aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--library/cropperjs/.babelrc19
-rw-r--r--library/cropperjs/.eslintrc19
-rw-r--r--library/cropperjs/.gitattributes2
-rw-r--r--library/cropperjs/.github/CODE_OF_CONDUCT.md13
-rw-r--r--library/cropperjs/.github/CONTRIBUTING.md201
-rw-r--r--library/cropperjs/.github/ISSUE_TEMPLATE/bug_report.md38
-rw-r--r--library/cropperjs/.github/ISSUE_TEMPLATE/feature_request.md20
-rw-r--r--library/cropperjs/.github/PULL_REQUEST_TEMPLATE.md47
-rw-r--r--library/cropperjs/.gitignore4
-rw-r--r--library/cropperjs/.stylelintrc10
-rw-r--r--library/cropperjs/.travis.yml6
-rw-r--r--library/cropperjs/CHANGELOG.md100
-rw-r--r--library/cropperjs/CONTRIBUTING.md35
-rw-r--r--library/cropperjs/ISSUE_TEMPLATE.md21
-rw-r--r--library/cropperjs/LICENSE2
-rw-r--r--library/cropperjs/README.md214
-rw-r--r--library/cropperjs/dist/cropper.common.js2022
-rw-r--r--library/cropperjs/dist/cropper.css44
-rw-r--r--library/cropperjs/dist/cropper.esm.js2022
-rw-r--r--library/cropperjs/dist/cropper.js6090
-rw-r--r--library/cropperjs/dist/cropper.min.css10
-rw-r--r--library/cropperjs/dist/cropper.min.js10
-rw-r--r--library/cropperjs/docs/css/cropper.css44
-rw-r--r--library/cropperjs/docs/css/main.css56
-rw-r--r--library/cropperjs/docs/examples/a-range-of-aspect-ratio.html (renamed from library/cropperjs/examples/a-range-of-aspect-ratio.html)13
-rw-r--r--library/cropperjs/docs/examples/crop-a-round-image.html94
-rw-r--r--library/cropperjs/docs/examples/crop-cross-origin-image.html (renamed from library/cropperjs/examples/crop-cross-origin-image.html)7
-rw-r--r--library/cropperjs/docs/examples/crop-on-canvas.html (renamed from library/cropperjs/examples/crop-on-canvas.html)10
-rw-r--r--library/cropperjs/docs/examples/cropper-in-modal.html (renamed from library/cropperjs/examples/cropper-in-modal.html)20
-rw-r--r--library/cropperjs/docs/examples/customize-preview.html (renamed from library/cropperjs/examples/customize-preview.html)17
-rw-r--r--library/cropperjs/docs/examples/fixed-crop-box.html (renamed from library/cropperjs/examples/fixed-crop-box.html)10
-rw-r--r--library/cropperjs/docs/examples/full-crop-box.html (renamed from library/cropperjs/examples/full-crop-box.html)10
-rw-r--r--library/cropperjs/docs/examples/mask-an-image.html108
-rw-r--r--library/cropperjs/docs/examples/minimum-and-maximum-cropped-dimensions.html81
-rw-r--r--library/cropperjs/docs/examples/multiple-croppers.html (renamed from library/cropperjs/examples/multiple-croppers.html)12
-rw-r--r--library/cropperjs/docs/examples/one-to-one-crop-box.html70
-rw-r--r--library/cropperjs/docs/examples/responsive-container.html (renamed from library/cropperjs/examples/responsive-container.html)12
-rw-r--r--library/cropperjs/docs/examples/upload-cropped-image-to-server.html176
-rw-r--r--library/cropperjs/docs/index.html90
-rw-r--r--library/cropperjs/docs/js/cropper.js6090
-rw-r--r--library/cropperjs/docs/js/main.js7
-rw-r--r--library/cropperjs/examples/crop-a-round-image.html103
-rw-r--r--library/cropperjs/examples/mask-an-image.html123
-rw-r--r--library/cropperjs/package-lock.json16021
-rw-r--r--library/cropperjs/package.json154
-rw-r--r--library/cropperjs/postcss.config.js14
-rw-r--r--library/cropperjs/rollup.config.js45
-rw-r--r--library/cropperjs/src/css/cropper.css46
-rw-r--r--library/cropperjs/src/css/cropper.scss286
-rw-r--r--library/cropperjs/src/index.css1
-rw-r--r--library/cropperjs/src/index.js3
-rw-r--r--library/cropperjs/src/index.scss1
-rw-r--r--library/cropperjs/src/js/change.js128
-rw-r--r--library/cropperjs/src/js/constants.js34
-rw-r--r--library/cropperjs/src/js/cropper.js275
-rw-r--r--library/cropperjs/src/js/defaults.js7
-rw-r--r--library/cropperjs/src/js/events.js21
-rw-r--r--library/cropperjs/src/js/handlers.js100
-rw-r--r--library/cropperjs/src/js/methods.js156
-rw-r--r--library/cropperjs/src/js/preview.js66
-rw-r--r--library/cropperjs/src/js/render.js65
-rw-r--r--library/cropperjs/src/js/template.js50
-rw-r--r--library/cropperjs/src/js/utilities.js524
-rw-r--r--library/cropperjs/test/css/main.css9
-rw-r--r--library/cropperjs/test/events/crop.js21
-rw-r--r--library/cropperjs/test/events/cropend.js24
-rw-r--r--library/cropperjs/test/events/cropmove.js24
-rw-r--r--library/cropperjs/test/events/cropstart.js56
-rw-r--r--library/cropperjs/test/events/ready.js15
-rw-r--r--library/cropperjs/test/events/zoom.js46
-rw-r--r--library/cropperjs/test/helpers.js46
-rw-r--r--library/cropperjs/test/index.html90
-rw-r--r--library/cropperjs/test/js/main.js74
-rw-r--r--library/cropperjs/test/karma.conf.js46
-rw-r--r--library/cropperjs/test/methods/clear.js29
-rw-r--r--library/cropperjs/test/methods/crop.js24
-rw-r--r--library/cropperjs/test/methods/destroy.js22
-rw-r--r--library/cropperjs/test/methods/disable.js60
-rw-r--r--library/cropperjs/test/methods/enable.js23
-rw-r--r--library/cropperjs/test/methods/getCanvasData.js23
-rw-r--r--library/cropperjs/test/methods/getContainerData.js19
-rw-r--r--library/cropperjs/test/methods/getCropBoxData.js21
-rw-r--r--library/cropperjs/test/methods/getCroppedCanvas.js33
-rw-r--r--library/cropperjs/test/methods/getData.js46
-rw-r--r--library/cropperjs/test/methods/getImageData.js31
-rw-r--r--library/cropperjs/test/methods/move.js20
-rw-r--r--library/cropperjs/test/methods/moveTo.js19
-rw-r--r--library/cropperjs/test/methods/replace.js23
-rw-r--r--library/cropperjs/test/methods/reset.js35
-rw-r--r--library/cropperjs/test/methods/rotate.js19
-rw-r--r--library/cropperjs/test/methods/rotateTo.js20
-rw-r--r--library/cropperjs/test/methods/scale.js19
-rw-r--r--library/cropperjs/test/methods/scaleX.js18
-rw-r--r--library/cropperjs/test/methods/scaleY.js18
-rw-r--r--library/cropperjs/test/methods/setAspectRatio.js20
-rw-r--r--library/cropperjs/test/methods/setCanvasData.js34
-rw-r--r--library/cropperjs/test/methods/setCropBoxData.js36
-rw-r--r--library/cropperjs/test/methods/setData.js36
-rw-r--r--library/cropperjs/test/methods/setDragMode.js27
-rw-r--r--library/cropperjs/test/methods/zoom.js20
-rw-r--r--library/cropperjs/test/methods/zoomTo.js21
-rw-r--r--library/cropperjs/test/options/aspectRatio.js39
-rw-r--r--library/cropperjs/test/options/autoCrop.js39
-rw-r--r--library/cropperjs/test/options/background.js40
-rw-r--r--library/cropperjs/test/options/center.js41
-rw-r--r--library/cropperjs/test/options/checkCrossOrigin.js67
-rw-r--r--library/cropperjs/test/options/checkOrientation.js43
-rw-r--r--library/cropperjs/test/options/crop.js21
-rw-r--r--library/cropperjs/test/options/cropBoxMovable.js41
-rw-r--r--library/cropperjs/test/options/cropBoxResizable.js65
-rw-r--r--library/cropperjs/test/options/cropend.js24
-rw-r--r--library/cropperjs/test/options/cropmove.js24
-rw-r--r--library/cropperjs/test/options/cropstart.js56
-rw-r--r--library/cropperjs/test/options/data.js35
-rw-r--r--library/cropperjs/test/options/dragMode.js60
-rw-r--r--library/cropperjs/test/options/guides.js43
-rw-r--r--library/cropperjs/test/options/highlight.js41
-rw-r--r--library/cropperjs/test/options/minCanvasHeight.js23
-rw-r--r--library/cropperjs/test/options/minCanvasWidth.js23
-rw-r--r--library/cropperjs/test/options/minContainerHeight.js21
-rw-r--r--library/cropperjs/test/options/minContainerWidth.js21
-rw-r--r--library/cropperjs/test/options/minCropBoxHeight.js23
-rw-r--r--library/cropperjs/test/options/minCropBoxWidth.js23
-rw-r--r--library/cropperjs/test/options/modal.js39
-rw-r--r--library/cropperjs/test/options/movable.js45
-rw-r--r--library/cropperjs/test/options/ready.js15
-rw-r--r--library/cropperjs/test/options/rotatable.js39
-rw-r--r--library/cropperjs/test/options/scalable.js43
-rw-r--r--library/cropperjs/test/options/toggleDragModeOnDblclick.js45
-rw-r--r--library/cropperjs/test/options/viewMode.js100
-rw-r--r--library/cropperjs/test/options/zoom.js46
-rw-r--r--library/cropperjs/test/options/zoomOnWheel.js47
-rw-r--r--library/cropperjs/test/options/zoomable.js51
-rw-r--r--library/cropperjs/test/specs/Cropper.spec.js11
-rw-r--r--library/cropperjs/test/specs/events/crop.spec.js30
-rw-r--r--library/cropperjs/test/specs/events/cropend.spec.js47
-rw-r--r--library/cropperjs/test/specs/events/cropmove.spec.js71
-rw-r--r--library/cropperjs/test/specs/events/cropstart.spec.js75
-rw-r--r--library/cropperjs/test/specs/events/ready.spec.js26
-rw-r--r--library/cropperjs/test/specs/events/zoom.spec.js56
-rw-r--r--library/cropperjs/test/specs/methods/clear.spec.js37
-rw-r--r--library/cropperjs/test/specs/methods/crop.spec.js50
-rw-r--r--library/cropperjs/test/specs/methods/destroy.spec.js30
-rw-r--r--library/cropperjs/test/specs/methods/disable.spec.js278
-rw-r--r--library/cropperjs/test/specs/methods/enable.spec.js16
-rw-r--r--library/cropperjs/test/specs/methods/getCanvasData.spec.js27
-rw-r--r--library/cropperjs/test/specs/methods/getContainerData.spec.js23
-rw-r--r--library/cropperjs/test/specs/methods/getCropBoxData.spec.js25
-rw-r--r--library/cropperjs/test/specs/methods/getCroppedCanvas.spec.js195
-rw-r--r--library/cropperjs/test/specs/methods/getData.spec.js91
-rw-r--r--library/cropperjs/test/specs/methods/getImageData.spec.js62
-rw-r--r--library/cropperjs/test/specs/methods/move.spec.js31
-rw-r--r--library/cropperjs/test/specs/methods/moveTo.spec.js29
-rw-r--r--library/cropperjs/test/specs/methods/noConflict.spec.js16
-rw-r--r--library/cropperjs/test/specs/methods/replace.spec.js17
-rw-r--r--library/cropperjs/test/specs/methods/reset.spec.js30
-rw-r--r--library/cropperjs/test/specs/methods/rotate.spec.js27
-rw-r--r--library/cropperjs/test/specs/methods/rotateTo.spec.js28
-rw-r--r--library/cropperjs/test/specs/methods/scale.spec.js29
-rw-r--r--library/cropperjs/test/specs/methods/scaleX.spec.js27
-rw-r--r--library/cropperjs/test/specs/methods/scaleY.spec.js27
-rw-r--r--library/cropperjs/test/specs/methods/setAspectRatio.spec.js31
-rw-r--r--library/cropperjs/test/specs/methods/setCanvasData.spec.js39
-rw-r--r--library/cropperjs/test/specs/methods/setCropBoxData.spec.js39
-rw-r--r--library/cropperjs/test/specs/methods/setData.spec.js71
-rw-r--r--library/cropperjs/test/specs/methods/setDefaults.spec.js30
-rw-r--r--library/cropperjs/test/specs/methods/setDragMode.spec.js29
-rw-r--r--library/cropperjs/test/specs/methods/zoom.spec.js31
-rw-r--r--library/cropperjs/test/specs/methods/zoomTo.spec.js33
-rw-r--r--library/cropperjs/test/specs/options/aspectRatio.spec.js24
-rw-r--r--library/cropperjs/test/specs/options/autoCrop.spec.js29
-rw-r--r--library/cropperjs/test/specs/options/autoCropArea.spec.js35
-rw-r--r--library/cropperjs/test/specs/options/background.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/center.spec.js31
-rw-r--r--library/cropperjs/test/specs/options/checkCrossOrigin.spec.js49
-rw-r--r--library/cropperjs/test/specs/options/checkOrientation.spec.js45
-rw-r--r--library/cropperjs/test/specs/options/crop.spec.js28
-rw-r--r--library/cropperjs/test/specs/options/cropBoxMovable.spec.js31
-rw-r--r--library/cropperjs/test/specs/options/cropBoxResizable.spec.js31
-rw-r--r--library/cropperjs/test/specs/options/cropend.spec.js35
-rw-r--r--library/cropperjs/test/specs/options/cropmove.spec.js57
-rw-r--r--library/cropperjs/test/specs/options/cropstart.spec.js61
-rw-r--r--library/cropperjs/test/specs/options/data.spec.js40
-rw-r--r--library/cropperjs/test/specs/options/dragMode.spec.js41
-rw-r--r--library/cropperjs/test/specs/options/guides.spec.js31
-rw-r--r--library/cropperjs/test/specs/options/highlight.spec.js31
-rw-r--r--library/cropperjs/test/specs/options/initialAspectRatio.spec.js40
-rw-r--r--library/cropperjs/test/specs/options/minCanvasHeight.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/minCanvasWidth.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/minContainerHeight.spec.js26
-rw-r--r--library/cropperjs/test/specs/options/minContainerWidth.spec.js26
-rw-r--r--library/cropperjs/test/specs/options/minCropBoxHeight.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/minCropBoxWidth.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/modal.spec.js27
-rw-r--r--library/cropperjs/test/specs/options/movable.spec.js35
-rw-r--r--library/cropperjs/test/specs/options/preview.spec.js105
-rw-r--r--library/cropperjs/test/specs/options/ready.spec.js34
-rw-r--r--library/cropperjs/test/specs/options/responsive.spec.js61
-rw-r--r--library/cropperjs/test/specs/options/restore.spec.js38
-rw-r--r--library/cropperjs/test/specs/options/rotatable.spec.js28
-rw-r--r--library/cropperjs/test/specs/options/scalable.spec.js33
-rw-r--r--library/cropperjs/test/specs/options/toggleDragModeOnDblclick.spec.js40
-rw-r--r--library/cropperjs/test/specs/options/viewMode.spec.js89
-rw-r--r--library/cropperjs/test/specs/options/wheelZoomRatio.spec.js38
-rw-r--r--library/cropperjs/test/specs/options/zoom.spec.js46
-rw-r--r--library/cropperjs/test/specs/options/zoomOnTouch.spec.js176
-rw-r--r--library/cropperjs/test/specs/options/zoomOnWheel.spec.js34
-rw-r--r--library/cropperjs/test/specs/options/zoomable.spec.js35
-rw-r--r--library/cropperjs/types/index.d.ts164
-rwxr-xr-xview/tpl/crophead.tpl4
210 files changed, 23891 insertions, 18185 deletions
diff --git a/library/cropperjs/.babelrc b/library/cropperjs/.babelrc
index 6909c9dc9..c67071221 100644
--- a/library/cropperjs/.babelrc
+++ b/library/cropperjs/.babelrc
@@ -1,10 +1,17 @@
{
"presets": [
- ["env", {
- "modules": false,
- "targets": {
- "browsers": ["last 2 versions", "ie >= 9"]
+ [
+ "@babel/preset-env",
+ {
+ "modules": false
}
- }]
- ]
+ ]
+ ],
+ "env": {
+ "test": {
+ "plugins": [
+ "istanbul"
+ ]
+ }
+ }
}
diff --git a/library/cropperjs/.eslintrc b/library/cropperjs/.eslintrc
index 8757045b6..7ecbe0dc0 100644
--- a/library/cropperjs/.eslintrc
+++ b/library/cropperjs/.eslintrc
@@ -3,11 +3,28 @@
"env": {
"browser": true
},
+ "root": true,
"rules": {
"no-param-reassign": "off",
"no-restricted-properties": "off",
"valid-jsdoc": ["error", {
"requireReturn": false
}]
- }
+ },
+ "overrides": [
+ {
+ "files": "test/**/*.spec.js",
+ "env": {
+ "mocha": true
+ },
+ "globals": {
+ "Cropper": true,
+ "expect": true
+ },
+ "rules": {
+ "no-new": "off",
+ "no-unused-expressions": "off"
+ }
+ }
+ ]
}
diff --git a/library/cropperjs/.gitattributes b/library/cropperjs/.gitattributes
new file mode 100644
index 000000000..dfe077042
--- /dev/null
+++ b/library/cropperjs/.gitattributes
@@ -0,0 +1,2 @@
+# Auto detect text files and perform LF normalization
+* text=auto
diff --git a/library/cropperjs/.github/CODE_OF_CONDUCT.md b/library/cropperjs/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..760ee26d2
--- /dev/null
+++ b/library/cropperjs/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,13 @@
+# Contributor Code of Conduct
+
+As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
+
+We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
+
+Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
+
+This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html
diff --git a/library/cropperjs/.github/CONTRIBUTING.md b/library/cropperjs/.github/CONTRIBUTING.md
new file mode 100644
index 000000000..a75dec824
--- /dev/null
+++ b/library/cropperjs/.github/CONTRIBUTING.md
@@ -0,0 +1,201 @@
+# Contributing to Cropper.js
+
+> Based on [Angular's contributing guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md).
+
+We would love for you to contribute to Cropper.js and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow:
+
+- [Code of Conduct](#code-of-conduct)
+- [Question or Problem](#question-or-problem)
+- [Issues and Bugs](#issues-and-bugs)
+- [Feature Requests](#feature-requests)
+- [Submission Guidelines](#submission-guidelines)
+- [Coding Rules](#coding-rules)
+- [Commit Message Guidelines](#commit-message-guidelines)
+
+## Code of Conduct
+
+Help us keep Cropper.js open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
+
+## Question or Problem
+
+Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Stack Overflow](https://stackoverflow.com/questions/tagged/cropperjs) where the questions should be tagged with tag `cropperjs`.
+
+Stack Overflow is a much better place to ask questions since:
+
+- There are thousands of people willing to help on Stack Overflow.
+- Questions and answers stay available for public viewing so your question / answer might help someone else.
+- Stack Overflow's voting system assures that the best answers are prominently visible.
+
+To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
+
+## Issues and Bugs
+
+If you find a bug in the source code, you can help us by [submitting an issue](#submitting-an-issue) to our [GitHub Repository](https://github.com/fengyuanchen/cropperjs). Even better, you can [submit a Pull Request](#submitting-a-pull-request-pr) with a fix.
+
+## Feature Requests
+
+You can *request* a new feature by [submitting an issue](#submitting-an-issue) to our [GitHub Repository](https://github.com/fengyuanchen/cropperjs). If you would like to *implement* a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it.
+
+Please consider what kind of change it is:
+
+- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
+- **Small Features** can be crafted and directly [submitted as a Pull Request](#submitting-a-pull-request-pr).
+
+## Submission Guidelines
+
+### Submitting an Issue
+
+Before you submit an issue, please search the [issue tracker](https://github.com/fengyuanchen/cropperjs/issues), maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
+
+We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs we will systematically ask you to provide a minimal reproduction scenario using [CodePen](https://codepen.io/pen). Having a live, reproducible scenario gives us wealth of important information without going back & forth to you with additional questions like:
+
+- version of Cropper.js used
+- 3rd-party libraries and their versions
+- and most importantly - a use-case that fails
+
+A minimal reproduce scenario using [CodePen](https://codepen.io/pen) allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If [CodePen](https://codepen.io/pen) is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.
+
+We will be insisting on a minimal reproduce scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience users often find coding problems themselves while preparing a minimal reproduce scenario. We understand that sometimes it might be hard to extract essentials bits of code from a larger code-base but we really need to isolate the problem before we can fix it.
+
+Unfortunately we are not able to investigate / fix bugs without a minimal reproduce scenario, so if we don't hear back from you we are going to close an issue that don't have enough info to be reproduced.
+
+You can file new issues by filling out our [new issue form](https://github.com/fengyuanchen/cropperjs/issues/new).
+
+### Submitting a Pull Request (PR)
+
+Before you submit your Pull Request (PR) consider the following guidelines:
+
+1. Search [GitHub](https://github.com/fengyuanchen/cropperjs/pulls) for an open or closed PR that relates to your submission. You don't want to duplicate effort.
+1. Fork the **fengyuanchen/cropperjs** repo.
+1. Make your changes in a new git branch:
+
+ ```shell
+ git checkout -b my-fix-branch master
+ ```
+
+1. Create your patch, **including appropriate test cases**.
+1. Follow our [Coding Rules](#coding-rules).
+1. Run the full Cropper.js test suite, and ensure that all tests pass.
+1. Commit your changes using a descriptive commit message that follows our [Commit Message Guidelines](#commit-message-guidelines). Adherence to these guidelines is necessary because release notes are automatically generated from these messages.
+
+ ```shell
+ git commit -a
+ ```
+
+ Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
+1. Push your branch to GitHub:
+
+ ```shell
+ git push origin my-fix-branch
+ ```
+
+1. In GitHub, send a pull request to `cropperjs:master`.
+1. If we suggest changes then:
+ - Make the required updates.
+ - Re-run the Cropper.js test suites to ensure tests are still passing.
+ - Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
+
+ ```shell
+ git rebase master -i
+ git push -f
+ ```
+
+That's it! Thank you for your contribution!
+
+#### After your pull request is merged
+
+After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
+
+1. Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
+
+ ```shell
+ git push origin --delete my-fix-branch
+ ```
+
+1. Check out the master branch:
+
+ ```shell
+ git checkout master -f
+ ```
+
+1. Delete the local branch:
+
+ ```shell
+ git branch -D my-fix-branch
+ ```
+
+1. Update your master with the latest upstream version:
+
+ ```shell
+ git pull --ff upstream master
+ ```
+
+## Coding Rules
+
+To ensure consistency throughout the source code, keep these rules in mind as you are working:
+
+- All features or bug fixes **must be tested** by one or more specs (unit-tests).
+- All public API methods **must be documented**.
+- We follow [Airbnb's JavaScript Style Guide](https://github.com/airbnb/javascript).
+
+## Commit Message Guidelines
+
+### Commit Message Format
+
+A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
+
+```
+<type>(<scope>): <subject>
+<BLANK LINE>
+<body>
+<BLANK LINE>
+<footer>
+```
+
+The **header** is mandatory and the **scope** of the header is optional.
+
+Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
+
+The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
+
+Here are some [samples](https://github.com/fengyuanchen/cropperjs/commits/master).
+
+### Revert
+
+If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
+
+### Type
+
+Must be one of the following:
+
+- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
+- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
+- **docs**: Documentation only changes
+- **feat**: A new feature
+- **fix**: A bug fix
+- **perf**: A code change that improves performance
+- **refactor**: A code change that neither fixes a bug nor adds a feature
+- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
+- **test**: Adding missing tests or correcting existing tests
+
+### Scope
+
+The scope could be anything specifying place of the commit change. For example `move`, `zoom`, `rotate`, etc...
+
+### Subject
+
+The subject contains succinct description of the change:
+
+- Use the imperative, present tense: "change" not "changed" nor "changes".
+- Don't capitalize first letter.
+- No dot (.) at the end.
+
+### Body
+
+Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
+
+### Footer
+
+The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
+
+**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
diff --git a/library/cropperjs/.github/ISSUE_TEMPLATE/bug_report.md b/library/cropperjs/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 000000000..dd84ea782
--- /dev/null
+++ b/library/cropperjs/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. iOS]
+ - Browser [e.g. chrome, safari]
+ - Version [e.g. 22]
+
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Browser [e.g. stock browser, safari]
+ - Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/library/cropperjs/.github/ISSUE_TEMPLATE/feature_request.md b/library/cropperjs/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 000000000..bbcbbe7d6
--- /dev/null
+++ b/library/cropperjs/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/library/cropperjs/.github/PULL_REQUEST_TEMPLATE.md b/library/cropperjs/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..5fdcf1095
--- /dev/null
+++ b/library/cropperjs/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,47 @@
+<!-- Please don't delete this template -->
+
+<!-- PULL REQUEST TEMPLATE -->
+<!-- (Update "[ ]" to "[x]" to check a box) -->
+
+**Summary**
+
+**What kind of change does this PR introduce?** (check at least one)
+
+- [ ] Bugfix
+- [ ] Feature
+- [ ] Code style update
+- [ ] Refactor
+- [ ] Docs
+- [ ] Build-related changes
+- [ ] Other, please describe:
+
+If changing the UI of default theme, please provide the **before/after** screenshot:
+
+**Does this PR introduce a breaking change?** (check one)
+
+- [ ] Yes
+- [ ] No
+
+If yes, please describe the impact and migration path for existing applications:
+
+**The PR fulfills these requirements:**
+
+- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
+
+You have tested in the following browsers: (Providing a detailed version will be better.)
+
+- [ ] Chrome
+- [ ] Firefox
+- [ ] Safari
+- [ ] Edge
+- [ ] IE
+
+If adding a **new feature**, the PR's description includes:
+
+- [ ] A convincing reason for adding this feature
+- [ ] Related documents have been updated
+- [ ] Related tests have been updated
+
+To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it.
+
+**Other information:**
diff --git a/library/cropperjs/.gitignore b/library/cropperjs/.gitignore
new file mode 100644
index 000000000..f943c9ce4
--- /dev/null
+++ b/library/cropperjs/.gitignore
@@ -0,0 +1,4 @@
+*.local
+*.map
+coverage
+node_modules
diff --git a/library/cropperjs/.stylelintrc b/library/cropperjs/.stylelintrc
new file mode 100644
index 000000000..eacc08cb0
--- /dev/null
+++ b/library/cropperjs/.stylelintrc
@@ -0,0 +1,10 @@
+{
+ "extends": "stylelint-config-standard",
+ "plugins": [
+ "stylelint-order"
+ ],
+ "rules": {
+ "no-descending-specificity": null,
+ "order/properties-alphabetical-order": true
+ }
+}
diff --git a/library/cropperjs/.travis.yml b/library/cropperjs/.travis.yml
index de9b4ae30..93eb30737 100644
--- a/library/cropperjs/.travis.yml
+++ b/library/cropperjs/.travis.yml
@@ -1,7 +1,9 @@
language: node_js
-node_js:
- - "node"
+node_js: node
+cache: npm
script:
- npm run lint
- npm run build
- npm test
+after_success:
+ - npm run codecov
diff --git a/library/cropperjs/CHANGELOG.md b/library/cropperjs/CHANGELOG.md
index f0d54cd92..5cddd4875 100644
--- a/library/cropperjs/CHANGELOG.md
+++ b/library/cropperjs/CHANGELOG.md
@@ -1,5 +1,99 @@
# Changelog
+## 1.5.6 (Oct 4, 2019)
+
+- Improve event type determining for iOS 13+ (#571).
+
+## 1.5.5 (Aug 3, 2019)
+
+- Clone the image's `crossOrigin` attribute always even though the `checkCrossOrigin` is set to `false` (#535).
+- Improve browser environment detecting (#554).
+
+## 1.5.4 (Jul 20, 2019)
+
+- Avoid removing the events of the original image.
+- Avoid requesting any Data URLs by XMLHttpRequest for better performance (#526).
+- Add an `alt` attribute to all internal images for better accessibility (#548).
+- Transform `enum`s to `type`s from the definition files for TypeScript (#550).
+
+## 1.5.3 (Jul 10, 2019)
+
+- Compute the size of the image for all browsers that use WebKit as the layout engine in iOS devices, such as Safari and in-app browsers (#544).
+
+## 1.5.2 (Jun 30, 2019)
+
+- Alway add a timestamp to the URL of a cross-origin image (#519).
+
+## 1.5.1 (Mar 10, 2019)
+
+- Revert the minimum container width from `300` to `200`.
+- Revert the minimum container height from `150` to `100`.
+
+## 1.5.0 (Mar 10, 2019)
+
+- Add `passive: false` and `capture: true` to wheel event for better performance.
+- Improve touch event binding.
+- Ignore the pointer events are not triggered by the primary button.
+- Fix typed array spreading error in IE or Safari 9.
+- Fix the RegExp for the Safari browser detecting to ignore Chrome (#478).
+
+## 1.4.3 (Oct 24, 2018)
+
+- Ignore range error when the image does not have correct Exif information
+
+## 1.4.2 (Oct 15, 2018)
+
+- Read orientation only when it is a JPEG image.
+- Improve cropper instance storage to avoid side effect (#394).
+- Fix parameter error of `Object.assign` in iOS devices (#432).
+- Improve typed array loop for better performance (#435).
+
+## 1.4.1 (Jul 15, 2018)
+
+- Not to restrict the canvas position when it is not cropped.
+- Fix wrong crop box size in view mode 1 and 2 (#381).
+
+## 1.4.0 (Jun 1, 2018)
+
+- Added 1 new option: `initialAspectRatio`.
+- Improve the smoothness of crop box resizing.
+
+## 1.3.6 (May 20, 2018)
+
+- Check orientation only when both the `rotatable` and `scalable` options are set to `true`.
+- In case rounding off leads to extra 1px in right or bottom border we should round the top-left corner and the dimension (#343).
+
+## 1.3.5 (Apr 15, 2018)
+
+- Ensure the cloned image loads completely before trigger the `ready` event to avoid side effect (#303).
+- Add namespace to data attribute names (from `data-*` to `data-cropper-*`) to avoid side effect (#319).
+
+## 1.3.4 (Mar 31, 2018)
+
+- Compute destination sizes with image's aspect ratio when draw image (#326).
+
+## 1.3.3 (Mar 18, 2018)
+
+- Improve event binding.
+- Add missing `pivot` definition to `zoomTo` method (#320)
+
+## 1.3.2 (Mar 3, 2018)
+
+- Fix the bug of cropping image with orientation (#313).
+
+## 1.3.1 (Feb 28, 2018)
+
+- Add missing `width` and `height` definitions (#302).
+- Fix incorrect behavior of `viewMode: 2` (#304).
+- Fix the bug of multiple starts (#306).
+- Remove `browser` field from the `package.json` file (#307).
+
+## 1.3.0 (Feb 25, 2018)
+
+- Add type definition files for TypeScript.
+- Enhance the `preview` option to support `Array` and `NodeList`.
+- Fix incorrect cropped canvas sizes when max/min sizes provided.
+
## 1.2.2 (Jan 3, 2018)
- Fix incorrect image natural sizes in iOS Safari (#279).
@@ -31,12 +125,12 @@
- Added 4 new options to `getCroppedCanvas` method: `minWidth`, `minHeight`, `maxWidth` and `maxHeight`.
- Enhanced image scaling: the `scaleX` and `scaleY` values should only be `1` or `-1` before, but now they can be any numbers.
-- Improved crop box resizing behaviour in the northeast, northwest, southeast and southwest directions. (#222).
+- Improved crop box resizing behavior in the northeast, northwest, southeast and southwest directions. (#222).
## 1.0.0 (Sep 3, 2017)
- Fixed a bug of zoom out after cleared the crop box in view mode 1, 2 and 3 (#209).
-- Improve crop box resizing behaviour in the east, west, south and north directions (#222).
+- Improve crop box resizing behavior in the east, west, south and north directions (#222).
## 1.0.0-rc.3 (Jul 7, 2017)
@@ -99,7 +193,7 @@
## 0.7.1 (May 28, 2016)
-- Improved the rotate and scale transform behaviour.
+- Improved the rotate and scale transform behavior.
- Improved the `getCroppedCanvas` method (returns the whole canvas if it is not cropped).
- Check cross origin setting when load image by XMLHTTPRequest.
diff --git a/library/cropperjs/CONTRIBUTING.md b/library/cropperjs/CONTRIBUTING.md
deleted file mode 100644
index 7c31d7ab0..000000000
--- a/library/cropperjs/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Contributing to Cropper
-
-## How to report bugs
-
-### Make sure it is a Cropper bug
-
-Most bugs reported to our bug tracker are actually bugs in user code, not in Cropper code. Keep in mind that just because your code throws an error inside of Cropper, this does *not* mean the bug is a Cropper bug.
-
-Ask for help first in a discussion forum like [Stack Overflow](http://stackoverflow.com/). You will get much quicker support, and you will help avoid tying up the Cropper team with invalid bug reports.
-
-### Disable browser extensions
-
-Make sure you have reproduced the bug with all browser extensions and add-ons disabled, as these can sometimes cause things to break in interesting and unpredictable ways. Try using incognito, stealth or anonymous browsing modes.
-
-### Try the latest version of Cropper
-
-Bugs in old versions of Cropper may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest release](https://github.com/fengyuanchen/cropperjs/releases/latest). We cannot fix bugs in older released files, if a bug has been fixed in a subsequent version of Cropper the site should upgrade.
-
-### Simplify the test case
-
-When experiencing a problem, [reduce your code](http://webkit.org/quality/reduction.html) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible.
-
-### Search for related or duplicate issues
-
-Go to the [Cropper issue tracker](https://github.com/fengyuanchen/cropperjs/issues) and make sure the problem hasn't already been reported. If not, create a new issue there and include your test case.
-
-### Browser support
-
-Remember that Cropper supports multiple browsers and their versions; any contributed code must work in all of them. You can refer to the [browser support page](https://github.com/fengyuanchen/cropperjs/blob/master/README.md#browser-support) for the current list of supported browsers.
-
-## Notes for pull request
-
-- Run the test suites in the `test` directory first.
-- Don't modify any files in the `dist` directory.
-- Follow the same code style as the library.
diff --git a/library/cropperjs/ISSUE_TEMPLATE.md b/library/cropperjs/ISSUE_TEMPLATE.md
deleted file mode 100644
index 0ed98b61d..000000000
--- a/library/cropperjs/ISSUE_TEMPLATE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Before opening an issue:
-
-- [Search for duplicate or closed issues](https://github.com/fengyuanchen/cropperjs/issues?utf8=%E2%9C%93&q=is%3Aissue)
-- Prepare a [reduced test case](https://css-tricks.com/reduced-test-cases/) for any bugs
-- Read the [contributing guidelines](https://github.com/fengyuanchen/cropperjs/blob/master/CONTRIBUTING.md)
-
-When asking general "how to" questions:
-
-- Please do not open an issue here
-- Instead, ask for help on [StackOverflow](http://stackoverflow.com/)
-
-When reporting a bug, include:
-
-- Operating system and version (Windows, Mac OS X, Android, iOS, Win10 Mobile)
-- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
-- Reduced test cases and potential fixes using [JS Bin](https://jsbin.com), [JSFiddle](https://jsfiddle.net/) or [CodePen](https://codepen.io/)
-
-When suggesting a feature, include:
-
-- As much detail as possible for what we should add and why it's important to Cropper.js
-- Relevant links to prior art, screenshots, or live demos whenever possible
diff --git a/library/cropperjs/LICENSE b/library/cropperjs/LICENSE
index e9b8a22b3..4ca99accb 100644
--- a/library/cropperjs/LICENSE
+++ b/library/cropperjs/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015-present Chen Fengyuan
+Copyright 2015-present Chen Fengyuan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/library/cropperjs/README.md b/library/cropperjs/README.md
index 73e8dda30..6f1227f95 100644
--- a/library/cropperjs/README.md
+++ b/library/cropperjs/README.md
@@ -1,11 +1,12 @@
# Cropper.js
-[![Build Status](https://travis-ci.org/fengyuanchen/cropperjs.svg)](https://travis-ci.org/fengyuanchen/cropperjs) [![Downloads](https://img.shields.io/npm/dm/cropperjs.svg)](https://www.npmjs.com/package/cropperjs) [![Version](https://img.shields.io/npm/v/cropperjs.svg)](https://www.npmjs.com/package/cropperjs)
+[![Build Status](https://img.shields.io/travis/fengyuanchen/cropperjs.svg)](https://travis-ci.org/fengyuanchen/cropperjs) [![Downloads](https://img.shields.io/npm/dm/cropperjs.svg)](https://www.npmjs.com/package/cropperjs) [![Version](https://img.shields.io/npm/v/cropperjs.svg)](https://www.npmjs.com/package/cropperjs)
> JavaScript image cropper.
- [Website](https://fengyuanchen.github.io/cropperjs)
- [Photo Editor](https://fengyuanchen.github.io/photo-editor) - An advanced example of Cropper.js.
+- [jquery-cropper](https://github.com/fengyuanchen/jquery-cropper) - A jQuery plugin wrapper for Cropper.js.
## Table of contents
@@ -23,7 +24,7 @@
## Features
-- Supports 38 [options](#options)
+- Supports 39 [options](#options)
- Supports 27 [methods](#methods)
- Supports 6 [events](#events)
- Supports touch (mobile)
@@ -32,7 +33,7 @@
- Supports scaling (flipping)
- Supports multiple croppers
- Supports to crop on a canvas
-- Supports to crop image in the browser-side by canvas
+- Supports to crop an image in the browser-side by canvas
- Supports to translate Exif Orientation information
- Cross-browser support
@@ -56,7 +57,7 @@ dist/
npm install cropperjs
```
-Include files:
+In browser:
```html
<link href="/path/to/cropper.css" rel="stylesheet">
@@ -67,11 +68,21 @@ The [cdnjs](https://github.com/cdnjs/cdnjs) provides CDN support for Cropper.js'
### Usage
-Initialize with `Cropper` constructor:
+#### Syntax
-- Browser: `window.Cropper`
-- CommonJS: `var Cropper = require('cropperjs')`
-- ES2015: `import Cropper from 'cropperjs'`
+```js
+new Cropper(element[, options])
+```
+
+- **element**
+ - Type: `HTMLImageElement` or `HTMLCanvasElement`
+ - The target image or canvas element for cropping.
+
+- **options** (optional)
+ - Type: `Object`
+ - The options for cropping. Check out the available [options](#options).
+
+#### Example
```html
<!-- Wrap the image or canvas element with a block element (container) -->
@@ -88,18 +99,21 @@ img {
```
```js
-var image = document.getElementById('image');
-var cropper = new Cropper(image, {
+// import 'cropperjs/dist/cropper.css';
+import Cropper from 'cropperjs';
+
+const image = document.getElementById('image');
+const cropper = new Cropper(image, {
aspectRatio: 16 / 9,
- crop: function(e) {
- console.log(e.detail.x);
- console.log(e.detail.y);
- console.log(e.detail.width);
- console.log(e.detail.height);
- console.log(e.detail.rotate);
- console.log(e.detail.scaleX);
- console.log(e.detail.scaleY);
- }
+ crop(event) {
+ console.log(event.detail.x);
+ console.log(event.detail.y);
+ console.log(event.detail.width);
+ console.log(event.detail.height);
+ console.log(event.detail.rotate);
+ console.log(event.detail.scaleX);
+ console.log(event.detail.scaleY);
+ },
});
```
@@ -109,7 +123,7 @@ How to crop a new area after zoom in or zoom out?
> Just double click your mouse to enter crop mode.
-How to move the image after crop an area?
+How to move the image after cropping an area?
> Just double click your mouse to enter move mode.
@@ -124,17 +138,17 @@ How to crop a square area in free ratio mode?
#### Notes
- The size of the cropper inherits from the size of the image's parent element (wrapper), so be sure to wrap the image with a **visible block element**.
- > If you are using cropper in a modal, you should initialize the cropper after the modal shown completely. Otherwise, you will not get a correct cropper.
+ > If you are using cropper in a modal, you should initialize the cropper after the modal is shown completely. Otherwise, you will not get the correct cropper.
-- The outputted cropped data bases on the original image size, so you can use them to crop the image directly.
+- The outputted cropped data is based on the original image size, so you can use them to crop the image directly.
- If you try to start cropper on a cross-origin image, please make sure that your browser supports HTML5 [CORS settings attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes), and your image server supports the `Access-Control-Allow-Origin` option (see the [HTTP access control (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)).
#### Known issues
-- [Known iOS resource limits](https://developer.apple.com/library/mac/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html): As iOS devices limit memory, the browser may crash when you are cropping a large image (iPhone camera resolution). To avoid this, you may resize the image first (preferably below 1024 pixels) before start a cropper.
+- [Known iOS resource limits](https://developer.apple.com/library/mac/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html): As iOS devices limit memory, the browser may crash when you are cropping a large image (iPhone camera resolution). To avoid this, you may resize the image first (preferably below 1024 pixels) before starting a cropper.
-- Known image size increase: When export the cropped image on browser-side with the `HTMLCanvasElement.toDataURL` method, the size of the exported image may be greater than the original image's. This is because the type of the exported image is not the same as the original image's. So just pass the type the original image's as the first parameter to `toDataURL` to fix this. For example, if the original type is JPEG, then use `cropper.getCroppedCanvas().toDataURL('image/jpeg')` to export image.
+- Known image size increase: When exporting the cropped image on browser-side with the `HTMLCanvasElement.toDataURL` method, the size of the exported image may be greater than the original image's. This is because the type of the exported image is not the same as the original image's. So just pass the type the original image's as the first parameter to `toDataURL` to fix this. For example, if the original type is JPEG, then use `cropper.getCroppedCanvas().toDataURL('image/jpeg')` to export image.
[⬆ back to top](#table-of-contents)
@@ -150,7 +164,7 @@ If you want to change the global default options, You may use `Cropper.setDefaul
- Options:
- `0`: no restrictions
- `1`: restrict the crop box to not exceed the size of the canvas.
- - `2`: restrict the minimum canvas size to fit within the container. If the proportions of the the canvas and the container differ, the minimum canvas will be surrounded by extra space in one of the dimensions.
+ - `2`: restrict the minimum canvas size to fit within the container. If the proportions of the canvas and the container differ, the minimum canvas will be surrounded by extra space in one of the dimensions.
- `3`: restrict the minimum canvas size to fill fit the container. If the proportions of the canvas and the container are different, the container will not be able to fit the whole canvas in one of the dimensions.
Define the view mode of the cropper. If you set `viewMode` to `0`, the crop box can extend outside the canvas, while a value of `1`, `2` or `3` will restrict the crop box to the size of the canvas. A `viewMode` of `2` or `3` will additionally restrict the canvas to the container. Note that if the proportions of the canvas and the container are the same, there is no difference between `2` and `3`.
@@ -166,48 +180,57 @@ Define the view mode of the cropper. If you set `viewMode` to `0`, the crop box
Define the dragging mode of the cropper.
+### initialAspectRatio
+
+- Type: `Number`
+- Default: `NaN`
+
+Define the initial aspect ratio of the crop box. By default, it is the same as the aspect ratio of the canvas (image wrapper).
+
+> Only available when the `aspectRatio` option is set to `NaN`.
+
### aspectRatio
- Type: `Number`
- Default: `NaN`
-Set the aspect ratio of the crop box. By default, the crop box is free ratio.
+Define the fixed aspect ratio of the crop box. By default, the crop box is free ratio.
### data
- Type: `Object`
- Default: `null`
-The previous cropped data if you had stored, will be passed to `setData` method automatically when built.
+The previous cropped data if you had stored, will be passed to `setData` method automatically when initialized. Only available when the `autoCrop` option is set to `true`.
### preview
-- Type: `Element` or `String`
+- Type: `Element`, `Array` (elements), `NodeList` or `String` (selector)
- Default: `''`
-- An element or A valid selector for [Document.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll)
+- An element or an array of elements or a node list object or a valid selector for [Document.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll)
-Add extra elements (containers) for previewing.
+Add extra elements (containers) for preview.
**Notes:**
-- The maximum width is the initial width of preview container.
-- The maximum height is the initial height of preview container.
+- The maximum width is the initial width of the preview container.
+- The maximum height is the initial height of the preview container.
- If you set an `aspectRatio` option, be sure to set the same aspect ratio to the preview container.
-- If preview is not getting properly displayed, set `overflow: hidden` style to the preview container.
+- If the preview is not getting properly displayed, set `overflow: hidden` style to the preview container.
### responsive
- Type: `Boolean`
- Default: `true`
-Re-render the cropper when resize the window.
+Re-render the cropper when resizing the window.
### restore
- Type: `Boolean`
- Default: `true`
-Restore the cropped area after resize the window.
+Restore the cropped area after resizing the window.
### checkCrossOrigin
@@ -218,7 +241,7 @@ Check if the current image is a cross-origin image.
If it is, when clone the image, a `crossOrigin` attribute will be added to the cloned image element and a timestamp will be added to the `src` attribute to reload the source image to avoid browser cache error.
-By adding `crossOrigin` attribute to image will stop adding timestamp to image url and stop reload of image, but the request (XMLHttpRequest) to read the image data for orientation checking will require a timestamp now.
+By adding `crossOrigin` attribute to image element will stop adding timestamp to image URL and stop reload of image, but the request (XMLHttpRequest) to read the image data for orientation checking will require a timestamp to bust cache to avoid browser cache error now, you can set the `checkOrientation` option to `false` to cancel this request.
If the value of the image's `crossOrigin` attribute is `"use-credentials"`, then the `withCredentials` attribute will set to `true` when read the image data by XMLHttpRequest.
@@ -227,7 +250,7 @@ If the value of the image's `crossOrigin` attribute is `"use-credentials"`, then
- Type: `Boolean`
- Default: `true`
-Check the current image's Exif Orientation information.
+Check the current image's Exif Orientation information. Note that only a JPEG image may contains Exif Orientation information.
More exactly, read the Orientation value for rotating or flipping the image, and then override the Orientation value with `1` (the default value) to avoid some issues ([1](https://github.com/fengyuanchen/cropper/issues/120), [2](https://github.com/fengyuanchen/cropper/issues/509)) on iOS devices.
@@ -277,7 +300,7 @@ Show the grid background of the container.
- Type: `Boolean`
- Default: `true`
-Enable to crop the image automatically when initialize.
+Enable to crop the image automatically when initialized.
### autoCropArea
@@ -333,7 +356,7 @@ Enable to zoom the image by wheeling mouse.
- Type: `Number`
- Default: `0.1`
-Define zoom ratio when zoom the image by wheeling mouse.
+Define zoom ratio when zooming the image by wheeling mouse.
### cropBoxMovable
@@ -354,7 +377,9 @@ Enable to resize the crop box by dragging.
- Type: `Boolean`
- Default: `true`
-Enable to toggle drag mode between "crop" and "move" when click twice on the cropper.
+Enable to toggle drag mode between "crop" and "move" when clicking twice on the cropper.
+
+> Requires [`dblclick`](https://developer.mozilla.org/en-US/docs/Web/Events/dblclick) event support.
### minContainerWidth
@@ -407,60 +432,60 @@ The minimum height of the crop box.
- Type: `Function`
- Default: `null`
-A shortcut of the "ready" event.
+A shortcut of the `ready` event.
### cropstart
- Type: `Function`
- Default: `null`
-A shortcut of the "cropstart" event.
+A shortcut of the `cropstart` event.
### cropmove
- Type: `Function`
- Default: `null`
-A shortcut of the "cropmove" event.
+A shortcut of the `cropmove` event.
### cropend
- Type: `Function`
- Default: `null`
-A shortcut of the "cropend" event.
+A shortcut of the `cropend` event.
### crop
- Type: `Function`
- Default: `null`
-A shortcut of the "crop" event.
+A shortcut of the `crop` event.
### zoom
- Type: `Function`
- Default: `null`
-A shortcut of the "zoom" event.
+A shortcut of the `zoom` event.
[⬆ back to top](#table-of-contents)
## Methods
-As there is an **asynchronous** process when load the image, you **should call most of the methods after ready**, except "setAspectRatio", "replace" and "destroy".
+As there is an **asynchronous** process when loading the image, you **should call most of the methods after ready**, except "setAspectRatio", "replace" and "destroy".
> If a method doesn't need to return any value, it will return the cropper instance (`this`) for chain composition.
```js
new Cropper(image, {
- ready: function () {
+ ready() {
// this.cropper[method](argument1, , argument2, ..., argumentN);
this.cropper.move(1, -1);
// Allows chain composition
this.cropper.move(1, -1).rotate(45).scale(1, -1);
- }
+ },
});
```
@@ -471,13 +496,13 @@ Show the crop box manually.
```js
new Cropper(image, {
autoCrop: false,
- ready: function () {
+ ready() {
// Do something here
// ...
// And then
this.cropper.crop();
- }
+ },
});
```
@@ -489,16 +514,16 @@ Reset the image and crop box to their initial states.
Clear the crop box.
-### replace(url[, onlyColorChanged])
+### replace(url[, hasSameSize])
- **url**:
- Type: `String`
- A new image url.
-- **onlyColorChanged** (optional):
+- **hasSameSize** (optional):
- Type: `Boolean`
- - If only change the color, not the size, then the cropper only need to change the srcs of all related images, not need to rebuild the cropper. This can be used for applying filters.
- - If not present, its default value is `false`.
+ - Default: `false`
+ - If the new image has the same size as the old one, then it will not rebuild the cropper and only update the URLs of all related images. This can be used for applying filters.
Replace the image's src and rebuild the cropper.
@@ -613,7 +638,7 @@ Rotate the image to an absolute degree.
- **scaleX**:
- Type: `Number`
- Default: `1`
- - The scaling factor to apply on the abscissa of the image.
+ - The scaling factor to apply to the abscissa of the image.
- When equal to `1` it does nothing.
- **scaleY** (optional):
@@ -636,7 +661,7 @@ cropper.scale(1, -1); // Flip vertical
- **scaleX**:
- Type: `Number`
- Default: `1`
- - The scaling factor to apply on the abscissa of the image.
+ - The scaling factor to apply to the abscissa of the image.
- When equal to `1` it does nothing.
Scale the abscissa of the image.
@@ -672,9 +697,10 @@ Scale the ordinate of the image.
Output the final cropped area position and size data (base on the natural size of the original image).
> You can send the data to server-side to crop the image directly:
+>
> 1. Rotate the image with the `rotate` property.
-> 1. Scale the image with the `scaleX` and `scaleY` properties.
-> 1. Crop the image with the `x`, `y`, `width` and `height` properties.
+> 2. Scale the image with the `scaleX` and `scaleY` properties.
+> 3. Crop the image with the `x`, `y`, `width` and `height` properties.
![A schematic diagram for data's properties](docs/images/data.jpg)
@@ -687,7 +713,7 @@ Output the final cropped area position and size data (base on the natural size o
Change the cropped area position and size with new data (base on the original image).
-> **Note:** This method only available when the `viewMode` option great than or equal to `1`.
+> **Note:** This method only available when the value of the `viewMode` option is greater than or equal to `1`.
### getContainerData()
@@ -717,7 +743,7 @@ Output the container size data.
- `scaleX`: the scaling factor to apply on the abscissa of the image if scaled
- `scaleY`: the scaling factor to apply on the ordinate of the image if scaled
-Output the image position, size and other related data.
+Output the image position, size, and other related data.
### getCanvasData()
@@ -734,11 +760,12 @@ Output the image position, size and other related data.
Output the canvas (image wrapper) position and size data.
```js
-var imageData = cropper.getImageData();
-var canvasData = cropper.getCanvasData();
+const imageData = cropper.getImageData();
+const canvasData = cropper.getCanvasData();
if (imageData.rotate % 180 === 0) {
- console.log(canvasData.naturalWidth === imageData.naturalWidth); // true
+ console.log(canvasData.naturalWidth === imageData.naturalWidth);
+ // > true
}
```
@@ -798,15 +825,16 @@ Change the crop box position and size with new data.
- A canvas drawn the cropped image.
- Notes:
- - The aspect ratio of the output canvas will be fitted to aspect ratio of the crop box automatically.
+ - The aspect ratio of the output canvas will be fitted to the aspect ratio of the crop box automatically.
- If you intend to get a JPEG image from the output canvas, you should set the `fillColor` option first, if not, the transparent part in the JPEG image will become black by default.
+ - Uses the Browser's native [canvas.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) API to do the compression work, which means it is **lossy compression**. For better image quality, you can upload the original image and the cropped data to a server and do the crop work on the server.
- Browser support:
- Basic image: requires [Canvas](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement) support ([IE 9+](http://caniuse.com/canvas)).
- Rotated image: requires [CSS3 2D Transforms](https://developer.mozilla.org/en-US/docs/Web/CSS/transform) support ([IE 9+](http://caniuse.com/transforms2d)).
- Cross-origin image: requires HTML5 [CORS settings attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) support ([IE 11+](http://caniuse.com/cors)).
-Get a canvas drawn the cropped image. If it is not cropped, then returns a canvas drawn the whole image.
+Get a canvas drawn the cropped image (lossy compression). If it is not cropped, then returns a canvas drawn the whole image.
> After then, you can display the canvas as an image directly, or use [HTMLCanvasElement.toDataURL](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL) to get a Data URL, or use [HTMLCanvasElement.toBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob) to get a blob and upload it to server with [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) if the browser supports these APIs.
@@ -827,26 +855,28 @@ cropper.getCroppedCanvas({
imageSmoothingQuality: 'high',
});
-// Upload cropped image to server if the browser supports `HTMLCanvasElement.toBlob`
-cropper.getCroppedCanvas().toBlob(function (blob) {
- var formData = new FormData();
+// Upload cropped image to server if the browser supports `HTMLCanvasElement.toBlob`.
+// The default value for the second parameter of `toBlob` is 'image/png', change it if necessary.
+cropper.getCroppedCanvas().toBlob((blob) => {
+ const formData = new FormData();
- formData.append('croppedImage', blob);
+ // Pass the image file name as the third parameter if necessary.
+ formData.append('croppedImage', blob/*, 'example.png' */);
- // Use `jQuery.ajax` method
+ // Use `jQuery.ajax` method for example
$.ajax('/path/to/upload', {
method: "POST",
data: formData,
processData: false,
contentType: false,
- success: function () {
+ success() {
console.log('Upload success');
},
- error: function () {
+ error() {
console.log('Upload error');
- }
+ },
});
-});
+}/*, 'image/png' */);
```
### setAspectRatio(aspectRatio)
@@ -874,14 +904,14 @@ Change the drag mode.
### ready
-This event fires when the target image has been loaded and the cropper instance is ready for cropping.
+This event fires when the target image has been loaded and the cropper instance is ready for operating.
```js
-var cropper;
+let cropper;
image.addEventListener('ready', function () {
console.log(this.cropper === cropper);
- // -> true
+ // > true
});
cropper = new Cropper(image);
@@ -912,9 +942,9 @@ cropper = new Cropper(image);
This event fires when the canvas (image wrapper) or the crop box starts to change.
```js
-image.addEventListener('cropstart', function (e) {
- console.log(e.detail.originalEvent);
- console.log(e.detail.action);
+image.addEventListener('cropstart', (event) => {
+ console.log(event.detail.originalEvent);
+ console.log(event.detail.action);
});
```
@@ -952,6 +982,11 @@ This event fires when the canvas (image wrapper) or the crop box stops to change
This event fires when the canvas (image wrapper) or the crop box changed.
+**Notes:**
+
+- When the `autoCrop` option is set to `true`, a `crop` event will be triggered before the `ready` event.
+- When the `data` option is set, another `crop` event will be triggered before the `ready` event.
+
### zoom
- **event.detail.originalEvent**:
@@ -969,11 +1004,10 @@ This event fires when the canvas (image wrapper) or the crop box changed.
This event fires when a cropper instance starts to zoom in or zoom out its canvas (image wrapper).
```js
-image.addEventListener('zoom', function (e) {
-
+image.addEventListener('zoom', (event) => {
// Zoom in
- if (e.detail.ratio > e.detail.oldRatio) {
- e.preventDefault(); // Prevent zoom in
+ if (event.detail.ratio > event.detail.oldRatio) {
+ event.preventDefault(); // Prevent zoom in
}
// Zoom out
@@ -985,7 +1019,7 @@ image.addEventListener('zoom', function (e) {
## No conflict
-If you have to use other cropper with the same namespace, just call the `Cropper.noConflict` static method to revert to it.
+If you have to use another cropper with the same namespace, just call the `Cropper.noConflict` static method to revert to it.
```html
<script src="other-cropper.js"></script>
@@ -1007,21 +1041,21 @@ If you have to use other cropper with the same namespace, just call the `Cropper
## Contributing
-Please read through our [contributing guidelines](CONTRIBUTING.md).
+Please read through our [contributing guidelines](.github/CONTRIBUTING.md).
## Versioning
-Maintained under the [Semantic Versioning guidelines](http://semver.org/).
+Maintained under the [Semantic Versioning guidelines](https://semver.org/).
## License
-[MIT](http://opensource.org/licenses/MIT) © [Chen Fengyuan](http://chenfengyuan.com)
+[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com)
## Related projects
- [angular-cropperjs](https://github.com/matheusdavidson/angular-cropperjs) by @matheusdavidson
- [ember-cropperjs](https://github.com/danielthall/ember-cropperjs) by @danielthall
-- [iron-cropper](https://www.webcomponents.org/element/safetychanger/iron-cropper) (web component) by @safetychanger
+- [iron-cropper](https://github.com/safetychanger/iron-cropper) by @safetychanger
- [react-cropper](https://github.com/roadmanfong/react-cropper) by @roadmanfong
- [vue-cropperjs](https://github.com/Agontuk/vue-cropperjs) by @Agontuk
diff --git a/library/cropperjs/dist/cropper.common.js b/library/cropperjs/dist/cropper.common.js
index 38c62e824..84cd77cdd 100644
--- a/library/cropperjs/dist/cropper.common.js
+++ b/library/cropperjs/dist/cropper.common.js
@@ -1,19 +1,126 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:27:18.062Z
+ * Date: 2019-10-04T04:33:48.372Z
*/
'use strict';
-var WINDOW = typeof window !== 'undefined' ? window : {};
-var NAMESPACE = 'cropper';
+function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+}
+
+function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+}
+
+function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+}
+
+function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(source, true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(source).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
+}
+
+function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+}
+
+function _iterableToArray(iter) {
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
+}
+
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
+}
+
+var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+var WINDOW = IS_BROWSER ? window : {};
+var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+var NAMESPACE = 'cropper'; // Actions
-// Actions
var ACTION_ALL = 'all';
var ACTION_CROP = 'crop';
var ACTION_MOVE = 'move';
@@ -25,127 +132,107 @@ var ACTION_NORTH = 'n';
var ACTION_NORTH_EAST = 'ne';
var ACTION_NORTH_WEST = 'nw';
var ACTION_SOUTH_EAST = 'se';
-var ACTION_SOUTH_WEST = 'sw';
-
-// Classes
-var CLASS_CROP = NAMESPACE + '-crop';
-var CLASS_DISABLED = NAMESPACE + '-disabled';
-var CLASS_HIDDEN = NAMESPACE + '-hidden';
-var CLASS_HIDE = NAMESPACE + '-hide';
-var CLASS_INVISIBLE = NAMESPACE + '-invisible';
-var CLASS_MODAL = NAMESPACE + '-modal';
-var CLASS_MOVE = NAMESPACE + '-move';
-
-// Data keys
-var DATA_ACTION = 'action';
-var DATA_PREVIEW = 'preview';
-
-// Drag modes
+var ACTION_SOUTH_WEST = 'sw'; // Classes
+
+var CLASS_CROP = "".concat(NAMESPACE, "-crop");
+var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
+var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
+var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
+var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys
+
+var DATA_ACTION = "".concat(NAMESPACE, "Action");
+var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes
+
var DRAG_MODE_CROP = 'crop';
var DRAG_MODE_MOVE = 'move';
-var DRAG_MODE_NONE = 'none';
+var DRAG_MODE_NONE = 'none'; // Events
-// Events
var EVENT_CROP = 'crop';
var EVENT_CROP_END = 'cropend';
var EVENT_CROP_MOVE = 'cropmove';
var EVENT_CROP_START = 'cropstart';
var EVENT_DBLCLICK = 'dblclick';
-var EVENT_ERROR = 'error';
-var EVENT_LOAD = 'load';
-var EVENT_POINTER_DOWN = WINDOW.PointerEvent ? 'pointerdown' : 'touchstart mousedown';
-var EVENT_POINTER_MOVE = WINDOW.PointerEvent ? 'pointermove' : 'touchmove mousemove';
-var EVENT_POINTER_UP = WINDOW.PointerEvent ? 'pointerup pointercancel' : 'touchend touchcancel mouseup';
+var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
var EVENT_READY = 'ready';
var EVENT_RESIZE = 'resize';
-var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
-var EVENT_ZOOM = 'zoom';
+var EVENT_WHEEL = 'wheel';
+var EVENT_ZOOM = 'zoom'; // Mime types
+
+var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps
-// RegExps
-var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
+var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
var REGEXP_DATA_URL = /^data:/;
var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
-var REGEXP_TAG_NAME = /^(img|canvas)$/i;
+var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
+// Inspired by the default width and height of a canvas element.
+
+var MIN_CONTAINER_WIDTH = 200;
+var MIN_CONTAINER_HEIGHT = 100;
var DEFAULTS = {
// Define the view mode of the cropper
- viewMode: 0, // 0, 1, 2, 3
-
+ viewMode: 0,
+ // 0, 1, 2, 3
// Define the dragging mode of the cropper
- dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none'
-
+ dragMode: DRAG_MODE_CROP,
+ // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
// Define the aspect ratio of the crop box
aspectRatio: NaN,
-
// An object with the previous cropping result data
data: null,
-
// A selector for adding extra containers to preview
preview: '',
-
// Re-render the cropper when resize the window
responsive: true,
-
// Restore the cropped area after resize the window
restore: true,
-
// Check if the current image is a cross-origin image
checkCrossOrigin: true,
-
// Check the current image's Exif Orientation information
checkOrientation: true,
-
// Show the black modal
modal: true,
-
// Show the dashed lines for guiding
guides: true,
-
// Show the center indicator for guiding
center: true,
-
// Show the white modal to highlight the crop box
highlight: true,
-
// Show the grid background
background: true,
-
// Enable to crop the image automatically when initialize
autoCrop: true,
-
// Define the percentage of automatic cropping area when initializes
autoCropArea: 0.8,
-
// Enable to move the image
movable: true,
-
// Enable to rotate the image
rotatable: true,
-
// Enable to scale the image
scalable: true,
-
// Enable to zoom the image
zoomable: true,
-
// Enable to zoom the image by dragging touch
zoomOnTouch: true,
-
// Enable to zoom the image by wheeling mouse
zoomOnWheel: true,
-
// Define zoom ratio when zoom the image by wheeling mouse
wheelZoomRatio: 0.1,
-
// Enable to move the crop box
cropBoxMovable: true,
-
// Enable to resize the crop box
cropBoxResizable: true,
-
// Toggle drag mode between "crop" and "move" when click twice on the cropper
toggleDragModeOnDblclick: true,
-
// Size limitation
minCanvasWidth: 0,
minCanvasHeight: 0,
@@ -153,7 +240,6 @@ var DEFAULTS = {
minCropBoxHeight: 0,
minContainerWidth: 200,
minContainerHeight: 100,
-
// Shortcuts of events
ready: null,
cropstart: null,
@@ -163,132 +249,50 @@ var DEFAULTS = {
zoom: null
};
-var TEMPLATE = '<div class="cropper-container">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-action="e"></span>' + '<span class="cropper-line line-n" data-action="n"></span>' + '<span class="cropper-line line-w" data-action="w"></span>' + '<span class="cropper-line line-s" data-action="s"></span>' + '<span class="cropper-point point-e" data-action="e"></span>' + '<span class="cropper-point point-n" data-action="n"></span>' + '<span class="cropper-point point-w" data-action="w"></span>' + '<span class="cropper-point point-s" data-action="s"></span>' + '<span class="cropper-point point-ne" data-action="ne"></span>' + '<span class="cropper-point point-nw" data-action="nw"></span>' + '<span class="cropper-point point-sw" data-action="sw"></span>' + '<span class="cropper-point point-se" data-action="se"></span>' + '</div>' + '</div>';
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-
-
-
-
-
-
-
-
-
-
-var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-};
-
-var createClass = function () {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
-}();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var toConsumableArray = function (arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
-
- return arr2;
- } else {
- return Array.from(arr);
- }
-};
+var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>';
/**
* Check if the given value is not a number.
*/
-var isNaN = Number.isNaN || WINDOW.isNaN;
+var isNaN = Number.isNaN || WINDOW.isNaN;
/**
* Check if the given value is a number.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is a number, else `false`.
*/
+
function isNumber(value) {
return typeof value === 'number' && !isNaN(value);
}
+/**
+ * Check if the given value is a positive number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
+ */
+var isPositiveNumber = function isPositiveNumber(value) {
+ return value > 0 && value < Infinity;
+};
/**
* Check if the given value is undefined.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is undefined, else `false`.
*/
+
function isUndefined(value) {
return typeof value === 'undefined';
}
-
/**
* Check if the given value is an object.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is an object, else `false`.
*/
+
function isObject(value) {
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null;
+ return _typeof(value) === 'object' && value !== null;
}
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
-
/**
* Check if the given value is a plain object.
* @param {*} value - The value to check.
@@ -303,41 +307,45 @@ function isPlainObject(value) {
try {
var _constructor = value.constructor;
var prototype = _constructor.prototype;
-
-
return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
- } catch (e) {
+ } catch (error) {
return false;
}
}
-
/**
* Check if the given value is a function.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is a function, else `false`.
*/
+
function isFunction(value) {
return typeof value === 'function';
}
+var slice = Array.prototype.slice;
+/**
+ * Convert array-like or iterable object to an array.
+ * @param {*} value - The value to convert.
+ * @returns {Array} Returns a new array.
+ */
+function toArray(value) {
+ return Array.from ? Array.from(value) : slice.call(value);
+}
/**
* Iterate the given data.
* @param {*} data - The data to iterate.
* @param {Function} callback - The process function for each element.
* @returns {*} The original data.
*/
-function each(data, callback) {
- if (data && isFunction(callback)) {
- if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
- var length = data.length;
- var i = void 0;
-
- for (i = 0; i < length; i += 1) {
- if (callback.call(data, data[i], i, data) === false) {
- break;
- }
- }
+function forEach(data, callback) {
+ if (data && isFunction(callback)) {
+ if (Array.isArray(data) || isNumber(data.length)
+ /* array-like */
+ ) {
+ toArray(data).forEach(function (value, key) {
+ callback.call(data, value, key, data);
+ });
} else if (isObject(data)) {
Object.keys(data).forEach(function (key) {
callback.call(data, data[key], key, data);
@@ -347,112 +355,83 @@ function each(data, callback) {
return data;
}
-
/**
* Extend the given object.
- * @param {*} obj - The object to be extended.
- * @param {*} args - The rest objects which will be merged to the first object.
+ * @param {*} target - The target object to extend.
+ * @param {*} args - The rest objects for merging to the target object.
* @returns {Object} The extended object.
*/
-function extend(obj) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+
+var assign = Object.assign || function assign(target) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
- if (isObject(obj) && args.length > 0) {
- if (Object.assign) {
- return Object.assign.apply(Object, [obj].concat(args));
- }
-
+ if (isObject(target) && args.length > 0) {
args.forEach(function (arg) {
if (isObject(arg)) {
Object.keys(arg).forEach(function (key) {
- obj[key] = arg[key];
+ target[key] = arg[key];
});
}
});
}
- return obj;
-}
-
-/**
- * Takes a function and returns a new one that will always have a particular context.
- * @param {Function} fn - The target function.
- * @param {Object} context - The new context for the function.
- * @returns {boolean} The new function.
- */
-function proxy(fn, context) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- return function () {
- for (var _len3 = arguments.length, args2 = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args2[_key3] = arguments[_key3];
- }
-
- return fn.apply(context, args.concat(args2));
- };
-}
-
-var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/i;
-
+ return target;
+};
+var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
/**
* Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/ }
+ * Check out {@link http://0.30000000000000004.com/}
* @param {number} value - The value to normalize.
* @param {number} [times=100000000000] - The times for normalizing.
* @returns {number} Returns the normalized number.
*/
+
function normalizeDecimalNumber(value) {
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
-
return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
-
-var REGEXP_SUFFIX = /^(width|height|left|top|marginLeft|marginTop)$/;
-
+var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
/**
* Apply styles to the given element.
* @param {Element} element - The target element.
* @param {Object} styles - The styles for applying.
*/
+
function setStyle(element, styles) {
var style = element.style;
-
-
- each(styles, function (value, property) {
+ forEach(styles, function (value, property) {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
- value += 'px';
+ value = "".concat(value, "px");
}
style[property] = value;
});
}
-
/**
* Check if the given element has a special class.
* @param {Element} element - The element to check.
* @param {string} value - The class to search.
* @returns {boolean} Returns `true` if the special class was found.
*/
+
function hasClass(element, value) {
return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
}
-
/**
* Add classes to the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be added.
*/
+
function addClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
addClass(elem, value);
});
return;
@@ -468,22 +447,22 @@ function addClass(element, value) {
if (!className) {
element.className = value;
} else if (className.indexOf(value) < 0) {
- element.className = className + ' ' + value;
+ element.className = "".concat(className, " ").concat(value);
}
}
-
/**
* Remove classes from the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be removed.
*/
+
function removeClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
removeClass(elem, value);
});
return;
@@ -498,102 +477,131 @@ function removeClass(element, value) {
element.className = element.className.replace(value, '');
}
}
-
/**
* Add or remove classes from the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be toggled.
* @param {boolean} added - Add only.
*/
+
function toggleClass(element, value, added) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
toggleClass(elem, value, added);
});
return;
- }
+ } // IE10-11 doesn't support the second parameter of `classList.toggle`
+
- // IE10-11 doesn't support the second parameter of `classList.toggle`
if (added) {
addClass(element, value);
} else {
removeClass(element, value);
}
}
-
-var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
-
+var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
/**
- * Hyphenate the given value.
- * @param {string} value - The value to hyphenate.
- * @returns {string} The hyphenated value.
+ * Transform the given string from camelCase to kebab-case
+ * @param {string} value - The value to transform.
+ * @returns {string} The transformed value.
*/
-function hyphenate(value) {
- return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
-}
+function toParamCase(value) {
+ return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();
+}
/**
* Get data from the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to get.
* @returns {string} The data value.
*/
+
function getData(element, name) {
if (isObject(element[name])) {
return element[name];
- } else if (element.dataset) {
+ }
+
+ if (element.dataset) {
return element.dataset[name];
}
- return element.getAttribute('data-' + hyphenate(name));
+ return element.getAttribute("data-".concat(toParamCase(name)));
}
-
/**
* Set data to the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to set.
* @param {string} data - The data value.
*/
+
function setData(element, name, data) {
if (isObject(data)) {
element[name] = data;
} else if (element.dataset) {
element.dataset[name] = data;
} else {
- element.setAttribute('data-' + hyphenate(name), data);
+ element.setAttribute("data-".concat(toParamCase(name)), data);
}
}
-
/**
* Remove data from the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to remove.
*/
+
function removeData(element, name) {
if (isObject(element[name])) {
try {
delete element[name];
- } catch (e) {
- element[name] = null;
+ } catch (error) {
+ element[name] = undefined;
}
} else if (element.dataset) {
// #128 Safari not allows to delete dataset property
try {
delete element.dataset[name];
- } catch (e) {
- element.dataset[name] = null;
+ } catch (error) {
+ element.dataset[name] = undefined;
}
} else {
- element.removeAttribute('data-' + hyphenate(name));
+ element.removeAttribute("data-".concat(toParamCase(name)));
}
}
+var REGEXP_SPACES = /\s\s*/;
-var REGEXP_SPACES = /\s+/;
+var onceSupported = function () {
+ var supported = false;
+ if (IS_BROWSER) {
+ var once = false;
+
+ var listener = function listener() {};
+
+ var options = Object.defineProperty({}, 'once', {
+ get: function get() {
+ supported = true;
+ return once;
+ },
+
+ /**
+ * This setter can fix a `TypeError` in strict mode
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+ * @param {boolean} value - The value to set
+ */
+ set: function set(value) {
+ once = value;
+ }
+ });
+ WINDOW.addEventListener('test', listener, options);
+ WINDOW.removeEventListener('test', listener, options);
+ }
+
+ return supported;
+}();
/**
* Remove event listener from the target element.
* @param {Element} element - The event target.
@@ -601,29 +609,32 @@ var REGEXP_SPACES = /\s+/;
* @param {Function} listener - The event listener.
* @param {Object} options - The event options.
*/
+
+
function removeListener(element, type, listener) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (!onceSupported) {
+ var listeners = element.listeners;
- if (!isFunction(listener)) {
- return;
- }
+ if (listeners && listeners[event] && listeners[event][listener]) {
+ handler = listeners[event][listener];
+ delete listeners[event][listener];
- var types = type.trim().split(REGEXP_SPACES);
+ if (Object.keys(listeners[event]).length === 0) {
+ delete listeners[event];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- removeListener(element, t, listener, options);
- });
- return;
- }
+ if (Object.keys(listeners).length === 0) {
+ delete element.listeners;
+ }
+ }
+ }
- if (element.removeEventListener) {
- element.removeEventListener(type, listener, options);
- } else if (element.detachEvent) {
- element.detachEvent('on' + type, listener);
- }
+ element.removeEventListener(event, handler, options);
+ });
}
-
/**
* Add event listener to the target element.
* @param {Element} element - The event target.
@@ -631,42 +642,41 @@ function removeListener(element, type, listener) {
* @param {Function} listener - The event listener.
* @param {Object} options - The event options.
*/
-function addListener(element, type, _listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
-
- if (!isFunction(_listener)) {
- return;
- }
- var types = type.trim().split(REGEXP_SPACES);
+function addListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var _handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (options.once && !onceSupported) {
+ var _element$listeners = element.listeners,
+ listeners = _element$listeners === void 0 ? {} : _element$listeners;
+
+ _handler = function handler() {
+ delete listeners[event][listener];
+ element.removeEventListener(event, _handler, options);
+
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- addListener(element, t, _listener, options);
- });
- return;
- }
+ listener.apply(element, args);
+ };
- if (options.once) {
- var originalListener = _listener;
+ if (!listeners[event]) {
+ listeners[event] = {};
+ }
- _listener = function listener() {
- for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
+ if (listeners[event][listener]) {
+ element.removeEventListener(event, listeners[event][listener], options);
}
- removeListener(element, type, _listener, options);
- return originalListener.apply(element, args);
- };
- }
+ listeners[event][listener] = _handler;
+ element.listeners = listeners;
+ }
- if (element.addEventListener) {
- element.addEventListener(type, _listener, options);
- } else if (element.attachEvent) {
- element.attachEvent('on' + type, _listener);
- }
+ element.addEventListener(event, _handler, options);
+ });
}
-
/**
* Dispatch event on the target element.
* @param {Element} element - The event target.
@@ -674,187 +684,113 @@ function addListener(element, type, _listener) {
* @param {Object} data - The additional event data.
* @returns {boolean} Indicate if the event is default prevented or not.
*/
+
function dispatchEvent(element, type, data) {
- if (element.dispatchEvent) {
- var event = void 0;
-
- // Event and CustomEvent on IE9-11 are global objects, not constructors
- if (isFunction(Event) && isFunction(CustomEvent)) {
- if (isUndefined(data)) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true
- });
- }
- } else if (isUndefined(data)) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
- } else {
- event = document.createEvent('CustomEvent');
- event.initCustomEvent(type, true, true, data);
- }
+ var event; // Event and CustomEvent on IE9-11 are global objects, not constructors
- // IE9+
- return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent('on' + type);
+ if (isFunction(Event) && isFunction(CustomEvent)) {
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true
+ });
+ } else {
+ event = document.createEvent('CustomEvent');
+ event.initCustomEvent(type, true, true, data);
}
- return true;
+ return element.dispatchEvent(event);
}
-
/**
* Get the offset base on the document.
* @param {Element} element - The target element.
* @returns {Object} The offset data.
*/
+
function getOffset(element) {
- var doc = document.documentElement;
var box = element.getBoundingClientRect();
-
return {
- left: box.left + ((window.scrollX || doc && doc.scrollLeft || 0) - (doc && doc.clientLeft || 0)),
- top: box.top + ((window.scrollY || doc && doc.scrollTop || 0) - (doc && doc.clientTop || 0))
+ left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+ top: box.top + (window.pageYOffset - document.documentElement.clientTop)
};
}
-
-/**
- * Empty an element.
- * @param {Element} element - The element to empty.
- */
-function empty(element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
- }
-}
-
var location = WINDOW.location;
-
-var REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
-
+var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
/**
* Check if the given URL is a cross origin URL.
* @param {string} url - The target URL.
* @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
*/
+
function isCrossOriginURL(url) {
var parts = url.match(REGEXP_ORIGINS);
-
- return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
+ return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
}
-
/**
* Add timestamp to the given URL.
* @param {string} url - The target URL.
* @returns {string} The result URL.
*/
-function addTimestamp(url) {
- var timestamp = 'timestamp=' + new Date().getTime();
+function addTimestamp(url) {
+ var timestamp = "timestamp=".concat(new Date().getTime());
return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
}
-
/**
* Get transforms base on the given object.
* @param {Object} obj - The target object.
* @returns {string} A string contains transform values.
*/
+
function getTransforms(_ref) {
var rotate = _ref.rotate,
scaleX = _ref.scaleX,
scaleY = _ref.scaleY,
translateX = _ref.translateX,
translateY = _ref.translateY;
-
var values = [];
if (isNumber(translateX) && translateX !== 0) {
- values.push('translateX(' + translateX + 'px)');
+ values.push("translateX(".concat(translateX, "px)"));
}
if (isNumber(translateY) && translateY !== 0) {
- values.push('translateY(' + translateY + 'px)');
- }
+ values.push("translateY(".concat(translateY, "px)"));
+ } // Rotate should come first before scale to match orientation transform
+
- // Rotate should come first before scale to match orientation transform
if (isNumber(rotate) && rotate !== 0) {
- values.push('rotate(' + rotate + 'deg)');
+ values.push("rotate(".concat(rotate, "deg)"));
}
if (isNumber(scaleX) && scaleX !== 1) {
- values.push('scaleX(' + scaleX + ')');
+ values.push("scaleX(".concat(scaleX, ")"));
}
if (isNumber(scaleY) && scaleY !== 1) {
- values.push('scaleY(' + scaleY + ')');
+ values.push("scaleY(".concat(scaleY, ")"));
}
var transform = values.length ? values.join(' ') : 'none';
-
return {
WebkitTransform: transform,
msTransform: transform,
transform: transform
};
}
-
-var navigator = WINDOW.navigator;
-
-var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
-
-/**
- * Get an image's natural sizes.
- * @param {string} image - The target image.
- * @param {Function} callback - The callback function.
- */
-function getImageNaturalSizes(image, callback) {
- // Modern browsers (except Safari)
- if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
- callback(image.naturalWidth, image.naturalHeight);
- return;
- }
-
- var newImage = document.createElement('img');
- var body = document.body || document.documentElement;
-
- newImage.onload = function () {
- callback(newImage.width, newImage.height);
-
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- body.removeChild(newImage);
- }
- };
-
- newImage.src = image.src;
-
- // iOS Safari will convert the image automatically
- // with its orientation once append it into DOM (#279)
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
- body.appendChild(newImage);
- }
-}
-
/**
* Get the max ratio of a group of pointers.
* @param {string} pointers - The target pointers.
* @returns {number} The result ratio.
*/
+
function getMaxZoomRatio(pointers) {
- var pointers2 = extend({}, pointers);
- var ratios = [];
+ var pointers2 = _objectSpread2({}, pointers);
- each(pointers, function (pointer, pointerId) {
+ var ratios = [];
+ forEach(pointers, function (pointer, pointerId) {
delete pointers2[pointerId];
-
- each(pointers2, function (pointer2) {
+ forEach(pointers2, function (pointer2) {
var x1 = Math.abs(pointer.startX - pointer2.startX);
var y1 = Math.abs(pointer.startY - pointer2.startY);
var x2 = Math.abs(pointer.endX - pointer2.endX);
@@ -862,99 +798,84 @@ function getMaxZoomRatio(pointers) {
var z1 = Math.sqrt(x1 * x1 + y1 * y1);
var z2 = Math.sqrt(x2 * x2 + y2 * y2);
var ratio = (z2 - z1) / z1;
-
ratios.push(ratio);
});
});
-
ratios.sort(function (a, b) {
return Math.abs(a) < Math.abs(b);
});
-
return ratios[0];
}
-
/**
* Get a pointer from an event object.
* @param {Object} event - The target event object.
* @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
* @returns {Object} The result pointer contains start and/or end point coordinates.
*/
+
function getPointer(_ref2, endOnly) {
var pageX = _ref2.pageX,
pageY = _ref2.pageY;
-
var end = {
endX: pageX,
endY: pageY
};
-
- if (endOnly) {
- return end;
- }
-
- return extend({
+ return endOnly ? end : _objectSpread2({
startX: pageX,
startY: pageY
}, end);
}
-
/**
* Get the center point coordinate of a group of pointers.
* @param {Object} pointers - The target pointers.
* @returns {Object} The center point coordinate.
*/
+
function getPointersCenter(pointers) {
var pageX = 0;
var pageY = 0;
var count = 0;
-
- each(pointers, function (_ref3) {
+ forEach(pointers, function (_ref3) {
var startX = _ref3.startX,
startY = _ref3.startY;
-
pageX += startX;
pageY += startY;
count += 1;
});
-
pageX /= count;
pageY /= count;
-
return {
pageX: pageX,
pageY: pageY
};
}
-
-/**
- * Check if the given value is a finite number.
- */
-var isFinite = Number.isFinite || WINDOW.isFinite;
-
/**
* Get the max sizes in a rectangle under the given aspect ratio.
* @param {Object} data - The original sizes.
+ * @param {string} [type='contain'] - The adjust type.
* @returns {Object} The result sizes.
*/
-function getContainSizes(_ref4) {
+
+function getAdjustedSizes(_ref4) // or 'cover'
+{
var aspectRatio = _ref4.aspectRatio,
height = _ref4.height,
width = _ref4.width;
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';
+ var isValidWidth = isPositiveNumber(width);
+ var isValidHeight = isPositiveNumber(height);
- var isValidNumber = function isValidNumber(value) {
- return isFinite(value) && value > 0;
- };
+ if (isValidWidth && isValidHeight) {
+ var adjustedWidth = height * aspectRatio;
- if (isValidNumber(width) && isValidNumber(height)) {
- if (height * aspectRatio > width) {
+ if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {
height = width / aspectRatio;
} else {
width = height * aspectRatio;
}
- } else if (isValidNumber(width)) {
+ } else if (isValidWidth) {
height = width / aspectRatio;
- } else if (isValidNumber(height)) {
+ } else if (isValidHeight) {
width = height * aspectRatio;
}
@@ -963,17 +884,16 @@ function getContainSizes(_ref4) {
height: height
};
}
-
/**
* Get the new sizes of a rectangle after rotated.
* @param {Object} data - The original sizes.
* @returns {Object} The result sizes.
*/
+
function getRotatedSizes(_ref5) {
var width = _ref5.width,
height = _ref5.height,
degree = _ref5.degree;
-
degree = Math.abs(degree) % 180;
if (degree === 90) {
@@ -988,7 +908,6 @@ function getRotatedSizes(_ref5) {
var cosArc = Math.cos(arc);
var newWidth = width * cosArc + height * sinArc;
var newHeight = width * sinArc + height * cosArc;
-
return degree > 90 ? {
width: newHeight,
height: newWidth
@@ -997,7 +916,6 @@ function getRotatedSizes(_ref5) {
height: newHeight
};
}
-
/**
* Get a canvas which drew the given image.
* @param {HTMLImageElement} image - The image for drawing.
@@ -1006,49 +924,63 @@ function getRotatedSizes(_ref5) {
* @param {Object} options - The options.
* @returns {HTMLCanvasElement} The result canvas.
*/
+
function getSourceCanvas(image, _ref6, _ref7, _ref8) {
- var imageNaturalWidth = _ref6.naturalWidth,
+ var imageAspectRatio = _ref6.aspectRatio,
+ imageNaturalWidth = _ref6.naturalWidth,
imageNaturalHeight = _ref6.naturalHeight,
_ref6$rotate = _ref6.rotate,
- rotate = _ref6$rotate === undefined ? 0 : _ref6$rotate,
+ rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,
_ref6$scaleX = _ref6.scaleX,
- scaleX = _ref6$scaleX === undefined ? 1 : _ref6$scaleX,
+ scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,
_ref6$scaleY = _ref6.scaleY,
- scaleY = _ref6$scaleY === undefined ? 1 : _ref6$scaleY;
+ scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;
var aspectRatio = _ref7.aspectRatio,
naturalWidth = _ref7.naturalWidth,
naturalHeight = _ref7.naturalHeight;
var _ref8$fillColor = _ref8.fillColor,
- fillColor = _ref8$fillColor === undefined ? 'transparent' : _ref8$fillColor,
+ fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,
_ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
- imageSmoothingEnabled = _ref8$imageSmoothingE === undefined ? true : _ref8$imageSmoothingE,
+ imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,
_ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
- imageSmoothingQuality = _ref8$imageSmoothingQ === undefined ? 'low' : _ref8$imageSmoothingQ,
+ imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,
_ref8$maxWidth = _ref8.maxWidth,
- maxWidth = _ref8$maxWidth === undefined ? Infinity : _ref8$maxWidth,
+ maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,
_ref8$maxHeight = _ref8.maxHeight,
- maxHeight = _ref8$maxHeight === undefined ? Infinity : _ref8$maxHeight,
+ maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,
_ref8$minWidth = _ref8.minWidth,
- minWidth = _ref8$minWidth === undefined ? 0 : _ref8$minWidth,
+ minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,
_ref8$minHeight = _ref8.minHeight,
- minHeight = _ref8$minHeight === undefined ? 0 : _ref8$minHeight;
-
+ minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
- var maxSizes = getContainSizes({
+ var maxSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: maxWidth,
height: maxHeight
});
- var minSizes = getContainSizes({
+ var minSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: minWidth,
height: minHeight
- });
+ }, 'cover');
var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
- var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
- var params = [-imageNaturalWidth / 2, -imageNaturalHeight / 2, imageNaturalWidth, imageNaturalHeight];
+ var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as
+ // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90
+ var destMaxSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: maxWidth,
+ height: maxHeight
+ });
+ var destMinSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));
+ var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));
+ var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
context.fillStyle = fillColor;
@@ -1059,15 +991,13 @@ function getSourceCanvas(image, _ref6, _ref7, _ref8) {
context.scale(scaleX, scaleY);
context.imageSmoothingEnabled = imageSmoothingEnabled;
context.imageSmoothingQuality = imageSmoothingQuality;
- context.drawImage.apply(context, [image].concat(toConsumableArray(params.map(function (param) {
+ context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
context.restore();
return canvas;
}
-
var fromCharCode = String.fromCharCode;
-
/**
* Get string from char code in data view.
* @param {DataView} dataView - The data view for read.
@@ -1078,133 +1008,139 @@ var fromCharCode = String.fromCharCode;
function getStringFromCharCode(dataView, start, length) {
var str = '';
- var i = void 0;
-
length += start;
- for (i = start; i < length; i += 1) {
+ for (var i = start; i < length; i += 1) {
str += fromCharCode(dataView.getUint8(i));
}
return str;
}
-
var REGEXP_DATA_URL_HEAD = /^data:.*,/;
-
/**
* Transform Data URL to array buffer.
* @param {string} dataURL - The Data URL to transform.
* @returns {ArrayBuffer} The result array buffer.
*/
+
function dataURLToArrayBuffer(dataURL) {
var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
var binary = atob(base64);
var arrayBuffer = new ArrayBuffer(binary.length);
var uint8 = new Uint8Array(arrayBuffer);
-
- each(uint8, function (value, i) {
+ forEach(uint8, function (value, i) {
uint8[i] = binary.charCodeAt(i);
});
-
return arrayBuffer;
}
-
/**
* Transform array buffer to Data URL.
* @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
* @param {string} mimeType - The mime type of the Data URL.
* @returns {string} The result Data URL.
*/
+
function arrayBufferToDataURL(arrayBuffer, mimeType) {
+ var chunks = []; // Chunk Typed Array for better performance (#435)
+
+ var chunkSize = 8192;
var uint8 = new Uint8Array(arrayBuffer);
- var data = '';
- // TypedArray.prototype.forEach is not supported in some browsers.
- each(uint8, function (value) {
- data += fromCharCode(value);
- });
+ while (uint8.length > 0) {
+ // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9
+ // eslint-disable-next-line prefer-spread
+ chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
+ uint8 = uint8.subarray(chunkSize);
+ }
- return 'data:' + mimeType + ';base64,' + btoa(data);
+ return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join('')));
}
-
/**
* Get orientation value from given array buffer.
* @param {ArrayBuffer} arrayBuffer - The array buffer to read.
* @returns {number} The read orientation value.
*/
-function getOrientation(arrayBuffer) {
+
+function resetAndGetOrientation(arrayBuffer) {
var dataView = new DataView(arrayBuffer);
- var orientation = void 0;
- var littleEndian = void 0;
- var app1Start = void 0;
- var ifdStart = void 0;
-
- // Only handle JPEG image (start by 0xFFD8)
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
- var length = dataView.byteLength;
- var offset = 2;
-
- while (offset < length) {
- if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
- app1Start = offset;
- break;
- }
+ var orientation; // Ignores range error when the image does not have correct Exif information
- offset += 1;
- }
- }
+ try {
+ var littleEndian;
+ var app1Start;
+ var ifdStart; // Only handle JPEG image (start by 0xFFD8)
- if (app1Start) {
- var exifIDCode = app1Start + 4;
- var tiffOffset = app1Start + 10;
+ if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
+ var length = dataView.byteLength;
+ var offset = 2;
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
- var endianness = dataView.getUint16(tiffOffset);
+ while (offset + 1 < length) {
+ if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
+ app1Start = offset;
+ break;
+ }
+
+ offset += 1;
+ }
+ }
+
+ if (app1Start) {
+ var exifIDCode = app1Start + 4;
+ var tiffOffset = app1Start + 10;
- littleEndian = endianness === 0x4949;
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
+ var endianness = dataView.getUint16(tiffOffset);
+ littleEndian = endianness === 0x4949;
- if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
- var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
+ if (littleEndian || endianness === 0x4D4D
+ /* bigEndian */
+ ) {
+ if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
+ var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
- if (firstIFDOffset >= 0x00000008) {
- ifdStart = tiffOffset + firstIFDOffset;
+ if (firstIFDOffset >= 0x00000008) {
+ ifdStart = tiffOffset + firstIFDOffset;
+ }
}
}
- }
+ }
}
- }
- if (ifdStart) {
- var _length = dataView.getUint16(ifdStart, littleEndian);
- var _offset = void 0;
- var i = void 0;
+ if (ifdStart) {
+ var _length = dataView.getUint16(ifdStart, littleEndian);
- for (i = 0; i < _length; i += 1) {
- _offset = ifdStart + i * 12 + 2;
+ var _offset;
- if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {
- // 8 is the offset of the current tag's value
- _offset += 8;
+ var i;
- // Get the original orientation value
- orientation = dataView.getUint16(_offset, littleEndian);
+ for (i = 0; i < _length; i += 1) {
+ _offset = ifdStart + i * 12 + 2;
- // Override the orientation with its default value
- dataView.setUint16(_offset, 1, littleEndian);
- break;
- }
+ if (dataView.getUint16(_offset, littleEndian) === 0x0112
+ /* Orientation */
+ ) {
+ // 8 is the offset of the current tag's value
+ _offset += 8; // Get the original orientation value
+
+ orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
+
+ dataView.setUint16(_offset, 1, littleEndian);
+ break;
+ }
+ }
}
+ } catch (error) {
+ orientation = 1;
}
return orientation;
}
-
/**
* Parse Exif Orientation value.
* @param {number} orientation - The orientation to parse.
* @returns {Object} The parsed result.
*/
+
function parseOrientation(orientation) {
var rotate = 0;
var scaleX = 1;
@@ -1215,35 +1151,35 @@ function parseOrientation(orientation) {
case 2:
scaleX = -1;
break;
-
// Rotate left 180°
+
case 3:
rotate = -180;
break;
-
// Flip vertical
+
case 4:
scaleY = -1;
break;
-
// Flip vertical and rotate right 90°
+
case 5:
rotate = 90;
scaleY = -1;
break;
-
// Rotate right 90°
+
case 6:
rotate = 90;
break;
-
// Flip horizontal and rotate right 90°
+
case 7:
rotate = 90;
scaleX = -1;
break;
-
// Rotate left 90°
+
case 8:
rotate = -90;
break;
@@ -1274,34 +1210,25 @@ var render = {
options = this.options,
container = this.container,
cropper = this.cropper;
-
-
addClass(cropper, CLASS_HIDDEN);
removeClass(element, CLASS_HIDDEN);
-
var containerData = {
width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
};
-
this.containerData = containerData;
-
setStyle(cropper, {
width: containerData.width,
height: containerData.height
});
-
addClass(element, CLASS_HIDDEN);
removeClass(cropper, CLASS_HIDDEN);
},
-
-
// Canvas (image wrapper)
initCanvas: function initCanvas() {
var containerData = this.containerData,
imageData = this.imageData;
var viewMode = this.options.viewMode;
-
var rotated = Math.abs(imageData.rotate) % 180 === 90;
var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
@@ -1328,17 +1255,15 @@ var render = {
width: canvasWidth,
height: canvasHeight
};
-
canvasData.left = (containerData.width - canvasWidth) / 2;
canvasData.top = (containerData.height - canvasHeight) / 2;
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
-
this.canvasData = canvasData;
this.limited = viewMode === 1 || viewMode === 2;
this.limitCanvas(true, true);
- this.initialImageData = extend({}, imageData);
- this.initialCanvasData = extend({}, canvasData);
+ this.initialImageData = assign({}, imageData);
+ this.initialCanvasData = assign({}, canvasData);
},
limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
var options = this.options,
@@ -1347,7 +1272,6 @@ var render = {
cropBoxData = this.cropBoxData;
var viewMode = options.viewMode;
var aspectRatio = canvasData.aspectRatio;
-
var cropped = this.cropped && cropBoxData;
if (sizeLimited) {
@@ -1382,16 +1306,14 @@ var render = {
}
}
- var _getContainSizes = getContainSizes({
+ var _getAdjustedSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: minCanvasWidth,
height: minCanvasHeight
});
- minCanvasWidth = _getContainSizes.width;
- minCanvasHeight = _getContainSizes.height;
-
-
+ minCanvasWidth = _getAdjustedSizes.width;
+ minCanvasHeight = _getAdjustedSizes.height;
canvasData.minWidth = minCanvasWidth;
canvasData.minHeight = minCanvasHeight;
canvasData.maxWidth = Infinity;
@@ -1399,10 +1321,9 @@ var render = {
}
if (positionLimited) {
- if (viewMode) {
+ if (viewMode > (cropped ? 0 : 1)) {
var newCanvasLeft = containerData.width - canvasData.width;
var newCanvasTop = containerData.height - canvasData.height;
-
canvasData.minLeft = Math.min(0, newCanvasLeft);
canvasData.minTop = Math.min(0, newCanvasTop);
canvasData.maxLeft = Math.max(0, newCanvasLeft);
@@ -1438,7 +1359,6 @@ var render = {
var canvasData = this.canvasData,
imageData = this.imageData;
-
if (transformed) {
var _getRotatedSizes = getRotatedSizes({
width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
@@ -1450,7 +1370,6 @@ var render = {
var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
-
canvasData.left -= (width - canvasData.width) / 2;
canvasData.top -= (height - canvasData.height) / 2;
canvasData.width = width;
@@ -1471,22 +1390,18 @@ var render = {
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
-
this.limitCanvas(false, true);
-
canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
-
- setStyle(this.canvas, extend({
+ setStyle(this.canvas, assign({
width: canvasData.width,
height: canvasData.height
}, getTransforms({
translateX: canvasData.left,
translateY: canvasData.top
})));
-
this.renderImage(changed);
if (this.cropped && this.limited) {
@@ -1496,20 +1411,18 @@ var render = {
renderImage: function renderImage(changed) {
var canvasData = this.canvasData,
imageData = this.imageData;
-
var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
-
- extend(imageData, {
+ assign(imageData, {
width: width,
height: height,
left: (canvasData.width - width) / 2,
top: (canvasData.height - height) / 2
});
- setStyle(this.image, extend({
+ setStyle(this.image, assign({
width: imageData.width,
height: imageData.height
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: imageData.left,
translateY: imageData.top
}, imageData))));
@@ -1521,8 +1434,7 @@ var render = {
initCropBox: function initCropBox() {
var options = this.options,
canvasData = this.canvasData;
- var aspectRatio = options.aspectRatio;
-
+ var aspectRatio = options.aspectRatio || options.initialAspectRatio;
var autoCropArea = Number(options.autoCropArea) || 0.8;
var cropBoxData = {
width: canvasData.width,
@@ -1538,21 +1450,18 @@ var render = {
}
this.cropBoxData = cropBoxData;
- this.limitCropBox(true, true);
+ this.limitCropBox(true, true); // Initialize auto crop area
- // Initialize auto crop area
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height"
- // The width/height of auto crop area must large than "minWidth/Height"
cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
cropBoxData.oldLeft = cropBoxData.left;
cropBoxData.oldTop = cropBoxData.top;
-
- this.initialCropBoxData = extend({}, cropBoxData);
+ this.initialCropBoxData = assign({}, cropBoxData);
},
limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
var options = this.options,
@@ -1562,14 +1471,12 @@ var render = {
limited = this.limited;
var aspectRatio = options.aspectRatio;
-
if (sizeLimited) {
var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
- var maxCropBoxWidth = Math.min(containerData.width, limited ? canvasData.width : containerData.width);
- var maxCropBoxHeight = Math.min(containerData.height, limited ? canvasData.height : containerData.height);
+ var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;
+ var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height
- // The min/maxCropBoxWidth/Height must be less than container's width/height
minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
@@ -1591,9 +1498,9 @@ var render = {
} else {
maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
}
- }
+ } // The minWidth/Height must be less than maxWidth/Height
+
- // The minWidth/Height must be less than maxWidth/Height
cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
cropBoxData.maxWidth = maxCropBoxWidth;
@@ -1619,7 +1526,6 @@ var render = {
containerData = this.containerData,
cropBoxData = this.cropBoxData;
-
if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
cropBoxData.left = cropBoxData.oldLeft;
}
@@ -1630,9 +1536,7 @@ var render = {
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
this.limitCropBox(false, true);
-
cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
cropBoxData.oldLeft = cropBoxData.left;
@@ -1643,7 +1547,7 @@ var render = {
setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
}
- setStyle(this.cropBox, extend({
+ setStyle(this.cropBox, assign({
width: cropBoxData.width,
height: cropBoxData.height
}, getTransforms({
@@ -1661,19 +1565,17 @@ var render = {
},
output: function output() {
this.preview();
-
- if (this.complete) {
- dispatchEvent(this.element, EVENT_CROP, this.getData());
- }
+ dispatchEvent(this.element, EVENT_CROP, this.getData());
}
};
var preview = {
initPreview: function initPreview() {
- var crossOrigin = this.crossOrigin;
+ var element = this.element,
+ crossOrigin = this.crossOrigin;
var preview = this.options.preview;
-
var url = crossOrigin ? this.crossOriginUrl : this.url;
+ var alt = element.alt || 'The image to preview';
var image = document.createElement('img');
if (crossOrigin) {
@@ -1681,25 +1583,30 @@ var preview = {
}
image.src = url;
+ image.alt = alt;
this.viewBox.appendChild(image);
- this.image2 = image;
+ this.viewBoxImage = image;
if (!preview) {
return;
}
- var previews = preview.querySelector ? [preview] : document.querySelectorAll(preview);
+ var previews = preview;
- this.previews = previews;
+ if (typeof preview === 'string') {
+ previews = element.ownerDocument.querySelectorAll(preview);
+ } else if (preview.querySelector) {
+ previews = [preview];
+ }
- each(previews, function (element) {
- var img = document.createElement('img');
+ this.previews = previews;
+ forEach(previews, function (el) {
+ var img = document.createElement('img'); // Save the original size for recover
- // Save the original size for recover
- setData(element, DATA_PREVIEW, {
- width: element.offsetWidth,
- height: element.offsetHeight,
- html: element.innerHTML
+ setData(el, DATA_PREVIEW, {
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ html: el.innerHTML
});
if (crossOrigin) {
@@ -1707,28 +1614,26 @@ var preview = {
}
img.src = url;
-
+ img.alt = alt;
/**
* Override img element styles
* Add `display:block` to avoid margin top issue
* Add `height:auto` to override `height` attribute on IE8
* (Occur only when margin-top <= -height)
*/
- img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
- empty(element);
- element.appendChild(img);
+ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ el.innerHTML = '';
+ el.appendChild(img);
});
},
resetPreview: function resetPreview() {
- each(this.previews, function (element) {
+ forEach(this.previews, function (element) {
var data = getData(element, DATA_PREVIEW);
-
setStyle(element, {
width: data.width,
height: data.height
});
-
element.innerHTML = data.html;
removeData(element, DATA_PREVIEW);
});
@@ -1741,7 +1646,6 @@ var preview = {
cropBoxHeight = cropBoxData.height;
var width = imageData.width,
height = imageData.height;
-
var left = cropBoxData.left - canvasData.left - imageData.left;
var top = cropBoxData.top - canvasData.top - imageData.top;
@@ -1749,15 +1653,14 @@ var preview = {
return;
}
- setStyle(this.image2, extend({
+ setStyle(this.viewBoxImage, assign({
width: width,
height: height
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left,
translateY: -top
}, imageData))));
-
- each(this.previews, function (element) {
+ forEach(this.previews, function (element) {
var data = getData(element, DATA_PREVIEW);
var originalWidth = data.width;
var originalHeight = data.height;
@@ -1780,11 +1683,10 @@ var preview = {
width: newWidth,
height: newHeight
});
-
- setStyle(element.getElementsByTagName('img')[0], extend({
+ setStyle(element.getElementsByTagName('img')[0], assign({
width: width * ratio,
height: height * ratio
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left * ratio,
translateY: -top * ratio
}, imageData))));
@@ -1798,7 +1700,6 @@ var events = {
options = this.options,
cropper = this.cropper;
-
if (isFunction(options.cropstart)) {
addListener(element, EVENT_CROP_START, options.cropstart);
}
@@ -1819,21 +1720,24 @@ var events = {
addListener(element, EVENT_ZOOM, options.zoom);
}
- addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = proxy(this.cropStart, this));
+ addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
if (options.zoomable && options.zoomOnWheel) {
- addListener(cropper, EVENT_WHEEL, this.onWheel = proxy(this.wheel, this));
+ addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
+ passive: false,
+ capture: true
+ });
}
if (options.toggleDragModeOnDblclick) {
- addListener(cropper, EVENT_DBLCLICK, this.onDblclick = proxy(this.dblclick, this));
+ addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
}
- addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = proxy(this.cropMove, this));
- addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = proxy(this.cropEnd, this));
+ addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));
+ addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));
if (options.responsive) {
- addListener(window, EVENT_RESIZE, this.onResize = proxy(this.resize, this));
+ addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
}
},
unbind: function unbind() {
@@ -1841,7 +1745,6 @@ var events = {
options = this.options,
cropper = this.cropper;
-
if (isFunction(options.cropstart)) {
removeListener(element, EVENT_CROP_START, options.cropstart);
}
@@ -1865,7 +1768,10 @@ var events = {
removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
if (options.zoomable && options.zoomOnWheel) {
- removeListener(cropper, EVENT_WHEEL, this.onWheel);
+ removeListener(cropper, EVENT_WHEEL, this.onWheel, {
+ passive: false,
+ capture: true
+ });
}
if (options.toggleDragModeOnDblclick) {
@@ -1886,20 +1792,18 @@ var handlers = {
var options = this.options,
container = this.container,
containerData = this.containerData;
-
- var minContainerWidth = Number(options.minContainerWidth) || 200;
- var minContainerHeight = Number(options.minContainerHeight) || 100;
+ var minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
+ var minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
return;
}
- var ratio = container.offsetWidth / containerData.width;
+ var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
- // Resize when width changed or height changed
if (ratio !== 1 || container.offsetHeight !== containerData.height) {
- var canvasData = void 0;
- var cropBoxData = void 0;
+ var canvasData;
+ var cropBoxData;
if (options.restore) {
canvasData = this.getCanvasData();
@@ -1909,10 +1813,10 @@ var handlers = {
this.render();
if (options.restore) {
- this.setCanvasData(each(canvasData, function (n, i) {
+ this.setCanvasData(forEach(canvasData, function (n, i) {
canvasData[i] = n * ratio;
}));
- this.setCropBoxData(each(cropBoxData, function (n, i) {
+ this.setCropBoxData(forEach(cropBoxData, function (n, i) {
cropBoxData[i] = n * ratio;
}));
}
@@ -1925,7 +1829,7 @@ var handlers = {
this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
},
- wheel: function wheel(e) {
+ wheel: function wheel(event) {
var _this = this;
var ratio = Number(this.options.wheelZoomRatio) || 0.1;
@@ -1935,53 +1839,56 @@ var handlers = {
return;
}
- e.preventDefault();
+ event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)
- // Limit wheel speed to prevent zoom too fast (#21)
if (this.wheeling) {
return;
}
this.wheeling = true;
-
setTimeout(function () {
_this.wheeling = false;
}, 50);
- if (e.deltaY) {
- delta = e.deltaY > 0 ? 1 : -1;
- } else if (e.wheelDelta) {
- delta = -e.wheelDelta / 120;
- } else if (e.detail) {
- delta = e.detail > 0 ? 1 : -1;
+ if (event.deltaY) {
+ delta = event.deltaY > 0 ? 1 : -1;
+ } else if (event.wheelDelta) {
+ delta = -event.wheelDelta / 120;
+ } else if (event.detail) {
+ delta = event.detail > 0 ? 1 : -1;
}
- this.zoom(-delta * ratio, e);
+ this.zoom(-delta * ratio, event);
},
- cropStart: function cropStart(e) {
- if (this.disabled) {
+ cropStart: function cropStart(event) {
+ var buttons = event.buttons,
+ button = event.button;
+
+ if (this.disabled // Handle mouse event and pointer event and ignore touch event
+ || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)
+ isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu
+ || event.ctrlKey)) {
return;
}
var options = this.options,
pointers = this.pointers;
+ var action;
- var action = void 0;
-
- if (e.changedTouches) {
+ if (event.changedTouches) {
// Handle touch event
- each(e.changedTouches, function (touch) {
+ forEach(event.changedTouches, function (touch) {
pointers[touch.identifier] = getPointer(touch);
});
} else {
// Handle mouse event and pointer event
- pointers[e.pointerId || 0] = getPointer(e);
+ pointers[event.pointerId || 0] = getPointer(event);
}
if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
action = ACTION_ZOOM;
} else {
- action = getData(e.target, DATA_ACTION);
+ action = getData(event.target, DATA_ACTION);
}
if (!REGEXP_ACTIONS.test(action)) {
@@ -1989,14 +1896,14 @@ var handlers = {
}
if (dispatchEvent(this.element, EVENT_CROP_START, {
- originalEvent: e,
+ originalEvent: event,
action: action
}) === false) {
return;
- }
+ } // This line is required for preventing page zooming in iOS browsers
- e.preventDefault();
+ event.preventDefault();
this.action = action;
this.cropping = false;
@@ -2005,37 +1912,35 @@ var handlers = {
addClass(this.dragBox, CLASS_MODAL);
}
},
- cropMove: function cropMove(e) {
+ cropMove: function cropMove(event) {
var action = this.action;
-
if (this.disabled || !action) {
return;
}
var pointers = this.pointers;
-
-
- e.preventDefault();
+ event.preventDefault();
if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
- originalEvent: e,
+ originalEvent: event,
action: action
}) === false) {
return;
}
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- extend(pointers[touch.identifier], getPointer(touch, true));
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ // The first parameter should not be undefined (#432)
+ assign(pointers[touch.identifier] || {}, getPointer(touch, true));
});
} else {
- extend(pointers[e.pointerId || 0], getPointer(e, true));
+ assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
}
- this.change(e);
+ this.change(event);
},
- cropEnd: function cropEnd(e) {
+ cropEnd: function cropEnd(event) {
if (this.disabled) {
return;
}
@@ -2043,20 +1948,19 @@ var handlers = {
var action = this.action,
pointers = this.pointers;
-
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
delete pointers[touch.identifier];
});
} else {
- delete pointers[e.pointerId || 0];
+ delete pointers[event.pointerId || 0];
}
if (!action) {
return;
}
- e.preventDefault();
+ event.preventDefault();
if (!Object.keys(pointers).length) {
this.action = '';
@@ -2068,14 +1972,14 @@ var handlers = {
}
dispatchEvent(this.element, EVENT_CROP_END, {
- originalEvent: e,
+ originalEvent: event,
action: action
});
}
};
var change = {
- change: function change(e) {
+ change: function change(event) {
var options = this.options,
canvasData = this.canvasData,
containerData = this.containerData,
@@ -2087,7 +1991,6 @@ var change = {
top = cropBoxData.top,
width = cropBoxData.width,
height = cropBoxData.height;
-
var right = left + width;
var bottom = top + height;
var minLeft = 0;
@@ -2095,17 +1998,15 @@ var change = {
var maxWidth = containerData.width;
var maxHeight = containerData.height;
var renderable = true;
- var offset = void 0;
+ var offset; // Locking aspect ratio in "free mode" by holding shift key
- // Locking aspect ratio in "free mode" by holding shift key
- if (!aspectRatio && e.shiftKey) {
+ if (!aspectRatio && event.shiftKey) {
aspectRatio = width && height ? width / height : 1;
}
if (this.limited) {
minLeft = cropBoxData.minLeft;
minTop = cropBoxData.minTop;
-
maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
}
@@ -2115,6 +2016,7 @@ var change = {
x: pointer.endX - pointer.startX,
y: pointer.endY - pointer.startY
};
+
var check = function check(side) {
switch (side) {
case ACTION_EAST:
@@ -2155,8 +2057,8 @@ var change = {
left += range.x;
top += range.y;
break;
-
// Resize crop box
+
case ACTION_EAST:
if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
renderable = false;
@@ -2166,14 +2068,15 @@ var change = {
check(ACTION_EAST);
width += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top -= range.x / aspectRatio / 2;
- }
-
if (width < 0) {
action = ACTION_WEST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
@@ -2188,14 +2091,15 @@ var change = {
height -= range.y;
top += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left += range.y * aspectRatio / 2;
- }
-
if (height < 0) {
action = ACTION_SOUTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
@@ -2210,14 +2114,15 @@ var change = {
width -= range.x;
left += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top += range.x / aspectRatio / 2;
- }
-
if (width < 0) {
action = ACTION_EAST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
@@ -2231,14 +2136,15 @@ var change = {
check(ACTION_SOUTH);
height += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left -= range.y * aspectRatio / 2;
- }
-
if (height < 0) {
action = ACTION_NORTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
@@ -2281,14 +2187,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2304,7 +2214,7 @@ var change = {
height -= range.y;
top += range.y;
width = height * aspectRatio;
- left += range.y * aspectRatio;
+ left += cropBoxData.width - width;
} else {
check(ACTION_NORTH);
check(ACTION_WEST);
@@ -2334,14 +2244,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2384,14 +2298,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2431,31 +2349,35 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
-
// Move canvas
+
case ACTION_MOVE:
this.move(range.x, range.y);
renderable = false;
break;
-
// Zoom canvas
+
case ACTION_ZOOM:
- this.zoom(getMaxZoomRatio(pointers), e);
+ this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
-
// Create crop box
+
case ACTION_CROP:
if (!range.x || !range.y) {
renderable = false;
@@ -2477,9 +2399,9 @@ var change = {
if (range.y < 0) {
top -= height;
- }
+ } // Show the crop box if is hidden
+
- // Show the crop box if is hidden
if (!this.cropped) {
removeClass(this.cropBox, CLASS_HIDDEN);
this.cropped = true;
@@ -2501,10 +2423,10 @@ var change = {
cropBoxData.top = top;
this.action = action;
this.renderCropBox();
- }
+ } // Override
+
- // Override
- each(pointers, function (p) {
+ forEach(pointers, function (p) {
p.startX = p.endX;
p.startY = p.endY;
});
@@ -2514,31 +2436,26 @@ var change = {
var methods = {
// Show the crop box manually
crop: function crop() {
- if (this.ready && !this.disabled) {
- if (!this.cropped) {
- this.cropped = true;
- this.limitCropBox(true, true);
-
- if (this.options.modal) {
- addClass(this.dragBox, CLASS_MODAL);
- }
+ if (this.ready && !this.cropped && !this.disabled) {
+ this.cropped = true;
+ this.limitCropBox(true, true);
- removeClass(this.cropBox, CLASS_HIDDEN);
+ if (this.options.modal) {
+ addClass(this.dragBox, CLASS_MODAL);
}
+ removeClass(this.cropBox, CLASS_HIDDEN);
this.setCropBoxData(this.initialCropBoxData);
}
return this;
},
-
-
// Reset the image and crop box to their initial states
reset: function reset() {
if (this.ready && !this.disabled) {
- this.imageData = extend({}, this.initialImageData);
- this.canvasData = extend({}, this.initialCanvasData);
- this.cropBoxData = extend({}, this.initialCropBoxData);
+ this.imageData = assign({}, this.initialImageData);
+ this.canvasData = assign({}, this.initialCanvasData);
+ this.cropBoxData = assign({}, this.initialCropBoxData);
this.renderCanvas();
if (this.cropped) {
@@ -2548,23 +2465,19 @@ var methods = {
return this;
},
-
-
// Clear the crop box
clear: function clear() {
if (this.cropped && !this.disabled) {
- extend(this.cropBoxData, {
+ assign(this.cropBoxData, {
left: 0,
top: 0,
width: 0,
height: 0
});
-
this.cropped = false;
this.renderCropBox();
- this.limitCanvas(true, true);
+ this.limitCanvas(true, true); // Render canvas after crop box rendered
- // Render canvas after crop box rendered
this.renderCanvas();
removeClass(this.dragBox, CLASS_MODAL);
addClass(this.cropBox, CLASS_HIDDEN);
@@ -2573,29 +2486,27 @@ var methods = {
return this;
},
-
/**
* Replace the image's src and rebuild the cropper
* @param {string} url - The new URL.
- * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
- * @returns {Object} this
+ * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
+ * @returns {Cropper} this
*/
replace: function replace(url) {
- var onlyColorChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!this.disabled && url) {
if (this.isImg) {
this.element.src = url;
}
- if (onlyColorChanged) {
+ if (hasSameSize) {
this.url = url;
this.image.src = url;
if (this.ready) {
- this.image2.src = url;
-
- each(this.previews, function (element) {
+ this.viewBoxImage.src = url;
+ forEach(this.previews, function (element) {
element.getElementsByTagName('img')[0].src = url;
});
}
@@ -2604,30 +2515,26 @@ var methods = {
this.replaced = true;
}
- // Clear previous data
this.options.data = null;
+ this.uncreate();
this.load(url);
}
}
return this;
},
-
-
// Enable (unfreeze) the cropper
enable: function enable() {
- if (this.ready) {
+ if (this.ready && this.disabled) {
this.disabled = false;
removeClass(this.cropper, CLASS_DISABLED);
}
return this;
},
-
-
// Disable (freeze) the cropper
disable: function disable() {
- if (this.ready) {
+ if (this.ready && !this.disabled) {
this.disabled = true;
addClass(this.cropper, CLASS_DISABLED);
}
@@ -2635,60 +2542,51 @@ var methods = {
return this;
},
-
- // Destroy the cropper and remove the instance from the image
+ /**
+ * Destroy the cropper and remove the instance from the image
+ * @returns {Cropper} this
+ */
destroy: function destroy() {
- var element = this.element,
- image = this.image;
+ var element = this.element;
+ if (!element[NAMESPACE]) {
+ return this;
+ }
- if (this.loaded) {
- if (this.isImg && this.replaced) {
- element.src = this.originalUrl;
- }
+ element[NAMESPACE] = undefined;
- this.unbuild();
- removeClass(element, CLASS_HIDDEN);
- } else if (this.isImg) {
- removeListener(element, EVENT_LOAD, this.onStart);
- } else if (image) {
- image.parentNode.removeChild(image);
+ if (this.isImg && this.replaced) {
+ element.src = this.originalUrl;
}
- removeData(element, NAMESPACE);
-
+ this.uncreate();
return this;
},
-
/**
* Move the canvas with relative offsets
* @param {number} offsetX - The relative offset distance on the x-axis.
- * @param {number} offsetY - The relative offset distance on the y-axis.
- * @returns {Object} this
+ * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
+ * @returns {Cropper} this
*/
- move: function move(offsetX, offsetY) {
- var _canvasData = this.canvasData,
- left = _canvasData.left,
- top = _canvasData.top;
-
-
+ move: function move(offsetX) {
+ var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;
+ var _this$canvasData = this.canvasData,
+ left = _this$canvasData.left,
+ top = _this$canvasData.top;
return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
},
-
/**
* Move the canvas to an absolute point
* @param {number} x - The x-axis coordinate.
* @param {number} [y=x] - The y-axis coordinate.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
moveTo: function moveTo(x) {
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
var canvasData = this.canvasData;
-
var changed = false;
-
x = Number(x);
y = Number(y);
@@ -2711,17 +2609,14 @@ var methods = {
return this;
},
-
/**
* Zoom the canvas with a relative ratio
* @param {number} ratio - The target ratio.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoom: function zoom(ratio, _originalEvent) {
var canvasData = this.canvasData;
-
-
ratio = Number(ratio);
if (ratio < 0) {
@@ -2733,13 +2628,12 @@ var methods = {
return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
},
-
/**
* Zoom the canvas to an absolute ratio
* @param {number} ratio - The target ratio.
* @param {Object} pivot - The zoom pivot point coordinate.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
var options = this.options,
@@ -2748,8 +2642,6 @@ var methods = {
height = canvasData.height,
naturalWidth = canvasData.naturalWidth,
naturalHeight = canvasData.naturalHeight;
-
-
ratio = Number(ratio);
if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
@@ -2757,23 +2649,21 @@ var methods = {
var newHeight = naturalHeight * ratio;
if (dispatchEvent(this.element, EVENT_ZOOM, {
- originalEvent: _originalEvent,
+ ratio: ratio,
oldRatio: width / naturalWidth,
- ratio: newWidth / naturalWidth
+ originalEvent: _originalEvent
}) === false) {
return this;
}
if (_originalEvent) {
var pointers = this.pointers;
-
var offset = getOffset(this.cropper);
var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
pageX: _originalEvent.pageX,
pageY: _originalEvent.pageY
- };
+ }; // Zoom from the triggering point of the event
- // Zoom from the triggering point of the event
canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
} else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
@@ -2793,21 +2683,19 @@ var methods = {
return this;
},
-
/**
* Rotate the canvas with a relative degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotate: function rotate(degree) {
return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
},
-
/**
* Rotate the canvas to an absolute degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotateTo: function rotateTo(degree) {
degree = Number(degree);
@@ -2820,45 +2708,36 @@ var methods = {
return this;
},
-
/**
* Scale the image on the x-axis.
* @param {number} scaleX - The scale ratio on the x-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleX: function scaleX(_scaleX) {
var scaleY = this.imageData.scaleY;
-
-
return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
},
-
/**
* Scale the image on the y-axis.
* @param {number} scaleY - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleY: function scaleY(_scaleY) {
var scaleX = this.imageData.scaleX;
-
-
return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
},
-
/**
* Scale the image
* @param {number} scaleX - The scale ratio on the x-axis.
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scale: function scale(scaleX) {
var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
var imageData = this.imageData;
-
var transformed = false;
-
scaleX = Number(scaleX);
scaleY = Number(scaleY);
@@ -2881,20 +2760,18 @@ var methods = {
return this;
},
-
/**
* Get the cropped area position and size data (base on the original image)
* @param {boolean} [rounded=false] - Indicate if round the data values or not.
* @returns {Object} The result cropped data.
*/
- getData: function getData$$1() {
+ getData: function getData() {
var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData,
cropBoxData = this.cropBoxData;
-
- var data = void 0;
+ var data;
if (this.ready && this.cropped) {
data = {
@@ -2903,13 +2780,21 @@ var methods = {
width: cropBoxData.width,
height: cropBoxData.height
};
-
var ratio = imageData.width / imageData.naturalWidth;
-
- each(data, function (n, i) {
- n /= ratio;
- data[i] = rounded ? Math.round(n) : n;
+ forEach(data, function (n, i) {
+ data[i] = n / ratio;
});
+
+ if (rounded) {
+ // In case rounding off leads to extra 1px in right or bottom border
+ // we should round the top-left corner and the dimension (#343).
+ var bottom = Math.round(data.y + data.height);
+ var right = Math.round(data.x + data.width);
+ data.x = Math.round(data.x);
+ data.y = Math.round(data.y);
+ data.width = right - data.x;
+ data.height = bottom - data.y;
+ }
} else {
data = {
x: 0,
@@ -2931,23 +2816,17 @@ var methods = {
return data;
},
-
/**
* Set the cropped area position and size with new data
* @param {Object} data - The new data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
- setData: function setData$$1(data) {
+ setData: function setData(data) {
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData;
-
var cropBoxData = {};
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
var transformed = false;
@@ -2998,36 +2877,32 @@ var methods = {
return this;
},
-
/**
* Get the container size data.
* @returns {Object} The result container data.
*/
getContainerData: function getContainerData() {
- return this.ready ? extend({}, this.containerData) : {};
+ return this.ready ? assign({}, this.containerData) : {};
},
-
/**
* Get the image position and size data.
* @returns {Object} The result image data.
*/
getImageData: function getImageData() {
- return this.loaded ? extend({}, this.imageData) : {};
+ return this.sized ? assign({}, this.imageData) : {};
},
-
/**
* Get the canvas position and size data.
* @returns {Object} The result canvas data.
*/
getCanvasData: function getCanvasData() {
var canvasData = this.canvasData;
-
var data = {};
if (this.ready) {
- each(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
+ forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
data[n] = canvasData[n];
});
}
@@ -3035,21 +2910,15 @@ var methods = {
return data;
},
-
/**
* Set the canvas position and size with new data.
* @param {Object} data - The new canvas data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCanvasData: function setCanvasData(data) {
var canvasData = this.canvasData;
var aspectRatio = canvasData.aspectRatio;
-
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
canvasData.left = data.left;
@@ -3073,15 +2942,13 @@ var methods = {
return this;
},
-
/**
* Get the crop box position and size data.
* @returns {Object} The result crop box data.
*/
getCropBoxData: function getCropBoxData() {
var cropBoxData = this.cropBoxData;
-
- var data = void 0;
+ var data;
if (this.ready && this.cropped) {
data = {
@@ -3095,22 +2962,16 @@ var methods = {
return data || {};
},
-
/**
* Set the crop box position and size with new data.
* @param {Object} data - The new crop box data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCropBoxData: function setCropBoxData(data) {
var cropBoxData = this.cropBoxData;
var aspectRatio = this.options.aspectRatio;
-
- var widthChanged = void 0;
- var heightChanged = void 0;
-
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ var widthChanged;
+ var heightChanged;
if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
@@ -3145,7 +3006,6 @@ var methods = {
return this;
},
-
/**
* Get a canvas drawn the cropped image.
* @param {Object} [options={}] - The config options.
@@ -3159,78 +3019,77 @@ var methods = {
}
var canvasData = this.canvasData;
+ var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.
- var source = getSourceCanvas(this.image, this.imageData, canvasData, options);
-
- // Returns the source canvas if it is not cropped.
if (!this.cropped) {
return source;
}
- var _getData = this.getData(),
- x = _getData.x,
- y = _getData.y,
- initialWidth = _getData.width,
- initialHeight = _getData.height;
+ var _this$getData = this.getData(),
+ initialX = _this$getData.x,
+ initialY = _this$getData.y,
+ initialWidth = _this$getData.width,
+ initialHeight = _this$getData.height;
+
+ var ratio = source.width / Math.floor(canvasData.naturalWidth);
+
+ if (ratio !== 1) {
+ initialX *= ratio;
+ initialY *= ratio;
+ initialWidth *= ratio;
+ initialHeight *= ratio;
+ }
var aspectRatio = initialWidth / initialHeight;
- var maxSizes = getContainSizes({
+ var maxSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: options.maxWidth || Infinity,
height: options.maxHeight || Infinity
});
- var minSizes = getContainSizes({
+ var minSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: options.minWidth || 0,
height: options.minHeight || 0
- });
+ }, 'cover');
- var _getContainSizes = getContainSizes({
+ var _getAdjustedSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
- width: options.width || initialWidth,
- height: options.height || initialHeight
+ width: options.width || (ratio !== 1 ? source.width : initialWidth),
+ height: options.height || (ratio !== 1 ? source.height : initialHeight)
}),
- width = _getContainSizes.width,
- height = _getContainSizes.height;
+ width = _getAdjustedSizes.width,
+ height = _getAdjustedSizes.height;
width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
-
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
-
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
-
context.fillStyle = options.fillColor || 'transparent';
context.fillRect(0, 0, width, height);
-
var _options$imageSmoothi = options.imageSmoothingEnabled,
- imageSmoothingEnabled = _options$imageSmoothi === undefined ? true : _options$imageSmoothi,
+ imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,
imageSmoothingQuality = options.imageSmoothingQuality;
-
-
context.imageSmoothingEnabled = imageSmoothingEnabled;
if (imageSmoothingQuality) {
context.imageSmoothingQuality = imageSmoothingQuality;
- }
+ } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
+
- // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
var sourceWidth = source.width;
- var sourceHeight = source.height;
+ var sourceHeight = source.height; // Source canvas parameters
- // Source canvas parameters
- var srcX = x;
- var srcY = y;
- var srcWidth = void 0;
- var srcHeight = void 0;
+ var srcX = initialX;
+ var srcY = initialY;
+ var srcWidth;
+ var srcHeight; // Destination canvas parameters
- // Destination canvas parameters
- var dstX = void 0;
- var dstY = void 0;
- var dstWidth = void 0;
- var dstHeight = void 0;
+ var dstX;
+ var dstY;
+ var dstWidth;
+ var dstHeight;
if (srcX <= -initialWidth || srcX > sourceWidth) {
srcX = 0;
@@ -3264,34 +3123,29 @@ var methods = {
dstHeight = srcHeight;
}
- // All the numerical parameters should be integer for `drawImage`
- // https://github.com/fengyuanchen/cropper/issues/476
- var params = [srcX, srcY, srcWidth, srcHeight];
+ var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError"
- // Avoid "IndexSizeError"
if (dstWidth > 0 && dstHeight > 0) {
var scale = width / initialWidth;
-
params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
- }
+ } // All the numerical parameters should be integer for `drawImage`
+ // https://github.com/fengyuanchen/cropper/issues/476
- context.drawImage.apply(context, [source].concat(toConsumableArray(params.map(function (param) {
+
+ context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
-
return canvas;
},
-
/**
* Change the aspect ratio of the crop box.
* @param {number} aspectRatio - The new aspect ratio.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setAspectRatio: function setAspectRatio(aspectRatio) {
var options = this.options;
-
if (!this.disabled && !isUndefined(aspectRatio)) {
// 0 -> NaN
options.aspectRatio = Math.max(0, aspectRatio) || NaN;
@@ -3308,24 +3162,21 @@ var methods = {
return this;
},
-
/**
* Change the drag mode.
* @param {string} mode - The new drag mode.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setDragMode: function setDragMode(mode) {
var options = this.options,
dragBox = this.dragBox,
face = this.face;
-
- if (this.loaded && !this.disabled) {
+ if (this.ready && !this.disabled) {
var croppable = mode === DRAG_MODE_CROP;
var movable = options.movable && mode === DRAG_MODE_MOVE;
-
mode = croppable || movable ? mode : DRAG_MODE_NONE;
-
+ options.dragMode = mode;
setData(dragBox, DATA_ACTION, mode);
toggleClass(dragBox, CLASS_CROP, croppable);
toggleClass(dragBox, CLASS_MOVE, movable);
@@ -3344,7 +3195,9 @@ var methods = {
var AnotherCropper = WINDOW.Cropper;
-var Cropper = function () {
+var Cropper =
+/*#__PURE__*/
+function () {
/**
* Create a new Cropper.
* @param {Element} element - The target element for cropping.
@@ -3352,58 +3205,50 @@ var Cropper = function () {
*/
function Cropper(element) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- classCallCheck(this, Cropper);
+
+ _classCallCheck(this, Cropper);
if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
throw new Error('The first argument is required and must be an <img> or <canvas> element.');
}
this.element = element;
- this.options = extend({}, DEFAULTS, isPlainObject(options) && options);
- this.complete = false;
+ this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
this.cropped = false;
this.disabled = false;
- this.isImg = false;
- this.limited = false;
- this.loaded = false;
+ this.pointers = {};
this.ready = false;
+ this.reloading = false;
this.replaced = false;
- this.wheeling = false;
- this.originalUrl = '';
- this.canvasData = null;
- this.cropBoxData = null;
- this.previews = null;
- this.pointers = {};
+ this.sized = false;
+ this.sizing = false;
this.init();
}
- createClass(Cropper, [{
- key: 'init',
+ _createClass(Cropper, [{
+ key: "init",
value: function init() {
var element = this.element;
-
var tagName = element.tagName.toLowerCase();
- var url = void 0;
+ var url;
- if (getData(element, NAMESPACE)) {
+ if (element[NAMESPACE]) {
return;
}
- setData(element, NAMESPACE, this);
+ element[NAMESPACE] = this;
if (tagName === 'img') {
- this.isImg = true;
+ this.isImg = true; // e.g.: "img/picture.jpg"
- // e.g.: "img/picture.jpg"
url = element.getAttribute('src') || '';
- this.originalUrl = url;
+ this.originalUrl = url; // Stop when it's a blank image
- // Stop when it's a blank image
if (!url) {
return;
- }
+ } // e.g.: "http://example.com/img/picture.jpg"
+
- // e.g.: "http://example.com/img/picture.jpg"
url = element.src;
} else if (tagName === 'canvas' && window.HTMLCanvasElement) {
url = element.toDataURL();
@@ -3412,7 +3257,7 @@ var Cropper = function () {
this.load(url);
}
}, {
- key: 'load',
+ key: "load",
value: function load(url) {
var _this = this;
@@ -3422,59 +3267,88 @@ var Cropper = function () {
this.url = url;
this.imageData = {};
-
var element = this.element,
options = this.options;
+ if (!options.rotatable && !options.scalable) {
+ options.checkOrientation = false;
+ } // Only IE10+ supports Typed Arrays
+
if (!options.checkOrientation || !window.ArrayBuffer) {
this.clone();
return;
- }
+ } // Detect the mime type of the image directly if it is a Data URL
+
- // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari
if (REGEXP_DATA_URL.test(url)) {
+ // Read ArrayBuffer from Data URL of JPEG images directly for better performance
if (REGEXP_DATA_URL_JPEG.test(url)) {
this.read(dataURLToArrayBuffer(url));
} else {
+ // Only a JPEG image may contains Exif Orientation information,
+ // the rest types of Data URLs are not necessary to check orientation at all.
this.clone();
}
return;
- }
+ } // 1. Detect the mime type of the image by a XMLHttpRequest.
+ // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.
- var xhr = new XMLHttpRequest();
- xhr.onerror = function () {
- _this.clone();
+ var xhr = new XMLHttpRequest();
+ var clone = this.clone.bind(this);
+ this.reloading = true;
+ this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:
+ // http, https, data, chrome, chrome-extension.
+ // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy
+ // in some browsers as IE11 and Safari.
+
+ xhr.onabort = clone;
+ xhr.onerror = clone;
+ xhr.ontimeout = clone;
+
+ xhr.onprogress = function () {
+ // Abort the request directly if it not a JPEG image for better performance
+ if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {
+ xhr.abort();
+ }
};
xhr.onload = function () {
_this.read(xhr.response);
};
+ xhr.onloadend = function () {
+ _this.reloading = false;
+ _this.xhr = null;
+ }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error
+
+
if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
url = addTimestamp(url);
}
- xhr.open('get', url);
+ xhr.open('GET', url);
xhr.responseType = 'arraybuffer';
xhr.withCredentials = element.crossOrigin === 'use-credentials';
xhr.send();
}
}, {
- key: 'read',
+ key: "read",
value: function read(arrayBuffer) {
var options = this.options,
- imageData = this.imageData;
+ imageData = this.imageData; // Reset the orientation value to its default value 1
+ // as some iOS browsers will render image with its orientation
- var orientation = getOrientation(arrayBuffer);
+ var orientation = resetAndGetOrientation(arrayBuffer);
var rotate = 0;
var scaleX = 1;
var scaleY = 1;
if (orientation > 1) {
- this.url = arrayBufferToDataURL(arrayBuffer, 'image/jpeg');
+ // Generate a new URL which has the default orientation value
+ this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
var _parseOrientation = parseOrientation(orientation);
@@ -3495,31 +3369,24 @@ var Cropper = function () {
this.clone();
}
}, {
- key: 'clone',
+ key: "clone",
value: function clone() {
var element = this.element,
url = this.url;
-
- var crossOrigin = void 0;
- var crossOriginUrl = void 0;
+ var crossOrigin = element.crossOrigin;
+ var crossOriginUrl = url;
if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
- crossOrigin = element.crossOrigin;
-
-
- if (crossOrigin) {
- crossOriginUrl = url;
- } else {
+ if (!crossOrigin) {
crossOrigin = 'anonymous';
+ } // Bust cache when there is not a "crossOrigin" property (#519)
- // Bust cache when there is not a "crossOrigin" property
- crossOriginUrl = addTimestamp(url);
- }
+
+ crossOriginUrl = addTimestamp(url);
}
this.crossOrigin = crossOrigin;
this.crossOriginUrl = crossOriginUrl;
-
var image = document.createElement('img');
if (crossOrigin) {
@@ -3527,138 +3394,126 @@ var Cropper = function () {
}
image.src = crossOriginUrl || url;
-
- var start = proxy(this.start, this);
- var stop = proxy(this.stop, this);
-
+ image.alt = element.alt || 'The image to crop';
this.image = image;
- this.onStart = start;
- this.onStop = stop;
-
- if (this.isImg) {
- if (element.complete) {
- this.start();
- } else {
- addListener(element, EVENT_LOAD, start);
- }
- } else {
- addListener(image, EVENT_LOAD, start);
- addListener(image, EVENT_ERROR, stop);
- addClass(image, CLASS_HIDE);
- element.parentNode.insertBefore(image, element.nextSibling);
- }
+ image.onload = this.start.bind(this);
+ image.onerror = this.stop.bind(this);
+ addClass(image, CLASS_HIDE);
+ element.parentNode.insertBefore(image, element.nextSibling);
}
}, {
- key: 'start',
- value: function start(event) {
+ key: "start",
+ value: function start() {
var _this2 = this;
- var image = this.isImg ? this.element : this.image;
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,
+ // such as Safari for iOS, Chrome for iOS, and in-app browsers.
- if (event) {
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- }
+ var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
- getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
- extend(_this2.imageData, {
+ var done = function done(naturalWidth, naturalHeight) {
+ assign(_this2.imageData, {
naturalWidth: naturalWidth,
naturalHeight: naturalHeight,
aspectRatio: naturalWidth / naturalHeight
});
- _this2.loaded = true;
+ _this2.sizing = false;
+ _this2.sized = true;
+
_this2.build();
- });
+ }; // Most modern browsers (excepts iOS WebKit)
+
+
+ if (image.naturalWidth && !isIOSWebKit) {
+ done(image.naturalWidth, image.naturalHeight);
+ return;
+ }
+
+ var sizingImage = document.createElement('img');
+ var body = document.body || document.documentElement;
+ this.sizingImage = sizingImage;
+
+ sizingImage.onload = function () {
+ done(sizingImage.width, sizingImage.height);
+
+ if (!isIOSWebKit) {
+ body.removeChild(sizingImage);
+ }
+ };
+
+ sizingImage.src = image.src; // iOS WebKit will convert the image automatically
+ // with its orientation once append it into DOM (#279)
+
+ if (!isIOSWebKit) {
+ sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
+ body.appendChild(sizingImage);
+ }
}
}, {
- key: 'stop',
+ key: "stop",
value: function stop() {
var image = this.image;
-
-
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
+ image.onload = null;
+ image.onerror = null;
image.parentNode.removeChild(image);
this.image = null;
}
}, {
- key: 'build',
+ key: "build",
value: function build() {
- var _this3 = this;
-
- if (!this.loaded) {
+ if (!this.sized || this.ready) {
return;
}
- // Unbuild first when replace
- if (this.ready) {
- this.unbuild();
- }
-
var element = this.element,
options = this.options,
- image = this.image;
-
- // Create cropper elements
+ image = this.image; // Create cropper elements
var container = element.parentNode;
var template = document.createElement('div');
-
template.innerHTML = TEMPLATE;
-
- var cropper = template.querySelector('.' + NAMESPACE + '-container');
- var canvas = cropper.querySelector('.' + NAMESPACE + '-canvas');
- var dragBox = cropper.querySelector('.' + NAMESPACE + '-drag-box');
- var cropBox = cropper.querySelector('.' + NAMESPACE + '-crop-box');
- var face = cropBox.querySelector('.' + NAMESPACE + '-face');
-
+ var cropper = template.querySelector(".".concat(NAMESPACE, "-container"));
+ var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas"));
+ var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box"));
+ var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box"));
+ var face = cropBox.querySelector(".".concat(NAMESPACE, "-face"));
this.container = container;
this.cropper = cropper;
this.canvas = canvas;
this.dragBox = dragBox;
this.cropBox = cropBox;
- this.viewBox = cropper.querySelector('.' + NAMESPACE + '-view-box');
+ this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box"));
this.face = face;
+ canvas.appendChild(image); // Hide the original image
- canvas.appendChild(image);
-
- // Hide the original image
- addClass(element, CLASS_HIDDEN);
+ addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image
- // Inserts the cropper after to the current image
- container.insertBefore(cropper, element.nextSibling);
+ container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden
- // Show the image if is hidden
if (!this.isImg) {
removeClass(image, CLASS_HIDE);
}
this.initPreview();
this.bind();
-
+ options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
-
- this.cropped = options.autoCrop;
-
- if (options.autoCrop) {
- if (options.modal) {
- addClass(dragBox, CLASS_MODAL);
- }
- } else {
- addClass(cropBox, CLASS_HIDDEN);
- }
+ addClass(cropBox, CLASS_HIDDEN);
if (!options.guides) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-dashed'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN);
}
if (!options.center) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-center'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN);
}
if (options.background) {
- addClass(cropper, NAMESPACE + '-bg');
+ addClass(cropper, "".concat(NAMESPACE, "-bg"));
}
if (!options.highlight) {
@@ -3671,90 +3526,85 @@ var Cropper = function () {
}
if (!options.cropBoxResizable) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-line'), CLASS_HIDDEN);
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-point'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN);
}
- this.setDragMode(options.dragMode);
this.render();
this.ready = true;
- this.setData(options.data);
+ this.setDragMode(options.dragMode);
- // Call the "ready" option asynchronously to keep "image.cropper" is defined
- this.completing = setTimeout(function () {
- if (isFunction(options.ready)) {
- addListener(element, EVENT_READY, options.ready, {
- once: true
- });
- }
+ if (options.autoCrop) {
+ this.crop();
+ }
- dispatchEvent(element, EVENT_READY);
- dispatchEvent(element, EVENT_CROP, _this3.getData());
+ this.setData(options.data);
- _this3.complete = true;
- }, 0);
+ if (isFunction(options.ready)) {
+ addListener(element, EVENT_READY, options.ready, {
+ once: true
+ });
+ }
+
+ dispatchEvent(element, EVENT_READY);
}
}, {
- key: 'unbuild',
+ key: "unbuild",
value: function unbuild() {
if (!this.ready) {
return;
}
- if (!this.complete) {
- clearTimeout(this.completing);
- }
-
this.ready = false;
- this.complete = false;
- this.initialImageData = null;
-
- // Clear `initialCanvasData` is necessary when replace
- this.initialCanvasData = null;
- this.initialCropBoxData = null;
- this.containerData = null;
- this.canvasData = null;
-
- // Clear `cropBoxData` is necessary when replace
- this.cropBoxData = null;
this.unbind();
this.resetPreview();
- this.previews = null;
- this.viewBox = null;
- this.cropBox = null;
- this.dragBox = null;
- this.canvas = null;
- this.container = null;
this.cropper.parentNode.removeChild(this.cropper);
- this.cropper = null;
+ removeClass(this.element, CLASS_HIDDEN);
+ }
+ }, {
+ key: "uncreate",
+ value: function uncreate() {
+ if (this.ready) {
+ this.unbuild();
+ this.ready = false;
+ this.cropped = false;
+ } else if (this.sizing) {
+ this.sizingImage.onload = null;
+ this.sizing = false;
+ this.sized = false;
+ } else if (this.reloading) {
+ this.xhr.onabort = null;
+ this.xhr.abort();
+ } else if (this.image) {
+ this.stop();
+ }
}
-
/**
* Get the no conflict cropper class.
* @returns {Cropper} The cropper class.
*/
}], [{
- key: 'noConflict',
+ key: "noConflict",
value: function noConflict() {
window.Cropper = AnotherCropper;
return Cropper;
}
-
/**
* Change the default options.
* @param {Object} options - The new default options.
*/
}, {
- key: 'setDefaults',
+ key: "setDefaults",
value: function setDefaults(options) {
- extend(DEFAULTS, isPlainObject(options) && options);
+ assign(DEFAULTS, isPlainObject(options) && options);
}
}]);
+
return Cropper;
}();
-extend(Cropper.prototype, render, preview, events, handlers, change, methods);
+assign(Cropper.prototype, render, preview, events, handlers, change, methods);
module.exports = Cropper;
diff --git a/library/cropperjs/dist/cropper.css b/library/cropperjs/dist/cropper.css
index dd22178fe..d54319a64 100644
--- a/library/cropperjs/dist/cropper.css
+++ b/library/cropperjs/dist/cropper.css
@@ -1,11 +1,11 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:26:29.610Z
+ * Date: 2019-10-04T04:33:44.164Z
*/
.cropper-container {
@@ -21,8 +21,7 @@
user-select: none;
}
-.cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)
- */
+.cropper-container img {
display: block;
height: 100%;
image-orientation: 0deg;
@@ -57,14 +56,14 @@
.cropper-modal {
background-color: #000;
- opacity: .5;
+ opacity: 0.5;
}
.cropper-view-box {
display: block;
height: 100%;
- outline-color: rgba(51, 153, 255, 0.75);
outline: 1px solid #39f;
+ outline-color: rgba(51, 153, 255, 0.75);
overflow: hidden;
width: 100%;
}
@@ -72,16 +71,16 @@
.cropper-dashed {
border: 0 dashed #eee;
display: block;
- opacity: .5;
+ opacity: 0.5;
position: absolute;
}
.cropper-dashed.dashed-h {
border-bottom-width: 1px;
border-top-width: 1px;
- height: 33.33333%;
+ height: calc(100% / 3);
left: 0;
- top: 33.33333%;
+ top: calc(100% / 3);
width: 100%;
}
@@ -89,37 +88,37 @@
border-left-width: 1px;
border-right-width: 1px;
height: 100%;
- left: 33.33333%;
+ left: calc(100% / 3);
top: 0;
- width: 33.33333%;
+ width: calc(100% / 3);
}
.cropper-center {
display: block;
height: 0;
left: 50%;
- opacity: .75;
+ opacity: 0.75;
position: absolute;
top: 50%;
width: 0;
}
-.cropper-center:before,
-.cropper-center:after {
+.cropper-center::before,
+.cropper-center::after {
background-color: #eee;
content: ' ';
display: block;
position: absolute;
}
-.cropper-center:before {
+.cropper-center::before {
height: 1px;
left: -3px;
top: 0;
width: 7px;
}
-.cropper-center:after {
+.cropper-center::after {
height: 7px;
left: 0;
top: -3px;
@@ -131,7 +130,7 @@
.cropper-point {
display: block;
height: 100%;
- opacity: .1;
+ opacity: 0.1;
position: absolute;
width: 100%;
}
@@ -177,7 +176,7 @@
.cropper-point {
background-color: #39f;
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
}
@@ -253,12 +252,12 @@
@media (min-width: 1200px) {
.cropper-point.point-se {
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
}
}
-.cropper-point.point-se:before {
+.cropper-point.point-se::before {
background-color: #39f;
bottom: -50%;
content: ' ';
@@ -303,4 +302,3 @@
.cropper-disabled .cropper-point {
cursor: not-allowed;
}
-
diff --git a/library/cropperjs/dist/cropper.esm.js b/library/cropperjs/dist/cropper.esm.js
index 929852d8a..55bb43ec3 100644
--- a/library/cropperjs/dist/cropper.esm.js
+++ b/library/cropperjs/dist/cropper.esm.js
@@ -1,17 +1,124 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:27:18.062Z
+ * Date: 2019-10-04T04:33:48.372Z
*/
-var WINDOW = typeof window !== 'undefined' ? window : {};
-var NAMESPACE = 'cropper';
+function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+
+ return _typeof(obj);
+}
+
+function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+}
+
+function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+}
+
+function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ return Constructor;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+
+ if (i % 2) {
+ ownKeys(source, true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(source).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+
+ return target;
+}
+
+function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
+}
+
+function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+}
+
+function _iterableToArray(iter) {
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
+}
+
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
+}
+
+var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+var WINDOW = IS_BROWSER ? window : {};
+var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+var NAMESPACE = 'cropper'; // Actions
-// Actions
var ACTION_ALL = 'all';
var ACTION_CROP = 'crop';
var ACTION_MOVE = 'move';
@@ -23,127 +130,107 @@ var ACTION_NORTH = 'n';
var ACTION_NORTH_EAST = 'ne';
var ACTION_NORTH_WEST = 'nw';
var ACTION_SOUTH_EAST = 'se';
-var ACTION_SOUTH_WEST = 'sw';
-
-// Classes
-var CLASS_CROP = NAMESPACE + '-crop';
-var CLASS_DISABLED = NAMESPACE + '-disabled';
-var CLASS_HIDDEN = NAMESPACE + '-hidden';
-var CLASS_HIDE = NAMESPACE + '-hide';
-var CLASS_INVISIBLE = NAMESPACE + '-invisible';
-var CLASS_MODAL = NAMESPACE + '-modal';
-var CLASS_MOVE = NAMESPACE + '-move';
-
-// Data keys
-var DATA_ACTION = 'action';
-var DATA_PREVIEW = 'preview';
-
-// Drag modes
+var ACTION_SOUTH_WEST = 'sw'; // Classes
+
+var CLASS_CROP = "".concat(NAMESPACE, "-crop");
+var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
+var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
+var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
+var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys
+
+var DATA_ACTION = "".concat(NAMESPACE, "Action");
+var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes
+
var DRAG_MODE_CROP = 'crop';
var DRAG_MODE_MOVE = 'move';
-var DRAG_MODE_NONE = 'none';
+var DRAG_MODE_NONE = 'none'; // Events
-// Events
var EVENT_CROP = 'crop';
var EVENT_CROP_END = 'cropend';
var EVENT_CROP_MOVE = 'cropmove';
var EVENT_CROP_START = 'cropstart';
var EVENT_DBLCLICK = 'dblclick';
-var EVENT_ERROR = 'error';
-var EVENT_LOAD = 'load';
-var EVENT_POINTER_DOWN = WINDOW.PointerEvent ? 'pointerdown' : 'touchstart mousedown';
-var EVENT_POINTER_MOVE = WINDOW.PointerEvent ? 'pointermove' : 'touchmove mousemove';
-var EVENT_POINTER_UP = WINDOW.PointerEvent ? 'pointerup pointercancel' : 'touchend touchcancel mouseup';
+var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
var EVENT_READY = 'ready';
var EVENT_RESIZE = 'resize';
-var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
-var EVENT_ZOOM = 'zoom';
+var EVENT_WHEEL = 'wheel';
+var EVENT_ZOOM = 'zoom'; // Mime types
+
+var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps
-// RegExps
-var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
+var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
var REGEXP_DATA_URL = /^data:/;
var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
-var REGEXP_TAG_NAME = /^(img|canvas)$/i;
+var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
+// Inspired by the default width and height of a canvas element.
+
+var MIN_CONTAINER_WIDTH = 200;
+var MIN_CONTAINER_HEIGHT = 100;
var DEFAULTS = {
// Define the view mode of the cropper
- viewMode: 0, // 0, 1, 2, 3
-
+ viewMode: 0,
+ // 0, 1, 2, 3
// Define the dragging mode of the cropper
- dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none'
-
+ dragMode: DRAG_MODE_CROP,
+ // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
// Define the aspect ratio of the crop box
aspectRatio: NaN,
-
// An object with the previous cropping result data
data: null,
-
// A selector for adding extra containers to preview
preview: '',
-
// Re-render the cropper when resize the window
responsive: true,
-
// Restore the cropped area after resize the window
restore: true,
-
// Check if the current image is a cross-origin image
checkCrossOrigin: true,
-
// Check the current image's Exif Orientation information
checkOrientation: true,
-
// Show the black modal
modal: true,
-
// Show the dashed lines for guiding
guides: true,
-
// Show the center indicator for guiding
center: true,
-
// Show the white modal to highlight the crop box
highlight: true,
-
// Show the grid background
background: true,
-
// Enable to crop the image automatically when initialize
autoCrop: true,
-
// Define the percentage of automatic cropping area when initializes
autoCropArea: 0.8,
-
// Enable to move the image
movable: true,
-
// Enable to rotate the image
rotatable: true,
-
// Enable to scale the image
scalable: true,
-
// Enable to zoom the image
zoomable: true,
-
// Enable to zoom the image by dragging touch
zoomOnTouch: true,
-
// Enable to zoom the image by wheeling mouse
zoomOnWheel: true,
-
// Define zoom ratio when zoom the image by wheeling mouse
wheelZoomRatio: 0.1,
-
// Enable to move the crop box
cropBoxMovable: true,
-
// Enable to resize the crop box
cropBoxResizable: true,
-
// Toggle drag mode between "crop" and "move" when click twice on the cropper
toggleDragModeOnDblclick: true,
-
// Size limitation
minCanvasWidth: 0,
minCanvasHeight: 0,
@@ -151,7 +238,6 @@ var DEFAULTS = {
minCropBoxHeight: 0,
minContainerWidth: 200,
minContainerHeight: 100,
-
// Shortcuts of events
ready: null,
cropstart: null,
@@ -161,132 +247,50 @@ var DEFAULTS = {
zoom: null
};
-var TEMPLATE = '<div class="cropper-container">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-action="e"></span>' + '<span class="cropper-line line-n" data-action="n"></span>' + '<span class="cropper-line line-w" data-action="w"></span>' + '<span class="cropper-line line-s" data-action="s"></span>' + '<span class="cropper-point point-e" data-action="e"></span>' + '<span class="cropper-point point-n" data-action="n"></span>' + '<span class="cropper-point point-w" data-action="w"></span>' + '<span class="cropper-point point-s" data-action="s"></span>' + '<span class="cropper-point point-ne" data-action="ne"></span>' + '<span class="cropper-point point-nw" data-action="nw"></span>' + '<span class="cropper-point point-sw" data-action="sw"></span>' + '<span class="cropper-point point-se" data-action="se"></span>' + '</div>' + '</div>';
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-
-
-
-
-
-
-
-
-
-
-var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-};
-
-var createClass = function () {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
-
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
- return Constructor;
- };
-}();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var toConsumableArray = function (arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
-
- return arr2;
- } else {
- return Array.from(arr);
- }
-};
+var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>';
/**
* Check if the given value is not a number.
*/
-var isNaN = Number.isNaN || WINDOW.isNaN;
+var isNaN = Number.isNaN || WINDOW.isNaN;
/**
* Check if the given value is a number.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is a number, else `false`.
*/
+
function isNumber(value) {
return typeof value === 'number' && !isNaN(value);
}
+/**
+ * Check if the given value is a positive number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
+ */
+var isPositiveNumber = function isPositiveNumber(value) {
+ return value > 0 && value < Infinity;
+};
/**
* Check if the given value is undefined.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is undefined, else `false`.
*/
+
function isUndefined(value) {
return typeof value === 'undefined';
}
-
/**
* Check if the given value is an object.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is an object, else `false`.
*/
+
function isObject(value) {
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null;
+ return _typeof(value) === 'object' && value !== null;
}
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
-
/**
* Check if the given value is a plain object.
* @param {*} value - The value to check.
@@ -301,41 +305,45 @@ function isPlainObject(value) {
try {
var _constructor = value.constructor;
var prototype = _constructor.prototype;
-
-
return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
- } catch (e) {
+ } catch (error) {
return false;
}
}
-
/**
* Check if the given value is a function.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is a function, else `false`.
*/
+
function isFunction(value) {
return typeof value === 'function';
}
+var slice = Array.prototype.slice;
+/**
+ * Convert array-like or iterable object to an array.
+ * @param {*} value - The value to convert.
+ * @returns {Array} Returns a new array.
+ */
+function toArray(value) {
+ return Array.from ? Array.from(value) : slice.call(value);
+}
/**
* Iterate the given data.
* @param {*} data - The data to iterate.
* @param {Function} callback - The process function for each element.
* @returns {*} The original data.
*/
-function each(data, callback) {
- if (data && isFunction(callback)) {
- if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
- var length = data.length;
- var i = void 0;
-
- for (i = 0; i < length; i += 1) {
- if (callback.call(data, data[i], i, data) === false) {
- break;
- }
- }
+function forEach(data, callback) {
+ if (data && isFunction(callback)) {
+ if (Array.isArray(data) || isNumber(data.length)
+ /* array-like */
+ ) {
+ toArray(data).forEach(function (value, key) {
+ callback.call(data, value, key, data);
+ });
} else if (isObject(data)) {
Object.keys(data).forEach(function (key) {
callback.call(data, data[key], key, data);
@@ -345,112 +353,83 @@ function each(data, callback) {
return data;
}
-
/**
* Extend the given object.
- * @param {*} obj - The object to be extended.
- * @param {*} args - The rest objects which will be merged to the first object.
+ * @param {*} target - The target object to extend.
+ * @param {*} args - The rest objects for merging to the target object.
* @returns {Object} The extended object.
*/
-function extend(obj) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+
+var assign = Object.assign || function assign(target) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
- if (isObject(obj) && args.length > 0) {
- if (Object.assign) {
- return Object.assign.apply(Object, [obj].concat(args));
- }
-
+ if (isObject(target) && args.length > 0) {
args.forEach(function (arg) {
if (isObject(arg)) {
Object.keys(arg).forEach(function (key) {
- obj[key] = arg[key];
+ target[key] = arg[key];
});
}
});
}
- return obj;
-}
-
-/**
- * Takes a function and returns a new one that will always have a particular context.
- * @param {Function} fn - The target function.
- * @param {Object} context - The new context for the function.
- * @returns {boolean} The new function.
- */
-function proxy(fn, context) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- return function () {
- for (var _len3 = arguments.length, args2 = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args2[_key3] = arguments[_key3];
- }
-
- return fn.apply(context, args.concat(args2));
- };
-}
-
-var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/i;
-
+ return target;
+};
+var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
/**
* Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/ }
+ * Check out {@link http://0.30000000000000004.com/}
* @param {number} value - The value to normalize.
* @param {number} [times=100000000000] - The times for normalizing.
* @returns {number} Returns the normalized number.
*/
+
function normalizeDecimalNumber(value) {
var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
-
return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
-
-var REGEXP_SUFFIX = /^(width|height|left|top|marginLeft|marginTop)$/;
-
+var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
/**
* Apply styles to the given element.
* @param {Element} element - The target element.
* @param {Object} styles - The styles for applying.
*/
+
function setStyle(element, styles) {
var style = element.style;
-
-
- each(styles, function (value, property) {
+ forEach(styles, function (value, property) {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
- value += 'px';
+ value = "".concat(value, "px");
}
style[property] = value;
});
}
-
/**
* Check if the given element has a special class.
* @param {Element} element - The element to check.
* @param {string} value - The class to search.
* @returns {boolean} Returns `true` if the special class was found.
*/
+
function hasClass(element, value) {
return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
}
-
/**
* Add classes to the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be added.
*/
+
function addClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
addClass(elem, value);
});
return;
@@ -466,22 +445,22 @@ function addClass(element, value) {
if (!className) {
element.className = value;
} else if (className.indexOf(value) < 0) {
- element.className = className + ' ' + value;
+ element.className = "".concat(className, " ").concat(value);
}
}
-
/**
* Remove classes from the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be removed.
*/
+
function removeClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
removeClass(elem, value);
});
return;
@@ -496,102 +475,131 @@ function removeClass(element, value) {
element.className = element.className.replace(value, '');
}
}
-
/**
* Add or remove classes from the given element.
* @param {Element} element - The target element.
* @param {string} value - The classes to be toggled.
* @param {boolean} added - Add only.
*/
+
function toggleClass(element, value, added) {
if (!value) {
return;
}
if (isNumber(element.length)) {
- each(element, function (elem) {
+ forEach(element, function (elem) {
toggleClass(elem, value, added);
});
return;
- }
+ } // IE10-11 doesn't support the second parameter of `classList.toggle`
+
- // IE10-11 doesn't support the second parameter of `classList.toggle`
if (added) {
addClass(element, value);
} else {
removeClass(element, value);
}
}
-
-var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
-
+var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
/**
- * Hyphenate the given value.
- * @param {string} value - The value to hyphenate.
- * @returns {string} The hyphenated value.
+ * Transform the given string from camelCase to kebab-case
+ * @param {string} value - The value to transform.
+ * @returns {string} The transformed value.
*/
-function hyphenate(value) {
- return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
-}
+function toParamCase(value) {
+ return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();
+}
/**
* Get data from the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to get.
* @returns {string} The data value.
*/
+
function getData(element, name) {
if (isObject(element[name])) {
return element[name];
- } else if (element.dataset) {
+ }
+
+ if (element.dataset) {
return element.dataset[name];
}
- return element.getAttribute('data-' + hyphenate(name));
+ return element.getAttribute("data-".concat(toParamCase(name)));
}
-
/**
* Set data to the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to set.
* @param {string} data - The data value.
*/
+
function setData(element, name, data) {
if (isObject(data)) {
element[name] = data;
} else if (element.dataset) {
element.dataset[name] = data;
} else {
- element.setAttribute('data-' + hyphenate(name), data);
+ element.setAttribute("data-".concat(toParamCase(name)), data);
}
}
-
/**
* Remove data from the given element.
* @param {Element} element - The target element.
* @param {string} name - The data key to remove.
*/
+
function removeData(element, name) {
if (isObject(element[name])) {
try {
delete element[name];
- } catch (e) {
- element[name] = null;
+ } catch (error) {
+ element[name] = undefined;
}
} else if (element.dataset) {
// #128 Safari not allows to delete dataset property
try {
delete element.dataset[name];
- } catch (e) {
- element.dataset[name] = null;
+ } catch (error) {
+ element.dataset[name] = undefined;
}
} else {
- element.removeAttribute('data-' + hyphenate(name));
+ element.removeAttribute("data-".concat(toParamCase(name)));
}
}
+var REGEXP_SPACES = /\s\s*/;
-var REGEXP_SPACES = /\s+/;
+var onceSupported = function () {
+ var supported = false;
+ if (IS_BROWSER) {
+ var once = false;
+
+ var listener = function listener() {};
+
+ var options = Object.defineProperty({}, 'once', {
+ get: function get() {
+ supported = true;
+ return once;
+ },
+
+ /**
+ * This setter can fix a `TypeError` in strict mode
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+ * @param {boolean} value - The value to set
+ */
+ set: function set(value) {
+ once = value;
+ }
+ });
+ WINDOW.addEventListener('test', listener, options);
+ WINDOW.removeEventListener('test', listener, options);
+ }
+
+ return supported;
+}();
/**
* Remove event listener from the target element.
* @param {Element} element - The event target.
@@ -599,29 +607,32 @@ var REGEXP_SPACES = /\s+/;
* @param {Function} listener - The event listener.
* @param {Object} options - The event options.
*/
+
+
function removeListener(element, type, listener) {
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (!onceSupported) {
+ var listeners = element.listeners;
- if (!isFunction(listener)) {
- return;
- }
+ if (listeners && listeners[event] && listeners[event][listener]) {
+ handler = listeners[event][listener];
+ delete listeners[event][listener];
- var types = type.trim().split(REGEXP_SPACES);
+ if (Object.keys(listeners[event]).length === 0) {
+ delete listeners[event];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- removeListener(element, t, listener, options);
- });
- return;
- }
+ if (Object.keys(listeners).length === 0) {
+ delete element.listeners;
+ }
+ }
+ }
- if (element.removeEventListener) {
- element.removeEventListener(type, listener, options);
- } else if (element.detachEvent) {
- element.detachEvent('on' + type, listener);
- }
+ element.removeEventListener(event, handler, options);
+ });
}
-
/**
* Add event listener to the target element.
* @param {Element} element - The event target.
@@ -629,42 +640,41 @@ function removeListener(element, type, listener) {
* @param {Function} listener - The event listener.
* @param {Object} options - The event options.
*/
-function addListener(element, type, _listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
-
- if (!isFunction(_listener)) {
- return;
- }
- var types = type.trim().split(REGEXP_SPACES);
+function addListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var _handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (options.once && !onceSupported) {
+ var _element$listeners = element.listeners,
+ listeners = _element$listeners === void 0 ? {} : _element$listeners;
+
+ _handler = function handler() {
+ delete listeners[event][listener];
+ element.removeEventListener(event, _handler, options);
+
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- addListener(element, t, _listener, options);
- });
- return;
- }
+ listener.apply(element, args);
+ };
- if (options.once) {
- var originalListener = _listener;
+ if (!listeners[event]) {
+ listeners[event] = {};
+ }
- _listener = function listener() {
- for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
+ if (listeners[event][listener]) {
+ element.removeEventListener(event, listeners[event][listener], options);
}
- removeListener(element, type, _listener, options);
- return originalListener.apply(element, args);
- };
- }
+ listeners[event][listener] = _handler;
+ element.listeners = listeners;
+ }
- if (element.addEventListener) {
- element.addEventListener(type, _listener, options);
- } else if (element.attachEvent) {
- element.attachEvent('on' + type, _listener);
- }
+ element.addEventListener(event, _handler, options);
+ });
}
-
/**
* Dispatch event on the target element.
* @param {Element} element - The event target.
@@ -672,187 +682,113 @@ function addListener(element, type, _listener) {
* @param {Object} data - The additional event data.
* @returns {boolean} Indicate if the event is default prevented or not.
*/
+
function dispatchEvent(element, type, data) {
- if (element.dispatchEvent) {
- var event = void 0;
-
- // Event and CustomEvent on IE9-11 are global objects, not constructors
- if (isFunction(Event) && isFunction(CustomEvent)) {
- if (isUndefined(data)) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true
- });
- }
- } else if (isUndefined(data)) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
- } else {
- event = document.createEvent('CustomEvent');
- event.initCustomEvent(type, true, true, data);
- }
+ var event; // Event and CustomEvent on IE9-11 are global objects, not constructors
- // IE9+
- return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent('on' + type);
+ if (isFunction(Event) && isFunction(CustomEvent)) {
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true
+ });
+ } else {
+ event = document.createEvent('CustomEvent');
+ event.initCustomEvent(type, true, true, data);
}
- return true;
+ return element.dispatchEvent(event);
}
-
/**
* Get the offset base on the document.
* @param {Element} element - The target element.
* @returns {Object} The offset data.
*/
+
function getOffset(element) {
- var doc = document.documentElement;
var box = element.getBoundingClientRect();
-
return {
- left: box.left + ((window.scrollX || doc && doc.scrollLeft || 0) - (doc && doc.clientLeft || 0)),
- top: box.top + ((window.scrollY || doc && doc.scrollTop || 0) - (doc && doc.clientTop || 0))
+ left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+ top: box.top + (window.pageYOffset - document.documentElement.clientTop)
};
}
-
-/**
- * Empty an element.
- * @param {Element} element - The element to empty.
- */
-function empty(element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
- }
-}
-
var location = WINDOW.location;
-
-var REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
-
+var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
/**
* Check if the given URL is a cross origin URL.
* @param {string} url - The target URL.
* @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
*/
+
function isCrossOriginURL(url) {
var parts = url.match(REGEXP_ORIGINS);
-
- return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
+ return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
}
-
/**
* Add timestamp to the given URL.
* @param {string} url - The target URL.
* @returns {string} The result URL.
*/
-function addTimestamp(url) {
- var timestamp = 'timestamp=' + new Date().getTime();
+function addTimestamp(url) {
+ var timestamp = "timestamp=".concat(new Date().getTime());
return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
}
-
/**
* Get transforms base on the given object.
* @param {Object} obj - The target object.
* @returns {string} A string contains transform values.
*/
+
function getTransforms(_ref) {
var rotate = _ref.rotate,
scaleX = _ref.scaleX,
scaleY = _ref.scaleY,
translateX = _ref.translateX,
translateY = _ref.translateY;
-
var values = [];
if (isNumber(translateX) && translateX !== 0) {
- values.push('translateX(' + translateX + 'px)');
+ values.push("translateX(".concat(translateX, "px)"));
}
if (isNumber(translateY) && translateY !== 0) {
- values.push('translateY(' + translateY + 'px)');
- }
+ values.push("translateY(".concat(translateY, "px)"));
+ } // Rotate should come first before scale to match orientation transform
+
- // Rotate should come first before scale to match orientation transform
if (isNumber(rotate) && rotate !== 0) {
- values.push('rotate(' + rotate + 'deg)');
+ values.push("rotate(".concat(rotate, "deg)"));
}
if (isNumber(scaleX) && scaleX !== 1) {
- values.push('scaleX(' + scaleX + ')');
+ values.push("scaleX(".concat(scaleX, ")"));
}
if (isNumber(scaleY) && scaleY !== 1) {
- values.push('scaleY(' + scaleY + ')');
+ values.push("scaleY(".concat(scaleY, ")"));
}
var transform = values.length ? values.join(' ') : 'none';
-
return {
WebkitTransform: transform,
msTransform: transform,
transform: transform
};
}
-
-var navigator = WINDOW.navigator;
-
-var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
-
-/**
- * Get an image's natural sizes.
- * @param {string} image - The target image.
- * @param {Function} callback - The callback function.
- */
-function getImageNaturalSizes(image, callback) {
- // Modern browsers (except Safari)
- if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
- callback(image.naturalWidth, image.naturalHeight);
- return;
- }
-
- var newImage = document.createElement('img');
- var body = document.body || document.documentElement;
-
- newImage.onload = function () {
- callback(newImage.width, newImage.height);
-
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- body.removeChild(newImage);
- }
- };
-
- newImage.src = image.src;
-
- // iOS Safari will convert the image automatically
- // with its orientation once append it into DOM (#279)
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
- body.appendChild(newImage);
- }
-}
-
/**
* Get the max ratio of a group of pointers.
* @param {string} pointers - The target pointers.
* @returns {number} The result ratio.
*/
+
function getMaxZoomRatio(pointers) {
- var pointers2 = extend({}, pointers);
- var ratios = [];
+ var pointers2 = _objectSpread2({}, pointers);
- each(pointers, function (pointer, pointerId) {
+ var ratios = [];
+ forEach(pointers, function (pointer, pointerId) {
delete pointers2[pointerId];
-
- each(pointers2, function (pointer2) {
+ forEach(pointers2, function (pointer2) {
var x1 = Math.abs(pointer.startX - pointer2.startX);
var y1 = Math.abs(pointer.startY - pointer2.startY);
var x2 = Math.abs(pointer.endX - pointer2.endX);
@@ -860,99 +796,84 @@ function getMaxZoomRatio(pointers) {
var z1 = Math.sqrt(x1 * x1 + y1 * y1);
var z2 = Math.sqrt(x2 * x2 + y2 * y2);
var ratio = (z2 - z1) / z1;
-
ratios.push(ratio);
});
});
-
ratios.sort(function (a, b) {
return Math.abs(a) < Math.abs(b);
});
-
return ratios[0];
}
-
/**
* Get a pointer from an event object.
* @param {Object} event - The target event object.
* @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
* @returns {Object} The result pointer contains start and/or end point coordinates.
*/
+
function getPointer(_ref2, endOnly) {
var pageX = _ref2.pageX,
pageY = _ref2.pageY;
-
var end = {
endX: pageX,
endY: pageY
};
-
- if (endOnly) {
- return end;
- }
-
- return extend({
+ return endOnly ? end : _objectSpread2({
startX: pageX,
startY: pageY
}, end);
}
-
/**
* Get the center point coordinate of a group of pointers.
* @param {Object} pointers - The target pointers.
* @returns {Object} The center point coordinate.
*/
+
function getPointersCenter(pointers) {
var pageX = 0;
var pageY = 0;
var count = 0;
-
- each(pointers, function (_ref3) {
+ forEach(pointers, function (_ref3) {
var startX = _ref3.startX,
startY = _ref3.startY;
-
pageX += startX;
pageY += startY;
count += 1;
});
-
pageX /= count;
pageY /= count;
-
return {
pageX: pageX,
pageY: pageY
};
}
-
-/**
- * Check if the given value is a finite number.
- */
-var isFinite = Number.isFinite || WINDOW.isFinite;
-
/**
* Get the max sizes in a rectangle under the given aspect ratio.
* @param {Object} data - The original sizes.
+ * @param {string} [type='contain'] - The adjust type.
* @returns {Object} The result sizes.
*/
-function getContainSizes(_ref4) {
+
+function getAdjustedSizes(_ref4) // or 'cover'
+{
var aspectRatio = _ref4.aspectRatio,
height = _ref4.height,
width = _ref4.width;
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';
+ var isValidWidth = isPositiveNumber(width);
+ var isValidHeight = isPositiveNumber(height);
- var isValidNumber = function isValidNumber(value) {
- return isFinite(value) && value > 0;
- };
+ if (isValidWidth && isValidHeight) {
+ var adjustedWidth = height * aspectRatio;
- if (isValidNumber(width) && isValidNumber(height)) {
- if (height * aspectRatio > width) {
+ if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {
height = width / aspectRatio;
} else {
width = height * aspectRatio;
}
- } else if (isValidNumber(width)) {
+ } else if (isValidWidth) {
height = width / aspectRatio;
- } else if (isValidNumber(height)) {
+ } else if (isValidHeight) {
width = height * aspectRatio;
}
@@ -961,17 +882,16 @@ function getContainSizes(_ref4) {
height: height
};
}
-
/**
* Get the new sizes of a rectangle after rotated.
* @param {Object} data - The original sizes.
* @returns {Object} The result sizes.
*/
+
function getRotatedSizes(_ref5) {
var width = _ref5.width,
height = _ref5.height,
degree = _ref5.degree;
-
degree = Math.abs(degree) % 180;
if (degree === 90) {
@@ -986,7 +906,6 @@ function getRotatedSizes(_ref5) {
var cosArc = Math.cos(arc);
var newWidth = width * cosArc + height * sinArc;
var newHeight = width * sinArc + height * cosArc;
-
return degree > 90 ? {
width: newHeight,
height: newWidth
@@ -995,7 +914,6 @@ function getRotatedSizes(_ref5) {
height: newHeight
};
}
-
/**
* Get a canvas which drew the given image.
* @param {HTMLImageElement} image - The image for drawing.
@@ -1004,49 +922,63 @@ function getRotatedSizes(_ref5) {
* @param {Object} options - The options.
* @returns {HTMLCanvasElement} The result canvas.
*/
+
function getSourceCanvas(image, _ref6, _ref7, _ref8) {
- var imageNaturalWidth = _ref6.naturalWidth,
+ var imageAspectRatio = _ref6.aspectRatio,
+ imageNaturalWidth = _ref6.naturalWidth,
imageNaturalHeight = _ref6.naturalHeight,
_ref6$rotate = _ref6.rotate,
- rotate = _ref6$rotate === undefined ? 0 : _ref6$rotate,
+ rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,
_ref6$scaleX = _ref6.scaleX,
- scaleX = _ref6$scaleX === undefined ? 1 : _ref6$scaleX,
+ scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,
_ref6$scaleY = _ref6.scaleY,
- scaleY = _ref6$scaleY === undefined ? 1 : _ref6$scaleY;
+ scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;
var aspectRatio = _ref7.aspectRatio,
naturalWidth = _ref7.naturalWidth,
naturalHeight = _ref7.naturalHeight;
var _ref8$fillColor = _ref8.fillColor,
- fillColor = _ref8$fillColor === undefined ? 'transparent' : _ref8$fillColor,
+ fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,
_ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
- imageSmoothingEnabled = _ref8$imageSmoothingE === undefined ? true : _ref8$imageSmoothingE,
+ imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,
_ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
- imageSmoothingQuality = _ref8$imageSmoothingQ === undefined ? 'low' : _ref8$imageSmoothingQ,
+ imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,
_ref8$maxWidth = _ref8.maxWidth,
- maxWidth = _ref8$maxWidth === undefined ? Infinity : _ref8$maxWidth,
+ maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,
_ref8$maxHeight = _ref8.maxHeight,
- maxHeight = _ref8$maxHeight === undefined ? Infinity : _ref8$maxHeight,
+ maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,
_ref8$minWidth = _ref8.minWidth,
- minWidth = _ref8$minWidth === undefined ? 0 : _ref8$minWidth,
+ minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,
_ref8$minHeight = _ref8.minHeight,
- minHeight = _ref8$minHeight === undefined ? 0 : _ref8$minHeight;
-
+ minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
- var maxSizes = getContainSizes({
+ var maxSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: maxWidth,
height: maxHeight
});
- var minSizes = getContainSizes({
+ var minSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: minWidth,
height: minHeight
- });
+ }, 'cover');
var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
- var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
- var params = [-imageNaturalWidth / 2, -imageNaturalHeight / 2, imageNaturalWidth, imageNaturalHeight];
+ var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as
+ // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90
+ var destMaxSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: maxWidth,
+ height: maxHeight
+ });
+ var destMinSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));
+ var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));
+ var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
context.fillStyle = fillColor;
@@ -1057,15 +989,13 @@ function getSourceCanvas(image, _ref6, _ref7, _ref8) {
context.scale(scaleX, scaleY);
context.imageSmoothingEnabled = imageSmoothingEnabled;
context.imageSmoothingQuality = imageSmoothingQuality;
- context.drawImage.apply(context, [image].concat(toConsumableArray(params.map(function (param) {
+ context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
context.restore();
return canvas;
}
-
var fromCharCode = String.fromCharCode;
-
/**
* Get string from char code in data view.
* @param {DataView} dataView - The data view for read.
@@ -1076,133 +1006,139 @@ var fromCharCode = String.fromCharCode;
function getStringFromCharCode(dataView, start, length) {
var str = '';
- var i = void 0;
-
length += start;
- for (i = start; i < length; i += 1) {
+ for (var i = start; i < length; i += 1) {
str += fromCharCode(dataView.getUint8(i));
}
return str;
}
-
var REGEXP_DATA_URL_HEAD = /^data:.*,/;
-
/**
* Transform Data URL to array buffer.
* @param {string} dataURL - The Data URL to transform.
* @returns {ArrayBuffer} The result array buffer.
*/
+
function dataURLToArrayBuffer(dataURL) {
var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
var binary = atob(base64);
var arrayBuffer = new ArrayBuffer(binary.length);
var uint8 = new Uint8Array(arrayBuffer);
-
- each(uint8, function (value, i) {
+ forEach(uint8, function (value, i) {
uint8[i] = binary.charCodeAt(i);
});
-
return arrayBuffer;
}
-
/**
* Transform array buffer to Data URL.
* @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
* @param {string} mimeType - The mime type of the Data URL.
* @returns {string} The result Data URL.
*/
+
function arrayBufferToDataURL(arrayBuffer, mimeType) {
+ var chunks = []; // Chunk Typed Array for better performance (#435)
+
+ var chunkSize = 8192;
var uint8 = new Uint8Array(arrayBuffer);
- var data = '';
- // TypedArray.prototype.forEach is not supported in some browsers.
- each(uint8, function (value) {
- data += fromCharCode(value);
- });
+ while (uint8.length > 0) {
+ // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9
+ // eslint-disable-next-line prefer-spread
+ chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
+ uint8 = uint8.subarray(chunkSize);
+ }
- return 'data:' + mimeType + ';base64,' + btoa(data);
+ return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join('')));
}
-
/**
* Get orientation value from given array buffer.
* @param {ArrayBuffer} arrayBuffer - The array buffer to read.
* @returns {number} The read orientation value.
*/
-function getOrientation(arrayBuffer) {
+
+function resetAndGetOrientation(arrayBuffer) {
var dataView = new DataView(arrayBuffer);
- var orientation = void 0;
- var littleEndian = void 0;
- var app1Start = void 0;
- var ifdStart = void 0;
-
- // Only handle JPEG image (start by 0xFFD8)
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
- var length = dataView.byteLength;
- var offset = 2;
-
- while (offset < length) {
- if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
- app1Start = offset;
- break;
- }
+ var orientation; // Ignores range error when the image does not have correct Exif information
- offset += 1;
- }
- }
+ try {
+ var littleEndian;
+ var app1Start;
+ var ifdStart; // Only handle JPEG image (start by 0xFFD8)
- if (app1Start) {
- var exifIDCode = app1Start + 4;
- var tiffOffset = app1Start + 10;
+ if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
+ var length = dataView.byteLength;
+ var offset = 2;
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
- var endianness = dataView.getUint16(tiffOffset);
+ while (offset + 1 < length) {
+ if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
+ app1Start = offset;
+ break;
+ }
+
+ offset += 1;
+ }
+ }
+
+ if (app1Start) {
+ var exifIDCode = app1Start + 4;
+ var tiffOffset = app1Start + 10;
- littleEndian = endianness === 0x4949;
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
+ var endianness = dataView.getUint16(tiffOffset);
+ littleEndian = endianness === 0x4949;
- if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
- var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
+ if (littleEndian || endianness === 0x4D4D
+ /* bigEndian */
+ ) {
+ if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
+ var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
- if (firstIFDOffset >= 0x00000008) {
- ifdStart = tiffOffset + firstIFDOffset;
+ if (firstIFDOffset >= 0x00000008) {
+ ifdStart = tiffOffset + firstIFDOffset;
+ }
}
}
- }
+ }
}
- }
- if (ifdStart) {
- var _length = dataView.getUint16(ifdStart, littleEndian);
- var _offset = void 0;
- var i = void 0;
+ if (ifdStart) {
+ var _length = dataView.getUint16(ifdStart, littleEndian);
- for (i = 0; i < _length; i += 1) {
- _offset = ifdStart + i * 12 + 2;
+ var _offset;
- if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {
- // 8 is the offset of the current tag's value
- _offset += 8;
+ var i;
- // Get the original orientation value
- orientation = dataView.getUint16(_offset, littleEndian);
+ for (i = 0; i < _length; i += 1) {
+ _offset = ifdStart + i * 12 + 2;
- // Override the orientation with its default value
- dataView.setUint16(_offset, 1, littleEndian);
- break;
- }
+ if (dataView.getUint16(_offset, littleEndian) === 0x0112
+ /* Orientation */
+ ) {
+ // 8 is the offset of the current tag's value
+ _offset += 8; // Get the original orientation value
+
+ orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
+
+ dataView.setUint16(_offset, 1, littleEndian);
+ break;
+ }
+ }
}
+ } catch (error) {
+ orientation = 1;
}
return orientation;
}
-
/**
* Parse Exif Orientation value.
* @param {number} orientation - The orientation to parse.
* @returns {Object} The parsed result.
*/
+
function parseOrientation(orientation) {
var rotate = 0;
var scaleX = 1;
@@ -1213,35 +1149,35 @@ function parseOrientation(orientation) {
case 2:
scaleX = -1;
break;
-
// Rotate left 180°
+
case 3:
rotate = -180;
break;
-
// Flip vertical
+
case 4:
scaleY = -1;
break;
-
// Flip vertical and rotate right 90°
+
case 5:
rotate = 90;
scaleY = -1;
break;
-
// Rotate right 90°
+
case 6:
rotate = 90;
break;
-
// Flip horizontal and rotate right 90°
+
case 7:
rotate = 90;
scaleX = -1;
break;
-
// Rotate left 90°
+
case 8:
rotate = -90;
break;
@@ -1272,34 +1208,25 @@ var render = {
options = this.options,
container = this.container,
cropper = this.cropper;
-
-
addClass(cropper, CLASS_HIDDEN);
removeClass(element, CLASS_HIDDEN);
-
var containerData = {
width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
};
-
this.containerData = containerData;
-
setStyle(cropper, {
width: containerData.width,
height: containerData.height
});
-
addClass(element, CLASS_HIDDEN);
removeClass(cropper, CLASS_HIDDEN);
},
-
-
// Canvas (image wrapper)
initCanvas: function initCanvas() {
var containerData = this.containerData,
imageData = this.imageData;
var viewMode = this.options.viewMode;
-
var rotated = Math.abs(imageData.rotate) % 180 === 90;
var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
@@ -1326,17 +1253,15 @@ var render = {
width: canvasWidth,
height: canvasHeight
};
-
canvasData.left = (containerData.width - canvasWidth) / 2;
canvasData.top = (containerData.height - canvasHeight) / 2;
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
-
this.canvasData = canvasData;
this.limited = viewMode === 1 || viewMode === 2;
this.limitCanvas(true, true);
- this.initialImageData = extend({}, imageData);
- this.initialCanvasData = extend({}, canvasData);
+ this.initialImageData = assign({}, imageData);
+ this.initialCanvasData = assign({}, canvasData);
},
limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
var options = this.options,
@@ -1345,7 +1270,6 @@ var render = {
cropBoxData = this.cropBoxData;
var viewMode = options.viewMode;
var aspectRatio = canvasData.aspectRatio;
-
var cropped = this.cropped && cropBoxData;
if (sizeLimited) {
@@ -1380,16 +1304,14 @@ var render = {
}
}
- var _getContainSizes = getContainSizes({
+ var _getAdjustedSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: minCanvasWidth,
height: minCanvasHeight
});
- minCanvasWidth = _getContainSizes.width;
- minCanvasHeight = _getContainSizes.height;
-
-
+ minCanvasWidth = _getAdjustedSizes.width;
+ minCanvasHeight = _getAdjustedSizes.height;
canvasData.minWidth = minCanvasWidth;
canvasData.minHeight = minCanvasHeight;
canvasData.maxWidth = Infinity;
@@ -1397,10 +1319,9 @@ var render = {
}
if (positionLimited) {
- if (viewMode) {
+ if (viewMode > (cropped ? 0 : 1)) {
var newCanvasLeft = containerData.width - canvasData.width;
var newCanvasTop = containerData.height - canvasData.height;
-
canvasData.minLeft = Math.min(0, newCanvasLeft);
canvasData.minTop = Math.min(0, newCanvasTop);
canvasData.maxLeft = Math.max(0, newCanvasLeft);
@@ -1436,7 +1357,6 @@ var render = {
var canvasData = this.canvasData,
imageData = this.imageData;
-
if (transformed) {
var _getRotatedSizes = getRotatedSizes({
width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
@@ -1448,7 +1368,6 @@ var render = {
var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
-
canvasData.left -= (width - canvasData.width) / 2;
canvasData.top -= (height - canvasData.height) / 2;
canvasData.width = width;
@@ -1469,22 +1388,18 @@ var render = {
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
-
this.limitCanvas(false, true);
-
canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
-
- setStyle(this.canvas, extend({
+ setStyle(this.canvas, assign({
width: canvasData.width,
height: canvasData.height
}, getTransforms({
translateX: canvasData.left,
translateY: canvasData.top
})));
-
this.renderImage(changed);
if (this.cropped && this.limited) {
@@ -1494,20 +1409,18 @@ var render = {
renderImage: function renderImage(changed) {
var canvasData = this.canvasData,
imageData = this.imageData;
-
var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
-
- extend(imageData, {
+ assign(imageData, {
width: width,
height: height,
left: (canvasData.width - width) / 2,
top: (canvasData.height - height) / 2
});
- setStyle(this.image, extend({
+ setStyle(this.image, assign({
width: imageData.width,
height: imageData.height
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: imageData.left,
translateY: imageData.top
}, imageData))));
@@ -1519,8 +1432,7 @@ var render = {
initCropBox: function initCropBox() {
var options = this.options,
canvasData = this.canvasData;
- var aspectRatio = options.aspectRatio;
-
+ var aspectRatio = options.aspectRatio || options.initialAspectRatio;
var autoCropArea = Number(options.autoCropArea) || 0.8;
var cropBoxData = {
width: canvasData.width,
@@ -1536,21 +1448,18 @@ var render = {
}
this.cropBoxData = cropBoxData;
- this.limitCropBox(true, true);
+ this.limitCropBox(true, true); // Initialize auto crop area
- // Initialize auto crop area
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height"
- // The width/height of auto crop area must large than "minWidth/Height"
cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
cropBoxData.oldLeft = cropBoxData.left;
cropBoxData.oldTop = cropBoxData.top;
-
- this.initialCropBoxData = extend({}, cropBoxData);
+ this.initialCropBoxData = assign({}, cropBoxData);
},
limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
var options = this.options,
@@ -1560,14 +1469,12 @@ var render = {
limited = this.limited;
var aspectRatio = options.aspectRatio;
-
if (sizeLimited) {
var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
- var maxCropBoxWidth = Math.min(containerData.width, limited ? canvasData.width : containerData.width);
- var maxCropBoxHeight = Math.min(containerData.height, limited ? canvasData.height : containerData.height);
+ var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;
+ var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height
- // The min/maxCropBoxWidth/Height must be less than container's width/height
minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
@@ -1589,9 +1496,9 @@ var render = {
} else {
maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
}
- }
+ } // The minWidth/Height must be less than maxWidth/Height
+
- // The minWidth/Height must be less than maxWidth/Height
cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
cropBoxData.maxWidth = maxCropBoxWidth;
@@ -1617,7 +1524,6 @@ var render = {
containerData = this.containerData,
cropBoxData = this.cropBoxData;
-
if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
cropBoxData.left = cropBoxData.oldLeft;
}
@@ -1628,9 +1534,7 @@ var render = {
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
this.limitCropBox(false, true);
-
cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
cropBoxData.oldLeft = cropBoxData.left;
@@ -1641,7 +1545,7 @@ var render = {
setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
}
- setStyle(this.cropBox, extend({
+ setStyle(this.cropBox, assign({
width: cropBoxData.width,
height: cropBoxData.height
}, getTransforms({
@@ -1659,19 +1563,17 @@ var render = {
},
output: function output() {
this.preview();
-
- if (this.complete) {
- dispatchEvent(this.element, EVENT_CROP, this.getData());
- }
+ dispatchEvent(this.element, EVENT_CROP, this.getData());
}
};
var preview = {
initPreview: function initPreview() {
- var crossOrigin = this.crossOrigin;
+ var element = this.element,
+ crossOrigin = this.crossOrigin;
var preview = this.options.preview;
-
var url = crossOrigin ? this.crossOriginUrl : this.url;
+ var alt = element.alt || 'The image to preview';
var image = document.createElement('img');
if (crossOrigin) {
@@ -1679,25 +1581,30 @@ var preview = {
}
image.src = url;
+ image.alt = alt;
this.viewBox.appendChild(image);
- this.image2 = image;
+ this.viewBoxImage = image;
if (!preview) {
return;
}
- var previews = preview.querySelector ? [preview] : document.querySelectorAll(preview);
+ var previews = preview;
- this.previews = previews;
+ if (typeof preview === 'string') {
+ previews = element.ownerDocument.querySelectorAll(preview);
+ } else if (preview.querySelector) {
+ previews = [preview];
+ }
- each(previews, function (element) {
- var img = document.createElement('img');
+ this.previews = previews;
+ forEach(previews, function (el) {
+ var img = document.createElement('img'); // Save the original size for recover
- // Save the original size for recover
- setData(element, DATA_PREVIEW, {
- width: element.offsetWidth,
- height: element.offsetHeight,
- html: element.innerHTML
+ setData(el, DATA_PREVIEW, {
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ html: el.innerHTML
});
if (crossOrigin) {
@@ -1705,28 +1612,26 @@ var preview = {
}
img.src = url;
-
+ img.alt = alt;
/**
* Override img element styles
* Add `display:block` to avoid margin top issue
* Add `height:auto` to override `height` attribute on IE8
* (Occur only when margin-top <= -height)
*/
- img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
- empty(element);
- element.appendChild(img);
+ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ el.innerHTML = '';
+ el.appendChild(img);
});
},
resetPreview: function resetPreview() {
- each(this.previews, function (element) {
+ forEach(this.previews, function (element) {
var data = getData(element, DATA_PREVIEW);
-
setStyle(element, {
width: data.width,
height: data.height
});
-
element.innerHTML = data.html;
removeData(element, DATA_PREVIEW);
});
@@ -1739,7 +1644,6 @@ var preview = {
cropBoxHeight = cropBoxData.height;
var width = imageData.width,
height = imageData.height;
-
var left = cropBoxData.left - canvasData.left - imageData.left;
var top = cropBoxData.top - canvasData.top - imageData.top;
@@ -1747,15 +1651,14 @@ var preview = {
return;
}
- setStyle(this.image2, extend({
+ setStyle(this.viewBoxImage, assign({
width: width,
height: height
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left,
translateY: -top
}, imageData))));
-
- each(this.previews, function (element) {
+ forEach(this.previews, function (element) {
var data = getData(element, DATA_PREVIEW);
var originalWidth = data.width;
var originalHeight = data.height;
@@ -1778,11 +1681,10 @@ var preview = {
width: newWidth,
height: newHeight
});
-
- setStyle(element.getElementsByTagName('img')[0], extend({
+ setStyle(element.getElementsByTagName('img')[0], assign({
width: width * ratio,
height: height * ratio
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left * ratio,
translateY: -top * ratio
}, imageData))));
@@ -1796,7 +1698,6 @@ var events = {
options = this.options,
cropper = this.cropper;
-
if (isFunction(options.cropstart)) {
addListener(element, EVENT_CROP_START, options.cropstart);
}
@@ -1817,21 +1718,24 @@ var events = {
addListener(element, EVENT_ZOOM, options.zoom);
}
- addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = proxy(this.cropStart, this));
+ addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
if (options.zoomable && options.zoomOnWheel) {
- addListener(cropper, EVENT_WHEEL, this.onWheel = proxy(this.wheel, this));
+ addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
+ passive: false,
+ capture: true
+ });
}
if (options.toggleDragModeOnDblclick) {
- addListener(cropper, EVENT_DBLCLICK, this.onDblclick = proxy(this.dblclick, this));
+ addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
}
- addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = proxy(this.cropMove, this));
- addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = proxy(this.cropEnd, this));
+ addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));
+ addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));
if (options.responsive) {
- addListener(window, EVENT_RESIZE, this.onResize = proxy(this.resize, this));
+ addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
}
},
unbind: function unbind() {
@@ -1839,7 +1743,6 @@ var events = {
options = this.options,
cropper = this.cropper;
-
if (isFunction(options.cropstart)) {
removeListener(element, EVENT_CROP_START, options.cropstart);
}
@@ -1863,7 +1766,10 @@ var events = {
removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
if (options.zoomable && options.zoomOnWheel) {
- removeListener(cropper, EVENT_WHEEL, this.onWheel);
+ removeListener(cropper, EVENT_WHEEL, this.onWheel, {
+ passive: false,
+ capture: true
+ });
}
if (options.toggleDragModeOnDblclick) {
@@ -1884,20 +1790,18 @@ var handlers = {
var options = this.options,
container = this.container,
containerData = this.containerData;
-
- var minContainerWidth = Number(options.minContainerWidth) || 200;
- var minContainerHeight = Number(options.minContainerHeight) || 100;
+ var minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
+ var minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
return;
}
- var ratio = container.offsetWidth / containerData.width;
+ var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
- // Resize when width changed or height changed
if (ratio !== 1 || container.offsetHeight !== containerData.height) {
- var canvasData = void 0;
- var cropBoxData = void 0;
+ var canvasData;
+ var cropBoxData;
if (options.restore) {
canvasData = this.getCanvasData();
@@ -1907,10 +1811,10 @@ var handlers = {
this.render();
if (options.restore) {
- this.setCanvasData(each(canvasData, function (n, i) {
+ this.setCanvasData(forEach(canvasData, function (n, i) {
canvasData[i] = n * ratio;
}));
- this.setCropBoxData(each(cropBoxData, function (n, i) {
+ this.setCropBoxData(forEach(cropBoxData, function (n, i) {
cropBoxData[i] = n * ratio;
}));
}
@@ -1923,7 +1827,7 @@ var handlers = {
this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
},
- wheel: function wheel(e) {
+ wheel: function wheel(event) {
var _this = this;
var ratio = Number(this.options.wheelZoomRatio) || 0.1;
@@ -1933,53 +1837,56 @@ var handlers = {
return;
}
- e.preventDefault();
+ event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)
- // Limit wheel speed to prevent zoom too fast (#21)
if (this.wheeling) {
return;
}
this.wheeling = true;
-
setTimeout(function () {
_this.wheeling = false;
}, 50);
- if (e.deltaY) {
- delta = e.deltaY > 0 ? 1 : -1;
- } else if (e.wheelDelta) {
- delta = -e.wheelDelta / 120;
- } else if (e.detail) {
- delta = e.detail > 0 ? 1 : -1;
+ if (event.deltaY) {
+ delta = event.deltaY > 0 ? 1 : -1;
+ } else if (event.wheelDelta) {
+ delta = -event.wheelDelta / 120;
+ } else if (event.detail) {
+ delta = event.detail > 0 ? 1 : -1;
}
- this.zoom(-delta * ratio, e);
+ this.zoom(-delta * ratio, event);
},
- cropStart: function cropStart(e) {
- if (this.disabled) {
+ cropStart: function cropStart(event) {
+ var buttons = event.buttons,
+ button = event.button;
+
+ if (this.disabled // Handle mouse event and pointer event and ignore touch event
+ || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)
+ isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu
+ || event.ctrlKey)) {
return;
}
var options = this.options,
pointers = this.pointers;
+ var action;
- var action = void 0;
-
- if (e.changedTouches) {
+ if (event.changedTouches) {
// Handle touch event
- each(e.changedTouches, function (touch) {
+ forEach(event.changedTouches, function (touch) {
pointers[touch.identifier] = getPointer(touch);
});
} else {
// Handle mouse event and pointer event
- pointers[e.pointerId || 0] = getPointer(e);
+ pointers[event.pointerId || 0] = getPointer(event);
}
if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
action = ACTION_ZOOM;
} else {
- action = getData(e.target, DATA_ACTION);
+ action = getData(event.target, DATA_ACTION);
}
if (!REGEXP_ACTIONS.test(action)) {
@@ -1987,14 +1894,14 @@ var handlers = {
}
if (dispatchEvent(this.element, EVENT_CROP_START, {
- originalEvent: e,
+ originalEvent: event,
action: action
}) === false) {
return;
- }
+ } // This line is required for preventing page zooming in iOS browsers
- e.preventDefault();
+ event.preventDefault();
this.action = action;
this.cropping = false;
@@ -2003,37 +1910,35 @@ var handlers = {
addClass(this.dragBox, CLASS_MODAL);
}
},
- cropMove: function cropMove(e) {
+ cropMove: function cropMove(event) {
var action = this.action;
-
if (this.disabled || !action) {
return;
}
var pointers = this.pointers;
-
-
- e.preventDefault();
+ event.preventDefault();
if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
- originalEvent: e,
+ originalEvent: event,
action: action
}) === false) {
return;
}
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- extend(pointers[touch.identifier], getPointer(touch, true));
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ // The first parameter should not be undefined (#432)
+ assign(pointers[touch.identifier] || {}, getPointer(touch, true));
});
} else {
- extend(pointers[e.pointerId || 0], getPointer(e, true));
+ assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
}
- this.change(e);
+ this.change(event);
},
- cropEnd: function cropEnd(e) {
+ cropEnd: function cropEnd(event) {
if (this.disabled) {
return;
}
@@ -2041,20 +1946,19 @@ var handlers = {
var action = this.action,
pointers = this.pointers;
-
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
delete pointers[touch.identifier];
});
} else {
- delete pointers[e.pointerId || 0];
+ delete pointers[event.pointerId || 0];
}
if (!action) {
return;
}
- e.preventDefault();
+ event.preventDefault();
if (!Object.keys(pointers).length) {
this.action = '';
@@ -2066,14 +1970,14 @@ var handlers = {
}
dispatchEvent(this.element, EVENT_CROP_END, {
- originalEvent: e,
+ originalEvent: event,
action: action
});
}
};
var change = {
- change: function change(e) {
+ change: function change(event) {
var options = this.options,
canvasData = this.canvasData,
containerData = this.containerData,
@@ -2085,7 +1989,6 @@ var change = {
top = cropBoxData.top,
width = cropBoxData.width,
height = cropBoxData.height;
-
var right = left + width;
var bottom = top + height;
var minLeft = 0;
@@ -2093,17 +1996,15 @@ var change = {
var maxWidth = containerData.width;
var maxHeight = containerData.height;
var renderable = true;
- var offset = void 0;
+ var offset; // Locking aspect ratio in "free mode" by holding shift key
- // Locking aspect ratio in "free mode" by holding shift key
- if (!aspectRatio && e.shiftKey) {
+ if (!aspectRatio && event.shiftKey) {
aspectRatio = width && height ? width / height : 1;
}
if (this.limited) {
minLeft = cropBoxData.minLeft;
minTop = cropBoxData.minTop;
-
maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
}
@@ -2113,6 +2014,7 @@ var change = {
x: pointer.endX - pointer.startX,
y: pointer.endY - pointer.startY
};
+
var check = function check(side) {
switch (side) {
case ACTION_EAST:
@@ -2153,8 +2055,8 @@ var change = {
left += range.x;
top += range.y;
break;
-
// Resize crop box
+
case ACTION_EAST:
if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
renderable = false;
@@ -2164,14 +2066,15 @@ var change = {
check(ACTION_EAST);
width += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top -= range.x / aspectRatio / 2;
- }
-
if (width < 0) {
action = ACTION_WEST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
@@ -2186,14 +2089,15 @@ var change = {
height -= range.y;
top += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left += range.y * aspectRatio / 2;
- }
-
if (height < 0) {
action = ACTION_SOUTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
@@ -2208,14 +2112,15 @@ var change = {
width -= range.x;
left += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top += range.x / aspectRatio / 2;
- }
-
if (width < 0) {
action = ACTION_EAST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
@@ -2229,14 +2134,15 @@ var change = {
check(ACTION_SOUTH);
height += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left -= range.y * aspectRatio / 2;
- }
-
if (height < 0) {
action = ACTION_NORTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
@@ -2279,14 +2185,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2302,7 +2212,7 @@ var change = {
height -= range.y;
top += range.y;
width = height * aspectRatio;
- left += range.y * aspectRatio;
+ left += cropBoxData.width - width;
} else {
check(ACTION_NORTH);
check(ACTION_WEST);
@@ -2332,14 +2242,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2382,14 +2296,18 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -2429,31 +2347,35 @@ var change = {
if (width < 0 && height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
-
// Move canvas
+
case ACTION_MOVE:
this.move(range.x, range.y);
renderable = false;
break;
-
// Zoom canvas
+
case ACTION_ZOOM:
- this.zoom(getMaxZoomRatio(pointers), e);
+ this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
-
// Create crop box
+
case ACTION_CROP:
if (!range.x || !range.y) {
renderable = false;
@@ -2475,9 +2397,9 @@ var change = {
if (range.y < 0) {
top -= height;
- }
+ } // Show the crop box if is hidden
+
- // Show the crop box if is hidden
if (!this.cropped) {
removeClass(this.cropBox, CLASS_HIDDEN);
this.cropped = true;
@@ -2499,10 +2421,10 @@ var change = {
cropBoxData.top = top;
this.action = action;
this.renderCropBox();
- }
+ } // Override
+
- // Override
- each(pointers, function (p) {
+ forEach(pointers, function (p) {
p.startX = p.endX;
p.startY = p.endY;
});
@@ -2512,31 +2434,26 @@ var change = {
var methods = {
// Show the crop box manually
crop: function crop() {
- if (this.ready && !this.disabled) {
- if (!this.cropped) {
- this.cropped = true;
- this.limitCropBox(true, true);
-
- if (this.options.modal) {
- addClass(this.dragBox, CLASS_MODAL);
- }
+ if (this.ready && !this.cropped && !this.disabled) {
+ this.cropped = true;
+ this.limitCropBox(true, true);
- removeClass(this.cropBox, CLASS_HIDDEN);
+ if (this.options.modal) {
+ addClass(this.dragBox, CLASS_MODAL);
}
+ removeClass(this.cropBox, CLASS_HIDDEN);
this.setCropBoxData(this.initialCropBoxData);
}
return this;
},
-
-
// Reset the image and crop box to their initial states
reset: function reset() {
if (this.ready && !this.disabled) {
- this.imageData = extend({}, this.initialImageData);
- this.canvasData = extend({}, this.initialCanvasData);
- this.cropBoxData = extend({}, this.initialCropBoxData);
+ this.imageData = assign({}, this.initialImageData);
+ this.canvasData = assign({}, this.initialCanvasData);
+ this.cropBoxData = assign({}, this.initialCropBoxData);
this.renderCanvas();
if (this.cropped) {
@@ -2546,23 +2463,19 @@ var methods = {
return this;
},
-
-
// Clear the crop box
clear: function clear() {
if (this.cropped && !this.disabled) {
- extend(this.cropBoxData, {
+ assign(this.cropBoxData, {
left: 0,
top: 0,
width: 0,
height: 0
});
-
this.cropped = false;
this.renderCropBox();
- this.limitCanvas(true, true);
+ this.limitCanvas(true, true); // Render canvas after crop box rendered
- // Render canvas after crop box rendered
this.renderCanvas();
removeClass(this.dragBox, CLASS_MODAL);
addClass(this.cropBox, CLASS_HIDDEN);
@@ -2571,29 +2484,27 @@ var methods = {
return this;
},
-
/**
* Replace the image's src and rebuild the cropper
* @param {string} url - The new URL.
- * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
- * @returns {Object} this
+ * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
+ * @returns {Cropper} this
*/
replace: function replace(url) {
- var onlyColorChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
if (!this.disabled && url) {
if (this.isImg) {
this.element.src = url;
}
- if (onlyColorChanged) {
+ if (hasSameSize) {
this.url = url;
this.image.src = url;
if (this.ready) {
- this.image2.src = url;
-
- each(this.previews, function (element) {
+ this.viewBoxImage.src = url;
+ forEach(this.previews, function (element) {
element.getElementsByTagName('img')[0].src = url;
});
}
@@ -2602,30 +2513,26 @@ var methods = {
this.replaced = true;
}
- // Clear previous data
this.options.data = null;
+ this.uncreate();
this.load(url);
}
}
return this;
},
-
-
// Enable (unfreeze) the cropper
enable: function enable() {
- if (this.ready) {
+ if (this.ready && this.disabled) {
this.disabled = false;
removeClass(this.cropper, CLASS_DISABLED);
}
return this;
},
-
-
// Disable (freeze) the cropper
disable: function disable() {
- if (this.ready) {
+ if (this.ready && !this.disabled) {
this.disabled = true;
addClass(this.cropper, CLASS_DISABLED);
}
@@ -2633,60 +2540,51 @@ var methods = {
return this;
},
-
- // Destroy the cropper and remove the instance from the image
+ /**
+ * Destroy the cropper and remove the instance from the image
+ * @returns {Cropper} this
+ */
destroy: function destroy() {
- var element = this.element,
- image = this.image;
+ var element = this.element;
+ if (!element[NAMESPACE]) {
+ return this;
+ }
- if (this.loaded) {
- if (this.isImg && this.replaced) {
- element.src = this.originalUrl;
- }
+ element[NAMESPACE] = undefined;
- this.unbuild();
- removeClass(element, CLASS_HIDDEN);
- } else if (this.isImg) {
- removeListener(element, EVENT_LOAD, this.onStart);
- } else if (image) {
- image.parentNode.removeChild(image);
+ if (this.isImg && this.replaced) {
+ element.src = this.originalUrl;
}
- removeData(element, NAMESPACE);
-
+ this.uncreate();
return this;
},
-
/**
* Move the canvas with relative offsets
* @param {number} offsetX - The relative offset distance on the x-axis.
- * @param {number} offsetY - The relative offset distance on the y-axis.
- * @returns {Object} this
+ * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
+ * @returns {Cropper} this
*/
- move: function move(offsetX, offsetY) {
- var _canvasData = this.canvasData,
- left = _canvasData.left,
- top = _canvasData.top;
-
-
+ move: function move(offsetX) {
+ var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;
+ var _this$canvasData = this.canvasData,
+ left = _this$canvasData.left,
+ top = _this$canvasData.top;
return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
},
-
/**
* Move the canvas to an absolute point
* @param {number} x - The x-axis coordinate.
* @param {number} [y=x] - The y-axis coordinate.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
moveTo: function moveTo(x) {
var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
var canvasData = this.canvasData;
-
var changed = false;
-
x = Number(x);
y = Number(y);
@@ -2709,17 +2607,14 @@ var methods = {
return this;
},
-
/**
* Zoom the canvas with a relative ratio
* @param {number} ratio - The target ratio.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoom: function zoom(ratio, _originalEvent) {
var canvasData = this.canvasData;
-
-
ratio = Number(ratio);
if (ratio < 0) {
@@ -2731,13 +2626,12 @@ var methods = {
return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
},
-
/**
* Zoom the canvas to an absolute ratio
* @param {number} ratio - The target ratio.
* @param {Object} pivot - The zoom pivot point coordinate.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
var options = this.options,
@@ -2746,8 +2640,6 @@ var methods = {
height = canvasData.height,
naturalWidth = canvasData.naturalWidth,
naturalHeight = canvasData.naturalHeight;
-
-
ratio = Number(ratio);
if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
@@ -2755,23 +2647,21 @@ var methods = {
var newHeight = naturalHeight * ratio;
if (dispatchEvent(this.element, EVENT_ZOOM, {
- originalEvent: _originalEvent,
+ ratio: ratio,
oldRatio: width / naturalWidth,
- ratio: newWidth / naturalWidth
+ originalEvent: _originalEvent
}) === false) {
return this;
}
if (_originalEvent) {
var pointers = this.pointers;
-
var offset = getOffset(this.cropper);
var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
pageX: _originalEvent.pageX,
pageY: _originalEvent.pageY
- };
+ }; // Zoom from the triggering point of the event
- // Zoom from the triggering point of the event
canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
} else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
@@ -2791,21 +2681,19 @@ var methods = {
return this;
},
-
/**
* Rotate the canvas with a relative degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotate: function rotate(degree) {
return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
},
-
/**
* Rotate the canvas to an absolute degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotateTo: function rotateTo(degree) {
degree = Number(degree);
@@ -2818,45 +2706,36 @@ var methods = {
return this;
},
-
/**
* Scale the image on the x-axis.
* @param {number} scaleX - The scale ratio on the x-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleX: function scaleX(_scaleX) {
var scaleY = this.imageData.scaleY;
-
-
return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
},
-
/**
* Scale the image on the y-axis.
* @param {number} scaleY - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleY: function scaleY(_scaleY) {
var scaleX = this.imageData.scaleX;
-
-
return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
},
-
/**
* Scale the image
* @param {number} scaleX - The scale ratio on the x-axis.
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scale: function scale(scaleX) {
var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
var imageData = this.imageData;
-
var transformed = false;
-
scaleX = Number(scaleX);
scaleY = Number(scaleY);
@@ -2879,20 +2758,18 @@ var methods = {
return this;
},
-
/**
* Get the cropped area position and size data (base on the original image)
* @param {boolean} [rounded=false] - Indicate if round the data values or not.
* @returns {Object} The result cropped data.
*/
- getData: function getData$$1() {
+ getData: function getData() {
var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData,
cropBoxData = this.cropBoxData;
-
- var data = void 0;
+ var data;
if (this.ready && this.cropped) {
data = {
@@ -2901,13 +2778,21 @@ var methods = {
width: cropBoxData.width,
height: cropBoxData.height
};
-
var ratio = imageData.width / imageData.naturalWidth;
-
- each(data, function (n, i) {
- n /= ratio;
- data[i] = rounded ? Math.round(n) : n;
+ forEach(data, function (n, i) {
+ data[i] = n / ratio;
});
+
+ if (rounded) {
+ // In case rounding off leads to extra 1px in right or bottom border
+ // we should round the top-left corner and the dimension (#343).
+ var bottom = Math.round(data.y + data.height);
+ var right = Math.round(data.x + data.width);
+ data.x = Math.round(data.x);
+ data.y = Math.round(data.y);
+ data.width = right - data.x;
+ data.height = bottom - data.y;
+ }
} else {
data = {
x: 0,
@@ -2929,23 +2814,17 @@ var methods = {
return data;
},
-
/**
* Set the cropped area position and size with new data
* @param {Object} data - The new data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
- setData: function setData$$1(data) {
+ setData: function setData(data) {
var options = this.options,
imageData = this.imageData,
canvasData = this.canvasData;
-
var cropBoxData = {};
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
var transformed = false;
@@ -2996,36 +2875,32 @@ var methods = {
return this;
},
-
/**
* Get the container size data.
* @returns {Object} The result container data.
*/
getContainerData: function getContainerData() {
- return this.ready ? extend({}, this.containerData) : {};
+ return this.ready ? assign({}, this.containerData) : {};
},
-
/**
* Get the image position and size data.
* @returns {Object} The result image data.
*/
getImageData: function getImageData() {
- return this.loaded ? extend({}, this.imageData) : {};
+ return this.sized ? assign({}, this.imageData) : {};
},
-
/**
* Get the canvas position and size data.
* @returns {Object} The result canvas data.
*/
getCanvasData: function getCanvasData() {
var canvasData = this.canvasData;
-
var data = {};
if (this.ready) {
- each(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
+ forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
data[n] = canvasData[n];
});
}
@@ -3033,21 +2908,15 @@ var methods = {
return data;
},
-
/**
* Set the canvas position and size with new data.
* @param {Object} data - The new canvas data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCanvasData: function setCanvasData(data) {
var canvasData = this.canvasData;
var aspectRatio = canvasData.aspectRatio;
-
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
canvasData.left = data.left;
@@ -3071,15 +2940,13 @@ var methods = {
return this;
},
-
/**
* Get the crop box position and size data.
* @returns {Object} The result crop box data.
*/
getCropBoxData: function getCropBoxData() {
var cropBoxData = this.cropBoxData;
-
- var data = void 0;
+ var data;
if (this.ready && this.cropped) {
data = {
@@ -3093,22 +2960,16 @@ var methods = {
return data || {};
},
-
/**
* Set the crop box position and size with new data.
* @param {Object} data - The new crop box data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCropBoxData: function setCropBoxData(data) {
var cropBoxData = this.cropBoxData;
var aspectRatio = this.options.aspectRatio;
-
- var widthChanged = void 0;
- var heightChanged = void 0;
-
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ var widthChanged;
+ var heightChanged;
if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
@@ -3143,7 +3004,6 @@ var methods = {
return this;
},
-
/**
* Get a canvas drawn the cropped image.
* @param {Object} [options={}] - The config options.
@@ -3157,78 +3017,77 @@ var methods = {
}
var canvasData = this.canvasData;
+ var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.
- var source = getSourceCanvas(this.image, this.imageData, canvasData, options);
-
- // Returns the source canvas if it is not cropped.
if (!this.cropped) {
return source;
}
- var _getData = this.getData(),
- x = _getData.x,
- y = _getData.y,
- initialWidth = _getData.width,
- initialHeight = _getData.height;
+ var _this$getData = this.getData(),
+ initialX = _this$getData.x,
+ initialY = _this$getData.y,
+ initialWidth = _this$getData.width,
+ initialHeight = _this$getData.height;
+
+ var ratio = source.width / Math.floor(canvasData.naturalWidth);
+
+ if (ratio !== 1) {
+ initialX *= ratio;
+ initialY *= ratio;
+ initialWidth *= ratio;
+ initialHeight *= ratio;
+ }
var aspectRatio = initialWidth / initialHeight;
- var maxSizes = getContainSizes({
+ var maxSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: options.maxWidth || Infinity,
height: options.maxHeight || Infinity
});
- var minSizes = getContainSizes({
+ var minSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
width: options.minWidth || 0,
height: options.minHeight || 0
- });
+ }, 'cover');
- var _getContainSizes = getContainSizes({
+ var _getAdjustedSizes = getAdjustedSizes({
aspectRatio: aspectRatio,
- width: options.width || initialWidth,
- height: options.height || initialHeight
+ width: options.width || (ratio !== 1 ? source.width : initialWidth),
+ height: options.height || (ratio !== 1 ? source.height : initialHeight)
}),
- width = _getContainSizes.width,
- height = _getContainSizes.height;
+ width = _getAdjustedSizes.width,
+ height = _getAdjustedSizes.height;
width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
-
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
-
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
-
context.fillStyle = options.fillColor || 'transparent';
context.fillRect(0, 0, width, height);
-
var _options$imageSmoothi = options.imageSmoothingEnabled,
- imageSmoothingEnabled = _options$imageSmoothi === undefined ? true : _options$imageSmoothi,
+ imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,
imageSmoothingQuality = options.imageSmoothingQuality;
-
-
context.imageSmoothingEnabled = imageSmoothingEnabled;
if (imageSmoothingQuality) {
context.imageSmoothingQuality = imageSmoothingQuality;
- }
+ } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
+
- // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
var sourceWidth = source.width;
- var sourceHeight = source.height;
+ var sourceHeight = source.height; // Source canvas parameters
- // Source canvas parameters
- var srcX = x;
- var srcY = y;
- var srcWidth = void 0;
- var srcHeight = void 0;
+ var srcX = initialX;
+ var srcY = initialY;
+ var srcWidth;
+ var srcHeight; // Destination canvas parameters
- // Destination canvas parameters
- var dstX = void 0;
- var dstY = void 0;
- var dstWidth = void 0;
- var dstHeight = void 0;
+ var dstX;
+ var dstY;
+ var dstWidth;
+ var dstHeight;
if (srcX <= -initialWidth || srcX > sourceWidth) {
srcX = 0;
@@ -3262,34 +3121,29 @@ var methods = {
dstHeight = srcHeight;
}
- // All the numerical parameters should be integer for `drawImage`
- // https://github.com/fengyuanchen/cropper/issues/476
- var params = [srcX, srcY, srcWidth, srcHeight];
+ var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError"
- // Avoid "IndexSizeError"
if (dstWidth > 0 && dstHeight > 0) {
var scale = width / initialWidth;
-
params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
- }
+ } // All the numerical parameters should be integer for `drawImage`
+ // https://github.com/fengyuanchen/cropper/issues/476
- context.drawImage.apply(context, [source].concat(toConsumableArray(params.map(function (param) {
+
+ context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
-
return canvas;
},
-
/**
* Change the aspect ratio of the crop box.
* @param {number} aspectRatio - The new aspect ratio.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setAspectRatio: function setAspectRatio(aspectRatio) {
var options = this.options;
-
if (!this.disabled && !isUndefined(aspectRatio)) {
// 0 -> NaN
options.aspectRatio = Math.max(0, aspectRatio) || NaN;
@@ -3306,24 +3160,21 @@ var methods = {
return this;
},
-
/**
* Change the drag mode.
* @param {string} mode - The new drag mode.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setDragMode: function setDragMode(mode) {
var options = this.options,
dragBox = this.dragBox,
face = this.face;
-
- if (this.loaded && !this.disabled) {
+ if (this.ready && !this.disabled) {
var croppable = mode === DRAG_MODE_CROP;
var movable = options.movable && mode === DRAG_MODE_MOVE;
-
mode = croppable || movable ? mode : DRAG_MODE_NONE;
-
+ options.dragMode = mode;
setData(dragBox, DATA_ACTION, mode);
toggleClass(dragBox, CLASS_CROP, croppable);
toggleClass(dragBox, CLASS_MOVE, movable);
@@ -3342,7 +3193,9 @@ var methods = {
var AnotherCropper = WINDOW.Cropper;
-var Cropper = function () {
+var Cropper =
+/*#__PURE__*/
+function () {
/**
* Create a new Cropper.
* @param {Element} element - The target element for cropping.
@@ -3350,58 +3203,50 @@ var Cropper = function () {
*/
function Cropper(element) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- classCallCheck(this, Cropper);
+
+ _classCallCheck(this, Cropper);
if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
throw new Error('The first argument is required and must be an <img> or <canvas> element.');
}
this.element = element;
- this.options = extend({}, DEFAULTS, isPlainObject(options) && options);
- this.complete = false;
+ this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
this.cropped = false;
this.disabled = false;
- this.isImg = false;
- this.limited = false;
- this.loaded = false;
+ this.pointers = {};
this.ready = false;
+ this.reloading = false;
this.replaced = false;
- this.wheeling = false;
- this.originalUrl = '';
- this.canvasData = null;
- this.cropBoxData = null;
- this.previews = null;
- this.pointers = {};
+ this.sized = false;
+ this.sizing = false;
this.init();
}
- createClass(Cropper, [{
- key: 'init',
+ _createClass(Cropper, [{
+ key: "init",
value: function init() {
var element = this.element;
-
var tagName = element.tagName.toLowerCase();
- var url = void 0;
+ var url;
- if (getData(element, NAMESPACE)) {
+ if (element[NAMESPACE]) {
return;
}
- setData(element, NAMESPACE, this);
+ element[NAMESPACE] = this;
if (tagName === 'img') {
- this.isImg = true;
+ this.isImg = true; // e.g.: "img/picture.jpg"
- // e.g.: "img/picture.jpg"
url = element.getAttribute('src') || '';
- this.originalUrl = url;
+ this.originalUrl = url; // Stop when it's a blank image
- // Stop when it's a blank image
if (!url) {
return;
- }
+ } // e.g.: "http://example.com/img/picture.jpg"
+
- // e.g.: "http://example.com/img/picture.jpg"
url = element.src;
} else if (tagName === 'canvas' && window.HTMLCanvasElement) {
url = element.toDataURL();
@@ -3410,7 +3255,7 @@ var Cropper = function () {
this.load(url);
}
}, {
- key: 'load',
+ key: "load",
value: function load(url) {
var _this = this;
@@ -3420,59 +3265,88 @@ var Cropper = function () {
this.url = url;
this.imageData = {};
-
var element = this.element,
options = this.options;
+ if (!options.rotatable && !options.scalable) {
+ options.checkOrientation = false;
+ } // Only IE10+ supports Typed Arrays
+
if (!options.checkOrientation || !window.ArrayBuffer) {
this.clone();
return;
- }
+ } // Detect the mime type of the image directly if it is a Data URL
+
- // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari
if (REGEXP_DATA_URL.test(url)) {
+ // Read ArrayBuffer from Data URL of JPEG images directly for better performance
if (REGEXP_DATA_URL_JPEG.test(url)) {
this.read(dataURLToArrayBuffer(url));
} else {
+ // Only a JPEG image may contains Exif Orientation information,
+ // the rest types of Data URLs are not necessary to check orientation at all.
this.clone();
}
return;
- }
+ } // 1. Detect the mime type of the image by a XMLHttpRequest.
+ // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.
- var xhr = new XMLHttpRequest();
- xhr.onerror = function () {
- _this.clone();
+ var xhr = new XMLHttpRequest();
+ var clone = this.clone.bind(this);
+ this.reloading = true;
+ this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:
+ // http, https, data, chrome, chrome-extension.
+ // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy
+ // in some browsers as IE11 and Safari.
+
+ xhr.onabort = clone;
+ xhr.onerror = clone;
+ xhr.ontimeout = clone;
+
+ xhr.onprogress = function () {
+ // Abort the request directly if it not a JPEG image for better performance
+ if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {
+ xhr.abort();
+ }
};
xhr.onload = function () {
_this.read(xhr.response);
};
+ xhr.onloadend = function () {
+ _this.reloading = false;
+ _this.xhr = null;
+ }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error
+
+
if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
url = addTimestamp(url);
}
- xhr.open('get', url);
+ xhr.open('GET', url);
xhr.responseType = 'arraybuffer';
xhr.withCredentials = element.crossOrigin === 'use-credentials';
xhr.send();
}
}, {
- key: 'read',
+ key: "read",
value: function read(arrayBuffer) {
var options = this.options,
- imageData = this.imageData;
+ imageData = this.imageData; // Reset the orientation value to its default value 1
+ // as some iOS browsers will render image with its orientation
- var orientation = getOrientation(arrayBuffer);
+ var orientation = resetAndGetOrientation(arrayBuffer);
var rotate = 0;
var scaleX = 1;
var scaleY = 1;
if (orientation > 1) {
- this.url = arrayBufferToDataURL(arrayBuffer, 'image/jpeg');
+ // Generate a new URL which has the default orientation value
+ this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
var _parseOrientation = parseOrientation(orientation);
@@ -3493,31 +3367,24 @@ var Cropper = function () {
this.clone();
}
}, {
- key: 'clone',
+ key: "clone",
value: function clone() {
var element = this.element,
url = this.url;
-
- var crossOrigin = void 0;
- var crossOriginUrl = void 0;
+ var crossOrigin = element.crossOrigin;
+ var crossOriginUrl = url;
if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
- crossOrigin = element.crossOrigin;
-
-
- if (crossOrigin) {
- crossOriginUrl = url;
- } else {
+ if (!crossOrigin) {
crossOrigin = 'anonymous';
+ } // Bust cache when there is not a "crossOrigin" property (#519)
- // Bust cache when there is not a "crossOrigin" property
- crossOriginUrl = addTimestamp(url);
- }
+
+ crossOriginUrl = addTimestamp(url);
}
this.crossOrigin = crossOrigin;
this.crossOriginUrl = crossOriginUrl;
-
var image = document.createElement('img');
if (crossOrigin) {
@@ -3525,138 +3392,126 @@ var Cropper = function () {
}
image.src = crossOriginUrl || url;
-
- var start = proxy(this.start, this);
- var stop = proxy(this.stop, this);
-
+ image.alt = element.alt || 'The image to crop';
this.image = image;
- this.onStart = start;
- this.onStop = stop;
-
- if (this.isImg) {
- if (element.complete) {
- this.start();
- } else {
- addListener(element, EVENT_LOAD, start);
- }
- } else {
- addListener(image, EVENT_LOAD, start);
- addListener(image, EVENT_ERROR, stop);
- addClass(image, CLASS_HIDE);
- element.parentNode.insertBefore(image, element.nextSibling);
- }
+ image.onload = this.start.bind(this);
+ image.onerror = this.stop.bind(this);
+ addClass(image, CLASS_HIDE);
+ element.parentNode.insertBefore(image, element.nextSibling);
}
}, {
- key: 'start',
- value: function start(event) {
+ key: "start",
+ value: function start() {
var _this2 = this;
- var image = this.isImg ? this.element : this.image;
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,
+ // such as Safari for iOS, Chrome for iOS, and in-app browsers.
- if (event) {
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- }
+ var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
- getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
- extend(_this2.imageData, {
+ var done = function done(naturalWidth, naturalHeight) {
+ assign(_this2.imageData, {
naturalWidth: naturalWidth,
naturalHeight: naturalHeight,
aspectRatio: naturalWidth / naturalHeight
});
- _this2.loaded = true;
+ _this2.sizing = false;
+ _this2.sized = true;
+
_this2.build();
- });
+ }; // Most modern browsers (excepts iOS WebKit)
+
+
+ if (image.naturalWidth && !isIOSWebKit) {
+ done(image.naturalWidth, image.naturalHeight);
+ return;
+ }
+
+ var sizingImage = document.createElement('img');
+ var body = document.body || document.documentElement;
+ this.sizingImage = sizingImage;
+
+ sizingImage.onload = function () {
+ done(sizingImage.width, sizingImage.height);
+
+ if (!isIOSWebKit) {
+ body.removeChild(sizingImage);
+ }
+ };
+
+ sizingImage.src = image.src; // iOS WebKit will convert the image automatically
+ // with its orientation once append it into DOM (#279)
+
+ if (!isIOSWebKit) {
+ sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
+ body.appendChild(sizingImage);
+ }
}
}, {
- key: 'stop',
+ key: "stop",
value: function stop() {
var image = this.image;
-
-
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
+ image.onload = null;
+ image.onerror = null;
image.parentNode.removeChild(image);
this.image = null;
}
}, {
- key: 'build',
+ key: "build",
value: function build() {
- var _this3 = this;
-
- if (!this.loaded) {
+ if (!this.sized || this.ready) {
return;
}
- // Unbuild first when replace
- if (this.ready) {
- this.unbuild();
- }
-
var element = this.element,
options = this.options,
- image = this.image;
-
- // Create cropper elements
+ image = this.image; // Create cropper elements
var container = element.parentNode;
var template = document.createElement('div');
-
template.innerHTML = TEMPLATE;
-
- var cropper = template.querySelector('.' + NAMESPACE + '-container');
- var canvas = cropper.querySelector('.' + NAMESPACE + '-canvas');
- var dragBox = cropper.querySelector('.' + NAMESPACE + '-drag-box');
- var cropBox = cropper.querySelector('.' + NAMESPACE + '-crop-box');
- var face = cropBox.querySelector('.' + NAMESPACE + '-face');
-
+ var cropper = template.querySelector(".".concat(NAMESPACE, "-container"));
+ var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas"));
+ var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box"));
+ var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box"));
+ var face = cropBox.querySelector(".".concat(NAMESPACE, "-face"));
this.container = container;
this.cropper = cropper;
this.canvas = canvas;
this.dragBox = dragBox;
this.cropBox = cropBox;
- this.viewBox = cropper.querySelector('.' + NAMESPACE + '-view-box');
+ this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box"));
this.face = face;
+ canvas.appendChild(image); // Hide the original image
- canvas.appendChild(image);
-
- // Hide the original image
- addClass(element, CLASS_HIDDEN);
+ addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image
- // Inserts the cropper after to the current image
- container.insertBefore(cropper, element.nextSibling);
+ container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden
- // Show the image if is hidden
if (!this.isImg) {
removeClass(image, CLASS_HIDE);
}
this.initPreview();
this.bind();
-
+ options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
-
- this.cropped = options.autoCrop;
-
- if (options.autoCrop) {
- if (options.modal) {
- addClass(dragBox, CLASS_MODAL);
- }
- } else {
- addClass(cropBox, CLASS_HIDDEN);
- }
+ addClass(cropBox, CLASS_HIDDEN);
if (!options.guides) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-dashed'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN);
}
if (!options.center) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-center'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN);
}
if (options.background) {
- addClass(cropper, NAMESPACE + '-bg');
+ addClass(cropper, "".concat(NAMESPACE, "-bg"));
}
if (!options.highlight) {
@@ -3669,90 +3524,85 @@ var Cropper = function () {
}
if (!options.cropBoxResizable) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-line'), CLASS_HIDDEN);
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-point'), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN);
}
- this.setDragMode(options.dragMode);
this.render();
this.ready = true;
- this.setData(options.data);
+ this.setDragMode(options.dragMode);
- // Call the "ready" option asynchronously to keep "image.cropper" is defined
- this.completing = setTimeout(function () {
- if (isFunction(options.ready)) {
- addListener(element, EVENT_READY, options.ready, {
- once: true
- });
- }
+ if (options.autoCrop) {
+ this.crop();
+ }
- dispatchEvent(element, EVENT_READY);
- dispatchEvent(element, EVENT_CROP, _this3.getData());
+ this.setData(options.data);
- _this3.complete = true;
- }, 0);
+ if (isFunction(options.ready)) {
+ addListener(element, EVENT_READY, options.ready, {
+ once: true
+ });
+ }
+
+ dispatchEvent(element, EVENT_READY);
}
}, {
- key: 'unbuild',
+ key: "unbuild",
value: function unbuild() {
if (!this.ready) {
return;
}
- if (!this.complete) {
- clearTimeout(this.completing);
- }
-
this.ready = false;
- this.complete = false;
- this.initialImageData = null;
-
- // Clear `initialCanvasData` is necessary when replace
- this.initialCanvasData = null;
- this.initialCropBoxData = null;
- this.containerData = null;
- this.canvasData = null;
-
- // Clear `cropBoxData` is necessary when replace
- this.cropBoxData = null;
this.unbind();
this.resetPreview();
- this.previews = null;
- this.viewBox = null;
- this.cropBox = null;
- this.dragBox = null;
- this.canvas = null;
- this.container = null;
this.cropper.parentNode.removeChild(this.cropper);
- this.cropper = null;
+ removeClass(this.element, CLASS_HIDDEN);
+ }
+ }, {
+ key: "uncreate",
+ value: function uncreate() {
+ if (this.ready) {
+ this.unbuild();
+ this.ready = false;
+ this.cropped = false;
+ } else if (this.sizing) {
+ this.sizingImage.onload = null;
+ this.sizing = false;
+ this.sized = false;
+ } else if (this.reloading) {
+ this.xhr.onabort = null;
+ this.xhr.abort();
+ } else if (this.image) {
+ this.stop();
+ }
}
-
/**
* Get the no conflict cropper class.
* @returns {Cropper} The cropper class.
*/
}], [{
- key: 'noConflict',
+ key: "noConflict",
value: function noConflict() {
window.Cropper = AnotherCropper;
return Cropper;
}
-
/**
* Change the default options.
* @param {Object} options - The new default options.
*/
}, {
- key: 'setDefaults',
+ key: "setDefaults",
value: function setDefaults(options) {
- extend(DEFAULTS, isPlainObject(options) && options);
+ assign(DEFAULTS, isPlainObject(options) && options);
}
}]);
+
return Cropper;
}();
-extend(Cropper.prototype, render, preview, events, handlers, change, methods);
+assign(Cropper.prototype, render, preview, events, handlers, change, methods);
export default Cropper;
diff --git a/library/cropperjs/dist/cropper.js b/library/cropperjs/dist/cropper.js
index 0e837953c..5c49d7bdf 100644
--- a/library/cropperjs/dist/cropper.js
+++ b/library/cropperjs/dist/cropper.js
@@ -1,198 +1,40 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:27:18.062Z
+ * Date: 2019-10-04T04:33:48.372Z
*/
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Cropper = factory());
-}(this, (function () { 'use strict';
-
-var WINDOW = typeof window !== 'undefined' ? window : {};
-var NAMESPACE = 'cropper';
-
-// Actions
-var ACTION_ALL = 'all';
-var ACTION_CROP = 'crop';
-var ACTION_MOVE = 'move';
-var ACTION_ZOOM = 'zoom';
-var ACTION_EAST = 'e';
-var ACTION_WEST = 'w';
-var ACTION_SOUTH = 's';
-var ACTION_NORTH = 'n';
-var ACTION_NORTH_EAST = 'ne';
-var ACTION_NORTH_WEST = 'nw';
-var ACTION_SOUTH_EAST = 'se';
-var ACTION_SOUTH_WEST = 'sw';
-
-// Classes
-var CLASS_CROP = NAMESPACE + '-crop';
-var CLASS_DISABLED = NAMESPACE + '-disabled';
-var CLASS_HIDDEN = NAMESPACE + '-hidden';
-var CLASS_HIDE = NAMESPACE + '-hide';
-var CLASS_INVISIBLE = NAMESPACE + '-invisible';
-var CLASS_MODAL = NAMESPACE + '-modal';
-var CLASS_MOVE = NAMESPACE + '-move';
-
-// Data keys
-var DATA_ACTION = 'action';
-var DATA_PREVIEW = 'preview';
-
-// Drag modes
-var DRAG_MODE_CROP = 'crop';
-var DRAG_MODE_MOVE = 'move';
-var DRAG_MODE_NONE = 'none';
-
-// Events
-var EVENT_CROP = 'crop';
-var EVENT_CROP_END = 'cropend';
-var EVENT_CROP_MOVE = 'cropmove';
-var EVENT_CROP_START = 'cropstart';
-var EVENT_DBLCLICK = 'dblclick';
-var EVENT_ERROR = 'error';
-var EVENT_LOAD = 'load';
-var EVENT_POINTER_DOWN = WINDOW.PointerEvent ? 'pointerdown' : 'touchstart mousedown';
-var EVENT_POINTER_MOVE = WINDOW.PointerEvent ? 'pointermove' : 'touchmove mousemove';
-var EVENT_POINTER_UP = WINDOW.PointerEvent ? 'pointerup pointercancel' : 'touchend touchcancel mouseup';
-var EVENT_READY = 'ready';
-var EVENT_RESIZE = 'resize';
-var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
-var EVENT_ZOOM = 'zoom';
-
-// RegExps
-var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
-var REGEXP_DATA_URL = /^data:/;
-var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
-var REGEXP_TAG_NAME = /^(img|canvas)$/i;
-
-var DEFAULTS = {
- // Define the view mode of the cropper
- viewMode: 0, // 0, 1, 2, 3
-
- // Define the dragging mode of the cropper
- dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none'
-
- // Define the aspect ratio of the crop box
- aspectRatio: NaN,
-
- // An object with the previous cropping result data
- data: null,
-
- // A selector for adding extra containers to preview
- preview: '',
-
- // Re-render the cropper when resize the window
- responsive: true,
-
- // Restore the cropped area after resize the window
- restore: true,
-
- // Check if the current image is a cross-origin image
- checkCrossOrigin: true,
-
- // Check the current image's Exif Orientation information
- checkOrientation: true,
-
- // Show the black modal
- modal: true,
-
- // Show the dashed lines for guiding
- guides: true,
-
- // Show the center indicator for guiding
- center: true,
-
- // Show the white modal to highlight the crop box
- highlight: true,
-
- // Show the grid background
- background: true,
-
- // Enable to crop the image automatically when initialize
- autoCrop: true,
-
- // Define the percentage of automatic cropping area when initializes
- autoCropArea: 0.8,
-
- // Enable to move the image
- movable: true,
-
- // Enable to rotate the image
- rotatable: true,
-
- // Enable to scale the image
- scalable: true,
-
- // Enable to zoom the image
- zoomable: true,
-
- // Enable to zoom the image by dragging touch
- zoomOnTouch: true,
-
- // Enable to zoom the image by wheeling mouse
- zoomOnWheel: true,
-
- // Define zoom ratio when zoom the image by wheeling mouse
- wheelZoomRatio: 0.1,
-
- // Enable to move the crop box
- cropBoxMovable: true,
-
- // Enable to resize the crop box
- cropBoxResizable: true,
-
- // Toggle drag mode between "crop" and "move" when click twice on the cropper
- toggleDragModeOnDblclick: true,
-
- // Size limitation
- minCanvasWidth: 0,
- minCanvasHeight: 0,
- minCropBoxWidth: 0,
- minCropBoxHeight: 0,
- minContainerWidth: 200,
- minContainerHeight: 100,
-
- // Shortcuts of events
- ready: null,
- cropstart: null,
- cropmove: null,
- cropend: null,
- crop: null,
- zoom: null
-};
-
-var TEMPLATE = '<div class="cropper-container">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-action="e"></span>' + '<span class="cropper-line line-n" data-action="n"></span>' + '<span class="cropper-line line-w" data-action="w"></span>' + '<span class="cropper-line line-s" data-action="s"></span>' + '<span class="cropper-point point-e" data-action="e"></span>' + '<span class="cropper-point point-n" data-action="n"></span>' + '<span class="cropper-point point-w" data-action="w"></span>' + '<span class="cropper-point point-s" data-action="s"></span>' + '<span class="cropper-point point-ne" data-action="ne"></span>' + '<span class="cropper-point point-nw" data-action="nw"></span>' + '<span class="cropper-point point-sw" data-action="sw"></span>' + '<span class="cropper-point point-se" data-action="se"></span>' + '</div>' + '</div>';
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-
-
-
-
-
-
-
-
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = global || self, global.Cropper = factory());
+}(this, function () { 'use strict';
+
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+ return _typeof(obj);
+ }
-var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
}
-};
-var createClass = function () {
- function defineProperties(target, props) {
+ function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
@@ -202,2324 +44,2403 @@ var createClass = function () {
}
}
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
- };
-}();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+ }
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+ function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(source, true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(source).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+ return target;
+ }
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+ return arr2;
+ }
+ }
+ function _iterableToArray(iter) {
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
+ }
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
+ }
+ var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+ var WINDOW = IS_BROWSER ? window : {};
+ var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+ var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+ var NAMESPACE = 'cropper'; // Actions
+
+ var ACTION_ALL = 'all';
+ var ACTION_CROP = 'crop';
+ var ACTION_MOVE = 'move';
+ var ACTION_ZOOM = 'zoom';
+ var ACTION_EAST = 'e';
+ var ACTION_WEST = 'w';
+ var ACTION_SOUTH = 's';
+ var ACTION_NORTH = 'n';
+ var ACTION_NORTH_EAST = 'ne';
+ var ACTION_NORTH_WEST = 'nw';
+ var ACTION_SOUTH_EAST = 'se';
+ var ACTION_SOUTH_WEST = 'sw'; // Classes
+
+ var CLASS_CROP = "".concat(NAMESPACE, "-crop");
+ var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
+ var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
+ var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+ var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+ var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
+ var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys
+
+ var DATA_ACTION = "".concat(NAMESPACE, "Action");
+ var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes
+
+ var DRAG_MODE_CROP = 'crop';
+ var DRAG_MODE_MOVE = 'move';
+ var DRAG_MODE_NONE = 'none'; // Events
+
+ var EVENT_CROP = 'crop';
+ var EVENT_CROP_END = 'cropend';
+ var EVENT_CROP_MOVE = 'cropmove';
+ var EVENT_CROP_START = 'cropstart';
+ var EVENT_DBLCLICK = 'dblclick';
+ var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+ var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+ var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+ var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+ var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+ var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
+ var EVENT_READY = 'ready';
+ var EVENT_RESIZE = 'resize';
+ var EVENT_WHEEL = 'wheel';
+ var EVENT_ZOOM = 'zoom'; // Mime types
+
+ var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps
+
+ var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
+ var REGEXP_DATA_URL = /^data:/;
+ var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
+ var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
+ // Inspired by the default width and height of a canvas element.
+
+ var MIN_CONTAINER_WIDTH = 200;
+ var MIN_CONTAINER_HEIGHT = 100;
+
+ var DEFAULTS = {
+ // Define the view mode of the cropper
+ viewMode: 0,
+ // 0, 1, 2, 3
+ // Define the dragging mode of the cropper
+ dragMode: DRAG_MODE_CROP,
+ // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
+ // Define the aspect ratio of the crop box
+ aspectRatio: NaN,
+ // An object with the previous cropping result data
+ data: null,
+ // A selector for adding extra containers to preview
+ preview: '',
+ // Re-render the cropper when resize the window
+ responsive: true,
+ // Restore the cropped area after resize the window
+ restore: true,
+ // Check if the current image is a cross-origin image
+ checkCrossOrigin: true,
+ // Check the current image's Exif Orientation information
+ checkOrientation: true,
+ // Show the black modal
+ modal: true,
+ // Show the dashed lines for guiding
+ guides: true,
+ // Show the center indicator for guiding
+ center: true,
+ // Show the white modal to highlight the crop box
+ highlight: true,
+ // Show the grid background
+ background: true,
+ // Enable to crop the image automatically when initialize
+ autoCrop: true,
+ // Define the percentage of automatic cropping area when initializes
+ autoCropArea: 0.8,
+ // Enable to move the image
+ movable: true,
+ // Enable to rotate the image
+ rotatable: true,
+ // Enable to scale the image
+ scalable: true,
+ // Enable to zoom the image
+ zoomable: true,
+ // Enable to zoom the image by dragging touch
+ zoomOnTouch: true,
+ // Enable to zoom the image by wheeling mouse
+ zoomOnWheel: true,
+ // Define zoom ratio when zoom the image by wheeling mouse
+ wheelZoomRatio: 0.1,
+ // Enable to move the crop box
+ cropBoxMovable: true,
+ // Enable to resize the crop box
+ cropBoxResizable: true,
+ // Toggle drag mode between "crop" and "move" when click twice on the cropper
+ toggleDragModeOnDblclick: true,
+ // Size limitation
+ minCanvasWidth: 0,
+ minCanvasHeight: 0,
+ minCropBoxWidth: 0,
+ minCropBoxHeight: 0,
+ minContainerWidth: 200,
+ minContainerHeight: 100,
+ // Shortcuts of events
+ ready: null,
+ cropstart: null,
+ cropmove: null,
+ cropend: null,
+ crop: null,
+ zoom: null
+ };
+ var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>';
+ /**
+ * Check if the given value is not a number.
+ */
+ var isNaN = Number.isNaN || WINDOW.isNaN;
+ /**
+ * Check if the given value is a number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a number, else `false`.
+ */
+ function isNumber(value) {
+ return typeof value === 'number' && !isNaN(value);
+ }
+ /**
+ * Check if the given value is a positive number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
+ */
-var toConsumableArray = function (arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+ var isPositiveNumber = function isPositiveNumber(value) {
+ return value > 0 && value < Infinity;
+ };
+ /**
+ * Check if the given value is undefined.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
+ */
- return arr2;
- } else {
- return Array.from(arr);
+ function isUndefined(value) {
+ return typeof value === 'undefined';
}
-};
-
-/**
- * Check if the given value is not a number.
- */
-var isNaN = Number.isNaN || WINDOW.isNaN;
+ /**
+ * Check if the given value is an object.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is an object, else `false`.
+ */
-/**
- * Check if the given value is a number.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a number, else `false`.
- */
-function isNumber(value) {
- return typeof value === 'number' && !isNaN(value);
-}
-
-/**
- * Check if the given value is undefined.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
- */
-function isUndefined(value) {
- return typeof value === 'undefined';
-}
-
-/**
- * Check if the given value is an object.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is an object, else `false`.
- */
-function isObject(value) {
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null;
-}
+ function isObject(value) {
+ return _typeof(value) === 'object' && value !== null;
+ }
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ /**
+ * Check if the given value is a plain object.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
+ */
-var hasOwnProperty = Object.prototype.hasOwnProperty;
+ function isPlainObject(value) {
+ if (!isObject(value)) {
+ return false;
+ }
-/**
- * Check if the given value is a plain object.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
- */
+ try {
+ var _constructor = value.constructor;
+ var prototype = _constructor.prototype;
+ return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
+ } catch (error) {
+ return false;
+ }
+ }
+ /**
+ * Check if the given value is a function.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a function, else `false`.
+ */
-function isPlainObject(value) {
- if (!isObject(value)) {
- return false;
+ function isFunction(value) {
+ return typeof value === 'function';
}
+ var slice = Array.prototype.slice;
+ /**
+ * Convert array-like or iterable object to an array.
+ * @param {*} value - The value to convert.
+ * @returns {Array} Returns a new array.
+ */
- try {
- var _constructor = value.constructor;
- var prototype = _constructor.prototype;
+ function toArray(value) {
+ return Array.from ? Array.from(value) : slice.call(value);
+ }
+ /**
+ * Iterate the given data.
+ * @param {*} data - The data to iterate.
+ * @param {Function} callback - The process function for each element.
+ * @returns {*} The original data.
+ */
+ function forEach(data, callback) {
+ if (data && isFunction(callback)) {
+ if (Array.isArray(data) || isNumber(data.length)
+ /* array-like */
+ ) {
+ toArray(data).forEach(function (value, key) {
+ callback.call(data, value, key, data);
+ });
+ } else if (isObject(data)) {
+ Object.keys(data).forEach(function (key) {
+ callback.call(data, data[key], key, data);
+ });
+ }
+ }
- return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
- } catch (e) {
- return false;
+ return data;
}
-}
-
-/**
- * Check if the given value is a function.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a function, else `false`.
- */
-function isFunction(value) {
- return typeof value === 'function';
-}
-
-/**
- * Iterate the given data.
- * @param {*} data - The data to iterate.
- * @param {Function} callback - The process function for each element.
- * @returns {*} The original data.
- */
-function each(data, callback) {
- if (data && isFunction(callback)) {
- if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
- var length = data.length;
+ /**
+ * Extend the given object.
+ * @param {*} target - The target object to extend.
+ * @param {*} args - The rest objects for merging to the target object.
+ * @returns {Object} The extended object.
+ */
- var i = void 0;
+ var assign = Object.assign || function assign(target) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
- for (i = 0; i < length; i += 1) {
- if (callback.call(data, data[i], i, data) === false) {
- break;
- }
+ if (isObject(target) && args.length > 0) {
+ args.forEach(function (arg) {
+ if (isObject(arg)) {
+ Object.keys(arg).forEach(function (key) {
+ target[key] = arg[key];
+ });
}
- } else if (isObject(data)) {
- Object.keys(data).forEach(function (key) {
- callback.call(data, data[key], key, data);
});
}
- }
- return data;
-}
+ return target;
+ };
+ var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
+ /**
+ * Normalize decimal number.
+ * Check out {@link http://0.30000000000000004.com/}
+ * @param {number} value - The value to normalize.
+ * @param {number} [times=100000000000] - The times for normalizing.
+ * @returns {number} Returns the normalized number.
+ */
-/**
- * Extend the given object.
- * @param {*} obj - The object to be extended.
- * @param {*} args - The rest objects which will be merged to the first object.
- * @returns {Object} The extended object.
- */
-function extend(obj) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
+ function normalizeDecimalNumber(value) {
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
+ return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
+ var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
+ /**
+ * Apply styles to the given element.
+ * @param {Element} element - The target element.
+ * @param {Object} styles - The styles for applying.
+ */
- if (isObject(obj) && args.length > 0) {
- if (Object.assign) {
- return Object.assign.apply(Object, [obj].concat(args));
- }
-
- args.forEach(function (arg) {
- if (isObject(arg)) {
- Object.keys(arg).forEach(function (key) {
- obj[key] = arg[key];
- });
+ function setStyle(element, styles) {
+ var style = element.style;
+ forEach(styles, function (value, property) {
+ if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
+ value = "".concat(value, "px");
}
+
+ style[property] = value;
});
}
+ /**
+ * Check if the given element has a special class.
+ * @param {Element} element - The element to check.
+ * @param {string} value - The class to search.
+ * @returns {boolean} Returns `true` if the special class was found.
+ */
- return obj;
-}
-
-/**
- * Takes a function and returns a new one that will always have a particular context.
- * @param {Function} fn - The target function.
- * @param {Object} context - The new context for the function.
- * @returns {boolean} The new function.
- */
-function proxy(fn, context) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
+ function hasClass(element, value) {
+ return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
}
+ /**
+ * Add classes to the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be added.
+ */
- return function () {
- for (var _len3 = arguments.length, args2 = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args2[_key3] = arguments[_key3];
+ function addClass(element, value) {
+ if (!value) {
+ return;
}
- return fn.apply(context, args.concat(args2));
- };
-}
-
-var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/i;
-
-/**
- * Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/ }
- * @param {number} value - The value to normalize.
- * @param {number} [times=100000000000] - The times for normalizing.
- * @returns {number} Returns the normalized number.
- */
-function normalizeDecimalNumber(value) {
- var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
-
- return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
-}
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ addClass(elem, value);
+ });
+ return;
+ }
-var REGEXP_SUFFIX = /^(width|height|left|top|marginLeft|marginTop)$/;
+ if (element.classList) {
+ element.classList.add(value);
+ return;
+ }
-/**
- * Apply styles to the given element.
- * @param {Element} element - The target element.
- * @param {Object} styles - The styles for applying.
- */
-function setStyle(element, styles) {
- var style = element.style;
+ var className = element.className.trim();
+ if (!className) {
+ element.className = value;
+ } else if (className.indexOf(value) < 0) {
+ element.className = "".concat(className, " ").concat(value);
+ }
+ }
+ /**
+ * Remove classes from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be removed.
+ */
- each(styles, function (value, property) {
- if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
- value += 'px';
+ function removeClass(element, value) {
+ if (!value) {
+ return;
}
- style[property] = value;
- });
-}
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ removeClass(elem, value);
+ });
+ return;
+ }
-/**
- * Check if the given element has a special class.
- * @param {Element} element - The element to check.
- * @param {string} value - The class to search.
- * @returns {boolean} Returns `true` if the special class was found.
- */
-function hasClass(element, value) {
- return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
-}
-
-/**
- * Add classes to the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be added.
- */
-function addClass(element, value) {
- if (!value) {
- return;
- }
+ if (element.classList) {
+ element.classList.remove(value);
+ return;
+ }
- if (isNumber(element.length)) {
- each(element, function (elem) {
- addClass(elem, value);
- });
- return;
+ if (element.className.indexOf(value) >= 0) {
+ element.className = element.className.replace(value, '');
+ }
}
+ /**
+ * Add or remove classes from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be toggled.
+ * @param {boolean} added - Add only.
+ */
- if (element.classList) {
- element.classList.add(value);
- return;
- }
+ function toggleClass(element, value, added) {
+ if (!value) {
+ return;
+ }
- var className = element.className.trim();
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ toggleClass(elem, value, added);
+ });
+ return;
+ } // IE10-11 doesn't support the second parameter of `classList.toggle`
- if (!className) {
- element.className = value;
- } else if (className.indexOf(value) < 0) {
- element.className = className + ' ' + value;
- }
-}
-/**
- * Remove classes from the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be removed.
- */
-function removeClass(element, value) {
- if (!value) {
- return;
+ if (added) {
+ addClass(element, value);
+ } else {
+ removeClass(element, value);
+ }
}
+ var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
+ /**
+ * Transform the given string from camelCase to kebab-case
+ * @param {string} value - The value to transform.
+ * @returns {string} The transformed value.
+ */
- if (isNumber(element.length)) {
- each(element, function (elem) {
- removeClass(elem, value);
- });
- return;
+ function toParamCase(value) {
+ return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();
}
+ /**
+ * Get data from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to get.
+ * @returns {string} The data value.
+ */
- if (element.classList) {
- element.classList.remove(value);
- return;
- }
+ function getData(element, name) {
+ if (isObject(element[name])) {
+ return element[name];
+ }
- if (element.className.indexOf(value) >= 0) {
- element.className = element.className.replace(value, '');
- }
-}
+ if (element.dataset) {
+ return element.dataset[name];
+ }
-/**
- * Add or remove classes from the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be toggled.
- * @param {boolean} added - Add only.
- */
-function toggleClass(element, value, added) {
- if (!value) {
- return;
+ return element.getAttribute("data-".concat(toParamCase(name)));
}
+ /**
+ * Set data to the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to set.
+ * @param {string} data - The data value.
+ */
- if (isNumber(element.length)) {
- each(element, function (elem) {
- toggleClass(elem, value, added);
- });
- return;
+ function setData(element, name, data) {
+ if (isObject(data)) {
+ element[name] = data;
+ } else if (element.dataset) {
+ element.dataset[name] = data;
+ } else {
+ element.setAttribute("data-".concat(toParamCase(name)), data);
+ }
}
+ /**
+ * Remove data from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to remove.
+ */
- // IE10-11 doesn't support the second parameter of `classList.toggle`
- if (added) {
- addClass(element, value);
- } else {
- removeClass(element, value);
+ function removeData(element, name) {
+ if (isObject(element[name])) {
+ try {
+ delete element[name];
+ } catch (error) {
+ element[name] = undefined;
+ }
+ } else if (element.dataset) {
+ // #128 Safari not allows to delete dataset property
+ try {
+ delete element.dataset[name];
+ } catch (error) {
+ element.dataset[name] = undefined;
+ }
+ } else {
+ element.removeAttribute("data-".concat(toParamCase(name)));
+ }
}
-}
+ var REGEXP_SPACES = /\s\s*/;
-var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
+ var onceSupported = function () {
+ var supported = false;
-/**
- * Hyphenate the given value.
- * @param {string} value - The value to hyphenate.
- * @returns {string} The hyphenated value.
- */
-function hyphenate(value) {
- return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
-}
-
-/**
- * Get data from the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to get.
- * @returns {string} The data value.
- */
-function getData(element, name) {
- if (isObject(element[name])) {
- return element[name];
- } else if (element.dataset) {
- return element.dataset[name];
- }
+ if (IS_BROWSER) {
+ var once = false;
- return element.getAttribute('data-' + hyphenate(name));
-}
+ var listener = function listener() {};
-/**
- * Set data to the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to set.
- * @param {string} data - The data value.
- */
-function setData(element, name, data) {
- if (isObject(data)) {
- element[name] = data;
- } else if (element.dataset) {
- element.dataset[name] = data;
- } else {
- element.setAttribute('data-' + hyphenate(name), data);
- }
-}
+ var options = Object.defineProperty({}, 'once', {
+ get: function get() {
+ supported = true;
+ return once;
+ },
-/**
- * Remove data from the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to remove.
- */
-function removeData(element, name) {
- if (isObject(element[name])) {
- try {
- delete element[name];
- } catch (e) {
- element[name] = null;
- }
- } else if (element.dataset) {
- // #128 Safari not allows to delete dataset property
- try {
- delete element.dataset[name];
- } catch (e) {
- element.dataset[name] = null;
+ /**
+ * This setter can fix a `TypeError` in strict mode
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+ * @param {boolean} value - The value to set
+ */
+ set: function set(value) {
+ once = value;
+ }
+ });
+ WINDOW.addEventListener('test', listener, options);
+ WINDOW.removeEventListener('test', listener, options);
}
- } else {
- element.removeAttribute('data-' + hyphenate(name));
- }
-}
-var REGEXP_SPACES = /\s+/;
+ return supported;
+ }();
+ /**
+ * Remove event listener from the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Function} listener - The event listener.
+ * @param {Object} options - The event options.
+ */
+
-/**
- * Remove event listener from the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Function} listener - The event listener.
- * @param {Object} options - The event options.
- */
-function removeListener(element, type, listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ function removeListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (!onceSupported) {
+ var listeners = element.listeners;
- if (!isFunction(listener)) {
- return;
- }
+ if (listeners && listeners[event] && listeners[event][listener]) {
+ handler = listeners[event][listener];
+ delete listeners[event][listener];
- var types = type.trim().split(REGEXP_SPACES);
+ if (Object.keys(listeners[event]).length === 0) {
+ delete listeners[event];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- removeListener(element, t, listener, options);
+ if (Object.keys(listeners).length === 0) {
+ delete element.listeners;
+ }
+ }
+ }
+
+ element.removeEventListener(event, handler, options);
});
- return;
}
+ /**
+ * Add event listener to the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Function} listener - The event listener.
+ * @param {Object} options - The event options.
+ */
- if (element.removeEventListener) {
- element.removeEventListener(type, listener, options);
- } else if (element.detachEvent) {
- element.detachEvent('on' + type, listener);
- }
-}
-
-/**
- * Add event listener to the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Function} listener - The event listener.
- * @param {Object} options - The event options.
- */
-function addListener(element, type, _listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ function addListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var _handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (options.once && !onceSupported) {
+ var _element$listeners = element.listeners,
+ listeners = _element$listeners === void 0 ? {} : _element$listeners;
- if (!isFunction(_listener)) {
- return;
- }
+ _handler = function handler() {
+ delete listeners[event][listener];
+ element.removeEventListener(event, _handler, options);
- var types = type.trim().split(REGEXP_SPACES);
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- addListener(element, t, _listener, options);
- });
- return;
- }
+ listener.apply(element, args);
+ };
- if (options.once) {
- var originalListener = _listener;
+ if (!listeners[event]) {
+ listeners[event] = {};
+ }
- _listener = function listener() {
- for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
+ if (listeners[event][listener]) {
+ element.removeEventListener(event, listeners[event][listener], options);
+ }
+
+ listeners[event][listener] = _handler;
+ element.listeners = listeners;
}
- removeListener(element, type, _listener, options);
- return originalListener.apply(element, args);
- };
+ element.addEventListener(event, _handler, options);
+ });
}
+ /**
+ * Dispatch event on the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Object} data - The additional event data.
+ * @returns {boolean} Indicate if the event is default prevented or not.
+ */
- if (element.addEventListener) {
- element.addEventListener(type, _listener, options);
- } else if (element.attachEvent) {
- element.attachEvent('on' + type, _listener);
- }
-}
-
-/**
- * Dispatch event on the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Object} data - The additional event data.
- * @returns {boolean} Indicate if the event is default prevented or not.
- */
-function dispatchEvent(element, type, data) {
- if (element.dispatchEvent) {
- var event = void 0;
+ function dispatchEvent(element, type, data) {
+ var event; // Event and CustomEvent on IE9-11 are global objects, not constructors
- // Event and CustomEvent on IE9-11 are global objects, not constructors
if (isFunction(Event) && isFunction(CustomEvent)) {
- if (isUndefined(data)) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true
- });
- }
- } else if (isUndefined(data)) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true
+ });
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent(type, true, true, data);
}
- // IE9+
return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent('on' + type);
}
+ /**
+ * Get the offset base on the document.
+ * @param {Element} element - The target element.
+ * @returns {Object} The offset data.
+ */
- return true;
-}
-
-/**
- * Get the offset base on the document.
- * @param {Element} element - The target element.
- * @returns {Object} The offset data.
- */
-function getOffset(element) {
- var doc = document.documentElement;
- var box = element.getBoundingClientRect();
-
- return {
- left: box.left + ((window.scrollX || doc && doc.scrollLeft || 0) - (doc && doc.clientLeft || 0)),
- top: box.top + ((window.scrollY || doc && doc.scrollTop || 0) - (doc && doc.clientTop || 0))
- };
-}
-
-/**
- * Empty an element.
- * @param {Element} element - The element to empty.
- */
-function empty(element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
+ function getOffset(element) {
+ var box = element.getBoundingClientRect();
+ return {
+ left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+ top: box.top + (window.pageYOffset - document.documentElement.clientTop)
+ };
}
-}
+ var location = WINDOW.location;
+ var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
+ /**
+ * Check if the given URL is a cross origin URL.
+ * @param {string} url - The target URL.
+ * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
+ */
-var location = WINDOW.location;
+ function isCrossOriginURL(url) {
+ var parts = url.match(REGEXP_ORIGINS);
+ return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
+ }
+ /**
+ * Add timestamp to the given URL.
+ * @param {string} url - The target URL.
+ * @returns {string} The result URL.
+ */
-var REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
+ function addTimestamp(url) {
+ var timestamp = "timestamp=".concat(new Date().getTime());
+ return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
+ }
+ /**
+ * Get transforms base on the given object.
+ * @param {Object} obj - The target object.
+ * @returns {string} A string contains transform values.
+ */
-/**
- * Check if the given URL is a cross origin URL.
- * @param {string} url - The target URL.
- * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
- */
-function isCrossOriginURL(url) {
- var parts = url.match(REGEXP_ORIGINS);
+ function getTransforms(_ref) {
+ var rotate = _ref.rotate,
+ scaleX = _ref.scaleX,
+ scaleY = _ref.scaleY,
+ translateX = _ref.translateX,
+ translateY = _ref.translateY;
+ var values = [];
- return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
-}
+ if (isNumber(translateX) && translateX !== 0) {
+ values.push("translateX(".concat(translateX, "px)"));
+ }
-/**
- * Add timestamp to the given URL.
- * @param {string} url - The target URL.
- * @returns {string} The result URL.
- */
-function addTimestamp(url) {
- var timestamp = 'timestamp=' + new Date().getTime();
+ if (isNumber(translateY) && translateY !== 0) {
+ values.push("translateY(".concat(translateY, "px)"));
+ } // Rotate should come first before scale to match orientation transform
- return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
-}
-/**
- * Get transforms base on the given object.
- * @param {Object} obj - The target object.
- * @returns {string} A string contains transform values.
- */
-function getTransforms(_ref) {
- var rotate = _ref.rotate,
- scaleX = _ref.scaleX,
- scaleY = _ref.scaleY,
- translateX = _ref.translateX,
- translateY = _ref.translateY;
+ if (isNumber(rotate) && rotate !== 0) {
+ values.push("rotate(".concat(rotate, "deg)"));
+ }
- var values = [];
+ if (isNumber(scaleX) && scaleX !== 1) {
+ values.push("scaleX(".concat(scaleX, ")"));
+ }
- if (isNumber(translateX) && translateX !== 0) {
- values.push('translateX(' + translateX + 'px)');
- }
+ if (isNumber(scaleY) && scaleY !== 1) {
+ values.push("scaleY(".concat(scaleY, ")"));
+ }
- if (isNumber(translateY) && translateY !== 0) {
- values.push('translateY(' + translateY + 'px)');
+ var transform = values.length ? values.join(' ') : 'none';
+ return {
+ WebkitTransform: transform,
+ msTransform: transform,
+ transform: transform
+ };
}
+ /**
+ * Get the max ratio of a group of pointers.
+ * @param {string} pointers - The target pointers.
+ * @returns {number} The result ratio.
+ */
- // Rotate should come first before scale to match orientation transform
- if (isNumber(rotate) && rotate !== 0) {
- values.push('rotate(' + rotate + 'deg)');
+ function getMaxZoomRatio(pointers) {
+ var pointers2 = _objectSpread2({}, pointers);
+
+ var ratios = [];
+ forEach(pointers, function (pointer, pointerId) {
+ delete pointers2[pointerId];
+ forEach(pointers2, function (pointer2) {
+ var x1 = Math.abs(pointer.startX - pointer2.startX);
+ var y1 = Math.abs(pointer.startY - pointer2.startY);
+ var x2 = Math.abs(pointer.endX - pointer2.endX);
+ var y2 = Math.abs(pointer.endY - pointer2.endY);
+ var z1 = Math.sqrt(x1 * x1 + y1 * y1);
+ var z2 = Math.sqrt(x2 * x2 + y2 * y2);
+ var ratio = (z2 - z1) / z1;
+ ratios.push(ratio);
+ });
+ });
+ ratios.sort(function (a, b) {
+ return Math.abs(a) < Math.abs(b);
+ });
+ return ratios[0];
}
+ /**
+ * Get a pointer from an event object.
+ * @param {Object} event - The target event object.
+ * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
+ * @returns {Object} The result pointer contains start and/or end point coordinates.
+ */
- if (isNumber(scaleX) && scaleX !== 1) {
- values.push('scaleX(' + scaleX + ')');
+ function getPointer(_ref2, endOnly) {
+ var pageX = _ref2.pageX,
+ pageY = _ref2.pageY;
+ var end = {
+ endX: pageX,
+ endY: pageY
+ };
+ return endOnly ? end : _objectSpread2({
+ startX: pageX,
+ startY: pageY
+ }, end);
}
+ /**
+ * Get the center point coordinate of a group of pointers.
+ * @param {Object} pointers - The target pointers.
+ * @returns {Object} The center point coordinate.
+ */
- if (isNumber(scaleY) && scaleY !== 1) {
- values.push('scaleY(' + scaleY + ')');
+ function getPointersCenter(pointers) {
+ var pageX = 0;
+ var pageY = 0;
+ var count = 0;
+ forEach(pointers, function (_ref3) {
+ var startX = _ref3.startX,
+ startY = _ref3.startY;
+ pageX += startX;
+ pageY += startY;
+ count += 1;
+ });
+ pageX /= count;
+ pageY /= count;
+ return {
+ pageX: pageX,
+ pageY: pageY
+ };
}
+ /**
+ * Get the max sizes in a rectangle under the given aspect ratio.
+ * @param {Object} data - The original sizes.
+ * @param {string} [type='contain'] - The adjust type.
+ * @returns {Object} The result sizes.
+ */
- var transform = values.length ? values.join(' ') : 'none';
-
- return {
- WebkitTransform: transform,
- msTransform: transform,
- transform: transform
- };
-}
+ function getAdjustedSizes(_ref4) // or 'cover'
+ {
+ var aspectRatio = _ref4.aspectRatio,
+ height = _ref4.height,
+ width = _ref4.width;
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';
+ var isValidWidth = isPositiveNumber(width);
+ var isValidHeight = isPositiveNumber(height);
-var navigator = WINDOW.navigator;
+ if (isValidWidth && isValidHeight) {
+ var adjustedWidth = height * aspectRatio;
-var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
+ if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {
+ height = width / aspectRatio;
+ } else {
+ width = height * aspectRatio;
+ }
+ } else if (isValidWidth) {
+ height = width / aspectRatio;
+ } else if (isValidHeight) {
+ width = height * aspectRatio;
+ }
-/**
- * Get an image's natural sizes.
- * @param {string} image - The target image.
- * @param {Function} callback - The callback function.
- */
-function getImageNaturalSizes(image, callback) {
- // Modern browsers (except Safari)
- if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
- callback(image.naturalWidth, image.naturalHeight);
- return;
+ return {
+ width: width,
+ height: height
+ };
}
+ /**
+ * Get the new sizes of a rectangle after rotated.
+ * @param {Object} data - The original sizes.
+ * @returns {Object} The result sizes.
+ */
- var newImage = document.createElement('img');
- var body = document.body || document.documentElement;
-
- newImage.onload = function () {
- callback(newImage.width, newImage.height);
+ function getRotatedSizes(_ref5) {
+ var width = _ref5.width,
+ height = _ref5.height,
+ degree = _ref5.degree;
+ degree = Math.abs(degree) % 180;
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- body.removeChild(newImage);
+ if (degree === 90) {
+ return {
+ width: height,
+ height: width
+ };
}
- };
-
- newImage.src = image.src;
- // iOS Safari will convert the image automatically
- // with its orientation once append it into DOM (#279)
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
- body.appendChild(newImage);
+ var arc = degree % 90 * Math.PI / 180;
+ var sinArc = Math.sin(arc);
+ var cosArc = Math.cos(arc);
+ var newWidth = width * cosArc + height * sinArc;
+ var newHeight = width * sinArc + height * cosArc;
+ return degree > 90 ? {
+ width: newHeight,
+ height: newWidth
+ } : {
+ width: newWidth,
+ height: newHeight
+ };
}
-}
+ /**
+ * Get a canvas which drew the given image.
+ * @param {HTMLImageElement} image - The image for drawing.
+ * @param {Object} imageData - The image data.
+ * @param {Object} canvasData - The canvas data.
+ * @param {Object} options - The options.
+ * @returns {HTMLCanvasElement} The result canvas.
+ */
-/**
- * Get the max ratio of a group of pointers.
- * @param {string} pointers - The target pointers.
- * @returns {number} The result ratio.
- */
-function getMaxZoomRatio(pointers) {
- var pointers2 = extend({}, pointers);
- var ratios = [];
-
- each(pointers, function (pointer, pointerId) {
- delete pointers2[pointerId];
-
- each(pointers2, function (pointer2) {
- var x1 = Math.abs(pointer.startX - pointer2.startX);
- var y1 = Math.abs(pointer.startY - pointer2.startY);
- var x2 = Math.abs(pointer.endX - pointer2.endX);
- var y2 = Math.abs(pointer.endY - pointer2.endY);
- var z1 = Math.sqrt(x1 * x1 + y1 * y1);
- var z2 = Math.sqrt(x2 * x2 + y2 * y2);
- var ratio = (z2 - z1) / z1;
-
- ratios.push(ratio);
+ function getSourceCanvas(image, _ref6, _ref7, _ref8) {
+ var imageAspectRatio = _ref6.aspectRatio,
+ imageNaturalWidth = _ref6.naturalWidth,
+ imageNaturalHeight = _ref6.naturalHeight,
+ _ref6$rotate = _ref6.rotate,
+ rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,
+ _ref6$scaleX = _ref6.scaleX,
+ scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,
+ _ref6$scaleY = _ref6.scaleY,
+ scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;
+ var aspectRatio = _ref7.aspectRatio,
+ naturalWidth = _ref7.naturalWidth,
+ naturalHeight = _ref7.naturalHeight;
+ var _ref8$fillColor = _ref8.fillColor,
+ fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,
+ _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
+ imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,
+ _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
+ imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,
+ _ref8$maxWidth = _ref8.maxWidth,
+ maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,
+ _ref8$maxHeight = _ref8.maxHeight,
+ maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,
+ _ref8$minWidth = _ref8.minWidth,
+ minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,
+ _ref8$minHeight = _ref8.minHeight,
+ minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ var maxSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: maxWidth,
+ height: maxHeight
});
- });
-
- ratios.sort(function (a, b) {
- return Math.abs(a) < Math.abs(b);
- });
-
- return ratios[0];
-}
-
-/**
- * Get a pointer from an event object.
- * @param {Object} event - The target event object.
- * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
- * @returns {Object} The result pointer contains start and/or end point coordinates.
- */
-function getPointer(_ref2, endOnly) {
- var pageX = _ref2.pageX,
- pageY = _ref2.pageY;
-
- var end = {
- endX: pageX,
- endY: pageY
- };
-
- if (endOnly) {
- return end;
+ var minSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
+ var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as
+ // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90
+
+ var destMaxSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: maxWidth,
+ height: maxHeight
+ });
+ var destMinSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));
+ var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));
+ var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];
+ canvas.width = normalizeDecimalNumber(width);
+ canvas.height = normalizeDecimalNumber(height);
+ context.fillStyle = fillColor;
+ context.fillRect(0, 0, width, height);
+ context.save();
+ context.translate(width / 2, height / 2);
+ context.rotate(rotate * Math.PI / 180);
+ context.scale(scaleX, scaleY);
+ context.imageSmoothingEnabled = imageSmoothingEnabled;
+ context.imageSmoothingQuality = imageSmoothingQuality;
+ context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {
+ return Math.floor(normalizeDecimalNumber(param));
+ }))));
+ context.restore();
+ return canvas;
}
+ var fromCharCode = String.fromCharCode;
+ /**
+ * Get string from char code in data view.
+ * @param {DataView} dataView - The data view for read.
+ * @param {number} start - The start index.
+ * @param {number} length - The read length.
+ * @returns {string} The read result.
+ */
- return extend({
- startX: pageX,
- startY: pageY
- }, end);
-}
-
-/**
- * Get the center point coordinate of a group of pointers.
- * @param {Object} pointers - The target pointers.
- * @returns {Object} The center point coordinate.
- */
-function getPointersCenter(pointers) {
- var pageX = 0;
- var pageY = 0;
- var count = 0;
-
- each(pointers, function (_ref3) {
- var startX = _ref3.startX,
- startY = _ref3.startY;
-
- pageX += startX;
- pageY += startY;
- count += 1;
- });
-
- pageX /= count;
- pageY /= count;
-
- return {
- pageX: pageX,
- pageY: pageY
- };
-}
-
-/**
- * Check if the given value is a finite number.
- */
-var isFinite = Number.isFinite || WINDOW.isFinite;
-
-/**
- * Get the max sizes in a rectangle under the given aspect ratio.
- * @param {Object} data - The original sizes.
- * @returns {Object} The result sizes.
- */
-function getContainSizes(_ref4) {
- var aspectRatio = _ref4.aspectRatio,
- height = _ref4.height,
- width = _ref4.width;
-
- var isValidNumber = function isValidNumber(value) {
- return isFinite(value) && value > 0;
- };
+ function getStringFromCharCode(dataView, start, length) {
+ var str = '';
+ length += start;
- if (isValidNumber(width) && isValidNumber(height)) {
- if (height * aspectRatio > width) {
- height = width / aspectRatio;
- } else {
- width = height * aspectRatio;
+ for (var i = start; i < length; i += 1) {
+ str += fromCharCode(dataView.getUint8(i));
}
- } else if (isValidNumber(width)) {
- height = width / aspectRatio;
- } else if (isValidNumber(height)) {
- width = height * aspectRatio;
- }
- return {
- width: width,
- height: height
- };
-}
-
-/**
- * Get the new sizes of a rectangle after rotated.
- * @param {Object} data - The original sizes.
- * @returns {Object} The result sizes.
- */
-function getRotatedSizes(_ref5) {
- var width = _ref5.width,
- height = _ref5.height,
- degree = _ref5.degree;
-
- degree = Math.abs(degree) % 180;
+ return str;
+ }
+ var REGEXP_DATA_URL_HEAD = /^data:.*,/;
+ /**
+ * Transform Data URL to array buffer.
+ * @param {string} dataURL - The Data URL to transform.
+ * @returns {ArrayBuffer} The result array buffer.
+ */
- if (degree === 90) {
- return {
- width: height,
- height: width
- };
+ function dataURLToArrayBuffer(dataURL) {
+ var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
+ var binary = atob(base64);
+ var arrayBuffer = new ArrayBuffer(binary.length);
+ var uint8 = new Uint8Array(arrayBuffer);
+ forEach(uint8, function (value, i) {
+ uint8[i] = binary.charCodeAt(i);
+ });
+ return arrayBuffer;
}
+ /**
+ * Transform array buffer to Data URL.
+ * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
+ * @param {string} mimeType - The mime type of the Data URL.
+ * @returns {string} The result Data URL.
+ */
- var arc = degree % 90 * Math.PI / 180;
- var sinArc = Math.sin(arc);
- var cosArc = Math.cos(arc);
- var newWidth = width * cosArc + height * sinArc;
- var newHeight = width * sinArc + height * cosArc;
-
- return degree > 90 ? {
- width: newHeight,
- height: newWidth
- } : {
- width: newWidth,
- height: newHeight
- };
-}
-
-/**
- * Get a canvas which drew the given image.
- * @param {HTMLImageElement} image - The image for drawing.
- * @param {Object} imageData - The image data.
- * @param {Object} canvasData - The canvas data.
- * @param {Object} options - The options.
- * @returns {HTMLCanvasElement} The result canvas.
- */
-function getSourceCanvas(image, _ref6, _ref7, _ref8) {
- var imageNaturalWidth = _ref6.naturalWidth,
- imageNaturalHeight = _ref6.naturalHeight,
- _ref6$rotate = _ref6.rotate,
- rotate = _ref6$rotate === undefined ? 0 : _ref6$rotate,
- _ref6$scaleX = _ref6.scaleX,
- scaleX = _ref6$scaleX === undefined ? 1 : _ref6$scaleX,
- _ref6$scaleY = _ref6.scaleY,
- scaleY = _ref6$scaleY === undefined ? 1 : _ref6$scaleY;
- var aspectRatio = _ref7.aspectRatio,
- naturalWidth = _ref7.naturalWidth,
- naturalHeight = _ref7.naturalHeight;
- var _ref8$fillColor = _ref8.fillColor,
- fillColor = _ref8$fillColor === undefined ? 'transparent' : _ref8$fillColor,
- _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
- imageSmoothingEnabled = _ref8$imageSmoothingE === undefined ? true : _ref8$imageSmoothingE,
- _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
- imageSmoothingQuality = _ref8$imageSmoothingQ === undefined ? 'low' : _ref8$imageSmoothingQ,
- _ref8$maxWidth = _ref8.maxWidth,
- maxWidth = _ref8$maxWidth === undefined ? Infinity : _ref8$maxWidth,
- _ref8$maxHeight = _ref8.maxHeight,
- maxHeight = _ref8$maxHeight === undefined ? Infinity : _ref8$maxHeight,
- _ref8$minWidth = _ref8.minWidth,
- minWidth = _ref8$minWidth === undefined ? 0 : _ref8$minWidth,
- _ref8$minHeight = _ref8.minHeight,
- minHeight = _ref8$minHeight === undefined ? 0 : _ref8$minHeight;
-
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
- var maxSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: maxWidth,
- height: maxHeight
- });
- var minSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: minWidth,
- height: minHeight
- });
- var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
- var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
- var params = [-imageNaturalWidth / 2, -imageNaturalHeight / 2, imageNaturalWidth, imageNaturalHeight];
-
- canvas.width = normalizeDecimalNumber(width);
- canvas.height = normalizeDecimalNumber(height);
- context.fillStyle = fillColor;
- context.fillRect(0, 0, width, height);
- context.save();
- context.translate(width / 2, height / 2);
- context.rotate(rotate * Math.PI / 180);
- context.scale(scaleX, scaleY);
- context.imageSmoothingEnabled = imageSmoothingEnabled;
- context.imageSmoothingQuality = imageSmoothingQuality;
- context.drawImage.apply(context, [image].concat(toConsumableArray(params.map(function (param) {
- return Math.floor(normalizeDecimalNumber(param));
- }))));
- context.restore();
- return canvas;
-}
-
-var fromCharCode = String.fromCharCode;
-
-/**
- * Get string from char code in data view.
- * @param {DataView} dataView - The data view for read.
- * @param {number} start - The start index.
- * @param {number} length - The read length.
- * @returns {string} The read result.
- */
+ function arrayBufferToDataURL(arrayBuffer, mimeType) {
+ var chunks = []; // Chunk Typed Array for better performance (#435)
-function getStringFromCharCode(dataView, start, length) {
- var str = '';
- var i = void 0;
+ var chunkSize = 8192;
+ var uint8 = new Uint8Array(arrayBuffer);
- length += start;
+ while (uint8.length > 0) {
+ // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9
+ // eslint-disable-next-line prefer-spread
+ chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
+ uint8 = uint8.subarray(chunkSize);
+ }
- for (i = start; i < length; i += 1) {
- str += fromCharCode(dataView.getUint8(i));
+ return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join('')));
}
+ /**
+ * Get orientation value from given array buffer.
+ * @param {ArrayBuffer} arrayBuffer - The array buffer to read.
+ * @returns {number} The read orientation value.
+ */
- return str;
-}
+ function resetAndGetOrientation(arrayBuffer) {
+ var dataView = new DataView(arrayBuffer);
+ var orientation; // Ignores range error when the image does not have correct Exif information
-var REGEXP_DATA_URL_HEAD = /^data:.*,/;
+ try {
+ var littleEndian;
+ var app1Start;
+ var ifdStart; // Only handle JPEG image (start by 0xFFD8)
-/**
- * Transform Data URL to array buffer.
- * @param {string} dataURL - The Data URL to transform.
- * @returns {ArrayBuffer} The result array buffer.
- */
-function dataURLToArrayBuffer(dataURL) {
- var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
- var binary = atob(base64);
- var arrayBuffer = new ArrayBuffer(binary.length);
- var uint8 = new Uint8Array(arrayBuffer);
-
- each(uint8, function (value, i) {
- uint8[i] = binary.charCodeAt(i);
- });
-
- return arrayBuffer;
-}
-
-/**
- * Transform array buffer to Data URL.
- * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
- * @param {string} mimeType - The mime type of the Data URL.
- * @returns {string} The result Data URL.
- */
-function arrayBufferToDataURL(arrayBuffer, mimeType) {
- var uint8 = new Uint8Array(arrayBuffer);
- var data = '';
-
- // TypedArray.prototype.forEach is not supported in some browsers.
- each(uint8, function (value) {
- data += fromCharCode(value);
- });
-
- return 'data:' + mimeType + ';base64,' + btoa(data);
-}
-
-/**
- * Get orientation value from given array buffer.
- * @param {ArrayBuffer} arrayBuffer - The array buffer to read.
- * @returns {number} The read orientation value.
- */
-function getOrientation(arrayBuffer) {
- var dataView = new DataView(arrayBuffer);
- var orientation = void 0;
- var littleEndian = void 0;
- var app1Start = void 0;
- var ifdStart = void 0;
-
- // Only handle JPEG image (start by 0xFFD8)
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
- var length = dataView.byteLength;
- var offset = 2;
-
- while (offset < length) {
- if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
- app1Start = offset;
- break;
- }
+ if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
+ var length = dataView.byteLength;
+ var offset = 2;
- offset += 1;
- }
- }
+ while (offset + 1 < length) {
+ if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
+ app1Start = offset;
+ break;
+ }
- if (app1Start) {
- var exifIDCode = app1Start + 4;
- var tiffOffset = app1Start + 10;
+ offset += 1;
+ }
+ }
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
- var endianness = dataView.getUint16(tiffOffset);
+ if (app1Start) {
+ var exifIDCode = app1Start + 4;
+ var tiffOffset = app1Start + 10;
- littleEndian = endianness === 0x4949;
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
+ var endianness = dataView.getUint16(tiffOffset);
+ littleEndian = endianness === 0x4949;
- if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
- var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
+ if (littleEndian || endianness === 0x4D4D
+ /* bigEndian */
+ ) {
+ if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
+ var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
- if (firstIFDOffset >= 0x00000008) {
- ifdStart = tiffOffset + firstIFDOffset;
+ if (firstIFDOffset >= 0x00000008) {
+ ifdStart = tiffOffset + firstIFDOffset;
+ }
+ }
}
- }
}
- }
- }
-
- if (ifdStart) {
- var _length = dataView.getUint16(ifdStart, littleEndian);
- var _offset = void 0;
- var i = void 0;
+ }
- for (i = 0; i < _length; i += 1) {
- _offset = ifdStart + i * 12 + 2;
+ if (ifdStart) {
+ var _length = dataView.getUint16(ifdStart, littleEndian);
- if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {
- // 8 is the offset of the current tag's value
- _offset += 8;
+ var _offset;
- // Get the original orientation value
- orientation = dataView.getUint16(_offset, littleEndian);
+ var i;
- // Override the orientation with its default value
- dataView.setUint16(_offset, 1, littleEndian);
- break;
- }
- }
- }
+ for (i = 0; i < _length; i += 1) {
+ _offset = ifdStart + i * 12 + 2;
- return orientation;
-}
-
-/**
- * Parse Exif Orientation value.
- * @param {number} orientation - The orientation to parse.
- * @returns {Object} The parsed result.
- */
-function parseOrientation(orientation) {
- var rotate = 0;
- var scaleX = 1;
- var scaleY = 1;
-
- switch (orientation) {
- // Flip horizontal
- case 2:
- scaleX = -1;
- break;
-
- // Rotate left 180°
- case 3:
- rotate = -180;
- break;
-
- // Flip vertical
- case 4:
- scaleY = -1;
- break;
-
- // Flip vertical and rotate right 90°
- case 5:
- rotate = 90;
- scaleY = -1;
- break;
-
- // Rotate right 90°
- case 6:
- rotate = 90;
- break;
-
- // Flip horizontal and rotate right 90°
- case 7:
- rotate = 90;
- scaleX = -1;
- break;
-
- // Rotate left 90°
- case 8:
- rotate = -90;
- break;
-
- default:
- }
-
- return {
- rotate: rotate,
- scaleX: scaleX,
- scaleY: scaleY
- };
-}
+ if (dataView.getUint16(_offset, littleEndian) === 0x0112
+ /* Orientation */
+ ) {
+ // 8 is the offset of the current tag's value
+ _offset += 8; // Get the original orientation value
-var render = {
- render: function render() {
- this.initContainer();
- this.initCanvas();
- this.initCropBox();
- this.renderCanvas();
+ orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
- if (this.cropped) {
- this.renderCropBox();
+ dataView.setUint16(_offset, 1, littleEndian);
+ break;
+ }
+ }
+ }
+ } catch (error) {
+ orientation = 1;
}
- },
- initContainer: function initContainer() {
- var element = this.element,
- options = this.options,
- container = this.container,
- cropper = this.cropper;
+ return orientation;
+ }
+ /**
+ * Parse Exif Orientation value.
+ * @param {number} orientation - The orientation to parse.
+ * @returns {Object} The parsed result.
+ */
- addClass(cropper, CLASS_HIDDEN);
- removeClass(element, CLASS_HIDDEN);
+ function parseOrientation(orientation) {
+ var rotate = 0;
+ var scaleX = 1;
+ var scaleY = 1;
- var containerData = {
- width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
- height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
- };
+ switch (orientation) {
+ // Flip horizontal
+ case 2:
+ scaleX = -1;
+ break;
+ // Rotate left 180°
- this.containerData = containerData;
+ case 3:
+ rotate = -180;
+ break;
+ // Flip vertical
- setStyle(cropper, {
- width: containerData.width,
- height: containerData.height
- });
+ case 4:
+ scaleY = -1;
+ break;
+ // Flip vertical and rotate right 90°
- addClass(element, CLASS_HIDDEN);
- removeClass(cropper, CLASS_HIDDEN);
- },
+ case 5:
+ rotate = 90;
+ scaleY = -1;
+ break;
+ // Rotate right 90°
+ case 6:
+ rotate = 90;
+ break;
+ // Flip horizontal and rotate right 90°
- // Canvas (image wrapper)
- initCanvas: function initCanvas() {
- var containerData = this.containerData,
- imageData = this.imageData;
- var viewMode = this.options.viewMode;
+ case 7:
+ rotate = 90;
+ scaleX = -1;
+ break;
+ // Rotate left 90°
- var rotated = Math.abs(imageData.rotate) % 180 === 90;
- var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
- var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
- var aspectRatio = naturalWidth / naturalHeight;
- var canvasWidth = containerData.width;
- var canvasHeight = containerData.height;
+ case 8:
+ rotate = -90;
+ break;
- if (containerData.height * aspectRatio > containerData.width) {
- if (viewMode === 3) {
- canvasWidth = containerData.height * aspectRatio;
- } else {
- canvasHeight = containerData.width / aspectRatio;
- }
- } else if (viewMode === 3) {
- canvasHeight = containerData.width / aspectRatio;
- } else {
- canvasWidth = containerData.height * aspectRatio;
+ default:
}
- var canvasData = {
- aspectRatio: aspectRatio,
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- width: canvasWidth,
- height: canvasHeight
+ return {
+ rotate: rotate,
+ scaleX: scaleX,
+ scaleY: scaleY
};
+ }
- canvasData.left = (containerData.width - canvasWidth) / 2;
- canvasData.top = (containerData.height - canvasHeight) / 2;
- canvasData.oldLeft = canvasData.left;
- canvasData.oldTop = canvasData.top;
-
- this.canvasData = canvasData;
- this.limited = viewMode === 1 || viewMode === 2;
- this.limitCanvas(true, true);
- this.initialImageData = extend({}, imageData);
- this.initialCanvasData = extend({}, canvasData);
- },
- limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
- var options = this.options,
- containerData = this.containerData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
- var viewMode = options.viewMode;
- var aspectRatio = canvasData.aspectRatio;
-
- var cropped = this.cropped && cropBoxData;
-
- if (sizeLimited) {
- var minCanvasWidth = Number(options.minCanvasWidth) || 0;
- var minCanvasHeight = Number(options.minCanvasHeight) || 0;
-
- if (viewMode > 1) {
- minCanvasWidth = Math.max(minCanvasWidth, containerData.width);
- minCanvasHeight = Math.max(minCanvasHeight, containerData.height);
+ var render = {
+ render: function render() {
+ this.initContainer();
+ this.initCanvas();
+ this.initCropBox();
+ this.renderCanvas();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
+ },
+ initContainer: function initContainer() {
+ var element = this.element,
+ options = this.options,
+ container = this.container,
+ cropper = this.cropper;
+ addClass(cropper, CLASS_HIDDEN);
+ removeClass(element, CLASS_HIDDEN);
+ var containerData = {
+ width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
+ height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
+ };
+ this.containerData = containerData;
+ setStyle(cropper, {
+ width: containerData.width,
+ height: containerData.height
+ });
+ addClass(element, CLASS_HIDDEN);
+ removeClass(cropper, CLASS_HIDDEN);
+ },
+ // Canvas (image wrapper)
+ initCanvas: function initCanvas() {
+ var containerData = this.containerData,
+ imageData = this.imageData;
+ var viewMode = this.options.viewMode;
+ var rotated = Math.abs(imageData.rotate) % 180 === 90;
+ var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
+ var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
+ var aspectRatio = naturalWidth / naturalHeight;
+ var canvasWidth = containerData.width;
+ var canvasHeight = containerData.height;
+
+ if (containerData.height * aspectRatio > containerData.width) {
if (viewMode === 3) {
- if (minCanvasHeight * aspectRatio > minCanvasWidth) {
- minCanvasWidth = minCanvasHeight * aspectRatio;
- } else {
- minCanvasHeight = minCanvasWidth / aspectRatio;
- }
- }
- } else if (viewMode > 0) {
- if (minCanvasWidth) {
- minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);
- } else if (minCanvasHeight) {
- minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);
- } else if (cropped) {
- minCanvasWidth = cropBoxData.width;
- minCanvasHeight = cropBoxData.height;
-
- if (minCanvasHeight * aspectRatio > minCanvasWidth) {
- minCanvasWidth = minCanvasHeight * aspectRatio;
- } else {
- minCanvasHeight = minCanvasWidth / aspectRatio;
- }
+ canvasWidth = containerData.height * aspectRatio;
+ } else {
+ canvasHeight = containerData.width / aspectRatio;
}
+ } else if (viewMode === 3) {
+ canvasHeight = containerData.width / aspectRatio;
+ } else {
+ canvasWidth = containerData.height * aspectRatio;
}
- var _getContainSizes = getContainSizes({
+ var canvasData = {
aspectRatio: aspectRatio,
- width: minCanvasWidth,
- height: minCanvasHeight
- });
-
- minCanvasWidth = _getContainSizes.width;
- minCanvasHeight = _getContainSizes.height;
-
-
- canvasData.minWidth = minCanvasWidth;
- canvasData.minHeight = minCanvasHeight;
- canvasData.maxWidth = Infinity;
- canvasData.maxHeight = Infinity;
- }
-
- if (positionLimited) {
- if (viewMode) {
- var newCanvasLeft = containerData.width - canvasData.width;
- var newCanvasTop = containerData.height - canvasData.height;
-
- canvasData.minLeft = Math.min(0, newCanvasLeft);
- canvasData.minTop = Math.min(0, newCanvasTop);
- canvasData.maxLeft = Math.max(0, newCanvasLeft);
- canvasData.maxTop = Math.max(0, newCanvasTop);
-
- if (cropped && this.limited) {
- canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));
- canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));
- canvasData.maxLeft = cropBoxData.left;
- canvasData.maxTop = cropBoxData.top;
-
- if (viewMode === 2) {
- if (canvasData.width >= containerData.width) {
- canvasData.minLeft = Math.min(0, newCanvasLeft);
- canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ naturalWidth: naturalWidth,
+ naturalHeight: naturalHeight,
+ width: canvasWidth,
+ height: canvasHeight
+ };
+ canvasData.left = (containerData.width - canvasWidth) / 2;
+ canvasData.top = (containerData.height - canvasHeight) / 2;
+ canvasData.oldLeft = canvasData.left;
+ canvasData.oldTop = canvasData.top;
+ this.canvasData = canvasData;
+ this.limited = viewMode === 1 || viewMode === 2;
+ this.limitCanvas(true, true);
+ this.initialImageData = assign({}, imageData);
+ this.initialCanvasData = assign({}, canvasData);
+ },
+ limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
+ var options = this.options,
+ containerData = this.containerData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var viewMode = options.viewMode;
+ var aspectRatio = canvasData.aspectRatio;
+ var cropped = this.cropped && cropBoxData;
+
+ if (sizeLimited) {
+ var minCanvasWidth = Number(options.minCanvasWidth) || 0;
+ var minCanvasHeight = Number(options.minCanvasHeight) || 0;
+
+ if (viewMode > 1) {
+ minCanvasWidth = Math.max(minCanvasWidth, containerData.width);
+ minCanvasHeight = Math.max(minCanvasHeight, containerData.height);
+
+ if (viewMode === 3) {
+ if (minCanvasHeight * aspectRatio > minCanvasWidth) {
+ minCanvasWidth = minCanvasHeight * aspectRatio;
+ } else {
+ minCanvasHeight = minCanvasWidth / aspectRatio;
+ }
+ }
+ } else if (viewMode > 0) {
+ if (minCanvasWidth) {
+ minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);
+ } else if (minCanvasHeight) {
+ minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);
+ } else if (cropped) {
+ minCanvasWidth = cropBoxData.width;
+ minCanvasHeight = cropBoxData.height;
+
+ if (minCanvasHeight * aspectRatio > minCanvasWidth) {
+ minCanvasWidth = minCanvasHeight * aspectRatio;
+ } else {
+ minCanvasHeight = minCanvasWidth / aspectRatio;
}
+ }
+ }
+
+ var _getAdjustedSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: minCanvasWidth,
+ height: minCanvasHeight
+ });
- if (canvasData.height >= containerData.height) {
- canvasData.minTop = Math.min(0, newCanvasTop);
- canvasData.maxTop = Math.max(0, newCanvasTop);
+ minCanvasWidth = _getAdjustedSizes.width;
+ minCanvasHeight = _getAdjustedSizes.height;
+ canvasData.minWidth = minCanvasWidth;
+ canvasData.minHeight = minCanvasHeight;
+ canvasData.maxWidth = Infinity;
+ canvasData.maxHeight = Infinity;
+ }
+
+ if (positionLimited) {
+ if (viewMode > (cropped ? 0 : 1)) {
+ var newCanvasLeft = containerData.width - canvasData.width;
+ var newCanvasTop = containerData.height - canvasData.height;
+ canvasData.minLeft = Math.min(0, newCanvasLeft);
+ canvasData.minTop = Math.min(0, newCanvasTop);
+ canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ canvasData.maxTop = Math.max(0, newCanvasTop);
+
+ if (cropped && this.limited) {
+ canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));
+ canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));
+ canvasData.maxLeft = cropBoxData.left;
+ canvasData.maxTop = cropBoxData.top;
+
+ if (viewMode === 2) {
+ if (canvasData.width >= containerData.width) {
+ canvasData.minLeft = Math.min(0, newCanvasLeft);
+ canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ }
+
+ if (canvasData.height >= containerData.height) {
+ canvasData.minTop = Math.min(0, newCanvasTop);
+ canvasData.maxTop = Math.max(0, newCanvasTop);
+ }
}
}
+ } else {
+ canvasData.minLeft = -canvasData.width;
+ canvasData.minTop = -canvasData.height;
+ canvasData.maxLeft = containerData.width;
+ canvasData.maxTop = containerData.height;
}
- } else {
- canvasData.minLeft = -canvasData.width;
- canvasData.minTop = -canvasData.height;
- canvasData.maxLeft = containerData.width;
- canvasData.maxTop = containerData.height;
}
- }
- },
- renderCanvas: function renderCanvas(changed, transformed) {
- var canvasData = this.canvasData,
- imageData = this.imageData;
-
+ },
+ renderCanvas: function renderCanvas(changed, transformed) {
+ var canvasData = this.canvasData,
+ imageData = this.imageData;
- if (transformed) {
- var _getRotatedSizes = getRotatedSizes({
- width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
- height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
- degree: imageData.rotate || 0
- }),
- naturalWidth = _getRotatedSizes.width,
- naturalHeight = _getRotatedSizes.height;
-
- var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
- var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
-
- canvasData.left -= (width - canvasData.width) / 2;
- canvasData.top -= (height - canvasData.height) / 2;
- canvasData.width = width;
- canvasData.height = height;
- canvasData.aspectRatio = naturalWidth / naturalHeight;
- canvasData.naturalWidth = naturalWidth;
- canvasData.naturalHeight = naturalHeight;
- this.limitCanvas(true, false);
- }
+ if (transformed) {
+ var _getRotatedSizes = getRotatedSizes({
+ width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
+ height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
+ degree: imageData.rotate || 0
+ }),
+ naturalWidth = _getRotatedSizes.width,
+ naturalHeight = _getRotatedSizes.height;
+
+ var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
+ var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
+ canvasData.left -= (width - canvasData.width) / 2;
+ canvasData.top -= (height - canvasData.height) / 2;
+ canvasData.width = width;
+ canvasData.height = height;
+ canvasData.aspectRatio = naturalWidth / naturalHeight;
+ canvasData.naturalWidth = naturalWidth;
+ canvasData.naturalHeight = naturalHeight;
+ this.limitCanvas(true, false);
+ }
+
+ if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {
+ canvasData.left = canvasData.oldLeft;
+ }
+
+ if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {
+ canvasData.top = canvasData.oldTop;
+ }
+
+ canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
+ canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
+ this.limitCanvas(false, true);
+ canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
+ canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
+ canvasData.oldLeft = canvasData.left;
+ canvasData.oldTop = canvasData.top;
+ setStyle(this.canvas, assign({
+ width: canvasData.width,
+ height: canvasData.height
+ }, getTransforms({
+ translateX: canvasData.left,
+ translateY: canvasData.top
+ })));
+ this.renderImage(changed);
+
+ if (this.cropped && this.limited) {
+ this.limitCropBox(true, true);
+ }
+ },
+ renderImage: function renderImage(changed) {
+ var canvasData = this.canvasData,
+ imageData = this.imageData;
+ var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
+ var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
+ assign(imageData, {
+ width: width,
+ height: height,
+ left: (canvasData.width - width) / 2,
+ top: (canvasData.height - height) / 2
+ });
+ setStyle(this.image, assign({
+ width: imageData.width,
+ height: imageData.height
+ }, getTransforms(assign({
+ translateX: imageData.left,
+ translateY: imageData.top
+ }, imageData))));
- if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {
- canvasData.left = canvasData.oldLeft;
- }
+ if (changed) {
+ this.output();
+ }
+ },
+ initCropBox: function initCropBox() {
+ var options = this.options,
+ canvasData = this.canvasData;
+ var aspectRatio = options.aspectRatio || options.initialAspectRatio;
+ var autoCropArea = Number(options.autoCropArea) || 0.8;
+ var cropBoxData = {
+ width: canvasData.width,
+ height: canvasData.height
+ };
- if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {
- canvasData.top = canvasData.oldTop;
- }
+ if (aspectRatio) {
+ if (canvasData.height * aspectRatio > canvasData.width) {
+ cropBoxData.height = cropBoxData.width / aspectRatio;
+ } else {
+ cropBoxData.width = cropBoxData.height * aspectRatio;
+ }
+ }
- canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
- canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
+ this.cropBoxData = cropBoxData;
+ this.limitCropBox(true, true); // Initialize auto crop area
- this.limitCanvas(false, true);
+ cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height"
- canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
- canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
- canvasData.oldLeft = canvasData.left;
- canvasData.oldTop = canvasData.top;
+ cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
+ cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
+ cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
+ cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
+ cropBoxData.oldLeft = cropBoxData.left;
+ cropBoxData.oldTop = cropBoxData.top;
+ this.initialCropBoxData = assign({}, cropBoxData);
+ },
+ limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
+ var options = this.options,
+ containerData = this.containerData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData,
+ limited = this.limited;
+ var aspectRatio = options.aspectRatio;
- setStyle(this.canvas, extend({
- width: canvasData.width,
- height: canvasData.height
- }, getTransforms({
- translateX: canvasData.left,
- translateY: canvasData.top
- })));
+ if (sizeLimited) {
+ var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
+ var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
+ var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;
+ var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height
- this.renderImage(changed);
+ minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
+ minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
- if (this.cropped && this.limited) {
- this.limitCropBox(true, true);
- }
- },
- renderImage: function renderImage(changed) {
- var canvasData = this.canvasData,
- imageData = this.imageData;
+ if (aspectRatio) {
+ if (minCropBoxWidth && minCropBoxHeight) {
+ if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {
+ minCropBoxHeight = minCropBoxWidth / aspectRatio;
+ } else {
+ minCropBoxWidth = minCropBoxHeight * aspectRatio;
+ }
+ } else if (minCropBoxWidth) {
+ minCropBoxHeight = minCropBoxWidth / aspectRatio;
+ } else if (minCropBoxHeight) {
+ minCropBoxWidth = minCropBoxHeight * aspectRatio;
+ }
- var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
- var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
+ if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {
+ maxCropBoxHeight = maxCropBoxWidth / aspectRatio;
+ } else {
+ maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
+ }
+ } // The minWidth/Height must be less than maxWidth/Height
- extend(imageData, {
- width: width,
- height: height,
- left: (canvasData.width - width) / 2,
- top: (canvasData.height - height) / 2
- });
- setStyle(this.image, extend({
- width: imageData.width,
- height: imageData.height
- }, getTransforms(extend({
- translateX: imageData.left,
- translateY: imageData.top
- }, imageData))));
-
- if (changed) {
- this.output();
- }
- },
- initCropBox: function initCropBox() {
- var options = this.options,
- canvasData = this.canvasData;
- var aspectRatio = options.aspectRatio;
-
- var autoCropArea = Number(options.autoCropArea) || 0.8;
- var cropBoxData = {
- width: canvasData.width,
- height: canvasData.height
- };
- if (aspectRatio) {
- if (canvasData.height * aspectRatio > canvasData.width) {
- cropBoxData.height = cropBoxData.width / aspectRatio;
- } else {
- cropBoxData.width = cropBoxData.height * aspectRatio;
+ cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
+ cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
+ cropBoxData.maxWidth = maxCropBoxWidth;
+ cropBoxData.maxHeight = maxCropBoxHeight;
}
- }
- this.cropBoxData = cropBoxData;
- this.limitCropBox(true, true);
-
- // Initialize auto crop area
- cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
- // The width/height of auto crop area must large than "minWidth/Height"
- cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
- cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
- cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
- cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
- cropBoxData.oldLeft = cropBoxData.left;
- cropBoxData.oldTop = cropBoxData.top;
-
- this.initialCropBoxData = extend({}, cropBoxData);
- },
- limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
- var options = this.options,
- containerData = this.containerData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData,
- limited = this.limited;
- var aspectRatio = options.aspectRatio;
-
-
- if (sizeLimited) {
- var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
- var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
- var maxCropBoxWidth = Math.min(containerData.width, limited ? canvasData.width : containerData.width);
- var maxCropBoxHeight = Math.min(containerData.height, limited ? canvasData.height : containerData.height);
-
- // The min/maxCropBoxWidth/Height must be less than container's width/height
- minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
- minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
-
- if (aspectRatio) {
- if (minCropBoxWidth && minCropBoxHeight) {
- if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {
- minCropBoxHeight = minCropBoxWidth / aspectRatio;
- } else {
- minCropBoxWidth = minCropBoxHeight * aspectRatio;
- }
- } else if (minCropBoxWidth) {
- minCropBoxHeight = minCropBoxWidth / aspectRatio;
- } else if (minCropBoxHeight) {
- minCropBoxWidth = minCropBoxHeight * aspectRatio;
- }
-
- if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {
- maxCropBoxHeight = maxCropBoxWidth / aspectRatio;
+ if (positionLimited) {
+ if (limited) {
+ cropBoxData.minLeft = Math.max(0, canvasData.left);
+ cropBoxData.minTop = Math.max(0, canvasData.top);
+ cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;
+ cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;
} else {
- maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
+ cropBoxData.minLeft = 0;
+ cropBoxData.minTop = 0;
+ cropBoxData.maxLeft = containerData.width - cropBoxData.width;
+ cropBoxData.maxTop = containerData.height - cropBoxData.height;
}
}
+ },
+ renderCropBox: function renderCropBox() {
+ var options = this.options,
+ containerData = this.containerData,
+ cropBoxData = this.cropBoxData;
- // The minWidth/Height must be less than maxWidth/Height
- cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
- cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
- cropBoxData.maxWidth = maxCropBoxWidth;
- cropBoxData.maxHeight = maxCropBoxHeight;
- }
-
- if (positionLimited) {
- if (limited) {
- cropBoxData.minLeft = Math.max(0, canvasData.left);
- cropBoxData.minTop = Math.max(0, canvasData.top);
- cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;
- cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;
- } else {
- cropBoxData.minLeft = 0;
- cropBoxData.minTop = 0;
- cropBoxData.maxLeft = containerData.width - cropBoxData.width;
- cropBoxData.maxTop = containerData.height - cropBoxData.height;
+ if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
+ cropBoxData.left = cropBoxData.oldLeft;
}
- }
- },
- renderCropBox: function renderCropBox() {
- var options = this.options,
- containerData = this.containerData,
- cropBoxData = this.cropBoxData;
-
- if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
- cropBoxData.left = cropBoxData.oldLeft;
- }
-
- if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {
- cropBoxData.top = cropBoxData.oldTop;
- }
-
- cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
- this.limitCropBox(false, true);
-
- cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
- cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
- cropBoxData.oldLeft = cropBoxData.left;
- cropBoxData.oldTop = cropBoxData.top;
+ if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {
+ cropBoxData.top = cropBoxData.oldTop;
+ }
- if (options.movable && options.cropBoxMovable) {
- // Turn to move the canvas when the crop box is equal to the container
- setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
- }
+ cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
+ this.limitCropBox(false, true);
+ cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
+ cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
+ cropBoxData.oldLeft = cropBoxData.left;
+ cropBoxData.oldTop = cropBoxData.top;
- setStyle(this.cropBox, extend({
- width: cropBoxData.width,
- height: cropBoxData.height
- }, getTransforms({
- translateX: cropBoxData.left,
- translateY: cropBoxData.top
- })));
+ if (options.movable && options.cropBoxMovable) {
+ // Turn to move the canvas when the crop box is equal to the container
+ setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
+ }
- if (this.cropped && this.limited) {
- this.limitCanvas(true, true);
- }
+ setStyle(this.cropBox, assign({
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ }, getTransforms({
+ translateX: cropBoxData.left,
+ translateY: cropBoxData.top
+ })));
- if (!this.disabled) {
- this.output();
- }
- },
- output: function output() {
- this.preview();
+ if (this.cropped && this.limited) {
+ this.limitCanvas(true, true);
+ }
- if (this.complete) {
+ if (!this.disabled) {
+ this.output();
+ }
+ },
+ output: function output() {
+ this.preview();
dispatchEvent(this.element, EVENT_CROP, this.getData());
}
- }
-};
+ };
-var preview = {
- initPreview: function initPreview() {
- var crossOrigin = this.crossOrigin;
- var preview = this.options.preview;
+ var preview = {
+ initPreview: function initPreview() {
+ var element = this.element,
+ crossOrigin = this.crossOrigin;
+ var preview = this.options.preview;
+ var url = crossOrigin ? this.crossOriginUrl : this.url;
+ var alt = element.alt || 'The image to preview';
+ var image = document.createElement('img');
- var url = crossOrigin ? this.crossOriginUrl : this.url;
- var image = document.createElement('img');
+ if (crossOrigin) {
+ image.crossOrigin = crossOrigin;
+ }
- if (crossOrigin) {
- image.crossOrigin = crossOrigin;
- }
+ image.src = url;
+ image.alt = alt;
+ this.viewBox.appendChild(image);
+ this.viewBoxImage = image;
- image.src = url;
- this.viewBox.appendChild(image);
- this.image2 = image;
+ if (!preview) {
+ return;
+ }
- if (!preview) {
- return;
- }
+ var previews = preview;
+
+ if (typeof preview === 'string') {
+ previews = element.ownerDocument.querySelectorAll(preview);
+ } else if (preview.querySelector) {
+ previews = [preview];
+ }
- var previews = preview.querySelector ? [preview] : document.querySelectorAll(preview);
+ this.previews = previews;
+ forEach(previews, function (el) {
+ var img = document.createElement('img'); // Save the original size for recover
- this.previews = previews;
+ setData(el, DATA_PREVIEW, {
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ html: el.innerHTML
+ });
- each(previews, function (element) {
- var img = document.createElement('img');
+ if (crossOrigin) {
+ img.crossOrigin = crossOrigin;
+ }
- // Save the original size for recover
- setData(element, DATA_PREVIEW, {
- width: element.offsetWidth,
- height: element.offsetHeight,
- html: element.innerHTML
+ img.src = url;
+ img.alt = alt;
+ /**
+ * Override img element styles
+ * Add `display:block` to avoid margin top issue
+ * Add `height:auto` to override `height` attribute on IE8
+ * (Occur only when margin-top <= -height)
+ */
+
+ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ el.innerHTML = '';
+ el.appendChild(img);
});
-
- if (crossOrigin) {
- img.crossOrigin = crossOrigin;
+ },
+ resetPreview: function resetPreview() {
+ forEach(this.previews, function (element) {
+ var data = getData(element, DATA_PREVIEW);
+ setStyle(element, {
+ width: data.width,
+ height: data.height
+ });
+ element.innerHTML = data.html;
+ removeData(element, DATA_PREVIEW);
+ });
+ },
+ preview: function preview() {
+ var imageData = this.imageData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var cropBoxWidth = cropBoxData.width,
+ cropBoxHeight = cropBoxData.height;
+ var width = imageData.width,
+ height = imageData.height;
+ var left = cropBoxData.left - canvasData.left - imageData.left;
+ var top = cropBoxData.top - canvasData.top - imageData.top;
+
+ if (!this.cropped || this.disabled) {
+ return;
}
- img.src = url;
+ setStyle(this.viewBoxImage, assign({
+ width: width,
+ height: height
+ }, getTransforms(assign({
+ translateX: -left,
+ translateY: -top
+ }, imageData))));
+ forEach(this.previews, function (element) {
+ var data = getData(element, DATA_PREVIEW);
+ var originalWidth = data.width;
+ var originalHeight = data.height;
+ var newWidth = originalWidth;
+ var newHeight = originalHeight;
+ var ratio = 1;
+
+ if (cropBoxWidth) {
+ ratio = originalWidth / cropBoxWidth;
+ newHeight = cropBoxHeight * ratio;
+ }
- /**
- * Override img element styles
- * Add `display:block` to avoid margin top issue
- * Add `height:auto` to override `height` attribute on IE8
- * (Occur only when margin-top <= -height)
- */
- img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ if (cropBoxHeight && newHeight > originalHeight) {
+ ratio = originalHeight / cropBoxHeight;
+ newWidth = cropBoxWidth * ratio;
+ newHeight = originalHeight;
+ }
- empty(element);
- element.appendChild(img);
- });
- },
- resetPreview: function resetPreview() {
- each(this.previews, function (element) {
- var data = getData(element, DATA_PREVIEW);
-
- setStyle(element, {
- width: data.width,
- height: data.height
+ setStyle(element, {
+ width: newWidth,
+ height: newHeight
+ });
+ setStyle(element.getElementsByTagName('img')[0], assign({
+ width: width * ratio,
+ height: height * ratio
+ }, getTransforms(assign({
+ translateX: -left * ratio,
+ translateY: -top * ratio
+ }, imageData))));
});
-
- element.innerHTML = data.html;
- removeData(element, DATA_PREVIEW);
- });
- },
- preview: function preview() {
- var imageData = this.imageData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
- var cropBoxWidth = cropBoxData.width,
- cropBoxHeight = cropBoxData.height;
- var width = imageData.width,
- height = imageData.height;
-
- var left = cropBoxData.left - canvasData.left - imageData.left;
- var top = cropBoxData.top - canvasData.top - imageData.top;
-
- if (!this.cropped || this.disabled) {
- return;
}
+ };
- setStyle(this.image2, extend({
- width: width,
- height: height
- }, getTransforms(extend({
- translateX: -left,
- translateY: -top
- }, imageData))));
-
- each(this.previews, function (element) {
- var data = getData(element, DATA_PREVIEW);
- var originalWidth = data.width;
- var originalHeight = data.height;
- var newWidth = originalWidth;
- var newHeight = originalHeight;
- var ratio = 1;
+ var events = {
+ bind: function bind() {
+ var element = this.element,
+ options = this.options,
+ cropper = this.cropper;
- if (cropBoxWidth) {
- ratio = originalWidth / cropBoxWidth;
- newHeight = cropBoxHeight * ratio;
+ if (isFunction(options.cropstart)) {
+ addListener(element, EVENT_CROP_START, options.cropstart);
}
- if (cropBoxHeight && newHeight > originalHeight) {
- ratio = originalHeight / cropBoxHeight;
- newWidth = cropBoxWidth * ratio;
- newHeight = originalHeight;
+ if (isFunction(options.cropmove)) {
+ addListener(element, EVENT_CROP_MOVE, options.cropmove);
}
- setStyle(element, {
- width: newWidth,
- height: newHeight
- });
-
- setStyle(element.getElementsByTagName('img')[0], extend({
- width: width * ratio,
- height: height * ratio
- }, getTransforms(extend({
- translateX: -left * ratio,
- translateY: -top * ratio
- }, imageData))));
- });
- }
-};
-
-var events = {
- bind: function bind() {
- var element = this.element,
- options = this.options,
- cropper = this.cropper;
+ if (isFunction(options.cropend)) {
+ addListener(element, EVENT_CROP_END, options.cropend);
+ }
+ if (isFunction(options.crop)) {
+ addListener(element, EVENT_CROP, options.crop);
+ }
- if (isFunction(options.cropstart)) {
- addListener(element, EVENT_CROP_START, options.cropstart);
- }
+ if (isFunction(options.zoom)) {
+ addListener(element, EVENT_ZOOM, options.zoom);
+ }
- if (isFunction(options.cropmove)) {
- addListener(element, EVENT_CROP_MOVE, options.cropmove);
- }
+ addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
- if (isFunction(options.cropend)) {
- addListener(element, EVENT_CROP_END, options.cropend);
- }
+ if (options.zoomable && options.zoomOnWheel) {
+ addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
+ passive: false,
+ capture: true
+ });
+ }
- if (isFunction(options.crop)) {
- addListener(element, EVENT_CROP, options.crop);
- }
+ if (options.toggleDragModeOnDblclick) {
+ addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
+ }
- if (isFunction(options.zoom)) {
- addListener(element, EVENT_ZOOM, options.zoom);
- }
+ addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));
+ addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));
- addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = proxy(this.cropStart, this));
+ if (options.responsive) {
+ addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
+ }
+ },
+ unbind: function unbind() {
+ var element = this.element,
+ options = this.options,
+ cropper = this.cropper;
- if (options.zoomable && options.zoomOnWheel) {
- addListener(cropper, EVENT_WHEEL, this.onWheel = proxy(this.wheel, this));
- }
+ if (isFunction(options.cropstart)) {
+ removeListener(element, EVENT_CROP_START, options.cropstart);
+ }
- if (options.toggleDragModeOnDblclick) {
- addListener(cropper, EVENT_DBLCLICK, this.onDblclick = proxy(this.dblclick, this));
- }
+ if (isFunction(options.cropmove)) {
+ removeListener(element, EVENT_CROP_MOVE, options.cropmove);
+ }
- addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = proxy(this.cropMove, this));
- addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = proxy(this.cropEnd, this));
+ if (isFunction(options.cropend)) {
+ removeListener(element, EVENT_CROP_END, options.cropend);
+ }
- if (options.responsive) {
- addListener(window, EVENT_RESIZE, this.onResize = proxy(this.resize, this));
- }
- },
- unbind: function unbind() {
- var element = this.element,
- options = this.options,
- cropper = this.cropper;
+ if (isFunction(options.crop)) {
+ removeListener(element, EVENT_CROP, options.crop);
+ }
+ if (isFunction(options.zoom)) {
+ removeListener(element, EVENT_ZOOM, options.zoom);
+ }
- if (isFunction(options.cropstart)) {
- removeListener(element, EVENT_CROP_START, options.cropstart);
- }
+ removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
- if (isFunction(options.cropmove)) {
- removeListener(element, EVENT_CROP_MOVE, options.cropmove);
- }
+ if (options.zoomable && options.zoomOnWheel) {
+ removeListener(cropper, EVENT_WHEEL, this.onWheel, {
+ passive: false,
+ capture: true
+ });
+ }
- if (isFunction(options.cropend)) {
- removeListener(element, EVENT_CROP_END, options.cropend);
- }
+ if (options.toggleDragModeOnDblclick) {
+ removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
+ }
- if (isFunction(options.crop)) {
- removeListener(element, EVENT_CROP, options.crop);
- }
+ removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
+ removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);
- if (isFunction(options.zoom)) {
- removeListener(element, EVENT_ZOOM, options.zoom);
+ if (options.responsive) {
+ removeListener(window, EVENT_RESIZE, this.onResize);
+ }
}
+ };
- removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
-
- if (options.zoomable && options.zoomOnWheel) {
- removeListener(cropper, EVENT_WHEEL, this.onWheel);
- }
+ var handlers = {
+ resize: function resize() {
+ var options = this.options,
+ container = this.container,
+ containerData = this.containerData;
+ var minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
+ var minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
- if (options.toggleDragModeOnDblclick) {
- removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
- }
+ if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
+ return;
+ }
- removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
- removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);
+ var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
- if (options.responsive) {
- removeListener(window, EVENT_RESIZE, this.onResize);
- }
- }
-};
+ if (ratio !== 1 || container.offsetHeight !== containerData.height) {
+ var canvasData;
+ var cropBoxData;
-var handlers = {
- resize: function resize() {
- var options = this.options,
- container = this.container,
- containerData = this.containerData;
+ if (options.restore) {
+ canvasData = this.getCanvasData();
+ cropBoxData = this.getCropBoxData();
+ }
- var minContainerWidth = Number(options.minContainerWidth) || 200;
- var minContainerHeight = Number(options.minContainerHeight) || 100;
+ this.render();
- if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
- return;
- }
+ if (options.restore) {
+ this.setCanvasData(forEach(canvasData, function (n, i) {
+ canvasData[i] = n * ratio;
+ }));
+ this.setCropBoxData(forEach(cropBoxData, function (n, i) {
+ cropBoxData[i] = n * ratio;
+ }));
+ }
+ }
+ },
+ dblclick: function dblclick() {
+ if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {
+ return;
+ }
- var ratio = container.offsetWidth / containerData.width;
+ this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
+ },
+ wheel: function wheel(event) {
+ var _this = this;
- // Resize when width changed or height changed
- if (ratio !== 1 || container.offsetHeight !== containerData.height) {
- var canvasData = void 0;
- var cropBoxData = void 0;
+ var ratio = Number(this.options.wheelZoomRatio) || 0.1;
+ var delta = 1;
- if (options.restore) {
- canvasData = this.getCanvasData();
- cropBoxData = this.getCropBoxData();
+ if (this.disabled) {
+ return;
}
- this.render();
+ event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)
- if (options.restore) {
- this.setCanvasData(each(canvasData, function (n, i) {
- canvasData[i] = n * ratio;
- }));
- this.setCropBoxData(each(cropBoxData, function (n, i) {
- cropBoxData[i] = n * ratio;
- }));
+ if (this.wheeling) {
+ return;
}
- }
- },
- dblclick: function dblclick() {
- if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {
- return;
- }
-
- this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
- },
- wheel: function wheel(e) {
- var _this = this;
- var ratio = Number(this.options.wheelZoomRatio) || 0.1;
- var delta = 1;
+ this.wheeling = true;
+ setTimeout(function () {
+ _this.wheeling = false;
+ }, 50);
- if (this.disabled) {
- return;
- }
+ if (event.deltaY) {
+ delta = event.deltaY > 0 ? 1 : -1;
+ } else if (event.wheelDelta) {
+ delta = -event.wheelDelta / 120;
+ } else if (event.detail) {
+ delta = event.detail > 0 ? 1 : -1;
+ }
- e.preventDefault();
+ this.zoom(-delta * ratio, event);
+ },
+ cropStart: function cropStart(event) {
+ var buttons = event.buttons,
+ button = event.button;
- // Limit wheel speed to prevent zoom too fast (#21)
- if (this.wheeling) {
- return;
- }
+ if (this.disabled // Handle mouse event and pointer event and ignore touch event
+ || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)
+ isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu
+ || event.ctrlKey)) {
+ return;
+ }
- this.wheeling = true;
+ var options = this.options,
+ pointers = this.pointers;
+ var action;
- setTimeout(function () {
- _this.wheeling = false;
- }, 50);
+ if (event.changedTouches) {
+ // Handle touch event
+ forEach(event.changedTouches, function (touch) {
+ pointers[touch.identifier] = getPointer(touch);
+ });
+ } else {
+ // Handle mouse event and pointer event
+ pointers[event.pointerId || 0] = getPointer(event);
+ }
- if (e.deltaY) {
- delta = e.deltaY > 0 ? 1 : -1;
- } else if (e.wheelDelta) {
- delta = -e.wheelDelta / 120;
- } else if (e.detail) {
- delta = e.detail > 0 ? 1 : -1;
- }
+ if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
+ action = ACTION_ZOOM;
+ } else {
+ action = getData(event.target, DATA_ACTION);
+ }
- this.zoom(-delta * ratio, e);
- },
- cropStart: function cropStart(e) {
- if (this.disabled) {
- return;
- }
+ if (!REGEXP_ACTIONS.test(action)) {
+ return;
+ }
- var options = this.options,
- pointers = this.pointers;
+ if (dispatchEvent(this.element, EVENT_CROP_START, {
+ originalEvent: event,
+ action: action
+ }) === false) {
+ return;
+ } // This line is required for preventing page zooming in iOS browsers
- var action = void 0;
- if (e.changedTouches) {
- // Handle touch event
- each(e.changedTouches, function (touch) {
- pointers[touch.identifier] = getPointer(touch);
- });
- } else {
- // Handle mouse event and pointer event
- pointers[e.pointerId || 0] = getPointer(e);
- }
+ event.preventDefault();
+ this.action = action;
+ this.cropping = false;
- if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
- action = ACTION_ZOOM;
- } else {
- action = getData(e.target, DATA_ACTION);
- }
+ if (action === ACTION_CROP) {
+ this.cropping = true;
+ addClass(this.dragBox, CLASS_MODAL);
+ }
+ },
+ cropMove: function cropMove(event) {
+ var action = this.action;
- if (!REGEXP_ACTIONS.test(action)) {
- return;
- }
+ if (this.disabled || !action) {
+ return;
+ }
- if (dispatchEvent(this.element, EVENT_CROP_START, {
- originalEvent: e,
- action: action
- }) === false) {
- return;
- }
+ var pointers = this.pointers;
+ event.preventDefault();
- e.preventDefault();
+ if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
+ originalEvent: event,
+ action: action
+ }) === false) {
+ return;
+ }
- this.action = action;
- this.cropping = false;
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ // The first parameter should not be undefined (#432)
+ assign(pointers[touch.identifier] || {}, getPointer(touch, true));
+ });
+ } else {
+ assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
+ }
- if (action === ACTION_CROP) {
- this.cropping = true;
- addClass(this.dragBox, CLASS_MODAL);
- }
- },
- cropMove: function cropMove(e) {
- var action = this.action;
+ this.change(event);
+ },
+ cropEnd: function cropEnd(event) {
+ if (this.disabled) {
+ return;
+ }
+ var action = this.action,
+ pointers = this.pointers;
- if (this.disabled || !action) {
- return;
- }
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ delete pointers[touch.identifier];
+ });
+ } else {
+ delete pointers[event.pointerId || 0];
+ }
- var pointers = this.pointers;
+ if (!action) {
+ return;
+ }
+ event.preventDefault();
- e.preventDefault();
+ if (!Object.keys(pointers).length) {
+ this.action = '';
+ }
- if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
- originalEvent: e,
- action: action
- }) === false) {
- return;
- }
+ if (this.cropping) {
+ this.cropping = false;
+ toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);
+ }
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- extend(pointers[touch.identifier], getPointer(touch, true));
+ dispatchEvent(this.element, EVENT_CROP_END, {
+ originalEvent: event,
+ action: action
});
- } else {
- extend(pointers[e.pointerId || 0], getPointer(e, true));
}
+ };
- this.change(e);
- },
- cropEnd: function cropEnd(e) {
- if (this.disabled) {
- return;
- }
+ var change = {
+ change: function change(event) {
+ var options = this.options,
+ canvasData = this.canvasData,
+ containerData = this.containerData,
+ cropBoxData = this.cropBoxData,
+ pointers = this.pointers;
+ var action = this.action;
+ var aspectRatio = options.aspectRatio;
+ var left = cropBoxData.left,
+ top = cropBoxData.top,
+ width = cropBoxData.width,
+ height = cropBoxData.height;
+ var right = left + width;
+ var bottom = top + height;
+ var minLeft = 0;
+ var minTop = 0;
+ var maxWidth = containerData.width;
+ var maxHeight = containerData.height;
+ var renderable = true;
+ var offset; // Locking aspect ratio in "free mode" by holding shift key
+
+ if (!aspectRatio && event.shiftKey) {
+ aspectRatio = width && height ? width / height : 1;
+ }
+
+ if (this.limited) {
+ minLeft = cropBoxData.minLeft;
+ minTop = cropBoxData.minTop;
+ maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
+ maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
+ }
+
+ var pointer = pointers[Object.keys(pointers)[0]];
+ var range = {
+ x: pointer.endX - pointer.startX,
+ y: pointer.endY - pointer.startY
+ };
- var action = this.action,
- pointers = this.pointers;
+ var check = function check(side) {
+ switch (side) {
+ case ACTION_EAST:
+ if (right + range.x > maxWidth) {
+ range.x = maxWidth - right;
+ }
+ break;
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- delete pointers[touch.identifier];
- });
- } else {
- delete pointers[e.pointerId || 0];
- }
+ case ACTION_WEST:
+ if (left + range.x < minLeft) {
+ range.x = minLeft - left;
+ }
- if (!action) {
- return;
- }
+ break;
- e.preventDefault();
+ case ACTION_NORTH:
+ if (top + range.y < minTop) {
+ range.y = minTop - top;
+ }
- if (!Object.keys(pointers).length) {
- this.action = '';
- }
+ break;
- if (this.cropping) {
- this.cropping = false;
- toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);
- }
+ case ACTION_SOUTH:
+ if (bottom + range.y > maxHeight) {
+ range.y = maxHeight - bottom;
+ }
- dispatchEvent(this.element, EVENT_CROP_END, {
- originalEvent: e,
- action: action
- });
- }
-};
-
-var change = {
- change: function change(e) {
- var options = this.options,
- canvasData = this.canvasData,
- containerData = this.containerData,
- cropBoxData = this.cropBoxData,
- pointers = this.pointers;
- var action = this.action;
- var aspectRatio = options.aspectRatio;
- var left = cropBoxData.left,
- top = cropBoxData.top,
- width = cropBoxData.width,
- height = cropBoxData.height;
-
- var right = left + width;
- var bottom = top + height;
- var minLeft = 0;
- var minTop = 0;
- var maxWidth = containerData.width;
- var maxHeight = containerData.height;
- var renderable = true;
- var offset = void 0;
-
- // Locking aspect ratio in "free mode" by holding shift key
- if (!aspectRatio && e.shiftKey) {
- aspectRatio = width && height ? width / height : 1;
- }
+ break;
- if (this.limited) {
- minLeft = cropBoxData.minLeft;
- minTop = cropBoxData.minTop;
+ default:
+ }
+ };
- maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
- maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
- }
+ switch (action) {
+ // Move crop box
+ case ACTION_ALL:
+ left += range.x;
+ top += range.y;
+ break;
+ // Resize crop box
- var pointer = pointers[Object.keys(pointers)[0]];
- var range = {
- x: pointer.endX - pointer.startX,
- y: pointer.endY - pointer.startY
- };
- var check = function check(side) {
- switch (side) {
case ACTION_EAST:
- if (right + range.x > maxWidth) {
- range.x = maxWidth - right;
+ if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
+ renderable = false;
+ break;
}
- break;
+ check(ACTION_EAST);
+ width += range.x;
- case ACTION_WEST:
- if (left + range.x < minLeft) {
- range.x = minLeft - left;
+ if (width < 0) {
+ action = ACTION_WEST;
+ width = -width;
+ left -= width;
}
- break;
-
- case ACTION_NORTH:
- if (top + range.y < minTop) {
- range.y = minTop - top;
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
- case ACTION_SOUTH:
- if (bottom + range.y > maxHeight) {
- range.y = maxHeight - bottom;
+ case ACTION_NORTH:
+ if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {
+ renderable = false;
+ break;
}
- break;
-
- default:
- }
- };
-
- switch (action) {
- // Move crop box
- case ACTION_ALL:
- left += range.x;
- top += range.y;
- break;
-
- // Resize crop box
- case ACTION_EAST:
- if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
- renderable = false;
- break;
- }
-
- check(ACTION_EAST);
- width += range.x;
-
- if (aspectRatio) {
- height = width / aspectRatio;
- top -= range.x / aspectRatio / 2;
- }
-
- if (width < 0) {
- action = ACTION_WEST;
- width = 0;
- }
-
- break;
-
- case ACTION_NORTH:
- if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {
- renderable = false;
- break;
- }
-
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
-
- if (aspectRatio) {
- width = height * aspectRatio;
- left += range.y * aspectRatio / 2;
- }
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
- if (height < 0) {
- action = ACTION_SOUTH;
- height = 0;
- }
+ if (height < 0) {
+ action = ACTION_SOUTH;
+ height = -height;
+ top -= height;
+ }
- break;
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
+ }
- case ACTION_WEST:
- if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
- renderable = false;
break;
- }
- check(ACTION_WEST);
- width -= range.x;
- left += range.x;
+ case ACTION_WEST:
+ if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
+ renderable = false;
+ break;
+ }
- if (aspectRatio) {
- height = width / aspectRatio;
- top += range.x / aspectRatio / 2;
- }
+ check(ACTION_WEST);
+ width -= range.x;
+ left += range.x;
- if (width < 0) {
- action = ACTION_EAST;
- width = 0;
- }
+ if (width < 0) {
+ action = ACTION_EAST;
+ width = -width;
+ left -= width;
+ }
- break;
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
+ }
- case ACTION_SOUTH:
- if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {
- renderable = false;
break;
- }
- check(ACTION_SOUTH);
- height += range.y;
-
- if (aspectRatio) {
- width = height * aspectRatio;
- left -= range.y * aspectRatio / 2;
- }
+ case ACTION_SOUTH:
+ if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {
+ renderable = false;
+ break;
+ }
- if (height < 0) {
- action = ACTION_NORTH;
- height = 0;
- }
+ check(ACTION_SOUTH);
+ height += range.y;
- break;
+ if (height < 0) {
+ action = ACTION_NORTH;
+ height = -height;
+ top -= height;
+ }
- case ACTION_NORTH_EAST:
- if (aspectRatio) {
- if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {
- renderable = false;
- break;
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
- width = height * aspectRatio;
- } else {
- check(ACTION_NORTH);
- check(ACTION_EAST);
+ break;
- if (range.x >= 0) {
- if (right < maxWidth) {
- width += range.x;
- } else if (range.y <= 0 && top <= minTop) {
+ case ACTION_NORTH_EAST:
+ if (aspectRatio) {
+ if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {
renderable = false;
+ break;
}
+
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
+ width = height * aspectRatio;
} else {
- width += range.x;
- }
+ check(ACTION_NORTH);
+ check(ACTION_EAST);
+
+ if (range.x >= 0) {
+ if (right < maxWidth) {
+ width += range.x;
+ } else if (range.y <= 0 && top <= minTop) {
+ renderable = false;
+ }
+ } else {
+ width += range.x;
+ }
- if (range.y <= 0) {
- if (top > minTop) {
+ if (range.y <= 0) {
+ if (top > minTop) {
+ height -= range.y;
+ top += range.y;
+ }
+ } else {
height -= range.y;
top += range.y;
}
- } else {
- height -= range.y;
- top += range.y;
}
- }
- if (width < 0 && height < 0) {
- action = ACTION_SOUTH_WEST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_NORTH_WEST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_SOUTH_EAST;
- height = 0;
- }
-
- break;
-
- case ACTION_NORTH_WEST:
- if (aspectRatio) {
- if (range.y <= 0 && (top <= minTop || left <= minLeft)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_SOUTH_WEST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_NORTH_WEST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_SOUTH_EAST;
+ height = -height;
+ top -= height;
}
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
- width = height * aspectRatio;
- left += range.y * aspectRatio;
- } else {
- check(ACTION_NORTH);
- check(ACTION_WEST);
+ break;
- if (range.x <= 0) {
- if (left > minLeft) {
- width -= range.x;
- left += range.x;
- } else if (range.y <= 0 && top <= minTop) {
+ case ACTION_NORTH_WEST:
+ if (aspectRatio) {
+ if (range.y <= 0 && (top <= minTop || left <= minLeft)) {
renderable = false;
+ break;
}
+
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
+ width = height * aspectRatio;
+ left += cropBoxData.width - width;
} else {
- width -= range.x;
- left += range.x;
- }
+ check(ACTION_NORTH);
+ check(ACTION_WEST);
+
+ if (range.x <= 0) {
+ if (left > minLeft) {
+ width -= range.x;
+ left += range.x;
+ } else if (range.y <= 0 && top <= minTop) {
+ renderable = false;
+ }
+ } else {
+ width -= range.x;
+ left += range.x;
+ }
- if (range.y <= 0) {
- if (top > minTop) {
+ if (range.y <= 0) {
+ if (top > minTop) {
+ height -= range.y;
+ top += range.y;
+ }
+ } else {
height -= range.y;
top += range.y;
}
- } else {
- height -= range.y;
- top += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_SOUTH_EAST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_NORTH_EAST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_SOUTH_WEST;
- height = 0;
- }
-
- break;
- case ACTION_SOUTH_WEST:
- if (aspectRatio) {
- if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_SOUTH_EAST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_NORTH_EAST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_SOUTH_WEST;
+ height = -height;
+ top -= height;
}
- check(ACTION_WEST);
- width -= range.x;
- left += range.x;
- height = width / aspectRatio;
- } else {
- check(ACTION_SOUTH);
- check(ACTION_WEST);
+ break;
- if (range.x <= 0) {
- if (left > minLeft) {
- width -= range.x;
- left += range.x;
- } else if (range.y >= 0 && bottom >= maxHeight) {
+ case ACTION_SOUTH_WEST:
+ if (aspectRatio) {
+ if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
renderable = false;
+ break;
}
- } else {
+
+ check(ACTION_WEST);
width -= range.x;
left += range.x;
- }
+ height = width / aspectRatio;
+ } else {
+ check(ACTION_SOUTH);
+ check(ACTION_WEST);
+
+ if (range.x <= 0) {
+ if (left > minLeft) {
+ width -= range.x;
+ left += range.x;
+ } else if (range.y >= 0 && bottom >= maxHeight) {
+ renderable = false;
+ }
+ } else {
+ width -= range.x;
+ left += range.x;
+ }
- if (range.y >= 0) {
- if (bottom < maxHeight) {
+ if (range.y >= 0) {
+ if (bottom < maxHeight) {
+ height += range.y;
+ }
+ } else {
height += range.y;
}
- } else {
- height += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_NORTH_EAST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_SOUTH_EAST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_NORTH_WEST;
- height = 0;
- }
-
- break;
- case ACTION_SOUTH_EAST:
- if (aspectRatio) {
- if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_NORTH_EAST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_SOUTH_EAST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_NORTH_WEST;
+ height = -height;
+ top -= height;
}
- check(ACTION_EAST);
- width += range.x;
- height = width / aspectRatio;
- } else {
- check(ACTION_SOUTH);
- check(ACTION_EAST);
+ break;
- if (range.x >= 0) {
- if (right < maxWidth) {
- width += range.x;
- } else if (range.y >= 0 && bottom >= maxHeight) {
+ case ACTION_SOUTH_EAST:
+ if (aspectRatio) {
+ if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
renderable = false;
+ break;
}
- } else {
+
+ check(ACTION_EAST);
width += range.x;
- }
+ height = width / aspectRatio;
+ } else {
+ check(ACTION_SOUTH);
+ check(ACTION_EAST);
+
+ if (range.x >= 0) {
+ if (right < maxWidth) {
+ width += range.x;
+ } else if (range.y >= 0 && bottom >= maxHeight) {
+ renderable = false;
+ }
+ } else {
+ width += range.x;
+ }
- if (range.y >= 0) {
- if (bottom < maxHeight) {
+ if (range.y >= 0) {
+ if (bottom < maxHeight) {
+ height += range.y;
+ }
+ } else {
height += range.y;
}
- } else {
- height += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_NORTH_WEST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_SOUTH_WEST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_NORTH_EAST;
- height = 0;
- }
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_NORTH_WEST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_SOUTH_WEST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_NORTH_EAST;
+ height = -height;
+ top -= height;
+ }
- // Move canvas
- case ACTION_MOVE:
- this.move(range.x, range.y);
- renderable = false;
- break;
+ break;
+ // Move canvas
- // Zoom canvas
- case ACTION_ZOOM:
- this.zoom(getMaxZoomRatio(pointers), e);
- renderable = false;
- break;
+ case ACTION_MOVE:
+ this.move(range.x, range.y);
+ renderable = false;
+ break;
+ // Zoom canvas
- // Create crop box
- case ACTION_CROP:
- if (!range.x || !range.y) {
+ case ACTION_ZOOM:
+ this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
- }
+ // Create crop box
- offset = getOffset(this.cropper);
- left = pointer.startX - offset.left;
- top = pointer.startY - offset.top;
- width = cropBoxData.minWidth;
- height = cropBoxData.minHeight;
+ case ACTION_CROP:
+ if (!range.x || !range.y) {
+ renderable = false;
+ break;
+ }
- if (range.x > 0) {
- action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;
- } else if (range.x < 0) {
- left -= width;
- action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;
- }
+ offset = getOffset(this.cropper);
+ left = pointer.startX - offset.left;
+ top = pointer.startY - offset.top;
+ width = cropBoxData.minWidth;
+ height = cropBoxData.minHeight;
+
+ if (range.x > 0) {
+ action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;
+ } else if (range.x < 0) {
+ left -= width;
+ action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;
+ }
+
+ if (range.y < 0) {
+ top -= height;
+ } // Show the crop box if is hidden
- if (range.y < 0) {
- top -= height;
- }
- // Show the crop box if is hidden
- if (!this.cropped) {
- removeClass(this.cropBox, CLASS_HIDDEN);
- this.cropped = true;
+ if (!this.cropped) {
+ removeClass(this.cropBox, CLASS_HIDDEN);
+ this.cropped = true;
- if (this.limited) {
- this.limitCropBox(true, true);
+ if (this.limited) {
+ this.limitCropBox(true, true);
+ }
}
- }
- break;
+ break;
- default:
- }
+ default:
+ }
- if (renderable) {
- cropBoxData.width = width;
- cropBoxData.height = height;
- cropBoxData.left = left;
- cropBoxData.top = top;
- this.action = action;
- this.renderCropBox();
- }
+ if (renderable) {
+ cropBoxData.width = width;
+ cropBoxData.height = height;
+ cropBoxData.left = left;
+ cropBoxData.top = top;
+ this.action = action;
+ this.renderCropBox();
+ } // Override
- // Override
- each(pointers, function (p) {
- p.startX = p.endX;
- p.startY = p.endY;
- });
- }
-};
-var methods = {
- // Show the crop box manually
- crop: function crop() {
- if (this.ready && !this.disabled) {
- if (!this.cropped) {
+ forEach(pointers, function (p) {
+ p.startX = p.endX;
+ p.startY = p.endY;
+ });
+ }
+ };
+
+ var methods = {
+ // Show the crop box manually
+ crop: function crop() {
+ if (this.ready && !this.cropped && !this.disabled) {
this.cropped = true;
this.limitCropBox(true, true);
@@ -2528,1164 +2449,1101 @@ var methods = {
}
removeClass(this.cropBox, CLASS_HIDDEN);
+ this.setCropBoxData(this.initialCropBoxData);
}
- this.setCropBoxData(this.initialCropBoxData);
- }
-
- return this;
- },
+ return this;
+ },
+ // Reset the image and crop box to their initial states
+ reset: function reset() {
+ if (this.ready && !this.disabled) {
+ this.imageData = assign({}, this.initialImageData);
+ this.canvasData = assign({}, this.initialCanvasData);
+ this.cropBoxData = assign({}, this.initialCropBoxData);
+ this.renderCanvas();
-
- // Reset the image and crop box to their initial states
- reset: function reset() {
- if (this.ready && !this.disabled) {
- this.imageData = extend({}, this.initialImageData);
- this.canvasData = extend({}, this.initialCanvasData);
- this.cropBoxData = extend({}, this.initialCropBoxData);
- this.renderCanvas();
-
- if (this.cropped) {
- this.renderCropBox();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
}
- }
-
- return this;
- },
-
-
- // Clear the crop box
- clear: function clear() {
- if (this.cropped && !this.disabled) {
- extend(this.cropBoxData, {
- left: 0,
- top: 0,
- width: 0,
- height: 0
- });
-
- this.cropped = false;
- this.renderCropBox();
- this.limitCanvas(true, true);
- // Render canvas after crop box rendered
- this.renderCanvas();
- removeClass(this.dragBox, CLASS_MODAL);
- addClass(this.cropBox, CLASS_HIDDEN);
- }
-
- return this;
- },
-
-
- /**
- * Replace the image's src and rebuild the cropper
- * @param {string} url - The new URL.
- * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
- * @returns {Object} this
- */
- replace: function replace(url) {
- var onlyColorChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ return this;
+ },
+ // Clear the crop box
+ clear: function clear() {
+ if (this.cropped && !this.disabled) {
+ assign(this.cropBoxData, {
+ left: 0,
+ top: 0,
+ width: 0,
+ height: 0
+ });
+ this.cropped = false;
+ this.renderCropBox();
+ this.limitCanvas(true, true); // Render canvas after crop box rendered
- if (!this.disabled && url) {
- if (this.isImg) {
- this.element.src = url;
+ this.renderCanvas();
+ removeClass(this.dragBox, CLASS_MODAL);
+ addClass(this.cropBox, CLASS_HIDDEN);
}
- if (onlyColorChanged) {
- this.url = url;
- this.image.src = url;
+ return this;
+ },
- if (this.ready) {
- this.image2.src = url;
+ /**
+ * Replace the image's src and rebuild the cropper
+ * @param {string} url - The new URL.
+ * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
+ * @returns {Cropper} this
+ */
+ replace: function replace(url) {
+ var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- each(this.previews, function (element) {
- element.getElementsByTagName('img')[0].src = url;
- });
- }
- } else {
+ if (!this.disabled && url) {
if (this.isImg) {
- this.replaced = true;
+ this.element.src = url;
}
- // Clear previous data
- this.options.data = null;
- this.load(url);
- }
- }
-
- return this;
- },
-
-
- // Enable (unfreeze) the cropper
- enable: function enable() {
- if (this.ready) {
- this.disabled = false;
- removeClass(this.cropper, CLASS_DISABLED);
- }
-
- return this;
- },
-
-
- // Disable (freeze) the cropper
- disable: function disable() {
- if (this.ready) {
- this.disabled = true;
- addClass(this.cropper, CLASS_DISABLED);
- }
+ if (hasSameSize) {
+ this.url = url;
+ this.image.src = url;
- return this;
- },
-
-
- // Destroy the cropper and remove the instance from the image
- destroy: function destroy() {
- var element = this.element,
- image = this.image;
-
-
- if (this.loaded) {
- if (this.isImg && this.replaced) {
- element.src = this.originalUrl;
- }
-
- this.unbuild();
- removeClass(element, CLASS_HIDDEN);
- } else if (this.isImg) {
- removeListener(element, EVENT_LOAD, this.onStart);
- } else if (image) {
- image.parentNode.removeChild(image);
- }
-
- removeData(element, NAMESPACE);
-
- return this;
- },
-
-
- /**
- * Move the canvas with relative offsets
- * @param {number} offsetX - The relative offset distance on the x-axis.
- * @param {number} offsetY - The relative offset distance on the y-axis.
- * @returns {Object} this
- */
- move: function move(offsetX, offsetY) {
- var _canvasData = this.canvasData,
- left = _canvasData.left,
- top = _canvasData.top;
-
-
- return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
- },
-
-
- /**
- * Move the canvas to an absolute point
- * @param {number} x - The x-axis coordinate.
- * @param {number} [y=x] - The y-axis coordinate.
- * @returns {Object} this
- */
- moveTo: function moveTo(x) {
- var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
- var canvasData = this.canvasData;
-
- var changed = false;
-
- x = Number(x);
- y = Number(y);
+ if (this.ready) {
+ this.viewBoxImage.src = url;
+ forEach(this.previews, function (element) {
+ element.getElementsByTagName('img')[0].src = url;
+ });
+ }
+ } else {
+ if (this.isImg) {
+ this.replaced = true;
+ }
- if (this.ready && !this.disabled && this.options.movable) {
- if (isNumber(x)) {
- canvasData.left = x;
- changed = true;
+ this.options.data = null;
+ this.uncreate();
+ this.load(url);
+ }
}
- if (isNumber(y)) {
- canvasData.top = y;
- changed = true;
+ return this;
+ },
+ // Enable (unfreeze) the cropper
+ enable: function enable() {
+ if (this.ready && this.disabled) {
+ this.disabled = false;
+ removeClass(this.cropper, CLASS_DISABLED);
}
- if (changed) {
- this.renderCanvas(true);
+ return this;
+ },
+ // Disable (freeze) the cropper
+ disable: function disable() {
+ if (this.ready && !this.disabled) {
+ this.disabled = true;
+ addClass(this.cropper, CLASS_DISABLED);
}
- }
-
- return this;
- },
-
-
- /**
- * Zoom the canvas with a relative ratio
- * @param {number} ratio - The target ratio.
- * @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
- */
- zoom: function zoom(ratio, _originalEvent) {
- var canvasData = this.canvasData;
-
-
- ratio = Number(ratio);
- if (ratio < 0) {
- ratio = 1 / (1 - ratio);
- } else {
- ratio = 1 + ratio;
- }
-
- return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
- },
+ return this;
+ },
+ /**
+ * Destroy the cropper and remove the instance from the image
+ * @returns {Cropper} this
+ */
+ destroy: function destroy() {
+ var element = this.element;
- /**
- * Zoom the canvas to an absolute ratio
- * @param {number} ratio - The target ratio.
- * @param {Object} pivot - The zoom pivot point coordinate.
- * @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
- */
- zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
- var options = this.options,
- canvasData = this.canvasData;
- var width = canvasData.width,
- height = canvasData.height,
- naturalWidth = canvasData.naturalWidth,
- naturalHeight = canvasData.naturalHeight;
-
-
- ratio = Number(ratio);
-
- if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
- var newWidth = naturalWidth * ratio;
- var newHeight = naturalHeight * ratio;
-
- if (dispatchEvent(this.element, EVENT_ZOOM, {
- originalEvent: _originalEvent,
- oldRatio: width / naturalWidth,
- ratio: newWidth / naturalWidth
- }) === false) {
+ if (!element[NAMESPACE]) {
return this;
}
- if (_originalEvent) {
- var pointers = this.pointers;
-
- var offset = getOffset(this.cropper);
- var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
- pageX: _originalEvent.pageX,
- pageY: _originalEvent.pageY
- };
+ element[NAMESPACE] = undefined;
- // Zoom from the triggering point of the event
- canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
- canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
- } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
- canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);
- canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);
- } else {
- // Zoom from the center of the canvas
- canvasData.left -= (newWidth - width) / 2;
- canvasData.top -= (newHeight - height) / 2;
+ if (this.isImg && this.replaced) {
+ element.src = this.originalUrl;
}
- canvasData.width = newWidth;
- canvasData.height = newHeight;
- this.renderCanvas(true);
- }
-
- return this;
- },
-
-
- /**
- * Rotate the canvas with a relative degree
- * @param {number} degree - The rotate degree.
- * @returns {Object} this
- */
- rotate: function rotate(degree) {
- return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
- },
-
-
- /**
- * Rotate the canvas to an absolute degree
- * @param {number} degree - The rotate degree.
- * @returns {Object} this
- */
- rotateTo: function rotateTo(degree) {
- degree = Number(degree);
-
- if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {
- this.imageData.rotate = degree % 360;
- this.renderCanvas(true, true);
- }
-
- return this;
- },
+ this.uncreate();
+ return this;
+ },
+ /**
+ * Move the canvas with relative offsets
+ * @param {number} offsetX - The relative offset distance on the x-axis.
+ * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
+ * @returns {Cropper} this
+ */
+ move: function move(offsetX) {
+ var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;
+ var _this$canvasData = this.canvasData,
+ left = _this$canvasData.left,
+ top = _this$canvasData.top;
+ return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
+ },
- /**
- * Scale the image on the x-axis.
- * @param {number} scaleX - The scale ratio on the x-axis.
- * @returns {Object} this
- */
- scaleX: function scaleX(_scaleX) {
- var scaleY = this.imageData.scaleY;
+ /**
+ * Move the canvas to an absolute point
+ * @param {number} x - The x-axis coordinate.
+ * @param {number} [y=x] - The y-axis coordinate.
+ * @returns {Cropper} this
+ */
+ moveTo: function moveTo(x) {
+ var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
+ var canvasData = this.canvasData;
+ var changed = false;
+ x = Number(x);
+ y = Number(y);
+
+ if (this.ready && !this.disabled && this.options.movable) {
+ if (isNumber(x)) {
+ canvasData.left = x;
+ changed = true;
+ }
+ if (isNumber(y)) {
+ canvasData.top = y;
+ changed = true;
+ }
- return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
- },
+ if (changed) {
+ this.renderCanvas(true);
+ }
+ }
+ return this;
+ },
- /**
- * Scale the image on the y-axis.
- * @param {number} scaleY - The scale ratio on the y-axis.
- * @returns {Object} this
- */
- scaleY: function scaleY(_scaleY) {
- var scaleX = this.imageData.scaleX;
+ /**
+ * Zoom the canvas with a relative ratio
+ * @param {number} ratio - The target ratio.
+ * @param {Event} _originalEvent - The original event if any.
+ * @returns {Cropper} this
+ */
+ zoom: function zoom(ratio, _originalEvent) {
+ var canvasData = this.canvasData;
+ ratio = Number(ratio);
+ if (ratio < 0) {
+ ratio = 1 / (1 - ratio);
+ } else {
+ ratio = 1 + ratio;
+ }
- return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
- },
+ return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
+ },
+ /**
+ * Zoom the canvas to an absolute ratio
+ * @param {number} ratio - The target ratio.
+ * @param {Object} pivot - The zoom pivot point coordinate.
+ * @param {Event} _originalEvent - The original event if any.
+ * @returns {Cropper} this
+ */
+ zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
+ var options = this.options,
+ canvasData = this.canvasData;
+ var width = canvasData.width,
+ height = canvasData.height,
+ naturalWidth = canvasData.naturalWidth,
+ naturalHeight = canvasData.naturalHeight;
+ ratio = Number(ratio);
+
+ if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
+ var newWidth = naturalWidth * ratio;
+ var newHeight = naturalHeight * ratio;
+
+ if (dispatchEvent(this.element, EVENT_ZOOM, {
+ ratio: ratio,
+ oldRatio: width / naturalWidth,
+ originalEvent: _originalEvent
+ }) === false) {
+ return this;
+ }
- /**
- * Scale the image
- * @param {number} scaleX - The scale ratio on the x-axis.
- * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
- * @returns {Object} this
- */
- scale: function scale(scaleX) {
- var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
- var imageData = this.imageData;
+ if (_originalEvent) {
+ var pointers = this.pointers;
+ var offset = getOffset(this.cropper);
+ var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
+ pageX: _originalEvent.pageX,
+ pageY: _originalEvent.pageY
+ }; // Zoom from the triggering point of the event
+
+ canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
+ canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
+ } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
+ canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);
+ canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);
+ } else {
+ // Zoom from the center of the canvas
+ canvasData.left -= (newWidth - width) / 2;
+ canvasData.top -= (newHeight - height) / 2;
+ }
- var transformed = false;
+ canvasData.width = newWidth;
+ canvasData.height = newHeight;
+ this.renderCanvas(true);
+ }
- scaleX = Number(scaleX);
- scaleY = Number(scaleY);
+ return this;
+ },
- if (this.ready && !this.disabled && this.options.scalable) {
- if (isNumber(scaleX)) {
- imageData.scaleX = scaleX;
- transformed = true;
- }
+ /**
+ * Rotate the canvas with a relative degree
+ * @param {number} degree - The rotate degree.
+ * @returns {Cropper} this
+ */
+ rotate: function rotate(degree) {
+ return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
+ },
- if (isNumber(scaleY)) {
- imageData.scaleY = scaleY;
- transformed = true;
- }
+ /**
+ * Rotate the canvas to an absolute degree
+ * @param {number} degree - The rotate degree.
+ * @returns {Cropper} this
+ */
+ rotateTo: function rotateTo(degree) {
+ degree = Number(degree);
- if (transformed) {
+ if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {
+ this.imageData.rotate = degree % 360;
this.renderCanvas(true, true);
}
- }
-
- return this;
- },
-
-
- /**
- * Get the cropped area position and size data (base on the original image)
- * @param {boolean} [rounded=false] - Indicate if round the data values or not.
- * @returns {Object} The result cropped data.
- */
- getData: function getData$$1() {
- var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var options = this.options,
- imageData = this.imageData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
-
- var data = void 0;
-
- if (this.ready && this.cropped) {
- data = {
- x: cropBoxData.left - canvasData.left,
- y: cropBoxData.top - canvasData.top,
- width: cropBoxData.width,
- height: cropBoxData.height
- };
-
- var ratio = imageData.width / imageData.naturalWidth;
-
- each(data, function (n, i) {
- n /= ratio;
- data[i] = rounded ? Math.round(n) : n;
- });
- } else {
- data = {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- };
- }
- if (options.rotatable) {
- data.rotate = imageData.rotate || 0;
- }
-
- if (options.scalable) {
- data.scaleX = imageData.scaleX || 1;
- data.scaleY = imageData.scaleY || 1;
- }
-
- return data;
- },
-
-
- /**
- * Set the cropped area position and size with new data
- * @param {Object} data - The new data.
- * @returns {Object} this
- */
- setData: function setData$$1(data) {
- var options = this.options,
- imageData = this.imageData,
- canvasData = this.canvasData;
+ return this;
+ },
- var cropBoxData = {};
+ /**
+ * Scale the image on the x-axis.
+ * @param {number} scaleX - The scale ratio on the x-axis.
+ * @returns {Cropper} this
+ */
+ scaleX: function scaleX(_scaleX) {
+ var scaleY = this.imageData.scaleY;
+ return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
+ },
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ /**
+ * Scale the image on the y-axis.
+ * @param {number} scaleY - The scale ratio on the y-axis.
+ * @returns {Cropper} this
+ */
+ scaleY: function scaleY(_scaleY) {
+ var scaleX = this.imageData.scaleX;
+ return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
+ },
- if (this.ready && !this.disabled && isPlainObject(data)) {
+ /**
+ * Scale the image
+ * @param {number} scaleX - The scale ratio on the x-axis.
+ * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
+ * @returns {Cropper} this
+ */
+ scale: function scale(scaleX) {
+ var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
+ var imageData = this.imageData;
var transformed = false;
+ scaleX = Number(scaleX);
+ scaleY = Number(scaleY);
- if (options.rotatable) {
- if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {
- imageData.rotate = data.rotate;
+ if (this.ready && !this.disabled && this.options.scalable) {
+ if (isNumber(scaleX)) {
+ imageData.scaleX = scaleX;
transformed = true;
}
- }
- if (options.scalable) {
- if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {
- imageData.scaleX = data.scaleX;
+ if (isNumber(scaleY)) {
+ imageData.scaleY = scaleY;
transformed = true;
}
- if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {
- imageData.scaleY = data.scaleY;
- transformed = true;
+ if (transformed) {
+ this.renderCanvas(true, true);
}
}
- if (transformed) {
- this.renderCanvas(true, true);
- }
-
- var ratio = imageData.width / imageData.naturalWidth;
+ return this;
+ },
- if (isNumber(data.x)) {
- cropBoxData.left = data.x * ratio + canvasData.left;
- }
+ /**
+ * Get the cropped area position and size data (base on the original image)
+ * @param {boolean} [rounded=false] - Indicate if round the data values or not.
+ * @returns {Object} The result cropped data.
+ */
+ getData: function getData() {
+ var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+ var options = this.options,
+ imageData = this.imageData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var data;
+
+ if (this.ready && this.cropped) {
+ data = {
+ x: cropBoxData.left - canvasData.left,
+ y: cropBoxData.top - canvasData.top,
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ };
+ var ratio = imageData.width / imageData.naturalWidth;
+ forEach(data, function (n, i) {
+ data[i] = n / ratio;
+ });
- if (isNumber(data.y)) {
- cropBoxData.top = data.y * ratio + canvasData.top;
+ if (rounded) {
+ // In case rounding off leads to extra 1px in right or bottom border
+ // we should round the top-left corner and the dimension (#343).
+ var bottom = Math.round(data.y + data.height);
+ var right = Math.round(data.x + data.width);
+ data.x = Math.round(data.x);
+ data.y = Math.round(data.y);
+ data.width = right - data.x;
+ data.height = bottom - data.y;
+ }
+ } else {
+ data = {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0
+ };
}
- if (isNumber(data.width)) {
- cropBoxData.width = data.width * ratio;
+ if (options.rotatable) {
+ data.rotate = imageData.rotate || 0;
}
- if (isNumber(data.height)) {
- cropBoxData.height = data.height * ratio;
+ if (options.scalable) {
+ data.scaleX = imageData.scaleX || 1;
+ data.scaleY = imageData.scaleY || 1;
}
- this.setCropBoxData(cropBoxData);
- }
-
- return this;
- },
-
-
- /**
- * Get the container size data.
- * @returns {Object} The result container data.
- */
- getContainerData: function getContainerData() {
- return this.ready ? extend({}, this.containerData) : {};
- },
-
-
- /**
- * Get the image position and size data.
- * @returns {Object} The result image data.
- */
- getImageData: function getImageData() {
- return this.loaded ? extend({}, this.imageData) : {};
- },
+ return data;
+ },
+ /**
+ * Set the cropped area position and size with new data
+ * @param {Object} data - The new data.
+ * @returns {Cropper} this
+ */
+ setData: function setData(data) {
+ var options = this.options,
+ imageData = this.imageData,
+ canvasData = this.canvasData;
+ var cropBoxData = {};
- /**
- * Get the canvas position and size data.
- * @returns {Object} The result canvas data.
- */
- getCanvasData: function getCanvasData() {
- var canvasData = this.canvasData;
+ if (this.ready && !this.disabled && isPlainObject(data)) {
+ var transformed = false;
- var data = {};
+ if (options.rotatable) {
+ if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {
+ imageData.rotate = data.rotate;
+ transformed = true;
+ }
+ }
- if (this.ready) {
- each(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
- data[n] = canvasData[n];
- });
- }
+ if (options.scalable) {
+ if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {
+ imageData.scaleX = data.scaleX;
+ transformed = true;
+ }
- return data;
- },
+ if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {
+ imageData.scaleY = data.scaleY;
+ transformed = true;
+ }
+ }
+ if (transformed) {
+ this.renderCanvas(true, true);
+ }
- /**
- * Set the canvas position and size with new data.
- * @param {Object} data - The new canvas data.
- * @returns {Object} this
- */
- setCanvasData: function setCanvasData(data) {
- var canvasData = this.canvasData;
- var aspectRatio = canvasData.aspectRatio;
+ var ratio = imageData.width / imageData.naturalWidth;
+ if (isNumber(data.x)) {
+ cropBoxData.left = data.x * ratio + canvasData.left;
+ }
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ if (isNumber(data.y)) {
+ cropBoxData.top = data.y * ratio + canvasData.top;
+ }
- if (this.ready && !this.disabled && isPlainObject(data)) {
- if (isNumber(data.left)) {
- canvasData.left = data.left;
- }
+ if (isNumber(data.width)) {
+ cropBoxData.width = data.width * ratio;
+ }
- if (isNumber(data.top)) {
- canvasData.top = data.top;
- }
+ if (isNumber(data.height)) {
+ cropBoxData.height = data.height * ratio;
+ }
- if (isNumber(data.width)) {
- canvasData.width = data.width;
- canvasData.height = data.width / aspectRatio;
- } else if (isNumber(data.height)) {
- canvasData.height = data.height;
- canvasData.width = data.height * aspectRatio;
+ this.setCropBoxData(cropBoxData);
}
- this.renderCanvas(true);
- }
-
- return this;
- },
+ return this;
+ },
+ /**
+ * Get the container size data.
+ * @returns {Object} The result container data.
+ */
+ getContainerData: function getContainerData() {
+ return this.ready ? assign({}, this.containerData) : {};
+ },
- /**
- * Get the crop box position and size data.
- * @returns {Object} The result crop box data.
- */
- getCropBoxData: function getCropBoxData() {
- var cropBoxData = this.cropBoxData;
+ /**
+ * Get the image position and size data.
+ * @returns {Object} The result image data.
+ */
+ getImageData: function getImageData() {
+ return this.sized ? assign({}, this.imageData) : {};
+ },
- var data = void 0;
+ /**
+ * Get the canvas position and size data.
+ * @returns {Object} The result canvas data.
+ */
+ getCanvasData: function getCanvasData() {
+ var canvasData = this.canvasData;
+ var data = {};
- if (this.ready && this.cropped) {
- data = {
- left: cropBoxData.left,
- top: cropBoxData.top,
- width: cropBoxData.width,
- height: cropBoxData.height
- };
- }
+ if (this.ready) {
+ forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
+ data[n] = canvasData[n];
+ });
+ }
- return data || {};
- },
+ return data;
+ },
+ /**
+ * Set the canvas position and size with new data.
+ * @param {Object} data - The new canvas data.
+ * @returns {Cropper} this
+ */
+ setCanvasData: function setCanvasData(data) {
+ var canvasData = this.canvasData;
+ var aspectRatio = canvasData.aspectRatio;
- /**
- * Set the crop box position and size with new data.
- * @param {Object} data - The new crop box data.
- * @returns {Object} this
- */
- setCropBoxData: function setCropBoxData(data) {
- var cropBoxData = this.cropBoxData;
- var aspectRatio = this.options.aspectRatio;
+ if (this.ready && !this.disabled && isPlainObject(data)) {
+ if (isNumber(data.left)) {
+ canvasData.left = data.left;
+ }
- var widthChanged = void 0;
- var heightChanged = void 0;
+ if (isNumber(data.top)) {
+ canvasData.top = data.top;
+ }
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ if (isNumber(data.width)) {
+ canvasData.width = data.width;
+ canvasData.height = data.width / aspectRatio;
+ } else if (isNumber(data.height)) {
+ canvasData.height = data.height;
+ canvasData.width = data.height * aspectRatio;
+ }
- if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
- if (isNumber(data.left)) {
- cropBoxData.left = data.left;
+ this.renderCanvas(true);
}
- if (isNumber(data.top)) {
- cropBoxData.top = data.top;
- }
+ return this;
+ },
- if (isNumber(data.width) && data.width !== cropBoxData.width) {
- widthChanged = true;
- cropBoxData.width = data.width;
+ /**
+ * Get the crop box position and size data.
+ * @returns {Object} The result crop box data.
+ */
+ getCropBoxData: function getCropBoxData() {
+ var cropBoxData = this.cropBoxData;
+ var data;
+
+ if (this.ready && this.cropped) {
+ data = {
+ left: cropBoxData.left,
+ top: cropBoxData.top,
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ };
}
- if (isNumber(data.height) && data.height !== cropBoxData.height) {
- heightChanged = true;
- cropBoxData.height = data.height;
- }
+ return data || {};
+ },
- if (aspectRatio) {
- if (widthChanged) {
- cropBoxData.height = cropBoxData.width / aspectRatio;
- } else if (heightChanged) {
- cropBoxData.width = cropBoxData.height * aspectRatio;
+ /**
+ * Set the crop box position and size with new data.
+ * @param {Object} data - The new crop box data.
+ * @returns {Cropper} this
+ */
+ setCropBoxData: function setCropBoxData(data) {
+ var cropBoxData = this.cropBoxData;
+ var aspectRatio = this.options.aspectRatio;
+ var widthChanged;
+ var heightChanged;
+
+ if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
+ if (isNumber(data.left)) {
+ cropBoxData.left = data.left;
}
- }
-
- this.renderCropBox();
- }
- return this;
- },
-
-
- /**
- * Get a canvas drawn the cropped image.
- * @param {Object} [options={}] - The config options.
- * @returns {HTMLCanvasElement} - The result canvas.
- */
- getCroppedCanvas: function getCroppedCanvas() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- if (!this.ready || !window.HTMLCanvasElement) {
- return null;
- }
-
- var canvasData = this.canvasData;
-
- var source = getSourceCanvas(this.image, this.imageData, canvasData, options);
-
- // Returns the source canvas if it is not cropped.
- if (!this.cropped) {
- return source;
- }
-
- var _getData = this.getData(),
- x = _getData.x,
- y = _getData.y,
- initialWidth = _getData.width,
- initialHeight = _getData.height;
-
- var aspectRatio = initialWidth / initialHeight;
- var maxSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.maxWidth || Infinity,
- height: options.maxHeight || Infinity
- });
- var minSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.minWidth || 0,
- height: options.minHeight || 0
- });
-
- var _getContainSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.width || initialWidth,
- height: options.height || initialHeight
- }),
- width = _getContainSizes.width,
- height = _getContainSizes.height;
-
- width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
- height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
-
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
+ if (isNumber(data.top)) {
+ cropBoxData.top = data.top;
+ }
- canvas.width = normalizeDecimalNumber(width);
- canvas.height = normalizeDecimalNumber(height);
+ if (isNumber(data.width) && data.width !== cropBoxData.width) {
+ widthChanged = true;
+ cropBoxData.width = data.width;
+ }
- context.fillStyle = options.fillColor || 'transparent';
- context.fillRect(0, 0, width, height);
+ if (isNumber(data.height) && data.height !== cropBoxData.height) {
+ heightChanged = true;
+ cropBoxData.height = data.height;
+ }
- var _options$imageSmoothi = options.imageSmoothingEnabled,
- imageSmoothingEnabled = _options$imageSmoothi === undefined ? true : _options$imageSmoothi,
- imageSmoothingQuality = options.imageSmoothingQuality;
+ if (aspectRatio) {
+ if (widthChanged) {
+ cropBoxData.height = cropBoxData.width / aspectRatio;
+ } else if (heightChanged) {
+ cropBoxData.width = cropBoxData.height * aspectRatio;
+ }
+ }
+ this.renderCropBox();
+ }
- context.imageSmoothingEnabled = imageSmoothingEnabled;
+ return this;
+ },
- if (imageSmoothingQuality) {
- context.imageSmoothingQuality = imageSmoothingQuality;
- }
+ /**
+ * Get a canvas drawn the cropped image.
+ * @param {Object} [options={}] - The config options.
+ * @returns {HTMLCanvasElement} - The result canvas.
+ */
+ getCroppedCanvas: function getCroppedCanvas() {
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
- var sourceWidth = source.width;
- var sourceHeight = source.height;
-
- // Source canvas parameters
- var srcX = x;
- var srcY = y;
- var srcWidth = void 0;
- var srcHeight = void 0;
-
- // Destination canvas parameters
- var dstX = void 0;
- var dstY = void 0;
- var dstWidth = void 0;
- var dstHeight = void 0;
-
- if (srcX <= -initialWidth || srcX > sourceWidth) {
- srcX = 0;
- srcWidth = 0;
- dstX = 0;
- dstWidth = 0;
- } else if (srcX <= 0) {
- dstX = -srcX;
- srcX = 0;
- srcWidth = Math.min(sourceWidth, initialWidth + srcX);
- dstWidth = srcWidth;
- } else if (srcX <= sourceWidth) {
- dstX = 0;
- srcWidth = Math.min(initialWidth, sourceWidth - srcX);
- dstWidth = srcWidth;
- }
+ if (!this.ready || !window.HTMLCanvasElement) {
+ return null;
+ }
- if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {
- srcY = 0;
- srcHeight = 0;
- dstY = 0;
- dstHeight = 0;
- } else if (srcY <= 0) {
- dstY = -srcY;
- srcY = 0;
- srcHeight = Math.min(sourceHeight, initialHeight + srcY);
- dstHeight = srcHeight;
- } else if (srcY <= sourceHeight) {
- dstY = 0;
- srcHeight = Math.min(initialHeight, sourceHeight - srcY);
- dstHeight = srcHeight;
- }
+ var canvasData = this.canvasData;
+ var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.
- // All the numerical parameters should be integer for `drawImage`
- // https://github.com/fengyuanchen/cropper/issues/476
- var params = [srcX, srcY, srcWidth, srcHeight];
+ if (!this.cropped) {
+ return source;
+ }
- // Avoid "IndexSizeError"
- if (dstWidth > 0 && dstHeight > 0) {
- var scale = width / initialWidth;
+ var _this$getData = this.getData(),
+ initialX = _this$getData.x,
+ initialY = _this$getData.y,
+ initialWidth = _this$getData.width,
+ initialHeight = _this$getData.height;
- params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
- }
+ var ratio = source.width / Math.floor(canvasData.naturalWidth);
- context.drawImage.apply(context, [source].concat(toConsumableArray(params.map(function (param) {
- return Math.floor(normalizeDecimalNumber(param));
- }))));
-
- return canvas;
- },
+ if (ratio !== 1) {
+ initialX *= ratio;
+ initialY *= ratio;
+ initialWidth *= ratio;
+ initialHeight *= ratio;
+ }
+ var aspectRatio = initialWidth / initialHeight;
+ var maxSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.maxWidth || Infinity,
+ height: options.maxHeight || Infinity
+ });
+ var minSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.minWidth || 0,
+ height: options.minHeight || 0
+ }, 'cover');
- /**
- * Change the aspect ratio of the crop box.
- * @param {number} aspectRatio - The new aspect ratio.
- * @returns {Object} this
- */
- setAspectRatio: function setAspectRatio(aspectRatio) {
- var options = this.options;
+ var _getAdjustedSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.width || (ratio !== 1 ? source.width : initialWidth),
+ height: options.height || (ratio !== 1 ? source.height : initialHeight)
+ }),
+ width = _getAdjustedSizes.width,
+ height = _getAdjustedSizes.height;
+
+ width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
+ height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ canvas.width = normalizeDecimalNumber(width);
+ canvas.height = normalizeDecimalNumber(height);
+ context.fillStyle = options.fillColor || 'transparent';
+ context.fillRect(0, 0, width, height);
+ var _options$imageSmoothi = options.imageSmoothingEnabled,
+ imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,
+ imageSmoothingQuality = options.imageSmoothingQuality;
+ context.imageSmoothingEnabled = imageSmoothingEnabled;
+
+ if (imageSmoothingQuality) {
+ context.imageSmoothingQuality = imageSmoothingQuality;
+ } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
+
+
+ var sourceWidth = source.width;
+ var sourceHeight = source.height; // Source canvas parameters
+
+ var srcX = initialX;
+ var srcY = initialY;
+ var srcWidth;
+ var srcHeight; // Destination canvas parameters
+
+ var dstX;
+ var dstY;
+ var dstWidth;
+ var dstHeight;
+
+ if (srcX <= -initialWidth || srcX > sourceWidth) {
+ srcX = 0;
+ srcWidth = 0;
+ dstX = 0;
+ dstWidth = 0;
+ } else if (srcX <= 0) {
+ dstX = -srcX;
+ srcX = 0;
+ srcWidth = Math.min(sourceWidth, initialWidth + srcX);
+ dstWidth = srcWidth;
+ } else if (srcX <= sourceWidth) {
+ dstX = 0;
+ srcWidth = Math.min(initialWidth, sourceWidth - srcX);
+ dstWidth = srcWidth;
+ }
+
+ if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {
+ srcY = 0;
+ srcHeight = 0;
+ dstY = 0;
+ dstHeight = 0;
+ } else if (srcY <= 0) {
+ dstY = -srcY;
+ srcY = 0;
+ srcHeight = Math.min(sourceHeight, initialHeight + srcY);
+ dstHeight = srcHeight;
+ } else if (srcY <= sourceHeight) {
+ dstY = 0;
+ srcHeight = Math.min(initialHeight, sourceHeight - srcY);
+ dstHeight = srcHeight;
+ }
+
+ var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError"
+
+ if (dstWidth > 0 && dstHeight > 0) {
+ var scale = width / initialWidth;
+ params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
+ } // All the numerical parameters should be integer for `drawImage`
+ // https://github.com/fengyuanchen/cropper/issues/476
+
+
+ context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {
+ return Math.floor(normalizeDecimalNumber(param));
+ }))));
+ return canvas;
+ },
+ /**
+ * Change the aspect ratio of the crop box.
+ * @param {number} aspectRatio - The new aspect ratio.
+ * @returns {Cropper} this
+ */
+ setAspectRatio: function setAspectRatio(aspectRatio) {
+ var options = this.options;
- if (!this.disabled && !isUndefined(aspectRatio)) {
- // 0 -> NaN
- options.aspectRatio = Math.max(0, aspectRatio) || NaN;
+ if (!this.disabled && !isUndefined(aspectRatio)) {
+ // 0 -> NaN
+ options.aspectRatio = Math.max(0, aspectRatio) || NaN;
- if (this.ready) {
- this.initCropBox();
+ if (this.ready) {
+ this.initCropBox();
- if (this.cropped) {
- this.renderCropBox();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
}
}
- }
-
- return this;
- },
-
-
- /**
- * Change the drag mode.
- * @param {string} mode - The new drag mode.
- * @returns {Object} this
- */
- setDragMode: function setDragMode(mode) {
- var options = this.options,
- dragBox = this.dragBox,
- face = this.face;
-
- if (this.loaded && !this.disabled) {
- var croppable = mode === DRAG_MODE_CROP;
- var movable = options.movable && mode === DRAG_MODE_MOVE;
+ return this;
+ },
- mode = croppable || movable ? mode : DRAG_MODE_NONE;
-
- setData(dragBox, DATA_ACTION, mode);
- toggleClass(dragBox, CLASS_CROP, croppable);
- toggleClass(dragBox, CLASS_MOVE, movable);
-
- if (!options.cropBoxMovable) {
- // Sync drag mode to crop box when it is not movable
- setData(face, DATA_ACTION, mode);
- toggleClass(face, CLASS_CROP, croppable);
- toggleClass(face, CLASS_MOVE, movable);
+ /**
+ * Change the drag mode.
+ * @param {string} mode - The new drag mode.
+ * @returns {Cropper} this
+ */
+ setDragMode: function setDragMode(mode) {
+ var options = this.options,
+ dragBox = this.dragBox,
+ face = this.face;
+
+ if (this.ready && !this.disabled) {
+ var croppable = mode === DRAG_MODE_CROP;
+ var movable = options.movable && mode === DRAG_MODE_MOVE;
+ mode = croppable || movable ? mode : DRAG_MODE_NONE;
+ options.dragMode = mode;
+ setData(dragBox, DATA_ACTION, mode);
+ toggleClass(dragBox, CLASS_CROP, croppable);
+ toggleClass(dragBox, CLASS_MOVE, movable);
+
+ if (!options.cropBoxMovable) {
+ // Sync drag mode to crop box when it is not movable
+ setData(face, DATA_ACTION, mode);
+ toggleClass(face, CLASS_CROP, croppable);
+ toggleClass(face, CLASS_MOVE, movable);
+ }
}
- }
-
- return this;
- }
-};
-
-var AnotherCropper = WINDOW.Cropper;
-
-var Cropper = function () {
- /**
- * Create a new Cropper.
- * @param {Element} element - The target element for cropping.
- * @param {Object} [options={}] - The configuration options.
- */
- function Cropper(element) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- classCallCheck(this, Cropper);
- if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
- throw new Error('The first argument is required and must be an <img> or <canvas> element.');
+ return this;
}
+ };
- this.element = element;
- this.options = extend({}, DEFAULTS, isPlainObject(options) && options);
- this.complete = false;
- this.cropped = false;
- this.disabled = false;
- this.isImg = false;
- this.limited = false;
- this.loaded = false;
- this.ready = false;
- this.replaced = false;
- this.wheeling = false;
- this.originalUrl = '';
- this.canvasData = null;
- this.cropBoxData = null;
- this.previews = null;
- this.pointers = {};
- this.init();
- }
+ var AnotherCropper = WINDOW.Cropper;
- createClass(Cropper, [{
- key: 'init',
- value: function init() {
- var element = this.element;
+ var Cropper =
+ /*#__PURE__*/
+ function () {
+ /**
+ * Create a new Cropper.
+ * @param {Element} element - The target element for cropping.
+ * @param {Object} [options={}] - The configuration options.
+ */
+ function Cropper(element) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var tagName = element.tagName.toLowerCase();
- var url = void 0;
+ _classCallCheck(this, Cropper);
- if (getData(element, NAMESPACE)) {
- return;
+ if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
+ throw new Error('The first argument is required and must be an <img> or <canvas> element.');
}
- setData(element, NAMESPACE, this);
-
- if (tagName === 'img') {
- this.isImg = true;
+ this.element = element;
+ this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
+ this.cropped = false;
+ this.disabled = false;
+ this.pointers = {};
+ this.ready = false;
+ this.reloading = false;
+ this.replaced = false;
+ this.sized = false;
+ this.sizing = false;
+ this.init();
+ }
- // e.g.: "img/picture.jpg"
- url = element.getAttribute('src') || '';
- this.originalUrl = url;
+ _createClass(Cropper, [{
+ key: "init",
+ value: function init() {
+ var element = this.element;
+ var tagName = element.tagName.toLowerCase();
+ var url;
- // Stop when it's a blank image
- if (!url) {
+ if (element[NAMESPACE]) {
return;
}
- // e.g.: "http://example.com/img/picture.jpg"
- url = element.src;
- } else if (tagName === 'canvas' && window.HTMLCanvasElement) {
- url = element.toDataURL();
- }
+ element[NAMESPACE] = this;
- this.load(url);
- }
- }, {
- key: 'load',
- value: function load(url) {
- var _this = this;
+ if (tagName === 'img') {
+ this.isImg = true; // e.g.: "img/picture.jpg"
- if (!url) {
- return;
- }
+ url = element.getAttribute('src') || '';
+ this.originalUrl = url; // Stop when it's a blank image
- this.url = url;
- this.imageData = {};
+ if (!url) {
+ return;
+ } // e.g.: "http://example.com/img/picture.jpg"
- var element = this.element,
- options = this.options;
+ url = element.src;
+ } else if (tagName === 'canvas' && window.HTMLCanvasElement) {
+ url = element.toDataURL();
+ }
- if (!options.checkOrientation || !window.ArrayBuffer) {
- this.clone();
- return;
+ this.load(url);
}
+ }, {
+ key: "load",
+ value: function load(url) {
+ var _this = this;
- // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari
- if (REGEXP_DATA_URL.test(url)) {
- if (REGEXP_DATA_URL_JPEG.test(url)) {
- this.read(dataURLToArrayBuffer(url));
- } else {
- this.clone();
+ if (!url) {
+ return;
}
- return;
- }
+ this.url = url;
+ this.imageData = {};
+ var element = this.element,
+ options = this.options;
- var xhr = new XMLHttpRequest();
+ if (!options.rotatable && !options.scalable) {
+ options.checkOrientation = false;
+ } // Only IE10+ supports Typed Arrays
- xhr.onerror = function () {
- _this.clone();
- };
- xhr.onload = function () {
- _this.read(xhr.response);
- };
+ if (!options.checkOrientation || !window.ArrayBuffer) {
+ this.clone();
+ return;
+ } // Detect the mime type of the image directly if it is a Data URL
- if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
- url = addTimestamp(url);
- }
- xhr.open('get', url);
- xhr.responseType = 'arraybuffer';
- xhr.withCredentials = element.crossOrigin === 'use-credentials';
- xhr.send();
- }
- }, {
- key: 'read',
- value: function read(arrayBuffer) {
- var options = this.options,
- imageData = this.imageData;
+ if (REGEXP_DATA_URL.test(url)) {
+ // Read ArrayBuffer from Data URL of JPEG images directly for better performance
+ if (REGEXP_DATA_URL_JPEG.test(url)) {
+ this.read(dataURLToArrayBuffer(url));
+ } else {
+ // Only a JPEG image may contains Exif Orientation information,
+ // the rest types of Data URLs are not necessary to check orientation at all.
+ this.clone();
+ }
- var orientation = getOrientation(arrayBuffer);
- var rotate = 0;
- var scaleX = 1;
- var scaleY = 1;
+ return;
+ } // 1. Detect the mime type of the image by a XMLHttpRequest.
+ // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.
+
+
+ var xhr = new XMLHttpRequest();
+ var clone = this.clone.bind(this);
+ this.reloading = true;
+ this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:
+ // http, https, data, chrome, chrome-extension.
+ // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy
+ // in some browsers as IE11 and Safari.
+
+ xhr.onabort = clone;
+ xhr.onerror = clone;
+ xhr.ontimeout = clone;
+
+ xhr.onprogress = function () {
+ // Abort the request directly if it not a JPEG image for better performance
+ if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {
+ xhr.abort();
+ }
+ };
- if (orientation > 1) {
- this.url = arrayBufferToDataURL(arrayBuffer, 'image/jpeg');
+ xhr.onload = function () {
+ _this.read(xhr.response);
+ };
- var _parseOrientation = parseOrientation(orientation);
+ xhr.onloadend = function () {
+ _this.reloading = false;
+ _this.xhr = null;
+ }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error
- rotate = _parseOrientation.rotate;
- scaleX = _parseOrientation.scaleX;
- scaleY = _parseOrientation.scaleY;
- }
- if (options.rotatable) {
- imageData.rotate = rotate;
- }
+ if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
+ url = addTimestamp(url);
+ }
- if (options.scalable) {
- imageData.scaleX = scaleX;
- imageData.scaleY = scaleY;
+ xhr.open('GET', url);
+ xhr.responseType = 'arraybuffer';
+ xhr.withCredentials = element.crossOrigin === 'use-credentials';
+ xhr.send();
}
+ }, {
+ key: "read",
+ value: function read(arrayBuffer) {
+ var options = this.options,
+ imageData = this.imageData; // Reset the orientation value to its default value 1
+ // as some iOS browsers will render image with its orientation
- this.clone();
- }
- }, {
- key: 'clone',
- value: function clone() {
- var element = this.element,
- url = this.url;
+ var orientation = resetAndGetOrientation(arrayBuffer);
+ var rotate = 0;
+ var scaleX = 1;
+ var scaleY = 1;
- var crossOrigin = void 0;
- var crossOriginUrl = void 0;
+ if (orientation > 1) {
+ // Generate a new URL which has the default orientation value
+ this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
- if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
- crossOrigin = element.crossOrigin;
+ var _parseOrientation = parseOrientation(orientation);
-
- if (crossOrigin) {
- crossOriginUrl = url;
- } else {
- crossOrigin = 'anonymous';
-
- // Bust cache when there is not a "crossOrigin" property
- crossOriginUrl = addTimestamp(url);
+ rotate = _parseOrientation.rotate;
+ scaleX = _parseOrientation.scaleX;
+ scaleY = _parseOrientation.scaleY;
}
- }
- this.crossOrigin = crossOrigin;
- this.crossOriginUrl = crossOriginUrl;
+ if (options.rotatable) {
+ imageData.rotate = rotate;
+ }
- var image = document.createElement('img');
+ if (options.scalable) {
+ imageData.scaleX = scaleX;
+ imageData.scaleY = scaleY;
+ }
- if (crossOrigin) {
- image.crossOrigin = crossOrigin;
+ this.clone();
}
+ }, {
+ key: "clone",
+ value: function clone() {
+ var element = this.element,
+ url = this.url;
+ var crossOrigin = element.crossOrigin;
+ var crossOriginUrl = url;
- image.src = crossOriginUrl || url;
-
- var start = proxy(this.start, this);
- var stop = proxy(this.stop, this);
+ if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
+ if (!crossOrigin) {
+ crossOrigin = 'anonymous';
+ } // Bust cache when there is not a "crossOrigin" property (#519)
- this.image = image;
- this.onStart = start;
- this.onStop = stop;
- if (this.isImg) {
- if (element.complete) {
- this.start();
- } else {
- addListener(element, EVENT_LOAD, start);
+ crossOriginUrl = addTimestamp(url);
}
- } else {
- addListener(image, EVENT_LOAD, start);
- addListener(image, EVENT_ERROR, stop);
- addClass(image, CLASS_HIDE);
- element.parentNode.insertBefore(image, element.nextSibling);
- }
- }
- }, {
- key: 'start',
- value: function start(event) {
- var _this2 = this;
-
- var image = this.isImg ? this.element : this.image;
-
- if (event) {
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- }
-
- getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
- extend(_this2.imageData, {
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- aspectRatio: naturalWidth / naturalHeight
- });
- _this2.loaded = true;
- _this2.build();
- });
- }
- }, {
- key: 'stop',
- value: function stop() {
- var image = this.image;
+ this.crossOrigin = crossOrigin;
+ this.crossOriginUrl = crossOriginUrl;
+ var image = document.createElement('img');
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- image.parentNode.removeChild(image);
- this.image = null;
- }
- }, {
- key: 'build',
- value: function build() {
- var _this3 = this;
+ if (crossOrigin) {
+ image.crossOrigin = crossOrigin;
+ }
- if (!this.loaded) {
- return;
+ image.src = crossOriginUrl || url;
+ image.alt = element.alt || 'The image to crop';
+ this.image = image;
+ image.onload = this.start.bind(this);
+ image.onerror = this.stop.bind(this);
+ addClass(image, CLASS_HIDE);
+ element.parentNode.insertBefore(image, element.nextSibling);
}
+ }, {
+ key: "start",
+ value: function start() {
+ var _this2 = this;
- // Unbuild first when replace
- if (this.ready) {
- this.unbuild();
- }
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,
+ // such as Safari for iOS, Chrome for iOS, and in-app browsers.
- var element = this.element,
- options = this.options,
- image = this.image;
+ var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
- // Create cropper elements
+ var done = function done(naturalWidth, naturalHeight) {
+ assign(_this2.imageData, {
+ naturalWidth: naturalWidth,
+ naturalHeight: naturalHeight,
+ aspectRatio: naturalWidth / naturalHeight
+ });
+ _this2.sizing = false;
+ _this2.sized = true;
- var container = element.parentNode;
- var template = document.createElement('div');
+ _this2.build();
+ }; // Most modern browsers (excepts iOS WebKit)
- template.innerHTML = TEMPLATE;
- var cropper = template.querySelector('.' + NAMESPACE + '-container');
- var canvas = cropper.querySelector('.' + NAMESPACE + '-canvas');
- var dragBox = cropper.querySelector('.' + NAMESPACE + '-drag-box');
- var cropBox = cropper.querySelector('.' + NAMESPACE + '-crop-box');
- var face = cropBox.querySelector('.' + NAMESPACE + '-face');
+ if (image.naturalWidth && !isIOSWebKit) {
+ done(image.naturalWidth, image.naturalHeight);
+ return;
+ }
- this.container = container;
- this.cropper = cropper;
- this.canvas = canvas;
- this.dragBox = dragBox;
- this.cropBox = cropBox;
- this.viewBox = cropper.querySelector('.' + NAMESPACE + '-view-box');
- this.face = face;
+ var sizingImage = document.createElement('img');
+ var body = document.body || document.documentElement;
+ this.sizingImage = sizingImage;
- canvas.appendChild(image);
+ sizingImage.onload = function () {
+ done(sizingImage.width, sizingImage.height);
- // Hide the original image
- addClass(element, CLASS_HIDDEN);
+ if (!isIOSWebKit) {
+ body.removeChild(sizingImage);
+ }
+ };
- // Inserts the cropper after to the current image
- container.insertBefore(cropper, element.nextSibling);
+ sizingImage.src = image.src; // iOS WebKit will convert the image automatically
+ // with its orientation once append it into DOM (#279)
- // Show the image if is hidden
- if (!this.isImg) {
- removeClass(image, CLASS_HIDE);
+ if (!isIOSWebKit) {
+ sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
+ body.appendChild(sizingImage);
+ }
}
+ }, {
+ key: "stop",
+ value: function stop() {
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ image.parentNode.removeChild(image);
+ this.image = null;
+ }
+ }, {
+ key: "build",
+ value: function build() {
+ if (!this.sized || this.ready) {
+ return;
+ }
- this.initPreview();
- this.bind();
+ var element = this.element,
+ options = this.options,
+ image = this.image; // Create cropper elements
+
+ var container = element.parentNode;
+ var template = document.createElement('div');
+ template.innerHTML = TEMPLATE;
+ var cropper = template.querySelector(".".concat(NAMESPACE, "-container"));
+ var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas"));
+ var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box"));
+ var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box"));
+ var face = cropBox.querySelector(".".concat(NAMESPACE, "-face"));
+ this.container = container;
+ this.cropper = cropper;
+ this.canvas = canvas;
+ this.dragBox = dragBox;
+ this.cropBox = cropBox;
+ this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box"));
+ this.face = face;
+ canvas.appendChild(image); // Hide the original image
+
+ addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image
+
+ container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden
+
+ if (!this.isImg) {
+ removeClass(image, CLASS_HIDE);
+ }
- options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
- options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
+ this.initPreview();
+ this.bind();
+ options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
+ options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
+ options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
+ addClass(cropBox, CLASS_HIDDEN);
- this.cropped = options.autoCrop;
+ if (!options.guides) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN);
+ }
- if (options.autoCrop) {
- if (options.modal) {
- addClass(dragBox, CLASS_MODAL);
+ if (!options.center) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN);
}
- } else {
- addClass(cropBox, CLASS_HIDDEN);
- }
- if (!options.guides) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-dashed'), CLASS_HIDDEN);
- }
+ if (options.background) {
+ addClass(cropper, "".concat(NAMESPACE, "-bg"));
+ }
- if (!options.center) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-center'), CLASS_HIDDEN);
- }
+ if (!options.highlight) {
+ addClass(face, CLASS_INVISIBLE);
+ }
- if (options.background) {
- addClass(cropper, NAMESPACE + '-bg');
- }
+ if (options.cropBoxMovable) {
+ addClass(face, CLASS_MOVE);
+ setData(face, DATA_ACTION, ACTION_ALL);
+ }
- if (!options.highlight) {
- addClass(face, CLASS_INVISIBLE);
- }
+ if (!options.cropBoxResizable) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN);
+ }
- if (options.cropBoxMovable) {
- addClass(face, CLASS_MOVE);
- setData(face, DATA_ACTION, ACTION_ALL);
- }
+ this.render();
+ this.ready = true;
+ this.setDragMode(options.dragMode);
- if (!options.cropBoxResizable) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-line'), CLASS_HIDDEN);
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-point'), CLASS_HIDDEN);
- }
+ if (options.autoCrop) {
+ this.crop();
+ }
- this.setDragMode(options.dragMode);
- this.render();
- this.ready = true;
- this.setData(options.data);
+ this.setData(options.data);
- // Call the "ready" option asynchronously to keep "image.cropper" is defined
- this.completing = setTimeout(function () {
if (isFunction(options.ready)) {
addListener(element, EVENT_READY, options.ready, {
once: true
@@ -3693,74 +3551,66 @@ var Cropper = function () {
}
dispatchEvent(element, EVENT_READY);
- dispatchEvent(element, EVENT_CROP, _this3.getData());
-
- _this3.complete = true;
- }, 0);
- }
- }, {
- key: 'unbuild',
- value: function unbuild() {
- if (!this.ready) {
- return;
}
+ }, {
+ key: "unbuild",
+ value: function unbuild() {
+ if (!this.ready) {
+ return;
+ }
- if (!this.complete) {
- clearTimeout(this.completing);
+ this.ready = false;
+ this.unbind();
+ this.resetPreview();
+ this.cropper.parentNode.removeChild(this.cropper);
+ removeClass(this.element, CLASS_HIDDEN);
+ }
+ }, {
+ key: "uncreate",
+ value: function uncreate() {
+ if (this.ready) {
+ this.unbuild();
+ this.ready = false;
+ this.cropped = false;
+ } else if (this.sizing) {
+ this.sizingImage.onload = null;
+ this.sizing = false;
+ this.sized = false;
+ } else if (this.reloading) {
+ this.xhr.onabort = null;
+ this.xhr.abort();
+ } else if (this.image) {
+ this.stop();
+ }
}
+ /**
+ * Get the no conflict cropper class.
+ * @returns {Cropper} The cropper class.
+ */
- this.ready = false;
- this.complete = false;
- this.initialImageData = null;
-
- // Clear `initialCanvasData` is necessary when replace
- this.initialCanvasData = null;
- this.initialCropBoxData = null;
- this.containerData = null;
- this.canvasData = null;
-
- // Clear `cropBoxData` is necessary when replace
- this.cropBoxData = null;
- this.unbind();
- this.resetPreview();
- this.previews = null;
- this.viewBox = null;
- this.cropBox = null;
- this.dragBox = null;
- this.canvas = null;
- this.container = null;
- this.cropper.parentNode.removeChild(this.cropper);
- this.cropper = null;
- }
+ }], [{
+ key: "noConflict",
+ value: function noConflict() {
+ window.Cropper = AnotherCropper;
+ return Cropper;
+ }
+ /**
+ * Change the default options.
+ * @param {Object} options - The new default options.
+ */
- /**
- * Get the no conflict cropper class.
- * @returns {Cropper} The cropper class.
- */
+ }, {
+ key: "setDefaults",
+ value: function setDefaults(options) {
+ assign(DEFAULTS, isPlainObject(options) && options);
+ }
+ }]);
- }], [{
- key: 'noConflict',
- value: function noConflict() {
- window.Cropper = AnotherCropper;
- return Cropper;
- }
+ return Cropper;
+ }();
- /**
- * Change the default options.
- * @param {Object} options - The new default options.
- */
+ assign(Cropper.prototype, render, preview, events, handlers, change, methods);
- }, {
- key: 'setDefaults',
- value: function setDefaults(options) {
- extend(DEFAULTS, isPlainObject(options) && options);
- }
- }]);
return Cropper;
-}();
-
-extend(Cropper.prototype, render, preview, events, handlers, change, methods);
-
-return Cropper;
-})));
+}));
diff --git a/library/cropperjs/dist/cropper.min.css b/library/cropperjs/dist/cropper.min.css
index 89148848a..d870a6740 100644
--- a/library/cropperjs/dist/cropper.min.css
+++ b/library/cropperjs/dist/cropper.min.css
@@ -1,9 +1,9 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:26:29.610Z
- */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline-color:rgba(51,153,255,.75);outline:1px solid #39f;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file
+ * Date: 2019-10-04T04:33:44.164Z
+ */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed} \ No newline at end of file
diff --git a/library/cropperjs/dist/cropper.min.js b/library/cropperjs/dist/cropper.min.js
index e213c6c41..958cc2391 100644
--- a/library/cropperjs/dist/cropper.min.js
+++ b/library/cropperjs/dist/cropper.min.js
@@ -1,10 +1,10 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:27:18.062Z
+ * Date: 2019-10-04T04:33:48.372Z
*/
-!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):t.Cropper=i()}(this,function(){"use strict";var t="undefined"!=typeof window?window:{},i="cropper",e=i+"-crop",a=i+"-disabled",n=i+"-hidden",o=i+"-hide",h=i+"-modal",r=i+"-move",s="action",c="preview",l="crop",d="cropend",p="cropmove",m="cropstart",u="load",g=t.PointerEvent?"pointerdown":"touchstart mousedown",f=t.PointerEvent?"pointermove":"touchmove mousemove",v=t.PointerEvent?"pointerup pointercancel":"touchend touchcancel mouseup",w="wheel mousewheel DOMMouseScroll",x=/^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/,b=/^data:/,y=/^data:image\/jpeg;base64,/,C=/^(img|canvas)$/i,M={viewMode:0,dragMode:"crop",aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")},k=function(){function t(t,i){for(var e=0;e<i.length;e++){var a=i[e];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(i,e,a){return e&&t(i.prototype,e),a&&t(i,a),i}}(),E=function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i<t.length;i++)e[i]=t[i];return e}return Array.from(t)},T=Number.isNaN||t.isNaN;function W(t){return"number"==typeof t&&!T(t)}function N(t){return void 0===t}function H(t){return"object"===(void 0===t?"undefined":D(t))&&null!==t}var L=Object.prototype.hasOwnProperty;function Y(t){if(!H(t))return!1;try{var i=t.constructor,e=i.prototype;return i&&e&&L.call(e,"isPrototypeOf")}catch(t){return!1}}function X(t){return"function"==typeof t}function O(t,i){if(t&&X(i))if(Array.isArray(t)||W(t.length)){var e=t.length,a=void 0;for(a=0;a<e&&!1!==i.call(t,t[a],a,t);a+=1);}else H(t)&&Object.keys(t).forEach(function(e){i.call(t,t[e],e,t)});return t}function S(t){for(var i=arguments.length,e=Array(i>1?i-1:0),a=1;a<i;a++)e[a-1]=arguments[a];if(H(t)&&e.length>0){if(Object.assign)return Object.assign.apply(Object,[t].concat(e));e.forEach(function(i){H(i)&&Object.keys(i).forEach(function(e){t[e]=i[e]})})}return t}function z(t,i){for(var e=arguments.length,a=Array(e>2?e-2:0),n=2;n<e;n++)a[n-2]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.apply(i,a.concat(n))}}var R=/\.\d*(?:0|9){12}\d*$/i;function A(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return R.test(t)?Math.round(t*i)/i:t}var I=/^(width|height|left|top|marginLeft|marginTop)$/;function U(t,i){var e=t.style;O(i,function(t,i){I.test(i)&&W(t)&&(t+="px"),e[i]=t})}function j(t,i){if(i)if(W(t.length))O(t,function(t){j(t,i)});else if(t.classList)t.classList.add(i);else{var e=t.className.trim();e?e.indexOf(i)<0&&(t.className=e+" "+i):t.className=i}}function P(t,i){i&&(W(t.length)?O(t,function(t){P(t,i)}):t.classList?t.classList.remove(i):t.className.indexOf(i)>=0&&(t.className=t.className.replace(i,"")))}function q(t,i,e){i&&(W(t.length)?O(t,function(t){q(t,i,e)}):e?j(t,i):P(t,i))}var $=/([a-z\d])([A-Z])/g;function Q(t){return t.replace($,"$1-$2").toLowerCase()}function Z(t,i){return H(t[i])?t[i]:t.dataset?t.dataset[i]:t.getAttribute("data-"+Q(i))}function F(t,i,e){H(e)?t[i]=e:t.dataset?t.dataset[i]=e:t.setAttribute("data-"+Q(i),e)}function K(t,i){if(H(t[i]))try{delete t[i]}catch(e){t[i]=null}else if(t.dataset)try{delete t.dataset[i]}catch(e){t.dataset[i]=null}else t.removeAttribute("data-"+Q(i))}var V=/\s+/;function G(t,i,e){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(X(e)){var n=i.trim().split(V);n.length>1?O(n,function(i){G(t,i,e,a)}):t.removeEventListener?t.removeEventListener(i,e,a):t.detachEvent&&t.detachEvent("on"+i,e)}}function J(t,i,e){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(X(e)){var n=i.trim().split(V);if(n.length>1)O(n,function(i){J(t,i,e,a)});else{if(a.once){var o=e;e=function(){for(var n=arguments.length,h=Array(n),r=0;r<n;r++)h[r]=arguments[r];return G(t,i,e,a),o.apply(t,h)}}t.addEventListener?t.addEventListener(i,e,a):t.attachEvent&&t.attachEvent("on"+i,e)}}}function _(t,i,e){if(t.dispatchEvent){var a=void 0;return X(Event)&&X(CustomEvent)?a=N(e)?new Event(i,{bubbles:!0,cancelable:!0}):new CustomEvent(i,{detail:e,bubbles:!0,cancelable:!0}):N(e)?(a=document.createEvent("Event")).initEvent(i,!0,!0):(a=document.createEvent("CustomEvent")).initCustomEvent(i,!0,!0,e),t.dispatchEvent(a)}return!t.fireEvent||t.fireEvent("on"+i)}function tt(t){var i=document.documentElement,e=t.getBoundingClientRect();return{left:e.left+((window.scrollX||i&&i.scrollLeft||0)-(i&&i.clientLeft||0)),top:e.top+((window.scrollY||i&&i.scrollTop||0)-(i&&i.clientTop||0))}}var it=t.location,et=/^(https?:)\/\/([^:/?#]+):?(\d*)/i;function at(t){var i=t.match(et);return i&&(i[1]!==it.protocol||i[2]!==it.hostname||i[3]!==it.port)}function nt(t){var i="timestamp="+(new Date).getTime();return t+(-1===t.indexOf("?")?"?":"&")+i}function ot(t){var i=t.rotate,e=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,h=[];W(n)&&0!==n&&h.push("translateX("+n+"px)"),W(o)&&0!==o&&h.push("translateY("+o+"px)"),W(i)&&0!==i&&h.push("rotate("+i+"deg)"),W(e)&&1!==e&&h.push("scaleX("+e+")"),W(a)&&1!==a&&h.push("scaleY("+a+")");var r=h.length?h.join(" "):"none";return{WebkitTransform:r,msTransform:r,transform:r}}var ht=t.navigator,rt=ht&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(ht.userAgent);function st(t,i){var e=t.pageX,a=t.pageY,n={endX:e,endY:a};return i?n:S({startX:e,startY:a},n)}var ct=Number.isFinite||t.isFinite;function lt(t){var i=t.aspectRatio,e=t.height,a=t.width,n=function(t){return ct(t)&&t>0};return n(a)&&n(e)?e*i>a?e=a/i:a=e*i:n(a)?e=a/i:n(e)&&(a=e*i),{width:a,height:e}}var dt=String.fromCharCode;var pt=/^data:.*,/;function mt(t){var i=new DataView(t),e=void 0,a=void 0,n=void 0,o=void 0;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var h=i.byteLength,r=2;r<h;){if(255===i.getUint8(r)&&225===i.getUint8(r+1)){n=r;break}r+=1}if(n){var s=n+10;if("Exif"===function(t,i,e){var a="",n=void 0;for(e+=i,n=i;n<e;n+=1)a+=dt(t.getUint8(n));return a}(i,n+4,4)){var c=i.getUint16(s);if(((a=18761===c)||19789===c)&&42===i.getUint16(s+2,a)){var l=i.getUint32(s+4,a);l>=8&&(o=s+l)}}}if(o){var d=i.getUint16(o,a),p=void 0,m=void 0;for(m=0;m<d;m+=1)if(p=o+12*m+2,274===i.getUint16(p,a)){p+=8,e=i.getUint16(p,a),i.setUint16(p,1,a);break}}return e}var ut={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,a=this.cropper;j(a,n),P(t,n);var o={width:Math.max(e.offsetWidth,Number(i.minContainerWidth)||200),height:Math.max(e.offsetHeight,Number(i.minContainerHeight)||100)};this.containerData=o,U(a,{width:o.width,height:o.height}),j(t,n),P(a,n)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,a=Math.abs(i.rotate)%180==90,n=a?i.naturalHeight:i.naturalWidth,o=a?i.naturalWidth:i.naturalHeight,h=n/o,r=t.width,s=t.height;t.height*h>t.width?3===e?r=t.height*h:s=t.width/h:3===e?s=t.width/h:r=t.height*h;var c={aspectRatio:h,naturalWidth:n,naturalHeight:o,width:r,height:s};c.left=(t.width-r)/2,c.top=(t.height-s)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===e||2===e,this.limitCanvas(!0,!0),this.initialImageData=S({},i),this.initialCanvasData=S({},c)},limitCanvas:function(t,i){var e=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=e.viewMode,r=n.aspectRatio,s=this.cropped&&o;if(t){var c=Number(e.minCanvasWidth)||0,l=Number(e.minCanvasHeight)||0;h>1?(c=Math.max(c,a.width),l=Math.max(l,a.height),3===h&&(l*r>c?c=l*r:l=c/r)):h>0&&(c?c=Math.max(c,s?o.width:0):l?l=Math.max(l,s?o.height:0):s&&(c=o.width,(l=o.height)*r>c?c=l*r:l=c/r));var d=lt({aspectRatio:r,width:c,height:l});c=d.width,l=d.height,n.minWidth=c,n.minHeight=l,n.maxWidth=1/0,n.maxHeight=1/0}if(i)if(h){var p=a.width-n.width,m=a.height-n.height;n.minLeft=Math.min(0,p),n.minTop=Math.min(0,m),n.maxLeft=Math.max(0,p),n.maxTop=Math.max(0,m),s&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===h&&(n.width>=a.width&&(n.minLeft=Math.min(0,p),n.maxLeft=Math.max(0,p)),n.height>=a.height&&(n.minTop=Math.min(0,m),n.maxTop=Math.max(0,m))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height},renderCanvas:function(t,i){var e=this.canvasData,a=this.imageData;if(i){var n=function(t){var i=t.width,e=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))return{width:e,height:i};var n=a%90*Math.PI/180,o=Math.sin(n),h=Math.cos(n),r=i*h+e*o,s=i*o+e*h;return a>90?{width:s,height:r}:{width:r,height:s}}({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),o=n.width,h=n.height,r=e.width*(o/e.naturalWidth),s=e.height*(h/e.naturalHeight);e.left-=(r-e.width)/2,e.top-=(s-e.height)/2,e.width=r,e.height=s,e.aspectRatio=o/h,e.naturalWidth=o,e.naturalHeight=h,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,U(this.canvas,S({width:e.width,height:e.height},ot({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,a=e.naturalWidth*(i.width/i.naturalWidth),n=e.naturalHeight*(i.height/i.naturalHeight);S(e,{width:a,height:n,left:(i.width-a)/2,top:(i.height-n)/2}),U(this.image,S({width:e.width,height:e.height},ot(S({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio,a=Number(t.autoCropArea)||.8,n={width:i.width,height:i.height};e&&(i.height*e>i.width?n.height=n.width/e:n.width=n.height*e),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=i.left+(i.width-n.width)/2,n.top=i.top+(i.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=S({},n)},limitCropBox:function(t,i){var e=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=this.limited,r=e.aspectRatio;if(t){var s=Number(e.minCropBoxWidth)||0,c=Number(e.minCropBoxHeight)||0,l=Math.min(a.width,h?n.width:a.width),d=Math.min(a.height,h?n.height:a.height);s=Math.min(s,a.width),c=Math.min(c,a.height),r&&(s&&c?c*r>s?c=s/r:s=c*r:s?c=s/r:c&&(s=c*r),d*r>l?d=l/r:l=d*r),o.minWidth=Math.min(s,l),o.minHeight=Math.min(c,d),o.maxWidth=l,o.maxHeight=d}i&&(h?(o.minLeft=Math.max(0,n.left),o.minTop=Math.max(0,n.top),o.maxLeft=Math.min(a.width,n.left+n.width)-o.width,o.maxTop=Math.min(a.height,n.top+n.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=a.width-o.width,o.maxTop=a.height-o.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&F(this.face,s,e.width>=i.width&&e.height>=i.height?"move":"all"),U(this.cropBox,S({width:e.width,height:e.height},ot({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),this.complete&&_(this.element,l,this.getData())}},gt={initPreview:function(){var t=this.crossOrigin,i=this.options.preview,e=t?this.crossOriginUrl:this.url,a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=e,this.viewBox.appendChild(a),this.image2=a,i){var n=i.querySelector?[i]:document.querySelectorAll(i);this.previews=n,O(n,function(i){var a=document.createElement("img");F(i,c,{width:i.offsetWidth,height:i.offsetHeight,html:i.innerHTML}),t&&(a.crossOrigin=t),a.src=e,a.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}(i),i.appendChild(a)})}},resetPreview:function(){O(this.previews,function(t){var i=Z(t,c);U(t,{width:i.width,height:i.height}),t.innerHTML=i.html,K(t,c)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,a=e.width,n=e.height,o=t.width,h=t.height,r=e.left-i.left-t.left,s=e.top-i.top-t.top;this.cropped&&!this.disabled&&(U(this.image2,S({width:o,height:h},ot(S({translateX:-r,translateY:-s},t)))),O(this.previews,function(i){var e=Z(i,c),l=e.width,d=e.height,p=l,m=d,u=1;a&&(m=n*(u=l/a)),n&&m>d&&(p=a*(u=d/n),m=d),U(i,{width:p,height:m}),U(i.getElementsByTagName("img")[0],S({width:o*u,height:h*u},ot(S({translateX:-r*u,translateY:-s*u},t))))}))}},ft={bind:function(){var t=this.element,i=this.options,e=this.cropper;X(i.cropstart)&&J(t,m,i.cropstart),X(i.cropmove)&&J(t,p,i.cropmove),X(i.cropend)&&J(t,d,i.cropend),X(i.crop)&&J(t,l,i.crop),X(i.zoom)&&J(t,"zoom",i.zoom),J(e,g,this.onCropStart=z(this.cropStart,this)),i.zoomable&&i.zoomOnWheel&&J(e,w,this.onWheel=z(this.wheel,this)),i.toggleDragModeOnDblclick&&J(e,"dblclick",this.onDblclick=z(this.dblclick,this)),J(t.ownerDocument,f,this.onCropMove=z(this.cropMove,this)),J(t.ownerDocument,v,this.onCropEnd=z(this.cropEnd,this)),i.responsive&&J(window,"resize",this.onResize=z(this.resize,this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;X(i.cropstart)&&G(t,m,i.cropstart),X(i.cropmove)&&G(t,p,i.cropmove),X(i.cropend)&&G(t,d,i.cropend),X(i.crop)&&G(t,l,i.crop),X(i.zoom)&&G(t,"zoom",i.zoom),G(e,g,this.onCropStart),i.zoomable&&i.zoomOnWheel&&G(e,w,this.onWheel),i.toggleDragModeOnDblclick&&G(e,"dblclick",this.onDblclick),G(t.ownerDocument,f,this.onCropMove),G(t.ownerDocument,v,this.onCropEnd),i.responsive&&G(window,"resize",this.onResize)}},vt={resize:function(){var t=this.options,i=this.container,e=this.containerData,a=Number(t.minContainerWidth)||200,n=Number(t.minContainerHeight)||100;if(!(this.disabled||e.width<=a||e.height<=n)){var o=i.offsetWidth/e.width;if(1!==o||i.offsetHeight!==e.height){var h=void 0,r=void 0;t.restore&&(h=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(O(h,function(t,i){h[i]=t*o})),this.setCropBoxData(O(r,function(t,i){r[i]=t*o})))}}},dblclick:function(){if(!this.disabled&&"none"!==this.options.dragMode){this.setDragMode((t=this.dragBox,i=e,(t.classList?t.classList.contains(i):t.className.indexOf(i)>-1)?"move":"crop"));var t,i}},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*e,t)))},cropStart:function(t){if(!this.disabled){var i=this.options,e=this.pointers,a=void 0;t.changedTouches?O(t.changedTouches,function(t){e[t.identifier]=st(t)}):e[t.pointerId||0]=st(t),a=Object.keys(e).length>1&&i.zoomable&&i.zoomOnTouch?"zoom":Z(t.target,s),x.test(a)&&!1!==_(this.element,m,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,"crop"===a&&(this.cropping=!0,j(this.dragBox,h)))}},cropMove:function(t){var i=this.action;if(!this.disabled&&i){var e=this.pointers;t.preventDefault(),!1!==_(this.element,p,{originalEvent:t,action:i})&&(t.changedTouches?O(t.changedTouches,function(t){S(e[t.identifier],st(t,!0))}):S(e[t.pointerId||0],st(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?O(t.changedTouches,function(t){delete e[t.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,q(this.dragBox,h,this.cropped&&this.options.modal)),_(this.element,d,{originalEvent:t,action:i}))}}},wt={change:function(t){var i=this.options,e=this.canvasData,a=this.containerData,o=this.cropBoxData,h=this.pointers,r=this.action,s=i.aspectRatio,c=o.left,l=o.top,d=o.width,p=o.height,m=c+d,u=l+p,g=0,f=0,v=a.width,w=a.height,x=!0,b=void 0;!s&&t.shiftKey&&(s=d&&p?d/p:1),this.limited&&(g=o.minLeft,f=o.minTop,v=g+Math.min(a.width,e.width,e.left+e.width),w=f+Math.min(a.height,e.height,e.top+e.height));var y=h[Object.keys(h)[0]],C={x:y.endX-y.startX,y:y.endY-y.startY},M=function(t){switch(t){case"e":m+C.x>v&&(C.x=v-m);break;case"w":c+C.x<g&&(C.x=g-c);break;case"n":l+C.y<f&&(C.y=f-l);break;case"s":u+C.y>w&&(C.y=w-u)}};switch(r){case"all":c+=C.x,l+=C.y;break;case"e":if(C.x>=0&&(m>=v||s&&(l<=f||u>=w))){x=!1;break}M("e"),d+=C.x,s&&(p=d/s,l-=C.x/s/2),d<0&&(r="w",d=0);break;case"n":if(C.y<=0&&(l<=f||s&&(c<=g||m>=v))){x=!1;break}M("n"),p-=C.y,l+=C.y,s&&(d=p*s,c+=C.y*s/2),p<0&&(r="s",p=0);break;case"w":if(C.x<=0&&(c<=g||s&&(l<=f||u>=w))){x=!1;break}M("w"),d-=C.x,c+=C.x,s&&(p=d/s,l+=C.x/s/2),d<0&&(r="e",d=0);break;case"s":if(C.y>=0&&(u>=w||s&&(c<=g||m>=v))){x=!1;break}M("s"),p+=C.y,s&&(d=p*s,c-=C.y*s/2),p<0&&(r="n",p=0);break;case"ne":if(s){if(C.y<=0&&(l<=f||m>=v)){x=!1;break}M("n"),p-=C.y,l+=C.y,d=p*s}else M("n"),M("e"),C.x>=0?m<v?d+=C.x:C.y<=0&&l<=f&&(x=!1):d+=C.x,C.y<=0?l>f&&(p-=C.y,l+=C.y):(p-=C.y,l+=C.y);d<0&&p<0?(r="sw",p=0,d=0):d<0?(r="nw",d=0):p<0&&(r="se",p=0);break;case"nw":if(s){if(C.y<=0&&(l<=f||c<=g)){x=!1;break}M("n"),p-=C.y,l+=C.y,d=p*s,c+=C.y*s}else M("n"),M("w"),C.x<=0?c>g?(d-=C.x,c+=C.x):C.y<=0&&l<=f&&(x=!1):(d-=C.x,c+=C.x),C.y<=0?l>f&&(p-=C.y,l+=C.y):(p-=C.y,l+=C.y);d<0&&p<0?(r="se",p=0,d=0):d<0?(r="ne",d=0):p<0&&(r="sw",p=0);break;case"sw":if(s){if(C.x<=0&&(c<=g||u>=w)){x=!1;break}M("w"),d-=C.x,c+=C.x,p=d/s}else M("s"),M("w"),C.x<=0?c>g?(d-=C.x,c+=C.x):C.y>=0&&u>=w&&(x=!1):(d-=C.x,c+=C.x),C.y>=0?u<w&&(p+=C.y):p+=C.y;d<0&&p<0?(r="ne",p=0,d=0):d<0?(r="se",d=0):p<0&&(r="nw",p=0);break;case"se":if(s){if(C.x>=0&&(m>=v||u>=w)){x=!1;break}M("e"),p=(d+=C.x)/s}else M("s"),M("e"),C.x>=0?m<v?d+=C.x:C.y>=0&&u>=w&&(x=!1):d+=C.x,C.y>=0?u<w&&(p+=C.y):p+=C.y;d<0&&p<0?(r="nw",p=0,d=0):d<0?(r="sw",d=0):p<0&&(r="ne",p=0);break;case"move":this.move(C.x,C.y),x=!1;break;case"zoom":this.zoom(function(t){var i=S({},t),e=[];return O(t,function(t,a){delete i[a],O(i,function(i){var a=Math.abs(t.startX-i.startX),n=Math.abs(t.startY-i.startY),o=Math.abs(t.endX-i.endX),h=Math.abs(t.endY-i.endY),r=Math.sqrt(a*a+n*n),s=(Math.sqrt(o*o+h*h)-r)/r;e.push(s)})}),e.sort(function(t,i){return Math.abs(t)<Math.abs(i)}),e[0]}(h),t),x=!1;break;case"crop":if(!C.x||!C.y){x=!1;break}b=tt(this.cropper),c=y.startX-b.left,l=y.startY-b.top,d=o.minWidth,p=o.minHeight,C.x>0?r=C.y>0?"se":"ne":C.x<0&&(c-=d,r=C.y>0?"sw":"nw"),C.y<0&&(l-=p),this.cropped||(P(this.cropBox,n),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}x&&(o.width=d,o.height=p,o.left=c,o.top=l,this.action=r,this.renderCropBox()),O(h,function(t){t.startX=t.endX,t.startY=t.endY})}},xt={crop:function(){return this.ready&&!this.disabled&&(this.cropped||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&j(this.dragBox,h),P(this.cropBox,n)),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=S({},this.initialImageData),this.canvasData=S({},this.initialCanvasData),this.cropBoxData=S({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(S(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),P(this.dragBox,h),j(this.cropBox,n)),this},replace:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.image2.src=t,O(this.previews,function(i){i.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.load(t))),this},enable:function(){return this.ready&&(this.disabled=!1,P(this.cropper,a)),this},disable:function(){return this.ready&&(this.disabled=!0,j(this.cropper,a)),this},destroy:function(){var t=this.element,e=this.image;return this.loaded?(this.isImg&&this.replaced&&(t.src=this.originalUrl),this.unbuild(),P(t,n)):this.isImg?G(t,u,this.onStart):e&&e.parentNode.removeChild(e),K(t,i),this},move:function(t,i){var e=this.canvasData,a=e.left,n=e.top;return this.moveTo(N(t)?t:a+Number(t),N(i)?i:n+Number(i))},moveTo:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.canvasData,a=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(W(t)&&(e.left=t,a=!0),W(i)&&(e.top=i,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var a=this.options,n=this.canvasData,o=n.width,h=n.height,r=n.naturalWidth,s=n.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&a.zoomable){var c=r*t,l=s*t;if(!1===_(this.element,"zoom",{originalEvent:e,oldRatio:o/r,ratio:c/r}))return this;if(e){var d=this.pointers,p=tt(this.cropper),m=d&&Object.keys(d).length?function(t){var i=0,e=0,a=0;return O(t,function(t){var n=t.startX,o=t.startY;i+=n,e+=o,a+=1}),{pageX:i/=a,pageY:e/=a}}(d):{pageX:e.pageX,pageY:e.pageY};n.left-=(c-o)*((m.pageX-p.left-n.left)/o),n.top-=(l-h)*((m.pageY-p.top-n.top)/h)}else Y(i)&&W(i.x)&&W(i.y)?(n.left-=(c-o)*((i.x-n.left)/o),n.top-=(l-h)*((i.y-n.top)/h)):(n.left-=(c-o)/2,n.top-=(l-h)/2);n.width=c,n.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return W(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,W(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(W(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.imageData,a=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(W(t)&&(e.scaleX=t,a=!0),W(i)&&(e.scaleY=i,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,e=this.imageData,a=this.canvasData,n=this.cropBoxData,o=void 0;if(this.ready&&this.cropped){o={x:n.left-a.left,y:n.top-a.top,width:n.width,height:n.height};var h=e.width/e.naturalWidth;O(o,function(i,e){i/=h,o[e]=t?Math.round(i):i})}else o={x:0,y:0,width:0,height:0};return i.rotatable&&(o.rotate=e.rotate||0),i.scalable&&(o.scaleX=e.scaleX||1,o.scaleY=e.scaleY||1),o},setData:function(t){var i=this.options,e=this.imageData,a=this.canvasData,n={};if(X(t)&&(t=t.call(this.element)),this.ready&&!this.disabled&&Y(t)){var o=!1;i.rotatable&&W(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,o=!0),i.scalable&&(W(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,o=!0),W(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var h=e.width/e.naturalWidth;W(t.x)&&(n.left=t.x*h+a.left),W(t.y)&&(n.top=t.y*h+a.top),W(t.width)&&(n.width=t.width*h),W(t.height)&&(n.height=t.height*h),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?S({},this.containerData):{}},getImageData:function(){return this.loaded?S({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&O(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return X(t)&&(t=t.call(this.element)),this.ready&&!this.disabled&&Y(t)&&(W(t.left)&&(i.left=t.left),W(t.top)&&(i.top=t.top),W(t.width)?(i.width=t.width,i.height=t.width/e):W(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,i=void 0;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,a=void 0,n=void 0;return X(t)&&(t=t.call(this.element)),this.ready&&this.cropped&&!this.disabled&&Y(t)&&(W(t.left)&&(i.left=t.left),W(t.top)&&(i.top=t.top),W(t.width)&&t.width!==i.width&&(a=!0,i.width=t.width),W(t.height)&&t.height!==i.height&&(n=!0,i.height=t.height),e&&(a?i.height=i.width/e:n&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=function(t,i,e,a){var n=i.naturalWidth,o=i.naturalHeight,h=i.rotate,r=void 0===h?0:h,s=i.scaleX,c=void 0===s?1:s,l=i.scaleY,d=void 0===l?1:l,p=e.aspectRatio,m=e.naturalWidth,u=e.naturalHeight,g=a.fillColor,f=void 0===g?"transparent":g,v=a.imageSmoothingEnabled,w=void 0===v||v,x=a.imageSmoothingQuality,b=void 0===x?"low":x,y=a.maxWidth,C=void 0===y?1/0:y,M=a.maxHeight,D=void 0===M?1/0:M,B=a.minWidth,k=void 0===B?0:B,T=a.minHeight,W=void 0===T?0:T,N=document.createElement("canvas"),H=N.getContext("2d"),L=lt({aspectRatio:p,width:C,height:D}),Y=lt({aspectRatio:p,width:k,height:W}),X=Math.min(L.width,Math.max(Y.width,m)),O=Math.min(L.height,Math.max(Y.height,u)),S=[-n/2,-o/2,n,o];return N.width=A(X),N.height=A(O),H.fillStyle=f,H.fillRect(0,0,X,O),H.save(),H.translate(X/2,O/2),H.rotate(r*Math.PI/180),H.scale(c,d),H.imageSmoothingEnabled=w,H.imageSmoothingQuality=b,H.drawImage.apply(H,[t].concat(E(S.map(function(t){return Math.floor(A(t))})))),H.restore(),N}(this.image,this.imageData,i,t);if(!this.cropped)return e;var a=this.getData(),n=a.x,o=a.y,h=a.width,r=a.height,s=h/r,c=lt({aspectRatio:s,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),l=lt({aspectRatio:s,width:t.minWidth||0,height:t.minHeight||0}),d=lt({aspectRatio:s,width:t.width||h,height:t.height||r}),p=d.width,m=d.height;p=Math.min(c.width,Math.max(l.width,p)),m=Math.min(c.height,Math.max(l.height,m));var u=document.createElement("canvas"),g=u.getContext("2d");u.width=A(p),u.height=A(m),g.fillStyle=t.fillColor||"transparent",g.fillRect(0,0,p,m);var f=t.imageSmoothingEnabled,v=void 0===f||f,w=t.imageSmoothingQuality;g.imageSmoothingEnabled=v,w&&(g.imageSmoothingQuality=w);var x=e.width,b=e.height,y=n,C=o,M=void 0,D=void 0,B=void 0,k=void 0,T=void 0,W=void 0;y<=-h||y>x?(y=0,M=0,B=0,T=0):y<=0?(B=-y,y=0,T=M=Math.min(x,h+y)):y<=x&&(B=0,T=M=Math.min(h,x-y)),M<=0||C<=-r||C>b?(C=0,D=0,k=0,W=0):C<=0?(k=-C,C=0,W=D=Math.min(b,r+C)):C<=b&&(k=0,W=D=Math.min(r,b-C));var N=[y,C,M,D];if(T>0&&W>0){var H=p/h;N.push(B*H,k*H,T*H,W*H)}return g.drawImage.apply(g,[e].concat(E(N.map(function(t){return Math.floor(A(t))})))),u},setAspectRatio:function(t){var i=this.options;return this.disabled||N(t)||(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,a=this.dragBox,n=this.face;if(this.loaded&&!this.disabled){var o="crop"===t,h=i.movable&&"move"===t;F(a,s,t=o||h?t:"none"),q(a,e,o),q(a,r,h),i.cropBoxMovable||(F(n,s,t),q(n,e,o),q(n,r,h))}return this}},bt=t.Cropper,yt=function(){function t(i){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(B(this,t),!i||!C.test(i.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=i,this.options=S({},M,Y(e)&&e),this.complete=!1,this.cropped=!1,this.disabled=!1,this.isImg=!1,this.limited=!1,this.loaded=!1,this.ready=!1,this.replaced=!1,this.wheeling=!1,this.originalUrl="",this.canvasData=null,this.cropBoxData=null,this.previews=null,this.pointers={},this.init()}return k(t,[{key:"init",value:function(){var t=this.element,e=t.tagName.toLowerCase(),a=void 0;if(!Z(t,i)){if(F(t,i,this),"img"===e){if(this.isImg=!0,a=t.getAttribute("src")||"",this.originalUrl=a,!a)return;a=t.src}else"canvas"===e&&window.HTMLCanvasElement&&(a=t.toDataURL());this.load(a)}}},{key:"load",value:function(t){var i=this;if(t){this.url=t,this.imageData={};var e=this.element,a=this.options;if(a.checkOrientation&&window.ArrayBuffer)if(b.test(t))y.test(t)?this.read(function(t){var i=t.replace(pt,""),e=atob(i),a=new ArrayBuffer(e.length),n=new Uint8Array(a);return O(n,function(t,i){n[i]=e.charCodeAt(i)}),a}(t)):this.clone();else{var n=new XMLHttpRequest;n.onerror=function(){i.clone()},n.onload=function(){i.read(n.response)},a.checkCrossOrigin&&at(t)&&e.crossOrigin&&(t=nt(t)),n.open("get",t),n.responseType="arraybuffer",n.withCredentials="use-credentials"===e.crossOrigin,n.send()}else this.clone()}}},{key:"read",value:function(t){var i=this.options,e=this.imageData,a=mt(t),n=0,o=1,h=1;if(a>1){this.url=function(t,i){var e="";return O(new Uint8Array(t),function(t){e+=dt(t)}),"data:"+i+";base64,"+btoa(e)}(t,"image/jpeg");var r=function(t){var i=0,e=1,a=1;switch(t){case 2:e=-1;break;case 3:i=-180;break;case 4:a=-1;break;case 5:i=90,a=-1;break;case 6:i=90;break;case 7:i=90,e=-1;break;case 8:i=-90}return{rotate:i,scaleX:e,scaleY:a}}(a);n=r.rotate,o=r.scaleX,h=r.scaleY}i.rotatable&&(e.rotate=n),i.scalable&&(e.scaleX=o,e.scaleY=h),this.clone()}},{key:"clone",value:function(){var t=this.element,i=this.url,e=void 0,a=void 0;this.options.checkCrossOrigin&&at(i)&&((e=t.crossOrigin)?a=i:(e="anonymous",a=nt(i))),this.crossOrigin=e,this.crossOriginUrl=a;var n=document.createElement("img");e&&(n.crossOrigin=e),n.src=a||i;var h=z(this.start,this),r=z(this.stop,this);this.image=n,this.onStart=h,this.onStop=r,this.isImg?t.complete?this.start():J(t,u,h):(J(n,u,h),J(n,"error",r),j(n,o),t.parentNode.insertBefore(n,t.nextSibling))}},{key:"start",value:function(t){var i=this,e=this.isImg?this.element:this.image;t&&(G(e,u,this.onStart),G(e,"error",this.onStop)),function(t,i){if(!t.naturalWidth||rt){var e=document.createElement("img"),a=document.body||document.documentElement;e.onload=function(){i(e.width,e.height),rt||a.removeChild(e)},e.src=t.src,rt||(e.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",a.appendChild(e))}else i(t.naturalWidth,t.naturalHeight)}(e,function(t,e){S(i.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),i.loaded=!0,i.build()})}},{key:"stop",value:function(){var t=this.image;G(t,u,this.onStart),G(t,"error",this.onStop),t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){var t=this;if(this.loaded){this.ready&&this.unbuild();var e=this.element,a=this.options,c=this.image,d=e.parentNode,p=document.createElement("div");p.innerHTML='<div class="cropper-container"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-action="e"></span><span class="cropper-line line-n" data-action="n"></span><span class="cropper-line line-w" data-action="w"></span><span class="cropper-line line-s" data-action="s"></span><span class="cropper-point point-e" data-action="e"></span><span class="cropper-point point-n" data-action="n"></span><span class="cropper-point point-w" data-action="w"></span><span class="cropper-point point-s" data-action="s"></span><span class="cropper-point point-ne" data-action="ne"></span><span class="cropper-point point-nw" data-action="nw"></span><span class="cropper-point point-sw" data-action="sw"></span><span class="cropper-point point-se" data-action="se"></span></div></div>';var m=p.querySelector("."+i+"-container"),u=m.querySelector("."+i+"-canvas"),g=m.querySelector("."+i+"-drag-box"),f=m.querySelector("."+i+"-crop-box"),v=f.querySelector("."+i+"-face");this.container=d,this.cropper=m,this.canvas=u,this.dragBox=g,this.cropBox=f,this.viewBox=m.querySelector("."+i+"-view-box"),this.face=v,u.appendChild(c),j(e,n),d.insertBefore(m,e.nextSibling),this.isImg||P(c,o),this.initPreview(),this.bind(),a.aspectRatio=Math.max(0,a.aspectRatio)||NaN,a.viewMode=Math.max(0,Math.min(3,Math.round(a.viewMode)))||0,this.cropped=a.autoCrop,a.autoCrop?a.modal&&j(g,h):j(f,n),a.guides||j(f.getElementsByClassName(i+"-dashed"),n),a.center||j(f.getElementsByClassName(i+"-center"),n),a.background&&j(m,i+"-bg"),a.highlight||j(v,"cropper-invisible"),a.cropBoxMovable&&(j(v,r),F(v,s,"all")),a.cropBoxResizable||(j(f.getElementsByClassName(i+"-line"),n),j(f.getElementsByClassName(i+"-point"),n)),this.setDragMode(a.dragMode),this.render(),this.ready=!0,this.setData(a.data),this.completing=setTimeout(function(){X(a.ready)&&J(e,"ready",a.ready,{once:!0}),_(e,"ready"),_(e,l,t.getData()),t.complete=!0},0)}}},{key:"unbuild",value:function(){this.ready&&(this.complete||clearTimeout(this.completing),this.ready=!1,this.complete=!1,this.initialImageData=null,this.initialCanvasData=null,this.initialCropBoxData=null,this.containerData=null,this.canvasData=null,this.cropBoxData=null,this.unbind(),this.resetPreview(),this.previews=null,this.viewBox=null,this.cropBox=null,this.dragBox=null,this.canvas=null,this.container=null,this.cropper.parentNode.removeChild(this.cropper),this.cropper=null)}}],[{key:"noConflict",value:function(){return window.Cropper=bt,t}},{key:"setDefaults",value:function(t){S(M,Y(t)&&t)}}]),t}();return S(yt.prototype,ut,gt,ft,vt,wt,xt),yt}); \ No newline at end of file
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Cropper=e()}(this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function i(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,a)}return i}function C(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(o,!0).forEach(function(t){var e,i,a;e=n,a=o[i=t],i in e?Object.defineProperty(e,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(o).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function P(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var n="undefined"!=typeof window&&void 0!==window.document,r=n?window:{},t=n&&"ontouchstart"in r.document.documentElement,o=n&&"PointerEvent"in r,l="cropper",D="all",B="crop",k="move",O="zoom",T="e",E="w",W="s",N="n",H="ne",L="nw",z="se",Y="sw",h="".concat(l,"-crop"),s="".concat(l,"-disabled"),X="".concat(l,"-hidden"),d="".concat(l,"-hide"),p="".concat(l,"-invisible"),c="".concat(l,"-modal"),u="".concat(l,"-move"),m="".concat(l,"Action"),g="".concat(l,"Preview"),f="crop",v="move",w="none",b="crop",x="cropend",y="cropmove",M="cropstart",R="dblclick",S=o?"pointerdown":t?"touchstart":"mousedown",A=o?"pointermove":t?"touchmove":"mousemove",j=o?"pointerup pointercancel":t?"touchend touchcancel":"mouseup",I="ready",U="zoom",q="image/jpeg",$=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Q=/^data:/,K=/^data:image\/jpeg;base64,/,Z=/^img|canvas$/i,G={viewMode:0,dragMode:f,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},V=Number.isNaN||r.isNaN;function F(t){return"number"==typeof t&&!V(t)}var J=function(t){return 0<t&&t<1/0};function _(t){return void 0===t}function tt(t){return"object"===e(t)&&null!==t}var et=Object.prototype.hasOwnProperty;function it(t){if(!tt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&et.call(i,"isPrototypeOf")}catch(t){return!1}}function at(t){return"function"==typeof t}var nt=Array.prototype.slice;function ot(t){return Array.from?Array.from(t):nt.call(t)}function rt(i,a){return i&&at(a)&&(Array.isArray(i)||F(i.length)?ot(i).forEach(function(t,e){a.call(i,t,e,i)}):tt(i)&&Object.keys(i).forEach(function(t){a.call(i,i[t],t,i)})),i}var ht=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return tt(i)&&0<e.length&&e.forEach(function(e){tt(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},st=/\.\d*(?:0|9){12}\d*$/;function ct(t,e){var i=1<arguments.length&&void 0!==e?e:1e11;return st.test(t)?Math.round(t*i)/i:t}var lt=/^width|height|left|top|marginLeft|marginTop$/;function dt(t,e){var i=t.style;rt(e,function(t,e){lt.test(e)&&F(t)&&(t="".concat(t,"px")),i[e]=t})}function pt(t,e){if(e)if(F(t.length))rt(t,function(t){pt(t,e)});else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function ut(t,e){e&&(F(t.length)?rt(t,function(t){ut(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function mt(t,e,i){e&&(F(t.length)?rt(t,function(t){mt(t,e,i)}):i?pt(t,e):ut(t,e))}var gt=/([a-z\d])([A-Z])/g;function ft(t){return t.replace(gt,"$1-$2").toLowerCase()}function vt(t,e){return tt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(ft(e)))}function wt(t,e,i){tt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(ft(e)),i)}var bt=/\s\s*/,xt=function(){var t=!1;if(n){var e=!1,i=function(){},a=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});r.addEventListener("test",i,a),r.removeEventListener("test",i,a)}return t}();function yt(i,t,a,e){var n=3<arguments.length&&void 0!==e?e:{},o=a;t.trim().split(bt).forEach(function(t){if(!xt){var e=i.listeners;e&&e[t]&&e[t][a]&&(o=e[t][a],delete e[t][a],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length&&delete i.listeners)}i.removeEventListener(t,o,n)})}function Mt(o,t,r,e){var h=3<arguments.length&&void 0!==e?e:{},s=r;t.trim().split(bt).forEach(function(a){if(h.once&&!xt){var t=o.listeners,n=void 0===t?{}:t;s=function(){delete n[a][r],o.removeEventListener(a,s,h);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.apply(o,e)},n[a]||(n[a]={}),n[a][r]&&o.removeEventListener(a,n[a][r],h),n[a][r]=s,o.listeners=n}o.addEventListener(a,s,h)})}function Ct(t,e,i){var a;return at(Event)&&at(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function Dt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Bt=r.location,kt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ot(t){var e=t.match(kt);return null!==e&&(e[1]!==Bt.protocol||e[2]!==Bt.hostname||e[3]!==Bt.port)}function Tt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Et(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,r=[];F(n)&&0!==n&&r.push("translateX(".concat(n,"px)")),F(o)&&0!==o&&r.push("translateY(".concat(o,"px)")),F(e)&&0!==e&&r.push("rotate(".concat(e,"deg)")),F(i)&&1!==i&&r.push("scaleX(".concat(i,")")),F(a)&&1!==a&&r.push("scaleY(".concat(a,")"));var h=r.length?r.join(" "):"none";return{WebkitTransform:h,msTransform:h,transform:h}}function Wt(t,e){var i=t.pageX,a=t.pageY,n={endX:i,endY:a};return e?n:C({startX:i,startY:a},n)}function Nt(t,e){var i=t.aspectRatio,a=t.height,n=t.width,o=1<arguments.length&&void 0!==e?e:"contain",r=J(n),h=J(a);if(r&&h){var s=a*i;"contain"===o&&n<s||"cover"===o&&s<n?a=n/i:n=a*i}else r?a=n/i:h&&(n=a*i);return{width:n,height:a}}var Ht=String.fromCharCode;var Lt=/^data:.*,/;function zt(t){var e,i=new DataView(t);try{var a,n,o;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var r=i.byteLength,h=2;h+1<r;){if(255===i.getUint8(h)&&225===i.getUint8(h+1)){n=h;break}h+=1}if(n){var s=n+10;if("Exif"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=Ht(t.getUint8(n));return a}(i,n+4,4)){var c=i.getUint16(s);if(((a=18761===c)||19789===c)&&42===i.getUint16(s+2,a)){var l=i.getUint32(s+4,a);8<=l&&(o=s+l)}}}if(o){var d,p,u=i.getUint16(o,a);for(p=0;p<u;p+=1)if(d=o+12*p+2,274===i.getUint16(d,a)){d+=8,e=i.getUint16(d,a),i.setUint16(d,1,a);break}}}catch(t){e=1}return e}var Yt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper;pt(a,X),ut(t,X);var n={width:Math.max(i.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(e.minContainerHeight)||100)};dt(a,{width:(this.containerData=n).width,height:n.height}),pt(t,X),ut(a,X)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,n=a?e.naturalHeight:e.naturalWidth,o=a?e.naturalWidth:e.naturalHeight,r=n/o,h=t.width,s=t.height;t.height*r>t.width?3===i?h=t.height*r:s=t.width/r:3===i?s=t.width/r:h=t.height*r;var c={aspectRatio:r,naturalWidth:n,naturalHeight:o,width:h,height:s};c.left=(t.width-h)/2,c.top=(t.height-s)/2,c.oldLeft=c.left,c.oldTop=c.top,this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=ht({},e),this.initialCanvasData=ht({},c)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,r=i.viewMode,h=n.aspectRatio,s=this.cropped&&o;if(t){var c=Number(i.minCanvasWidth)||0,l=Number(i.minCanvasHeight)||0;1<r?(c=Math.max(c,a.width),l=Math.max(l,a.height),3===r&&(c<l*h?c=l*h:l=c/h)):0<r&&(c?c=Math.max(c,s?o.width:0):l?l=Math.max(l,s?o.height:0):s&&((c=o.width)<(l=o.height)*h?c=l*h:l=c/h));var d=Nt({aspectRatio:h,width:c,height:l});c=d.width,l=d.height,n.minWidth=c,n.minHeight=l,n.maxWidth=1/0,n.maxHeight=1/0}if(e)if((s?0:1)<r){var p=a.width-n.width,u=a.height-n.height;n.minLeft=Math.min(0,p),n.minTop=Math.min(0,u),n.maxLeft=Math.max(0,p),n.maxTop=Math.max(0,u),s&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===r&&(n.width>=a.width&&(n.minLeft=Math.min(0,p),n.maxLeft=Math.max(0,p)),n.height>=a.height&&(n.minTop=Math.min(0,u),n.maxTop=Math.max(0,u))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height},renderCanvas:function(t,e){var i=this.canvasData,a=this.imageData;if(e){var n=function(t){var e=t.width,i=t.height,a=t.degree;if(90===(a=Math.abs(a)%180))return{width:i,height:e};var n=a%90*Math.PI/180,o=Math.sin(n),r=Math.cos(n),h=e*r+i*o,s=e*o+i*r;return 90<a?{width:s,height:h}:{width:h,height:s}}({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),o=n.width,r=n.height,h=i.width*(o/i.naturalWidth),s=i.height*(r/i.naturalHeight);i.left-=(h-i.width)/2,i.top-=(s-i.height)/2,i.width=h,i.height=s,i.aspectRatio=o/r,i.naturalWidth=o,i.naturalHeight=r,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,dt(this.canvas,ht({width:i.width,height:i.height},Et({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);ht(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),dt(this.image,ht({width:i.width,height:i.height},Et(ht({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,n={width:e.width,height:e.height};i&&(e.height*i>e.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*a),n.height=Math.max(n.minHeight,n.height*a),n.left=e.left+(e.width-n.width)/2,n.top=e.top+(e.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=ht({},n)},limitCropBox:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,r=this.limited,h=i.aspectRatio;if(t){var s=Number(i.minCropBoxWidth)||0,c=Number(i.minCropBoxHeight)||0,l=r?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width,d=r?Math.min(a.height,n.height,n.height+n.top,a.height-n.top):a.height;s=Math.min(s,a.width),c=Math.min(c,a.height),h&&(s&&c?s<c*h?c=s/h:s=c*h:s?c=s/h:c&&(s=c*h),l<d*h?d=l/h:l=d*h),o.minWidth=Math.min(s,l),o.minHeight=Math.min(c,d),o.maxWidth=l,o.maxHeight=d}e&&(r?(o.minLeft=Math.max(0,n.left),o.minTop=Math.max(0,n.top),o.maxLeft=Math.min(a.width,n.left+n.width)-o.width,o.maxTop=Math.min(a.height,n.top+n.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=a.width-o.width,o.maxTop=a.height-o.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&wt(this.face,m,i.width>=e.width&&i.height>=e.height?k:D),dt(this.cropBox,ht({width:i.width,height:i.height},Et({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ct(this.element,b,this.getData())}},Xt={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");if(i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e){var r=e;"string"==typeof e?r=t.ownerDocument.querySelectorAll(e):e.querySelector&&(r=[e]),rt(this.previews=r,function(t){var e=document.createElement("img");wt(t,g,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)})}},resetPreview:function(){rt(this.previews,function(t){var e=vt(t,g);dt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(e,i){if(tt(e[i]))try{delete e[i]}catch(t){e[i]=void 0}else if(e.dataset)try{delete e.dataset[i]}catch(t){e.dataset[i]=void 0}else e.removeAttribute("data-".concat(ft(i)))}(t,g)})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,s=e.width,c=e.height,l=h.width,d=h.height,p=e.left-t.left-h.left,u=e.top-t.top-h.top;this.cropped&&!this.disabled&&(dt(this.viewBoxImage,ht({width:l,height:d},Et(ht({translateX:-p,translateY:-u},h)))),rt(this.previews,function(t){var e=vt(t,g),i=e.width,a=e.height,n=i,o=a,r=1;s&&(o=c*(r=i/s)),c&&a<o&&(n=s*(r=a/c),o=a),dt(t,{width:n,height:o}),dt(t.getElementsByTagName("img")[0],ht({width:l*r,height:d*r},Et(ht({translateX:-p*r,translateY:-u*r},h))))}))}},Rt={bind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&Mt(t,M,e.cropstart),at(e.cropmove)&&Mt(t,y,e.cropmove),at(e.cropend)&&Mt(t,x,e.cropend),at(e.crop)&&Mt(t,b,e.crop),at(e.zoom)&&Mt(t,U,e.zoom),Mt(i,S,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Mt(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Mt(i,R,this.onDblclick=this.dblclick.bind(this)),Mt(t.ownerDocument,A,this.onCropMove=this.cropMove.bind(this)),Mt(t.ownerDocument,j,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Mt(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&yt(t,M,e.cropstart),at(e.cropmove)&&yt(t,y,e.cropmove),at(e.cropend)&&yt(t,x,e.cropend),at(e.crop)&&yt(t,b,e.crop),at(e.zoom)&&yt(t,U,e.zoom),yt(i,S,this.onCropStart),e.zoomable&&e.zoomOnWheel&&yt(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&yt(i,R,this.onDblclick),yt(t.ownerDocument,A,this.onCropMove),yt(t.ownerDocument,j,this.onCropEnd),e.responsive&&yt(window,"resize",this.onResize)}},St={resize:function(){var t=this.options,e=this.container,i=this.containerData,a=Number(t.minContainerWidth)||200,n=Number(t.minContainerHeight)||100;if(!(this.disabled||i.width<=a||i.height<=n)){var o,r,h=e.offsetWidth/i.width;if(1!=h||e.offsetHeight!==i.height)t.restore&&(o=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(rt(o,function(t,e){o[e]=t*h})),this.setCropBoxData(rt(r,function(t,e){r[e]=t*h})))}},dblclick:function(){this.disabled||this.options.dragMode===w||this.setDragMode(function(t,e){return t.classList?t.classList.contains(e):-1<t.className.indexOf(e)}(this.dragBox,h)?v:f)},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?a=0<t.deltaY?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=0<t.detail?1:-1),this.zoom(-a*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(F(e)&&1!==e||F(i)&&0!==i||t.ctrlKey))){var a,n=this.options,o=this.pointers;t.changedTouches?rt(t.changedTouches,function(t){o[t.identifier]=Wt(t)}):o[t.pointerId||0]=Wt(t),a=1<Object.keys(o).length&&n.zoomable&&n.zoomOnTouch?O:vt(t.target,m),$.test(a)&&!1!==Ct(this.element,M,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===B&&(this.cropping=!0,pt(this.dragBox,c)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==Ct(this.element,y,{originalEvent:t,action:e})&&(t.changedTouches?rt(t.changedTouches,function(t){ht(i[t.identifier]||{},Wt(t,!0))}):ht(i[t.pointerId||0]||{},Wt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?rt(t.changedTouches,function(t){delete i[t.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,mt(this.dragBox,c,this.cropped&&this.options.modal)),Ct(this.element,x,{originalEvent:t,action:e}))}}},At={change:function(t){var e,i=this.options,a=this.canvasData,n=this.containerData,o=this.cropBoxData,r=this.pointers,h=this.action,s=i.aspectRatio,c=o.left,l=o.top,d=o.width,p=o.height,u=c+d,m=l+p,g=0,f=0,v=n.width,w=n.height,b=!0;!s&&t.shiftKey&&(s=d&&p?d/p:1),this.limited&&(g=o.minLeft,f=o.minTop,v=g+Math.min(n.width,a.width,a.left+a.width),w=f+Math.min(n.height,a.height,a.top+a.height));function x(t){switch(t){case T:u+M.x>v&&(M.x=v-u);break;case E:c+M.x<g&&(M.x=g-c);break;case N:l+M.y<f&&(M.y=f-l);break;case W:m+M.y>w&&(M.y=w-m)}}var y=r[Object.keys(r)[0]],M={x:y.endX-y.startX,y:y.endY-y.startY};switch(h){case D:c+=M.x,l+=M.y;break;case T:if(0<=M.x&&(v<=u||s&&(l<=f||w<=m))){b=!1;break}x(T),(d+=M.x)<0&&(h=E,c-=d=-d),s&&(p=d/s,l+=(o.height-p)/2);break;case N:if(M.y<=0&&(l<=f||s&&(c<=g||v<=u))){b=!1;break}x(N),p-=M.y,l+=M.y,p<0&&(h=W,l-=p=-p),s&&(d=p*s,c+=(o.width-d)/2);break;case E:if(M.x<=0&&(c<=g||s&&(l<=f||w<=m))){b=!1;break}x(E),d-=M.x,c+=M.x,d<0&&(h=T,c-=d=-d),s&&(p=d/s,l+=(o.height-p)/2);break;case W:if(0<=M.y&&(w<=m||s&&(c<=g||v<=u))){b=!1;break}x(W),(p+=M.y)<0&&(h=N,l-=p=-p),s&&(d=p*s,c+=(o.width-d)/2);break;case H:if(s){if(M.y<=0&&(l<=f||v<=u)){b=!1;break}x(N),p-=M.y,l+=M.y,d=p*s}else x(N),x(T),0<=M.x?u<v?d+=M.x:M.y<=0&&l<=f&&(b=!1):d+=M.x,M.y<=0?f<l&&(p-=M.y,l+=M.y):(p-=M.y,l+=M.y);d<0&&p<0?(h=Y,l-=p=-p,c-=d=-d):d<0?(h=L,c-=d=-d):p<0&&(h=z,l-=p=-p);break;case L:if(s){if(M.y<=0&&(l<=f||c<=g)){b=!1;break}x(N),p-=M.y,l+=M.y,d=p*s,c+=o.width-d}else x(N),x(E),M.x<=0?g<c?(d-=M.x,c+=M.x):M.y<=0&&l<=f&&(b=!1):(d-=M.x,c+=M.x),M.y<=0?f<l&&(p-=M.y,l+=M.y):(p-=M.y,l+=M.y);d<0&&p<0?(h=z,l-=p=-p,c-=d=-d):d<0?(h=H,c-=d=-d):p<0&&(h=Y,l-=p=-p);break;case Y:if(s){if(M.x<=0&&(c<=g||w<=m)){b=!1;break}x(E),d-=M.x,c+=M.x,p=d/s}else x(W),x(E),M.x<=0?g<c?(d-=M.x,c+=M.x):0<=M.y&&w<=m&&(b=!1):(d-=M.x,c+=M.x),0<=M.y?m<w&&(p+=M.y):p+=M.y;d<0&&p<0?(h=H,l-=p=-p,c-=d=-d):d<0?(h=z,c-=d=-d):p<0&&(h=L,l-=p=-p);break;case z:if(s){if(0<=M.x&&(v<=u||w<=m)){b=!1;break}x(T),p=(d+=M.x)/s}else x(W),x(T),0<=M.x?u<v?d+=M.x:0<=M.y&&w<=m&&(b=!1):d+=M.x,0<=M.y?m<w&&(p+=M.y):p+=M.y;d<0&&p<0?(h=L,l-=p=-p,c-=d=-d):d<0?(h=Y,c-=d=-d):p<0&&(h=H,l-=p=-p);break;case k:this.move(M.x,M.y),b=!1;break;case O:this.zoom(function(t){var e=C({},t),s=[];return rt(t,function(h,t){delete e[t],rt(e,function(t){var e=Math.abs(h.startX-t.startX),i=Math.abs(h.startY-t.startY),a=Math.abs(h.endX-t.endX),n=Math.abs(h.endY-t.endY),o=Math.sqrt(e*e+i*i),r=(Math.sqrt(a*a+n*n)-o)/o;s.push(r)})}),s.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),s[0]}(r),t),b=!1;break;case B:if(!M.x||!M.y){b=!1;break}e=Dt(this.cropper),c=y.startX-e.left,l=y.startY-e.top,d=o.minWidth,p=o.minHeight,0<M.x?h=0<M.y?z:H:M.x<0&&(c-=d,h=0<M.y?Y:L),M.y<0&&(l-=p),this.cropped||(ut(this.cropBox,X),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}b&&(o.width=d,o.height=p,o.left=c,o.top=l,this.action=h,this.renderCropBox()),rt(r,function(t){t.startX=t.endX,t.startY=t.endY})}},jt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&pt(this.dragBox,c),ut(this.cropBox,X),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=ht({},this.initialImageData),this.canvasData=ht({},this.initialCanvasData),this.cropBoxData=ht({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(ht(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ut(this.dragBox,c),pt(this.cropBox,X)),this},replace:function(e,t){var i=1<arguments.length&&void 0!==t&&t;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),i?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,rt(this.previews,function(t){t.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ut(this.cropper,s)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,pt(this.cropper,s)),this},destroy:function(){var t=this.element;return t[l]&&(t[l]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate()),this},move:function(t,e){var i=1<arguments.length&&void 0!==e?e:t,a=this.canvasData,n=a.left,o=a.top;return this.moveTo(_(t)?t:n+Number(t),_(i)?i:o+Number(i))},moveTo:function(t,e){var i=1<arguments.length&&void 0!==e?e:t,a=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(F(t)&&(a.left=t,n=!0),F(i)&&(a.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a=this.options,n=this.canvasData,o=n.width,r=n.height,h=n.naturalWidth,s=n.naturalHeight;if(0<=(t=Number(t))&&this.ready&&!this.disabled&&a.zoomable){var c=h*t,l=s*t;if(!1===Ct(this.element,U,{ratio:t,oldRatio:o/h,originalEvent:i}))return this;if(i){var d=this.pointers,p=Dt(this.cropper),u=d&&Object.keys(d).length?function(t){var a=0,n=0,o=0;return rt(t,function(t){var e=t.startX,i=t.startY;a+=e,n+=i,o+=1}),{pageX:a/=o,pageY:n/=o}}(d):{pageX:i.pageX,pageY:i.pageY};n.left-=(c-o)*((u.pageX-p.left-n.left)/o),n.top-=(l-r)*((u.pageY-p.top-n.top)/r)}else it(e)&&F(e.x)&&F(e.y)?(n.left-=(c-o)*((e.x-n.left)/o),n.top-=(l-r)*((e.y-n.top)/r)):(n.left-=(c-o)/2,n.top-=(l-r)/2);n.width=c,n.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return F(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,F(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(F(e)?e:1,t)},scale:function(t,e){var i=1<arguments.length&&void 0!==e?e:t,a=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(F(t)&&(a.scaleX=t,n=!0),F(i)&&(a.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(t){var i,e=0<arguments.length&&void 0!==t&&t,a=this.options,n=this.imageData,o=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){i={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var h=n.width/n.naturalWidth;if(rt(i,function(t,e){i[e]=t/h}),e){var s=Math.round(i.y+i.height),c=Math.round(i.x+i.width);i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=c-i.x,i.height=s-i.y}}else i={x:0,y:0,width:0,height:0};return a.rotatable&&(i.rotate=n.rotate||0),a.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(t){var e=this.options,i=this.imageData,a=this.canvasData,n={};if(this.ready&&!this.disabled&&it(t)){var o=!1;e.rotatable&&F(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,o=!0),e.scalable&&(F(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,o=!0),F(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var r=i.width/i.naturalWidth;F(t.x)&&(n.left=t.x*r+a.left),F(t.y)&&(n.top=t.y*r+a.top),F(t.width)&&(n.width=t.width*r),F(t.height)&&(n.height=t.height*r),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?ht({},this.containerData):{}},getImageData:function(){return this.sized?ht({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,i={};return this.ready&&rt(["left","top","width","height","naturalWidth","naturalHeight"],function(t){i[t]=e[t]}),i},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&it(t)&&(F(t.left)&&(e.left=t.left),F(t.top)&&(e.top=t.top),F(t.width)?(e.width=t.width,e.height=t.width/i):F(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&it(t)&&(F(t.left)&&(a.left=t.left),F(t.top)&&(a.top=t.top),F(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),F(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,a=function(t,e,i,a){var n=e.aspectRatio,o=e.naturalWidth,r=e.naturalHeight,h=e.rotate,s=void 0===h?0:h,c=e.scaleX,l=void 0===c?1:c,d=e.scaleY,p=void 0===d?1:d,u=i.aspectRatio,m=i.naturalWidth,g=i.naturalHeight,f=a.fillColor,v=void 0===f?"transparent":f,w=a.imageSmoothingEnabled,b=void 0===w||w,x=a.imageSmoothingQuality,y=void 0===x?"low":x,M=a.maxWidth,C=void 0===M?1/0:M,D=a.maxHeight,B=void 0===D?1/0:D,k=a.minWidth,O=void 0===k?0:k,T=a.minHeight,E=void 0===T?0:T,W=document.createElement("canvas"),N=W.getContext("2d"),H=Nt({aspectRatio:u,width:C,height:B}),L=Nt({aspectRatio:u,width:O,height:E},"cover"),z=Math.min(H.width,Math.max(L.width,m)),Y=Math.min(H.height,Math.max(L.height,g)),X=Nt({aspectRatio:n,width:C,height:B}),R=Nt({aspectRatio:n,width:O,height:E},"cover"),S=Math.min(X.width,Math.max(R.width,o)),A=Math.min(X.height,Math.max(R.height,r)),j=[-S/2,-A/2,S,A];return W.width=ct(z),W.height=ct(Y),N.fillStyle=v,N.fillRect(0,0,z,Y),N.save(),N.translate(z/2,Y/2),N.rotate(s*Math.PI/180),N.scale(l,p),N.imageSmoothingEnabled=b,N.imageSmoothingQuality=y,N.drawImage.apply(N,[t].concat(P(j.map(function(t){return Math.floor(ct(t))})))),N.restore(),W}(this.image,this.imageData,i,e);if(!this.cropped)return a;var n=this.getData(),o=n.x,r=n.y,h=n.width,s=n.height,c=a.width/Math.floor(i.naturalWidth);1!=c&&(o*=c,r*=c,h*=c,s*=c);var l=h/s,d=Nt({aspectRatio:l,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=Nt({aspectRatio:l,width:e.minWidth||0,height:e.minHeight||0},"cover"),u=Nt({aspectRatio:l,width:e.width||(1!=c?a.width:h),height:e.height||(1!=c?a.height:s)}),m=u.width,g=u.height;m=Math.min(d.width,Math.max(p.width,m)),g=Math.min(d.height,Math.max(p.height,g));var f=document.createElement("canvas"),v=f.getContext("2d");f.width=ct(m),f.height=ct(g),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,m,g);var w=e.imageSmoothingEnabled,b=void 0===w||w,x=e.imageSmoothingQuality;v.imageSmoothingEnabled=b,x&&(v.imageSmoothingQuality=x);var y,M,C,D,B,k,O=a.width,T=a.height,E=o,W=r;E<=-h||O<E?B=C=y=E=0:E<=0?(C=-E,E=0,B=y=Math.min(O,h+E)):E<=O&&(C=0,B=y=Math.min(h,O-E)),y<=0||W<=-s||T<W?k=D=M=W=0:W<=0?(D=-W,W=0,k=M=Math.min(T,s+W)):W<=T&&(D=0,k=M=Math.min(s,T-W));var N=[E,W,y,M];if(0<B&&0<k){var H=m/h;N.push(C*H,D*H,B*H,k*H)}return v.drawImage.apply(v,[a].concat(P(N.map(function(t){return Math.floor(ct(t))})))),f},setAspectRatio:function(t){var e=this.options;return this.disabled||_(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,a=this.face;if(this.ready&&!this.disabled){var n=t===f,o=e.movable&&t===v;t=n||o?t:w,e.dragMode=t,wt(i,m,t),mt(i,h,n),mt(i,u,o),e.cropBoxMovable||(wt(a,m,t),mt(a,h,n),mt(a,u,o))}return this}},Pt=r.Cropper,It=function(){function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),!t||!Z.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=ht({},G,it(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return function(t,e,i){e&&a(t.prototype,e),i&&a(t,i)}(i,[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[l]){if(e[l]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e=this;if(t){this.url=t,this.imageData={};var i=this.element,a=this.options;if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if(Q.test(t))K.test(t)?this.read(function(t){var e=t.replace(Lt,""),i=atob(e),a=new ArrayBuffer(i.length),n=new Uint8Array(a);return rt(n,function(t,e){n[e]=i.charCodeAt(e)}),a}(t)):this.clone();else{var n=new XMLHttpRequest,o=this.clone.bind(this);this.reloading=!0,(this.xhr=n).onabort=o,n.onerror=o,n.ontimeout=o,n.onprogress=function(){n.getResponseHeader("content-type")!==q&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&Ot(t)&&i.crossOrigin&&(t=Tt(t)),n.open("GET",t),n.responseType="arraybuffer",n.withCredentials="use-credentials"===i.crossOrigin,n.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=zt(t),n=0,o=1,r=1;if(1<a){this.url=function(t,e){for(var i=[],a=new Uint8Array(t);0<a.length;)i.push(Ht.apply(null,ot(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,q);var h=function(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:a}}(a);n=h.rotate,o=h.scaleX,r=h.scaleY}e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=o,i.scaleY=r),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e;this.options.checkCrossOrigin&&Ot(e)&&(i=i||"anonymous",a=Tt(e)),this.crossOrigin=i,this.crossOriginUrl=a;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",(this.image=n).onload=this.start.bind(this),n.onerror=this.stop.bind(this),pt(n,d),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){var i=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;function e(t,e){ht(i.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),i.sizing=!1,i.sized=!0,i.build()}var a=r.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(r.navigator.userAgent);if(!t.naturalWidth||a){var n=document.createElement("img"),o=document.body||document.documentElement;(this.sizingImage=n).onload=function(){e(n.width,n.height),a||o.removeChild(n)},n.src=t.src,a||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(n))}else e(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,i=this.image,a=t.parentNode,n=document.createElement("div");n.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var o=n.querySelector(".".concat(l,"-container")),r=o.querySelector(".".concat(l,"-canvas")),h=o.querySelector(".".concat(l,"-drag-box")),s=o.querySelector(".".concat(l,"-crop-box")),c=s.querySelector(".".concat(l,"-face"));this.container=a,this.cropper=o,this.canvas=r,this.dragBox=h,this.cropBox=s,this.viewBox=o.querySelector(".".concat(l,"-view-box")),this.face=c,r.appendChild(i),pt(t,X),a.insertBefore(o,t.nextSibling),this.isImg||ut(i,d),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,pt(s,X),e.guides||pt(s.getElementsByClassName("".concat(l,"-dashed")),X),e.center||pt(s.getElementsByClassName("".concat(l,"-center")),X),e.background&&pt(o,"".concat(l,"-bg")),e.highlight||pt(c,p),e.cropBoxMovable&&(pt(c,u),wt(c,m,D)),e.cropBoxResizable||(pt(s.getElementsByClassName("".concat(l,"-line")),X),pt(s.getElementsByClassName("".concat(l,"-point")),X)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),at(e.ready)&&Mt(t,I,e.ready,{once:!0}),Ct(t,I)}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),ut(this.element,X))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Pt,i}},{key:"setDefaults",value:function(t){ht(G,it(t)&&t)}}]),i}();return ht(It.prototype,Yt,Xt,Rt,St,At,jt),It}); \ No newline at end of file
diff --git a/library/cropperjs/docs/css/cropper.css b/library/cropperjs/docs/css/cropper.css
index dd22178fe..d54319a64 100644
--- a/library/cropperjs/docs/css/cropper.css
+++ b/library/cropperjs/docs/css/cropper.css
@@ -1,11 +1,11 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:26:29.610Z
+ * Date: 2019-10-04T04:33:44.164Z
*/
.cropper-container {
@@ -21,8 +21,7 @@
user-select: none;
}
-.cropper-container img {/*Avoid margin top issue (Occur only when margin-top <= -height)
- */
+.cropper-container img {
display: block;
height: 100%;
image-orientation: 0deg;
@@ -57,14 +56,14 @@
.cropper-modal {
background-color: #000;
- opacity: .5;
+ opacity: 0.5;
}
.cropper-view-box {
display: block;
height: 100%;
- outline-color: rgba(51, 153, 255, 0.75);
outline: 1px solid #39f;
+ outline-color: rgba(51, 153, 255, 0.75);
overflow: hidden;
width: 100%;
}
@@ -72,16 +71,16 @@
.cropper-dashed {
border: 0 dashed #eee;
display: block;
- opacity: .5;
+ opacity: 0.5;
position: absolute;
}
.cropper-dashed.dashed-h {
border-bottom-width: 1px;
border-top-width: 1px;
- height: 33.33333%;
+ height: calc(100% / 3);
left: 0;
- top: 33.33333%;
+ top: calc(100% / 3);
width: 100%;
}
@@ -89,37 +88,37 @@
border-left-width: 1px;
border-right-width: 1px;
height: 100%;
- left: 33.33333%;
+ left: calc(100% / 3);
top: 0;
- width: 33.33333%;
+ width: calc(100% / 3);
}
.cropper-center {
display: block;
height: 0;
left: 50%;
- opacity: .75;
+ opacity: 0.75;
position: absolute;
top: 50%;
width: 0;
}
-.cropper-center:before,
-.cropper-center:after {
+.cropper-center::before,
+.cropper-center::after {
background-color: #eee;
content: ' ';
display: block;
position: absolute;
}
-.cropper-center:before {
+.cropper-center::before {
height: 1px;
left: -3px;
top: 0;
width: 7px;
}
-.cropper-center:after {
+.cropper-center::after {
height: 7px;
left: 0;
top: -3px;
@@ -131,7 +130,7 @@
.cropper-point {
display: block;
height: 100%;
- opacity: .1;
+ opacity: 0.1;
position: absolute;
width: 100%;
}
@@ -177,7 +176,7 @@
.cropper-point {
background-color: #39f;
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
}
@@ -253,12 +252,12 @@
@media (min-width: 1200px) {
.cropper-point.point-se {
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
}
}
-.cropper-point.point-se:before {
+.cropper-point.point-se::before {
background-color: #39f;
bottom: -50%;
content: ' ';
@@ -303,4 +302,3 @@
.cropper-disabled .cropper-point {
cursor: not-allowed;
}
-
diff --git a/library/cropperjs/docs/css/main.css b/library/cropperjs/docs/css/main.css
index d89f82d27..79e34be55 100644
--- a/library/cropperjs/docs/css/main.css
+++ b/library/cropperjs/docs/css/main.css
@@ -1,6 +1,6 @@
.btn {
- padding-left: .75rem;
- padding-right: .75rem;
+ padding-left: 0.75rem;
+ padding-right: 0.75rem;
}
label.btn {
@@ -12,9 +12,9 @@ label.btn {
}
.carbonads {
- border-radius: .25rem;
border: 1px solid #ccc;
- font-size: .875rem;
+ border-radius: 0.25rem;
+ font-size: 0.875rem;
overflow: hidden;
padding: 1rem;
}
@@ -59,7 +59,7 @@ label.btn {
}
.footer {
- font-size: .875rem;
+ font-size: 0.875rem;
}
.heart {
@@ -92,8 +92,8 @@ label.btn {
.heart::after {
background-color: #fff;
content: "♥";
- padding-left: .5rem;
- padding-right: .5rem;
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
position: relative;
z-index: 1;
}
@@ -127,8 +127,8 @@ label.btn {
.img-preview {
float: left;
- margin-bottom: .5rem;
- margin-right: .5rem;
+ margin-bottom: 0.5rem;
+ margin-right: 0.5rem;
overflow: hidden;
}
@@ -158,7 +158,7 @@ label.btn {
}
.docs-data > .input-group {
- margin-bottom: .5rem;
+ margin-bottom: 0.5rem;
}
.docs-data .input-group-prepend .input-group-text {
@@ -172,24 +172,24 @@ label.btn {
.docs-buttons > .btn,
.docs-buttons > .btn-group,
.docs-buttons > .form-control {
- margin-bottom: .5rem;
- margin-right: .25rem;
+ margin-bottom: 0.5rem;
+ margin-right: 0.25rem;
}
.docs-toggles > .btn,
.docs-toggles > .btn-group,
.docs-toggles > .dropdown {
- margin-bottom: .5rem;
+ margin-bottom: 0.5rem;
}
.docs-tooltip {
display: block;
- margin: -.5rem -.75rem;
- padding: .5rem .75rem;
+ margin: -0.5rem -0.75rem;
+ padding: 0.5rem 0.75rem;
}
.docs-tooltip > .icon {
- margin: 0 -.25rem;
+ margin: 0 -0.25rem;
vertical-align: top;
}
@@ -203,29 +203,29 @@ label.btn {
}
.btn-toggle {
- padding: .5rem;
+ padding: 0.5rem;
}
.btn-toggle > .docs-tooltip {
- margin: -.5rem;
- padding: .5rem;
+ margin: -0.5rem;
+ padding: 0.5rem;
}
@media (max-width: 400px) {
.btn-group-crop {
- margin-right: -1rem!important;
+ margin-right: -1rem !important;
}
.btn-group-crop > .btn {
- padding-left: .5rem;
- padding-right: .5rem;
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
}
.btn-group-crop .docs-tooltip {
- margin-left: -.5rem;
- margin-right: -.5rem;
- padding-left: .5rem;
- padding-right: .5rem;
+ margin-left: -0.5rem;
+ margin-right: -0.5rem;
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
}
}
@@ -234,8 +234,8 @@ label.btn {
}
.docs-options .dropdown-menu > li {
- font-size: .875rem;
- padding: .125rem 1rem;
+ font-size: 0.875rem;
+ padding: 0.125rem 1rem;
}
.docs-options .dropdown-menu .form-check-label {
diff --git a/library/cropperjs/examples/a-range-of-aspect-ratio.html b/library/cropperjs/docs/examples/a-range-of-aspect-ratio.html
index fae5cb60b..37f414cbb 100644
--- a/library/cropperjs/examples/a-range-of-aspect-ratio.html
+++ b/library/cropperjs/docs/examples/a-range-of-aspect-ratio.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,15 +18,13 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Cropper with a range of aspect ratio</h1>
<div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
</div>
-
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
@@ -49,6 +47,7 @@
});
}
},
+
cropmove: function () {
var cropper = this.cropper;
var cropBoxData = cropper.getCropBoxData();
@@ -63,7 +62,7 @@
width: cropBoxData.height * maxAspectRatio
});
}
- }
+ },
});
});
</script>
diff --git a/library/cropperjs/docs/examples/crop-a-round-image.html b/library/cropperjs/docs/examples/crop-a-round-image.html
new file mode 100644
index 000000000..095ac2244
--- /dev/null
+++ b/library/cropperjs/docs/examples/crop-a-round-image.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>Cropper.js</title>
+ <link rel="stylesheet" href="../css/cropper.css">
+ <style>
+ .container {
+ margin: 20px auto;
+ max-width: 640px;
+ }
+
+ img {
+ max-width: 100%;
+ }
+
+ .cropper-view-box,
+ .cropper-face {
+ border-radius: 50%;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Crop a round image</h1>
+ <h3>Image</h3>
+ <div>
+ <img id="image" src="../images/picture.jpg" alt="Picture">
+ </div>
+ <h3>Result</h3>
+ <p>
+ <button type="button" id="button">Crop</button>
+ </p>
+ <div id="result"></div>
+ </div>
+ <script src="../js/cropper.js"></script>
+ <script>
+ function getRoundedCanvas(sourceCanvas) {
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ var width = sourceCanvas.width;
+ var height = sourceCanvas.height;
+
+ canvas.width = width;
+ canvas.height = height;
+ context.imageSmoothingEnabled = true;
+ context.drawImage(sourceCanvas, 0, 0, width, height);
+ context.globalCompositeOperation = 'destination-in';
+ context.beginPath();
+ context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
+ context.fill();
+ return canvas;
+ }
+
+ window.addEventListener('DOMContentLoaded', function () {
+ var image = document.getElementById('image');
+ var button = document.getElementById('button');
+ var result = document.getElementById('result');
+ var croppable = false;
+ var cropper = new Cropper(image, {
+ aspectRatio: 1,
+ viewMode: 1,
+ ready: function () {
+ croppable = true;
+ },
+ });
+
+ button.onclick = function () {
+ var croppedCanvas;
+ var roundedCanvas;
+ var roundedImage;
+
+ if (!croppable) {
+ return;
+ }
+
+ // Crop
+ croppedCanvas = cropper.getCroppedCanvas();
+
+ // Round
+ roundedCanvas = getRoundedCanvas(croppedCanvas);
+
+ // Show
+ roundedImage = document.createElement('img');
+ roundedImage.src = roundedCanvas.toDataURL()
+ result.innerHTML = '';
+ result.appendChild(roundedImage);
+ };
+ });
+ </script>
+</body>
+</html>
diff --git a/library/cropperjs/examples/crop-cross-origin-image.html b/library/cropperjs/docs/examples/crop-cross-origin-image.html
index 54f08664a..23f75bec0 100644
--- a/library/cropperjs/examples/crop-cross-origin-image.html
+++ b/library/cropperjs/docs/examples/crop-cross-origin-image.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,7 +18,6 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Crop a cross origin image</h1>
<p>A cross origin image with a <code>crossorigin</code> attribute and an available <code>Access-Control-Allow-Origin</code> response header can be cropped by Cropper.</p>
@@ -30,7 +29,7 @@
<div id="result"></div>
</div>
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
diff --git a/library/cropperjs/examples/crop-on-canvas.html b/library/cropperjs/docs/examples/crop-on-canvas.html
index 228e36f75..d4a58583c 100644
--- a/library/cropperjs/examples/crop-on-canvas.html
+++ b/library/cropperjs/docs/examples/crop-on-canvas.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,12 +18,11 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Crop on canvas with Cropper</h1>
<h3>Image</h3>
<div class="img-container">
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
<h3>Canvas</h3>
<div class="img-container">
@@ -31,7 +30,7 @@
</div>
</div>
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
function start() {
var width = this.offsetWidth;
@@ -45,7 +44,6 @@
0, 0, this.naturalWidth, this.naturalHeight,
0, 0, width, height
);
-
cropper = new Cropper(canvas);
}
diff --git a/library/cropperjs/examples/cropper-in-modal.html b/library/cropperjs/docs/examples/cropper-in-modal.html
index a9ce3e80b..f36ff4e4e 100644
--- a/library/cropperjs/examples/cropper-in-modal.html
+++ b/library/cropperjs/docs/examples/cropper-in-modal.html
@@ -5,8 +5,8 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.img-container img {
max-width: 100%;
@@ -14,7 +14,6 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Cropper in a Bootstrap modal</h1>
@@ -24,7 +23,7 @@
</button>
<!-- Modal -->
- <div class="modal fade" id="modal" role="dialog" aria-labelledby="modalLabel" tabindex="-1">
+ <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -35,20 +34,20 @@
</div>
<div class="modal-body">
<div class="img-container">
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
- <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script>
- <script src="../dist/cropper.js"></script>
+ <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.getElementById('image');
@@ -60,8 +59,7 @@
cropper = new Cropper(image, {
autoCropArea: 0.5,
ready: function () {
-
- // Strict mode: set crop box data first
+ //Should set crop box data first here
cropper.setCropBoxData(cropBoxData).setCanvasData(canvasData);
}
});
diff --git a/library/cropperjs/examples/customize-preview.html b/library/cropperjs/docs/examples/customize-preview.html
index ea1c24b88..72a108f8a 100644
--- a/library/cropperjs/examples/customize-preview.html
+++ b/library/cropperjs/docs/examples/customize-preview.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 960px;
margin: 20px auto;
+ max-width: 960px;
}
img {
@@ -43,12 +43,11 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Customize preview for Cropper</h1>
<div class="row">
<div class="col col-6">
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
<div class="col col-3">
<div class="preview"></div>
@@ -62,7 +61,7 @@
</div>
</div>
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
function each(arr, callback) {
var length = arr.length;
@@ -82,7 +81,7 @@
ready: function () {
var clone = this.cloneNode();
- clone.className = ''
+ clone.className = '';
clone.style.cssText = (
'display: block;' +
'width: 100%;' +
@@ -97,8 +96,8 @@
});
},
- crop: function (e) {
- var data = e.detail;
+ crop: function (event) {
+ var data = event.detail;
var cropper = this.cropper;
var imageData = cropper.getImageData();
var previewAspectRatio = data.width / data.height;
@@ -115,7 +114,7 @@
previewImage.style.marginLeft = -data.x / imageScaledRatio + 'px';
previewImage.style.marginTop = -data.y / imageScaledRatio + 'px';
});
- }
+ },
});
});
</script>
diff --git a/library/cropperjs/examples/fixed-crop-box.html b/library/cropperjs/docs/examples/fixed-crop-box.html
index b9f1101fb..d2f11f535 100644
--- a/library/cropperjs/examples/fixed-crop-box.html
+++ b/library/cropperjs/docs/examples/fixed-crop-box.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,15 +18,13 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Cropper with fixed crop box</h1>
<div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
</div>
-
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
diff --git a/library/cropperjs/examples/full-crop-box.html b/library/cropperjs/docs/examples/full-crop-box.html
index 7065eab94..fe0bdd8e1 100644
--- a/library/cropperjs/examples/full-crop-box.html
+++ b/library/cropperjs/docs/examples/full-crop-box.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,15 +18,13 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Cropper with full crop box</h1>
<div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
</div>
-
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
diff --git a/library/cropperjs/docs/examples/mask-an-image.html b/library/cropperjs/docs/examples/mask-an-image.html
new file mode 100644
index 000000000..9236ac451
--- /dev/null
+++ b/library/cropperjs/docs/examples/mask-an-image.html
@@ -0,0 +1,108 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>Cropper.js</title>
+ <link rel="stylesheet" href="../css/cropper.css">
+ <style>
+ .container {
+ margin: 20px auto;
+ max-width: 640px;
+ }
+
+ img {
+ max-width: 100%;
+ }
+
+ .cropper-view-box,
+ .cropper-face {
+ background-color: black;
+ opacity: 1;
+ }
+
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Mask an image (Redaction)</h1>
+ <h3>Image</h3>
+ <div>
+ <img id="image" src="../images/picture.jpg" alt="Picture">
+ </div>
+ <h3>Result</h3>
+ <p><button type="button" id="button">Mask</button></p>
+ <div id="result"></div>
+ </div>
+ <script src="../js/cropper.js"></script>
+ <script>
+ function getMaskedCanvas(sourceCanvas, sourceImage, cropper) {
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ var maskWidth = cropper.getData().width;
+ var maskHeight = cropper.getData().height;
+ var maskTop = cropper.getData().y;
+ var maskLeft = cropper.getData().x;
+ var imageWidth = cropper.getImageData().naturalWidth;
+ var imageHeight = cropper.getImageData().naturalHeight;
+ var imageLeft = cropper.getImageData().left;
+ var imageTop = cropper.getImageData().top;
+ var imageAspect = cropper.getImageData().aspectRatio;
+
+ canvas.width = imageWidth;
+ canvas.height = imageHeight;
+
+ // Debug
+ console.log('Image Width: ' + imageWidth + ' Image Height: ' + imageHeight + ' Image Aspect Ratio: ' + imageAspect );
+ console.log('Image Left: ' + imageLeft + ' Image Top: ' + imageTop );
+ console.log('Mask Width: ' + maskWidth + ' Mask Height: ' + maskHeight + ' Mask Left: ' + maskLeft + ' Mask Top: ' + maskTop);
+
+ context.imageSmoothingEnabled = true;
+ context.drawImage(image, 0, 0, imageWidth, imageHeight);
+ context.fillRect(maskLeft, maskTop, maskWidth, maskHeight);
+ return canvas;
+ }
+
+ window.addEventListener('DOMContentLoaded', function () {
+ var image = document.getElementById('image');
+ var button = document.getElementById('button');
+ var result = document.getElementById('result');
+ var croppable = false;
+ var cropper = new Cropper(image, {
+ viewMode: 0,
+ guides: true,
+ center: true,
+ highlight: true,
+ cropBoxMovable: true,
+ cropBoxResizable: true,
+ ready: function () {
+ croppable = true;
+ },
+ });
+
+ button.onclick = function () {
+ var croppedCanvas;
+ var maskedCanvas;
+ var maskedImage;
+
+ if (!croppable) {
+ return;
+ }
+
+ // Crop
+ croppedCanvas = cropper.getCroppedCanvas();
+
+ // Mask
+ maskedCanvas = getMaskedCanvas(croppedCanvas, image, cropper);
+
+ // Show
+ maskedImage = document.createElement('img');
+ maskedImage.src = maskedCanvas.toDataURL();
+ result.innerHTML = '';
+ result.appendChild(maskedImage);
+ };
+ });
+ </script>
+</body>
+</html>
diff --git a/library/cropperjs/docs/examples/minimum-and-maximum-cropped-dimensions.html b/library/cropperjs/docs/examples/minimum-and-maximum-cropped-dimensions.html
new file mode 100644
index 000000000..4c55fc327
--- /dev/null
+++ b/library/cropperjs/docs/examples/minimum-and-maximum-cropped-dimensions.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>Cropper.js</title>
+ <link rel="stylesheet" href="../css/cropper.css">
+ <style>
+ .container {
+ margin: 20px auto;
+ max-width: 640px;
+ }
+
+ img {
+ max-width: 100%;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Minimum and maximum cropped dimensions</h1>
+ <h3>Image</h3>
+ <div>
+ <img id="image" src="../images/picture.jpg" alt="Picture">
+ </div>
+ <p>Maximum Width: 640, Maximum Height: 320, Minimum Width: 320, Minimum Height: 160</p>
+ <p>Data: <span id="data"></span></p>
+ <h3>Result</h3>
+ <p>
+ <button type="button" id="button">Crop</button>
+ </p>
+ <div id="result"></div>
+ </div>
+ <script src="../js/cropper.js"></script>
+ <script>
+ window.addEventListener('DOMContentLoaded', function () {
+ var image = document.querySelector('#image');
+ var data = document.querySelector('#data');
+ var button = document.getElementById('button');
+ var result = document.getElementById('result');
+ var minCroppedWidth = 320;
+ var minCroppedHeight = 160;
+ var maxCroppedWidth = 640;
+ var maxCroppedHeight = 320;
+ var cropper = new Cropper(image, {
+ viewMode: 3,
+
+ data: {
+ width: (minCroppedWidth + maxCroppedWidth) / 2,
+ height: (minCroppedHeight + maxCroppedHeight) / 2,
+ },
+
+ crop: function (event) {
+ var width = event.detail.width;
+ var height = event.detail.height;
+
+ if (
+ width < minCroppedWidth
+ || height < minCroppedHeight
+ || width > maxCroppedWidth
+ || height > maxCroppedHeight
+ ) {
+ cropper.setData({
+ width: Math.max(minCroppedWidth, Math.min(maxCroppedWidth, width)),
+ height: Math.max(minCroppedHeight, Math.min(maxCroppedHeight, height)),
+ });
+ }
+
+ data.textContent = JSON.stringify(cropper.getData(true));
+ },
+ });
+
+ button.onclick = function () {
+ result.innerHTML = '';
+ result.appendChild(cropper.getCroppedCanvas());
+ };
+ });
+ </script>
+</body>
+</html>
diff --git a/library/cropperjs/examples/multiple-croppers.html b/library/cropperjs/docs/examples/multiple-croppers.html
index 6b12e70b2..5ccc6c32b 100644
--- a/library/cropperjs/examples/multiple-croppers.html
+++ b/library/cropperjs/docs/examples/multiple-croppers.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,20 +18,18 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Multiple Croppers</h1>
<h3>Cropper</h3>
<div>
- <img src="../docs/images/picture.jpg" alt="Picture">
+ <img src="../images/picture.jpg" alt="Picture">
</div>
<h3>Another</h3>
<div>
- <img src="../docs/images/picture.jpg" alt="Picture">
+ <img src="../images/picture.jpg" alt="Picture">
</div>
</div>
-
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var images = document.querySelectorAll('img');
diff --git a/library/cropperjs/docs/examples/one-to-one-crop-box.html b/library/cropperjs/docs/examples/one-to-one-crop-box.html
new file mode 100644
index 000000000..1012262a1
--- /dev/null
+++ b/library/cropperjs/docs/examples/one-to-one-crop-box.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>Cropper.js</title>
+ <link rel="stylesheet" href="../css/cropper.css">
+ <style>
+ .container {
+ margin: 20px auto;
+ max-width: 640px;
+ }
+
+ img {
+ max-width: 100%;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>One to one crop box</h1>
+ <p>The image displays in its natural size, so the size of the crop box size equals real cropped size.</p>
+ <h3>Image</h3>
+ <div>
+ <img id="image" src="../images/picture.jpg" alt="Picture">
+ </div>
+ <p>Data: <span id="data"></span></p>
+ <p>Crop Box Data: <span id="cropBoxData"></span></p>
+ <h3>Result</h3>
+ <p>
+ <button type="button" id="button">Crop</button>
+ </p>
+ <div id="result"></div>
+ </div>
+ <script src="../js/cropper.js"></script>
+ <script>
+ window.addEventListener('DOMContentLoaded', function () {
+ var image = document.querySelector('#image');
+ var data = document.querySelector('#data');
+ var cropBoxData = document.querySelector('#cropBoxData');
+ var button = document.getElementById('button');
+ var result = document.getElementById('result');
+ var cropper = new Cropper(image, {
+ ready: function (event) {
+ // Zoom the image to its natural size
+ cropper.zoomTo(1);
+ },
+
+ crop: function (event) {
+ data.textContent = JSON.stringify(cropper.getData());
+ cropBoxData.textContent = JSON.stringify(cropper.getCropBoxData());
+ },
+
+ zoom: function (event) {
+ // Keep the image in its natural size
+ if (event.detail.oldRatio === 1) {
+ event.preventDefault();
+ }
+ },
+ });
+
+ button.onclick = function () {
+ result.innerHTML = '';
+ result.appendChild(cropper.getCroppedCanvas());
+ };
+ });
+ </script>
+</body>
+</html>
diff --git a/library/cropperjs/examples/responsive-container.html b/library/cropperjs/docs/examples/responsive-container.html
index c1aa7483b..11f1cf7b6 100644
--- a/library/cropperjs/examples/responsive-container.html
+++ b/library/cropperjs/docs/examples/responsive-container.html
@@ -5,11 +5,11 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
+ <link rel="stylesheet" href="../css/cropper.css">
<style>
.container {
- max-width: 640px;
margin: 20px auto;
+ max-width: 640px;
}
img {
@@ -18,18 +18,16 @@
</style>
</head>
<body>
-
<div class="container">
<h1>Cropper with responsive container</h1>
<p>
<button type="button" id="replace">Replace Image</button>
</p>
<div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
+ <img id="image" src="../images/picture.jpg" alt="Picture">
</div>
</div>
-
- <script src="../dist/cropper.js"></script>
+ <script src="../js/cropper.js"></script>
<script>
window.addEventListener('DOMContentLoaded', function () {
var image = document.querySelector('#image');
@@ -41,7 +39,7 @@
});
document.getElementById('replace').onclick = function () {
- cropper.replace('../docs/images/picture-2.jpg');
+ cropper.replace('../images/picture-2.jpg');
};
});
</script>
diff --git a/library/cropperjs/docs/examples/upload-cropped-image-to-server.html b/library/cropperjs/docs/examples/upload-cropped-image-to-server.html
new file mode 100644
index 000000000..aef0ee58b
--- /dev/null
+++ b/library/cropperjs/docs/examples/upload-cropped-image-to-server.html
@@ -0,0 +1,176 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <title>Cropper.js</title>
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
+ <link rel="stylesheet" href="../css/cropper.css">
+ <style>
+ .label {
+ cursor: pointer;
+ }
+
+ .progress {
+ display: none;
+ margin-bottom: 1rem;
+ }
+
+ .alert {
+ display: none;
+ }
+
+ .img-container img {
+ max-width: 100%;
+ }
+ </style>
+</head>
+<body>
+ <div class="container">
+ <h1>Upload cropped image to server</h1>
+ <label class="label" data-toggle="tooltip" title="Change your avatar">
+ <img class="rounded" id="avatar" src="https://avatars0.githubusercontent.com/u/3456749?s=160" alt="avatar">
+ <input type="file" class="sr-only" id="input" name="image" accept="image/*">
+ </label>
+ <div class="progress">
+ <div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
+ </div>
+ <div class="alert" role="alert"></div>
+ <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title" id="modalLabel">Crop the image</h5>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ </div>
+ <div class="modal-body">
+ <div class="img-container">
+ <img id="image" src="https://avatars0.githubusercontent.com/u/3456749">
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
+ <button type="button" class="btn btn-primary" id="crop">Crop</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.bundle.min.js"></script>
+ <script src="../js/cropper.js"></script>
+ <script>
+ window.addEventListener('DOMContentLoaded', function () {
+ var avatar = document.getElementById('avatar');
+ var image = document.getElementById('image');
+ var input = document.getElementById('input');
+ var $progress = $('.progress');
+ var $progressBar = $('.progress-bar');
+ var $alert = $('.alert');
+ var $modal = $('#modal');
+ var cropper;
+
+ $('[data-toggle="tooltip"]').tooltip();
+
+ input.addEventListener('change', function (e) {
+ var files = e.target.files;
+ var done = function (url) {
+ input.value = '';
+ image.src = url;
+ $alert.hide();
+ $modal.modal('show');
+ };
+ var reader;
+ var file;
+ var url;
+
+ if (files && files.length > 0) {
+ file = files[0];
+
+ if (URL) {
+ done(URL.createObjectURL(file));
+ } else if (FileReader) {
+ reader = new FileReader();
+ reader.onload = function (e) {
+ done(reader.result);
+ };
+ reader.readAsDataURL(file);
+ }
+ }
+ });
+
+ $modal.on('shown.bs.modal', function () {
+ cropper = new Cropper(image, {
+ aspectRatio: 1,
+ viewMode: 3,
+ });
+ }).on('hidden.bs.modal', function () {
+ cropper.destroy();
+ cropper = null;
+ });
+
+ document.getElementById('crop').addEventListener('click', function () {
+ var initialAvatarURL;
+ var canvas;
+
+ $modal.modal('hide');
+
+ if (cropper) {
+ canvas = cropper.getCroppedCanvas({
+ width: 160,
+ height: 160,
+ });
+ initialAvatarURL = avatar.src;
+ avatar.src = canvas.toDataURL();
+ $progress.show();
+ $alert.removeClass('alert-success alert-warning');
+ canvas.toBlob(function (blob) {
+ var formData = new FormData();
+
+ formData.append('avatar', blob, 'avatar.jpg');
+ $.ajax('https://jsonplaceholder.typicode.com/posts', {
+ method: 'POST',
+ data: formData,
+ processData: false,
+ contentType: false,
+
+ xhr: function () {
+ var xhr = new XMLHttpRequest();
+
+ xhr.upload.onprogress = function (e) {
+ var percent = '0';
+ var percentage = '0%';
+
+ if (e.lengthComputable) {
+ percent = Math.round((e.loaded / e.total) * 100);
+ percentage = percent + '%';
+ $progressBar.width(percentage).attr('aria-valuenow', percent).text(percentage);
+ }
+ };
+
+ return xhr;
+ },
+
+ success: function () {
+ $alert.show().addClass('alert-success').text('Upload success');
+ },
+
+ error: function () {
+ avatar.src = initialAvatarURL;
+ $alert.show().addClass('alert-warning').text('Upload error');
+ },
+
+ complete: function () {
+ $progress.hide();
+ },
+ });
+ });
+ }
+ });
+ });
+ </script>
+</body>
+</html>
diff --git a/library/cropperjs/docs/index.html b/library/cropperjs/docs/index.html
index 7c3354cb1..fa8aaf6dd 100644
--- a/library/cropperjs/docs/index.html
+++ b/library/cropperjs/docs/index.html
@@ -5,11 +5,10 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="JavaScript image cropper.">
- <meta name="keywords" content="HTML, CSS, JS, JavaScript, image cropping, cropper, cropperjs, cropper.js, front-end, web development">
<meta name="author" content="Chen Fengyuan">
<title>Cropper.js</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css">
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="css/cropper.css">
<link rel="stylesheet" href="css/main.css">
</head>
@@ -31,13 +30,47 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbar-collapse" role="navigation">
- <nav class="nav navbar-nav">
- <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/blob/master/README.md" data-toggle="tooltip" title="View the documentation">Docs</a>
- <a class="nav-link" href="https://fengyuanchen.github.io/photo-editor" data-toggle="tooltip" title="An advanced example of Cropper.js">Photo Editor</a>
- <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs" data-toggle="tooltip" title="View the GitHub project">GitHub</a>
- <a class="nav-link" href="https://fengyuanchen.github.io" data-toggle="tooltip" title="More projects">More</a>
- <a class="nav-link" href="http://chenfengyuan.com" data-toggle="tooltip" title="About the author">About</a>
- </nav>
+ <ul class="nav navbar-nav">
+ <li class="nav-item">
+ <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/blob/master/README.md" data-toggle="tooltip" title="View the documentation">Docs</a>
+ </li>
+ <li class="nav-item dropdown">
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Examples
+ </a>
+ <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
+ <a class="dropdown-item" href="examples/a-range-of-aspect-ratio.html">Cropper with a range of aspect ratio</a>
+ <a class="dropdown-item" href="examples/crop-a-round-image.html">Crop a round image</a>
+ <a class="dropdown-item" href="examples/crop-cross-origin-image.html">Crop cross origin image</a>
+ <a class="dropdown-item" href="examples/crop-on-canvas.html">Crop on canvas</a>
+ <a class="dropdown-item" href="examples/cropper-in-modal.html">Cropper in modal</a>
+ <a class="dropdown-item" href="examples/customize-preview.html">Customize preview</a>
+ <a class="dropdown-item" href="examples/fixed-crop-box.html">Fixed crop box</a>
+ <a class="dropdown-item" href="examples/full-crop-box.html">Full crop box</a>
+ <a class="dropdown-item" href="examples/mask-an-image.html">Mask an image</a>
+ <a class="dropdown-item" href="examples/minimum-and-maximum-cropped-dimensions.html">Minimum and maximum cropped dimensions</a>
+ <a class="dropdown-item" href="examples/multiple-croppers.html">Multiple croppers</a>
+ <a class="dropdown-item" href="examples/one-to-one-crop-box.html">One to one crop box</a>
+ <a class="dropdown-item" href="examples/responsive-container.html">Responsive container</a>
+ <a class="dropdown-item" href="examples/upload-cropped-image-to-server.html">Upload cropped image to server</a>
+ </div>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="https://fengyuanchen.github.io/photo-editor" data-toggle="tooltip" title="An advanced example of Cropper.js">Photo Editor</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs" data-toggle="tooltip" title="View the GitHub project">GitHub</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="https://fengyuanchen.github.io" data-toggle="tooltip" title="Explore more projects">Explore</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link" href="https://chenfengyuan.com" data-toggle="tooltip" title="About the author">About</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link text-warning" href="https://fengyuanchen.github.io/cropper.js/" data-toggle="tooltip" title="View the next version">v2.0 (Alpha)</a>
+ </li>
+ </ul>
</div>
</nav>
</header>
@@ -47,12 +80,12 @@
<div class="container">
<div class="row">
<div class="col-md">
- <h1>Cropper.js <small class="h6">v1.2.2</small></h1>
+ <h1>Cropper.js <small class="h6">v1.5.6</small></h1>
<p class="lead">JavaScript image cropper.</p>
</div>
<div class="col-md">
<div class="carbonads">
- <script id="_carbonads_js" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=fengyuanchen" async></script>
+ <script id="_carbonads_js" src="https://cdn.carbonads.com/carbon.js?serve=CKYI55Q7&placement=fengyuanchengithubio" async></script>
</div>
</div>
</div>
@@ -78,7 +111,6 @@
</div>
<!-- <h3>Data:</h3> -->
- <!-- <h3>Data:</h3> -->
<div class="docs-data">
<div class="input-group input-group-sm">
<span class="input-group-prepend">
@@ -146,12 +178,12 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" data-method="setDragMode" data-option="move" title="Move">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.setDragMode(&quot;move&quot;)">
- <span class="fa fa-arrows"></span>
+ <span class="fa fa-arrows-alt"></span>
</span>
</button>
<button type="button" class="btn btn-primary" data-method="setDragMode" data-option="crop" title="Crop">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.setDragMode(&quot;crop&quot;)">
- <span class="fa fa-crop"></span>
+ <span class="fa fa-crop-alt"></span>
</span>
</button>
</div>
@@ -195,12 +227,12 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" data-method="rotate" data-option="-45" title="Rotate Left">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.rotate(-45)">
- <span class="fa fa-rotate-left"></span>
+ <span class="fa fa-undo-alt"></span>
</span>
</button>
<button type="button" class="btn btn-primary" data-method="rotate" data-option="45" title="Rotate Right">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.rotate(45)">
- <span class="fa fa-rotate-right"></span>
+ <span class="fa fa-redo-alt"></span>
</span>
</button>
</div>
@@ -208,12 +240,12 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" data-method="scaleX" data-option="-1" title="Flip Horizontal">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.scaleX(-1)">
- <span class="fa fa-arrows-h"></span>
+ <span class="fa fa-arrows-alt-h"></span>
</span>
</button>
<button type="button" class="btn btn-primary" data-method="scaleY" data-option="-1" title="Flip Vertical">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.scaleY(-1)">
- <span class="fa fa-arrows-v"></span>
+ <span class="fa fa-arrows-alt-v"></span>
</span>
</button>
</div>
@@ -226,7 +258,7 @@
</button>
<button type="button" class="btn btn-primary" data-method="clear" title="Clear">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.clear()">
- <span class="fa fa-remove"></span>
+ <span class="fa fa-times"></span>
</span>
</button>
</div>
@@ -247,11 +279,11 @@
<div class="btn-group">
<button type="button" class="btn btn-primary" data-method="reset" title="Reset">
<span class="docs-tooltip" data-toggle="tooltip" title="cropper.reset()">
- <span class="fa fa-refresh"></span>
+ <span class="fa fa-sync-alt"></span>
</span>
</button>
<label class="btn btn-primary btn-upload" for="inputImage" title="Upload image file">
- <input type="file" class="sr-only" id="inputImage" name="file" accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff">
+ <input type="file" class="sr-only" id="inputImage" name="file" accept="image/*">
<span class="docs-tooltip" data-toggle="tooltip" title="Import image with Blob URLs">
<span class="fa fa-upload"></span>
</span>
@@ -293,7 +325,7 @@
</div>
<div class="modal-body"></div>
<div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<a class="btn btn-primary" id="download" href="javascript:void(0);" download="cropped.jpg">Download</a>
</div>
</div>
@@ -360,7 +392,7 @@
Scale (-2, -1)
</span>
</button>
- <textarea class="form-control" id="putData" rows="1" placeholder="Get data to here or set data with this value"></textarea>
+ <textarea class="form-control" id="putData" placeholder="Get data to here or set data with this value"></textarea>
</div><!-- /.docs-buttons -->
@@ -561,17 +593,17 @@
<p class="heart"></p>
<nav class="nav flex-wrap justify-content-center mb-3">
<a class="nav-link" href="https://github.com/fengyuanchen/cropperjs">GitHub</a>
- <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/tree/master/examples">Examples</a>
+ <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/releases">Releases</a>
<a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/blob/master/LICENSE">License</a>
- <a class="nav-link" href="http://chenfengyuan.com">About</a>
+ <a class="nav-link" href="https://chenfengyuan.com">About</a>
</nav>
</div>
</footer>
<!-- Scripts -->
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.bundle.min.js"></script>
- <script src="https://fengyuanchen.github.io/js/common.js"></script>
+ <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
+ <script src="https://fengyuanchen.github.io/shared/google-analytics.js"></script>
<script src="js/cropper.js"></script>
<script src="js/main.js"></script>
</body>
diff --git a/library/cropperjs/docs/js/cropper.js b/library/cropperjs/docs/js/cropper.js
index 0e837953c..5c49d7bdf 100644
--- a/library/cropperjs/docs/js/cropper.js
+++ b/library/cropperjs/docs/js/cropper.js
@@ -1,198 +1,40 @@
/*!
- * Cropper.js v1.2.2
- * https://github.com/fengyuanchen/cropperjs
+ * Cropper.js v1.5.6
+ * https://fengyuanchen.github.io/cropperjs
*
- * Copyright (c) 2015-2018 Chen Fengyuan
+ * Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
- * Date: 2018-01-03T13:27:18.062Z
+ * Date: 2019-10-04T04:33:48.372Z
*/
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Cropper = factory());
-}(this, (function () { 'use strict';
-
-var WINDOW = typeof window !== 'undefined' ? window : {};
-var NAMESPACE = 'cropper';
-
-// Actions
-var ACTION_ALL = 'all';
-var ACTION_CROP = 'crop';
-var ACTION_MOVE = 'move';
-var ACTION_ZOOM = 'zoom';
-var ACTION_EAST = 'e';
-var ACTION_WEST = 'w';
-var ACTION_SOUTH = 's';
-var ACTION_NORTH = 'n';
-var ACTION_NORTH_EAST = 'ne';
-var ACTION_NORTH_WEST = 'nw';
-var ACTION_SOUTH_EAST = 'se';
-var ACTION_SOUTH_WEST = 'sw';
-
-// Classes
-var CLASS_CROP = NAMESPACE + '-crop';
-var CLASS_DISABLED = NAMESPACE + '-disabled';
-var CLASS_HIDDEN = NAMESPACE + '-hidden';
-var CLASS_HIDE = NAMESPACE + '-hide';
-var CLASS_INVISIBLE = NAMESPACE + '-invisible';
-var CLASS_MODAL = NAMESPACE + '-modal';
-var CLASS_MOVE = NAMESPACE + '-move';
-
-// Data keys
-var DATA_ACTION = 'action';
-var DATA_PREVIEW = 'preview';
-
-// Drag modes
-var DRAG_MODE_CROP = 'crop';
-var DRAG_MODE_MOVE = 'move';
-var DRAG_MODE_NONE = 'none';
-
-// Events
-var EVENT_CROP = 'crop';
-var EVENT_CROP_END = 'cropend';
-var EVENT_CROP_MOVE = 'cropmove';
-var EVENT_CROP_START = 'cropstart';
-var EVENT_DBLCLICK = 'dblclick';
-var EVENT_ERROR = 'error';
-var EVENT_LOAD = 'load';
-var EVENT_POINTER_DOWN = WINDOW.PointerEvent ? 'pointerdown' : 'touchstart mousedown';
-var EVENT_POINTER_MOVE = WINDOW.PointerEvent ? 'pointermove' : 'touchmove mousemove';
-var EVENT_POINTER_UP = WINDOW.PointerEvent ? 'pointerup pointercancel' : 'touchend touchcancel mouseup';
-var EVENT_READY = 'ready';
-var EVENT_RESIZE = 'resize';
-var EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
-var EVENT_ZOOM = 'zoom';
-
-// RegExps
-var REGEXP_ACTIONS = /^(e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
-var REGEXP_DATA_URL = /^data:/;
-var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
-var REGEXP_TAG_NAME = /^(img|canvas)$/i;
-
-var DEFAULTS = {
- // Define the view mode of the cropper
- viewMode: 0, // 0, 1, 2, 3
-
- // Define the dragging mode of the cropper
- dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none'
-
- // Define the aspect ratio of the crop box
- aspectRatio: NaN,
-
- // An object with the previous cropping result data
- data: null,
-
- // A selector for adding extra containers to preview
- preview: '',
-
- // Re-render the cropper when resize the window
- responsive: true,
-
- // Restore the cropped area after resize the window
- restore: true,
-
- // Check if the current image is a cross-origin image
- checkCrossOrigin: true,
-
- // Check the current image's Exif Orientation information
- checkOrientation: true,
-
- // Show the black modal
- modal: true,
-
- // Show the dashed lines for guiding
- guides: true,
-
- // Show the center indicator for guiding
- center: true,
-
- // Show the white modal to highlight the crop box
- highlight: true,
-
- // Show the grid background
- background: true,
-
- // Enable to crop the image automatically when initialize
- autoCrop: true,
-
- // Define the percentage of automatic cropping area when initializes
- autoCropArea: 0.8,
-
- // Enable to move the image
- movable: true,
-
- // Enable to rotate the image
- rotatable: true,
-
- // Enable to scale the image
- scalable: true,
-
- // Enable to zoom the image
- zoomable: true,
-
- // Enable to zoom the image by dragging touch
- zoomOnTouch: true,
-
- // Enable to zoom the image by wheeling mouse
- zoomOnWheel: true,
-
- // Define zoom ratio when zoom the image by wheeling mouse
- wheelZoomRatio: 0.1,
-
- // Enable to move the crop box
- cropBoxMovable: true,
-
- // Enable to resize the crop box
- cropBoxResizable: true,
-
- // Toggle drag mode between "crop" and "move" when click twice on the cropper
- toggleDragModeOnDblclick: true,
-
- // Size limitation
- minCanvasWidth: 0,
- minCanvasHeight: 0,
- minCropBoxWidth: 0,
- minCropBoxHeight: 0,
- minContainerWidth: 200,
- minContainerHeight: 100,
-
- // Shortcuts of events
- ready: null,
- cropstart: null,
- cropmove: null,
- cropend: null,
- crop: null,
- zoom: null
-};
-
-var TEMPLATE = '<div class="cropper-container">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-action="e"></span>' + '<span class="cropper-line line-n" data-action="n"></span>' + '<span class="cropper-line line-w" data-action="w"></span>' + '<span class="cropper-line line-s" data-action="s"></span>' + '<span class="cropper-point point-e" data-action="e"></span>' + '<span class="cropper-point point-n" data-action="n"></span>' + '<span class="cropper-point point-w" data-action="w"></span>' + '<span class="cropper-point point-s" data-action="s"></span>' + '<span class="cropper-point point-ne" data-action="ne"></span>' + '<span class="cropper-point point-nw" data-action="nw"></span>' + '<span class="cropper-point point-sw" data-action="sw"></span>' + '<span class="cropper-point point-se" data-action="se"></span>' + '</div>' + '</div>';
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-
-
-
-
-
-
-
-
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = global || self, global.Cropper = factory());
+}(this, function () { 'use strict';
+
+ function _typeof(obj) {
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
+ _typeof = function (obj) {
+ return typeof obj;
+ };
+ } else {
+ _typeof = function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+ }
+ return _typeof(obj);
+ }
-var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
}
-};
-var createClass = function () {
- function defineProperties(target, props) {
+ function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
@@ -202,2324 +44,2403 @@ var createClass = function () {
}
}
- return function (Constructor, protoProps, staticProps) {
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
- if (staticProps) defineProperties(Constructor, staticProps);
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
- };
-}();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ }
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+ }
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+ }
+ function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ ownKeys(source, true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(source).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+ return target;
+ }
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) {
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+ return arr2;
+ }
+ }
+ function _iterableToArray(iter) {
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
+ }
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
+ }
+ var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+ var WINDOW = IS_BROWSER ? window : {};
+ var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+ var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
+ var NAMESPACE = 'cropper'; // Actions
+
+ var ACTION_ALL = 'all';
+ var ACTION_CROP = 'crop';
+ var ACTION_MOVE = 'move';
+ var ACTION_ZOOM = 'zoom';
+ var ACTION_EAST = 'e';
+ var ACTION_WEST = 'w';
+ var ACTION_SOUTH = 's';
+ var ACTION_NORTH = 'n';
+ var ACTION_NORTH_EAST = 'ne';
+ var ACTION_NORTH_WEST = 'nw';
+ var ACTION_SOUTH_EAST = 'se';
+ var ACTION_SOUTH_WEST = 'sw'; // Classes
+
+ var CLASS_CROP = "".concat(NAMESPACE, "-crop");
+ var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
+ var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
+ var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
+ var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
+ var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
+ var CLASS_MOVE = "".concat(NAMESPACE, "-move"); // Data keys
+
+ var DATA_ACTION = "".concat(NAMESPACE, "Action");
+ var DATA_PREVIEW = "".concat(NAMESPACE, "Preview"); // Drag modes
+
+ var DRAG_MODE_CROP = 'crop';
+ var DRAG_MODE_MOVE = 'move';
+ var DRAG_MODE_NONE = 'none'; // Events
+
+ var EVENT_CROP = 'crop';
+ var EVENT_CROP_END = 'cropend';
+ var EVENT_CROP_MOVE = 'cropmove';
+ var EVENT_CROP_START = 'cropstart';
+ var EVENT_DBLCLICK = 'dblclick';
+ var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+ var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+ var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+ var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+ var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+ var EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
+ var EVENT_READY = 'ready';
+ var EVENT_RESIZE = 'resize';
+ var EVENT_WHEEL = 'wheel';
+ var EVENT_ZOOM = 'zoom'; // Mime types
+
+ var MIME_TYPE_JPEG = 'image/jpeg'; // RegExps
+
+ var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
+ var REGEXP_DATA_URL = /^data:/;
+ var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
+ var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc
+ // Inspired by the default width and height of a canvas element.
+
+ var MIN_CONTAINER_WIDTH = 200;
+ var MIN_CONTAINER_HEIGHT = 100;
+
+ var DEFAULTS = {
+ // Define the view mode of the cropper
+ viewMode: 0,
+ // 0, 1, 2, 3
+ // Define the dragging mode of the cropper
+ dragMode: DRAG_MODE_CROP,
+ // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
+ // Define the aspect ratio of the crop box
+ aspectRatio: NaN,
+ // An object with the previous cropping result data
+ data: null,
+ // A selector for adding extra containers to preview
+ preview: '',
+ // Re-render the cropper when resize the window
+ responsive: true,
+ // Restore the cropped area after resize the window
+ restore: true,
+ // Check if the current image is a cross-origin image
+ checkCrossOrigin: true,
+ // Check the current image's Exif Orientation information
+ checkOrientation: true,
+ // Show the black modal
+ modal: true,
+ // Show the dashed lines for guiding
+ guides: true,
+ // Show the center indicator for guiding
+ center: true,
+ // Show the white modal to highlight the crop box
+ highlight: true,
+ // Show the grid background
+ background: true,
+ // Enable to crop the image automatically when initialize
+ autoCrop: true,
+ // Define the percentage of automatic cropping area when initializes
+ autoCropArea: 0.8,
+ // Enable to move the image
+ movable: true,
+ // Enable to rotate the image
+ rotatable: true,
+ // Enable to scale the image
+ scalable: true,
+ // Enable to zoom the image
+ zoomable: true,
+ // Enable to zoom the image by dragging touch
+ zoomOnTouch: true,
+ // Enable to zoom the image by wheeling mouse
+ zoomOnWheel: true,
+ // Define zoom ratio when zoom the image by wheeling mouse
+ wheelZoomRatio: 0.1,
+ // Enable to move the crop box
+ cropBoxMovable: true,
+ // Enable to resize the crop box
+ cropBoxResizable: true,
+ // Toggle drag mode between "crop" and "move" when click twice on the cropper
+ toggleDragModeOnDblclick: true,
+ // Size limitation
+ minCanvasWidth: 0,
+ minCanvasHeight: 0,
+ minCropBoxWidth: 0,
+ minCropBoxHeight: 0,
+ minContainerWidth: 200,
+ minContainerHeight: 100,
+ // Shortcuts of events
+ ready: null,
+ cropstart: null,
+ cropmove: null,
+ cropend: null,
+ crop: null,
+ zoom: null
+ };
+ var TEMPLATE = '<div class="cropper-container" touch-action="none">' + '<div class="cropper-wrap-box">' + '<div class="cropper-canvas"></div>' + '</div>' + '<div class="cropper-drag-box"></div>' + '<div class="cropper-crop-box">' + '<span class="cropper-view-box"></span>' + '<span class="cropper-dashed dashed-h"></span>' + '<span class="cropper-dashed dashed-v"></span>' + '<span class="cropper-center"></span>' + '<span class="cropper-face"></span>' + '<span class="cropper-line line-e" data-cropper-action="e"></span>' + '<span class="cropper-line line-n" data-cropper-action="n"></span>' + '<span class="cropper-line line-w" data-cropper-action="w"></span>' + '<span class="cropper-line line-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-e" data-cropper-action="e"></span>' + '<span class="cropper-point point-n" data-cropper-action="n"></span>' + '<span class="cropper-point point-w" data-cropper-action="w"></span>' + '<span class="cropper-point point-s" data-cropper-action="s"></span>' + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>' + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>' + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>' + '<span class="cropper-point point-se" data-cropper-action="se"></span>' + '</div>' + '</div>';
+ /**
+ * Check if the given value is not a number.
+ */
+ var isNaN = Number.isNaN || WINDOW.isNaN;
+ /**
+ * Check if the given value is a number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a number, else `false`.
+ */
+ function isNumber(value) {
+ return typeof value === 'number' && !isNaN(value);
+ }
+ /**
+ * Check if the given value is a positive number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
+ */
-var toConsumableArray = function (arr) {
- if (Array.isArray(arr)) {
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
+ var isPositiveNumber = function isPositiveNumber(value) {
+ return value > 0 && value < Infinity;
+ };
+ /**
+ * Check if the given value is undefined.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
+ */
- return arr2;
- } else {
- return Array.from(arr);
+ function isUndefined(value) {
+ return typeof value === 'undefined';
}
-};
-
-/**
- * Check if the given value is not a number.
- */
-var isNaN = Number.isNaN || WINDOW.isNaN;
+ /**
+ * Check if the given value is an object.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is an object, else `false`.
+ */
-/**
- * Check if the given value is a number.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a number, else `false`.
- */
-function isNumber(value) {
- return typeof value === 'number' && !isNaN(value);
-}
-
-/**
- * Check if the given value is undefined.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is undefined, else `false`.
- */
-function isUndefined(value) {
- return typeof value === 'undefined';
-}
-
-/**
- * Check if the given value is an object.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is an object, else `false`.
- */
-function isObject(value) {
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null;
-}
+ function isObject(value) {
+ return _typeof(value) === 'object' && value !== null;
+ }
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ /**
+ * Check if the given value is a plain object.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
+ */
-var hasOwnProperty = Object.prototype.hasOwnProperty;
+ function isPlainObject(value) {
+ if (!isObject(value)) {
+ return false;
+ }
-/**
- * Check if the given value is a plain object.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a plain object, else `false`.
- */
+ try {
+ var _constructor = value.constructor;
+ var prototype = _constructor.prototype;
+ return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
+ } catch (error) {
+ return false;
+ }
+ }
+ /**
+ * Check if the given value is a function.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a function, else `false`.
+ */
-function isPlainObject(value) {
- if (!isObject(value)) {
- return false;
+ function isFunction(value) {
+ return typeof value === 'function';
}
+ var slice = Array.prototype.slice;
+ /**
+ * Convert array-like or iterable object to an array.
+ * @param {*} value - The value to convert.
+ * @returns {Array} Returns a new array.
+ */
- try {
- var _constructor = value.constructor;
- var prototype = _constructor.prototype;
+ function toArray(value) {
+ return Array.from ? Array.from(value) : slice.call(value);
+ }
+ /**
+ * Iterate the given data.
+ * @param {*} data - The data to iterate.
+ * @param {Function} callback - The process function for each element.
+ * @returns {*} The original data.
+ */
+ function forEach(data, callback) {
+ if (data && isFunction(callback)) {
+ if (Array.isArray(data) || isNumber(data.length)
+ /* array-like */
+ ) {
+ toArray(data).forEach(function (value, key) {
+ callback.call(data, value, key, data);
+ });
+ } else if (isObject(data)) {
+ Object.keys(data).forEach(function (key) {
+ callback.call(data, data[key], key, data);
+ });
+ }
+ }
- return _constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
- } catch (e) {
- return false;
+ return data;
}
-}
-
-/**
- * Check if the given value is a function.
- * @param {*} value - The value to check.
- * @returns {boolean} Returns `true` if the given value is a function, else `false`.
- */
-function isFunction(value) {
- return typeof value === 'function';
-}
-
-/**
- * Iterate the given data.
- * @param {*} data - The data to iterate.
- * @param {Function} callback - The process function for each element.
- * @returns {*} The original data.
- */
-function each(data, callback) {
- if (data && isFunction(callback)) {
- if (Array.isArray(data) || isNumber(data.length) /* array-like */) {
- var length = data.length;
+ /**
+ * Extend the given object.
+ * @param {*} target - The target object to extend.
+ * @param {*} args - The rest objects for merging to the target object.
+ * @returns {Object} The extended object.
+ */
- var i = void 0;
+ var assign = Object.assign || function assign(target) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
- for (i = 0; i < length; i += 1) {
- if (callback.call(data, data[i], i, data) === false) {
- break;
- }
+ if (isObject(target) && args.length > 0) {
+ args.forEach(function (arg) {
+ if (isObject(arg)) {
+ Object.keys(arg).forEach(function (key) {
+ target[key] = arg[key];
+ });
}
- } else if (isObject(data)) {
- Object.keys(data).forEach(function (key) {
- callback.call(data, data[key], key, data);
});
}
- }
- return data;
-}
+ return target;
+ };
+ var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
+ /**
+ * Normalize decimal number.
+ * Check out {@link http://0.30000000000000004.com/}
+ * @param {number} value - The value to normalize.
+ * @param {number} [times=100000000000] - The times for normalizing.
+ * @returns {number} Returns the normalized number.
+ */
-/**
- * Extend the given object.
- * @param {*} obj - The object to be extended.
- * @param {*} args - The rest objects which will be merged to the first object.
- * @returns {Object} The extended object.
- */
-function extend(obj) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
+ function normalizeDecimalNumber(value) {
+ var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
+ return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
+ var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
+ /**
+ * Apply styles to the given element.
+ * @param {Element} element - The target element.
+ * @param {Object} styles - The styles for applying.
+ */
- if (isObject(obj) && args.length > 0) {
- if (Object.assign) {
- return Object.assign.apply(Object, [obj].concat(args));
- }
-
- args.forEach(function (arg) {
- if (isObject(arg)) {
- Object.keys(arg).forEach(function (key) {
- obj[key] = arg[key];
- });
+ function setStyle(element, styles) {
+ var style = element.style;
+ forEach(styles, function (value, property) {
+ if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
+ value = "".concat(value, "px");
}
+
+ style[property] = value;
});
}
+ /**
+ * Check if the given element has a special class.
+ * @param {Element} element - The element to check.
+ * @param {string} value - The class to search.
+ * @returns {boolean} Returns `true` if the special class was found.
+ */
- return obj;
-}
-
-/**
- * Takes a function and returns a new one that will always have a particular context.
- * @param {Function} fn - The target function.
- * @param {Object} context - The new context for the function.
- * @returns {boolean} The new function.
- */
-function proxy(fn, context) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
+ function hasClass(element, value) {
+ return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
}
+ /**
+ * Add classes to the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be added.
+ */
- return function () {
- for (var _len3 = arguments.length, args2 = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args2[_key3] = arguments[_key3];
+ function addClass(element, value) {
+ if (!value) {
+ return;
}
- return fn.apply(context, args.concat(args2));
- };
-}
-
-var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/i;
-
-/**
- * Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/ }
- * @param {number} value - The value to normalize.
- * @param {number} [times=100000000000] - The times for normalizing.
- * @returns {number} Returns the normalized number.
- */
-function normalizeDecimalNumber(value) {
- var times = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100000000000;
-
- return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
-}
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ addClass(elem, value);
+ });
+ return;
+ }
-var REGEXP_SUFFIX = /^(width|height|left|top|marginLeft|marginTop)$/;
+ if (element.classList) {
+ element.classList.add(value);
+ return;
+ }
-/**
- * Apply styles to the given element.
- * @param {Element} element - The target element.
- * @param {Object} styles - The styles for applying.
- */
-function setStyle(element, styles) {
- var style = element.style;
+ var className = element.className.trim();
+ if (!className) {
+ element.className = value;
+ } else if (className.indexOf(value) < 0) {
+ element.className = "".concat(className, " ").concat(value);
+ }
+ }
+ /**
+ * Remove classes from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be removed.
+ */
- each(styles, function (value, property) {
- if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
- value += 'px';
+ function removeClass(element, value) {
+ if (!value) {
+ return;
}
- style[property] = value;
- });
-}
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ removeClass(elem, value);
+ });
+ return;
+ }
-/**
- * Check if the given element has a special class.
- * @param {Element} element - The element to check.
- * @param {string} value - The class to search.
- * @returns {boolean} Returns `true` if the special class was found.
- */
-function hasClass(element, value) {
- return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
-}
-
-/**
- * Add classes to the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be added.
- */
-function addClass(element, value) {
- if (!value) {
- return;
- }
+ if (element.classList) {
+ element.classList.remove(value);
+ return;
+ }
- if (isNumber(element.length)) {
- each(element, function (elem) {
- addClass(elem, value);
- });
- return;
+ if (element.className.indexOf(value) >= 0) {
+ element.className = element.className.replace(value, '');
+ }
}
+ /**
+ * Add or remove classes from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} value - The classes to be toggled.
+ * @param {boolean} added - Add only.
+ */
- if (element.classList) {
- element.classList.add(value);
- return;
- }
+ function toggleClass(element, value, added) {
+ if (!value) {
+ return;
+ }
- var className = element.className.trim();
+ if (isNumber(element.length)) {
+ forEach(element, function (elem) {
+ toggleClass(elem, value, added);
+ });
+ return;
+ } // IE10-11 doesn't support the second parameter of `classList.toggle`
- if (!className) {
- element.className = value;
- } else if (className.indexOf(value) < 0) {
- element.className = className + ' ' + value;
- }
-}
-/**
- * Remove classes from the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be removed.
- */
-function removeClass(element, value) {
- if (!value) {
- return;
+ if (added) {
+ addClass(element, value);
+ } else {
+ removeClass(element, value);
+ }
}
+ var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
+ /**
+ * Transform the given string from camelCase to kebab-case
+ * @param {string} value - The value to transform.
+ * @returns {string} The transformed value.
+ */
- if (isNumber(element.length)) {
- each(element, function (elem) {
- removeClass(elem, value);
- });
- return;
+ function toParamCase(value) {
+ return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();
}
+ /**
+ * Get data from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to get.
+ * @returns {string} The data value.
+ */
- if (element.classList) {
- element.classList.remove(value);
- return;
- }
+ function getData(element, name) {
+ if (isObject(element[name])) {
+ return element[name];
+ }
- if (element.className.indexOf(value) >= 0) {
- element.className = element.className.replace(value, '');
- }
-}
+ if (element.dataset) {
+ return element.dataset[name];
+ }
-/**
- * Add or remove classes from the given element.
- * @param {Element} element - The target element.
- * @param {string} value - The classes to be toggled.
- * @param {boolean} added - Add only.
- */
-function toggleClass(element, value, added) {
- if (!value) {
- return;
+ return element.getAttribute("data-".concat(toParamCase(name)));
}
+ /**
+ * Set data to the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to set.
+ * @param {string} data - The data value.
+ */
- if (isNumber(element.length)) {
- each(element, function (elem) {
- toggleClass(elem, value, added);
- });
- return;
+ function setData(element, name, data) {
+ if (isObject(data)) {
+ element[name] = data;
+ } else if (element.dataset) {
+ element.dataset[name] = data;
+ } else {
+ element.setAttribute("data-".concat(toParamCase(name)), data);
+ }
}
+ /**
+ * Remove data from the given element.
+ * @param {Element} element - The target element.
+ * @param {string} name - The data key to remove.
+ */
- // IE10-11 doesn't support the second parameter of `classList.toggle`
- if (added) {
- addClass(element, value);
- } else {
- removeClass(element, value);
+ function removeData(element, name) {
+ if (isObject(element[name])) {
+ try {
+ delete element[name];
+ } catch (error) {
+ element[name] = undefined;
+ }
+ } else if (element.dataset) {
+ // #128 Safari not allows to delete dataset property
+ try {
+ delete element.dataset[name];
+ } catch (error) {
+ element.dataset[name] = undefined;
+ }
+ } else {
+ element.removeAttribute("data-".concat(toParamCase(name)));
+ }
}
-}
+ var REGEXP_SPACES = /\s\s*/;
-var REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
+ var onceSupported = function () {
+ var supported = false;
-/**
- * Hyphenate the given value.
- * @param {string} value - The value to hyphenate.
- * @returns {string} The hyphenated value.
- */
-function hyphenate(value) {
- return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
-}
-
-/**
- * Get data from the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to get.
- * @returns {string} The data value.
- */
-function getData(element, name) {
- if (isObject(element[name])) {
- return element[name];
- } else if (element.dataset) {
- return element.dataset[name];
- }
+ if (IS_BROWSER) {
+ var once = false;
- return element.getAttribute('data-' + hyphenate(name));
-}
+ var listener = function listener() {};
-/**
- * Set data to the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to set.
- * @param {string} data - The data value.
- */
-function setData(element, name, data) {
- if (isObject(data)) {
- element[name] = data;
- } else if (element.dataset) {
- element.dataset[name] = data;
- } else {
- element.setAttribute('data-' + hyphenate(name), data);
- }
-}
+ var options = Object.defineProperty({}, 'once', {
+ get: function get() {
+ supported = true;
+ return once;
+ },
-/**
- * Remove data from the given element.
- * @param {Element} element - The target element.
- * @param {string} name - The data key to remove.
- */
-function removeData(element, name) {
- if (isObject(element[name])) {
- try {
- delete element[name];
- } catch (e) {
- element[name] = null;
- }
- } else if (element.dataset) {
- // #128 Safari not allows to delete dataset property
- try {
- delete element.dataset[name];
- } catch (e) {
- element.dataset[name] = null;
+ /**
+ * This setter can fix a `TypeError` in strict mode
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+ * @param {boolean} value - The value to set
+ */
+ set: function set(value) {
+ once = value;
+ }
+ });
+ WINDOW.addEventListener('test', listener, options);
+ WINDOW.removeEventListener('test', listener, options);
}
- } else {
- element.removeAttribute('data-' + hyphenate(name));
- }
-}
-var REGEXP_SPACES = /\s+/;
+ return supported;
+ }();
+ /**
+ * Remove event listener from the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Function} listener - The event listener.
+ * @param {Object} options - The event options.
+ */
+
-/**
- * Remove event listener from the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Function} listener - The event listener.
- * @param {Object} options - The event options.
- */
-function removeListener(element, type, listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ function removeListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (!onceSupported) {
+ var listeners = element.listeners;
- if (!isFunction(listener)) {
- return;
- }
+ if (listeners && listeners[event] && listeners[event][listener]) {
+ handler = listeners[event][listener];
+ delete listeners[event][listener];
- var types = type.trim().split(REGEXP_SPACES);
+ if (Object.keys(listeners[event]).length === 0) {
+ delete listeners[event];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- removeListener(element, t, listener, options);
+ if (Object.keys(listeners).length === 0) {
+ delete element.listeners;
+ }
+ }
+ }
+
+ element.removeEventListener(event, handler, options);
});
- return;
}
+ /**
+ * Add event listener to the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Function} listener - The event listener.
+ * @param {Object} options - The event options.
+ */
- if (element.removeEventListener) {
- element.removeEventListener(type, listener, options);
- } else if (element.detachEvent) {
- element.detachEvent('on' + type, listener);
- }
-}
-
-/**
- * Add event listener to the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Function} listener - The event listener.
- * @param {Object} options - The event options.
- */
-function addListener(element, type, _listener) {
- var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ function addListener(element, type, listener) {
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
+ var _handler = listener;
+ type.trim().split(REGEXP_SPACES).forEach(function (event) {
+ if (options.once && !onceSupported) {
+ var _element$listeners = element.listeners,
+ listeners = _element$listeners === void 0 ? {} : _element$listeners;
- if (!isFunction(_listener)) {
- return;
- }
+ _handler = function handler() {
+ delete listeners[event][listener];
+ element.removeEventListener(event, _handler, options);
- var types = type.trim().split(REGEXP_SPACES);
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
- if (types.length > 1) {
- each(types, function (t) {
- addListener(element, t, _listener, options);
- });
- return;
- }
+ listener.apply(element, args);
+ };
- if (options.once) {
- var originalListener = _listener;
+ if (!listeners[event]) {
+ listeners[event] = {};
+ }
- _listener = function listener() {
- for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
+ if (listeners[event][listener]) {
+ element.removeEventListener(event, listeners[event][listener], options);
+ }
+
+ listeners[event][listener] = _handler;
+ element.listeners = listeners;
}
- removeListener(element, type, _listener, options);
- return originalListener.apply(element, args);
- };
+ element.addEventListener(event, _handler, options);
+ });
}
+ /**
+ * Dispatch event on the target element.
+ * @param {Element} element - The event target.
+ * @param {string} type - The event type(s).
+ * @param {Object} data - The additional event data.
+ * @returns {boolean} Indicate if the event is default prevented or not.
+ */
- if (element.addEventListener) {
- element.addEventListener(type, _listener, options);
- } else if (element.attachEvent) {
- element.attachEvent('on' + type, _listener);
- }
-}
-
-/**
- * Dispatch event on the target element.
- * @param {Element} element - The event target.
- * @param {string} type - The event type(s).
- * @param {Object} data - The additional event data.
- * @returns {boolean} Indicate if the event is default prevented or not.
- */
-function dispatchEvent(element, type, data) {
- if (element.dispatchEvent) {
- var event = void 0;
+ function dispatchEvent(element, type, data) {
+ var event; // Event and CustomEvent on IE9-11 are global objects, not constructors
- // Event and CustomEvent on IE9-11 are global objects, not constructors
if (isFunction(Event) && isFunction(CustomEvent)) {
- if (isUndefined(data)) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true
- });
- }
- } else if (isUndefined(data)) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true
+ });
} else {
event = document.createEvent('CustomEvent');
event.initCustomEvent(type, true, true, data);
}
- // IE9+
return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent('on' + type);
}
+ /**
+ * Get the offset base on the document.
+ * @param {Element} element - The target element.
+ * @returns {Object} The offset data.
+ */
- return true;
-}
-
-/**
- * Get the offset base on the document.
- * @param {Element} element - The target element.
- * @returns {Object} The offset data.
- */
-function getOffset(element) {
- var doc = document.documentElement;
- var box = element.getBoundingClientRect();
-
- return {
- left: box.left + ((window.scrollX || doc && doc.scrollLeft || 0) - (doc && doc.clientLeft || 0)),
- top: box.top + ((window.scrollY || doc && doc.scrollTop || 0) - (doc && doc.clientTop || 0))
- };
-}
-
-/**
- * Empty an element.
- * @param {Element} element - The element to empty.
- */
-function empty(element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
+ function getOffset(element) {
+ var box = element.getBoundingClientRect();
+ return {
+ left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+ top: box.top + (window.pageYOffset - document.documentElement.clientTop)
+ };
}
-}
+ var location = WINDOW.location;
+ var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
+ /**
+ * Check if the given URL is a cross origin URL.
+ * @param {string} url - The target URL.
+ * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
+ */
-var location = WINDOW.location;
+ function isCrossOriginURL(url) {
+ var parts = url.match(REGEXP_ORIGINS);
+ return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
+ }
+ /**
+ * Add timestamp to the given URL.
+ * @param {string} url - The target URL.
+ * @returns {string} The result URL.
+ */
-var REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
+ function addTimestamp(url) {
+ var timestamp = "timestamp=".concat(new Date().getTime());
+ return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
+ }
+ /**
+ * Get transforms base on the given object.
+ * @param {Object} obj - The target object.
+ * @returns {string} A string contains transform values.
+ */
-/**
- * Check if the given URL is a cross origin URL.
- * @param {string} url - The target URL.
- * @returns {boolean} Returns `true` if the given URL is a cross origin URL, else `false`.
- */
-function isCrossOriginURL(url) {
- var parts = url.match(REGEXP_ORIGINS);
+ function getTransforms(_ref) {
+ var rotate = _ref.rotate,
+ scaleX = _ref.scaleX,
+ scaleY = _ref.scaleY,
+ translateX = _ref.translateX,
+ translateY = _ref.translateY;
+ var values = [];
- return parts && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
-}
+ if (isNumber(translateX) && translateX !== 0) {
+ values.push("translateX(".concat(translateX, "px)"));
+ }
-/**
- * Add timestamp to the given URL.
- * @param {string} url - The target URL.
- * @returns {string} The result URL.
- */
-function addTimestamp(url) {
- var timestamp = 'timestamp=' + new Date().getTime();
+ if (isNumber(translateY) && translateY !== 0) {
+ values.push("translateY(".concat(translateY, "px)"));
+ } // Rotate should come first before scale to match orientation transform
- return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
-}
-/**
- * Get transforms base on the given object.
- * @param {Object} obj - The target object.
- * @returns {string} A string contains transform values.
- */
-function getTransforms(_ref) {
- var rotate = _ref.rotate,
- scaleX = _ref.scaleX,
- scaleY = _ref.scaleY,
- translateX = _ref.translateX,
- translateY = _ref.translateY;
+ if (isNumber(rotate) && rotate !== 0) {
+ values.push("rotate(".concat(rotate, "deg)"));
+ }
- var values = [];
+ if (isNumber(scaleX) && scaleX !== 1) {
+ values.push("scaleX(".concat(scaleX, ")"));
+ }
- if (isNumber(translateX) && translateX !== 0) {
- values.push('translateX(' + translateX + 'px)');
- }
+ if (isNumber(scaleY) && scaleY !== 1) {
+ values.push("scaleY(".concat(scaleY, ")"));
+ }
- if (isNumber(translateY) && translateY !== 0) {
- values.push('translateY(' + translateY + 'px)');
+ var transform = values.length ? values.join(' ') : 'none';
+ return {
+ WebkitTransform: transform,
+ msTransform: transform,
+ transform: transform
+ };
}
+ /**
+ * Get the max ratio of a group of pointers.
+ * @param {string} pointers - The target pointers.
+ * @returns {number} The result ratio.
+ */
- // Rotate should come first before scale to match orientation transform
- if (isNumber(rotate) && rotate !== 0) {
- values.push('rotate(' + rotate + 'deg)');
+ function getMaxZoomRatio(pointers) {
+ var pointers2 = _objectSpread2({}, pointers);
+
+ var ratios = [];
+ forEach(pointers, function (pointer, pointerId) {
+ delete pointers2[pointerId];
+ forEach(pointers2, function (pointer2) {
+ var x1 = Math.abs(pointer.startX - pointer2.startX);
+ var y1 = Math.abs(pointer.startY - pointer2.startY);
+ var x2 = Math.abs(pointer.endX - pointer2.endX);
+ var y2 = Math.abs(pointer.endY - pointer2.endY);
+ var z1 = Math.sqrt(x1 * x1 + y1 * y1);
+ var z2 = Math.sqrt(x2 * x2 + y2 * y2);
+ var ratio = (z2 - z1) / z1;
+ ratios.push(ratio);
+ });
+ });
+ ratios.sort(function (a, b) {
+ return Math.abs(a) < Math.abs(b);
+ });
+ return ratios[0];
}
+ /**
+ * Get a pointer from an event object.
+ * @param {Object} event - The target event object.
+ * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
+ * @returns {Object} The result pointer contains start and/or end point coordinates.
+ */
- if (isNumber(scaleX) && scaleX !== 1) {
- values.push('scaleX(' + scaleX + ')');
+ function getPointer(_ref2, endOnly) {
+ var pageX = _ref2.pageX,
+ pageY = _ref2.pageY;
+ var end = {
+ endX: pageX,
+ endY: pageY
+ };
+ return endOnly ? end : _objectSpread2({
+ startX: pageX,
+ startY: pageY
+ }, end);
}
+ /**
+ * Get the center point coordinate of a group of pointers.
+ * @param {Object} pointers - The target pointers.
+ * @returns {Object} The center point coordinate.
+ */
- if (isNumber(scaleY) && scaleY !== 1) {
- values.push('scaleY(' + scaleY + ')');
+ function getPointersCenter(pointers) {
+ var pageX = 0;
+ var pageY = 0;
+ var count = 0;
+ forEach(pointers, function (_ref3) {
+ var startX = _ref3.startX,
+ startY = _ref3.startY;
+ pageX += startX;
+ pageY += startY;
+ count += 1;
+ });
+ pageX /= count;
+ pageY /= count;
+ return {
+ pageX: pageX,
+ pageY: pageY
+ };
}
+ /**
+ * Get the max sizes in a rectangle under the given aspect ratio.
+ * @param {Object} data - The original sizes.
+ * @param {string} [type='contain'] - The adjust type.
+ * @returns {Object} The result sizes.
+ */
- var transform = values.length ? values.join(' ') : 'none';
-
- return {
- WebkitTransform: transform,
- msTransform: transform,
- transform: transform
- };
-}
+ function getAdjustedSizes(_ref4) // or 'cover'
+ {
+ var aspectRatio = _ref4.aspectRatio,
+ height = _ref4.height,
+ width = _ref4.width;
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contain';
+ var isValidWidth = isPositiveNumber(width);
+ var isValidHeight = isPositiveNumber(height);
-var navigator = WINDOW.navigator;
+ if (isValidWidth && isValidHeight) {
+ var adjustedWidth = height * aspectRatio;
-var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
+ if (type === 'contain' && adjustedWidth > width || type === 'cover' && adjustedWidth < width) {
+ height = width / aspectRatio;
+ } else {
+ width = height * aspectRatio;
+ }
+ } else if (isValidWidth) {
+ height = width / aspectRatio;
+ } else if (isValidHeight) {
+ width = height * aspectRatio;
+ }
-/**
- * Get an image's natural sizes.
- * @param {string} image - The target image.
- * @param {Function} callback - The callback function.
- */
-function getImageNaturalSizes(image, callback) {
- // Modern browsers (except Safari)
- if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
- callback(image.naturalWidth, image.naturalHeight);
- return;
+ return {
+ width: width,
+ height: height
+ };
}
+ /**
+ * Get the new sizes of a rectangle after rotated.
+ * @param {Object} data - The original sizes.
+ * @returns {Object} The result sizes.
+ */
- var newImage = document.createElement('img');
- var body = document.body || document.documentElement;
-
- newImage.onload = function () {
- callback(newImage.width, newImage.height);
+ function getRotatedSizes(_ref5) {
+ var width = _ref5.width,
+ height = _ref5.height,
+ degree = _ref5.degree;
+ degree = Math.abs(degree) % 180;
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- body.removeChild(newImage);
+ if (degree === 90) {
+ return {
+ width: height,
+ height: width
+ };
}
- };
-
- newImage.src = image.src;
- // iOS Safari will convert the image automatically
- // with its orientation once append it into DOM (#279)
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- newImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
- body.appendChild(newImage);
+ var arc = degree % 90 * Math.PI / 180;
+ var sinArc = Math.sin(arc);
+ var cosArc = Math.cos(arc);
+ var newWidth = width * cosArc + height * sinArc;
+ var newHeight = width * sinArc + height * cosArc;
+ return degree > 90 ? {
+ width: newHeight,
+ height: newWidth
+ } : {
+ width: newWidth,
+ height: newHeight
+ };
}
-}
+ /**
+ * Get a canvas which drew the given image.
+ * @param {HTMLImageElement} image - The image for drawing.
+ * @param {Object} imageData - The image data.
+ * @param {Object} canvasData - The canvas data.
+ * @param {Object} options - The options.
+ * @returns {HTMLCanvasElement} The result canvas.
+ */
-/**
- * Get the max ratio of a group of pointers.
- * @param {string} pointers - The target pointers.
- * @returns {number} The result ratio.
- */
-function getMaxZoomRatio(pointers) {
- var pointers2 = extend({}, pointers);
- var ratios = [];
-
- each(pointers, function (pointer, pointerId) {
- delete pointers2[pointerId];
-
- each(pointers2, function (pointer2) {
- var x1 = Math.abs(pointer.startX - pointer2.startX);
- var y1 = Math.abs(pointer.startY - pointer2.startY);
- var x2 = Math.abs(pointer.endX - pointer2.endX);
- var y2 = Math.abs(pointer.endY - pointer2.endY);
- var z1 = Math.sqrt(x1 * x1 + y1 * y1);
- var z2 = Math.sqrt(x2 * x2 + y2 * y2);
- var ratio = (z2 - z1) / z1;
-
- ratios.push(ratio);
+ function getSourceCanvas(image, _ref6, _ref7, _ref8) {
+ var imageAspectRatio = _ref6.aspectRatio,
+ imageNaturalWidth = _ref6.naturalWidth,
+ imageNaturalHeight = _ref6.naturalHeight,
+ _ref6$rotate = _ref6.rotate,
+ rotate = _ref6$rotate === void 0 ? 0 : _ref6$rotate,
+ _ref6$scaleX = _ref6.scaleX,
+ scaleX = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX,
+ _ref6$scaleY = _ref6.scaleY,
+ scaleY = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;
+ var aspectRatio = _ref7.aspectRatio,
+ naturalWidth = _ref7.naturalWidth,
+ naturalHeight = _ref7.naturalHeight;
+ var _ref8$fillColor = _ref8.fillColor,
+ fillColor = _ref8$fillColor === void 0 ? 'transparent' : _ref8$fillColor,
+ _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
+ imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE,
+ _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
+ imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? 'low' : _ref8$imageSmoothingQ,
+ _ref8$maxWidth = _ref8.maxWidth,
+ maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth,
+ _ref8$maxHeight = _ref8.maxHeight,
+ maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight,
+ _ref8$minWidth = _ref8.minWidth,
+ minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth,
+ _ref8$minHeight = _ref8.minHeight,
+ minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ var maxSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: maxWidth,
+ height: maxHeight
});
- });
-
- ratios.sort(function (a, b) {
- return Math.abs(a) < Math.abs(b);
- });
-
- return ratios[0];
-}
-
-/**
- * Get a pointer from an event object.
- * @param {Object} event - The target event object.
- * @param {boolean} endOnly - Indicates if only returns the end point coordinate or not.
- * @returns {Object} The result pointer contains start and/or end point coordinates.
- */
-function getPointer(_ref2, endOnly) {
- var pageX = _ref2.pageX,
- pageY = _ref2.pageY;
-
- var end = {
- endX: pageX,
- endY: pageY
- };
-
- if (endOnly) {
- return end;
+ var minSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
+ var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight)); // Note: should always use image's natural sizes for drawing as
+ // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90
+
+ var destMaxSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: maxWidth,
+ height: maxHeight
+ });
+ var destMinSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: minWidth,
+ height: minHeight
+ }, 'cover');
+ var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));
+ var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));
+ var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];
+ canvas.width = normalizeDecimalNumber(width);
+ canvas.height = normalizeDecimalNumber(height);
+ context.fillStyle = fillColor;
+ context.fillRect(0, 0, width, height);
+ context.save();
+ context.translate(width / 2, height / 2);
+ context.rotate(rotate * Math.PI / 180);
+ context.scale(scaleX, scaleY);
+ context.imageSmoothingEnabled = imageSmoothingEnabled;
+ context.imageSmoothingQuality = imageSmoothingQuality;
+ context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function (param) {
+ return Math.floor(normalizeDecimalNumber(param));
+ }))));
+ context.restore();
+ return canvas;
}
+ var fromCharCode = String.fromCharCode;
+ /**
+ * Get string from char code in data view.
+ * @param {DataView} dataView - The data view for read.
+ * @param {number} start - The start index.
+ * @param {number} length - The read length.
+ * @returns {string} The read result.
+ */
- return extend({
- startX: pageX,
- startY: pageY
- }, end);
-}
-
-/**
- * Get the center point coordinate of a group of pointers.
- * @param {Object} pointers - The target pointers.
- * @returns {Object} The center point coordinate.
- */
-function getPointersCenter(pointers) {
- var pageX = 0;
- var pageY = 0;
- var count = 0;
-
- each(pointers, function (_ref3) {
- var startX = _ref3.startX,
- startY = _ref3.startY;
-
- pageX += startX;
- pageY += startY;
- count += 1;
- });
-
- pageX /= count;
- pageY /= count;
-
- return {
- pageX: pageX,
- pageY: pageY
- };
-}
-
-/**
- * Check if the given value is a finite number.
- */
-var isFinite = Number.isFinite || WINDOW.isFinite;
-
-/**
- * Get the max sizes in a rectangle under the given aspect ratio.
- * @param {Object} data - The original sizes.
- * @returns {Object} The result sizes.
- */
-function getContainSizes(_ref4) {
- var aspectRatio = _ref4.aspectRatio,
- height = _ref4.height,
- width = _ref4.width;
-
- var isValidNumber = function isValidNumber(value) {
- return isFinite(value) && value > 0;
- };
+ function getStringFromCharCode(dataView, start, length) {
+ var str = '';
+ length += start;
- if (isValidNumber(width) && isValidNumber(height)) {
- if (height * aspectRatio > width) {
- height = width / aspectRatio;
- } else {
- width = height * aspectRatio;
+ for (var i = start; i < length; i += 1) {
+ str += fromCharCode(dataView.getUint8(i));
}
- } else if (isValidNumber(width)) {
- height = width / aspectRatio;
- } else if (isValidNumber(height)) {
- width = height * aspectRatio;
- }
- return {
- width: width,
- height: height
- };
-}
-
-/**
- * Get the new sizes of a rectangle after rotated.
- * @param {Object} data - The original sizes.
- * @returns {Object} The result sizes.
- */
-function getRotatedSizes(_ref5) {
- var width = _ref5.width,
- height = _ref5.height,
- degree = _ref5.degree;
-
- degree = Math.abs(degree) % 180;
+ return str;
+ }
+ var REGEXP_DATA_URL_HEAD = /^data:.*,/;
+ /**
+ * Transform Data URL to array buffer.
+ * @param {string} dataURL - The Data URL to transform.
+ * @returns {ArrayBuffer} The result array buffer.
+ */
- if (degree === 90) {
- return {
- width: height,
- height: width
- };
+ function dataURLToArrayBuffer(dataURL) {
+ var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
+ var binary = atob(base64);
+ var arrayBuffer = new ArrayBuffer(binary.length);
+ var uint8 = new Uint8Array(arrayBuffer);
+ forEach(uint8, function (value, i) {
+ uint8[i] = binary.charCodeAt(i);
+ });
+ return arrayBuffer;
}
+ /**
+ * Transform array buffer to Data URL.
+ * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
+ * @param {string} mimeType - The mime type of the Data URL.
+ * @returns {string} The result Data URL.
+ */
- var arc = degree % 90 * Math.PI / 180;
- var sinArc = Math.sin(arc);
- var cosArc = Math.cos(arc);
- var newWidth = width * cosArc + height * sinArc;
- var newHeight = width * sinArc + height * cosArc;
-
- return degree > 90 ? {
- width: newHeight,
- height: newWidth
- } : {
- width: newWidth,
- height: newHeight
- };
-}
-
-/**
- * Get a canvas which drew the given image.
- * @param {HTMLImageElement} image - The image for drawing.
- * @param {Object} imageData - The image data.
- * @param {Object} canvasData - The canvas data.
- * @param {Object} options - The options.
- * @returns {HTMLCanvasElement} The result canvas.
- */
-function getSourceCanvas(image, _ref6, _ref7, _ref8) {
- var imageNaturalWidth = _ref6.naturalWidth,
- imageNaturalHeight = _ref6.naturalHeight,
- _ref6$rotate = _ref6.rotate,
- rotate = _ref6$rotate === undefined ? 0 : _ref6$rotate,
- _ref6$scaleX = _ref6.scaleX,
- scaleX = _ref6$scaleX === undefined ? 1 : _ref6$scaleX,
- _ref6$scaleY = _ref6.scaleY,
- scaleY = _ref6$scaleY === undefined ? 1 : _ref6$scaleY;
- var aspectRatio = _ref7.aspectRatio,
- naturalWidth = _ref7.naturalWidth,
- naturalHeight = _ref7.naturalHeight;
- var _ref8$fillColor = _ref8.fillColor,
- fillColor = _ref8$fillColor === undefined ? 'transparent' : _ref8$fillColor,
- _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled,
- imageSmoothingEnabled = _ref8$imageSmoothingE === undefined ? true : _ref8$imageSmoothingE,
- _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality,
- imageSmoothingQuality = _ref8$imageSmoothingQ === undefined ? 'low' : _ref8$imageSmoothingQ,
- _ref8$maxWidth = _ref8.maxWidth,
- maxWidth = _ref8$maxWidth === undefined ? Infinity : _ref8$maxWidth,
- _ref8$maxHeight = _ref8.maxHeight,
- maxHeight = _ref8$maxHeight === undefined ? Infinity : _ref8$maxHeight,
- _ref8$minWidth = _ref8.minWidth,
- minWidth = _ref8$minWidth === undefined ? 0 : _ref8$minWidth,
- _ref8$minHeight = _ref8.minHeight,
- minHeight = _ref8$minHeight === undefined ? 0 : _ref8$minHeight;
-
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
- var maxSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: maxWidth,
- height: maxHeight
- });
- var minSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: minWidth,
- height: minHeight
- });
- var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
- var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
- var params = [-imageNaturalWidth / 2, -imageNaturalHeight / 2, imageNaturalWidth, imageNaturalHeight];
-
- canvas.width = normalizeDecimalNumber(width);
- canvas.height = normalizeDecimalNumber(height);
- context.fillStyle = fillColor;
- context.fillRect(0, 0, width, height);
- context.save();
- context.translate(width / 2, height / 2);
- context.rotate(rotate * Math.PI / 180);
- context.scale(scaleX, scaleY);
- context.imageSmoothingEnabled = imageSmoothingEnabled;
- context.imageSmoothingQuality = imageSmoothingQuality;
- context.drawImage.apply(context, [image].concat(toConsumableArray(params.map(function (param) {
- return Math.floor(normalizeDecimalNumber(param));
- }))));
- context.restore();
- return canvas;
-}
-
-var fromCharCode = String.fromCharCode;
-
-/**
- * Get string from char code in data view.
- * @param {DataView} dataView - The data view for read.
- * @param {number} start - The start index.
- * @param {number} length - The read length.
- * @returns {string} The read result.
- */
+ function arrayBufferToDataURL(arrayBuffer, mimeType) {
+ var chunks = []; // Chunk Typed Array for better performance (#435)
-function getStringFromCharCode(dataView, start, length) {
- var str = '';
- var i = void 0;
+ var chunkSize = 8192;
+ var uint8 = new Uint8Array(arrayBuffer);
- length += start;
+ while (uint8.length > 0) {
+ // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9
+ // eslint-disable-next-line prefer-spread
+ chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
+ uint8 = uint8.subarray(chunkSize);
+ }
- for (i = start; i < length; i += 1) {
- str += fromCharCode(dataView.getUint8(i));
+ return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join('')));
}
+ /**
+ * Get orientation value from given array buffer.
+ * @param {ArrayBuffer} arrayBuffer - The array buffer to read.
+ * @returns {number} The read orientation value.
+ */
- return str;
-}
+ function resetAndGetOrientation(arrayBuffer) {
+ var dataView = new DataView(arrayBuffer);
+ var orientation; // Ignores range error when the image does not have correct Exif information
-var REGEXP_DATA_URL_HEAD = /^data:.*,/;
+ try {
+ var littleEndian;
+ var app1Start;
+ var ifdStart; // Only handle JPEG image (start by 0xFFD8)
-/**
- * Transform Data URL to array buffer.
- * @param {string} dataURL - The Data URL to transform.
- * @returns {ArrayBuffer} The result array buffer.
- */
-function dataURLToArrayBuffer(dataURL) {
- var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, '');
- var binary = atob(base64);
- var arrayBuffer = new ArrayBuffer(binary.length);
- var uint8 = new Uint8Array(arrayBuffer);
-
- each(uint8, function (value, i) {
- uint8[i] = binary.charCodeAt(i);
- });
-
- return arrayBuffer;
-}
-
-/**
- * Transform array buffer to Data URL.
- * @param {ArrayBuffer} arrayBuffer - The array buffer to transform.
- * @param {string} mimeType - The mime type of the Data URL.
- * @returns {string} The result Data URL.
- */
-function arrayBufferToDataURL(arrayBuffer, mimeType) {
- var uint8 = new Uint8Array(arrayBuffer);
- var data = '';
-
- // TypedArray.prototype.forEach is not supported in some browsers.
- each(uint8, function (value) {
- data += fromCharCode(value);
- });
-
- return 'data:' + mimeType + ';base64,' + btoa(data);
-}
-
-/**
- * Get orientation value from given array buffer.
- * @param {ArrayBuffer} arrayBuffer - The array buffer to read.
- * @returns {number} The read orientation value.
- */
-function getOrientation(arrayBuffer) {
- var dataView = new DataView(arrayBuffer);
- var orientation = void 0;
- var littleEndian = void 0;
- var app1Start = void 0;
- var ifdStart = void 0;
-
- // Only handle JPEG image (start by 0xFFD8)
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
- var length = dataView.byteLength;
- var offset = 2;
-
- while (offset < length) {
- if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
- app1Start = offset;
- break;
- }
+ if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
+ var length = dataView.byteLength;
+ var offset = 2;
- offset += 1;
- }
- }
+ while (offset + 1 < length) {
+ if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
+ app1Start = offset;
+ break;
+ }
- if (app1Start) {
- var exifIDCode = app1Start + 4;
- var tiffOffset = app1Start + 10;
+ offset += 1;
+ }
+ }
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
- var endianness = dataView.getUint16(tiffOffset);
+ if (app1Start) {
+ var exifIDCode = app1Start + 4;
+ var tiffOffset = app1Start + 10;
- littleEndian = endianness === 0x4949;
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
+ var endianness = dataView.getUint16(tiffOffset);
+ littleEndian = endianness === 0x4949;
- if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
- var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
+ if (littleEndian || endianness === 0x4D4D
+ /* bigEndian */
+ ) {
+ if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
+ var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
- if (firstIFDOffset >= 0x00000008) {
- ifdStart = tiffOffset + firstIFDOffset;
+ if (firstIFDOffset >= 0x00000008) {
+ ifdStart = tiffOffset + firstIFDOffset;
+ }
+ }
}
- }
}
- }
- }
-
- if (ifdStart) {
- var _length = dataView.getUint16(ifdStart, littleEndian);
- var _offset = void 0;
- var i = void 0;
+ }
- for (i = 0; i < _length; i += 1) {
- _offset = ifdStart + i * 12 + 2;
+ if (ifdStart) {
+ var _length = dataView.getUint16(ifdStart, littleEndian);
- if (dataView.getUint16(_offset, littleEndian) === 0x0112 /* Orientation */) {
- // 8 is the offset of the current tag's value
- _offset += 8;
+ var _offset;
- // Get the original orientation value
- orientation = dataView.getUint16(_offset, littleEndian);
+ var i;
- // Override the orientation with its default value
- dataView.setUint16(_offset, 1, littleEndian);
- break;
- }
- }
- }
+ for (i = 0; i < _length; i += 1) {
+ _offset = ifdStart + i * 12 + 2;
- return orientation;
-}
-
-/**
- * Parse Exif Orientation value.
- * @param {number} orientation - The orientation to parse.
- * @returns {Object} The parsed result.
- */
-function parseOrientation(orientation) {
- var rotate = 0;
- var scaleX = 1;
- var scaleY = 1;
-
- switch (orientation) {
- // Flip horizontal
- case 2:
- scaleX = -1;
- break;
-
- // Rotate left 180°
- case 3:
- rotate = -180;
- break;
-
- // Flip vertical
- case 4:
- scaleY = -1;
- break;
-
- // Flip vertical and rotate right 90°
- case 5:
- rotate = 90;
- scaleY = -1;
- break;
-
- // Rotate right 90°
- case 6:
- rotate = 90;
- break;
-
- // Flip horizontal and rotate right 90°
- case 7:
- rotate = 90;
- scaleX = -1;
- break;
-
- // Rotate left 90°
- case 8:
- rotate = -90;
- break;
-
- default:
- }
-
- return {
- rotate: rotate,
- scaleX: scaleX,
- scaleY: scaleY
- };
-}
+ if (dataView.getUint16(_offset, littleEndian) === 0x0112
+ /* Orientation */
+ ) {
+ // 8 is the offset of the current tag's value
+ _offset += 8; // Get the original orientation value
-var render = {
- render: function render() {
- this.initContainer();
- this.initCanvas();
- this.initCropBox();
- this.renderCanvas();
+ orientation = dataView.getUint16(_offset, littleEndian); // Override the orientation with its default value
- if (this.cropped) {
- this.renderCropBox();
+ dataView.setUint16(_offset, 1, littleEndian);
+ break;
+ }
+ }
+ }
+ } catch (error) {
+ orientation = 1;
}
- },
- initContainer: function initContainer() {
- var element = this.element,
- options = this.options,
- container = this.container,
- cropper = this.cropper;
+ return orientation;
+ }
+ /**
+ * Parse Exif Orientation value.
+ * @param {number} orientation - The orientation to parse.
+ * @returns {Object} The parsed result.
+ */
- addClass(cropper, CLASS_HIDDEN);
- removeClass(element, CLASS_HIDDEN);
+ function parseOrientation(orientation) {
+ var rotate = 0;
+ var scaleX = 1;
+ var scaleY = 1;
- var containerData = {
- width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
- height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
- };
+ switch (orientation) {
+ // Flip horizontal
+ case 2:
+ scaleX = -1;
+ break;
+ // Rotate left 180°
- this.containerData = containerData;
+ case 3:
+ rotate = -180;
+ break;
+ // Flip vertical
- setStyle(cropper, {
- width: containerData.width,
- height: containerData.height
- });
+ case 4:
+ scaleY = -1;
+ break;
+ // Flip vertical and rotate right 90°
- addClass(element, CLASS_HIDDEN);
- removeClass(cropper, CLASS_HIDDEN);
- },
+ case 5:
+ rotate = 90;
+ scaleY = -1;
+ break;
+ // Rotate right 90°
+ case 6:
+ rotate = 90;
+ break;
+ // Flip horizontal and rotate right 90°
- // Canvas (image wrapper)
- initCanvas: function initCanvas() {
- var containerData = this.containerData,
- imageData = this.imageData;
- var viewMode = this.options.viewMode;
+ case 7:
+ rotate = 90;
+ scaleX = -1;
+ break;
+ // Rotate left 90°
- var rotated = Math.abs(imageData.rotate) % 180 === 90;
- var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
- var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
- var aspectRatio = naturalWidth / naturalHeight;
- var canvasWidth = containerData.width;
- var canvasHeight = containerData.height;
+ case 8:
+ rotate = -90;
+ break;
- if (containerData.height * aspectRatio > containerData.width) {
- if (viewMode === 3) {
- canvasWidth = containerData.height * aspectRatio;
- } else {
- canvasHeight = containerData.width / aspectRatio;
- }
- } else if (viewMode === 3) {
- canvasHeight = containerData.width / aspectRatio;
- } else {
- canvasWidth = containerData.height * aspectRatio;
+ default:
}
- var canvasData = {
- aspectRatio: aspectRatio,
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- width: canvasWidth,
- height: canvasHeight
+ return {
+ rotate: rotate,
+ scaleX: scaleX,
+ scaleY: scaleY
};
+ }
- canvasData.left = (containerData.width - canvasWidth) / 2;
- canvasData.top = (containerData.height - canvasHeight) / 2;
- canvasData.oldLeft = canvasData.left;
- canvasData.oldTop = canvasData.top;
-
- this.canvasData = canvasData;
- this.limited = viewMode === 1 || viewMode === 2;
- this.limitCanvas(true, true);
- this.initialImageData = extend({}, imageData);
- this.initialCanvasData = extend({}, canvasData);
- },
- limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
- var options = this.options,
- containerData = this.containerData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
- var viewMode = options.viewMode;
- var aspectRatio = canvasData.aspectRatio;
-
- var cropped = this.cropped && cropBoxData;
-
- if (sizeLimited) {
- var minCanvasWidth = Number(options.minCanvasWidth) || 0;
- var minCanvasHeight = Number(options.minCanvasHeight) || 0;
-
- if (viewMode > 1) {
- minCanvasWidth = Math.max(minCanvasWidth, containerData.width);
- minCanvasHeight = Math.max(minCanvasHeight, containerData.height);
+ var render = {
+ render: function render() {
+ this.initContainer();
+ this.initCanvas();
+ this.initCropBox();
+ this.renderCanvas();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
+ },
+ initContainer: function initContainer() {
+ var element = this.element,
+ options = this.options,
+ container = this.container,
+ cropper = this.cropper;
+ addClass(cropper, CLASS_HIDDEN);
+ removeClass(element, CLASS_HIDDEN);
+ var containerData = {
+ width: Math.max(container.offsetWidth, Number(options.minContainerWidth) || 200),
+ height: Math.max(container.offsetHeight, Number(options.minContainerHeight) || 100)
+ };
+ this.containerData = containerData;
+ setStyle(cropper, {
+ width: containerData.width,
+ height: containerData.height
+ });
+ addClass(element, CLASS_HIDDEN);
+ removeClass(cropper, CLASS_HIDDEN);
+ },
+ // Canvas (image wrapper)
+ initCanvas: function initCanvas() {
+ var containerData = this.containerData,
+ imageData = this.imageData;
+ var viewMode = this.options.viewMode;
+ var rotated = Math.abs(imageData.rotate) % 180 === 90;
+ var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
+ var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
+ var aspectRatio = naturalWidth / naturalHeight;
+ var canvasWidth = containerData.width;
+ var canvasHeight = containerData.height;
+
+ if (containerData.height * aspectRatio > containerData.width) {
if (viewMode === 3) {
- if (minCanvasHeight * aspectRatio > minCanvasWidth) {
- minCanvasWidth = minCanvasHeight * aspectRatio;
- } else {
- minCanvasHeight = minCanvasWidth / aspectRatio;
- }
- }
- } else if (viewMode > 0) {
- if (minCanvasWidth) {
- minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);
- } else if (minCanvasHeight) {
- minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);
- } else if (cropped) {
- minCanvasWidth = cropBoxData.width;
- minCanvasHeight = cropBoxData.height;
-
- if (minCanvasHeight * aspectRatio > minCanvasWidth) {
- minCanvasWidth = minCanvasHeight * aspectRatio;
- } else {
- minCanvasHeight = minCanvasWidth / aspectRatio;
- }
+ canvasWidth = containerData.height * aspectRatio;
+ } else {
+ canvasHeight = containerData.width / aspectRatio;
}
+ } else if (viewMode === 3) {
+ canvasHeight = containerData.width / aspectRatio;
+ } else {
+ canvasWidth = containerData.height * aspectRatio;
}
- var _getContainSizes = getContainSizes({
+ var canvasData = {
aspectRatio: aspectRatio,
- width: minCanvasWidth,
- height: minCanvasHeight
- });
-
- minCanvasWidth = _getContainSizes.width;
- minCanvasHeight = _getContainSizes.height;
-
-
- canvasData.minWidth = minCanvasWidth;
- canvasData.minHeight = minCanvasHeight;
- canvasData.maxWidth = Infinity;
- canvasData.maxHeight = Infinity;
- }
-
- if (positionLimited) {
- if (viewMode) {
- var newCanvasLeft = containerData.width - canvasData.width;
- var newCanvasTop = containerData.height - canvasData.height;
-
- canvasData.minLeft = Math.min(0, newCanvasLeft);
- canvasData.minTop = Math.min(0, newCanvasTop);
- canvasData.maxLeft = Math.max(0, newCanvasLeft);
- canvasData.maxTop = Math.max(0, newCanvasTop);
-
- if (cropped && this.limited) {
- canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));
- canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));
- canvasData.maxLeft = cropBoxData.left;
- canvasData.maxTop = cropBoxData.top;
-
- if (viewMode === 2) {
- if (canvasData.width >= containerData.width) {
- canvasData.minLeft = Math.min(0, newCanvasLeft);
- canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ naturalWidth: naturalWidth,
+ naturalHeight: naturalHeight,
+ width: canvasWidth,
+ height: canvasHeight
+ };
+ canvasData.left = (containerData.width - canvasWidth) / 2;
+ canvasData.top = (containerData.height - canvasHeight) / 2;
+ canvasData.oldLeft = canvasData.left;
+ canvasData.oldTop = canvasData.top;
+ this.canvasData = canvasData;
+ this.limited = viewMode === 1 || viewMode === 2;
+ this.limitCanvas(true, true);
+ this.initialImageData = assign({}, imageData);
+ this.initialCanvasData = assign({}, canvasData);
+ },
+ limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
+ var options = this.options,
+ containerData = this.containerData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var viewMode = options.viewMode;
+ var aspectRatio = canvasData.aspectRatio;
+ var cropped = this.cropped && cropBoxData;
+
+ if (sizeLimited) {
+ var minCanvasWidth = Number(options.minCanvasWidth) || 0;
+ var minCanvasHeight = Number(options.minCanvasHeight) || 0;
+
+ if (viewMode > 1) {
+ minCanvasWidth = Math.max(minCanvasWidth, containerData.width);
+ minCanvasHeight = Math.max(minCanvasHeight, containerData.height);
+
+ if (viewMode === 3) {
+ if (minCanvasHeight * aspectRatio > minCanvasWidth) {
+ minCanvasWidth = minCanvasHeight * aspectRatio;
+ } else {
+ minCanvasHeight = minCanvasWidth / aspectRatio;
+ }
+ }
+ } else if (viewMode > 0) {
+ if (minCanvasWidth) {
+ minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);
+ } else if (minCanvasHeight) {
+ minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);
+ } else if (cropped) {
+ minCanvasWidth = cropBoxData.width;
+ minCanvasHeight = cropBoxData.height;
+
+ if (minCanvasHeight * aspectRatio > minCanvasWidth) {
+ minCanvasWidth = minCanvasHeight * aspectRatio;
+ } else {
+ minCanvasHeight = minCanvasWidth / aspectRatio;
}
+ }
+ }
+
+ var _getAdjustedSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: minCanvasWidth,
+ height: minCanvasHeight
+ });
- if (canvasData.height >= containerData.height) {
- canvasData.minTop = Math.min(0, newCanvasTop);
- canvasData.maxTop = Math.max(0, newCanvasTop);
+ minCanvasWidth = _getAdjustedSizes.width;
+ minCanvasHeight = _getAdjustedSizes.height;
+ canvasData.minWidth = minCanvasWidth;
+ canvasData.minHeight = minCanvasHeight;
+ canvasData.maxWidth = Infinity;
+ canvasData.maxHeight = Infinity;
+ }
+
+ if (positionLimited) {
+ if (viewMode > (cropped ? 0 : 1)) {
+ var newCanvasLeft = containerData.width - canvasData.width;
+ var newCanvasTop = containerData.height - canvasData.height;
+ canvasData.minLeft = Math.min(0, newCanvasLeft);
+ canvasData.minTop = Math.min(0, newCanvasTop);
+ canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ canvasData.maxTop = Math.max(0, newCanvasTop);
+
+ if (cropped && this.limited) {
+ canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));
+ canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));
+ canvasData.maxLeft = cropBoxData.left;
+ canvasData.maxTop = cropBoxData.top;
+
+ if (viewMode === 2) {
+ if (canvasData.width >= containerData.width) {
+ canvasData.minLeft = Math.min(0, newCanvasLeft);
+ canvasData.maxLeft = Math.max(0, newCanvasLeft);
+ }
+
+ if (canvasData.height >= containerData.height) {
+ canvasData.minTop = Math.min(0, newCanvasTop);
+ canvasData.maxTop = Math.max(0, newCanvasTop);
+ }
}
}
+ } else {
+ canvasData.minLeft = -canvasData.width;
+ canvasData.minTop = -canvasData.height;
+ canvasData.maxLeft = containerData.width;
+ canvasData.maxTop = containerData.height;
}
- } else {
- canvasData.minLeft = -canvasData.width;
- canvasData.minTop = -canvasData.height;
- canvasData.maxLeft = containerData.width;
- canvasData.maxTop = containerData.height;
}
- }
- },
- renderCanvas: function renderCanvas(changed, transformed) {
- var canvasData = this.canvasData,
- imageData = this.imageData;
-
+ },
+ renderCanvas: function renderCanvas(changed, transformed) {
+ var canvasData = this.canvasData,
+ imageData = this.imageData;
- if (transformed) {
- var _getRotatedSizes = getRotatedSizes({
- width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
- height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
- degree: imageData.rotate || 0
- }),
- naturalWidth = _getRotatedSizes.width,
- naturalHeight = _getRotatedSizes.height;
-
- var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
- var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
-
- canvasData.left -= (width - canvasData.width) / 2;
- canvasData.top -= (height - canvasData.height) / 2;
- canvasData.width = width;
- canvasData.height = height;
- canvasData.aspectRatio = naturalWidth / naturalHeight;
- canvasData.naturalWidth = naturalWidth;
- canvasData.naturalHeight = naturalHeight;
- this.limitCanvas(true, false);
- }
+ if (transformed) {
+ var _getRotatedSizes = getRotatedSizes({
+ width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
+ height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
+ degree: imageData.rotate || 0
+ }),
+ naturalWidth = _getRotatedSizes.width,
+ naturalHeight = _getRotatedSizes.height;
+
+ var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
+ var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
+ canvasData.left -= (width - canvasData.width) / 2;
+ canvasData.top -= (height - canvasData.height) / 2;
+ canvasData.width = width;
+ canvasData.height = height;
+ canvasData.aspectRatio = naturalWidth / naturalHeight;
+ canvasData.naturalWidth = naturalWidth;
+ canvasData.naturalHeight = naturalHeight;
+ this.limitCanvas(true, false);
+ }
+
+ if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {
+ canvasData.left = canvasData.oldLeft;
+ }
+
+ if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {
+ canvasData.top = canvasData.oldTop;
+ }
+
+ canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
+ canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
+ this.limitCanvas(false, true);
+ canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
+ canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
+ canvasData.oldLeft = canvasData.left;
+ canvasData.oldTop = canvasData.top;
+ setStyle(this.canvas, assign({
+ width: canvasData.width,
+ height: canvasData.height
+ }, getTransforms({
+ translateX: canvasData.left,
+ translateY: canvasData.top
+ })));
+ this.renderImage(changed);
+
+ if (this.cropped && this.limited) {
+ this.limitCropBox(true, true);
+ }
+ },
+ renderImage: function renderImage(changed) {
+ var canvasData = this.canvasData,
+ imageData = this.imageData;
+ var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
+ var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
+ assign(imageData, {
+ width: width,
+ height: height,
+ left: (canvasData.width - width) / 2,
+ top: (canvasData.height - height) / 2
+ });
+ setStyle(this.image, assign({
+ width: imageData.width,
+ height: imageData.height
+ }, getTransforms(assign({
+ translateX: imageData.left,
+ translateY: imageData.top
+ }, imageData))));
- if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {
- canvasData.left = canvasData.oldLeft;
- }
+ if (changed) {
+ this.output();
+ }
+ },
+ initCropBox: function initCropBox() {
+ var options = this.options,
+ canvasData = this.canvasData;
+ var aspectRatio = options.aspectRatio || options.initialAspectRatio;
+ var autoCropArea = Number(options.autoCropArea) || 0.8;
+ var cropBoxData = {
+ width: canvasData.width,
+ height: canvasData.height
+ };
- if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {
- canvasData.top = canvasData.oldTop;
- }
+ if (aspectRatio) {
+ if (canvasData.height * aspectRatio > canvasData.width) {
+ cropBoxData.height = cropBoxData.width / aspectRatio;
+ } else {
+ cropBoxData.width = cropBoxData.height * aspectRatio;
+ }
+ }
- canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
- canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
+ this.cropBoxData = cropBoxData;
+ this.limitCropBox(true, true); // Initialize auto crop area
- this.limitCanvas(false, true);
+ cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight); // The width/height of auto crop area must large than "minWidth/Height"
- canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
- canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
- canvasData.oldLeft = canvasData.left;
- canvasData.oldTop = canvasData.top;
+ cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
+ cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
+ cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
+ cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
+ cropBoxData.oldLeft = cropBoxData.left;
+ cropBoxData.oldTop = cropBoxData.top;
+ this.initialCropBoxData = assign({}, cropBoxData);
+ },
+ limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
+ var options = this.options,
+ containerData = this.containerData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData,
+ limited = this.limited;
+ var aspectRatio = options.aspectRatio;
- setStyle(this.canvas, extend({
- width: canvasData.width,
- height: canvasData.height
- }, getTransforms({
- translateX: canvasData.left,
- translateY: canvasData.top
- })));
+ if (sizeLimited) {
+ var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
+ var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
+ var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;
+ var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height; // The min/maxCropBoxWidth/Height must be less than container's width/height
- this.renderImage(changed);
+ minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
+ minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
- if (this.cropped && this.limited) {
- this.limitCropBox(true, true);
- }
- },
- renderImage: function renderImage(changed) {
- var canvasData = this.canvasData,
- imageData = this.imageData;
+ if (aspectRatio) {
+ if (minCropBoxWidth && minCropBoxHeight) {
+ if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {
+ minCropBoxHeight = minCropBoxWidth / aspectRatio;
+ } else {
+ minCropBoxWidth = minCropBoxHeight * aspectRatio;
+ }
+ } else if (minCropBoxWidth) {
+ minCropBoxHeight = minCropBoxWidth / aspectRatio;
+ } else if (minCropBoxHeight) {
+ minCropBoxWidth = minCropBoxHeight * aspectRatio;
+ }
- var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
- var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
+ if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {
+ maxCropBoxHeight = maxCropBoxWidth / aspectRatio;
+ } else {
+ maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
+ }
+ } // The minWidth/Height must be less than maxWidth/Height
- extend(imageData, {
- width: width,
- height: height,
- left: (canvasData.width - width) / 2,
- top: (canvasData.height - height) / 2
- });
- setStyle(this.image, extend({
- width: imageData.width,
- height: imageData.height
- }, getTransforms(extend({
- translateX: imageData.left,
- translateY: imageData.top
- }, imageData))));
-
- if (changed) {
- this.output();
- }
- },
- initCropBox: function initCropBox() {
- var options = this.options,
- canvasData = this.canvasData;
- var aspectRatio = options.aspectRatio;
-
- var autoCropArea = Number(options.autoCropArea) || 0.8;
- var cropBoxData = {
- width: canvasData.width,
- height: canvasData.height
- };
- if (aspectRatio) {
- if (canvasData.height * aspectRatio > canvasData.width) {
- cropBoxData.height = cropBoxData.width / aspectRatio;
- } else {
- cropBoxData.width = cropBoxData.height * aspectRatio;
+ cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
+ cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
+ cropBoxData.maxWidth = maxCropBoxWidth;
+ cropBoxData.maxHeight = maxCropBoxHeight;
}
- }
- this.cropBoxData = cropBoxData;
- this.limitCropBox(true, true);
-
- // Initialize auto crop area
- cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
- // The width/height of auto crop area must large than "minWidth/Height"
- cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
- cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
- cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
- cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
- cropBoxData.oldLeft = cropBoxData.left;
- cropBoxData.oldTop = cropBoxData.top;
-
- this.initialCropBoxData = extend({}, cropBoxData);
- },
- limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
- var options = this.options,
- containerData = this.containerData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData,
- limited = this.limited;
- var aspectRatio = options.aspectRatio;
-
-
- if (sizeLimited) {
- var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
- var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
- var maxCropBoxWidth = Math.min(containerData.width, limited ? canvasData.width : containerData.width);
- var maxCropBoxHeight = Math.min(containerData.height, limited ? canvasData.height : containerData.height);
-
- // The min/maxCropBoxWidth/Height must be less than container's width/height
- minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
- minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
-
- if (aspectRatio) {
- if (minCropBoxWidth && minCropBoxHeight) {
- if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {
- minCropBoxHeight = minCropBoxWidth / aspectRatio;
- } else {
- minCropBoxWidth = minCropBoxHeight * aspectRatio;
- }
- } else if (minCropBoxWidth) {
- minCropBoxHeight = minCropBoxWidth / aspectRatio;
- } else if (minCropBoxHeight) {
- minCropBoxWidth = minCropBoxHeight * aspectRatio;
- }
-
- if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {
- maxCropBoxHeight = maxCropBoxWidth / aspectRatio;
+ if (positionLimited) {
+ if (limited) {
+ cropBoxData.minLeft = Math.max(0, canvasData.left);
+ cropBoxData.minTop = Math.max(0, canvasData.top);
+ cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;
+ cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;
} else {
- maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
+ cropBoxData.minLeft = 0;
+ cropBoxData.minTop = 0;
+ cropBoxData.maxLeft = containerData.width - cropBoxData.width;
+ cropBoxData.maxTop = containerData.height - cropBoxData.height;
}
}
+ },
+ renderCropBox: function renderCropBox() {
+ var options = this.options,
+ containerData = this.containerData,
+ cropBoxData = this.cropBoxData;
- // The minWidth/Height must be less than maxWidth/Height
- cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
- cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
- cropBoxData.maxWidth = maxCropBoxWidth;
- cropBoxData.maxHeight = maxCropBoxHeight;
- }
-
- if (positionLimited) {
- if (limited) {
- cropBoxData.minLeft = Math.max(0, canvasData.left);
- cropBoxData.minTop = Math.max(0, canvasData.top);
- cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;
- cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;
- } else {
- cropBoxData.minLeft = 0;
- cropBoxData.minTop = 0;
- cropBoxData.maxLeft = containerData.width - cropBoxData.width;
- cropBoxData.maxTop = containerData.height - cropBoxData.height;
+ if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
+ cropBoxData.left = cropBoxData.oldLeft;
}
- }
- },
- renderCropBox: function renderCropBox() {
- var options = this.options,
- containerData = this.containerData,
- cropBoxData = this.cropBoxData;
-
- if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
- cropBoxData.left = cropBoxData.oldLeft;
- }
-
- if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {
- cropBoxData.top = cropBoxData.oldTop;
- }
-
- cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
- cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
-
- this.limitCropBox(false, true);
-
- cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
- cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
- cropBoxData.oldLeft = cropBoxData.left;
- cropBoxData.oldTop = cropBoxData.top;
+ if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {
+ cropBoxData.top = cropBoxData.oldTop;
+ }
- if (options.movable && options.cropBoxMovable) {
- // Turn to move the canvas when the crop box is equal to the container
- setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
- }
+ cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
+ cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
+ this.limitCropBox(false, true);
+ cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
+ cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
+ cropBoxData.oldLeft = cropBoxData.left;
+ cropBoxData.oldTop = cropBoxData.top;
- setStyle(this.cropBox, extend({
- width: cropBoxData.width,
- height: cropBoxData.height
- }, getTransforms({
- translateX: cropBoxData.left,
- translateY: cropBoxData.top
- })));
+ if (options.movable && options.cropBoxMovable) {
+ // Turn to move the canvas when the crop box is equal to the container
+ setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
+ }
- if (this.cropped && this.limited) {
- this.limitCanvas(true, true);
- }
+ setStyle(this.cropBox, assign({
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ }, getTransforms({
+ translateX: cropBoxData.left,
+ translateY: cropBoxData.top
+ })));
- if (!this.disabled) {
- this.output();
- }
- },
- output: function output() {
- this.preview();
+ if (this.cropped && this.limited) {
+ this.limitCanvas(true, true);
+ }
- if (this.complete) {
+ if (!this.disabled) {
+ this.output();
+ }
+ },
+ output: function output() {
+ this.preview();
dispatchEvent(this.element, EVENT_CROP, this.getData());
}
- }
-};
+ };
-var preview = {
- initPreview: function initPreview() {
- var crossOrigin = this.crossOrigin;
- var preview = this.options.preview;
+ var preview = {
+ initPreview: function initPreview() {
+ var element = this.element,
+ crossOrigin = this.crossOrigin;
+ var preview = this.options.preview;
+ var url = crossOrigin ? this.crossOriginUrl : this.url;
+ var alt = element.alt || 'The image to preview';
+ var image = document.createElement('img');
- var url = crossOrigin ? this.crossOriginUrl : this.url;
- var image = document.createElement('img');
+ if (crossOrigin) {
+ image.crossOrigin = crossOrigin;
+ }
- if (crossOrigin) {
- image.crossOrigin = crossOrigin;
- }
+ image.src = url;
+ image.alt = alt;
+ this.viewBox.appendChild(image);
+ this.viewBoxImage = image;
- image.src = url;
- this.viewBox.appendChild(image);
- this.image2 = image;
+ if (!preview) {
+ return;
+ }
- if (!preview) {
- return;
- }
+ var previews = preview;
+
+ if (typeof preview === 'string') {
+ previews = element.ownerDocument.querySelectorAll(preview);
+ } else if (preview.querySelector) {
+ previews = [preview];
+ }
- var previews = preview.querySelector ? [preview] : document.querySelectorAll(preview);
+ this.previews = previews;
+ forEach(previews, function (el) {
+ var img = document.createElement('img'); // Save the original size for recover
- this.previews = previews;
+ setData(el, DATA_PREVIEW, {
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ html: el.innerHTML
+ });
- each(previews, function (element) {
- var img = document.createElement('img');
+ if (crossOrigin) {
+ img.crossOrigin = crossOrigin;
+ }
- // Save the original size for recover
- setData(element, DATA_PREVIEW, {
- width: element.offsetWidth,
- height: element.offsetHeight,
- html: element.innerHTML
+ img.src = url;
+ img.alt = alt;
+ /**
+ * Override img element styles
+ * Add `display:block` to avoid margin top issue
+ * Add `height:auto` to override `height` attribute on IE8
+ * (Occur only when margin-top <= -height)
+ */
+
+ img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ el.innerHTML = '';
+ el.appendChild(img);
});
-
- if (crossOrigin) {
- img.crossOrigin = crossOrigin;
+ },
+ resetPreview: function resetPreview() {
+ forEach(this.previews, function (element) {
+ var data = getData(element, DATA_PREVIEW);
+ setStyle(element, {
+ width: data.width,
+ height: data.height
+ });
+ element.innerHTML = data.html;
+ removeData(element, DATA_PREVIEW);
+ });
+ },
+ preview: function preview() {
+ var imageData = this.imageData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var cropBoxWidth = cropBoxData.width,
+ cropBoxHeight = cropBoxData.height;
+ var width = imageData.width,
+ height = imageData.height;
+ var left = cropBoxData.left - canvasData.left - imageData.left;
+ var top = cropBoxData.top - canvasData.top - imageData.top;
+
+ if (!this.cropped || this.disabled) {
+ return;
}
- img.src = url;
+ setStyle(this.viewBoxImage, assign({
+ width: width,
+ height: height
+ }, getTransforms(assign({
+ translateX: -left,
+ translateY: -top
+ }, imageData))));
+ forEach(this.previews, function (element) {
+ var data = getData(element, DATA_PREVIEW);
+ var originalWidth = data.width;
+ var originalHeight = data.height;
+ var newWidth = originalWidth;
+ var newHeight = originalHeight;
+ var ratio = 1;
+
+ if (cropBoxWidth) {
+ ratio = originalWidth / cropBoxWidth;
+ newHeight = cropBoxHeight * ratio;
+ }
- /**
- * Override img element styles
- * Add `display:block` to avoid margin top issue
- * Add `height:auto` to override `height` attribute on IE8
- * (Occur only when margin-top <= -height)
- */
- img.style.cssText = 'display:block;' + 'width:100%;' + 'height:auto;' + 'min-width:0!important;' + 'min-height:0!important;' + 'max-width:none!important;' + 'max-height:none!important;' + 'image-orientation:0deg!important;"';
+ if (cropBoxHeight && newHeight > originalHeight) {
+ ratio = originalHeight / cropBoxHeight;
+ newWidth = cropBoxWidth * ratio;
+ newHeight = originalHeight;
+ }
- empty(element);
- element.appendChild(img);
- });
- },
- resetPreview: function resetPreview() {
- each(this.previews, function (element) {
- var data = getData(element, DATA_PREVIEW);
-
- setStyle(element, {
- width: data.width,
- height: data.height
+ setStyle(element, {
+ width: newWidth,
+ height: newHeight
+ });
+ setStyle(element.getElementsByTagName('img')[0], assign({
+ width: width * ratio,
+ height: height * ratio
+ }, getTransforms(assign({
+ translateX: -left * ratio,
+ translateY: -top * ratio
+ }, imageData))));
});
-
- element.innerHTML = data.html;
- removeData(element, DATA_PREVIEW);
- });
- },
- preview: function preview() {
- var imageData = this.imageData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
- var cropBoxWidth = cropBoxData.width,
- cropBoxHeight = cropBoxData.height;
- var width = imageData.width,
- height = imageData.height;
-
- var left = cropBoxData.left - canvasData.left - imageData.left;
- var top = cropBoxData.top - canvasData.top - imageData.top;
-
- if (!this.cropped || this.disabled) {
- return;
}
+ };
- setStyle(this.image2, extend({
- width: width,
- height: height
- }, getTransforms(extend({
- translateX: -left,
- translateY: -top
- }, imageData))));
-
- each(this.previews, function (element) {
- var data = getData(element, DATA_PREVIEW);
- var originalWidth = data.width;
- var originalHeight = data.height;
- var newWidth = originalWidth;
- var newHeight = originalHeight;
- var ratio = 1;
+ var events = {
+ bind: function bind() {
+ var element = this.element,
+ options = this.options,
+ cropper = this.cropper;
- if (cropBoxWidth) {
- ratio = originalWidth / cropBoxWidth;
- newHeight = cropBoxHeight * ratio;
+ if (isFunction(options.cropstart)) {
+ addListener(element, EVENT_CROP_START, options.cropstart);
}
- if (cropBoxHeight && newHeight > originalHeight) {
- ratio = originalHeight / cropBoxHeight;
- newWidth = cropBoxWidth * ratio;
- newHeight = originalHeight;
+ if (isFunction(options.cropmove)) {
+ addListener(element, EVENT_CROP_MOVE, options.cropmove);
}
- setStyle(element, {
- width: newWidth,
- height: newHeight
- });
-
- setStyle(element.getElementsByTagName('img')[0], extend({
- width: width * ratio,
- height: height * ratio
- }, getTransforms(extend({
- translateX: -left * ratio,
- translateY: -top * ratio
- }, imageData))));
- });
- }
-};
-
-var events = {
- bind: function bind() {
- var element = this.element,
- options = this.options,
- cropper = this.cropper;
+ if (isFunction(options.cropend)) {
+ addListener(element, EVENT_CROP_END, options.cropend);
+ }
+ if (isFunction(options.crop)) {
+ addListener(element, EVENT_CROP, options.crop);
+ }
- if (isFunction(options.cropstart)) {
- addListener(element, EVENT_CROP_START, options.cropstart);
- }
+ if (isFunction(options.zoom)) {
+ addListener(element, EVENT_ZOOM, options.zoom);
+ }
- if (isFunction(options.cropmove)) {
- addListener(element, EVENT_CROP_MOVE, options.cropmove);
- }
+ addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
- if (isFunction(options.cropend)) {
- addListener(element, EVENT_CROP_END, options.cropend);
- }
+ if (options.zoomable && options.zoomOnWheel) {
+ addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
+ passive: false,
+ capture: true
+ });
+ }
- if (isFunction(options.crop)) {
- addListener(element, EVENT_CROP, options.crop);
- }
+ if (options.toggleDragModeOnDblclick) {
+ addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
+ }
- if (isFunction(options.zoom)) {
- addListener(element, EVENT_ZOOM, options.zoom);
- }
+ addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));
+ addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));
- addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = proxy(this.cropStart, this));
+ if (options.responsive) {
+ addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
+ }
+ },
+ unbind: function unbind() {
+ var element = this.element,
+ options = this.options,
+ cropper = this.cropper;
- if (options.zoomable && options.zoomOnWheel) {
- addListener(cropper, EVENT_WHEEL, this.onWheel = proxy(this.wheel, this));
- }
+ if (isFunction(options.cropstart)) {
+ removeListener(element, EVENT_CROP_START, options.cropstart);
+ }
- if (options.toggleDragModeOnDblclick) {
- addListener(cropper, EVENT_DBLCLICK, this.onDblclick = proxy(this.dblclick, this));
- }
+ if (isFunction(options.cropmove)) {
+ removeListener(element, EVENT_CROP_MOVE, options.cropmove);
+ }
- addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = proxy(this.cropMove, this));
- addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = proxy(this.cropEnd, this));
+ if (isFunction(options.cropend)) {
+ removeListener(element, EVENT_CROP_END, options.cropend);
+ }
- if (options.responsive) {
- addListener(window, EVENT_RESIZE, this.onResize = proxy(this.resize, this));
- }
- },
- unbind: function unbind() {
- var element = this.element,
- options = this.options,
- cropper = this.cropper;
+ if (isFunction(options.crop)) {
+ removeListener(element, EVENT_CROP, options.crop);
+ }
+ if (isFunction(options.zoom)) {
+ removeListener(element, EVENT_ZOOM, options.zoom);
+ }
- if (isFunction(options.cropstart)) {
- removeListener(element, EVENT_CROP_START, options.cropstart);
- }
+ removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
- if (isFunction(options.cropmove)) {
- removeListener(element, EVENT_CROP_MOVE, options.cropmove);
- }
+ if (options.zoomable && options.zoomOnWheel) {
+ removeListener(cropper, EVENT_WHEEL, this.onWheel, {
+ passive: false,
+ capture: true
+ });
+ }
- if (isFunction(options.cropend)) {
- removeListener(element, EVENT_CROP_END, options.cropend);
- }
+ if (options.toggleDragModeOnDblclick) {
+ removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
+ }
- if (isFunction(options.crop)) {
- removeListener(element, EVENT_CROP, options.crop);
- }
+ removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
+ removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);
- if (isFunction(options.zoom)) {
- removeListener(element, EVENT_ZOOM, options.zoom);
+ if (options.responsive) {
+ removeListener(window, EVENT_RESIZE, this.onResize);
+ }
}
+ };
- removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
-
- if (options.zoomable && options.zoomOnWheel) {
- removeListener(cropper, EVENT_WHEEL, this.onWheel);
- }
+ var handlers = {
+ resize: function resize() {
+ var options = this.options,
+ container = this.container,
+ containerData = this.containerData;
+ var minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
+ var minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
- if (options.toggleDragModeOnDblclick) {
- removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
- }
+ if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
+ return;
+ }
- removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
- removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);
+ var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed
- if (options.responsive) {
- removeListener(window, EVENT_RESIZE, this.onResize);
- }
- }
-};
+ if (ratio !== 1 || container.offsetHeight !== containerData.height) {
+ var canvasData;
+ var cropBoxData;
-var handlers = {
- resize: function resize() {
- var options = this.options,
- container = this.container,
- containerData = this.containerData;
+ if (options.restore) {
+ canvasData = this.getCanvasData();
+ cropBoxData = this.getCropBoxData();
+ }
- var minContainerWidth = Number(options.minContainerWidth) || 200;
- var minContainerHeight = Number(options.minContainerHeight) || 100;
+ this.render();
- if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) {
- return;
- }
+ if (options.restore) {
+ this.setCanvasData(forEach(canvasData, function (n, i) {
+ canvasData[i] = n * ratio;
+ }));
+ this.setCropBoxData(forEach(cropBoxData, function (n, i) {
+ cropBoxData[i] = n * ratio;
+ }));
+ }
+ }
+ },
+ dblclick: function dblclick() {
+ if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {
+ return;
+ }
- var ratio = container.offsetWidth / containerData.width;
+ this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
+ },
+ wheel: function wheel(event) {
+ var _this = this;
- // Resize when width changed or height changed
- if (ratio !== 1 || container.offsetHeight !== containerData.height) {
- var canvasData = void 0;
- var cropBoxData = void 0;
+ var ratio = Number(this.options.wheelZoomRatio) || 0.1;
+ var delta = 1;
- if (options.restore) {
- canvasData = this.getCanvasData();
- cropBoxData = this.getCropBoxData();
+ if (this.disabled) {
+ return;
}
- this.render();
+ event.preventDefault(); // Limit wheel speed to prevent zoom too fast (#21)
- if (options.restore) {
- this.setCanvasData(each(canvasData, function (n, i) {
- canvasData[i] = n * ratio;
- }));
- this.setCropBoxData(each(cropBoxData, function (n, i) {
- cropBoxData[i] = n * ratio;
- }));
+ if (this.wheeling) {
+ return;
}
- }
- },
- dblclick: function dblclick() {
- if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {
- return;
- }
-
- this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
- },
- wheel: function wheel(e) {
- var _this = this;
- var ratio = Number(this.options.wheelZoomRatio) || 0.1;
- var delta = 1;
+ this.wheeling = true;
+ setTimeout(function () {
+ _this.wheeling = false;
+ }, 50);
- if (this.disabled) {
- return;
- }
+ if (event.deltaY) {
+ delta = event.deltaY > 0 ? 1 : -1;
+ } else if (event.wheelDelta) {
+ delta = -event.wheelDelta / 120;
+ } else if (event.detail) {
+ delta = event.detail > 0 ? 1 : -1;
+ }
- e.preventDefault();
+ this.zoom(-delta * ratio, event);
+ },
+ cropStart: function cropStart(event) {
+ var buttons = event.buttons,
+ button = event.button;
- // Limit wheel speed to prevent zoom too fast (#21)
- if (this.wheeling) {
- return;
- }
+ if (this.disabled // Handle mouse event and pointer event and ignore touch event
+ || (event.type === 'mousedown' || event.type === 'pointerdown' && event.pointerType === 'mouse') && ( // No primary button (Usually the left button)
+ isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 // Open context menu
+ || event.ctrlKey)) {
+ return;
+ }
- this.wheeling = true;
+ var options = this.options,
+ pointers = this.pointers;
+ var action;
- setTimeout(function () {
- _this.wheeling = false;
- }, 50);
+ if (event.changedTouches) {
+ // Handle touch event
+ forEach(event.changedTouches, function (touch) {
+ pointers[touch.identifier] = getPointer(touch);
+ });
+ } else {
+ // Handle mouse event and pointer event
+ pointers[event.pointerId || 0] = getPointer(event);
+ }
- if (e.deltaY) {
- delta = e.deltaY > 0 ? 1 : -1;
- } else if (e.wheelDelta) {
- delta = -e.wheelDelta / 120;
- } else if (e.detail) {
- delta = e.detail > 0 ? 1 : -1;
- }
+ if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
+ action = ACTION_ZOOM;
+ } else {
+ action = getData(event.target, DATA_ACTION);
+ }
- this.zoom(-delta * ratio, e);
- },
- cropStart: function cropStart(e) {
- if (this.disabled) {
- return;
- }
+ if (!REGEXP_ACTIONS.test(action)) {
+ return;
+ }
- var options = this.options,
- pointers = this.pointers;
+ if (dispatchEvent(this.element, EVENT_CROP_START, {
+ originalEvent: event,
+ action: action
+ }) === false) {
+ return;
+ } // This line is required for preventing page zooming in iOS browsers
- var action = void 0;
- if (e.changedTouches) {
- // Handle touch event
- each(e.changedTouches, function (touch) {
- pointers[touch.identifier] = getPointer(touch);
- });
- } else {
- // Handle mouse event and pointer event
- pointers[e.pointerId || 0] = getPointer(e);
- }
+ event.preventDefault();
+ this.action = action;
+ this.cropping = false;
- if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
- action = ACTION_ZOOM;
- } else {
- action = getData(e.target, DATA_ACTION);
- }
+ if (action === ACTION_CROP) {
+ this.cropping = true;
+ addClass(this.dragBox, CLASS_MODAL);
+ }
+ },
+ cropMove: function cropMove(event) {
+ var action = this.action;
- if (!REGEXP_ACTIONS.test(action)) {
- return;
- }
+ if (this.disabled || !action) {
+ return;
+ }
- if (dispatchEvent(this.element, EVENT_CROP_START, {
- originalEvent: e,
- action: action
- }) === false) {
- return;
- }
+ var pointers = this.pointers;
+ event.preventDefault();
- e.preventDefault();
+ if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
+ originalEvent: event,
+ action: action
+ }) === false) {
+ return;
+ }
- this.action = action;
- this.cropping = false;
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ // The first parameter should not be undefined (#432)
+ assign(pointers[touch.identifier] || {}, getPointer(touch, true));
+ });
+ } else {
+ assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
+ }
- if (action === ACTION_CROP) {
- this.cropping = true;
- addClass(this.dragBox, CLASS_MODAL);
- }
- },
- cropMove: function cropMove(e) {
- var action = this.action;
+ this.change(event);
+ },
+ cropEnd: function cropEnd(event) {
+ if (this.disabled) {
+ return;
+ }
+ var action = this.action,
+ pointers = this.pointers;
- if (this.disabled || !action) {
- return;
- }
+ if (event.changedTouches) {
+ forEach(event.changedTouches, function (touch) {
+ delete pointers[touch.identifier];
+ });
+ } else {
+ delete pointers[event.pointerId || 0];
+ }
- var pointers = this.pointers;
+ if (!action) {
+ return;
+ }
+ event.preventDefault();
- e.preventDefault();
+ if (!Object.keys(pointers).length) {
+ this.action = '';
+ }
- if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
- originalEvent: e,
- action: action
- }) === false) {
- return;
- }
+ if (this.cropping) {
+ this.cropping = false;
+ toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);
+ }
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- extend(pointers[touch.identifier], getPointer(touch, true));
+ dispatchEvent(this.element, EVENT_CROP_END, {
+ originalEvent: event,
+ action: action
});
- } else {
- extend(pointers[e.pointerId || 0], getPointer(e, true));
}
+ };
- this.change(e);
- },
- cropEnd: function cropEnd(e) {
- if (this.disabled) {
- return;
- }
+ var change = {
+ change: function change(event) {
+ var options = this.options,
+ canvasData = this.canvasData,
+ containerData = this.containerData,
+ cropBoxData = this.cropBoxData,
+ pointers = this.pointers;
+ var action = this.action;
+ var aspectRatio = options.aspectRatio;
+ var left = cropBoxData.left,
+ top = cropBoxData.top,
+ width = cropBoxData.width,
+ height = cropBoxData.height;
+ var right = left + width;
+ var bottom = top + height;
+ var minLeft = 0;
+ var minTop = 0;
+ var maxWidth = containerData.width;
+ var maxHeight = containerData.height;
+ var renderable = true;
+ var offset; // Locking aspect ratio in "free mode" by holding shift key
+
+ if (!aspectRatio && event.shiftKey) {
+ aspectRatio = width && height ? width / height : 1;
+ }
+
+ if (this.limited) {
+ minLeft = cropBoxData.minLeft;
+ minTop = cropBoxData.minTop;
+ maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
+ maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
+ }
+
+ var pointer = pointers[Object.keys(pointers)[0]];
+ var range = {
+ x: pointer.endX - pointer.startX,
+ y: pointer.endY - pointer.startY
+ };
- var action = this.action,
- pointers = this.pointers;
+ var check = function check(side) {
+ switch (side) {
+ case ACTION_EAST:
+ if (right + range.x > maxWidth) {
+ range.x = maxWidth - right;
+ }
+ break;
- if (e.changedTouches) {
- each(e.changedTouches, function (touch) {
- delete pointers[touch.identifier];
- });
- } else {
- delete pointers[e.pointerId || 0];
- }
+ case ACTION_WEST:
+ if (left + range.x < minLeft) {
+ range.x = minLeft - left;
+ }
- if (!action) {
- return;
- }
+ break;
- e.preventDefault();
+ case ACTION_NORTH:
+ if (top + range.y < minTop) {
+ range.y = minTop - top;
+ }
- if (!Object.keys(pointers).length) {
- this.action = '';
- }
+ break;
- if (this.cropping) {
- this.cropping = false;
- toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);
- }
+ case ACTION_SOUTH:
+ if (bottom + range.y > maxHeight) {
+ range.y = maxHeight - bottom;
+ }
- dispatchEvent(this.element, EVENT_CROP_END, {
- originalEvent: e,
- action: action
- });
- }
-};
-
-var change = {
- change: function change(e) {
- var options = this.options,
- canvasData = this.canvasData,
- containerData = this.containerData,
- cropBoxData = this.cropBoxData,
- pointers = this.pointers;
- var action = this.action;
- var aspectRatio = options.aspectRatio;
- var left = cropBoxData.left,
- top = cropBoxData.top,
- width = cropBoxData.width,
- height = cropBoxData.height;
-
- var right = left + width;
- var bottom = top + height;
- var minLeft = 0;
- var minTop = 0;
- var maxWidth = containerData.width;
- var maxHeight = containerData.height;
- var renderable = true;
- var offset = void 0;
-
- // Locking aspect ratio in "free mode" by holding shift key
- if (!aspectRatio && e.shiftKey) {
- aspectRatio = width && height ? width / height : 1;
- }
+ break;
- if (this.limited) {
- minLeft = cropBoxData.minLeft;
- minTop = cropBoxData.minTop;
+ default:
+ }
+ };
- maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
- maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
- }
+ switch (action) {
+ // Move crop box
+ case ACTION_ALL:
+ left += range.x;
+ top += range.y;
+ break;
+ // Resize crop box
- var pointer = pointers[Object.keys(pointers)[0]];
- var range = {
- x: pointer.endX - pointer.startX,
- y: pointer.endY - pointer.startY
- };
- var check = function check(side) {
- switch (side) {
case ACTION_EAST:
- if (right + range.x > maxWidth) {
- range.x = maxWidth - right;
+ if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
+ renderable = false;
+ break;
}
- break;
+ check(ACTION_EAST);
+ width += range.x;
- case ACTION_WEST:
- if (left + range.x < minLeft) {
- range.x = minLeft - left;
+ if (width < 0) {
+ action = ACTION_WEST;
+ width = -width;
+ left -= width;
}
- break;
-
- case ACTION_NORTH:
- if (top + range.y < minTop) {
- range.y = minTop - top;
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
- case ACTION_SOUTH:
- if (bottom + range.y > maxHeight) {
- range.y = maxHeight - bottom;
+ case ACTION_NORTH:
+ if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {
+ renderable = false;
+ break;
}
- break;
-
- default:
- }
- };
-
- switch (action) {
- // Move crop box
- case ACTION_ALL:
- left += range.x;
- top += range.y;
- break;
-
- // Resize crop box
- case ACTION_EAST:
- if (range.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
- renderable = false;
- break;
- }
-
- check(ACTION_EAST);
- width += range.x;
-
- if (aspectRatio) {
- height = width / aspectRatio;
- top -= range.x / aspectRatio / 2;
- }
-
- if (width < 0) {
- action = ACTION_WEST;
- width = 0;
- }
-
- break;
-
- case ACTION_NORTH:
- if (range.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {
- renderable = false;
- break;
- }
-
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
-
- if (aspectRatio) {
- width = height * aspectRatio;
- left += range.y * aspectRatio / 2;
- }
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
- if (height < 0) {
- action = ACTION_SOUTH;
- height = 0;
- }
+ if (height < 0) {
+ action = ACTION_SOUTH;
+ height = -height;
+ top -= height;
+ }
- break;
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
+ }
- case ACTION_WEST:
- if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
- renderable = false;
break;
- }
- check(ACTION_WEST);
- width -= range.x;
- left += range.x;
+ case ACTION_WEST:
+ if (range.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
+ renderable = false;
+ break;
+ }
- if (aspectRatio) {
- height = width / aspectRatio;
- top += range.x / aspectRatio / 2;
- }
+ check(ACTION_WEST);
+ width -= range.x;
+ left += range.x;
- if (width < 0) {
- action = ACTION_EAST;
- width = 0;
- }
+ if (width < 0) {
+ action = ACTION_EAST;
+ width = -width;
+ left -= width;
+ }
- break;
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
+ }
- case ACTION_SOUTH:
- if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {
- renderable = false;
break;
- }
- check(ACTION_SOUTH);
- height += range.y;
-
- if (aspectRatio) {
- width = height * aspectRatio;
- left -= range.y * aspectRatio / 2;
- }
+ case ACTION_SOUTH:
+ if (range.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {
+ renderable = false;
+ break;
+ }
- if (height < 0) {
- action = ACTION_NORTH;
- height = 0;
- }
+ check(ACTION_SOUTH);
+ height += range.y;
- break;
+ if (height < 0) {
+ action = ACTION_NORTH;
+ height = -height;
+ top -= height;
+ }
- case ACTION_NORTH_EAST:
- if (aspectRatio) {
- if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {
- renderable = false;
- break;
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
- width = height * aspectRatio;
- } else {
- check(ACTION_NORTH);
- check(ACTION_EAST);
+ break;
- if (range.x >= 0) {
- if (right < maxWidth) {
- width += range.x;
- } else if (range.y <= 0 && top <= minTop) {
+ case ACTION_NORTH_EAST:
+ if (aspectRatio) {
+ if (range.y <= 0 && (top <= minTop || right >= maxWidth)) {
renderable = false;
+ break;
}
+
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
+ width = height * aspectRatio;
} else {
- width += range.x;
- }
+ check(ACTION_NORTH);
+ check(ACTION_EAST);
+
+ if (range.x >= 0) {
+ if (right < maxWidth) {
+ width += range.x;
+ } else if (range.y <= 0 && top <= minTop) {
+ renderable = false;
+ }
+ } else {
+ width += range.x;
+ }
- if (range.y <= 0) {
- if (top > minTop) {
+ if (range.y <= 0) {
+ if (top > minTop) {
+ height -= range.y;
+ top += range.y;
+ }
+ } else {
height -= range.y;
top += range.y;
}
- } else {
- height -= range.y;
- top += range.y;
}
- }
- if (width < 0 && height < 0) {
- action = ACTION_SOUTH_WEST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_NORTH_WEST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_SOUTH_EAST;
- height = 0;
- }
-
- break;
-
- case ACTION_NORTH_WEST:
- if (aspectRatio) {
- if (range.y <= 0 && (top <= minTop || left <= minLeft)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_SOUTH_WEST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_NORTH_WEST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_SOUTH_EAST;
+ height = -height;
+ top -= height;
}
- check(ACTION_NORTH);
- height -= range.y;
- top += range.y;
- width = height * aspectRatio;
- left += range.y * aspectRatio;
- } else {
- check(ACTION_NORTH);
- check(ACTION_WEST);
+ break;
- if (range.x <= 0) {
- if (left > minLeft) {
- width -= range.x;
- left += range.x;
- } else if (range.y <= 0 && top <= minTop) {
+ case ACTION_NORTH_WEST:
+ if (aspectRatio) {
+ if (range.y <= 0 && (top <= minTop || left <= minLeft)) {
renderable = false;
+ break;
}
+
+ check(ACTION_NORTH);
+ height -= range.y;
+ top += range.y;
+ width = height * aspectRatio;
+ left += cropBoxData.width - width;
} else {
- width -= range.x;
- left += range.x;
- }
+ check(ACTION_NORTH);
+ check(ACTION_WEST);
+
+ if (range.x <= 0) {
+ if (left > minLeft) {
+ width -= range.x;
+ left += range.x;
+ } else if (range.y <= 0 && top <= minTop) {
+ renderable = false;
+ }
+ } else {
+ width -= range.x;
+ left += range.x;
+ }
- if (range.y <= 0) {
- if (top > minTop) {
+ if (range.y <= 0) {
+ if (top > minTop) {
+ height -= range.y;
+ top += range.y;
+ }
+ } else {
height -= range.y;
top += range.y;
}
- } else {
- height -= range.y;
- top += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_SOUTH_EAST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_NORTH_EAST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_SOUTH_WEST;
- height = 0;
- }
-
- break;
- case ACTION_SOUTH_WEST:
- if (aspectRatio) {
- if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_SOUTH_EAST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_NORTH_EAST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_SOUTH_WEST;
+ height = -height;
+ top -= height;
}
- check(ACTION_WEST);
- width -= range.x;
- left += range.x;
- height = width / aspectRatio;
- } else {
- check(ACTION_SOUTH);
- check(ACTION_WEST);
+ break;
- if (range.x <= 0) {
- if (left > minLeft) {
- width -= range.x;
- left += range.x;
- } else if (range.y >= 0 && bottom >= maxHeight) {
+ case ACTION_SOUTH_WEST:
+ if (aspectRatio) {
+ if (range.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
renderable = false;
+ break;
}
- } else {
+
+ check(ACTION_WEST);
width -= range.x;
left += range.x;
- }
+ height = width / aspectRatio;
+ } else {
+ check(ACTION_SOUTH);
+ check(ACTION_WEST);
+
+ if (range.x <= 0) {
+ if (left > minLeft) {
+ width -= range.x;
+ left += range.x;
+ } else if (range.y >= 0 && bottom >= maxHeight) {
+ renderable = false;
+ }
+ } else {
+ width -= range.x;
+ left += range.x;
+ }
- if (range.y >= 0) {
- if (bottom < maxHeight) {
+ if (range.y >= 0) {
+ if (bottom < maxHeight) {
+ height += range.y;
+ }
+ } else {
height += range.y;
}
- } else {
- height += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_NORTH_EAST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_SOUTH_EAST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_NORTH_WEST;
- height = 0;
- }
-
- break;
- case ACTION_SOUTH_EAST:
- if (aspectRatio) {
- if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
- renderable = false;
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_NORTH_EAST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_SOUTH_EAST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_NORTH_WEST;
+ height = -height;
+ top -= height;
}
- check(ACTION_EAST);
- width += range.x;
- height = width / aspectRatio;
- } else {
- check(ACTION_SOUTH);
- check(ACTION_EAST);
+ break;
- if (range.x >= 0) {
- if (right < maxWidth) {
- width += range.x;
- } else if (range.y >= 0 && bottom >= maxHeight) {
+ case ACTION_SOUTH_EAST:
+ if (aspectRatio) {
+ if (range.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
renderable = false;
+ break;
}
- } else {
+
+ check(ACTION_EAST);
width += range.x;
- }
+ height = width / aspectRatio;
+ } else {
+ check(ACTION_SOUTH);
+ check(ACTION_EAST);
+
+ if (range.x >= 0) {
+ if (right < maxWidth) {
+ width += range.x;
+ } else if (range.y >= 0 && bottom >= maxHeight) {
+ renderable = false;
+ }
+ } else {
+ width += range.x;
+ }
- if (range.y >= 0) {
- if (bottom < maxHeight) {
+ if (range.y >= 0) {
+ if (bottom < maxHeight) {
+ height += range.y;
+ }
+ } else {
height += range.y;
}
- } else {
- height += range.y;
}
- }
-
- if (width < 0 && height < 0) {
- action = ACTION_NORTH_WEST;
- height = 0;
- width = 0;
- } else if (width < 0) {
- action = ACTION_SOUTH_WEST;
- width = 0;
- } else if (height < 0) {
- action = ACTION_NORTH_EAST;
- height = 0;
- }
- break;
+ if (width < 0 && height < 0) {
+ action = ACTION_NORTH_WEST;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
+ } else if (width < 0) {
+ action = ACTION_SOUTH_WEST;
+ width = -width;
+ left -= width;
+ } else if (height < 0) {
+ action = ACTION_NORTH_EAST;
+ height = -height;
+ top -= height;
+ }
- // Move canvas
- case ACTION_MOVE:
- this.move(range.x, range.y);
- renderable = false;
- break;
+ break;
+ // Move canvas
- // Zoom canvas
- case ACTION_ZOOM:
- this.zoom(getMaxZoomRatio(pointers), e);
- renderable = false;
- break;
+ case ACTION_MOVE:
+ this.move(range.x, range.y);
+ renderable = false;
+ break;
+ // Zoom canvas
- // Create crop box
- case ACTION_CROP:
- if (!range.x || !range.y) {
+ case ACTION_ZOOM:
+ this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
- }
+ // Create crop box
- offset = getOffset(this.cropper);
- left = pointer.startX - offset.left;
- top = pointer.startY - offset.top;
- width = cropBoxData.minWidth;
- height = cropBoxData.minHeight;
+ case ACTION_CROP:
+ if (!range.x || !range.y) {
+ renderable = false;
+ break;
+ }
- if (range.x > 0) {
- action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;
- } else if (range.x < 0) {
- left -= width;
- action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;
- }
+ offset = getOffset(this.cropper);
+ left = pointer.startX - offset.left;
+ top = pointer.startY - offset.top;
+ width = cropBoxData.minWidth;
+ height = cropBoxData.minHeight;
+
+ if (range.x > 0) {
+ action = range.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;
+ } else if (range.x < 0) {
+ left -= width;
+ action = range.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;
+ }
+
+ if (range.y < 0) {
+ top -= height;
+ } // Show the crop box if is hidden
- if (range.y < 0) {
- top -= height;
- }
- // Show the crop box if is hidden
- if (!this.cropped) {
- removeClass(this.cropBox, CLASS_HIDDEN);
- this.cropped = true;
+ if (!this.cropped) {
+ removeClass(this.cropBox, CLASS_HIDDEN);
+ this.cropped = true;
- if (this.limited) {
- this.limitCropBox(true, true);
+ if (this.limited) {
+ this.limitCropBox(true, true);
+ }
}
- }
- break;
+ break;
- default:
- }
+ default:
+ }
- if (renderable) {
- cropBoxData.width = width;
- cropBoxData.height = height;
- cropBoxData.left = left;
- cropBoxData.top = top;
- this.action = action;
- this.renderCropBox();
- }
+ if (renderable) {
+ cropBoxData.width = width;
+ cropBoxData.height = height;
+ cropBoxData.left = left;
+ cropBoxData.top = top;
+ this.action = action;
+ this.renderCropBox();
+ } // Override
- // Override
- each(pointers, function (p) {
- p.startX = p.endX;
- p.startY = p.endY;
- });
- }
-};
-var methods = {
- // Show the crop box manually
- crop: function crop() {
- if (this.ready && !this.disabled) {
- if (!this.cropped) {
+ forEach(pointers, function (p) {
+ p.startX = p.endX;
+ p.startY = p.endY;
+ });
+ }
+ };
+
+ var methods = {
+ // Show the crop box manually
+ crop: function crop() {
+ if (this.ready && !this.cropped && !this.disabled) {
this.cropped = true;
this.limitCropBox(true, true);
@@ -2528,1164 +2449,1101 @@ var methods = {
}
removeClass(this.cropBox, CLASS_HIDDEN);
+ this.setCropBoxData(this.initialCropBoxData);
}
- this.setCropBoxData(this.initialCropBoxData);
- }
-
- return this;
- },
+ return this;
+ },
+ // Reset the image and crop box to their initial states
+ reset: function reset() {
+ if (this.ready && !this.disabled) {
+ this.imageData = assign({}, this.initialImageData);
+ this.canvasData = assign({}, this.initialCanvasData);
+ this.cropBoxData = assign({}, this.initialCropBoxData);
+ this.renderCanvas();
-
- // Reset the image and crop box to their initial states
- reset: function reset() {
- if (this.ready && !this.disabled) {
- this.imageData = extend({}, this.initialImageData);
- this.canvasData = extend({}, this.initialCanvasData);
- this.cropBoxData = extend({}, this.initialCropBoxData);
- this.renderCanvas();
-
- if (this.cropped) {
- this.renderCropBox();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
}
- }
-
- return this;
- },
-
-
- // Clear the crop box
- clear: function clear() {
- if (this.cropped && !this.disabled) {
- extend(this.cropBoxData, {
- left: 0,
- top: 0,
- width: 0,
- height: 0
- });
-
- this.cropped = false;
- this.renderCropBox();
- this.limitCanvas(true, true);
- // Render canvas after crop box rendered
- this.renderCanvas();
- removeClass(this.dragBox, CLASS_MODAL);
- addClass(this.cropBox, CLASS_HIDDEN);
- }
-
- return this;
- },
-
-
- /**
- * Replace the image's src and rebuild the cropper
- * @param {string} url - The new URL.
- * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
- * @returns {Object} this
- */
- replace: function replace(url) {
- var onlyColorChanged = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+ return this;
+ },
+ // Clear the crop box
+ clear: function clear() {
+ if (this.cropped && !this.disabled) {
+ assign(this.cropBoxData, {
+ left: 0,
+ top: 0,
+ width: 0,
+ height: 0
+ });
+ this.cropped = false;
+ this.renderCropBox();
+ this.limitCanvas(true, true); // Render canvas after crop box rendered
- if (!this.disabled && url) {
- if (this.isImg) {
- this.element.src = url;
+ this.renderCanvas();
+ removeClass(this.dragBox, CLASS_MODAL);
+ addClass(this.cropBox, CLASS_HIDDEN);
}
- if (onlyColorChanged) {
- this.url = url;
- this.image.src = url;
+ return this;
+ },
- if (this.ready) {
- this.image2.src = url;
+ /**
+ * Replace the image's src and rebuild the cropper
+ * @param {string} url - The new URL.
+ * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
+ * @returns {Cropper} this
+ */
+ replace: function replace(url) {
+ var hasSameSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- each(this.previews, function (element) {
- element.getElementsByTagName('img')[0].src = url;
- });
- }
- } else {
+ if (!this.disabled && url) {
if (this.isImg) {
- this.replaced = true;
+ this.element.src = url;
}
- // Clear previous data
- this.options.data = null;
- this.load(url);
- }
- }
-
- return this;
- },
-
-
- // Enable (unfreeze) the cropper
- enable: function enable() {
- if (this.ready) {
- this.disabled = false;
- removeClass(this.cropper, CLASS_DISABLED);
- }
-
- return this;
- },
-
-
- // Disable (freeze) the cropper
- disable: function disable() {
- if (this.ready) {
- this.disabled = true;
- addClass(this.cropper, CLASS_DISABLED);
- }
+ if (hasSameSize) {
+ this.url = url;
+ this.image.src = url;
- return this;
- },
-
-
- // Destroy the cropper and remove the instance from the image
- destroy: function destroy() {
- var element = this.element,
- image = this.image;
-
-
- if (this.loaded) {
- if (this.isImg && this.replaced) {
- element.src = this.originalUrl;
- }
-
- this.unbuild();
- removeClass(element, CLASS_HIDDEN);
- } else if (this.isImg) {
- removeListener(element, EVENT_LOAD, this.onStart);
- } else if (image) {
- image.parentNode.removeChild(image);
- }
-
- removeData(element, NAMESPACE);
-
- return this;
- },
-
-
- /**
- * Move the canvas with relative offsets
- * @param {number} offsetX - The relative offset distance on the x-axis.
- * @param {number} offsetY - The relative offset distance on the y-axis.
- * @returns {Object} this
- */
- move: function move(offsetX, offsetY) {
- var _canvasData = this.canvasData,
- left = _canvasData.left,
- top = _canvasData.top;
-
-
- return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
- },
-
-
- /**
- * Move the canvas to an absolute point
- * @param {number} x - The x-axis coordinate.
- * @param {number} [y=x] - The y-axis coordinate.
- * @returns {Object} this
- */
- moveTo: function moveTo(x) {
- var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
- var canvasData = this.canvasData;
-
- var changed = false;
-
- x = Number(x);
- y = Number(y);
+ if (this.ready) {
+ this.viewBoxImage.src = url;
+ forEach(this.previews, function (element) {
+ element.getElementsByTagName('img')[0].src = url;
+ });
+ }
+ } else {
+ if (this.isImg) {
+ this.replaced = true;
+ }
- if (this.ready && !this.disabled && this.options.movable) {
- if (isNumber(x)) {
- canvasData.left = x;
- changed = true;
+ this.options.data = null;
+ this.uncreate();
+ this.load(url);
+ }
}
- if (isNumber(y)) {
- canvasData.top = y;
- changed = true;
+ return this;
+ },
+ // Enable (unfreeze) the cropper
+ enable: function enable() {
+ if (this.ready && this.disabled) {
+ this.disabled = false;
+ removeClass(this.cropper, CLASS_DISABLED);
}
- if (changed) {
- this.renderCanvas(true);
+ return this;
+ },
+ // Disable (freeze) the cropper
+ disable: function disable() {
+ if (this.ready && !this.disabled) {
+ this.disabled = true;
+ addClass(this.cropper, CLASS_DISABLED);
}
- }
-
- return this;
- },
-
-
- /**
- * Zoom the canvas with a relative ratio
- * @param {number} ratio - The target ratio.
- * @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
- */
- zoom: function zoom(ratio, _originalEvent) {
- var canvasData = this.canvasData;
-
-
- ratio = Number(ratio);
- if (ratio < 0) {
- ratio = 1 / (1 - ratio);
- } else {
- ratio = 1 + ratio;
- }
-
- return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
- },
+ return this;
+ },
+ /**
+ * Destroy the cropper and remove the instance from the image
+ * @returns {Cropper} this
+ */
+ destroy: function destroy() {
+ var element = this.element;
- /**
- * Zoom the canvas to an absolute ratio
- * @param {number} ratio - The target ratio.
- * @param {Object} pivot - The zoom pivot point coordinate.
- * @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
- */
- zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
- var options = this.options,
- canvasData = this.canvasData;
- var width = canvasData.width,
- height = canvasData.height,
- naturalWidth = canvasData.naturalWidth,
- naturalHeight = canvasData.naturalHeight;
-
-
- ratio = Number(ratio);
-
- if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
- var newWidth = naturalWidth * ratio;
- var newHeight = naturalHeight * ratio;
-
- if (dispatchEvent(this.element, EVENT_ZOOM, {
- originalEvent: _originalEvent,
- oldRatio: width / naturalWidth,
- ratio: newWidth / naturalWidth
- }) === false) {
+ if (!element[NAMESPACE]) {
return this;
}
- if (_originalEvent) {
- var pointers = this.pointers;
-
- var offset = getOffset(this.cropper);
- var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
- pageX: _originalEvent.pageX,
- pageY: _originalEvent.pageY
- };
+ element[NAMESPACE] = undefined;
- // Zoom from the triggering point of the event
- canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
- canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
- } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
- canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);
- canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);
- } else {
- // Zoom from the center of the canvas
- canvasData.left -= (newWidth - width) / 2;
- canvasData.top -= (newHeight - height) / 2;
+ if (this.isImg && this.replaced) {
+ element.src = this.originalUrl;
}
- canvasData.width = newWidth;
- canvasData.height = newHeight;
- this.renderCanvas(true);
- }
-
- return this;
- },
-
-
- /**
- * Rotate the canvas with a relative degree
- * @param {number} degree - The rotate degree.
- * @returns {Object} this
- */
- rotate: function rotate(degree) {
- return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
- },
-
-
- /**
- * Rotate the canvas to an absolute degree
- * @param {number} degree - The rotate degree.
- * @returns {Object} this
- */
- rotateTo: function rotateTo(degree) {
- degree = Number(degree);
-
- if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {
- this.imageData.rotate = degree % 360;
- this.renderCanvas(true, true);
- }
-
- return this;
- },
+ this.uncreate();
+ return this;
+ },
+ /**
+ * Move the canvas with relative offsets
+ * @param {number} offsetX - The relative offset distance on the x-axis.
+ * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
+ * @returns {Cropper} this
+ */
+ move: function move(offsetX) {
+ var offsetY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : offsetX;
+ var _this$canvasData = this.canvasData,
+ left = _this$canvasData.left,
+ top = _this$canvasData.top;
+ return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
+ },
- /**
- * Scale the image on the x-axis.
- * @param {number} scaleX - The scale ratio on the x-axis.
- * @returns {Object} this
- */
- scaleX: function scaleX(_scaleX) {
- var scaleY = this.imageData.scaleY;
+ /**
+ * Move the canvas to an absolute point
+ * @param {number} x - The x-axis coordinate.
+ * @param {number} [y=x] - The y-axis coordinate.
+ * @returns {Cropper} this
+ */
+ moveTo: function moveTo(x) {
+ var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x;
+ var canvasData = this.canvasData;
+ var changed = false;
+ x = Number(x);
+ y = Number(y);
+
+ if (this.ready && !this.disabled && this.options.movable) {
+ if (isNumber(x)) {
+ canvasData.left = x;
+ changed = true;
+ }
+ if (isNumber(y)) {
+ canvasData.top = y;
+ changed = true;
+ }
- return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
- },
+ if (changed) {
+ this.renderCanvas(true);
+ }
+ }
+ return this;
+ },
- /**
- * Scale the image on the y-axis.
- * @param {number} scaleY - The scale ratio on the y-axis.
- * @returns {Object} this
- */
- scaleY: function scaleY(_scaleY) {
- var scaleX = this.imageData.scaleX;
+ /**
+ * Zoom the canvas with a relative ratio
+ * @param {number} ratio - The target ratio.
+ * @param {Event} _originalEvent - The original event if any.
+ * @returns {Cropper} this
+ */
+ zoom: function zoom(ratio, _originalEvent) {
+ var canvasData = this.canvasData;
+ ratio = Number(ratio);
+ if (ratio < 0) {
+ ratio = 1 / (1 - ratio);
+ } else {
+ ratio = 1 + ratio;
+ }
- return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
- },
+ return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
+ },
+ /**
+ * Zoom the canvas to an absolute ratio
+ * @param {number} ratio - The target ratio.
+ * @param {Object} pivot - The zoom pivot point coordinate.
+ * @param {Event} _originalEvent - The original event if any.
+ * @returns {Cropper} this
+ */
+ zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
+ var options = this.options,
+ canvasData = this.canvasData;
+ var width = canvasData.width,
+ height = canvasData.height,
+ naturalWidth = canvasData.naturalWidth,
+ naturalHeight = canvasData.naturalHeight;
+ ratio = Number(ratio);
+
+ if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
+ var newWidth = naturalWidth * ratio;
+ var newHeight = naturalHeight * ratio;
+
+ if (dispatchEvent(this.element, EVENT_ZOOM, {
+ ratio: ratio,
+ oldRatio: width / naturalWidth,
+ originalEvent: _originalEvent
+ }) === false) {
+ return this;
+ }
- /**
- * Scale the image
- * @param {number} scaleX - The scale ratio on the x-axis.
- * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
- * @returns {Object} this
- */
- scale: function scale(scaleX) {
- var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
- var imageData = this.imageData;
+ if (_originalEvent) {
+ var pointers = this.pointers;
+ var offset = getOffset(this.cropper);
+ var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
+ pageX: _originalEvent.pageX,
+ pageY: _originalEvent.pageY
+ }; // Zoom from the triggering point of the event
+
+ canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
+ canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
+ } else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
+ canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);
+ canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);
+ } else {
+ // Zoom from the center of the canvas
+ canvasData.left -= (newWidth - width) / 2;
+ canvasData.top -= (newHeight - height) / 2;
+ }
- var transformed = false;
+ canvasData.width = newWidth;
+ canvasData.height = newHeight;
+ this.renderCanvas(true);
+ }
- scaleX = Number(scaleX);
- scaleY = Number(scaleY);
+ return this;
+ },
- if (this.ready && !this.disabled && this.options.scalable) {
- if (isNumber(scaleX)) {
- imageData.scaleX = scaleX;
- transformed = true;
- }
+ /**
+ * Rotate the canvas with a relative degree
+ * @param {number} degree - The rotate degree.
+ * @returns {Cropper} this
+ */
+ rotate: function rotate(degree) {
+ return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
+ },
- if (isNumber(scaleY)) {
- imageData.scaleY = scaleY;
- transformed = true;
- }
+ /**
+ * Rotate the canvas to an absolute degree
+ * @param {number} degree - The rotate degree.
+ * @returns {Cropper} this
+ */
+ rotateTo: function rotateTo(degree) {
+ degree = Number(degree);
- if (transformed) {
+ if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {
+ this.imageData.rotate = degree % 360;
this.renderCanvas(true, true);
}
- }
-
- return this;
- },
-
-
- /**
- * Get the cropped area position and size data (base on the original image)
- * @param {boolean} [rounded=false] - Indicate if round the data values or not.
- * @returns {Object} The result cropped data.
- */
- getData: function getData$$1() {
- var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
- var options = this.options,
- imageData = this.imageData,
- canvasData = this.canvasData,
- cropBoxData = this.cropBoxData;
-
- var data = void 0;
-
- if (this.ready && this.cropped) {
- data = {
- x: cropBoxData.left - canvasData.left,
- y: cropBoxData.top - canvasData.top,
- width: cropBoxData.width,
- height: cropBoxData.height
- };
-
- var ratio = imageData.width / imageData.naturalWidth;
-
- each(data, function (n, i) {
- n /= ratio;
- data[i] = rounded ? Math.round(n) : n;
- });
- } else {
- data = {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- };
- }
- if (options.rotatable) {
- data.rotate = imageData.rotate || 0;
- }
-
- if (options.scalable) {
- data.scaleX = imageData.scaleX || 1;
- data.scaleY = imageData.scaleY || 1;
- }
-
- return data;
- },
-
-
- /**
- * Set the cropped area position and size with new data
- * @param {Object} data - The new data.
- * @returns {Object} this
- */
- setData: function setData$$1(data) {
- var options = this.options,
- imageData = this.imageData,
- canvasData = this.canvasData;
+ return this;
+ },
- var cropBoxData = {};
+ /**
+ * Scale the image on the x-axis.
+ * @param {number} scaleX - The scale ratio on the x-axis.
+ * @returns {Cropper} this
+ */
+ scaleX: function scaleX(_scaleX) {
+ var scaleY = this.imageData.scaleY;
+ return this.scale(_scaleX, isNumber(scaleY) ? scaleY : 1);
+ },
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ /**
+ * Scale the image on the y-axis.
+ * @param {number} scaleY - The scale ratio on the y-axis.
+ * @returns {Cropper} this
+ */
+ scaleY: function scaleY(_scaleY) {
+ var scaleX = this.imageData.scaleX;
+ return this.scale(isNumber(scaleX) ? scaleX : 1, _scaleY);
+ },
- if (this.ready && !this.disabled && isPlainObject(data)) {
+ /**
+ * Scale the image
+ * @param {number} scaleX - The scale ratio on the x-axis.
+ * @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
+ * @returns {Cropper} this
+ */
+ scale: function scale(scaleX) {
+ var scaleY = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : scaleX;
+ var imageData = this.imageData;
var transformed = false;
+ scaleX = Number(scaleX);
+ scaleY = Number(scaleY);
- if (options.rotatable) {
- if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {
- imageData.rotate = data.rotate;
+ if (this.ready && !this.disabled && this.options.scalable) {
+ if (isNumber(scaleX)) {
+ imageData.scaleX = scaleX;
transformed = true;
}
- }
- if (options.scalable) {
- if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {
- imageData.scaleX = data.scaleX;
+ if (isNumber(scaleY)) {
+ imageData.scaleY = scaleY;
transformed = true;
}
- if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {
- imageData.scaleY = data.scaleY;
- transformed = true;
+ if (transformed) {
+ this.renderCanvas(true, true);
}
}
- if (transformed) {
- this.renderCanvas(true, true);
- }
-
- var ratio = imageData.width / imageData.naturalWidth;
+ return this;
+ },
- if (isNumber(data.x)) {
- cropBoxData.left = data.x * ratio + canvasData.left;
- }
+ /**
+ * Get the cropped area position and size data (base on the original image)
+ * @param {boolean} [rounded=false] - Indicate if round the data values or not.
+ * @returns {Object} The result cropped data.
+ */
+ getData: function getData() {
+ var rounded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
+ var options = this.options,
+ imageData = this.imageData,
+ canvasData = this.canvasData,
+ cropBoxData = this.cropBoxData;
+ var data;
+
+ if (this.ready && this.cropped) {
+ data = {
+ x: cropBoxData.left - canvasData.left,
+ y: cropBoxData.top - canvasData.top,
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ };
+ var ratio = imageData.width / imageData.naturalWidth;
+ forEach(data, function (n, i) {
+ data[i] = n / ratio;
+ });
- if (isNumber(data.y)) {
- cropBoxData.top = data.y * ratio + canvasData.top;
+ if (rounded) {
+ // In case rounding off leads to extra 1px in right or bottom border
+ // we should round the top-left corner and the dimension (#343).
+ var bottom = Math.round(data.y + data.height);
+ var right = Math.round(data.x + data.width);
+ data.x = Math.round(data.x);
+ data.y = Math.round(data.y);
+ data.width = right - data.x;
+ data.height = bottom - data.y;
+ }
+ } else {
+ data = {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0
+ };
}
- if (isNumber(data.width)) {
- cropBoxData.width = data.width * ratio;
+ if (options.rotatable) {
+ data.rotate = imageData.rotate || 0;
}
- if (isNumber(data.height)) {
- cropBoxData.height = data.height * ratio;
+ if (options.scalable) {
+ data.scaleX = imageData.scaleX || 1;
+ data.scaleY = imageData.scaleY || 1;
}
- this.setCropBoxData(cropBoxData);
- }
-
- return this;
- },
-
-
- /**
- * Get the container size data.
- * @returns {Object} The result container data.
- */
- getContainerData: function getContainerData() {
- return this.ready ? extend({}, this.containerData) : {};
- },
-
-
- /**
- * Get the image position and size data.
- * @returns {Object} The result image data.
- */
- getImageData: function getImageData() {
- return this.loaded ? extend({}, this.imageData) : {};
- },
+ return data;
+ },
+ /**
+ * Set the cropped area position and size with new data
+ * @param {Object} data - The new data.
+ * @returns {Cropper} this
+ */
+ setData: function setData(data) {
+ var options = this.options,
+ imageData = this.imageData,
+ canvasData = this.canvasData;
+ var cropBoxData = {};
- /**
- * Get the canvas position and size data.
- * @returns {Object} The result canvas data.
- */
- getCanvasData: function getCanvasData() {
- var canvasData = this.canvasData;
+ if (this.ready && !this.disabled && isPlainObject(data)) {
+ var transformed = false;
- var data = {};
+ if (options.rotatable) {
+ if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {
+ imageData.rotate = data.rotate;
+ transformed = true;
+ }
+ }
- if (this.ready) {
- each(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
- data[n] = canvasData[n];
- });
- }
+ if (options.scalable) {
+ if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {
+ imageData.scaleX = data.scaleX;
+ transformed = true;
+ }
- return data;
- },
+ if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {
+ imageData.scaleY = data.scaleY;
+ transformed = true;
+ }
+ }
+ if (transformed) {
+ this.renderCanvas(true, true);
+ }
- /**
- * Set the canvas position and size with new data.
- * @param {Object} data - The new canvas data.
- * @returns {Object} this
- */
- setCanvasData: function setCanvasData(data) {
- var canvasData = this.canvasData;
- var aspectRatio = canvasData.aspectRatio;
+ var ratio = imageData.width / imageData.naturalWidth;
+ if (isNumber(data.x)) {
+ cropBoxData.left = data.x * ratio + canvasData.left;
+ }
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ if (isNumber(data.y)) {
+ cropBoxData.top = data.y * ratio + canvasData.top;
+ }
- if (this.ready && !this.disabled && isPlainObject(data)) {
- if (isNumber(data.left)) {
- canvasData.left = data.left;
- }
+ if (isNumber(data.width)) {
+ cropBoxData.width = data.width * ratio;
+ }
- if (isNumber(data.top)) {
- canvasData.top = data.top;
- }
+ if (isNumber(data.height)) {
+ cropBoxData.height = data.height * ratio;
+ }
- if (isNumber(data.width)) {
- canvasData.width = data.width;
- canvasData.height = data.width / aspectRatio;
- } else if (isNumber(data.height)) {
- canvasData.height = data.height;
- canvasData.width = data.height * aspectRatio;
+ this.setCropBoxData(cropBoxData);
}
- this.renderCanvas(true);
- }
-
- return this;
- },
+ return this;
+ },
+ /**
+ * Get the container size data.
+ * @returns {Object} The result container data.
+ */
+ getContainerData: function getContainerData() {
+ return this.ready ? assign({}, this.containerData) : {};
+ },
- /**
- * Get the crop box position and size data.
- * @returns {Object} The result crop box data.
- */
- getCropBoxData: function getCropBoxData() {
- var cropBoxData = this.cropBoxData;
+ /**
+ * Get the image position and size data.
+ * @returns {Object} The result image data.
+ */
+ getImageData: function getImageData() {
+ return this.sized ? assign({}, this.imageData) : {};
+ },
- var data = void 0;
+ /**
+ * Get the canvas position and size data.
+ * @returns {Object} The result canvas data.
+ */
+ getCanvasData: function getCanvasData() {
+ var canvasData = this.canvasData;
+ var data = {};
- if (this.ready && this.cropped) {
- data = {
- left: cropBoxData.left,
- top: cropBoxData.top,
- width: cropBoxData.width,
- height: cropBoxData.height
- };
- }
+ if (this.ready) {
+ forEach(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight'], function (n) {
+ data[n] = canvasData[n];
+ });
+ }
- return data || {};
- },
+ return data;
+ },
+ /**
+ * Set the canvas position and size with new data.
+ * @param {Object} data - The new canvas data.
+ * @returns {Cropper} this
+ */
+ setCanvasData: function setCanvasData(data) {
+ var canvasData = this.canvasData;
+ var aspectRatio = canvasData.aspectRatio;
- /**
- * Set the crop box position and size with new data.
- * @param {Object} data - The new crop box data.
- * @returns {Object} this
- */
- setCropBoxData: function setCropBoxData(data) {
- var cropBoxData = this.cropBoxData;
- var aspectRatio = this.options.aspectRatio;
+ if (this.ready && !this.disabled && isPlainObject(data)) {
+ if (isNumber(data.left)) {
+ canvasData.left = data.left;
+ }
- var widthChanged = void 0;
- var heightChanged = void 0;
+ if (isNumber(data.top)) {
+ canvasData.top = data.top;
+ }
- if (isFunction(data)) {
- data = data.call(this.element);
- }
+ if (isNumber(data.width)) {
+ canvasData.width = data.width;
+ canvasData.height = data.width / aspectRatio;
+ } else if (isNumber(data.height)) {
+ canvasData.height = data.height;
+ canvasData.width = data.height * aspectRatio;
+ }
- if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
- if (isNumber(data.left)) {
- cropBoxData.left = data.left;
+ this.renderCanvas(true);
}
- if (isNumber(data.top)) {
- cropBoxData.top = data.top;
- }
+ return this;
+ },
- if (isNumber(data.width) && data.width !== cropBoxData.width) {
- widthChanged = true;
- cropBoxData.width = data.width;
+ /**
+ * Get the crop box position and size data.
+ * @returns {Object} The result crop box data.
+ */
+ getCropBoxData: function getCropBoxData() {
+ var cropBoxData = this.cropBoxData;
+ var data;
+
+ if (this.ready && this.cropped) {
+ data = {
+ left: cropBoxData.left,
+ top: cropBoxData.top,
+ width: cropBoxData.width,
+ height: cropBoxData.height
+ };
}
- if (isNumber(data.height) && data.height !== cropBoxData.height) {
- heightChanged = true;
- cropBoxData.height = data.height;
- }
+ return data || {};
+ },
- if (aspectRatio) {
- if (widthChanged) {
- cropBoxData.height = cropBoxData.width / aspectRatio;
- } else if (heightChanged) {
- cropBoxData.width = cropBoxData.height * aspectRatio;
+ /**
+ * Set the crop box position and size with new data.
+ * @param {Object} data - The new crop box data.
+ * @returns {Cropper} this
+ */
+ setCropBoxData: function setCropBoxData(data) {
+ var cropBoxData = this.cropBoxData;
+ var aspectRatio = this.options.aspectRatio;
+ var widthChanged;
+ var heightChanged;
+
+ if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
+ if (isNumber(data.left)) {
+ cropBoxData.left = data.left;
}
- }
-
- this.renderCropBox();
- }
- return this;
- },
-
-
- /**
- * Get a canvas drawn the cropped image.
- * @param {Object} [options={}] - The config options.
- * @returns {HTMLCanvasElement} - The result canvas.
- */
- getCroppedCanvas: function getCroppedCanvas() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
- if (!this.ready || !window.HTMLCanvasElement) {
- return null;
- }
-
- var canvasData = this.canvasData;
-
- var source = getSourceCanvas(this.image, this.imageData, canvasData, options);
-
- // Returns the source canvas if it is not cropped.
- if (!this.cropped) {
- return source;
- }
-
- var _getData = this.getData(),
- x = _getData.x,
- y = _getData.y,
- initialWidth = _getData.width,
- initialHeight = _getData.height;
-
- var aspectRatio = initialWidth / initialHeight;
- var maxSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.maxWidth || Infinity,
- height: options.maxHeight || Infinity
- });
- var minSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.minWidth || 0,
- height: options.minHeight || 0
- });
-
- var _getContainSizes = getContainSizes({
- aspectRatio: aspectRatio,
- width: options.width || initialWidth,
- height: options.height || initialHeight
- }),
- width = _getContainSizes.width,
- height = _getContainSizes.height;
-
- width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
- height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
-
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
+ if (isNumber(data.top)) {
+ cropBoxData.top = data.top;
+ }
- canvas.width = normalizeDecimalNumber(width);
- canvas.height = normalizeDecimalNumber(height);
+ if (isNumber(data.width) && data.width !== cropBoxData.width) {
+ widthChanged = true;
+ cropBoxData.width = data.width;
+ }
- context.fillStyle = options.fillColor || 'transparent';
- context.fillRect(0, 0, width, height);
+ if (isNumber(data.height) && data.height !== cropBoxData.height) {
+ heightChanged = true;
+ cropBoxData.height = data.height;
+ }
- var _options$imageSmoothi = options.imageSmoothingEnabled,
- imageSmoothingEnabled = _options$imageSmoothi === undefined ? true : _options$imageSmoothi,
- imageSmoothingQuality = options.imageSmoothingQuality;
+ if (aspectRatio) {
+ if (widthChanged) {
+ cropBoxData.height = cropBoxData.width / aspectRatio;
+ } else if (heightChanged) {
+ cropBoxData.width = cropBoxData.height * aspectRatio;
+ }
+ }
+ this.renderCropBox();
+ }
- context.imageSmoothingEnabled = imageSmoothingEnabled;
+ return this;
+ },
- if (imageSmoothingQuality) {
- context.imageSmoothingQuality = imageSmoothingQuality;
- }
+ /**
+ * Get a canvas drawn the cropped image.
+ * @param {Object} [options={}] - The config options.
+ * @returns {HTMLCanvasElement} - The result canvas.
+ */
+ getCroppedCanvas: function getCroppedCanvas() {
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
- var sourceWidth = source.width;
- var sourceHeight = source.height;
-
- // Source canvas parameters
- var srcX = x;
- var srcY = y;
- var srcWidth = void 0;
- var srcHeight = void 0;
-
- // Destination canvas parameters
- var dstX = void 0;
- var dstY = void 0;
- var dstWidth = void 0;
- var dstHeight = void 0;
-
- if (srcX <= -initialWidth || srcX > sourceWidth) {
- srcX = 0;
- srcWidth = 0;
- dstX = 0;
- dstWidth = 0;
- } else if (srcX <= 0) {
- dstX = -srcX;
- srcX = 0;
- srcWidth = Math.min(sourceWidth, initialWidth + srcX);
- dstWidth = srcWidth;
- } else if (srcX <= sourceWidth) {
- dstX = 0;
- srcWidth = Math.min(initialWidth, sourceWidth - srcX);
- dstWidth = srcWidth;
- }
+ if (!this.ready || !window.HTMLCanvasElement) {
+ return null;
+ }
- if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {
- srcY = 0;
- srcHeight = 0;
- dstY = 0;
- dstHeight = 0;
- } else if (srcY <= 0) {
- dstY = -srcY;
- srcY = 0;
- srcHeight = Math.min(sourceHeight, initialHeight + srcY);
- dstHeight = srcHeight;
- } else if (srcY <= sourceHeight) {
- dstY = 0;
- srcHeight = Math.min(initialHeight, sourceHeight - srcY);
- dstHeight = srcHeight;
- }
+ var canvasData = this.canvasData;
+ var source = getSourceCanvas(this.image, this.imageData, canvasData, options); // Returns the source canvas if it is not cropped.
- // All the numerical parameters should be integer for `drawImage`
- // https://github.com/fengyuanchen/cropper/issues/476
- var params = [srcX, srcY, srcWidth, srcHeight];
+ if (!this.cropped) {
+ return source;
+ }
- // Avoid "IndexSizeError"
- if (dstWidth > 0 && dstHeight > 0) {
- var scale = width / initialWidth;
+ var _this$getData = this.getData(),
+ initialX = _this$getData.x,
+ initialY = _this$getData.y,
+ initialWidth = _this$getData.width,
+ initialHeight = _this$getData.height;
- params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
- }
+ var ratio = source.width / Math.floor(canvasData.naturalWidth);
- context.drawImage.apply(context, [source].concat(toConsumableArray(params.map(function (param) {
- return Math.floor(normalizeDecimalNumber(param));
- }))));
-
- return canvas;
- },
+ if (ratio !== 1) {
+ initialX *= ratio;
+ initialY *= ratio;
+ initialWidth *= ratio;
+ initialHeight *= ratio;
+ }
+ var aspectRatio = initialWidth / initialHeight;
+ var maxSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.maxWidth || Infinity,
+ height: options.maxHeight || Infinity
+ });
+ var minSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.minWidth || 0,
+ height: options.minHeight || 0
+ }, 'cover');
- /**
- * Change the aspect ratio of the crop box.
- * @param {number} aspectRatio - The new aspect ratio.
- * @returns {Object} this
- */
- setAspectRatio: function setAspectRatio(aspectRatio) {
- var options = this.options;
+ var _getAdjustedSizes = getAdjustedSizes({
+ aspectRatio: aspectRatio,
+ width: options.width || (ratio !== 1 ? source.width : initialWidth),
+ height: options.height || (ratio !== 1 ? source.height : initialHeight)
+ }),
+ width = _getAdjustedSizes.width,
+ height = _getAdjustedSizes.height;
+
+ width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
+ height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
+ var canvas = document.createElement('canvas');
+ var context = canvas.getContext('2d');
+ canvas.width = normalizeDecimalNumber(width);
+ canvas.height = normalizeDecimalNumber(height);
+ context.fillStyle = options.fillColor || 'transparent';
+ context.fillRect(0, 0, width, height);
+ var _options$imageSmoothi = options.imageSmoothingEnabled,
+ imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi,
+ imageSmoothingQuality = options.imageSmoothingQuality;
+ context.imageSmoothingEnabled = imageSmoothingEnabled;
+
+ if (imageSmoothingQuality) {
+ context.imageSmoothingQuality = imageSmoothingQuality;
+ } // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.drawImage
+
+
+ var sourceWidth = source.width;
+ var sourceHeight = source.height; // Source canvas parameters
+
+ var srcX = initialX;
+ var srcY = initialY;
+ var srcWidth;
+ var srcHeight; // Destination canvas parameters
+
+ var dstX;
+ var dstY;
+ var dstWidth;
+ var dstHeight;
+
+ if (srcX <= -initialWidth || srcX > sourceWidth) {
+ srcX = 0;
+ srcWidth = 0;
+ dstX = 0;
+ dstWidth = 0;
+ } else if (srcX <= 0) {
+ dstX = -srcX;
+ srcX = 0;
+ srcWidth = Math.min(sourceWidth, initialWidth + srcX);
+ dstWidth = srcWidth;
+ } else if (srcX <= sourceWidth) {
+ dstX = 0;
+ srcWidth = Math.min(initialWidth, sourceWidth - srcX);
+ dstWidth = srcWidth;
+ }
+
+ if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {
+ srcY = 0;
+ srcHeight = 0;
+ dstY = 0;
+ dstHeight = 0;
+ } else if (srcY <= 0) {
+ dstY = -srcY;
+ srcY = 0;
+ srcHeight = Math.min(sourceHeight, initialHeight + srcY);
+ dstHeight = srcHeight;
+ } else if (srcY <= sourceHeight) {
+ dstY = 0;
+ srcHeight = Math.min(initialHeight, sourceHeight - srcY);
+ dstHeight = srcHeight;
+ }
+
+ var params = [srcX, srcY, srcWidth, srcHeight]; // Avoid "IndexSizeError"
+
+ if (dstWidth > 0 && dstHeight > 0) {
+ var scale = width / initialWidth;
+ params.push(dstX * scale, dstY * scale, dstWidth * scale, dstHeight * scale);
+ } // All the numerical parameters should be integer for `drawImage`
+ // https://github.com/fengyuanchen/cropper/issues/476
+
+
+ context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function (param) {
+ return Math.floor(normalizeDecimalNumber(param));
+ }))));
+ return canvas;
+ },
+ /**
+ * Change the aspect ratio of the crop box.
+ * @param {number} aspectRatio - The new aspect ratio.
+ * @returns {Cropper} this
+ */
+ setAspectRatio: function setAspectRatio(aspectRatio) {
+ var options = this.options;
- if (!this.disabled && !isUndefined(aspectRatio)) {
- // 0 -> NaN
- options.aspectRatio = Math.max(0, aspectRatio) || NaN;
+ if (!this.disabled && !isUndefined(aspectRatio)) {
+ // 0 -> NaN
+ options.aspectRatio = Math.max(0, aspectRatio) || NaN;
- if (this.ready) {
- this.initCropBox();
+ if (this.ready) {
+ this.initCropBox();
- if (this.cropped) {
- this.renderCropBox();
+ if (this.cropped) {
+ this.renderCropBox();
+ }
}
}
- }
-
- return this;
- },
-
-
- /**
- * Change the drag mode.
- * @param {string} mode - The new drag mode.
- * @returns {Object} this
- */
- setDragMode: function setDragMode(mode) {
- var options = this.options,
- dragBox = this.dragBox,
- face = this.face;
-
- if (this.loaded && !this.disabled) {
- var croppable = mode === DRAG_MODE_CROP;
- var movable = options.movable && mode === DRAG_MODE_MOVE;
+ return this;
+ },
- mode = croppable || movable ? mode : DRAG_MODE_NONE;
-
- setData(dragBox, DATA_ACTION, mode);
- toggleClass(dragBox, CLASS_CROP, croppable);
- toggleClass(dragBox, CLASS_MOVE, movable);
-
- if (!options.cropBoxMovable) {
- // Sync drag mode to crop box when it is not movable
- setData(face, DATA_ACTION, mode);
- toggleClass(face, CLASS_CROP, croppable);
- toggleClass(face, CLASS_MOVE, movable);
+ /**
+ * Change the drag mode.
+ * @param {string} mode - The new drag mode.
+ * @returns {Cropper} this
+ */
+ setDragMode: function setDragMode(mode) {
+ var options = this.options,
+ dragBox = this.dragBox,
+ face = this.face;
+
+ if (this.ready && !this.disabled) {
+ var croppable = mode === DRAG_MODE_CROP;
+ var movable = options.movable && mode === DRAG_MODE_MOVE;
+ mode = croppable || movable ? mode : DRAG_MODE_NONE;
+ options.dragMode = mode;
+ setData(dragBox, DATA_ACTION, mode);
+ toggleClass(dragBox, CLASS_CROP, croppable);
+ toggleClass(dragBox, CLASS_MOVE, movable);
+
+ if (!options.cropBoxMovable) {
+ // Sync drag mode to crop box when it is not movable
+ setData(face, DATA_ACTION, mode);
+ toggleClass(face, CLASS_CROP, croppable);
+ toggleClass(face, CLASS_MOVE, movable);
+ }
}
- }
-
- return this;
- }
-};
-
-var AnotherCropper = WINDOW.Cropper;
-
-var Cropper = function () {
- /**
- * Create a new Cropper.
- * @param {Element} element - The target element for cropping.
- * @param {Object} [options={}] - The configuration options.
- */
- function Cropper(element) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- classCallCheck(this, Cropper);
- if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
- throw new Error('The first argument is required and must be an <img> or <canvas> element.');
+ return this;
}
+ };
- this.element = element;
- this.options = extend({}, DEFAULTS, isPlainObject(options) && options);
- this.complete = false;
- this.cropped = false;
- this.disabled = false;
- this.isImg = false;
- this.limited = false;
- this.loaded = false;
- this.ready = false;
- this.replaced = false;
- this.wheeling = false;
- this.originalUrl = '';
- this.canvasData = null;
- this.cropBoxData = null;
- this.previews = null;
- this.pointers = {};
- this.init();
- }
+ var AnotherCropper = WINDOW.Cropper;
- createClass(Cropper, [{
- key: 'init',
- value: function init() {
- var element = this.element;
+ var Cropper =
+ /*#__PURE__*/
+ function () {
+ /**
+ * Create a new Cropper.
+ * @param {Element} element - The target element for cropping.
+ * @param {Object} [options={}] - The configuration options.
+ */
+ function Cropper(element) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var tagName = element.tagName.toLowerCase();
- var url = void 0;
+ _classCallCheck(this, Cropper);
- if (getData(element, NAMESPACE)) {
- return;
+ if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
+ throw new Error('The first argument is required and must be an <img> or <canvas> element.');
}
- setData(element, NAMESPACE, this);
-
- if (tagName === 'img') {
- this.isImg = true;
+ this.element = element;
+ this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
+ this.cropped = false;
+ this.disabled = false;
+ this.pointers = {};
+ this.ready = false;
+ this.reloading = false;
+ this.replaced = false;
+ this.sized = false;
+ this.sizing = false;
+ this.init();
+ }
- // e.g.: "img/picture.jpg"
- url = element.getAttribute('src') || '';
- this.originalUrl = url;
+ _createClass(Cropper, [{
+ key: "init",
+ value: function init() {
+ var element = this.element;
+ var tagName = element.tagName.toLowerCase();
+ var url;
- // Stop when it's a blank image
- if (!url) {
+ if (element[NAMESPACE]) {
return;
}
- // e.g.: "http://example.com/img/picture.jpg"
- url = element.src;
- } else if (tagName === 'canvas' && window.HTMLCanvasElement) {
- url = element.toDataURL();
- }
+ element[NAMESPACE] = this;
- this.load(url);
- }
- }, {
- key: 'load',
- value: function load(url) {
- var _this = this;
+ if (tagName === 'img') {
+ this.isImg = true; // e.g.: "img/picture.jpg"
- if (!url) {
- return;
- }
+ url = element.getAttribute('src') || '';
+ this.originalUrl = url; // Stop when it's a blank image
- this.url = url;
- this.imageData = {};
+ if (!url) {
+ return;
+ } // e.g.: "http://example.com/img/picture.jpg"
- var element = this.element,
- options = this.options;
+ url = element.src;
+ } else if (tagName === 'canvas' && window.HTMLCanvasElement) {
+ url = element.toDataURL();
+ }
- if (!options.checkOrientation || !window.ArrayBuffer) {
- this.clone();
- return;
+ this.load(url);
}
+ }, {
+ key: "load",
+ value: function load(url) {
+ var _this = this;
- // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari
- if (REGEXP_DATA_URL.test(url)) {
- if (REGEXP_DATA_URL_JPEG.test(url)) {
- this.read(dataURLToArrayBuffer(url));
- } else {
- this.clone();
+ if (!url) {
+ return;
}
- return;
- }
+ this.url = url;
+ this.imageData = {};
+ var element = this.element,
+ options = this.options;
- var xhr = new XMLHttpRequest();
+ if (!options.rotatable && !options.scalable) {
+ options.checkOrientation = false;
+ } // Only IE10+ supports Typed Arrays
- xhr.onerror = function () {
- _this.clone();
- };
- xhr.onload = function () {
- _this.read(xhr.response);
- };
+ if (!options.checkOrientation || !window.ArrayBuffer) {
+ this.clone();
+ return;
+ } // Detect the mime type of the image directly if it is a Data URL
- if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
- url = addTimestamp(url);
- }
- xhr.open('get', url);
- xhr.responseType = 'arraybuffer';
- xhr.withCredentials = element.crossOrigin === 'use-credentials';
- xhr.send();
- }
- }, {
- key: 'read',
- value: function read(arrayBuffer) {
- var options = this.options,
- imageData = this.imageData;
+ if (REGEXP_DATA_URL.test(url)) {
+ // Read ArrayBuffer from Data URL of JPEG images directly for better performance
+ if (REGEXP_DATA_URL_JPEG.test(url)) {
+ this.read(dataURLToArrayBuffer(url));
+ } else {
+ // Only a JPEG image may contains Exif Orientation information,
+ // the rest types of Data URLs are not necessary to check orientation at all.
+ this.clone();
+ }
- var orientation = getOrientation(arrayBuffer);
- var rotate = 0;
- var scaleX = 1;
- var scaleY = 1;
+ return;
+ } // 1. Detect the mime type of the image by a XMLHttpRequest.
+ // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.
+
+
+ var xhr = new XMLHttpRequest();
+ var clone = this.clone.bind(this);
+ this.reloading = true;
+ this.xhr = xhr; // 1. Cross origin requests are only supported for protocol schemes:
+ // http, https, data, chrome, chrome-extension.
+ // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy
+ // in some browsers as IE11 and Safari.
+
+ xhr.onabort = clone;
+ xhr.onerror = clone;
+ xhr.ontimeout = clone;
+
+ xhr.onprogress = function () {
+ // Abort the request directly if it not a JPEG image for better performance
+ if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {
+ xhr.abort();
+ }
+ };
- if (orientation > 1) {
- this.url = arrayBufferToDataURL(arrayBuffer, 'image/jpeg');
+ xhr.onload = function () {
+ _this.read(xhr.response);
+ };
- var _parseOrientation = parseOrientation(orientation);
+ xhr.onloadend = function () {
+ _this.reloading = false;
+ _this.xhr = null;
+ }; // Bust cache when there is a "crossOrigin" property to avoid browser cache error
- rotate = _parseOrientation.rotate;
- scaleX = _parseOrientation.scaleX;
- scaleY = _parseOrientation.scaleY;
- }
- if (options.rotatable) {
- imageData.rotate = rotate;
- }
+ if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
+ url = addTimestamp(url);
+ }
- if (options.scalable) {
- imageData.scaleX = scaleX;
- imageData.scaleY = scaleY;
+ xhr.open('GET', url);
+ xhr.responseType = 'arraybuffer';
+ xhr.withCredentials = element.crossOrigin === 'use-credentials';
+ xhr.send();
}
+ }, {
+ key: "read",
+ value: function read(arrayBuffer) {
+ var options = this.options,
+ imageData = this.imageData; // Reset the orientation value to its default value 1
+ // as some iOS browsers will render image with its orientation
- this.clone();
- }
- }, {
- key: 'clone',
- value: function clone() {
- var element = this.element,
- url = this.url;
+ var orientation = resetAndGetOrientation(arrayBuffer);
+ var rotate = 0;
+ var scaleX = 1;
+ var scaleY = 1;
- var crossOrigin = void 0;
- var crossOriginUrl = void 0;
+ if (orientation > 1) {
+ // Generate a new URL which has the default orientation value
+ this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
- if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
- crossOrigin = element.crossOrigin;
+ var _parseOrientation = parseOrientation(orientation);
-
- if (crossOrigin) {
- crossOriginUrl = url;
- } else {
- crossOrigin = 'anonymous';
-
- // Bust cache when there is not a "crossOrigin" property
- crossOriginUrl = addTimestamp(url);
+ rotate = _parseOrientation.rotate;
+ scaleX = _parseOrientation.scaleX;
+ scaleY = _parseOrientation.scaleY;
}
- }
- this.crossOrigin = crossOrigin;
- this.crossOriginUrl = crossOriginUrl;
+ if (options.rotatable) {
+ imageData.rotate = rotate;
+ }
- var image = document.createElement('img');
+ if (options.scalable) {
+ imageData.scaleX = scaleX;
+ imageData.scaleY = scaleY;
+ }
- if (crossOrigin) {
- image.crossOrigin = crossOrigin;
+ this.clone();
}
+ }, {
+ key: "clone",
+ value: function clone() {
+ var element = this.element,
+ url = this.url;
+ var crossOrigin = element.crossOrigin;
+ var crossOriginUrl = url;
- image.src = crossOriginUrl || url;
-
- var start = proxy(this.start, this);
- var stop = proxy(this.stop, this);
+ if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
+ if (!crossOrigin) {
+ crossOrigin = 'anonymous';
+ } // Bust cache when there is not a "crossOrigin" property (#519)
- this.image = image;
- this.onStart = start;
- this.onStop = stop;
- if (this.isImg) {
- if (element.complete) {
- this.start();
- } else {
- addListener(element, EVENT_LOAD, start);
+ crossOriginUrl = addTimestamp(url);
}
- } else {
- addListener(image, EVENT_LOAD, start);
- addListener(image, EVENT_ERROR, stop);
- addClass(image, CLASS_HIDE);
- element.parentNode.insertBefore(image, element.nextSibling);
- }
- }
- }, {
- key: 'start',
- value: function start(event) {
- var _this2 = this;
-
- var image = this.isImg ? this.element : this.image;
-
- if (event) {
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- }
-
- getImageNaturalSizes(image, function (naturalWidth, naturalHeight) {
- extend(_this2.imageData, {
- naturalWidth: naturalWidth,
- naturalHeight: naturalHeight,
- aspectRatio: naturalWidth / naturalHeight
- });
- _this2.loaded = true;
- _this2.build();
- });
- }
- }, {
- key: 'stop',
- value: function stop() {
- var image = this.image;
+ this.crossOrigin = crossOrigin;
+ this.crossOriginUrl = crossOriginUrl;
+ var image = document.createElement('img');
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- image.parentNode.removeChild(image);
- this.image = null;
- }
- }, {
- key: 'build',
- value: function build() {
- var _this3 = this;
+ if (crossOrigin) {
+ image.crossOrigin = crossOrigin;
+ }
- if (!this.loaded) {
- return;
+ image.src = crossOriginUrl || url;
+ image.alt = element.alt || 'The image to crop';
+ this.image = image;
+ image.onload = this.start.bind(this);
+ image.onerror = this.stop.bind(this);
+ addClass(image, CLASS_HIDE);
+ element.parentNode.insertBefore(image, element.nextSibling);
}
+ }, {
+ key: "start",
+ value: function start() {
+ var _this2 = this;
- // Unbuild first when replace
- if (this.ready) {
- this.unbuild();
- }
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ this.sizing = true; // Match all browsers that use WebKit as the layout engine in iOS devices,
+ // such as Safari for iOS, Chrome for iOS, and in-app browsers.
- var element = this.element,
- options = this.options,
- image = this.image;
+ var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
- // Create cropper elements
+ var done = function done(naturalWidth, naturalHeight) {
+ assign(_this2.imageData, {
+ naturalWidth: naturalWidth,
+ naturalHeight: naturalHeight,
+ aspectRatio: naturalWidth / naturalHeight
+ });
+ _this2.sizing = false;
+ _this2.sized = true;
- var container = element.parentNode;
- var template = document.createElement('div');
+ _this2.build();
+ }; // Most modern browsers (excepts iOS WebKit)
- template.innerHTML = TEMPLATE;
- var cropper = template.querySelector('.' + NAMESPACE + '-container');
- var canvas = cropper.querySelector('.' + NAMESPACE + '-canvas');
- var dragBox = cropper.querySelector('.' + NAMESPACE + '-drag-box');
- var cropBox = cropper.querySelector('.' + NAMESPACE + '-crop-box');
- var face = cropBox.querySelector('.' + NAMESPACE + '-face');
+ if (image.naturalWidth && !isIOSWebKit) {
+ done(image.naturalWidth, image.naturalHeight);
+ return;
+ }
- this.container = container;
- this.cropper = cropper;
- this.canvas = canvas;
- this.dragBox = dragBox;
- this.cropBox = cropBox;
- this.viewBox = cropper.querySelector('.' + NAMESPACE + '-view-box');
- this.face = face;
+ var sizingImage = document.createElement('img');
+ var body = document.body || document.documentElement;
+ this.sizingImage = sizingImage;
- canvas.appendChild(image);
+ sizingImage.onload = function () {
+ done(sizingImage.width, sizingImage.height);
- // Hide the original image
- addClass(element, CLASS_HIDDEN);
+ if (!isIOSWebKit) {
+ body.removeChild(sizingImage);
+ }
+ };
- // Inserts the cropper after to the current image
- container.insertBefore(cropper, element.nextSibling);
+ sizingImage.src = image.src; // iOS WebKit will convert the image automatically
+ // with its orientation once append it into DOM (#279)
- // Show the image if is hidden
- if (!this.isImg) {
- removeClass(image, CLASS_HIDE);
+ if (!isIOSWebKit) {
+ sizingImage.style.cssText = 'left:0;' + 'max-height:none!important;' + 'max-width:none!important;' + 'min-height:0!important;' + 'min-width:0!important;' + 'opacity:0;' + 'position:absolute;' + 'top:0;' + 'z-index:-1;';
+ body.appendChild(sizingImage);
+ }
}
+ }, {
+ key: "stop",
+ value: function stop() {
+ var image = this.image;
+ image.onload = null;
+ image.onerror = null;
+ image.parentNode.removeChild(image);
+ this.image = null;
+ }
+ }, {
+ key: "build",
+ value: function build() {
+ if (!this.sized || this.ready) {
+ return;
+ }
- this.initPreview();
- this.bind();
+ var element = this.element,
+ options = this.options,
+ image = this.image; // Create cropper elements
+
+ var container = element.parentNode;
+ var template = document.createElement('div');
+ template.innerHTML = TEMPLATE;
+ var cropper = template.querySelector(".".concat(NAMESPACE, "-container"));
+ var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas"));
+ var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box"));
+ var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box"));
+ var face = cropBox.querySelector(".".concat(NAMESPACE, "-face"));
+ this.container = container;
+ this.cropper = cropper;
+ this.canvas = canvas;
+ this.dragBox = dragBox;
+ this.cropBox = cropBox;
+ this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box"));
+ this.face = face;
+ canvas.appendChild(image); // Hide the original image
+
+ addClass(element, CLASS_HIDDEN); // Inserts the cropper after to the current image
+
+ container.insertBefore(cropper, element.nextSibling); // Show the image if is hidden
+
+ if (!this.isImg) {
+ removeClass(image, CLASS_HIDE);
+ }
- options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
- options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
+ this.initPreview();
+ this.bind();
+ options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
+ options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
+ options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
+ addClass(cropBox, CLASS_HIDDEN);
- this.cropped = options.autoCrop;
+ if (!options.guides) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN);
+ }
- if (options.autoCrop) {
- if (options.modal) {
- addClass(dragBox, CLASS_MODAL);
+ if (!options.center) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN);
}
- } else {
- addClass(cropBox, CLASS_HIDDEN);
- }
- if (!options.guides) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-dashed'), CLASS_HIDDEN);
- }
+ if (options.background) {
+ addClass(cropper, "".concat(NAMESPACE, "-bg"));
+ }
- if (!options.center) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-center'), CLASS_HIDDEN);
- }
+ if (!options.highlight) {
+ addClass(face, CLASS_INVISIBLE);
+ }
- if (options.background) {
- addClass(cropper, NAMESPACE + '-bg');
- }
+ if (options.cropBoxMovable) {
+ addClass(face, CLASS_MOVE);
+ setData(face, DATA_ACTION, ACTION_ALL);
+ }
- if (!options.highlight) {
- addClass(face, CLASS_INVISIBLE);
- }
+ if (!options.cropBoxResizable) {
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN);
+ addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN);
+ }
- if (options.cropBoxMovable) {
- addClass(face, CLASS_MOVE);
- setData(face, DATA_ACTION, ACTION_ALL);
- }
+ this.render();
+ this.ready = true;
+ this.setDragMode(options.dragMode);
- if (!options.cropBoxResizable) {
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-line'), CLASS_HIDDEN);
- addClass(cropBox.getElementsByClassName(NAMESPACE + '-point'), CLASS_HIDDEN);
- }
+ if (options.autoCrop) {
+ this.crop();
+ }
- this.setDragMode(options.dragMode);
- this.render();
- this.ready = true;
- this.setData(options.data);
+ this.setData(options.data);
- // Call the "ready" option asynchronously to keep "image.cropper" is defined
- this.completing = setTimeout(function () {
if (isFunction(options.ready)) {
addListener(element, EVENT_READY, options.ready, {
once: true
@@ -3693,74 +3551,66 @@ var Cropper = function () {
}
dispatchEvent(element, EVENT_READY);
- dispatchEvent(element, EVENT_CROP, _this3.getData());
-
- _this3.complete = true;
- }, 0);
- }
- }, {
- key: 'unbuild',
- value: function unbuild() {
- if (!this.ready) {
- return;
}
+ }, {
+ key: "unbuild",
+ value: function unbuild() {
+ if (!this.ready) {
+ return;
+ }
- if (!this.complete) {
- clearTimeout(this.completing);
+ this.ready = false;
+ this.unbind();
+ this.resetPreview();
+ this.cropper.parentNode.removeChild(this.cropper);
+ removeClass(this.element, CLASS_HIDDEN);
+ }
+ }, {
+ key: "uncreate",
+ value: function uncreate() {
+ if (this.ready) {
+ this.unbuild();
+ this.ready = false;
+ this.cropped = false;
+ } else if (this.sizing) {
+ this.sizingImage.onload = null;
+ this.sizing = false;
+ this.sized = false;
+ } else if (this.reloading) {
+ this.xhr.onabort = null;
+ this.xhr.abort();
+ } else if (this.image) {
+ this.stop();
+ }
}
+ /**
+ * Get the no conflict cropper class.
+ * @returns {Cropper} The cropper class.
+ */
- this.ready = false;
- this.complete = false;
- this.initialImageData = null;
-
- // Clear `initialCanvasData` is necessary when replace
- this.initialCanvasData = null;
- this.initialCropBoxData = null;
- this.containerData = null;
- this.canvasData = null;
-
- // Clear `cropBoxData` is necessary when replace
- this.cropBoxData = null;
- this.unbind();
- this.resetPreview();
- this.previews = null;
- this.viewBox = null;
- this.cropBox = null;
- this.dragBox = null;
- this.canvas = null;
- this.container = null;
- this.cropper.parentNode.removeChild(this.cropper);
- this.cropper = null;
- }
+ }], [{
+ key: "noConflict",
+ value: function noConflict() {
+ window.Cropper = AnotherCropper;
+ return Cropper;
+ }
+ /**
+ * Change the default options.
+ * @param {Object} options - The new default options.
+ */
- /**
- * Get the no conflict cropper class.
- * @returns {Cropper} The cropper class.
- */
+ }, {
+ key: "setDefaults",
+ value: function setDefaults(options) {
+ assign(DEFAULTS, isPlainObject(options) && options);
+ }
+ }]);
- }], [{
- key: 'noConflict',
- value: function noConflict() {
- window.Cropper = AnotherCropper;
- return Cropper;
- }
+ return Cropper;
+ }();
- /**
- * Change the default options.
- * @param {Object} options - The new default options.
- */
+ assign(Cropper.prototype, render, preview, events, handlers, change, methods);
- }, {
- key: 'setDefaults',
- value: function setDefaults(options) {
- extend(DEFAULTS, isPlainObject(options) && options);
- }
- }]);
return Cropper;
-}();
-
-extend(Cropper.prototype, render, preview, events, handlers, change, methods);
-
-return Cropper;
-})));
+}));
diff --git a/library/cropperjs/docs/js/main.js b/library/cropperjs/docs/js/main.js
index d74afbd60..b54ad6453 100644
--- a/library/cropperjs/docs/js/main.js
+++ b/library/cropperjs/docs/js/main.js
@@ -1,5 +1,4 @@
window.onload = function () {
-
'use strict';
var Cropper = window.Cropper;
@@ -49,6 +48,7 @@ window.onload = function () {
var cropper = new Cropper(image, options);
var originalImageURL = image.src;
var uploadedImageType = 'image/jpeg';
+ var uploadedImageName = 'cropped.jpg';
var uploadedImageURL;
// Tooltip
@@ -67,6 +67,7 @@ window.onload = function () {
// Download
if (typeof download.download === 'undefined') {
download.className += ' disabled';
+ download.title = 'Your browser does not support download';
}
// Options
@@ -206,6 +207,7 @@ window.onload = function () {
$('#getCroppedCanvasModal').modal().find('.modal-body').html(result);
if (!download.disabled) {
+ download.download = uploadedImageName;
download.href = result.toDataURL(uploadedImageType);
}
}
@@ -237,7 +239,7 @@ window.onload = function () {
document.body.onkeydown = function (event) {
var e = event || window.event;
- if (!cropper || this.scrollTop > 300) {
+ if (e.target !== this || !cropper || this.scrollTop > 300) {
return;
}
@@ -277,6 +279,7 @@ window.onload = function () {
if (/^image\/\w+/.test(file.type)) {
uploadedImageType = file.type;
+ uploadedImageName = file.name;
if (uploadedImageURL) {
URL.revokeObjectURL(uploadedImageURL);
diff --git a/library/cropperjs/examples/crop-a-round-image.html b/library/cropperjs/examples/crop-a-round-image.html
deleted file mode 100644
index da027d847..000000000
--- a/library/cropperjs/examples/crop-a-round-image.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
- <style>
- .container {
- max-width: 640px;
- margin: 20px auto;
- }
-
- img {
- max-width: 100%;
- }
-
- .cropper-view-box,
- .cropper-face {
- border-radius: 50%;
- }
- </style>
-</head>
-<body>
-
- <div class="container">
- <h1>Crop a round image</h1>
- <h3>Image</h3>
- <div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
- </div>
- <h3>Result</h3>
- <p>
- <button type="button" id="button">Crop</button>
- </p>
- <div id="result"></div>
- </div>
-
- <script src="../dist/cropper.js"></script>
- <script>
- (function () {
-
- function getRoundedCanvas(sourceCanvas) {
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
- var width = sourceCanvas.width;
- var height = sourceCanvas.height;
-
- canvas.width = width;
- canvas.height = height;
-
- context.imageSmoothingEnabled = true;
- context.drawImage(sourceCanvas, 0, 0, width, height);
- context.globalCompositeOperation = 'destination-in';
- context.beginPath();
- context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true);
- context.fill();
-
- return canvas;
- }
-
- window.addEventListener('DOMContentLoaded', function () {
- var image = document.getElementById('image');
- var button = document.getElementById('button');
- var result = document.getElementById('result');
- var croppable = false;
- var cropper = new Cropper(image, {
- aspectRatio: 1,
- viewMode: 1,
- ready: function () {
- croppable = true;
- }
- });
-
- button.onclick = function () {
- var croppedCanvas;
- var roundedCanvas;
- var roundedImage;
-
- if (!croppable) {
- return;
- }
-
- // Crop
- croppedCanvas = cropper.getCroppedCanvas();
-
- // Round
- roundedCanvas = getRoundedCanvas(croppedCanvas);
-
- // Show
- roundedImage = document.createElement('img');
- roundedImage.src = roundedCanvas.toDataURL()
- result.innerHTML = '';
- result.appendChild(roundedImage);
- };
-
- });
-
- })();
- </script>
-</body>
-</html>
diff --git a/library/cropperjs/examples/mask-an-image.html b/library/cropperjs/examples/mask-an-image.html
deleted file mode 100644
index d821da43b..000000000
--- a/library/cropperjs/examples/mask-an-image.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>Cropper.js</title>
- <link rel="stylesheet" href="../dist/cropper.css">
- <style>
- .container {
- max-width: 640px;
- margin: 20px auto;
- }
-
- img {
- max-width: 100%;
- }
-
- .cropper-view-box,
- .cropper-face {
- background-color: black;
- opacity: 1;
- }
-
- </style>
-</head>
-
-<body>
-
- <div class="container">
- <h1>Mask an image (Redaction)</h1>
- <h3>Image</h3>
- <div>
- <img id="image" src="../docs/images/picture.jpg" alt="Picture">
- </div>
- <h3>Result</h3>
- <p><button type="button" id="button">Mask</button></p>
- <div id="result"></div>
- </div>
-
- <script src="../dist/cropper.js"></script>
- <script>
- (function () {
-
- function getMaskedCanvas(sourceCanvas, sourceImage, cropper) {
- var canvas = document.createElement('canvas');
- var context = canvas.getContext('2d');
-
- var maskWidth = cropper.getData().width;
- var maskHeight = cropper.getData().height;
- var maskTop = cropper.getData().y;
- var maskLeft = cropper.getData().x;
-
- var imageWidth = cropper.getImageData().naturalWidth;
- var imageHeight = cropper.getImageData().naturalHeight;
- var imageLeft = cropper.getImageData().left;
- var imageTop = cropper.getImageData().top;
- var imageAspect = cropper.getImageData().aspectRatio;
-
- canvas.width = imageWidth;
- canvas.height = imageHeight;
-
- // debug
- console.log('Image Width: ' + imageWidth + ' Image Height: ' + imageHeight + ' Image Aspect Ratio: ' + imageAspect );
- console.log('Image Left: ' + imageLeft + ' Image Top: ' + imageTop );
- console.log('Mask Width: ' + maskWidth + ' Mask Height: ' + maskHeight + ' Mask Left: ' + maskLeft + ' Mask Top: ' + maskTop);
-
- context.imageSmoothingEnabled = true;
- context.drawImage(image, 0, 0, imageWidth, imageHeight);
- context.fillRect(maskLeft, maskTop, maskWidth, maskHeight);
-
- return canvas;
- }
-
- window.addEventListener('DOMContentLoaded', function () {
- var image = document.getElementById('image');
- var button = document.getElementById('button');
- var result = document.getElementById('result');
- var croppable = false;
- var cropper = new Cropper(image, {
- viewMode: 0,
- guides: true,
- center: true,
- highlight: true,
- cropBoxMovable: true,
- cropBoxResizable: true,
- ready: function () {
- croppable = true;
- }
- });
-
- button.onclick = function () {
- var croppedCanvas;
- var roundedCanvas;
- var roundedImage;
-
- if (!croppable) {
- return;
- }
-
- // Crop
- croppedCanvas = cropper.getCroppedCanvas();
-
- // Mask
- maskedCanvas = getMaskedCanvas(croppedCanvas, image, cropper);
-
- // Show
- maskedImage = document.createElement('img');
- maskedImage.src = maskedCanvas.toDataURL()
- result.innerHTML = '';
- result.appendChild(maskedImage);
-
- };
-
- });
-
- })();
-
- </script>
-</body>
-
-</html>
diff --git a/library/cropperjs/package-lock.json b/library/cropperjs/package-lock.json
index 229ee70fa..d19eef9b4 100644
--- a/library/cropperjs/package-lock.json
+++ b/library/cropperjs/package-lock.json
@@ -1,799 +1,2182 @@
{
"name": "cropperjs",
- "version": "1.2.2",
+ "version": "1.5.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
- "JSONStream": {
- "version": "0.8.4",
- "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz",
- "integrity": "sha1-kWV9/m/4V0gwZhMrRhi2Lo9Ih70=",
+ "@babel/code-frame": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
+ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
"dev": true,
"requires": {
- "jsonparse": "0.0.5",
- "through": "2.3.8"
+ "@babel/highlight": "^7.0.0"
}
},
- "acorn": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz",
- "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==",
- "dev": true
- },
- "acorn-jsx": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
- "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
+ "@babel/core": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.2.tgz",
+ "integrity": "sha512-l8zto/fuoZIbncm+01p8zPSDZu/VuuJhAfA7d/AbzM09WR7iVhavvfNDYCNpo1VvLk6E6xgAoP9P+/EMJHuRkQ==",
"dev": true,
"requires": {
- "acorn": "3.3.0"
+ "@babel/code-frame": "^7.5.5",
+ "@babel/generator": "^7.6.2",
+ "@babel/helpers": "^7.6.2",
+ "@babel/parser": "^7.6.2",
+ "@babel/template": "^7.6.0",
+ "@babel/traverse": "^7.6.2",
+ "@babel/types": "^7.6.0",
+ "convert-source-map": "^1.1.0",
+ "debug": "^4.1.0",
+ "json5": "^2.1.0",
+ "lodash": "^4.17.13",
+ "resolve": "^1.3.2",
+ "semver": "^5.4.1",
+ "source-map": "^0.5.0"
},
"dependencies": {
- "acorn": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
- "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=",
+ "@babel/code-frame": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
+ "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.0.0"
+ }
+ },
+ "@babel/generator": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.2.tgz",
+ "integrity": "sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.6.0",
+ "jsesc": "^2.5.1",
+ "lodash": "^4.17.13",
+ "source-map": "^0.5.0"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.2.tgz",
+ "integrity": "sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg==",
"dev": true
+ },
+ "@babel/template": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
+ "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.6.0",
+ "@babel/types": "^7.6.0"
+ }
+ },
+ "@babel/traverse": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.2.tgz",
+ "integrity": "sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.5.5",
+ "@babel/generator": "^7.6.2",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/parser": "^7.6.2",
+ "@babel/types": "^7.6.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0",
+ "lodash": "^4.17.13"
+ }
+ },
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
}
}
},
- "ajv": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.2.3.tgz",
- "integrity": "sha1-wG9Zh3jETGsWGrr+NGa4GtGBTtI=",
+ "@babel/generator": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz",
+ "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==",
"dev": true,
"requires": {
- "co": "4.6.0",
- "fast-deep-equal": "1.0.0",
- "json-schema-traverse": "0.3.1",
- "json-stable-stringify": "1.0.1"
+ "@babel/types": "^7.5.5",
+ "jsesc": "^2.5.1",
+ "lodash": "^4.17.13",
+ "source-map": "^0.5.0",
+ "trim-right": "^1.0.1"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
+ "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "dev": true
+ }
}
},
- "ajv-keywords": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.0.tgz",
- "integrity": "sha1-opbhf3v658HOT34N5T0pyzIWLfA=",
- "dev": true
- },
- "alphanum-sort": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz",
- "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
- "dev": true
- },
- "amdefine": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
- "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
- "dev": true
- },
- "ansi-align": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz",
- "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=",
+ "@babel/helper-annotate-as-pure": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz",
+ "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==",
"dev": true,
"requires": {
- "string-width": "2.1.1"
+ "@babel/types": "^7.0.0"
}
},
- "ansi-escapes": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz",
- "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==",
- "dev": true
- },
- "ansi-regex": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
- "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
- "dev": true
- },
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
+ "@babel/helper-builder-binary-assignment-operator-visitor": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz",
+ "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-explode-assignable-expression": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
},
- "anymatch": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
- "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
+ "@babel/helper-call-delegate": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz",
+ "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==",
"dev": true,
"requires": {
- "micromatch": "2.3.11",
- "normalize-path": "2.1.1"
+ "@babel/helper-hoist-variables": "^7.4.4",
+ "@babel/traverse": "^7.4.4",
+ "@babel/types": "^7.4.4"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
}
},
- "argparse": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz",
- "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=",
+ "@babel/helper-define-map": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz",
+ "integrity": "sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg==",
"dev": true,
"requires": {
- "sprintf-js": "1.0.3"
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/types": "^7.5.5",
+ "lodash": "^4.17.13"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
}
},
- "arr-diff": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
- "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
+ "@babel/helper-explode-assignable-expression": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz",
+ "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==",
"dev": true,
"requires": {
- "arr-flatten": "1.1.0"
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
}
},
- "arr-flatten": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
- "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
- "dev": true
+ "@babel/helper-function-name": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz",
+ "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-get-function-arity": "^7.0.0",
+ "@babel/template": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
},
- "array-differ": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz",
- "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=",
- "dev": true
+ "@babel/helper-get-function-arity": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz",
+ "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
},
- "array-filter": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz",
- "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=",
- "dev": true
+ "@babel/helper-hoist-variables": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz",
+ "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.4.4"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
},
- "array-find-index": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
- "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
- "dev": true
+ "@babel/helper-member-expression-to-functions": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz",
+ "integrity": "sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.5.5"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
},
- "array-map": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz",
- "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=",
- "dev": true
+ "@babel/helper-module-imports": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz",
+ "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.0.0"
+ }
},
- "array-reduce": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz",
- "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=",
- "dev": true
+ "@babel/helper-module-transforms": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz",
+ "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-simple-access": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/template": "^7.4.4",
+ "@babel/types": "^7.5.5",
+ "lodash": "^4.17.13"
+ },
+ "dependencies": {
+ "@babel/parser": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.2.tgz",
+ "integrity": "sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg==",
+ "dev": true
+ },
+ "@babel/template": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
+ "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.6.0",
+ "@babel/types": "^7.6.0"
+ }
+ },
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
},
- "array-union": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
- "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
+ "@babel/helper-optimise-call-expression": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz",
+ "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==",
"dev": true,
"requires": {
- "array-uniq": "1.0.3"
+ "@babel/types": "^7.0.0"
}
},
- "array-uniq": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
- "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
+ "@babel/helper-plugin-utils": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz",
+ "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==",
"dev": true
},
- "array-unique": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
- "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
- "dev": true
+ "@babel/helper-regex": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz",
+ "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.13"
+ }
},
- "arrify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
- "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
- "dev": true
+ "@babel/helper-remap-async-to-generator": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz",
+ "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-wrap-function": "^7.1.0",
+ "@babel/template": "^7.1.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
},
- "asn1": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
- "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=",
- "dev": true
+ "@babel/helper-replace-supers": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz",
+ "integrity": "sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-member-expression-to-functions": "^7.5.5",
+ "@babel/helper-optimise-call-expression": "^7.0.0",
+ "@babel/traverse": "^7.5.5",
+ "@babel/types": "^7.5.5"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ }
+ }
},
- "assert-plus": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
- "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
- "dev": true
+ "@babel/helper-simple-access": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz",
+ "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==",
+ "dev": true,
+ "requires": {
+ "@babel/template": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
},
- "async-each": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
- "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
- "dev": true
+ "@babel/helper-split-export-declaration": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
+ "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.4.4"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
+ "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "dev": true
+ }
+ }
},
- "asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
- "dev": true
+ "@babel/helper-wrap-function": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz",
+ "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/template": "^7.1.0",
+ "@babel/traverse": "^7.1.0",
+ "@babel/types": "^7.2.0"
+ }
},
- "autoprefixer": {
- "version": "6.7.7",
- "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz",
- "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=",
+ "@babel/helpers": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz",
+ "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==",
"dev": true,
"requires": {
- "browserslist": "1.7.7",
- "caniuse-db": "1.0.30000744",
- "normalize-range": "0.1.2",
- "num2fraction": "1.2.2",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "@babel/template": "^7.6.0",
+ "@babel/traverse": "^7.6.2",
+ "@babel/types": "^7.6.0"
},
"dependencies": {
- "browserslist": {
- "version": "1.7.7",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
- "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
+ "@babel/generator": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.2.tgz",
+ "integrity": "sha512-j8iHaIW4gGPnViaIHI7e9t/Hl8qLjERI6DcV9kEpAIDJsAOrcnXqRS7t+QbhL76pwbtqP+QCQLL0z1CyVmtjjQ==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.6.0",
+ "jsesc": "^2.5.1",
+ "lodash": "^4.17.13",
+ "source-map": "^0.5.0"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.2.tgz",
+ "integrity": "sha512-mdFqWrSPCmikBoaBYMuBulzTIKuXVPtEISFbRRVNwMWpCms/hmE2kRq0bblUHaNRKrjRlmVbx1sDHmjmRgD2Xg==",
+ "dev": true
+ },
+ "@babel/template": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
+ "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.6.0",
+ "@babel/types": "^7.6.0"
+ }
+ },
+ "@babel/traverse": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.2.tgz",
+ "integrity": "sha512-8fRE76xNwNttVEF2TwxJDGBLWthUkHWSldmfuBzVRmEDWOtu4XdINTgN7TDWzuLg4bbeIMLvfMFD9we5YcWkRQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.5.5",
+ "@babel/generator": "^7.6.2",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/parser": "^7.6.2",
+ "@babel/types": "^7.6.0",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0",
+ "lodash": "^4.17.13"
+ },
+ "dependencies": {
+ "@babel/code-frame": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
+ "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.0.0"
+ }
+ }
+ }
+ },
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
"dev": true,
"requires": {
- "caniuse-db": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
}
}
}
},
- "aws-sign2": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
- "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
- "dev": true
+ "@babel/highlight": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
+ "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.0.0",
+ "esutils": "^2.0.2",
+ "js-tokens": "^4.0.0"
+ }
},
- "aws4": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
- "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
+ "@babel/parser": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz",
+ "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==",
"dev": true
},
- "babel-code-frame": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
- "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
+ "@babel/plugin-proposal-async-generator-functions": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz",
+ "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "esutils": "2.0.2",
- "js-tokens": "3.0.2"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-remap-async-to-generator": "^7.1.0",
+ "@babel/plugin-syntax-async-generators": "^7.2.0"
}
},
- "babel-core": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz",
- "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=",
- "dev": true,
- "requires": {
- "babel-code-frame": "6.26.0",
- "babel-generator": "6.26.0",
- "babel-helpers": "6.24.1",
- "babel-messages": "6.23.0",
- "babel-register": "6.26.0",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0",
- "babylon": "6.18.0",
- "convert-source-map": "1.5.0",
- "debug": "2.6.9",
- "json5": "0.5.1",
- "lodash": "4.17.4",
- "minimatch": "3.0.4",
- "path-is-absolute": "1.0.1",
- "private": "0.1.7",
- "slash": "1.0.0",
- "source-map": "0.5.7"
+ "@babel/plugin-proposal-dynamic-import": {
+ "version": "7.5.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz",
+ "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-dynamic-import": "^7.2.0"
}
},
- "babel-generator": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz",
- "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=",
+ "@babel/plugin-proposal-json-strings": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz",
+ "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==",
"dev": true,
"requires": {
- "babel-messages": "6.23.0",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0",
- "detect-indent": "4.0.0",
- "jsesc": "1.3.0",
- "lodash": "4.17.4",
- "source-map": "0.5.7",
- "trim-right": "1.0.1"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-json-strings": "^7.2.0"
}
},
- "babel-helper-builder-binary-assignment-operator-visitor": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
- "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
+ "@babel/plugin-proposal-object-rest-spread": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz",
+ "integrity": "sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw==",
"dev": true,
"requires": {
- "babel-helper-explode-assignable-expression": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-object-rest-spread": "^7.2.0"
}
},
- "babel-helper-call-delegate": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz",
- "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=",
+ "@babel/plugin-proposal-optional-catch-binding": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz",
+ "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==",
"dev": true,
"requires": {
- "babel-helper-hoist-variables": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.2.0"
}
},
- "babel-helper-define-map": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz",
- "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=",
+ "@babel/plugin-proposal-unicode-property-regex": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.6.2.tgz",
+ "integrity": "sha512-NxHETdmpeSCtiatMRYWVJo7266rrvAC3DTeG5exQBIH/fMIUK7ejDNznBbn3HQl/o9peymRRg7Yqkx6PdUXmMw==",
"dev": true,
"requires": {
- "babel-helper-function-name": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0",
- "lodash": "4.17.4"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.6.0"
}
},
- "babel-helper-explode-assignable-expression": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
- "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
+ "@babel/plugin-syntax-async-generators": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz",
+ "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-function-name": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
- "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
+ "@babel/plugin-syntax-dynamic-import": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz",
+ "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==",
"dev": true,
"requires": {
- "babel-helper-get-function-arity": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-get-function-arity": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
- "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
+ "@babel/plugin-syntax-json-strings": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz",
+ "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-hoist-variables": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz",
- "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=",
+ "@babel/plugin-syntax-object-rest-spread": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz",
+ "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-optimise-call-expression": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz",
- "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=",
+ "@babel/plugin-syntax-optional-catch-binding": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz",
+ "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-regex": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz",
- "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=",
+ "@babel/plugin-transform-arrow-functions": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz",
+ "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0",
- "lodash": "4.17.4"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helper-remap-async-to-generator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
- "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
+ "@babel/plugin-transform-async-to-generator": {
+ "version": "7.5.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz",
+ "integrity": "sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg==",
"dev": true,
"requires": {
- "babel-helper-function-name": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-remap-async-to-generator": "^7.1.0"
}
},
- "babel-helper-replace-supers": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz",
- "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=",
+ "@babel/plugin-transform-block-scoped-functions": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz",
+ "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==",
"dev": true,
"requires": {
- "babel-helper-optimise-call-expression": "6.24.1",
- "babel-messages": "6.23.0",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0"
}
},
- "babel-helpers": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
- "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
+ "@babel/plugin-transform-block-scoping": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.2.tgz",
+ "integrity": "sha512-zZT8ivau9LOQQaOGC7bQLQOT4XPkPXgN2ERfUgk1X8ql+mVkLc4E8eKk+FO3o0154kxzqenWCorfmEXpEZcrSQ==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0"
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "lodash": "^4.17.13"
}
},
- "babel-messages": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
- "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
+ "@babel/plugin-transform-classes": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz",
+ "integrity": "sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-define-map": "^7.5.5",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-optimise-call-expression": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-replace-supers": "^7.5.5",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "globals": "^11.1.0"
+ }
+ },
+ "@babel/plugin-transform-computed-properties": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz",
+ "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-destructuring": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz",
+ "integrity": "sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-dotall-regex": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.6.2.tgz",
+ "integrity": "sha512-KGKT9aqKV+9YMZSkowzYoYEiHqgaDhGmPNZlZxX6UeHC4z30nC1J9IrZuGqbYFB1jaIGdv91ujpze0exiVK8bA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.6.0"
+ }
+ },
+ "@babel/plugin-transform-duplicate-keys": {
+ "version": "7.5.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz",
+ "integrity": "sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-exponentiation-operator": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz",
+ "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-for-of": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz",
+ "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-function-name": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz",
+ "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-literals": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz",
+ "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-member-expression-literals": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz",
+ "integrity": "sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-modules-amd": {
+ "version": "7.5.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz",
+ "integrity": "sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "babel-plugin-dynamic-import-node": "^2.3.0"
+ }
+ },
+ "@babel/plugin-transform-modules-commonjs": {
+ "version": "7.6.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz",
+ "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.4.4",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-simple-access": "^7.1.0",
+ "babel-plugin-dynamic-import-node": "^2.3.0"
+ }
+ },
+ "@babel/plugin-transform-modules-systemjs": {
+ "version": "7.5.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz",
+ "integrity": "sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-hoist-variables": "^7.4.4",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "babel-plugin-dynamic-import-node": "^2.3.0"
+ }
+ },
+ "@babel/plugin-transform-modules-umd": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz",
+ "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-transforms": "^7.1.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-named-capturing-groups-regex": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.2.tgz",
+ "integrity": "sha512-xBdB+XOs+lgbZc2/4F5BVDVcDNS4tcSKQc96KmlqLEAwz6tpYPEvPdmDfvVG0Ssn8lAhronaRs6Z6KSexIpK5g==",
+ "dev": true,
+ "requires": {
+ "regexpu-core": "^4.6.0"
+ }
+ },
+ "@babel/plugin-transform-new-target": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz",
+ "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-object-super": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz",
+ "integrity": "sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-replace-supers": "^7.5.5"
+ }
+ },
+ "@babel/plugin-transform-parameters": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz",
+ "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-call-delegate": "^7.4.4",
+ "@babel/helper-get-function-arity": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-property-literals": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz",
+ "integrity": "sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-regenerator": {
+ "version": "7.4.5",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz",
+ "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==",
+ "dev": true,
+ "requires": {
+ "regenerator-transform": "^0.14.0"
+ }
+ },
+ "@babel/plugin-transform-reserved-words": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz",
+ "integrity": "sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-shorthand-properties": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz",
+ "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-spread": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz",
+ "integrity": "sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-sticky-regex": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz",
+ "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-template-literals": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz",
+ "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-annotate-as-pure": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-typeof-symbol": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz",
+ "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0"
+ }
+ },
+ "@babel/plugin-transform-unicode-regex": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.6.2.tgz",
+ "integrity": "sha512-orZI6cWlR3nk2YmYdb0gImrgCUwb5cBUwjf6Ks6dvNVvXERkwtJWOQaEOjPiu0Gu1Tq6Yq/hruCZZOOi9F34Dw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/helper-regex": "^7.4.4",
+ "regexpu-core": "^4.6.0"
+ }
+ },
+ "@babel/preset-env": {
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.6.2.tgz",
+ "integrity": "sha512-Ru7+mfzy9M1/YTEtlDS8CD45jd22ngb9tXnn64DvQK3ooyqSw9K4K9DUWmYknTTVk4TqygL9dqCrZgm1HMea/Q==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-module-imports": "^7.0.0",
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "@babel/plugin-proposal-async-generator-functions": "^7.2.0",
+ "@babel/plugin-proposal-dynamic-import": "^7.5.0",
+ "@babel/plugin-proposal-json-strings": "^7.2.0",
+ "@babel/plugin-proposal-object-rest-spread": "^7.6.2",
+ "@babel/plugin-proposal-optional-catch-binding": "^7.2.0",
+ "@babel/plugin-proposal-unicode-property-regex": "^7.6.2",
+ "@babel/plugin-syntax-async-generators": "^7.2.0",
+ "@babel/plugin-syntax-dynamic-import": "^7.2.0",
+ "@babel/plugin-syntax-json-strings": "^7.2.0",
+ "@babel/plugin-syntax-object-rest-spread": "^7.2.0",
+ "@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
+ "@babel/plugin-transform-arrow-functions": "^7.2.0",
+ "@babel/plugin-transform-async-to-generator": "^7.5.0",
+ "@babel/plugin-transform-block-scoped-functions": "^7.2.0",
+ "@babel/plugin-transform-block-scoping": "^7.6.2",
+ "@babel/plugin-transform-classes": "^7.5.5",
+ "@babel/plugin-transform-computed-properties": "^7.2.0",
+ "@babel/plugin-transform-destructuring": "^7.6.0",
+ "@babel/plugin-transform-dotall-regex": "^7.6.2",
+ "@babel/plugin-transform-duplicate-keys": "^7.5.0",
+ "@babel/plugin-transform-exponentiation-operator": "^7.2.0",
+ "@babel/plugin-transform-for-of": "^7.4.4",
+ "@babel/plugin-transform-function-name": "^7.4.4",
+ "@babel/plugin-transform-literals": "^7.2.0",
+ "@babel/plugin-transform-member-expression-literals": "^7.2.0",
+ "@babel/plugin-transform-modules-amd": "^7.5.0",
+ "@babel/plugin-transform-modules-commonjs": "^7.6.0",
+ "@babel/plugin-transform-modules-systemjs": "^7.5.0",
+ "@babel/plugin-transform-modules-umd": "^7.2.0",
+ "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.2",
+ "@babel/plugin-transform-new-target": "^7.4.4",
+ "@babel/plugin-transform-object-super": "^7.5.5",
+ "@babel/plugin-transform-parameters": "^7.4.4",
+ "@babel/plugin-transform-property-literals": "^7.2.0",
+ "@babel/plugin-transform-regenerator": "^7.4.5",
+ "@babel/plugin-transform-reserved-words": "^7.2.0",
+ "@babel/plugin-transform-shorthand-properties": "^7.2.0",
+ "@babel/plugin-transform-spread": "^7.6.2",
+ "@babel/plugin-transform-sticky-regex": "^7.2.0",
+ "@babel/plugin-transform-template-literals": "^7.4.4",
+ "@babel/plugin-transform-typeof-symbol": "^7.2.0",
+ "@babel/plugin-transform-unicode-regex": "^7.6.2",
+ "@babel/types": "^7.6.0",
+ "browserslist": "^4.6.0",
+ "core-js-compat": "^3.1.1",
+ "invariant": "^2.2.2",
+ "js-levenshtein": "^1.1.3",
+ "semver": "^5.5.0"
+ },
+ "dependencies": {
+ "@babel/types": {
+ "version": "7.6.1",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
+ "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "browserslist": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz",
+ "integrity": "sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000989",
+ "electron-to-chromium": "^1.3.247",
+ "node-releases": "^1.1.29"
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000998",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000998.tgz",
+ "integrity": "sha512-8Tj5sPZR9kMHeDD9SZXIVr5m9ofufLLCG2Y4QwQrH18GIwG+kCc+zYdlR036ZRkuKjVVetyxeAgGA1xF7XdmzQ==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.273",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.273.tgz",
+ "integrity": "sha512-0kUppiHQvHEENHh+nTtvTt4eXMwcPyWmMaj73GPrSEm3ldKhmmHuOH6IjrmuW6YmyS/fpXcLvMQLNVpqRhpNWw==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.34",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.34.tgz",
+ "integrity": "sha512-fNn12JTEfniTuCqo0r9jXgl44+KxRH/huV7zM/KAGOKxDKrHr6EbT7SSs4B+DNxyBE2mks28AD+Jw6PkfY5uwA==",
+ "dev": true,
+ "requires": {
+ "semver": "^6.3.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
+ }
+ }
+ },
+ "@babel/runtime": {
+ "version": "7.4.5",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz",
+ "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==",
+ "dev": true,
+ "requires": {
+ "regenerator-runtime": "^0.13.2"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.13.2",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
+ "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==",
+ "dev": true
+ }
+ }
+ },
+ "@babel/template": {
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz",
+ "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.2.2",
+ "@babel/types": "^7.2.2"
+ }
+ },
+ "@babel/traverse": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz",
+ "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@babel/code-frame": "^7.5.5",
+ "@babel/generator": "^7.5.5",
+ "@babel/helper-function-name": "^7.1.0",
+ "@babel/helper-split-export-declaration": "^7.4.4",
+ "@babel/parser": "^7.5.5",
+ "@babel/types": "^7.5.5",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0",
+ "lodash": "^4.17.13"
+ },
+ "dependencies": {
+ "@babel/code-frame": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
+ "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.0.0"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz",
+ "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==",
+ "dev": true
+ },
+ "@babel/types": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
+ "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
+ "dev": true
+ }
}
},
- "babel-plugin-check-es2015-constants": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz",
- "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=",
+ "@babel/types": {
+ "version": "7.3.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz",
+ "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.11",
+ "to-fast-properties": "^2.0.0"
}
},
- "babel-plugin-external-helpers": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz",
- "integrity": "sha1-IoX0iwK9Xe3oUXXK+MYuhq3M76E=",
+ "@commitlint/cli": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-8.2.0.tgz",
+ "integrity": "sha512-8fJ5pmytc38yw2QWbTTJmXLfSiWPwMkHH4govo9zJ/+ERPBF2jvlxD/dQvk24ezcizjKc6LFka2edYC4OQ+Dgw==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@commitlint/format": "^8.2.0",
+ "@commitlint/lint": "^8.2.0",
+ "@commitlint/load": "^8.2.0",
+ "@commitlint/read": "^8.2.0",
+ "babel-polyfill": "6.26.0",
+ "chalk": "2.4.2",
+ "get-stdin": "7.0.0",
+ "lodash": "4.17.14",
+ "meow": "5.0.0",
+ "resolve-from": "5.0.0",
+ "resolve-global": "1.0.0"
+ },
+ "dependencies": {
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
+ "dev": true
+ }
}
},
- "babel-plugin-syntax-async-functions": {
- "version": "6.13.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
- "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
+ "@commitlint/config-conventional": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-8.2.0.tgz",
+ "integrity": "sha512-HuwlHQ3DyVhpK9GHgTMhJXD8Zp8PGIQVpQGYh/iTrEU6TVxdRC61BxIDZvfWatCaiG617Z/U8maRAFrqFM4TqA==",
"dev": true
},
- "babel-plugin-syntax-exponentiation-operator": {
- "version": "6.13.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
- "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
+ "@commitlint/ensure": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-8.2.0.tgz",
+ "integrity": "sha512-XZZih/kcRrqK7lEORbSYCfqQw6byfsFbLygRGVdJMlCPGu9E2MjpwCtoj5z7y/lKfUB3MJaBhzn2muJqS1gC6A==",
+ "dev": true,
+ "requires": {
+ "lodash": "4.17.14"
+ },
+ "dependencies": {
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
+ "dev": true
+ }
+ }
+ },
+ "@commitlint/execute-rule": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.2.0.tgz",
+ "integrity": "sha512-9MBRthHaulbWTa8ReG2Oii2qc117NuvzhZdnkuKuYLhker7sUXGFcVhLanuWUKGyfyI2o9zVr/NHsNbCCsTzAA==",
"dev": true
},
- "babel-plugin-syntax-trailing-function-commas": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
- "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
+ "@commitlint/format": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-8.2.0.tgz",
+ "integrity": "sha512-sA77agkDEMsEMrlGhrLtAg8vRexkOofEEv/CZX+4xlANyAz2kNwJvMg33lcL65CBhqKEnRRJRxfZ1ZqcujdKcQ==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.0.1"
+ }
+ },
+ "@commitlint/is-ignored": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-8.2.0.tgz",
+ "integrity": "sha512-ADaGnKfbfV6KD1pETp0Qf7XAyc75xTy3WJlbvPbwZ4oPdBMsXF0oXEEGMis6qABfU2IXan5/KAJgAFX3vdd0jA==",
+ "dev": true,
+ "requires": {
+ "@types/semver": "^6.0.1",
+ "semver": "6.2.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz",
+ "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==",
+ "dev": true
+ }
+ }
+ },
+ "@commitlint/lint": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-8.2.0.tgz",
+ "integrity": "sha512-ch9JN8aR37ufdjoWv50jLfvFz9rWMgLW5HEkMGLsM/51gjekmQYS5NJg8S2+6F5+jmralAO7VkUMI6FukXKX0A==",
+ "dev": true,
+ "requires": {
+ "@commitlint/is-ignored": "^8.2.0",
+ "@commitlint/parse": "^8.2.0",
+ "@commitlint/rules": "^8.2.0",
+ "babel-runtime": "^6.23.0",
+ "lodash": "4.17.14"
+ },
+ "dependencies": {
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
+ "dev": true
+ }
+ }
+ },
+ "@commitlint/load": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.2.0.tgz",
+ "integrity": "sha512-EV6PfAY/p83QynNd1llHxJiNxKmp43g8+7dZbyfHFbsGOdokrCnoelAVZ+WGgktXwLN/uXyfkcIAxwac015UYw==",
+ "dev": true,
+ "requires": {
+ "@commitlint/execute-rule": "^8.2.0",
+ "@commitlint/resolve-extends": "^8.2.0",
+ "babel-runtime": "^6.23.0",
+ "chalk": "2.4.2",
+ "cosmiconfig": "^5.2.0",
+ "lodash": "4.17.14",
+ "resolve-from": "^5.0.0"
+ },
+ "dependencies": {
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
+ "dev": true
+ }
+ }
+ },
+ "@commitlint/message": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-8.2.0.tgz",
+ "integrity": "sha512-LNsSwDLIFgE3nb/Sb1PIluYNy4Q8igdf4tpJCdv5JJDf7CZCZt3ZTglj0YutZZorpRRuHJsVIB2+dI4bVH3bFw==",
"dev": true
},
- "babel-plugin-transform-async-to-generator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
- "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
+ "@commitlint/parse": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-8.2.0.tgz",
+ "integrity": "sha512-vzouqroTXG6QXApkrps0gbeSYW6w5drpUk7QAeZIcaCSPsQXDM8eqqt98ZzlzLJHo5oPNXPX1AAVSTrssvHemA==",
"dev": true,
"requires": {
- "babel-helper-remap-async-to-generator": "6.24.1",
- "babel-plugin-syntax-async-functions": "6.13.0",
- "babel-runtime": "6.26.0"
+ "conventional-changelog-angular": "^1.3.3",
+ "conventional-commits-parser": "^2.1.0",
+ "lodash": "^4.17.11"
}
},
- "babel-plugin-transform-es2015-arrow-functions": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz",
- "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=",
+ "@commitlint/read": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-8.2.0.tgz",
+ "integrity": "sha512-1tBai1VuSQmsOTsvJr3Fi/GZqX3zdxRqYe/yN4i3cLA5S2Y4QGJ5I3l6nGZlKgm/sSelTCVKHltrfWU8s5H7SA==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@commitlint/top-level": "^8.2.0",
+ "@marionebl/sander": "^0.6.0",
+ "babel-runtime": "^6.23.0",
+ "git-raw-commits": "^1.3.0"
}
},
- "babel-plugin-transform-es2015-block-scoped-functions": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz",
- "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=",
+ "@commitlint/resolve-extends": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.2.0.tgz",
+ "integrity": "sha512-cwi0HUsDcD502HBP8huXfTkVuWmeo1Fiz3GKxNwMBBsJV4+bKa7QrtxbNpXhVuarX7QjWfNTvmW6KmFS7YK9uw==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@types/node": "^12.0.2",
+ "import-fresh": "^3.0.0",
+ "lodash": "4.17.14",
+ "resolve-from": "^5.0.0",
+ "resolve-global": "^1.0.0"
+ },
+ "dependencies": {
+ "@types/node": {
+ "version": "12.7.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz",
+ "integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==",
+ "dev": true
+ },
+ "lodash": {
+ "version": "4.17.14",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz",
+ "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==",
+ "dev": true
+ }
}
},
- "babel-plugin-transform-es2015-block-scoping": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz",
- "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=",
+ "@commitlint/rules": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-8.2.0.tgz",
+ "integrity": "sha512-FlqSBBP2Gxt5Ibw+bxdYpzqYR6HI8NIBpaTBhAjSEAduQtdWFMOhF0zsgkwH7lHN7opaLcnY2fXxAhbzTmJQQA==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0",
- "lodash": "4.17.4"
+ "@commitlint/ensure": "^8.2.0",
+ "@commitlint/message": "^8.2.0",
+ "@commitlint/to-lines": "^8.2.0",
+ "babel-runtime": "^6.23.0"
}
},
- "babel-plugin-transform-es2015-classes": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz",
- "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=",
+ "@commitlint/to-lines": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-8.2.0.tgz",
+ "integrity": "sha512-LXTYG3sMenlN5qwyTZ6czOULVcx46uMy+MEVqpvCgptqr/MZcV/C2J+S2o1DGwj1gOEFMpqrZaE3/1R2Q+N8ng==",
+ "dev": true
+ },
+ "@commitlint/top-level": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-8.2.0.tgz",
+ "integrity": "sha512-Yaw4KmYNy31/HhRUuZ+fupFcDalnfpdu4JGBgGAqS9aBHdMSSWdWqtAaDaxdtWjTZeN3O0sA2gOhXwvKwiDwvw==",
"dev": true,
"requires": {
- "babel-helper-define-map": "6.26.0",
- "babel-helper-function-name": "6.24.1",
- "babel-helper-optimise-call-expression": "6.24.1",
- "babel-helper-replace-supers": "6.24.1",
- "babel-messages": "6.23.0",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "find-up": "^4.0.0"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^4.1.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
+ "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.2.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true
+ }
}
},
- "babel-plugin-transform-es2015-computed-properties": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz",
- "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=",
+ "@csstools/convert-colors": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz",
+ "integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==",
+ "dev": true
+ },
+ "@marionebl/sander": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/@marionebl/sander/-/sander-0.6.1.tgz",
+ "integrity": "sha1-GViWWHTyS8Ub5Ih1/rUNZC/EH3s=",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0"
+ "graceful-fs": "^4.1.3",
+ "mkdirp": "^0.5.1",
+ "rimraf": "^2.5.2"
}
},
- "babel-plugin-transform-es2015-destructuring": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz",
- "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=",
+ "@mrmlnc/readdir-enhanced": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
+ "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "call-me-maybe": "^1.0.1",
+ "glob-to-regexp": "^0.3.0"
}
},
- "babel-plugin-transform-es2015-duplicate-keys": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz",
- "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=",
+ "@nodelib/fs.scandir": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.2.tgz",
+ "integrity": "sha512-wrIBsjA5pl13f0RN4Zx4FNWmU71lv03meGKnqRUoCyan17s4V3WL92f3w3AIuWbNnpcrQyFBU5qMavJoB8d27w==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "@nodelib/fs.stat": "2.0.2",
+ "run-parallel": "^1.1.9"
+ },
+ "dependencies": {
+ "@nodelib/fs.stat": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.2.tgz",
+ "integrity": "sha512-z8+wGWV2dgUhLqrtRYa03yDx4HWMvXKi1z8g3m2JyxAx8F7xk74asqPk5LAETjqDSGLFML/6CDl0+yFunSYicw==",
+ "dev": true
+ }
}
},
- "babel-plugin-transform-es2015-for-of": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz",
- "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=",
+ "@nodelib/fs.stat": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
+ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==",
+ "dev": true
+ },
+ "@nodelib/fs.walk": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.3.tgz",
+ "integrity": "sha512-l6t8xEhfK9Sa4YO5mIRdau7XSOADfmh3jCr0evNHdY+HNkW6xuQhgMH7D73VV6WpZOagrW0UludvMTiifiwTfA==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@nodelib/fs.scandir": "2.1.2",
+ "fastq": "^1.6.0"
}
},
- "babel-plugin-transform-es2015-function-name": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz",
- "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=",
+ "@samverschueren/stream-to-observable": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz",
+ "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==",
"dev": true,
"requires": {
- "babel-helper-function-name": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "any-observable": "^0.3.0"
}
},
- "babel-plugin-transform-es2015-literals": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz",
- "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=",
+ "@types/estree": {
+ "version": "0.0.39",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
+ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
+ "dev": true
+ },
+ "@types/events": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
+ "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==",
+ "dev": true
+ },
+ "@types/glob": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz",
+ "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "@types/events": "*",
+ "@types/minimatch": "*",
+ "@types/node": "*"
}
},
- "babel-plugin-transform-es2015-modules-amd": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz",
- "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=",
+ "@types/minimatch": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
+ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
+ "dev": true
+ },
+ "@types/node": {
+ "version": "11.11.0",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.0.tgz",
+ "integrity": "sha512-D5Rt+HXgEywr3RQJcGlZUCTCx1qVbCZpVk3/tOOA6spLNZdGm8BU+zRgdRYDoF1pO3RuXLxADzMrF903JlQXqg==",
+ "dev": true
+ },
+ "@types/normalize-package-data": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
+ "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",
+ "dev": true
+ },
+ "@types/q": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz",
+ "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==",
+ "dev": true
+ },
+ "@types/semver": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.0.2.tgz",
+ "integrity": "sha512-G1Ggy7/9Nsa1Jt2yiBR2riEuyK2DFNnqow6R7cromXPMNynackRY1vqFTLz/gwnef1LHokbXThcPhqMRjUbkpQ==",
+ "dev": true
+ },
+ "@types/unist": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz",
+ "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==",
+ "dev": true
+ },
+ "@types/vfile": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/vfile/-/vfile-3.0.2.tgz",
+ "integrity": "sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw==",
"dev": true,
"requires": {
- "babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0"
+ "@types/node": "*",
+ "@types/unist": "*",
+ "@types/vfile-message": "*"
}
},
- "babel-plugin-transform-es2015-modules-commonjs": {
- "version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz",
- "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=",
+ "@types/vfile-message": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@types/vfile-message/-/vfile-message-1.0.1.tgz",
+ "integrity": "sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA==",
"dev": true,
"requires": {
- "babel-plugin-transform-strict-mode": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-types": "6.26.0"
+ "@types/node": "*",
+ "@types/unist": "*"
}
},
- "babel-plugin-transform-es2015-modules-systemjs": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz",
- "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=",
+ "JSONStream": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
+ "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
"dev": true,
"requires": {
- "babel-helper-hoist-variables": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0"
+ "jsonparse": "^1.2.0",
+ "through": ">=2.2.7 <3"
}
},
- "babel-plugin-transform-es2015-modules-umd": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz",
- "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=",
+ "accepts": {
+ "version": "1.3.7",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
+ "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"dev": true,
"requires": {
- "babel-plugin-transform-es2015-modules-amd": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0"
+ "mime-types": "~2.1.24",
+ "negotiator": "0.6.2"
}
},
- "babel-plugin-transform-es2015-object-super": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz",
- "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=",
+ "acorn": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
+ "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
+ "dev": true
+ },
+ "acorn-jsx": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz",
+ "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==",
+ "dev": true
+ },
+ "after": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
+ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=",
+ "dev": true
+ },
+ "agent-base": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
+ "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
"dev": true,
"requires": {
- "babel-helper-replace-supers": "6.24.1",
- "babel-runtime": "6.26.0"
+ "es6-promisify": "^5.0.0"
}
},
- "babel-plugin-transform-es2015-parameters": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz",
- "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=",
+ "aggregate-error": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.0.tgz",
+ "integrity": "sha512-yKD9kEoJIR+2IFqhMwayIBgheLYbB3PS2OBhWae1L/ODTd/JF/30cW0bc9TqzRL3k4U41Dieu3BF4I29p8xesA==",
"dev": true,
"requires": {
- "babel-helper-call-delegate": "6.24.1",
- "babel-helper-get-function-arity": "6.24.1",
- "babel-runtime": "6.26.0",
- "babel-template": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0"
+ "clean-stack": "^2.0.0",
+ "indent-string": "^3.2.0"
}
},
- "babel-plugin-transform-es2015-shorthand-properties": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz",
- "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=",
+ "ajv": {
+ "version": "6.10.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
+ "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "fast-deep-equal": "^2.0.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
}
},
- "babel-plugin-transform-es2015-spread": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz",
- "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=",
+ "alphanum-sort": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz",
+ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
+ "dev": true
+ },
+ "ansi-colors": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz",
+ "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==",
+ "dev": true
+ },
+ "ansi-escapes": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
+ "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
+ "dev": true
+ },
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "color-convert": "^1.9.0"
}
},
- "babel-plugin-transform-es2015-sticky-regex": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz",
- "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=",
+ "any-observable": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz",
+ "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==",
+ "dev": true
+ },
+ "anymatch": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
+ "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
"dev": true,
"requires": {
- "babel-helper-regex": "6.26.0",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "micromatch": "^3.1.4",
+ "normalize-path": "^2.1.1"
+ },
+ "dependencies": {
+ "normalize-path": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
+ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
+ "dev": true,
+ "requires": {
+ "remove-trailing-separator": "^1.0.1"
+ }
+ }
}
},
- "babel-plugin-transform-es2015-template-literals": {
- "version": "6.22.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz",
- "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=",
+ "append-transform": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz",
+ "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "default-require-extensions": "^2.0.0"
}
},
- "babel-plugin-transform-es2015-typeof-symbol": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz",
- "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=",
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0"
+ "sprintf-js": "~1.0.2"
}
},
- "babel-plugin-transform-es2015-unicode-regex": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz",
- "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=",
+ "argv": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz",
+ "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=",
+ "dev": true
+ },
+ "arr-diff": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+ "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=",
+ "dev": true
+ },
+ "arr-flatten": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+ "dev": true
+ },
+ "arr-union": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
+ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
+ "dev": true
+ },
+ "array-filter": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz",
+ "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=",
+ "dev": true
+ },
+ "array-find-index": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
+ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
+ "dev": true
+ },
+ "array-ify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz",
+ "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=",
+ "dev": true
+ },
+ "array-includes": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz",
+ "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=",
"dev": true,
"requires": {
- "babel-helper-regex": "6.26.0",
- "babel-runtime": "6.26.0",
- "regexpu-core": "2.0.0"
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.7.0"
}
},
- "babel-plugin-transform-exponentiation-operator": {
- "version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
- "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
+ "array-map": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz",
+ "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=",
+ "dev": true
+ },
+ "array-reduce": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz",
+ "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=",
+ "dev": true
+ },
+ "array-union": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
+ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
"dev": true,
"requires": {
- "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1",
- "babel-plugin-syntax-exponentiation-operator": "6.13.0",
- "babel-runtime": "6.26.0"
+ "array-uniq": "^1.0.1"
}
},
- "babel-plugin-transform-regenerator": {
+ "array-uniq": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
+ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
+ "dev": true
+ },
+ "array-unique": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
+ "dev": true
+ },
+ "arraybuffer.slice": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz",
+ "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==",
+ "dev": true
+ },
+ "arrify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+ "dev": true
+ },
+ "assertion-error": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
+ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
+ "dev": true
+ },
+ "assign-symbols": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
+ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
+ "dev": true
+ },
+ "astral-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
+ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
+ "dev": true
+ },
+ "async": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz",
+ "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.11"
+ }
+ },
+ "async-each": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
+ "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
+ "dev": true
+ },
+ "async-limiter": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
+ "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
+ "dev": true
+ },
+ "atob": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
+ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
+ "dev": true
+ },
+ "autoprefixer": {
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.1.tgz",
+ "integrity": "sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw==",
+ "dev": true,
+ "requires": {
+ "browserslist": "^4.6.3",
+ "caniuse-lite": "^1.0.30000980",
+ "chalk": "^2.4.2",
+ "normalize-range": "^0.1.2",
+ "num2fraction": "^1.2.2",
+ "postcss": "^7.0.17",
+ "postcss-value-parser": "^4.0.0"
+ },
+ "dependencies": {
+ "browserslist": {
+ "version": "4.6.4",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.4.tgz",
+ "integrity": "sha512-ErJT8qGfRt/VWHSr1HeqZzz50DvxHtr1fVL1m5wf20aGrG8e1ce8fpZ2EjZEfs09DDZYSvtRaDlMpWslBf8Low==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000981",
+ "electron-to-chromium": "^1.3.188",
+ "node-releases": "^1.1.25"
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000983",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000983.tgz",
+ "integrity": "sha512-/llD1bZ6qwNkt41AsvjsmwNOoA4ZB+8iqmf5LVyeSXuBODT/hAMFNVOh84NdUzoiYiSKqo5vQ3ZzeYHSi/olDQ==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.188",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.188.tgz",
+ "integrity": "sha512-tEQcughYIMj8WDMc59EGEtNxdGgwal/oLLTDw+NEqJRJwGflQvH3aiyiexrWeZOETP4/ko78PVr6gwNhdozvuQ==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.25",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.25.tgz",
+ "integrity": "sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==",
+ "dev": true,
+ "requires": {
+ "semver": "^5.3.0"
+ }
+ },
+ "postcss": {
+ "version": "7.0.17",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz",
+ "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
+ }
+ },
+ "postcss-value-parser": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz",
+ "integrity": "sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ==",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "babel-code-frame": {
"version": "6.26.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz",
- "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=",
+ "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"dev": true,
"requires": {
- "regenerator-transform": "0.10.1"
+ "chalk": "^1.1.3",
+ "esutils": "^2.0.2",
+ "js-tokens": "^3.0.2"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "js-tokens": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
+ }
+ },
+ "babel-core": {
+ "version": "6.26.3",
+ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
+ "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-generator": "^6.26.0",
+ "babel-helpers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-register": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "convert-source-map": "^1.5.1",
+ "debug": "^2.6.9",
+ "json5": "^0.5.1",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.4",
+ "path-is-absolute": "^1.0.1",
+ "private": "^0.1.8",
+ "slash": "^1.0.0",
+ "source-map": "^0.5.7"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "json5": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "slash": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
+ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
+ "dev": true
+ }
+ }
+ },
+ "babel-generator": {
+ "version": "6.26.1",
+ "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz",
+ "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==",
+ "dev": true,
+ "requires": {
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "detect-indent": "^4.0.0",
+ "jsesc": "^1.3.0",
+ "lodash": "^4.17.4",
+ "source-map": "^0.5.7",
+ "trim-right": "^1.0.1"
+ },
+ "dependencies": {
+ "jsesc": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
+ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "dev": true
+ }
}
},
- "babel-plugin-transform-strict-mode": {
+ "babel-helpers": {
"version": "6.24.1",
- "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz",
- "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=",
+ "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
+ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0"
+ "babel-runtime": "^6.22.0",
+ "babel-template": "^6.24.1"
}
},
- "babel-preset-env": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz",
- "integrity": "sha512-W6VIyA6Ch9ePMI7VptNn2wBM6dbG0eSz25HEiL40nQXCsXGTGZSTZu1Iap+cj3Q0S5a7T9+529l/5Bkvd+afNA==",
- "dev": true,
- "requires": {
- "babel-plugin-check-es2015-constants": "6.22.0",
- "babel-plugin-syntax-trailing-function-commas": "6.22.0",
- "babel-plugin-transform-async-to-generator": "6.24.1",
- "babel-plugin-transform-es2015-arrow-functions": "6.22.0",
- "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0",
- "babel-plugin-transform-es2015-block-scoping": "6.26.0",
- "babel-plugin-transform-es2015-classes": "6.24.1",
- "babel-plugin-transform-es2015-computed-properties": "6.24.1",
- "babel-plugin-transform-es2015-destructuring": "6.23.0",
- "babel-plugin-transform-es2015-duplicate-keys": "6.24.1",
- "babel-plugin-transform-es2015-for-of": "6.23.0",
- "babel-plugin-transform-es2015-function-name": "6.24.1",
- "babel-plugin-transform-es2015-literals": "6.22.0",
- "babel-plugin-transform-es2015-modules-amd": "6.24.1",
- "babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
- "babel-plugin-transform-es2015-modules-systemjs": "6.24.1",
- "babel-plugin-transform-es2015-modules-umd": "6.24.1",
- "babel-plugin-transform-es2015-object-super": "6.24.1",
- "babel-plugin-transform-es2015-parameters": "6.24.1",
- "babel-plugin-transform-es2015-shorthand-properties": "6.24.1",
- "babel-plugin-transform-es2015-spread": "6.22.0",
- "babel-plugin-transform-es2015-sticky-regex": "6.24.1",
- "babel-plugin-transform-es2015-template-literals": "6.22.0",
- "babel-plugin-transform-es2015-typeof-symbol": "6.23.0",
- "babel-plugin-transform-es2015-unicode-regex": "6.24.1",
- "babel-plugin-transform-exponentiation-operator": "6.24.1",
- "babel-plugin-transform-regenerator": "6.26.0",
- "browserslist": "2.5.0",
- "invariant": "2.2.2",
- "semver": "5.4.1"
+ "babel-messages": {
+ "version": "6.23.0",
+ "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
+ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.22.0"
+ }
+ },
+ "babel-plugin-dynamic-import-node": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz",
+ "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==",
+ "dev": true,
+ "requires": {
+ "object.assign": "^4.1.0"
+ }
+ },
+ "babel-plugin-istanbul": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz",
+ "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.0.0",
+ "find-up": "^3.0.0",
+ "istanbul-lib-instrument": "^3.3.0",
+ "test-exclude": "^5.2.3"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
+ "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ }
+ }
+ },
+ "babel-polyfill": {
+ "version": "6.26.0",
+ "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
+ "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.26.0",
+ "core-js": "^2.5.0",
+ "regenerator-runtime": "^0.10.5"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.10.5",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
+ "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
+ "dev": true
+ }
}
},
"babel-register": {
@@ -802,13 +2185,13 @@
"integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=",
"dev": true,
"requires": {
- "babel-core": "6.26.0",
- "babel-runtime": "6.26.0",
- "core-js": "2.5.1",
- "home-or-tmp": "2.0.0",
- "lodash": "4.17.4",
- "mkdirp": "0.5.1",
- "source-map-support": "0.4.18"
+ "babel-core": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "core-js": "^2.5.0",
+ "home-or-tmp": "^2.0.0",
+ "lodash": "^4.17.4",
+ "mkdirp": "^0.5.1",
+ "source-map-support": "^0.4.15"
}
},
"babel-runtime": {
@@ -817,8 +2200,8 @@
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"dev": true,
"requires": {
- "core-js": "2.5.1",
- "regenerator-runtime": "0.11.0"
+ "core-js": "^2.4.0",
+ "regenerator-runtime": "^0.11.0"
}
},
"babel-template": {
@@ -827,11 +2210,11 @@
"integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-traverse": "6.26.0",
- "babel-types": "6.26.0",
- "babylon": "6.18.0",
- "lodash": "4.17.4"
+ "babel-runtime": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "lodash": "^4.17.4"
}
},
"babel-traverse": {
@@ -840,15 +2223,38 @@
"integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=",
"dev": true,
"requires": {
- "babel-code-frame": "6.26.0",
- "babel-messages": "6.23.0",
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0",
- "babylon": "6.18.0",
- "debug": "2.6.9",
- "globals": "9.18.0",
- "invariant": "2.2.2",
- "lodash": "4.17.4"
+ "babel-code-frame": "^6.26.0",
+ "babel-messages": "^6.23.0",
+ "babel-runtime": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "debug": "^2.6.8",
+ "globals": "^9.18.0",
+ "invariant": "^2.2.2",
+ "lodash": "^4.17.4"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "globals": {
+ "version": "9.18.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
+ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
}
},
"babel-types": {
@@ -857,10 +2263,18 @@
"integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "esutils": "2.0.2",
- "lodash": "4.17.4",
- "to-fast-properties": "1.0.3"
+ "babel-runtime": "^6.26.0",
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.4",
+ "to-fast-properties": "^1.0.3"
+ },
+ "dependencies": {
+ "to-fast-properties": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
+ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "dev": true
+ }
}
},
"babylon": {
@@ -869,271 +2283,501 @@
"integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
"dev": true
},
+ "backo2": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
+ "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=",
+ "dev": true
+ },
+ "bail": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.4.tgz",
+ "integrity": "sha512-S8vuDB4w6YpRhICUDET3guPlQpaJl7od94tpZ0Fvnyp+MKW/HyDTcRDck+29C9g+d/qQHnddRH3+94kZdrW0Ww==",
+ "dev": true
+ },
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
- "bcrypt-pbkdf": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
- "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
+ "base": {
+ "version": "0.11.2",
+ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
+ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
"dev": true,
- "optional": true,
"requires": {
- "tweetnacl": "0.14.5"
+ "cache-base": "^1.0.1",
+ "class-utils": "^0.3.5",
+ "component-emitter": "^1.2.1",
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.1",
+ "mixin-deep": "^1.2.0",
+ "pascalcase": "^0.1.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
}
},
- "binary-extensions": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz",
- "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=",
+ "base64-arraybuffer": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
+ "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=",
"dev": true
},
- "bluebird": {
- "version": "3.5.1",
- "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
- "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==",
+ "base64id": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
+ "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=",
"dev": true
},
- "boom": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
- "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
+ "better-assert": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
+ "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=",
"dev": true,
"requires": {
- "hoek": "4.2.0"
+ "callsite": "1.0.0"
}
},
- "boxen": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.2.2.tgz",
- "integrity": "sha1-Px1AMsMP/qnUsCwyLq8up0HcvOU=",
+ "binary-extensions": {
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.0.tgz",
+ "integrity": "sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw==",
+ "dev": true
+ },
+ "blob": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
+ "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==",
+ "dev": true
+ },
+ "bluebird": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.0.tgz",
+ "integrity": "sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg==",
+ "dev": true
+ },
+ "body-parser": {
+ "version": "1.19.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
+ "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"dev": true,
"requires": {
- "ansi-align": "2.0.0",
- "camelcase": "4.1.0",
- "chalk": "2.3.0",
- "cli-boxes": "1.0.0",
- "string-width": "2.1.1",
- "term-size": "1.2.0",
- "widest-line": "1.0.0"
+ "bytes": "3.1.0",
+ "content-type": "~1.0.4",
+ "debug": "2.6.9",
+ "depd": "~1.1.2",
+ "http-errors": "1.7.2",
+ "iconv-lite": "0.4.24",
+ "on-finished": "~2.3.0",
+ "qs": "6.7.0",
+ "raw-body": "2.4.0",
+ "type-is": "~1.6.17"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "camelcase": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
- "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
- "dev": true
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
+ "ms": "2.0.0"
}
},
- "has-flag": {
+ "ms": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
}
}
},
+ "boolbase": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
+ "dev": true
+ },
"brace-expansion": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
- "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
- "balanced-match": "1.0.0",
+ "balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"braces": {
- "version": "1.8.5",
- "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
- "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.1.0",
+ "array-unique": "^0.3.2",
+ "extend-shallow": "^2.0.1",
+ "fill-range": "^4.0.0",
+ "isobject": "^3.0.1",
+ "repeat-element": "^1.1.2",
+ "snapdragon": "^0.8.1",
+ "snapdragon-node": "^2.0.1",
+ "split-string": "^3.0.2",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
+ },
+ "browserslist": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz",
+ "integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==",
"dev": true,
"requires": {
- "expand-range": "1.8.2",
- "preserve": "0.2.0",
- "repeat-element": "1.1.2"
+ "caniuse-lite": "^1.0.30000939",
+ "electron-to-chromium": "^1.3.113",
+ "node-releases": "^1.1.8"
}
},
- "browserslist": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.5.0.tgz",
- "integrity": "sha512-6Vw1LIigGw8zCK0gxczksUMZlO+oPUwBazAztMmFL/F8D5wB0qCuxRJGYgYM3JzaO0v2ZMRIg+nnnOgNsPGHeA==",
+ "buffer-alloc": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
+ "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
"dev": true,
"requires": {
- "caniuse-lite": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
+ "buffer-alloc-unsafe": "^1.1.0",
+ "buffer-fill": "^1.0.0"
}
},
- "builtin-modules": {
+ "buffer-alloc-unsafe": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
+ "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
+ "dev": true
+ },
+ "buffer-fill": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
+ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=",
+ "dev": true
+ },
+ "buffer-from": {
"version": "1.1.1",
- "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
- "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
+ "bytes": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
+ "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
+ "dev": true
+ },
+ "cache-base": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
+ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
+ "dev": true,
+ "requires": {
+ "collection-visit": "^1.0.0",
+ "component-emitter": "^1.2.1",
+ "get-value": "^2.0.6",
+ "has-value": "^1.0.0",
+ "isobject": "^3.0.1",
+ "set-value": "^2.0.0",
+ "to-object-path": "^0.3.0",
+ "union-value": "^1.0.0",
+ "unset-value": "^1.0.0"
+ }
+ },
+ "call-me-maybe": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
+ "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=",
+ "dev": true
+ },
+ "caller-callsite": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
+ "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=",
+ "dev": true,
+ "requires": {
+ "callsites": "^2.0.0"
+ },
+ "dependencies": {
+ "callsites": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
+ "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
+ "dev": true
+ }
+ }
+ },
"caller-path": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
- "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz",
+ "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=",
"dev": true,
"requires": {
- "callsites": "0.2.0"
+ "caller-callsite": "^2.0.0"
}
},
+ "callsite": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
+ "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=",
+ "dev": true
+ },
"callsites": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
- "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true
},
+ "camel-case": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
+ "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
+ "dev": true,
+ "requires": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.1.1"
+ }
+ },
"camelcase": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
- "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
"dev": true
},
"camelcase-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
- "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz",
+ "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=",
"dev": true,
"requires": {
- "camelcase": "2.1.1",
- "map-obj": "1.0.1"
+ "camelcase": "^4.1.0",
+ "map-obj": "^2.0.0",
+ "quick-lru": "^1.0.0"
}
},
"caniuse-api": {
- "version": "1.6.1",
- "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz",
- "integrity": "sha1-tTTnxzTE+B7F++isoq0kNUuWLGw=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz",
+ "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==",
"dev": true,
"requires": {
- "browserslist": "1.7.7",
- "caniuse-db": "1.0.30000744",
- "lodash.memoize": "4.1.2",
- "lodash.uniq": "4.5.0"
- },
- "dependencies": {
- "browserslist": {
- "version": "1.7.7",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
- "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
- "dev": true,
- "requires": {
- "caniuse-db": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
- }
- }
+ "browserslist": "^4.0.0",
+ "caniuse-lite": "^1.0.0",
+ "lodash.memoize": "^4.1.2",
+ "lodash.uniq": "^4.5.0"
}
},
- "caniuse-db": {
- "version": "1.0.30000744",
- "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000744.tgz",
- "integrity": "sha1-AHWP991fcTjTShVgjcz3Glllb/4=",
- "dev": true
- },
"caniuse-lite": {
- "version": "1.0.30000744",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000744.tgz",
- "integrity": "sha1-hg+lyDujT+YZOX1gfzC7R0ghZxs=",
+ "version": "1.0.30000943",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000943.tgz",
+ "integrity": "sha512-nJMjU4UaesbOHTcmz6VS+qaog++Fdepg4KAya5DL/AZrL/aaAZDGOOQ0AECtsJa09r4cJBdHZMive5mw8lnQ5A==",
"dev": true
},
- "capture-stack-trace": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz",
- "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=",
+ "ccount": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.4.tgz",
+ "integrity": "sha512-fpZ81yYfzentuieinmGnphk0pLkOTMm6MZdVqwd77ROvhko6iujLNGrHH5E7utq3ygWklwfmwuG+A7P+NpqT6w==",
"dev": true
},
- "caseless": {
- "version": "0.12.0",
- "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
- "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
- "dev": true
+ "chai": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
+ "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
+ "dev": true,
+ "requires": {
+ "assertion-error": "^1.1.0",
+ "check-error": "^1.0.2",
+ "deep-eql": "^3.0.1",
+ "get-func-name": "^2.0.0",
+ "pathval": "^1.1.0",
+ "type-detect": "^4.0.5"
+ }
},
"chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
- "ansi-styles": "2.2.1",
- "escape-string-regexp": "1.0.5",
- "has-ansi": "2.0.0",
- "strip-ansi": "3.0.1",
- "supports-color": "2.0.0"
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
}
},
+ "change-case": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/change-case/-/change-case-3.1.0.tgz",
+ "integrity": "sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw==",
+ "dev": true,
+ "requires": {
+ "camel-case": "^3.0.0",
+ "constant-case": "^2.0.0",
+ "dot-case": "^2.1.0",
+ "header-case": "^1.0.0",
+ "is-lower-case": "^1.1.0",
+ "is-upper-case": "^1.1.0",
+ "lower-case": "^1.1.1",
+ "lower-case-first": "^1.0.0",
+ "no-case": "^2.3.2",
+ "param-case": "^2.1.0",
+ "pascal-case": "^2.0.0",
+ "path-case": "^2.1.0",
+ "sentence-case": "^2.1.0",
+ "snake-case": "^2.1.0",
+ "swap-case": "^1.1.0",
+ "title-case": "^2.1.0",
+ "upper-case": "^1.1.1",
+ "upper-case-first": "^1.1.0"
+ }
+ },
+ "character-entities": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.3.tgz",
+ "integrity": "sha512-yB4oYSAa9yLcGyTbB4ItFwHw43QHdH129IJ5R+WvxOkWlyFnR5FAaBNnUq4mcxsTVZGh28bHoeTHMKXH1wZf3w==",
+ "dev": true
+ },
+ "character-entities-html4": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.3.tgz",
+ "integrity": "sha512-SwnyZ7jQBCRHELk9zf2CN5AnGEc2nA+uKMZLHvcqhpPprjkYhiLn0DywMHgN5ttFZuITMATbh68M6VIVKwJbcg==",
+ "dev": true
+ },
+ "character-entities-legacy": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.3.tgz",
+ "integrity": "sha512-YAxUpPoPwxYFsslbdKkhrGnXAtXoHNgYjlBM3WMXkWGTl5RsY3QmOyhwAgL8Nxm9l5LBThXGawxKPn68y6/fww==",
+ "dev": true
+ },
+ "character-reference-invalid": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.3.tgz",
+ "integrity": "sha512-VOq6PRzQBam/8Jm6XBGk2fNEnHXAdGd6go0rtd4weAGECBamHDwwCQSOT12TACIYUZegUXnV6xBXqUssijtxIg==",
+ "dev": true
+ },
"chardet": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
- "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
+ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
+ "dev": true
+ },
+ "check-error": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
+ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
"dev": true
},
"chokidar": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
- "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz",
+ "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==",
"dev": true,
"requires": {
- "anymatch": "1.3.2",
- "async-each": "1.0.1",
- "glob-parent": "2.0.0",
- "inherits": "2.0.3",
- "is-binary-path": "1.0.1",
- "is-glob": "2.0.1",
- "path-is-absolute": "1.0.1",
- "readdirp": "2.1.0"
+ "anymatch": "^2.0.0",
+ "async-each": "^1.0.1",
+ "braces": "^2.3.2",
+ "fsevents": "^1.2.7",
+ "glob-parent": "^3.1.0",
+ "inherits": "^2.0.3",
+ "is-binary-path": "^1.0.0",
+ "is-glob": "^4.0.0",
+ "normalize-path": "^3.0.0",
+ "path-is-absolute": "^1.0.0",
+ "readdirp": "^2.2.1",
+ "upath": "^1.1.0"
}
},
- "circular-json": {
- "version": "0.3.3",
- "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
- "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
+ "ci-info": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
+ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
"dev": true
},
- "clap": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz",
- "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==",
+ "class-utils": {
+ "version": "0.3.6",
+ "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
+ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
"dev": true,
"requires": {
- "chalk": "1.1.3"
+ "arr-union": "^3.1.0",
+ "define-property": "^0.2.5",
+ "isobject": "^3.0.0",
+ "static-extend": "^0.1.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ }
}
},
- "cli-boxes": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz",
- "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=",
+ "clean-stack": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
+ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"dev": true
},
"cli-cursor": {
@@ -1142,14 +2786,61 @@
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
"dev": true,
"requires": {
- "restore-cursor": "2.0.0"
+ "restore-cursor": "^2.0.0"
}
},
- "cli-spinners": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.1.0.tgz",
- "integrity": "sha1-8YR7FohE2RemceudFH499JfJDQY=",
- "dev": true
+ "cli-truncate": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-0.2.1.tgz",
+ "integrity": "sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ=",
+ "dev": true,
+ "requires": {
+ "slice-ansi": "0.0.4",
+ "string-width": "^1.0.1"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "slice-ansi": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz",
+ "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=",
+ "dev": true
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ }
+ }
},
"cli-width": {
"version": "2.2.0",
@@ -1158,67 +2849,91 @@
"dev": true
},
"cliui": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
- "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
+ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
"dev": true,
"requires": {
- "string-width": "1.0.2",
- "strip-ansi": "3.0.1",
- "wrap-ansi": "2.1.0"
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0",
+ "wrap-ansi": "^2.0.0"
},
"dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"requires": {
- "number-is-nan": "1.0.1"
+ "number-is-nan": "^1.0.0"
}
},
- "string-width": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "wrap-ansi": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"dev": true,
"requires": {
- "code-point-at": "1.1.0",
- "is-fullwidth-code-point": "1.0.0",
- "strip-ansi": "3.0.1"
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1"
+ },
+ "dependencies": {
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ }
}
}
}
},
- "clone": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz",
- "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=",
- "dev": true
- },
"clone-regexp": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.0.tgz",
- "integrity": "sha1-6uCiQT9VwJQvgYwin+/OhF1/Oxw=",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz",
+ "integrity": "sha512-beMpP7BOtTipFuW8hrJvREQ2DrRu3BE7by0ZpibtfBA+qfHYvMGTc2Yb1JMYPKg/JUw0CHYvpg796aNTSW9z7Q==",
"dev": true,
"requires": {
- "is-regexp": "1.0.0",
- "is-supported-regexp-flag": "1.0.0"
+ "is-regexp": "^2.0.0"
+ },
+ "dependencies": {
+ "is-regexp": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-2.1.0.tgz",
+ "integrity": "sha512-OZ4IlER3zmRIoB9AqNhEggVxqIH4ofDns5nRrPS6yQxXE1TPCUpFznBfRQmQa8uC+pXqjMnukiJBxCisIxiLGA==",
+ "dev": true
+ }
}
},
- "co": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
- "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
- "dev": true
- },
"coa": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/coa/-/coa-1.0.4.tgz",
- "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz",
+ "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==",
"dev": true,
"requires": {
- "q": "1.5.0"
+ "@types/q": "^1.5.1",
+ "chalk": "^2.4.1",
+ "q": "^1.1.2"
}
},
"code-point-at": {
@@ -1227,32 +2942,54 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true
},
+ "codecov": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.6.1.tgz",
+ "integrity": "sha512-IUJB6WG47nWK7o50etF8jBadxdMw7DmoQg05yIljstXFBGB6clOZsIj6iD4P82T2YaIU3qq+FFu8K9pxgkCJDQ==",
+ "dev": true,
+ "requires": {
+ "argv": "^0.0.2",
+ "ignore-walk": "^3.0.1",
+ "js-yaml": "^3.13.1",
+ "teeny-request": "^3.11.3",
+ "urlgrey": "^0.4.4"
+ }
+ },
+ "collapse-white-space": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.5.tgz",
+ "integrity": "sha512-703bOOmytCYAX9cXYqoikYIx6twmFCXsnzRQheBcTG3nzKYBR4P/+wkYeH+Mvj7qUz8zZDtdyzbxfnEi/kYzRQ==",
+ "dev": true
+ },
+ "collection-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
+ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=",
+ "dev": true,
+ "requires": {
+ "map-visit": "^1.0.0",
+ "object-visit": "^1.0.0"
+ }
+ },
"color": {
- "version": "0.11.4",
- "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz",
- "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/color/-/color-3.1.0.tgz",
+ "integrity": "sha512-CwyopLkuRYO5ei2EpzpIh6LqJMt6Mt+jZhO5VI5f/wJLZriXQE32/SSqzmrh+QB+AZT81Cj8yv+7zwToW8ahZg==",
"dev": true,
"requires": {
- "clone": "1.0.2",
- "color-convert": "1.9.0",
- "color-string": "0.3.0"
+ "color-convert": "^1.9.1",
+ "color-string": "^1.5.2"
}
},
"color-convert": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
- "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=",
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
- "color-diff": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/color-diff/-/color-diff-0.1.7.tgz",
- "integrity": "sha1-bbeM2UgqjkWdQIIer0tQMoPcuOI=",
- "dev": true
- },
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
@@ -1260,82 +2997,59 @@
"dev": true
},
"color-string": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz",
- "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=",
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.3.tgz",
+ "integrity": "sha512-dC2C5qeWoYkxki5UAXapdjqO672AM4vZuPGRQfO8b5HKuKGBbKWpITyDYN7TOFKvRW7kOgAn3746clDBMDJyQw==",
"dev": true,
"requires": {
- "color-name": "1.1.3"
+ "color-name": "^1.0.0",
+ "simple-swizzle": "^0.2.2"
}
},
- "colorguard": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/colorguard/-/colorguard-1.2.0.tgz",
- "integrity": "sha1-8/rK9cquuk71RlPZ+yW7cxd8DYQ=",
- "dev": true,
- "requires": {
- "chalk": "1.1.3",
- "color-diff": "0.1.7",
- "log-symbols": "1.0.2",
- "object-assign": "4.1.1",
- "pipetteur": "2.0.3",
- "plur": "2.1.2",
- "postcss": "5.2.18",
- "postcss-reporter": "1.4.1",
- "text-table": "0.2.0",
- "yargs": "1.3.3"
- },
- "dependencies": {
- "postcss-reporter": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-1.4.1.tgz",
- "integrity": "sha1-wTbwpbFhkV83ndN2XGEHX357mvI=",
- "dev": true,
- "requires": {
- "chalk": "1.1.3",
- "lodash": "4.17.4",
- "log-symbols": "1.0.2",
- "postcss": "5.2.18"
- }
- },
- "yargs": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.3.3.tgz",
- "integrity": "sha1-BU3oth8i7v23IHBZ6u+da4P7kxo=",
- "dev": true
- }
- }
+ "colors": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
+ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
+ "dev": true
},
- "colormin": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/colormin/-/colormin-1.1.2.tgz",
- "integrity": "sha1-6i90IKcrlogaOKrlnsEkpvcpgTM=",
+ "commander": {
+ "version": "2.20.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
+ "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==",
+ "dev": true
+ },
+ "compare-func": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz",
+ "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=",
"dev": true,
"requires": {
- "color": "0.11.4",
- "css-color-names": "0.0.4",
- "has": "1.0.1"
+ "array-ify": "^1.0.0",
+ "dot-prop": "^3.0.0"
}
},
- "colors": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz",
- "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=",
+ "compare-versions": {
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.5.1.tgz",
+ "integrity": "sha512-9fGPIB7C6AyM18CJJBHt5EnCZDG3oiTJYy0NjfIAGjKpzv0tkxWko7TNQHF5ymqm7IH03tqmeuBxtvD+Izh6mg==",
"dev": true
},
- "combined-stream": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
- "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
- "dev": true,
- "requires": {
- "delayed-stream": "1.0.0"
- }
+ "component-bind": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
+ "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=",
+ "dev": true
},
- "commander": {
- "version": "2.11.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz",
- "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==",
+ "component-emitter": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
+ "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=",
+ "dev": true
+ },
+ "component-inherit": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
+ "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=",
"dev": true
},
"concat-map": {
@@ -1345,28 +3059,60 @@
"dev": true
},
"concat-stream": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz",
- "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=",
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
"dev": true,
"requires": {
- "inherits": "2.0.3",
- "readable-stream": "2.3.3",
- "typedarray": "0.0.6"
+ "buffer-from": "^1.0.0",
+ "inherits": "^2.0.3",
+ "readable-stream": "^2.2.2",
+ "typedarray": "^0.0.6"
}
},
- "configstore": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz",
- "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==",
+ "confusing-browser-globals": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz",
+ "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==",
+ "dev": true
+ },
+ "connect": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz",
+ "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==",
"dev": true,
"requires": {
- "dot-prop": "4.2.0",
- "graceful-fs": "4.1.11",
- "make-dir": "1.1.0",
- "unique-string": "1.0.0",
- "write-file-atomic": "2.3.0",
- "xdg-basedir": "3.0.0"
+ "debug": "2.6.9",
+ "finalhandler": "1.1.2",
+ "parseurl": "~1.3.3",
+ "utils-merge": "1.0.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "constant-case": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz",
+ "integrity": "sha1-QXV2TTidP6nI7NKRhu1gBSQ7akY=",
+ "dev": true,
+ "requires": {
+ "snake-case": "^2.1.0",
+ "upper-case": "^1.1.1"
}
},
"contains-path": {
@@ -1375,18 +3121,133 @@
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
+ "content-type": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
+ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
+ "dev": true
+ },
+ "conventional-changelog-angular": {
+ "version": "1.6.6",
+ "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz",
+ "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==",
+ "dev": true,
+ "requires": {
+ "compare-func": "^1.3.1",
+ "q": "^1.5.1"
+ }
+ },
+ "conventional-commits-parser": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz",
+ "integrity": "sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ==",
+ "dev": true,
+ "requires": {
+ "JSONStream": "^1.0.4",
+ "is-text-path": "^1.0.0",
+ "lodash": "^4.2.1",
+ "meow": "^4.0.0",
+ "split2": "^2.0.0",
+ "through2": "^2.0.0",
+ "trim-off-newlines": "^1.0.0"
+ },
+ "dependencies": {
+ "meow": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz",
+ "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==",
+ "dev": true,
+ "requires": {
+ "camelcase-keys": "^4.0.0",
+ "decamelize-keys": "^1.0.0",
+ "loud-rejection": "^1.0.0",
+ "minimist": "^1.1.3",
+ "minimist-options": "^3.0.1",
+ "normalize-package-data": "^2.3.4",
+ "read-pkg-up": "^3.0.0",
+ "redent": "^2.0.0",
+ "trim-newlines": "^2.0.0"
+ }
+ }
+ }
+ },
"convert-source-map": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz",
- "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=",
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
+ "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "~5.1.1"
+ }
+ },
+ "cookie": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
+ "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=",
+ "dev": true
+ },
+ "copy-descriptor": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
+ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
"dev": true
},
"core-js": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz",
- "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=",
+ "version": "2.6.5",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
+ "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
"dev": true
},
+ "core-js-compat": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.2.1.tgz",
+ "integrity": "sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A==",
+ "dev": true,
+ "requires": {
+ "browserslist": "^4.6.6",
+ "semver": "^6.3.0"
+ },
+ "dependencies": {
+ "browserslist": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.7.0.tgz",
+ "integrity": "sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30000989",
+ "electron-to-chromium": "^1.3.247",
+ "node-releases": "^1.1.29"
+ }
+ },
+ "caniuse-lite": {
+ "version": "1.0.30000998",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000998.tgz",
+ "integrity": "sha512-8Tj5sPZR9kMHeDD9SZXIVr5m9ofufLLCG2Y4QwQrH18GIwG+kCc+zYdlR036ZRkuKjVVetyxeAgGA1xF7XdmzQ==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.273",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.273.tgz",
+ "integrity": "sha512-0kUppiHQvHEENHh+nTtvTt4eXMwcPyWmMaj73GPrSEm3ldKhmmHuOH6IjrmuW6YmyS/fpXcLvMQLNVpqRhpNWw==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.34",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.34.tgz",
+ "integrity": "sha512-fNn12JTEfniTuCqo0r9jXgl44+KxRH/huV7zM/KAGOKxDKrHr6EbT7SSs4B+DNxyBE2mks28AD+Jw6PkfY5uwA==",
+ "dev": true,
+ "requires": {
+ "semver": "^6.3.0"
+ }
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
+ },
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@@ -1394,157 +3255,149 @@
"dev": true
},
"cosmiconfig": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-2.2.2.tgz",
- "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==",
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
+ "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
"dev": true,
"requires": {
- "is-directory": "0.3.1",
- "js-yaml": "3.7.0",
- "minimist": "1.2.0",
- "object-assign": "4.1.1",
- "os-homedir": "1.0.2",
- "parse-json": "2.2.0",
- "require-from-string": "1.2.1"
+ "import-fresh": "^2.0.0",
+ "is-directory": "^0.3.1",
+ "js-yaml": "^3.13.1",
+ "parse-json": "^4.0.0"
},
"dependencies": {
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "import-fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
+ "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
+ "dev": true,
+ "requires": {
+ "caller-path": "^2.0.0",
+ "resolve-from": "^3.0.0"
+ }
+ },
+ "resolve-from": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
"dev": true
}
}
},
"cp-file": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-3.2.0.tgz",
- "integrity": "sha1-b4NhYlRiTwrViqSqjQdvAmvn4Yg=",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.1.0.tgz",
+ "integrity": "sha512-an34I0lJwKncRKjxe3uGWUuiIIVYsHHjBGKld3OQB56hfoPCYom31VysvfuysKqHLbz6drnqP5YrCfLw17I2kw==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "mkdirp": "0.5.1",
- "nested-error-stacks": "1.0.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1",
- "readable-stream": "2.3.3"
+ "graceful-fs": "^4.1.2",
+ "make-dir": "^2.0.0",
+ "nested-error-stacks": "^2.0.0",
+ "pify": "^4.0.1",
+ "safe-buffer": "^5.0.1"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+ "dev": true
+ }
}
},
"cpy": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/cpy/-/cpy-4.0.1.tgz",
- "integrity": "sha1-tnJn66LzlgugalphrJQDNCKDNCQ=",
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/cpy/-/cpy-7.1.0.tgz",
+ "integrity": "sha512-HT6xnKeHwACUObD3LEFAsjeQ9IUVhC1Pn6Qbk0q6CEWy0WG061khT3ZxQU6IuMXPEEyb+vvluyUOyTdl+9EPWQ==",
"dev": true,
"requires": {
- "cp-file": "3.2.0",
- "globby": "4.1.0",
- "meow": "3.7.0",
- "nested-error-stacks": "1.0.2",
- "object-assign": "4.1.1",
- "pinkie-promise": "2.0.1"
+ "arrify": "^1.0.1",
+ "cp-file": "^6.1.0",
+ "globby": "^9.1.0",
+ "nested-error-stacks": "^2.0.0"
}
},
"cpy-cli": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-1.0.1.tgz",
- "integrity": "sha1-Z/taSi3sKMqKv/N13kuecfanVhw=",
- "dev": true,
- "requires": {
- "cpy": "4.0.1",
- "meow": "3.7.0"
- }
- },
- "create-error-class": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz",
- "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=",
- "dev": true,
- "requires": {
- "capture-stack-trace": "1.0.0"
- }
- },
- "cross-spawn": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
- "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-2.0.0.tgz",
+ "integrity": "sha512-LzrtY3lBWvFZcw4lXgkEbbDUd7y78juC3C5l7gj3UyezMEZF0Be9fjCVLN1HoZAzdMDeC3KHehWpHBJvgVAPkw==",
"dev": true,
"requires": {
- "lru-cache": "4.1.1",
- "shebang-command": "1.2.0",
- "which": "1.3.0"
+ "cpy": "^7.0.0",
+ "meow": "^5.0.0"
}
},
- "cryptiles": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz",
- "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=",
+ "create-banner": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/create-banner/-/create-banner-1.0.0.tgz",
+ "integrity": "sha512-SxHIXp1kNsV4oSxDP0mLxkaLhoCjT9x3eDN49Hb7oM0TRzj2IlaRmqeYVEdRG5kxNClvecNkgStVE5yQTqaT0w==",
"dev": true,
"requires": {
- "boom": "5.2.0"
+ "change-case": "^3.0.2",
+ "dot-prop": "^4.2.0",
+ "extend": "^3.0.1",
+ "read-pkg-up": "^3.0.0"
},
"dependencies": {
- "boom": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
- "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
+ "dot-prop": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
+ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
- "hoek": "4.2.0"
+ "is-obj": "^1.0.0"
}
}
}
},
- "crypto-random-string": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
- "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=",
- "dev": true
- },
- "css-color-function": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/css-color-function/-/css-color-function-1.3.3.tgz",
- "integrity": "sha1-jtJMLAIFBzM5+voAS8jBQfzLKC4=",
+ "cross-env": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz",
+ "integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==",
"dev": true,
"requires": {
- "balanced-match": "0.1.0",
- "color": "0.11.4",
- "debug": "3.1.0",
- "rgb": "0.1.0"
+ "cross-spawn": "^7.0.0"
},
"dependencies": {
- "balanced-match": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.1.0.tgz",
- "integrity": "sha1-tQS9BYabOSWd0MXvw12EMXbczEo=",
- "dev": true
- },
- "debug": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
- "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "cross-spawn": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.0.tgz",
+ "integrity": "sha512-6U/8SMK2FBNnB21oQ4+6Nsodxanw1gTkntYA2zBdkFYFu3ZDx65P2ONEXGSvob/QS6REjVHQ9zxzdOafwFdstw==",
"dev": true,
"requires": {
- "ms": "2.0.0"
+ "path-key": "^3.1.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
}
+ },
+ "path-key": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.0.tgz",
+ "integrity": "sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg==",
+ "dev": true
}
}
},
- "css-color-list": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/css-color-list/-/css-color-list-0.0.1.tgz",
- "integrity": "sha1-hxjoaVrnosyHh76HFfHACKfyixU=",
+ "cross-spawn": {
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
- "css-color-names": "0.0.1"
- },
- "dependencies": {
- "css-color-names": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.1.tgz",
- "integrity": "sha1-XQVI+iVkVu3kqaDCrHqxnT6xrYE=",
- "dev": true
- }
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
+ "shebang-command": "^1.2.0",
+ "which": "^1.2.9"
+ }
+ },
+ "css-blank-pseudo": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz",
+ "integrity": "sha512-LHz35Hr83dnFeipc7oqFDmsjHdljj3TQtxGGiNWSOsTLIAubSm4TEz8qCaKFpk7idaQ1GfWscF4E6mgpBysA1w==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.5"
}
},
"css-color-names": {
@@ -1553,108 +3406,220 @@
"integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=",
"dev": true
},
- "css-rule-stream": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/css-rule-stream/-/css-rule-stream-1.1.0.tgz",
- "integrity": "sha1-N4bnGYmD2WWibjGVfgkHjLt3BaI=",
+ "css-declaration-sorter": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-4.0.1.tgz",
+ "integrity": "sha512-BcxQSKTSEEQUftYpBVnsH4SF05NTuBokb19/sBt6asXGKZ/6VP7PLG1CBCkFDYOnhXhPh0jMhO6xZ71oYHXHBA==",
"dev": true,
"requires": {
- "css-tokenize": "1.0.1",
- "duplexer2": "0.0.2",
- "ldjson-stream": "1.2.1",
- "through2": "0.6.5"
+ "postcss": "^7.0.1",
+ "timsort": "^0.3.0"
}
},
- "css-tokenize": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/css-tokenize/-/css-tokenize-1.0.1.tgz",
- "integrity": "sha1-RiXLHtohwUOFi3+B1oA8HSb8FL4=",
+ "css-has-pseudo": {
+ "version": "0.10.0",
+ "resolved": "https://registry.npmjs.org/css-has-pseudo/-/css-has-pseudo-0.10.0.tgz",
+ "integrity": "sha512-Z8hnfsZu4o/kt+AuFzeGpLVhFOGO9mluyHBaA2bA8aCGTwah5sT3WV/fTHH8UNZUytOIImuGPrl/prlb4oX4qQ==",
"dev": true,
"requires": {
- "inherits": "2.0.3",
- "readable-stream": "1.1.14"
+ "postcss": "^7.0.6",
+ "postcss-selector-parser": "^5.0.0-rc.4"
+ }
+ },
+ "css-prefers-color-scheme": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-3.1.1.tgz",
+ "integrity": "sha512-MTu6+tMs9S3EUqzmqLXEcgNRbNkkD/TGFvowpeoWJn5Vfq7FMgsmRQs9X5NXAURiOBmOxm/lLjsDNXDE6k9bhg==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.5"
+ }
+ },
+ "css-select": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.0.2.tgz",
+ "integrity": "sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ==",
+ "dev": true,
+ "requires": {
+ "boolbase": "^1.0.0",
+ "css-what": "^2.1.2",
+ "domutils": "^1.7.0",
+ "nth-check": "^1.0.2"
+ }
+ },
+ "css-select-base-adapter": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz",
+ "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==",
+ "dev": true
+ },
+ "css-tree": {
+ "version": "1.0.0-alpha.28",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.28.tgz",
+ "integrity": "sha512-joNNW1gCp3qFFzj4St6zk+Wh/NBv0vM5YbEreZk0SD4S23S+1xBKb6cLDg2uj4P4k/GUMlIm6cKIDqIG+vdt0w==",
+ "dev": true,
+ "requires": {
+ "mdn-data": "~1.1.0",
+ "source-map": "^0.5.3"
+ }
+ },
+ "css-unit-converter": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz",
+ "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=",
+ "dev": true
+ },
+ "css-url-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/css-url-regex/-/css-url-regex-1.1.0.tgz",
+ "integrity": "sha1-g4NCMMyfdMRX3lnuvRVD/uuDt+w=",
+ "dev": true
+ },
+ "css-what": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz",
+ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
+ "dev": true
+ },
+ "cssdb": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-4.4.0.tgz",
+ "integrity": "sha512-LsTAR1JPEM9TpGhl/0p3nQecC2LJ0kD8X5YARu1hk/9I1gril5vDtMZyNxcEpxxDj34YNck/ucjuoUd66K03oQ==",
+ "dev": true
+ },
+ "cssesc": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz",
+ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==",
+ "dev": true
+ },
+ "cssnano": {
+ "version": "4.1.10",
+ "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
+ "integrity": "sha512-5wny+F6H4/8RgNlaqab4ktc3e0/blKutmq8yNlBFXA//nSFFAqAngjNVRzUvCgYROULmZZUoosL/KSoZo5aUaQ==",
+ "dev": true,
+ "requires": {
+ "cosmiconfig": "^5.0.0",
+ "cssnano-preset-default": "^4.0.7",
+ "is-resolvable": "^1.0.0",
+ "postcss": "^7.0.0"
},
"dependencies": {
- "isarray": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
- "dev": true
+ "cosmiconfig": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz",
+ "integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==",
+ "dev": true,
+ "requires": {
+ "import-fresh": "^2.0.0",
+ "is-directory": "^0.3.1",
+ "js-yaml": "^3.9.0",
+ "lodash.get": "^4.4.2",
+ "parse-json": "^4.0.0"
+ }
},
- "readable-stream": {
- "version": "1.1.14",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
- "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
+ "import-fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
+ "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
"dev": true,
"requires": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "isarray": "0.0.1",
- "string_decoder": "0.10.31"
+ "caller-path": "^2.0.0",
+ "resolve-from": "^3.0.0"
}
},
- "string_decoder": {
- "version": "0.10.31",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
+ "resolve-from": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
"dev": true
}
}
},
- "css-unit-converter": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz",
- "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=",
+ "cssnano-preset-default": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-4.0.7.tgz",
+ "integrity": "sha512-x0YHHx2h6p0fCl1zY9L9roD7rnlltugGu7zXSKQx6k2rYw0Hi3IqxcoAGF7u9Q5w1nt7vK0ulxV8Lo+EvllGsA==",
+ "dev": true,
+ "requires": {
+ "css-declaration-sorter": "^4.0.1",
+ "cssnano-util-raw-cache": "^4.0.1",
+ "postcss": "^7.0.0",
+ "postcss-calc": "^7.0.1",
+ "postcss-colormin": "^4.0.3",
+ "postcss-convert-values": "^4.0.1",
+ "postcss-discard-comments": "^4.0.2",
+ "postcss-discard-duplicates": "^4.0.2",
+ "postcss-discard-empty": "^4.0.1",
+ "postcss-discard-overridden": "^4.0.1",
+ "postcss-merge-longhand": "^4.0.11",
+ "postcss-merge-rules": "^4.0.3",
+ "postcss-minify-font-values": "^4.0.2",
+ "postcss-minify-gradients": "^4.0.2",
+ "postcss-minify-params": "^4.0.2",
+ "postcss-minify-selectors": "^4.0.2",
+ "postcss-normalize-charset": "^4.0.1",
+ "postcss-normalize-display-values": "^4.0.2",
+ "postcss-normalize-positions": "^4.0.2",
+ "postcss-normalize-repeat-style": "^4.0.2",
+ "postcss-normalize-string": "^4.0.2",
+ "postcss-normalize-timing-functions": "^4.0.2",
+ "postcss-normalize-unicode": "^4.0.1",
+ "postcss-normalize-url": "^4.0.1",
+ "postcss-normalize-whitespace": "^4.0.2",
+ "postcss-ordered-values": "^4.1.2",
+ "postcss-reduce-initial": "^4.0.3",
+ "postcss-reduce-transforms": "^4.0.2",
+ "postcss-svgo": "^4.0.2",
+ "postcss-unique-selectors": "^4.0.1"
+ }
+ },
+ "cssnano-util-get-arguments": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz",
+ "integrity": "sha1-7ToIKZ8h11dBsg87gfGU7UnMFQ8=",
"dev": true
},
- "cssnano": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz",
- "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=",
- "dev": true,
- "requires": {
- "autoprefixer": "6.7.7",
- "decamelize": "1.2.0",
- "defined": "1.0.0",
- "has": "1.0.1",
- "object-assign": "4.1.1",
- "postcss": "5.2.18",
- "postcss-calc": "5.3.1",
- "postcss-colormin": "2.2.2",
- "postcss-convert-values": "2.6.1",
- "postcss-discard-comments": "2.0.4",
- "postcss-discard-duplicates": "2.1.0",
- "postcss-discard-empty": "2.1.0",
- "postcss-discard-overridden": "0.1.1",
- "postcss-discard-unused": "2.2.3",
- "postcss-filter-plugins": "2.0.2",
- "postcss-merge-idents": "2.1.7",
- "postcss-merge-longhand": "2.0.2",
- "postcss-merge-rules": "2.1.2",
- "postcss-minify-font-values": "1.0.5",
- "postcss-minify-gradients": "1.0.5",
- "postcss-minify-params": "1.2.2",
- "postcss-minify-selectors": "2.1.1",
- "postcss-normalize-charset": "1.1.1",
- "postcss-normalize-url": "3.0.8",
- "postcss-ordered-values": "2.2.3",
- "postcss-reduce-idents": "2.4.0",
- "postcss-reduce-initial": "1.0.1",
- "postcss-reduce-transforms": "1.0.4",
- "postcss-svgo": "2.1.6",
- "postcss-unique-selectors": "2.0.2",
- "postcss-value-parser": "3.3.0",
- "postcss-zindex": "2.2.0"
+ "cssnano-util-get-match": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/cssnano-util-get-match/-/cssnano-util-get-match-4.0.0.tgz",
+ "integrity": "sha1-wOTKB/U4a7F+xeUiULT1lhNlFW0=",
+ "dev": true
+ },
+ "cssnano-util-raw-cache": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/cssnano-util-raw-cache/-/cssnano-util-raw-cache-4.0.1.tgz",
+ "integrity": "sha512-qLuYtWK2b2Dy55I8ZX3ky1Z16WYsx544Q0UWViebptpwn/xDBmog2TLg4f+DBMg1rJ6JDWtn96WHbOKDWt1WQA==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.0"
}
},
+ "cssnano-util-same-parent": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz",
+ "integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q==",
+ "dev": true
+ },
"csso": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/csso/-/csso-2.3.2.tgz",
- "integrity": "sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U=",
+ "version": "3.5.1",
+ "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz",
+ "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==",
"dev": true,
"requires": {
- "clap": "1.2.3",
- "source-map": "0.5.7"
+ "css-tree": "1.0.0-alpha.29"
+ },
+ "dependencies": {
+ "css-tree": {
+ "version": "1.0.0-alpha.29",
+ "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz",
+ "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==",
+ "dev": true,
+ "requires": {
+ "mdn-data": "~1.1.0",
+ "source-map": "^0.5.3"
+ }
+ }
}
},
"cuint": {
@@ -1669,25 +3634,49 @@
"integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
"dev": true,
"requires": {
- "array-find-index": "1.0.2"
+ "array-find-index": "^1.0.1"
}
},
- "dashdash": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
- "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "custom-event": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz",
+ "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=",
+ "dev": true
+ },
+ "dargs": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz",
+ "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=",
"dev": true,
"requires": {
- "assert-plus": "1.0.0"
+ "number-is-nan": "^1.0.0"
}
},
+ "date-fns": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz",
+ "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
+ "dev": true
+ },
+ "date-format": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz",
+ "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==",
+ "dev": true
+ },
+ "debounce": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz",
+ "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==",
+ "dev": true
+ },
"debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
+ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"requires": {
- "ms": "2.0.0"
+ "ms": "^2.1.1"
}
},
"decamelize": {
@@ -1696,129 +3685,135 @@
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
"dev": true
},
- "deep-extend": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz",
- "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=",
+ "decamelize-keys": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz",
+ "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=",
+ "dev": true,
+ "requires": {
+ "decamelize": "^1.1.0",
+ "map-obj": "^1.0.0"
+ },
+ "dependencies": {
+ "map-obj": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
+ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
+ "dev": true
+ }
+ }
+ },
+ "decode-uri-component": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
+ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
+ "dev": true
+ },
+ "dedent": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
+ "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=",
"dev": true
},
+ "deep-eql": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
+ "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
+ "dev": true,
+ "requires": {
+ "type-detect": "^4.0.0"
+ }
+ },
"deep-is": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
"dev": true
},
- "define-properties": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz",
- "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=",
+ "default-require-extensions": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz",
+ "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=",
"dev": true,
"requires": {
- "foreach": "2.0.5",
- "object-keys": "1.0.11"
+ "strip-bom": "^3.0.0"
}
},
- "defined": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
- "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=",
- "dev": true
+ "define-properties": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
+ "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
+ "dev": true,
+ "requires": {
+ "object-keys": "^1.0.12"
+ }
},
- "del": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
- "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
+ "define-property": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
+ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
"dev": true,
"requires": {
- "globby": "5.0.0",
- "is-path-cwd": "1.0.0",
- "is-path-in-cwd": "1.0.0",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1",
- "rimraf": "2.6.2"
+ "is-descriptor": "^1.0.2",
+ "isobject": "^3.0.1"
},
"dependencies": {
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
"dev": true,
"requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
+ "kind-of": "^6.0.0"
}
},
- "globby": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
- "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
"dev": true,
"requires": {
- "array-union": "1.0.2",
- "arrify": "1.0.1",
- "glob": "7.1.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
}
}
}
},
- "del-cli": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-1.1.0.tgz",
- "integrity": "sha1-J1V9aaC335ncuqHjSgnmrGWR0sQ=",
+ "del": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz",
+ "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=",
"dev": true,
"requires": {
- "del": "3.0.0",
- "meow": "3.7.0",
- "update-notifier": "2.3.0"
+ "globby": "^6.1.0",
+ "is-path-cwd": "^1.0.0",
+ "is-path-in-cwd": "^1.0.0",
+ "p-map": "^1.1.1",
+ "pify": "^3.0.0",
+ "rimraf": "^2.2.8"
},
"dependencies": {
- "del": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz",
- "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=",
- "dev": true,
- "requires": {
- "globby": "6.1.0",
- "is-path-cwd": "1.0.0",
- "is-path-in-cwd": "1.0.0",
- "p-map": "1.2.0",
- "pify": "3.0.0",
- "rimraf": "2.6.2"
- }
- },
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
- }
- },
"globby": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
"integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
"dev": true,
"requires": {
- "array-union": "1.0.2",
- "glob": "7.1.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "array-union": "^1.0.1",
+ "glob": "^7.0.3",
+ "object-assign": "^4.0.1",
+ "pify": "^2.0.0",
+ "pinkie-promise": "^2.0.0"
},
"dependencies": {
"pify": {
@@ -1828,269 +3823,503 @@
"dev": true
}
}
- },
- "pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
- "dev": true
}
}
},
- "delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
- "dev": true
- },
- "dependency-graph": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.5.1.tgz",
- "integrity": "sha512-nk3OjiI68T3876/tsm4Hm57ye7zc4Kl87hkcALBMCuSrN1q1NvuY5HCnSSkoJjGdrMo5gmu0WTN2cV/D76q/mw==",
- "dev": true
- },
- "detect-indent": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
- "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
- "dev": true,
- "requires": {
- "repeating": "2.0.1"
- }
- },
- "diff": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz",
- "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==",
- "dev": true
- },
- "doctrine": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz",
- "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==",
- "dev": true,
- "requires": {
- "esutils": "2.0.2"
- }
- },
- "doiuse": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/doiuse/-/doiuse-2.6.0.tgz",
- "integrity": "sha1-GJLRC2Gpo1at2/K2FJM+gfi7ODQ=",
+ "del-cli": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/del-cli/-/del-cli-3.0.0.tgz",
+ "integrity": "sha512-J4HDC2mpcN5aopya4VdkyiFXZaqAoo7ua9VpKbciX3DDUSbtJbPMc3ivggJsAAgS6EqonmbenIiMhBGtJPW9FA==",
"dev": true,
"requires": {
- "browserslist": "1.7.7",
- "caniuse-db": "1.0.30000744",
- "css-rule-stream": "1.1.0",
- "duplexer2": "0.0.2",
- "jsonfilter": "1.1.2",
- "ldjson-stream": "1.2.1",
- "lodash": "4.17.4",
- "multimatch": "2.1.0",
- "postcss": "5.2.18",
- "source-map": "0.4.4",
- "through2": "0.6.5",
- "yargs": "3.32.0"
+ "del": "^5.1.0",
+ "meow": "^5.0.0"
},
"dependencies": {
- "browserslist": {
- "version": "1.7.7",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
- "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
+ "@nodelib/fs.stat": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.2.tgz",
+ "integrity": "sha512-z8+wGWV2dgUhLqrtRYa03yDx4HWMvXKi1z8g3m2JyxAx8F7xk74asqPk5LAETjqDSGLFML/6CDl0+yFunSYicw==",
+ "dev": true
+ },
+ "array-union": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
+ "dev": true
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
- "caniuse-db": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
+ "fill-range": "^7.0.1"
}
},
- "is-fullwidth-code-point": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
- "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "del": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz",
+ "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==",
"dev": true,
"requires": {
- "number-is-nan": "1.0.1"
+ "globby": "^10.0.1",
+ "graceful-fs": "^4.2.2",
+ "is-glob": "^4.0.1",
+ "is-path-cwd": "^2.2.0",
+ "is-path-inside": "^3.0.1",
+ "p-map": "^3.0.0",
+ "rimraf": "^3.0.0",
+ "slash": "^3.0.0"
}
},
- "os-locale": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
- "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
+ "dir-glob": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
+ "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"requires": {
- "lcid": "1.0.0"
+ "path-type": "^4.0.0"
}
},
- "source-map": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
- "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
+ "fast-glob": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.0.4.tgz",
+ "integrity": "sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg==",
"dev": true,
"requires": {
- "amdefine": "1.0.1"
+ "@nodelib/fs.stat": "^2.0.1",
+ "@nodelib/fs.walk": "^1.2.1",
+ "glob-parent": "^5.0.0",
+ "is-glob": "^4.0.1",
+ "merge2": "^1.2.3",
+ "micromatch": "^4.0.2"
}
},
- "string-width": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
- "code-point-at": "1.1.0",
- "is-fullwidth-code-point": "1.0.0",
- "strip-ansi": "3.0.1"
+ "to-regex-range": "^5.0.1"
}
},
- "yargs": {
- "version": "3.32.0",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
- "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=",
+ "glob-parent": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
+ "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "globby": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz",
+ "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==",
+ "dev": true,
+ "requires": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^2.1.0",
+ "dir-glob": "^3.0.1",
+ "fast-glob": "^3.0.3",
+ "glob": "^7.1.3",
+ "ignore": "^5.1.1",
+ "merge2": "^1.2.3",
+ "slash": "^3.0.0"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz",
+ "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==",
+ "dev": true
+ },
+ "ignore": {
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz",
+ "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "is-path-cwd": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
+ "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==",
+ "dev": true
+ },
+ "is-path-inside": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.2.tgz",
+ "integrity": "sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg==",
+ "dev": true
+ },
+ "micromatch": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
+ "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
+ "dev": true,
+ "requires": {
+ "braces": "^3.0.1",
+ "picomatch": "^2.0.5"
+ }
+ },
+ "p-map": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz",
+ "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==",
+ "dev": true,
+ "requires": {
+ "aggregate-error": "^3.0.0"
+ }
+ },
+ "path-type": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
+ "dev": true
+ },
+ "rimraf": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.0.tgz",
+ "integrity": "sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ },
+ "slash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "dev": true
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
- "camelcase": "2.1.1",
- "cliui": "3.2.0",
- "decamelize": "1.2.0",
- "os-locale": "1.4.0",
- "string-width": "1.0.2",
- "window-size": "0.1.4",
- "y18n": "3.2.1"
+ "is-number": "^7.0.0"
}
}
}
},
- "dot-prop": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
- "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
+ "depd": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
+ "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
+ "dev": true
+ },
+ "dependency-graph": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.8.0.tgz",
+ "integrity": "sha512-DCvzSq2UiMsuLnj/9AL484ummEgLtZIcRS7YvtO38QnpX3vqh9nJ8P+zhu8Ja+SmLrBHO2iDbva20jq38qvBkQ==",
+ "dev": true
+ },
+ "detect-indent": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
+ "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
"dev": true,
"requires": {
- "is-obj": "1.0.1"
+ "repeating": "^2.0.0"
}
},
- "duplexer": {
+ "di": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz",
+ "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=",
+ "dev": true
+ },
+ "diff": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
+ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "dev": true
+ },
+ "dir-glob": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
+ "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==",
+ "dev": true,
+ "requires": {
+ "path-type": "^3.0.0"
+ }
+ },
+ "doctrine": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2"
+ }
+ },
+ "dom-serialize": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz",
+ "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=",
+ "dev": true,
+ "requires": {
+ "custom-event": "~1.0.0",
+ "ent": "~2.2.0",
+ "extend": "^3.0.0",
+ "void-elements": "^2.0.0"
+ }
+ },
+ "dom-serializer": {
"version": "0.1.1",
- "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz",
- "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=",
+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz",
+ "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==",
+ "dev": true,
+ "requires": {
+ "domelementtype": "^1.3.0",
+ "entities": "^1.1.1"
+ }
+ },
+ "domelementtype": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
+ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==",
"dev": true
},
- "duplexer2": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
- "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=",
+ "domhandler": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
+ "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
"dev": true,
"requires": {
- "readable-stream": "1.1.14"
- },
- "dependencies": {
- "isarray": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
- "dev": true
- },
- "readable-stream": {
- "version": "1.1.14",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
- "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
- "dev": true,
- "requires": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "isarray": "0.0.1",
- "string_decoder": "0.10.31"
- }
- },
- "string_decoder": {
- "version": "0.10.31",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
- "dev": true
- }
+ "domelementtype": "1"
}
},
- "duplexer3": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
- "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
+ "domutils": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
+ "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
+ "dev": true,
+ "requires": {
+ "dom-serializer": "0",
+ "domelementtype": "1"
+ }
+ },
+ "dot-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-2.1.1.tgz",
+ "integrity": "sha1-NNzzf1Co6TwrO8qLt/uRVcfaO+4=",
+ "dev": true,
+ "requires": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "dot-prop": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz",
+ "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=",
+ "dev": true,
+ "requires": {
+ "is-obj": "^1.0.0"
+ }
+ },
+ "ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=",
"dev": true
},
- "ecc-jsbn": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
- "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
+ "electron-to-chromium": {
+ "version": "1.3.113",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.113.tgz",
+ "integrity": "sha512-De+lPAxEcpxvqPTyZAXELNpRZXABRxf+uL/rSykstQhzj/B0l1150G/ExIIxKc16lI89Hgz81J0BHAcbTqK49g==",
+ "dev": true
+ },
+ "elegant-spinner": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz",
+ "integrity": "sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4=",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+ "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+ "dev": true
+ },
+ "encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
+ "dev": true
+ },
+ "end-of-stream": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
+ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
"dev": true,
- "optional": true,
"requires": {
- "jsbn": "0.1.1"
+ "once": "^1.4.0"
}
},
- "editorconfig": {
- "version": "0.13.3",
- "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.3.tgz",
- "integrity": "sha512-WkjsUNVCu+ITKDj73QDvi0trvpdDWdkDyHybDGSXPfekLCqwmpD7CP7iPbvBgosNuLcI96XTDwNa75JyFl7tEQ==",
+ "engine.io": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.2.1.tgz",
+ "integrity": "sha512-+VlKzHzMhaU+GsCIg4AoXF1UdDFjHHwMmMKqMJNDNLlUlejz58FCy4LBqB2YVJskHGYl06BatYWKP2TVdVXE5w==",
"dev": true,
"requires": {
- "bluebird": "3.5.1",
- "commander": "2.11.0",
- "lru-cache": "3.2.0",
- "semver": "5.4.1",
- "sigmund": "1.0.1"
+ "accepts": "~1.3.4",
+ "base64id": "1.0.0",
+ "cookie": "0.3.1",
+ "debug": "~3.1.0",
+ "engine.io-parser": "~2.1.0",
+ "ws": "~3.3.1"
},
"dependencies": {
- "lru-cache": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz",
- "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=",
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"dev": true,
"requires": {
- "pseudomap": "1.0.2"
+ "ms": "2.0.0"
}
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
}
}
},
- "electron-to-chromium": {
- "version": "1.3.24",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.24.tgz",
- "integrity": "sha1-m3uIuwXOufoBahd4M8wt3jiPIbY=",
+ "engine.io-client": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz",
+ "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==",
+ "dev": true,
+ "requires": {
+ "component-emitter": "1.2.1",
+ "component-inherit": "0.0.3",
+ "debug": "~3.1.0",
+ "engine.io-parser": "~2.1.1",
+ "has-cors": "1.1.0",
+ "indexof": "0.0.1",
+ "parseqs": "0.0.5",
+ "parseuri": "0.0.5",
+ "ws": "~3.3.1",
+ "xmlhttprequest-ssl": "~1.5.4",
+ "yeast": "0.1.2"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "engine.io-parser": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz",
+ "integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==",
+ "dev": true,
+ "requires": {
+ "after": "0.8.2",
+ "arraybuffer.slice": "~0.0.7",
+ "base64-arraybuffer": "0.1.5",
+ "blob": "0.0.5",
+ "has-binary2": "~1.0.2"
+ }
+ },
+ "ent": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz",
+ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=",
+ "dev": true
+ },
+ "entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
"dev": true
},
"error-ex": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
- "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=",
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
+ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"requires": {
- "is-arrayish": "0.2.1"
+ "is-arrayish": "^0.2.1"
}
},
"es-abstract": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.9.0.tgz",
- "integrity": "sha512-kk3IJoKo7A3pWJc0OV8yZ/VEX2oSUytfekrJiqoxBlKJMFAJVJVpGdHClCCTdv+Fn2zHfpDHHIelMFhZVfef3Q==",
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz",
+ "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==",
"dev": true,
"requires": {
- "es-to-primitive": "1.1.1",
- "function-bind": "1.1.1",
- "has": "1.0.1",
- "is-callable": "1.1.3",
- "is-regex": "1.0.4"
+ "es-to-primitive": "^1.2.0",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3",
+ "is-callable": "^1.1.4",
+ "is-regex": "^1.0.4",
+ "object-keys": "^1.0.12"
}
},
"es-to-primitive": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz",
- "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
+ "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
"dev": true,
"requires": {
- "is-callable": "1.1.3",
- "is-date-object": "1.0.1",
- "is-symbol": "1.0.1"
+ "is-callable": "^1.1.4",
+ "is-date-object": "^1.0.1",
+ "is-symbol": "^1.0.2"
}
},
"es6-promise": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.1.1.tgz",
- "integrity": "sha512-OaU1hHjgJf+b0NzsxCg7NdIYERD6Hy/PEmFLTjw+b65scuisG3Kt4QoTvJ66BBkPZ581gr0kpoVzKnxniM8nng==",
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
+ "dev": true
+ },
+ "es6-promisify": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
+ "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
+ "dev": true,
+ "requires": {
+ "es6-promise": "^4.0.3"
+ }
+ },
+ "escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=",
"dev": true
},
"escape-string-regexp": {
@@ -2100,235 +4329,221 @@
"dev": true
},
"eslint": {
- "version": "4.14.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.14.0.tgz",
- "integrity": "sha512-Ul6CSGRjKscEyg0X/EeNs7o2XdnbTEOD1OM8cTjmx85RPcBJQrEhZLevhuJZNAE/vS2iVl5Uhgiqf3h5uLMCJQ==",
- "dev": true,
- "requires": {
- "ajv": "5.5.2",
- "babel-code-frame": "6.26.0",
- "chalk": "2.3.0",
- "concat-stream": "1.6.0",
- "cross-spawn": "5.1.0",
- "debug": "3.1.0",
- "doctrine": "2.0.2",
- "eslint-scope": "3.7.1",
- "eslint-visitor-keys": "1.0.0",
- "espree": "3.5.2",
- "esquery": "1.0.0",
- "esutils": "2.0.2",
- "file-entry-cache": "2.0.0",
- "functional-red-black-tree": "1.0.1",
- "glob": "7.1.2",
- "globals": "11.1.0",
- "ignore": "3.3.5",
- "imurmurhash": "0.1.4",
- "inquirer": "3.3.0",
- "is-resolvable": "1.0.1",
- "js-yaml": "3.10.0",
- "json-stable-stringify-without-jsonify": "1.0.1",
- "levn": "0.3.0",
- "lodash": "4.17.4",
- "minimatch": "3.0.4",
- "mkdirp": "0.5.1",
- "natural-compare": "1.4.0",
- "optionator": "0.8.2",
- "path-is-inside": "1.0.2",
- "pluralize": "7.0.0",
- "progress": "2.0.0",
- "require-uncached": "1.0.3",
- "semver": "5.4.1",
- "strip-ansi": "4.0.0",
- "strip-json-comments": "2.0.1",
- "table": "4.0.2",
- "text-table": "0.2.0"
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.5.1.tgz",
+ "integrity": "sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "ajv": "^6.10.0",
+ "chalk": "^2.1.0",
+ "cross-spawn": "^6.0.5",
+ "debug": "^4.0.1",
+ "doctrine": "^3.0.0",
+ "eslint-scope": "^5.0.0",
+ "eslint-utils": "^1.4.2",
+ "eslint-visitor-keys": "^1.1.0",
+ "espree": "^6.1.1",
+ "esquery": "^1.0.1",
+ "esutils": "^2.0.2",
+ "file-entry-cache": "^5.0.1",
+ "functional-red-black-tree": "^1.0.1",
+ "glob-parent": "^5.0.0",
+ "globals": "^11.7.0",
+ "ignore": "^4.0.6",
+ "import-fresh": "^3.0.0",
+ "imurmurhash": "^0.1.4",
+ "inquirer": "^6.4.1",
+ "is-glob": "^4.0.0",
+ "js-yaml": "^3.13.1",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "levn": "^0.3.0",
+ "lodash": "^4.17.14",
+ "minimatch": "^3.0.4",
+ "mkdirp": "^0.5.1",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.8.2",
+ "progress": "^2.0.0",
+ "regexpp": "^2.0.1",
+ "semver": "^6.1.2",
+ "strip-ansi": "^5.2.0",
+ "strip-json-comments": "^3.0.1",
+ "table": "^5.2.3",
+ "text-table": "^0.2.0",
+ "v8-compile-cache": "^2.0.3"
},
"dependencies": {
- "ajv": {
- "version": "5.5.2",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
- "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
- "dev": true,
- "requires": {
- "co": "4.6.0",
- "fast-deep-equal": "1.0.0",
- "fast-json-stable-stringify": "2.0.0",
- "json-schema-traverse": "0.3.1"
- }
- },
"ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
- "dev": true
- },
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
- }
- },
- "debug": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
- "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- },
- "esprima": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
- "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "glob-parent": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
+ "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
"dev": true,
"requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
+ "is-glob": "^4.0.1"
+ },
+ "dependencies": {
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ }
}
},
- "globals": {
- "version": "11.1.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-11.1.0.tgz",
- "integrity": "sha512-uEuWt9mqTlPDwSqi+sHjD4nWU/1N+q0fiWI9T1mZpD2UENqX20CFD5T/ziLZvztPaBKl7ZylUi1q6Qfm7E2CiQ==",
- "dev": true
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
},
- "js-yaml": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
- "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==",
- "dev": true,
- "requires": {
- "argparse": "1.0.9",
- "esprima": "4.0.0"
- }
- },
"strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
- "dev": true,
- "requires": {
- "ansi-regex": "3.0.0"
- }
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "ansi-regex": "^4.1.0"
}
}
}
},
"eslint-config-airbnb-base": {
- "version": "12.1.0",
- "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.1.0.tgz",
- "integrity": "sha512-/vjm0Px5ZCpmJqnjIzcFb9TKZrKWz0gnuG/7Gfkt0Db1ELJR51xkZth+t14rYdqWgX836XbuxtArbIHlVhbLBA==",
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.0.0.tgz",
+ "integrity": "sha512-2IDHobw97upExLmsebhtfoD3NAKhV4H0CJWP3Uprd/uk+cHuWYOczPVxQ8PxLFUAw7o3Th1RAU8u1DoUpr+cMA==",
"dev": true,
"requires": {
- "eslint-restricted-globals": "0.1.1"
+ "confusing-browser-globals": "^1.0.7",
+ "object.assign": "^4.1.0",
+ "object.entries": "^1.1.0"
}
},
"eslint-import-resolver-node": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz",
- "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
+ "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
"dev": true,
"requires": {
- "debug": "2.6.9",
- "resolve": "1.4.0"
+ "debug": "^2.6.9",
+ "resolve": "^1.5.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
}
},
"eslint-module-utils": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz",
- "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==",
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz",
+ "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==",
"dev": true,
"requires": {
- "debug": "2.6.9",
- "pkg-dir": "1.0.0"
+ "debug": "^2.6.8",
+ "pkg-dir": "^2.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
}
},
"eslint-plugin-import": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz",
- "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==",
+ "version": "2.18.2",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz",
+ "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==",
"dev": true,
"requires": {
- "builtin-modules": "1.1.1",
- "contains-path": "0.1.0",
- "debug": "2.6.9",
+ "array-includes": "^3.0.3",
+ "contains-path": "^0.1.0",
+ "debug": "^2.6.9",
"doctrine": "1.5.0",
- "eslint-import-resolver-node": "0.3.1",
- "eslint-module-utils": "2.1.1",
- "has": "1.0.1",
- "lodash.cond": "4.5.2",
- "minimatch": "3.0.4",
- "read-pkg-up": "2.0.0"
+ "eslint-import-resolver-node": "^0.3.2",
+ "eslint-module-utils": "^2.4.0",
+ "has": "^1.0.3",
+ "minimatch": "^3.0.4",
+ "object.values": "^1.1.0",
+ "read-pkg-up": "^2.0.0",
+ "resolve": "^1.11.0"
},
"dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
- "esutils": "2.0.2",
- "isarray": "1.0.0"
+ "esutils": "^2.0.2",
+ "isarray": "^1.0.0"
}
},
- "find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "load-json-file": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
+ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true,
"requires": {
- "locate-path": "2.0.0"
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^2.2.0",
+ "pify": "^2.0.0",
+ "strip-bom": "^3.0.0"
}
},
- "load-json-file": {
+ "ms": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
- "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "parse-json": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
+ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "parse-json": "2.2.0",
- "pify": "2.3.0",
- "strip-bom": "3.0.0"
+ "error-ex": "^1.2.0"
}
},
"path-type": {
@@ -2337,18 +4552,24 @@
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"dev": true,
"requires": {
- "pify": "2.3.0"
+ "pify": "^2.0.0"
}
},
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ },
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"dev": true,
"requires": {
- "load-json-file": "2.0.0",
- "normalize-package-data": "2.4.0",
- "path-type": "2.0.0"
+ "load-json-file": "^2.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^2.0.0"
}
},
"read-pkg-up": {
@@ -2357,85 +4578,91 @@
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"dev": true,
"requires": {
- "find-up": "2.1.0",
- "read-pkg": "2.0.0"
+ "find-up": "^2.0.0",
+ "read-pkg": "^2.0.0"
}
},
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
+ "resolve": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
+ "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
+ "dev": true,
+ "requires": {
+ "path-parse": "^1.0.6"
+ }
}
}
},
- "eslint-restricted-globals": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz",
- "integrity": "sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=",
- "dev": true
- },
"eslint-scope": {
- "version": "3.7.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
- "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
+ "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
+ "dev": true,
+ "requires": {
+ "esrecurse": "^4.1.0",
+ "estraverse": "^4.1.1"
+ }
+ },
+ "eslint-utils": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz",
+ "integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==",
"dev": true,
"requires": {
- "esrecurse": "4.2.0",
- "estraverse": "4.2.0"
+ "eslint-visitor-keys": "^1.0.0"
}
},
"eslint-visitor-keys": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
- "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz",
+ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==",
"dev": true
},
"espree": {
- "version": "3.5.2",
- "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz",
- "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==",
+ "version": "6.1.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz",
+ "integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==",
"dev": true,
"requires": {
- "acorn": "5.3.0",
- "acorn-jsx": "3.0.1"
+ "acorn": "^7.0.0",
+ "acorn-jsx": "^5.0.2",
+ "eslint-visitor-keys": "^1.1.0"
}
},
"esprima": {
- "version": "2.7.3",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
- "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
"esquery": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz",
- "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
+ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
"dev": true,
"requires": {
- "estraverse": "4.2.0"
+ "estraverse": "^4.0.0"
}
},
"esrecurse": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz",
- "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=",
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
"dev": true,
"requires": {
- "estraverse": "4.2.0",
- "object-assign": "4.1.1"
+ "estraverse": "^4.1.0"
}
},
"estraverse": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
- "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
"dev": true
},
"estree-walker": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.2.1.tgz",
- "integrity": "sha1-va/oCVOD2EFNXcLs9MkXO225QS4=",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz",
+ "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==",
"dev": true
},
"esutils": {
@@ -2444,52 +4671,84 @@
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
- "event-stream": {
- "version": "3.3.4",
- "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz",
- "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=",
- "dev": true,
- "requires": {
- "duplexer": "0.1.1",
- "from": "0.1.7",
- "map-stream": "0.1.0",
- "pause-stream": "0.0.11",
- "split": "0.3.3",
- "stream-combiner": "0.0.4",
- "through": "2.3.8"
- }
+ "eventemitter3": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz",
+ "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==",
+ "dev": true
},
"execa": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
- "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"requires": {
- "cross-spawn": "5.1.0",
- "get-stream": "3.0.0",
- "is-stream": "1.1.0",
- "npm-run-path": "2.0.2",
- "p-finally": "1.0.0",
- "signal-exit": "3.0.2",
- "strip-eof": "1.0.0"
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
}
},
"execall": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/execall/-/execall-1.0.0.tgz",
- "integrity": "sha1-c9CQTjlbPKsGWLCNCewlMH8pu3M=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/execall/-/execall-2.0.0.tgz",
+ "integrity": "sha512-0FU2hZ5Hh6iQnarpRtQurM/aAvp3RIbfvgLHrcqJYzhXyV2KFruhuChf9NC6waAhiUR7FFtlugkI4p7f2Fqlow==",
"dev": true,
"requires": {
- "clone-regexp": "1.0.0"
+ "clone-regexp": "^2.1.0"
}
},
"expand-brackets": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
- "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
- "dev": true,
- "requires": {
- "is-posix-bracket": "0.1.1"
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=",
+ "dev": true,
+ "requires": {
+ "debug": "^2.3.3",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "posix-character-classes": "^0.1.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
}
},
"expand-range": {
@@ -2498,70 +4757,203 @@
"integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=",
"dev": true,
"requires": {
- "fill-range": "2.2.3"
+ "fill-range": "^2.1.0"
+ },
+ "dependencies": {
+ "fill-range": {
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz",
+ "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==",
+ "dev": true,
+ "requires": {
+ "is-number": "^2.1.0",
+ "isobject": "^2.0.0",
+ "randomatic": "^3.0.0",
+ "repeat-element": "^1.1.2",
+ "repeat-string": "^1.5.2"
+ }
+ },
+ "is-number": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
+ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ }
+ },
+ "isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "requires": {
+ "isarray": "1.0.0"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"extend": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
- "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"dev": true
},
- "external-editor": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz",
- "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==",
+ "extend-shallow": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
+ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
- "chardet": "0.4.2",
- "iconv-lite": "0.4.19",
- "tmp": "0.0.33"
+ "assign-symbols": "^1.0.0",
+ "is-extendable": "^1.0.1"
+ },
+ "dependencies": {
+ "is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dev": true,
+ "requires": {
+ "is-plain-object": "^2.0.4"
+ }
+ }
}
},
- "extglob": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
- "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
+ "external-editor": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
+ "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
"dev": true,
"requires": {
- "is-extglob": "1.0.0"
+ "chardet": "^0.7.0",
+ "iconv-lite": "^0.4.24",
+ "tmp": "^0.0.33"
+ }
+ },
+ "extglob": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
+ "dev": true,
+ "requires": {
+ "array-unique": "^0.3.2",
+ "define-property": "^1.0.0",
+ "expand-brackets": "^2.1.4",
+ "extend-shallow": "^2.0.1",
+ "fragment-cache": "^0.2.1",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
}
},
"extract-zip": {
- "version": "1.6.6",
- "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz",
- "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=",
+ "version": "1.6.7",
+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
+ "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
"dev": true,
"requires": {
- "concat-stream": "1.6.0",
+ "concat-stream": "1.6.2",
"debug": "2.6.9",
- "mkdirp": "0.5.0",
+ "mkdirp": "0.5.1",
"yauzl": "2.4.1"
},
"dependencies": {
- "mkdirp": {
- "version": "0.5.0",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
- "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=",
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
- "minimist": "0.0.8"
+ "ms": "2.0.0"
}
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
}
}
},
- "extsprintf": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
- "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
- "dev": true
- },
"fast-deep-equal": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz",
- "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
+ "fast-glob": {
+ "version": "2.2.6",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.6.tgz",
+ "integrity": "sha512-0BvMaZc1k9F+MeWWMe8pL6YltFzZYcJsYU7D4JyDA6PAczaXvxqQQ/z+mDF7/4Mw01DeUc+i3CTKajnkANkV4w==",
+ "dev": true,
+ "requires": {
+ "@mrmlnc/readdir-enhanced": "^2.2.1",
+ "@nodelib/fs.stat": "^1.1.2",
+ "glob-parent": "^3.1.0",
+ "is-glob": "^4.0.0",
+ "merge2": "^1.2.3",
+ "micromatch": "^3.1.10"
+ }
+ },
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
@@ -2574,13 +4966,22 @@
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
"dev": true
},
+ "fastq": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz",
+ "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==",
+ "dev": true,
+ "requires": {
+ "reusify": "^1.0.0"
+ }
+ },
"fd-slicer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
"dev": true,
"requires": {
- "pend": "1.2.0"
+ "pend": "~1.2.0"
}
},
"figures": {
@@ -2589,17 +4990,16 @@
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
"dev": true,
"requires": {
- "escape-string-regexp": "1.0.5"
+ "escape-string-regexp": "^1.0.5"
}
},
"file-entry-cache": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz",
- "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
+ "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
"dev": true,
"requires": {
- "flat-cache": "1.3.0",
- "object-assign": "4.1.1"
+ "flat-cache": "^2.0.1"
}
},
"filename-regex": {
@@ -2608,47 +5008,146 @@
"integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=",
"dev": true
},
+ "fileset": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz",
+ "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=",
+ "dev": true,
+ "requires": {
+ "glob": "^7.0.3",
+ "minimatch": "^3.0.3"
+ }
+ },
"fill-range": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz",
- "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=",
"dev": true,
"requires": {
- "is-number": "2.1.0",
- "isobject": "2.1.0",
- "randomatic": "1.1.7",
- "repeat-element": "1.1.2",
- "repeat-string": "1.6.1"
+ "extend-shallow": "^2.0.1",
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1",
+ "to-regex-range": "^2.1.0"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
}
},
- "find-up": {
+ "finalhandler": {
"version": "1.1.2",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
- "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
+ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"dev": true,
"requires": {
- "path-exists": "2.1.0",
- "pinkie-promise": "2.0.1"
+ "debug": "2.6.9",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "on-finished": "~2.3.0",
+ "parseurl": "~1.3.3",
+ "statuses": "~1.5.0",
+ "unpipe": "~1.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "find-up": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "dev": true,
+ "requires": {
+ "locate-path": "^2.0.0"
+ }
+ },
+ "flat": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz",
+ "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==",
+ "dev": true,
+ "requires": {
+ "is-buffer": "~2.0.3"
+ },
+ "dependencies": {
+ "is-buffer": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
+ "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==",
+ "dev": true
+ }
}
},
"flat-cache": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
- "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
+ "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
"dev": true,
"requires": {
- "circular-json": "0.3.3",
- "del": "2.2.2",
- "graceful-fs": "4.1.11",
- "write": "0.2.1"
+ "flatted": "^2.0.0",
+ "rimraf": "2.6.3",
+ "write": "1.0.3"
}
},
+ "flatted": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz",
+ "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
+ "dev": true
+ },
"flatten": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz",
"integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=",
"dev": true
},
+ "fn-name": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-2.0.1.tgz",
+ "integrity": "sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc=",
+ "dev": true
+ },
+ "follow-redirects": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.9.0.tgz",
+ "integrity": "sha512-CRcPzsSIbXyVDl0QI01muNDu69S8trU4jArW9LpOt2WtC6LyUJetcIrmfHsRBx7/Jb6GHJUiuqyYxPooFfNt6A==",
+ "dev": true,
+ "requires": {
+ "debug": "^3.0.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
"for-in": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
@@ -2661,47 +5160,27 @@
"integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=",
"dev": true,
"requires": {
- "for-in": "1.0.2"
+ "for-in": "^1.0.1"
}
},
- "foreach": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz",
- "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=",
- "dev": true
- },
- "forever-agent": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
- "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
- "dev": true
- },
- "form-data": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz",
- "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=",
+ "fragment-cache": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
+ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=",
"dev": true,
"requires": {
- "asynckit": "0.4.0",
- "combined-stream": "1.0.5",
- "mime-types": "2.1.17"
+ "map-cache": "^0.2.2"
}
},
- "from": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
- "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=",
- "dev": true
- },
"fs-extra": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz",
- "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
+ "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "jsonfile": "2.4.0",
- "klaw": "1.3.1"
+ "graceful-fs": "^4.1.2",
+ "jsonfile": "^4.0.0",
+ "universalify": "^0.1.0"
}
},
"fs.realpath": {
@@ -2710,6 +5189,554 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
+ "fsevents": {
+ "version": "1.2.7",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz",
+ "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "nan": "^2.9.2",
+ "node-pre-gyp": "^0.10.0"
+ },
+ "dependencies": {
+ "abbrev": {
+ "version": "1.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "are-we-there-yet": {
+ "version": "1.1.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "delegates": "^1.0.0",
+ "readable-stream": "^2.0.6"
+ }
+ },
+ "balanced-match": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "chownr": {
+ "version": "1.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "console-control-strings": {
+ "version": "1.1.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "debug": {
+ "version": "2.6.9",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "deep-extend": {
+ "version": "0.6.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "delegates": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "detect-libc": {
+ "version": "1.0.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "fs-minipass": {
+ "version": "1.2.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "gauge": {
+ "version": "2.7.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "aproba": "^1.0.3",
+ "console-control-strings": "^1.0.0",
+ "has-unicode": "^2.0.0",
+ "object-assign": "^4.1.0",
+ "signal-exit": "^3.0.0",
+ "string-width": "^1.0.1",
+ "strip-ansi": "^3.0.1",
+ "wide-align": "^1.1.0"
+ }
+ },
+ "glob": {
+ "version": "7.1.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "has-unicode": {
+ "version": "2.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "iconv-lite": {
+ "version": "0.4.24",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
+ },
+ "ignore-walk": {
+ "version": "3.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minimatch": "^3.0.4"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "ini": {
+ "version": "1.3.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "number-is-nan": "^1.0.0"
+ }
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "0.0.8",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "minipass": {
+ "version": "2.3.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "safe-buffer": "^5.1.2",
+ "yallist": "^3.0.0"
+ }
+ },
+ "minizlib": {
+ "version": "1.2.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minipass": "^2.2.1"
+ }
+ },
+ "mkdirp": {
+ "version": "0.5.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "minimist": "0.0.8"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "needle": {
+ "version": "2.2.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "debug": "^2.1.2",
+ "iconv-lite": "^0.4.4",
+ "sax": "^1.2.4"
+ }
+ },
+ "node-pre-gyp": {
+ "version": "0.10.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "detect-libc": "^1.0.2",
+ "mkdirp": "^0.5.1",
+ "needle": "^2.2.1",
+ "nopt": "^4.0.1",
+ "npm-packlist": "^1.1.6",
+ "npmlog": "^4.0.2",
+ "rc": "^1.2.7",
+ "rimraf": "^2.6.1",
+ "semver": "^5.3.0",
+ "tar": "^4"
+ }
+ },
+ "nopt": {
+ "version": "4.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "abbrev": "1",
+ "osenv": "^0.1.4"
+ }
+ },
+ "npm-bundled": {
+ "version": "1.0.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "npm-packlist": {
+ "version": "1.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ignore-walk": "^3.0.1",
+ "npm-bundled": "^1.0.1"
+ }
+ },
+ "npmlog": {
+ "version": "4.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "are-we-there-yet": "~1.1.2",
+ "console-control-strings": "~1.1.0",
+ "gauge": "~2.7.3",
+ "set-blocking": "~2.0.0"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "once": {
+ "version": "1.4.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "os-homedir": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "os-tmpdir": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "osenv": {
+ "version": "0.1.5",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.0"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "process-nextick-args": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "rc": {
+ "version": "1.2.8",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "deep-extend": "^0.6.0",
+ "ini": "~1.3.0",
+ "minimist": "^1.2.0",
+ "strip-json-comments": "~2.0.1"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "1.2.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ }
+ }
+ },
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "rimraf": {
+ "version": "2.6.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "glob": "^7.1.3"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "sax": {
+ "version": "1.2.4",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "semver": {
+ "version": "5.6.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "signal-exit": {
+ "version": "3.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "code-point-at": "^1.0.0",
+ "is-fullwidth-code-point": "^1.0.0",
+ "strip-ansi": "^3.0.0"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "tar": {
+ "version": "4.4.8",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "chownr": "^1.1.1",
+ "fs-minipass": "^1.2.5",
+ "minipass": "^2.3.4",
+ "minizlib": "^1.1.1",
+ "mkdirp": "^0.5.0",
+ "safe-buffer": "^5.1.2",
+ "yallist": "^3.0.2"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "wide-align": {
+ "version": "1.1.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "string-width": "^1.0.2 || 2"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ },
+ "yallist": {
+ "version": "3.0.3",
+ "bundled": true,
+ "dev": true,
+ "optional": true
+ }
+ }
+ },
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -2722,50 +5749,100 @@
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"dev": true
},
- "gather-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/gather-stream/-/gather-stream-1.0.0.tgz",
- "integrity": "sha1-szmUr0V6gRVwDUEPMXczy+egkEs=",
- "dev": true
+ "g-status": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/g-status/-/g-status-2.0.2.tgz",
+ "integrity": "sha512-kQoE9qH+T1AHKgSSD0Hkv98bobE90ILQcXAF4wvGgsr7uFqNvwmh8j+Lq3l0RVt3E3HjSbv2B9biEGcEtpHLCA==",
+ "dev": true,
+ "requires": {
+ "arrify": "^1.0.1",
+ "matcher": "^1.0.0",
+ "simple-git": "^1.85.0"
+ }
},
"get-caller-file": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz",
- "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
+ "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==",
+ "dev": true
+ },
+ "get-func-name": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
+ "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
+ "dev": true
+ },
+ "get-own-enumerable-property-symbols": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz",
+ "integrity": "sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg==",
"dev": true
},
"get-stdin": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
- "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz",
+ "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==",
"dev": true
},
"get-stream": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
- "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "get-value": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
+ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=",
"dev": true
},
- "getpass": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
- "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "git-raw-commits": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz",
+ "integrity": "sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg==",
"dev": true,
"requires": {
- "assert-plus": "1.0.0"
+ "dargs": "^4.0.1",
+ "lodash.template": "^4.0.2",
+ "meow": "^4.0.0",
+ "split2": "^2.0.0",
+ "through2": "^2.0.0"
+ },
+ "dependencies": {
+ "meow": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz",
+ "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==",
+ "dev": true,
+ "requires": {
+ "camelcase-keys": "^4.0.0",
+ "decamelize-keys": "^1.0.0",
+ "loud-rejection": "^1.0.0",
+ "minimist": "^1.1.3",
+ "minimist-options": "^3.0.1",
+ "normalize-package-data": "^2.3.4",
+ "read-pkg-up": "^3.0.0",
+ "redent": "^2.0.0",
+ "trim-newlines": "^2.0.0"
+ }
+ }
}
},
"glob": {
- "version": "6.0.4",
- "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
- "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
+ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"dev": true,
"requires": {
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
}
},
"glob-base": {
@@ -2774,46 +5851,120 @@
"integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=",
"dev": true,
"requires": {
- "glob-parent": "2.0.0",
- "is-glob": "2.0.1"
+ "glob-parent": "^2.0.0",
+ "is-glob": "^2.0.0"
+ },
+ "dependencies": {
+ "glob-parent": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
+ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
+ "dev": true,
+ "requires": {
+ "is-glob": "^2.0.0"
+ }
+ },
+ "is-extglob": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ }
}
},
"glob-parent": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
- "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
+ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
"dev": true,
"requires": {
- "is-glob": "2.0.1"
+ "is-glob": "^3.1.0",
+ "path-dirname": "^1.0.0"
+ },
+ "dependencies": {
+ "is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.0"
+ }
+ }
}
},
+ "glob-to-regexp": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz",
+ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=",
+ "dev": true
+ },
"global-dirs": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.0.tgz",
- "integrity": "sha1-ENNAOeDfBCcuJizyQiT3IJQ0308=",
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
+ "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=",
"dev": true,
"requires": {
- "ini": "1.3.4"
+ "ini": "^1.3.4"
+ }
+ },
+ "global-modules": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz",
+ "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==",
+ "dev": true,
+ "requires": {
+ "global-prefix": "^3.0.0"
+ }
+ },
+ "global-prefix": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz",
+ "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==",
+ "dev": true,
+ "requires": {
+ "ini": "^1.3.5",
+ "kind-of": "^6.0.2",
+ "which": "^1.3.1"
}
},
"globals": {
- "version": "9.18.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
- "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
+ "version": "11.11.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz",
+ "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==",
"dev": true
},
"globby": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-4.1.0.tgz",
- "integrity": "sha1-CA9UVJ7BuCpsYOYx/ILhIR2+lfg=",
- "dev": true,
- "requires": {
- "array-union": "1.0.2",
- "arrify": "1.0.1",
- "glob": "6.0.4",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "version": "9.1.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-9.1.0.tgz",
+ "integrity": "sha512-VtYjhHr7ncls724Of5W6Kaahz0ag7dB4G62/2HsN+xEKG6SrPzM1AJMerGxQTwJGnN9reeyxdvXbuZYpfssCvg==",
+ "dev": true,
+ "requires": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^1.0.2",
+ "dir-glob": "^2.2.1",
+ "fast-glob": "^2.2.6",
+ "glob": "^7.1.3",
+ "ignore": "^4.0.3",
+ "pify": "^4.0.1",
+ "slash": "^2.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+ "dev": true
+ }
}
},
"globjoin": {
@@ -2822,54 +5973,62 @@
"integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=",
"dev": true
},
- "got": {
- "version": "6.7.1",
- "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz",
- "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
+ "gonzales-pe": {
+ "version": "4.2.4",
+ "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.4.tgz",
+ "integrity": "sha512-v0Ts/8IsSbh9n1OJRnSfa7Nlxi4AkXIsWB6vPept8FDbL4bXn3FNuxjYtO/nmBGu7GDkL9MFeGebeSu6l55EPQ==",
"dev": true,
"requires": {
- "create-error-class": "3.0.2",
- "duplexer3": "0.1.4",
- "get-stream": "3.0.0",
- "is-redirect": "1.0.0",
- "is-retry-allowed": "1.1.0",
- "is-stream": "1.1.0",
- "lowercase-keys": "1.0.0",
- "safe-buffer": "5.1.1",
- "timed-out": "4.0.1",
- "unzip-response": "2.0.1",
- "url-parse-lax": "1.0.0"
+ "minimist": "1.1.x"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz",
+ "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=",
+ "dev": true
+ }
}
},
"graceful-fs": {
- "version": "4.1.11",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
- "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
+ "version": "4.1.15",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
+ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"dev": true
},
- "har-schema": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
- "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
+ "growl": {
+ "version": "1.10.5",
+ "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
+ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
- "har-validator": {
- "version": "5.0.3",
- "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
- "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
+ "handlebars": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.2.tgz",
+ "integrity": "sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg==",
"dev": true,
"requires": {
- "ajv": "5.2.3",
- "har-schema": "2.0.0"
+ "neo-async": "^2.6.0",
+ "optimist": "^0.6.1",
+ "source-map": "^0.6.1",
+ "uglify-js": "^3.1.4"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
}
},
"has": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz",
- "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
- "function-bind": "1.1.1"
+ "function-bind": "^1.1.1"
}
},
"has-ansi": {
@@ -2878,41 +6037,104 @@
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"dev": true,
"requires": {
- "ansi-regex": "2.1.1"
+ "ansi-regex": "^2.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ }
}
},
+ "has-binary2": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz",
+ "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==",
+ "dev": true,
+ "requires": {
+ "isarray": "2.0.1"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
+ "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=",
+ "dev": true
+ }
+ }
+ },
+ "has-cors": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
+ "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=",
+ "dev": true
+ },
"has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "has-symbols": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
- "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
+ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=",
"dev": true
},
- "hasha": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz",
- "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=",
+ "has-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
+ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=",
"dev": true,
"requires": {
- "is-stream": "1.1.0",
- "pinkie-promise": "2.0.1"
+ "get-value": "^2.0.6",
+ "has-values": "^1.0.0",
+ "isobject": "^3.0.0"
}
},
- "hawk": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
- "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==",
+ "has-values": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
+ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=",
"dev": true,
"requires": {
- "boom": "4.3.1",
- "cryptiles": "3.1.2",
- "hoek": "4.2.0",
- "sntp": "2.1.0"
+ "is-number": "^3.0.0",
+ "kind-of": "^4.0.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
+ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
- "hoek": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz",
- "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==",
+ "he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true
+ },
+ "header-case": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz",
+ "integrity": "sha1-lTWXMZfBRLCWE81l0xfvGZY70C0=",
+ "dev": true,
+ "requires": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.1.3"
+ }
+ },
+ "hex-color-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
+ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==",
"dev": true
},
"home-or-tmp": {
@@ -2921,55 +6143,302 @@
"integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
"dev": true,
"requires": {
- "os-homedir": "1.0.2",
- "os-tmpdir": "1.0.2"
+ "os-homedir": "^1.0.0",
+ "os-tmpdir": "^1.0.1"
}
},
"hosted-git-info": {
- "version": "2.5.0",
- "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
- "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
+ "version": "2.7.1",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
+ "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
+ "dev": true
+ },
+ "hsl-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/hsl-regex/-/hsl-regex-1.0.0.tgz",
+ "integrity": "sha1-1JMwx4ntgZ4nakwNJy3/owsY/m4=",
+ "dev": true
+ },
+ "hsla-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/hsla-regex/-/hsla-regex-1.0.0.tgz",
+ "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=",
"dev": true
},
"html-comment-regex": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz",
- "integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=",
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz",
+ "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==",
"dev": true
},
"html-tags": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz",
- "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz",
+ "integrity": "sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==",
"dev": true
},
- "http-signature": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
- "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "htmlparser2": {
+ "version": "3.10.1",
+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz",
+ "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==",
"dev": true,
"requires": {
- "assert-plus": "1.0.0",
- "jsprim": "1.4.1",
- "sshpk": "1.13.1"
+ "domelementtype": "^1.3.1",
+ "domhandler": "^2.3.0",
+ "domutils": "^1.5.1",
+ "entities": "^1.1.1",
+ "inherits": "^2.0.1",
+ "readable-stream": "^3.1.1"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz",
+ "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==",
+ "dev": true,
+ "requires": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ }
+ }
+ }
+ },
+ "http-errors": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
+ "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
+ "dev": true,
+ "requires": {
+ "depd": "~1.1.2",
+ "inherits": "2.0.3",
+ "setprototypeof": "1.1.1",
+ "statuses": ">= 1.5.0 < 2",
+ "toidentifier": "1.0.0"
+ }
+ },
+ "http-proxy": {
+ "version": "1.18.0",
+ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz",
+ "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==",
+ "dev": true,
+ "requires": {
+ "eventemitter3": "^4.0.0",
+ "follow-redirects": "^1.0.0",
+ "requires-port": "^1.0.0"
+ }
+ },
+ "https-proxy-agent": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
+ "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
+ "dev": true,
+ "requires": {
+ "agent-base": "^4.3.0",
+ "debug": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
+ "husky": {
+ "version": "3.0.8",
+ "resolved": "https://registry.npmjs.org/husky/-/husky-3.0.8.tgz",
+ "integrity": "sha512-HFOsgcyrX3qe/rBuqyTt+P4Gxn5P0seJmr215LAZ/vnwK3jWB3r0ck7swbzGRUbufCf9w/lgHPVbF/YXQALgfQ==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.2",
+ "cosmiconfig": "^5.2.1",
+ "execa": "^1.0.0",
+ "get-stdin": "^7.0.0",
+ "is-ci": "^2.0.0",
+ "opencollective-postinstall": "^2.0.2",
+ "pkg-dir": "^4.2.0",
+ "please-upgrade-node": "^3.2.0",
+ "read-pkg": "^5.1.1",
+ "run-node": "^1.0.0",
+ "slash": "^3.0.0"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^4.1.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
+ "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.2.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "parse-json": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz",
+ "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1",
+ "lines-and-columns": "^1.1.6"
+ }
+ },
+ "path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true
+ },
+ "pkg-dir": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",
+ "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
+ "dev": true,
+ "requires": {
+ "find-up": "^4.0.0"
+ }
+ },
+ "please-upgrade-node": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
+ "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
+ "dev": true,
+ "requires": {
+ "semver-compare": "^1.0.0"
+ }
+ },
+ "read-pkg": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
+ "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",
+ "dev": true,
+ "requires": {
+ "@types/normalize-package-data": "^2.4.0",
+ "normalize-package-data": "^2.5.0",
+ "parse-json": "^5.0.0",
+ "type-fest": "^0.6.0"
+ }
+ },
+ "slash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "dev": true
+ }
}
},
"iconv-lite": {
- "version": "0.4.19",
- "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
- "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==",
- "dev": true
+ "version": "0.4.24",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "dev": true,
+ "requires": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ }
},
"ignore": {
- "version": "3.3.5",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz",
- "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==",
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
"dev": true
},
- "import-lazy": {
+ "ignore-walk": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.2.tgz",
+ "integrity": "sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw==",
+ "dev": true,
+ "requires": {
+ "minimatch": "^3.0.4"
+ }
+ },
+ "import-cwd": {
"version": "2.1.0",
- "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
- "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=",
+ "resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-2.1.0.tgz",
+ "integrity": "sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk=",
+ "dev": true,
+ "requires": {
+ "import-from": "^2.1.0"
+ }
+ },
+ "import-fresh": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz",
+ "integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==",
+ "dev": true,
+ "requires": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "dependencies": {
+ "resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true
+ }
+ }
+ },
+ "import-from": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz",
+ "integrity": "sha1-M1238qev/VOqpHHUuAId7ja387E=",
+ "dev": true,
+ "requires": {
+ "resolve-from": "^3.0.0"
+ },
+ "dependencies": {
+ "resolve-from": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+ "dev": true
+ }
+ }
+ },
+ "import-lazy": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz",
+ "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==",
"dev": true
},
"imurmurhash": {
@@ -2979,13 +6448,10 @@
"dev": true
},
"indent-string": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
- "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
- "dev": true,
- "requires": {
- "repeating": "2.0.1"
- }
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz",
+ "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=",
+ "dev": true
},
"indexes-of": {
"version": "1.0.1",
@@ -2993,14 +6459,20 @@
"integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=",
"dev": true
},
+ "indexof": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
+ "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=",
+ "dev": true
+ },
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
- "once": "1.4.0",
- "wrappy": "1.0.2"
+ "once": "^1.3.0",
+ "wrappy": "1"
}
},
"inherits": {
@@ -3010,104 +6482,62 @@
"dev": true
},
"ini": {
- "version": "1.3.4",
- "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz",
- "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=",
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true
},
"inquirer": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
- "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
- "dev": true,
- "requires": {
- "ansi-escapes": "3.0.0",
- "chalk": "2.3.0",
- "cli-cursor": "2.1.0",
- "cli-width": "2.2.0",
- "external-editor": "2.1.0",
- "figures": "2.0.0",
- "lodash": "4.17.4",
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
+ "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==",
+ "dev": true,
+ "requires": {
+ "ansi-escapes": "^3.2.0",
+ "chalk": "^2.4.2",
+ "cli-cursor": "^2.1.0",
+ "cli-width": "^2.0.0",
+ "external-editor": "^3.0.3",
+ "figures": "^2.0.0",
+ "lodash": "^4.17.12",
"mute-stream": "0.0.7",
- "run-async": "2.3.0",
- "rx-lite": "4.0.8",
- "rx-lite-aggregates": "4.0.8",
- "string-width": "2.1.1",
- "strip-ansi": "4.0.0",
- "through": "2.3.8"
+ "run-async": "^2.2.0",
+ "rxjs": "^6.4.0",
+ "string-width": "^2.1.0",
+ "strip-ansi": "^5.1.0",
+ "through": "^2.3.6"
},
"dependencies": {
"ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
- "dev": true
- },
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
},
"strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
- "dev": true,
- "requires": {
- "ansi-regex": "3.0.0"
- }
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "ansi-regex": "^4.1.0"
}
}
}
},
"invariant": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz",
- "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=",
+ "version": "2.2.4",
+ "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
"dev": true,
"requires": {
- "loose-envify": "1.3.1"
+ "loose-envify": "^1.0.0"
}
},
"invert-kv": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
- "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
- "dev": true
- },
- "irregular-plurals": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.3.0.tgz",
- "integrity": "sha512-njf5A+Mxb3kojuHd1DzISjjIl+XhyzovXEOyPPSzdQozq/Lf2tN27mOrAAsxEPZxpn6I4MGzs1oo9TxXxPFpaA==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
+ "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
"dev": true
},
"is-absolute-url": {
@@ -3116,6 +6546,48 @@
"integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=",
"dev": true
},
+ "is-accessor-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "is-alphabetical": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.3.tgz",
+ "integrity": "sha512-eEMa6MKpHFzw38eKm56iNNi6GJ7lf6aLLio7Kr23sJPAECscgRtZvOBYybejWDQ2bM949Y++61PY+udzj5QMLA==",
+ "dev": true
+ },
+ "is-alphanumeric": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz",
+ "integrity": "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=",
+ "dev": true
+ },
+ "is-alphanumerical": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.3.tgz",
+ "integrity": "sha512-A1IGAPO5AW9vSh7omxIlOGwIqEvpW/TA+DksVOPM5ODuxKlZS09+TEM1E3275lJqO2oJ38vDpeAL3DCIiHE6eA==",
+ "dev": true,
+ "requires": {
+ "is-alphabetical": "^1.0.0",
+ "is-decimal": "^1.0.0"
+ }
+ },
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
@@ -3128,29 +6600,63 @@
"integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=",
"dev": true,
"requires": {
- "binary-extensions": "1.10.0"
+ "binary-extensions": "^1.0.0"
}
},
"is-buffer": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
- "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"dev": true
},
- "is-builtin-module": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
- "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
+ "is-callable": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
+ "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
+ "dev": true
+ },
+ "is-ci": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz",
+ "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==",
"dev": true,
"requires": {
- "builtin-modules": "1.1.1"
+ "ci-info": "^2.0.0"
}
},
- "is-callable": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz",
- "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=",
- "dev": true
+ "is-color-stop": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-color-stop/-/is-color-stop-1.1.0.tgz",
+ "integrity": "sha1-z/9HGu5N1cnhWFmPvhKWe1za00U=",
+ "dev": true,
+ "requires": {
+ "css-color-names": "^0.0.4",
+ "hex-color-regex": "^1.1.0",
+ "hsl-regex": "^1.0.0",
+ "hsla-regex": "^1.0.0",
+ "rgb-regex": "^1.0.1",
+ "rgba-regex": "^1.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
},
"is-date-object": {
"version": "1.0.1",
@@ -3158,6 +6664,31 @@
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
"dev": true
},
+ "is-decimal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.3.tgz",
+ "integrity": "sha512-bvLSwoDg2q6Gf+E2LEPiklHZxxiSi3XAh4Mav65mKqTfCO1HM3uBs24TjEH8iJX3bbDdLXKJXBTmGzuTUuAEjQ==",
+ "dev": true
+ },
+ "is-descriptor": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^0.1.6",
+ "is-data-descriptor": "^0.1.4",
+ "kind-of": "^5.0.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+ "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+ "dev": true
+ }
+ }
+ },
"is-directory": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz",
@@ -3176,7 +6707,7 @@
"integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=",
"dev": true,
"requires": {
- "is-primitive": "2.0.0"
+ "is-primitive": "^2.0.0"
}
},
"is-extendable": {
@@ -3186,9 +6717,9 @@
"dev": true
},
"is-extglob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
- "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
"dev": true
},
"is-finite": {
@@ -3197,7 +6728,7 @@
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
"dev": true,
"requires": {
- "number-is-nan": "1.0.1"
+ "number-is-nan": "^1.0.0"
}
},
"is-fullwidth-code-point": {
@@ -3207,37 +6738,47 @@
"dev": true
},
"is-glob": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
- "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
+ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
"dev": true,
"requires": {
- "is-extglob": "1.0.0"
+ "is-extglob": "^2.1.1"
}
},
- "is-installed-globally": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz",
- "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=",
+ "is-hexadecimal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.3.tgz",
+ "integrity": "sha512-zxQ9//Q3D/34poZf8fiy3m3XVpbQc7ren15iKqrTtLPwkPD/t3Scy9Imp63FujULGxuK0ZlCwoo5xNpktFgbOA==",
+ "dev": true
+ },
+ "is-lower-case": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz",
+ "integrity": "sha1-fhR75HaNxGbbO/shzGCzHmrWk5M=",
"dev": true,
"requires": {
- "global-dirs": "0.1.0",
- "is-path-inside": "1.0.0"
+ "lower-case": "^1.1.0"
}
},
- "is-npm": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz",
- "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=",
- "dev": true
- },
"is-number": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz",
- "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
"dev": true,
"requires": {
- "kind-of": "3.2.2"
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
"is-obj": {
@@ -3246,6 +6787,15 @@
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
+ "is-observable": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-1.1.0.tgz",
+ "integrity": "sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==",
+ "dev": true,
+ "requires": {
+ "symbol-observable": "^1.1.0"
+ }
+ },
"is-path-cwd": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
@@ -3253,21 +6803,21 @@
"dev": true
},
"is-path-in-cwd": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz",
- "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
+ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
"dev": true,
"requires": {
- "is-path-inside": "1.0.0"
+ "is-path-inside": "^1.0.0"
}
},
"is-path-inside": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz",
- "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
+ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
"dev": true,
"requires": {
- "path-is-inside": "1.0.2"
+ "path-is-inside": "^1.0.1"
}
},
"is-plain-obj": {
@@ -3276,6 +6826,15 @@
"integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
"dev": true
},
+ "is-plain-object": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.1"
+ }
+ },
"is-posix-bracket": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz",
@@ -3294,19 +6853,13 @@
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
"dev": true
},
- "is-redirect": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz",
- "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=",
- "dev": true
- },
"is-regex": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
"integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
"dev": true,
"requires": {
- "has": "1.0.1"
+ "has": "^1.0.1"
}
},
"is-regexp": {
@@ -3316,15 +6869,9 @@
"dev": true
},
"is-resolvable": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz",
- "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==",
- "dev": true
- },
- "is-retry-allowed": {
"version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz",
- "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=",
+ "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
+ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
"dev": true
},
"is-stream": {
@@ -3333,37 +6880,58 @@
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"dev": true
},
- "is-supported-regexp-flag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-supported-regexp-flag/-/is-supported-regexp-flag-1.0.0.tgz",
- "integrity": "sha1-i1IMhfrnolM4LUsCZS4EVXbhO7g=",
- "dev": true
- },
"is-svg": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz",
- "integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz",
+ "integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==",
"dev": true,
"requires": {
- "html-comment-regex": "1.1.1"
+ "html-comment-regex": "^1.1.0"
}
},
"is-symbol": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
+ "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
+ "dev": true,
+ "requires": {
+ "has-symbols": "^1.0.0"
+ }
+ },
+ "is-text-path": {
"version": "1.0.1",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz",
- "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=",
+ "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz",
+ "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=",
+ "dev": true,
+ "requires": {
+ "text-extensions": "^1.0.0"
+ }
+ },
+ "is-upper-case": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz",
+ "integrity": "sha1-jQsfp+eTOh5YSDYA7H2WYcuvdW8=",
+ "dev": true,
+ "requires": {
+ "upper-case": "^1.1.0"
+ }
+ },
+ "is-whitespace-character": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.3.tgz",
+ "integrity": "sha512-SNPgMLz9JzPccD3nPctcj8sZlX9DAMJSKH8bP7Z6bohCwuNgX8xbWr1eTAYXX9Vpi/aSn8Y1akL9WgM3t43YNQ==",
"dev": true
},
- "is-typedarray": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
- "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
+ "is-windows": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
"dev": true
},
- "is-utf8": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
- "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
+ "is-word-character": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.3.tgz",
+ "integrity": "sha512-0wfcrFgOOOBdgRNT9H33xe6Zi6yhX/uoc4U8NBZGeQQB0ctU1dnlNTyL9JM2646bHDTpsDm1Brb3VPoCIMrd/A==",
"dev": true
},
"isarray": {
@@ -3372,255 +6940,842 @@
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
+ "isbinaryfile": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz",
+ "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==",
+ "dev": true,
+ "requires": {
+ "buffer-alloc": "^1.2.0"
+ }
+ },
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
- "isnumeric": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/isnumeric/-/isnumeric-0.2.0.tgz",
- "integrity": "sha1-ojR7o2DeGeM9D/1ZD933dVy/LmQ=",
+ "isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
"dev": true
},
- "isobject": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
- "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "istanbul-api": {
+ "version": "2.1.6",
+ "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.6.tgz",
+ "integrity": "sha512-x0Eicp6KsShG1k1rMgBAi/1GgY7kFGEBwQpw3PXGEmu+rBcBNhqU8g2DgY9mlepAsLPzrzrbqSgCGANnki4POA==",
+ "dev": true,
+ "requires": {
+ "async": "^2.6.2",
+ "compare-versions": "^3.4.0",
+ "fileset": "^2.0.3",
+ "istanbul-lib-coverage": "^2.0.5",
+ "istanbul-lib-hook": "^2.0.7",
+ "istanbul-lib-instrument": "^3.3.0",
+ "istanbul-lib-report": "^2.0.8",
+ "istanbul-lib-source-maps": "^3.0.6",
+ "istanbul-reports": "^2.2.4",
+ "js-yaml": "^3.13.1",
+ "make-dir": "^2.1.0",
+ "minimatch": "^3.0.4",
+ "once": "^1.4.0"
+ }
+ },
+ "istanbul-lib-coverage": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
+ "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
+ "dev": true
+ },
+ "istanbul-lib-hook": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz",
+ "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==",
"dev": true,
"requires": {
- "isarray": "1.0.0"
+ "append-transform": "^1.0.0"
}
},
- "isstream": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
- "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
- "dev": true
+ "istanbul-lib-instrument": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz",
+ "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==",
+ "dev": true,
+ "requires": {
+ "@babel/generator": "^7.4.0",
+ "@babel/parser": "^7.4.3",
+ "@babel/template": "^7.4.0",
+ "@babel/traverse": "^7.4.3",
+ "@babel/types": "^7.4.0",
+ "istanbul-lib-coverage": "^2.0.5",
+ "semver": "^6.0.0"
+ },
+ "dependencies": {
+ "@babel/parser": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz",
+ "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g==",
+ "dev": true
+ },
+ "@babel/template": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz",
+ "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/parser": "^7.4.4",
+ "@babel/types": "^7.4.4"
+ }
+ },
+ "@babel/types": {
+ "version": "7.5.5",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
+ "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
+ "dev": true,
+ "requires": {
+ "esutils": "^2.0.2",
+ "lodash": "^4.17.13",
+ "to-fast-properties": "^2.0.0"
+ }
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
+ }
},
- "js-base64": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz",
- "integrity": "sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw==",
+ "istanbul-lib-report": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz",
+ "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==",
+ "dev": true,
+ "requires": {
+ "istanbul-lib-coverage": "^2.0.5",
+ "make-dir": "^2.1.0",
+ "supports-color": "^6.1.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "istanbul-lib-source-maps": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz",
+ "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==",
+ "dev": true,
+ "requires": {
+ "debug": "^4.1.1",
+ "istanbul-lib-coverage": "^2.0.5",
+ "make-dir": "^2.1.0",
+ "rimraf": "^2.6.3",
+ "source-map": "^0.6.1"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
+ "istanbul-reports": {
+ "version": "2.2.6",
+ "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz",
+ "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==",
+ "dev": true,
+ "requires": {
+ "handlebars": "^4.1.2"
+ }
+ },
+ "js-levenshtein": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz",
+ "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==",
"dev": true
},
"js-tokens": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
- "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"js-yaml": {
- "version": "3.7.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz",
- "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"dev": true,
"requires": {
- "argparse": "1.0.9",
- "esprima": "2.7.3"
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
}
},
- "jsbn": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
- "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
- "dev": true,
- "optional": true
- },
"jsesc": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
- "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
"dev": true
},
"json-parse-better-errors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz",
- "integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==",
- "dev": true
- },
- "json-schema": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
- "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
"dev": true
},
"json-schema-traverse": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
- "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
- "json-stable-stringify": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
- "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
- "dev": true,
- "requires": {
- "jsonify": "0.0.0"
- }
- },
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
"dev": true
},
- "json-stringify-safe": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
- "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
- "dev": true
- },
"json5": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
- "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
- "dev": true
- },
- "jsonfile": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
- "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz",
+ "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11"
+ "minimist": "^1.2.0"
}
},
- "jsonfilter": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/jsonfilter/-/jsonfilter-1.1.2.tgz",
- "integrity": "sha1-Ie987cdRk4E8dZMulqmL4gW6WhE=",
+ "jsonfile": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
+ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
- "JSONStream": "0.8.4",
- "minimist": "1.2.0",
- "stream-combiner": "0.2.2",
- "through2": "0.6.5"
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "jsonify": {
+ "version": "0.0.0",
+ "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
+ "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
+ "dev": true
+ },
+ "jsonparse": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
+ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=",
+ "dev": true
+ },
+ "karma": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/karma/-/karma-4.3.0.tgz",
+ "integrity": "sha512-NSPViHOt+RW38oJklvYxQC4BSQsv737oQlr/r06pCM+slDOr4myuI1ivkRmp+3dVpJDfZt2DmaPJ2wkx+ZZuMQ==",
+ "dev": true,
+ "requires": {
+ "bluebird": "^3.3.0",
+ "body-parser": "^1.16.1",
+ "braces": "^3.0.2",
+ "chokidar": "^3.0.0",
+ "colors": "^1.1.0",
+ "connect": "^3.6.0",
+ "core-js": "^3.1.3",
+ "di": "^0.0.1",
+ "dom-serialize": "^2.2.0",
+ "flatted": "^2.0.0",
+ "glob": "^7.1.1",
+ "graceful-fs": "^4.1.2",
+ "http-proxy": "^1.13.0",
+ "isbinaryfile": "^3.0.0",
+ "lodash": "^4.17.14",
+ "log4js": "^4.0.0",
+ "mime": "^2.3.1",
+ "minimatch": "^3.0.2",
+ "optimist": "^0.6.1",
+ "qjobs": "^1.1.4",
+ "range-parser": "^1.2.0",
+ "rimraf": "^2.6.0",
+ "safe-buffer": "^5.0.1",
+ "socket.io": "2.1.1",
+ "source-map": "^0.6.1",
+ "tmp": "0.0.33",
+ "useragent": "2.3.0"
},
"dependencies": {
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "anymatch": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
+ "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
+ "binary-extensions": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz",
+ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==",
+ "dev": true
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "chokidar": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.1.tgz",
+ "integrity": "sha512-/j5PPkb5Feyps9e+jo07jUZGvkB5Aj953NrI4s8xSVScrAo/RHeILrtdb4uzR7N6aaFFxxJ+gt8mA8HfNpw76w==",
+ "dev": true,
+ "requires": {
+ "anymatch": "~3.1.1",
+ "braces": "~3.0.2",
+ "fsevents": "~2.1.0",
+ "glob-parent": "~5.1.0",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.1.3"
+ }
+ },
+ "core-js": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.2.1.tgz",
+ "integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw==",
"dev": true
},
- "stream-combiner": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz",
- "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=",
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "fsevents": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.0.tgz",
+ "integrity": "sha512-+iXhW3LuDQsno8dOIrCIT/CBjeBWuP7PXe8w9shnj9Lebny/Gx1ZjVBYwexLz36Ri2jKuXMNpV6CYNh8lHHgrQ==",
+ "dev": true,
+ "optional": true
+ },
+ "glob-parent": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
+ "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "readdirp": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.3.tgz",
+ "integrity": "sha512-ZOsfTGkjO2kqeR5Mzr5RYDbTGYneSkdNKX2fOX2P5jF7vMrd/GNnIAUtDldeHHumHUCQ3V05YfWUdxMPAsRu9Q==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.0.4"
+ }
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
- "duplexer": "0.1.1",
- "through": "2.3.8"
+ "is-number": "^7.0.0"
}
}
}
},
- "jsonify": {
- "version": "0.0.0",
- "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
- "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
+ "karma-chai": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz",
+ "integrity": "sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o=",
"dev": true
},
- "jsonparse": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz",
- "integrity": "sha1-MwVCrT8KZUZlt3jz6y2an6UHrGQ=",
- "dev": true
+ "karma-chrome-launcher": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz",
+ "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==",
+ "dev": true,
+ "requires": {
+ "which": "^1.2.1"
+ }
},
- "jsprim": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
- "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+ "karma-coverage-istanbul-reporter": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-2.1.0.tgz",
+ "integrity": "sha512-UH0mXPJFJyK5uiK7EkwGtQ8f30lCBAfqRResnZ4pzLJ04SOp4SPlYkmwbbZ6iVJ6sQFVzlDUXlntBEsLRdgZpg==",
"dev": true,
"requires": {
- "assert-plus": "1.0.0",
- "extsprintf": "1.3.0",
- "json-schema": "0.2.3",
- "verror": "1.10.0"
+ "istanbul-api": "^2.1.6",
+ "minimatch": "^3.0.4"
}
},
- "kew": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz",
- "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=",
- "dev": true
+ "karma-mocha": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-1.3.0.tgz",
+ "integrity": "sha1-7qrH/8DiAetjxGdEDStpx883eL8=",
+ "dev": true,
+ "requires": {
+ "minimist": "1.2.0"
+ }
},
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "karma-mocha-reporter": {
+ "version": "2.2.5",
+ "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz",
+ "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=",
"dev": true,
"requires": {
- "is-buffer": "1.1.5"
+ "chalk": "^2.1.0",
+ "log-symbols": "^2.1.0",
+ "strip-ansi": "^4.0.0"
}
},
- "klaw": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
- "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
+ "karma-rollup-preprocessor": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.2.tgz",
+ "integrity": "sha512-A+kr5FoiMr/S8dIPij/nuzB9PLhkrh3umFowjumAOKBDVQRhPYs3kKmQ82hP3+2MB6CICqeB4MmiIE4iTwUmDQ==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11"
+ "chokidar": "^3.0.2",
+ "debounce": "^1.2.0"
+ },
+ "dependencies": {
+ "anymatch": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.0.3.tgz",
+ "integrity": "sha512-c6IvoeBECQlMVuYUjSwimnhmztImpErfxJzWZhIQinIvQWoGOnB0dLIgifbPHQt5heS6mNlaZG16f06H3C8t1g==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
+ "binary-extensions": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz",
+ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==",
+ "dev": true
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "chokidar": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz",
+ "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==",
+ "dev": true,
+ "requires": {
+ "anymatch": "^3.0.1",
+ "braces": "^3.0.2",
+ "fsevents": "^2.0.6",
+ "glob-parent": "^5.0.0",
+ "is-binary-path": "^2.1.0",
+ "is-glob": "^4.0.1",
+ "normalize-path": "^3.0.0",
+ "readdirp": "^3.1.1"
+ }
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "fsevents": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz",
+ "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==",
+ "dev": true,
+ "optional": true
+ },
+ "glob-parent": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
+ "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
+ "is-glob": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
+ "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "readdirp": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.1.tgz",
+ "integrity": "sha512-XXdSXZrQuvqoETj50+JAitxz1UPdt5dupjT6T5nVB+WvjMv2XKYj+s7hPeAVCXvmJrL36O4YYyWlIC3an2ePiQ==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.0.4"
+ }
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ }
}
},
+ "kind-of": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
+ "dev": true
+ },
"known-css-properties": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.2.0.tgz",
- "integrity": "sha512-UTCzU28rRI9wkb8qSGoZa9pgWvxr4LjP2MEhi9XHb/1XMOJy0uTnIxaxzj8My/PORG+kQG6VzAcGvRw66eIOfA==",
+ "version": "0.15.0",
+ "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.15.0.tgz",
+ "integrity": "sha512-TS0RCcQfHYsA+59uIHhnsA71NBkpILbqi0W+hde4R5FtESdzur0tCJFoko/1Pbhx+8rmdUc0R1VE4ixnnD+9xw==",
"dev": true
},
- "latest-version": {
+ "lcid": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
+ "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
+ "dev": true,
+ "requires": {
+ "invert-kv": "^2.0.0"
+ }
+ },
+ "leven": {
"version": "3.1.0",
- "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz",
- "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=",
+ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
+ "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
+ "dev": true
+ },
+ "levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
"dev": true,
"requires": {
- "package-json": "4.0.1"
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ }
+ },
+ "lines-and-columns": {
+ "version": "1.1.6",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
+ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
+ "dev": true
+ },
+ "lint-staged": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.2.1.tgz",
+ "integrity": "sha512-n0tDGR/rTCgQNwXnUf/eWIpPNddGWxC32ANTNYsj2k02iZb7Cz5ox2tytwBu+2r0zDXMEMKw7Y9OD/qsav561A==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.3.1",
+ "commander": "^2.14.1",
+ "cosmiconfig": "^5.2.0",
+ "debug": "^3.1.0",
+ "dedent": "^0.7.0",
+ "del": "^3.0.0",
+ "execa": "^1.0.0",
+ "g-status": "^2.0.2",
+ "is-glob": "^4.0.0",
+ "is-windows": "^1.0.2",
+ "listr": "^0.14.2",
+ "listr-update-renderer": "^0.5.0",
+ "lodash": "^4.17.11",
+ "log-symbols": "^2.2.0",
+ "micromatch": "^3.1.8",
+ "npm-which": "^3.0.1",
+ "p-map": "^1.1.1",
+ "path-is-inside": "^1.0.2",
+ "pify": "^3.0.0",
+ "please-upgrade-node": "^3.0.2",
+ "staged-git-files": "1.1.2",
+ "string-argv": "^0.0.2",
+ "stringify-object": "^3.2.2",
+ "yup": "^0.27.0"
+ },
+ "dependencies": {
+ "cosmiconfig": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
+ "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
+ "dev": true,
+ "requires": {
+ "import-fresh": "^2.0.0",
+ "is-directory": "^0.3.1",
+ "js-yaml": "^3.13.1",
+ "parse-json": "^4.0.0"
+ }
+ },
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "execa": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "import-fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz",
+ "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=",
+ "dev": true,
+ "requires": {
+ "caller-path": "^2.0.0",
+ "resolve-from": "^3.0.0"
+ }
+ },
+ "js-yaml": {
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
+ },
+ "resolve-from": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+ "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+ "dev": true
+ }
}
},
- "lcid": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
- "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
+ "listr": {
+ "version": "0.14.3",
+ "resolved": "https://registry.npmjs.org/listr/-/listr-0.14.3.tgz",
+ "integrity": "sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA==",
"dev": true,
"requires": {
- "invert-kv": "1.0.0"
+ "@samverschueren/stream-to-observable": "^0.3.0",
+ "is-observable": "^1.1.0",
+ "is-promise": "^2.1.0",
+ "is-stream": "^1.1.0",
+ "listr-silent-renderer": "^1.1.1",
+ "listr-update-renderer": "^0.5.0",
+ "listr-verbose-renderer": "^0.5.0",
+ "p-map": "^2.0.0",
+ "rxjs": "^6.3.3"
+ },
+ "dependencies": {
+ "p-map": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz",
+ "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==",
+ "dev": true
+ }
}
},
- "ldjson-stream": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/ldjson-stream/-/ldjson-stream-1.2.1.tgz",
- "integrity": "sha1-kb7O2lrE7SsX5kn7d356v6AYnCs=",
+ "listr-silent-renderer": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz",
+ "integrity": "sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4=",
+ "dev": true
+ },
+ "listr-update-renderer": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz",
+ "integrity": "sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA==",
"dev": true,
"requires": {
- "split2": "0.2.1",
- "through2": "0.6.5"
+ "chalk": "^1.1.3",
+ "cli-truncate": "^0.2.1",
+ "elegant-spinner": "^1.0.1",
+ "figures": "^1.7.0",
+ "indent-string": "^3.0.0",
+ "log-symbols": "^1.0.2",
+ "log-update": "^2.3.0",
+ "strip-ansi": "^3.0.1"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
+ "dev": true
+ },
+ "chalk": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ }
+ },
+ "figures": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
+ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.5",
+ "object-assign": "^4.1.0"
+ }
+ },
+ "log-symbols": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz",
+ "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=",
+ "dev": true,
+ "requires": {
+ "chalk": "^1.0.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^2.0.0"
+ }
+ },
+ "supports-color": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+ "dev": true
+ }
}
},
- "levn": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
- "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "listr-verbose-renderer": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz",
+ "integrity": "sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw==",
"dev": true,
"requires": {
- "prelude-ls": "1.1.2",
- "type-check": "0.3.2"
+ "chalk": "^2.4.1",
+ "cli-cursor": "^2.1.0",
+ "date-fns": "^1.27.2",
+ "figures": "^2.0.0"
}
},
"load-json-file": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
- "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+ "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "parse-json": "2.2.0",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1",
- "strip-bom": "2.0.0"
+ "graceful-fs": "^4.1.2",
+ "parse-json": "^4.0.0",
+ "pify": "^3.0.0",
+ "strip-bom": "^3.0.0"
}
},
"locate-path": {
@@ -3629,22 +7784,14 @@
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
- "p-locate": "2.0.0",
- "path-exists": "3.0.0"
- },
- "dependencies": {
- "path-exists": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
- "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
- "dev": true
- }
+ "p-locate": "^2.0.0",
+ "path-exists": "^3.0.0"
}
},
"lodash": {
- "version": "4.17.4",
- "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
- "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
+ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
"lodash._reinterpolate": {
@@ -3653,10 +7800,10 @@
"integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=",
"dev": true
},
- "lodash.cond": {
- "version": "4.5.2",
- "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz",
- "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=",
+ "lodash.get": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
+ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true
},
"lodash.memoize": {
@@ -3671,8 +7818,8 @@
"integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=",
"dev": true,
"requires": {
- "lodash._reinterpolate": "3.0.0",
- "lodash.templatesettings": "4.1.0"
+ "lodash._reinterpolate": "~3.0.0",
+ "lodash.templatesettings": "^4.0.0"
}
},
"lodash.templatesettings": {
@@ -3681,7 +7828,7 @@
"integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=",
"dev": true,
"requires": {
- "lodash._reinterpolate": "3.0.0"
+ "lodash._reinterpolate": "~3.0.0"
}
},
"lodash.uniq": {
@@ -3691,21 +7838,51 @@
"dev": true
},
"log-symbols": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz",
- "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
+ "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.0.1"
+ }
+ },
+ "log-update": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/log-update/-/log-update-2.3.0.tgz",
+ "integrity": "sha1-iDKP19HOeTiykoN0bwsbwSayRwg=",
+ "dev": true,
+ "requires": {
+ "ansi-escapes": "^3.0.0",
+ "cli-cursor": "^2.0.0",
+ "wrap-ansi": "^3.0.1"
+ }
+ },
+ "log4js": {
+ "version": "4.5.1",
+ "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz",
+ "integrity": "sha512-EEEgFcE9bLgaYUKuozyFfytQM2wDHtXn4tAN41pkaxpNjAykv11GVdeI4tHtmPWW4Xrgh9R/2d7XYghDVjbKKw==",
"dev": true,
"requires": {
- "chalk": "1.1.3"
+ "date-format": "^2.0.0",
+ "debug": "^4.1.1",
+ "flatted": "^2.0.0",
+ "rfdc": "^1.1.4",
+ "streamroller": "^1.0.6"
}
},
+ "longest-streak": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.3.tgz",
+ "integrity": "sha512-9lz5IVdpwsKLMzQi0MQ+oD9EA0mIGcWYP7jXMTZVXP8D42PwuAk+M/HBFYQoxt1G5OR8m7aSIgb1UymfWGBWEw==",
+ "dev": true
+ },
"loose-envify": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
- "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+ "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dev": true,
"requires": {
- "js-tokens": "3.0.2"
+ "js-tokens": "^3.0.0 || ^4.0.0"
}
},
"loud-rejection": {
@@ -3714,80 +7891,146 @@
"integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
"dev": true,
"requires": {
- "currently-unhandled": "0.4.1",
- "signal-exit": "3.0.2"
+ "currently-unhandled": "^0.4.1",
+ "signal-exit": "^3.0.0"
}
},
- "lowercase-keys": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz",
- "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=",
+ "lower-case": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
+ "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
"dev": true
},
- "lru-cache": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
- "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
+ "lower-case-first": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/lower-case-first/-/lower-case-first-1.0.2.tgz",
+ "integrity": "sha1-5dp8JvKacHO+AtUrrJmA5ZIq36E=",
"dev": true,
"requires": {
- "pseudomap": "1.0.2",
- "yallist": "2.1.2"
+ "lower-case": "^1.1.2"
}
},
- "macaddress": {
- "version": "0.2.8",
- "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.8.tgz",
- "integrity": "sha1-WQTcU3w57G2+/q6QIycTX6hRHxI=",
- "dev": true
+ "lru-cache": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
+ "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
+ "dev": true,
+ "requires": {
+ "pseudomap": "^1.0.2",
+ "yallist": "^2.1.2"
+ }
},
"make-dir": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz",
- "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+ "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"requires": {
- "pify": "3.0.0"
+ "pify": "^4.0.1",
+ "semver": "^5.6.0"
},
"dependencies": {
"pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true
}
}
},
+ "map-age-cleaner": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
+ "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
+ "dev": true,
+ "requires": {
+ "p-defer": "^1.0.0"
+ }
+ },
+ "map-cache": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
+ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
+ "dev": true
+ },
"map-obj": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
- "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz",
+ "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=",
"dev": true
},
- "map-stream": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz",
- "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=",
+ "map-visit": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
+ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=",
+ "dev": true,
+ "requires": {
+ "object-visit": "^1.0.0"
+ }
+ },
+ "markdown-escapes": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.3.tgz",
+ "integrity": "sha512-XUi5HJhhV5R74k8/0H2oCbCiYf/u4cO/rX8tnGkRvrqhsr5BRNU6Mg0yt/8UIx1iIS8220BNJsDb7XnILhLepw==",
"dev": true
},
- "math-expression-evaluator": {
- "version": "1.2.17",
- "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz",
- "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=",
+ "markdown-table": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz",
+ "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==",
+ "dev": true
+ },
+ "matcher": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/matcher/-/matcher-1.1.1.tgz",
+ "integrity": "sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg==",
+ "dev": true,
+ "requires": {
+ "escape-string-regexp": "^1.0.4"
+ }
+ },
+ "math-random": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz",
+ "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==",
"dev": true
},
"mathml-tag-names": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.0.1.tgz",
- "integrity": "sha1-jUEmgWi/htEQK5gQnijlMeejRXg=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.1.tgz",
+ "integrity": "sha512-pWB896KPGSGkp1XtyzRBftpTzwSOL0Gfk0wLvxt4f2mgzjY19o0LxJ3U25vNWTzsh7da+KTbuXQoQ3lOJZ8WHw==",
+ "dev": true
+ },
+ "mdast-util-compact": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.3.tgz",
+ "integrity": "sha512-nRiU5GpNy62rZppDKbLwhhtw5DXoFMqw9UNZFmlPsNaQCZ//WLjGKUwWMdJrUH+Se7UvtO2gXtAMe0g/N+eI5w==",
+ "dev": true,
+ "requires": {
+ "unist-util-visit": "^1.1.0"
+ }
+ },
+ "mdn-data": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz",
+ "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==",
+ "dev": true
+ },
+ "media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
"dev": true
},
"mem": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
- "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=",
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz",
+ "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==",
"dev": true,
"requires": {
- "mimic-fn": "1.1.0"
+ "map-age-cleaner": "^0.1.1",
+ "mimic-fn": "^1.0.0",
+ "p-is-promise": "^2.0.0"
}
},
"memorystream": {
@@ -3797,77 +8040,74 @@
"dev": true
},
"meow": {
- "version": "3.7.0",
- "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
- "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz",
+ "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==",
"dev": true,
"requires": {
- "camelcase-keys": "2.1.0",
- "decamelize": "1.2.0",
- "loud-rejection": "1.6.0",
- "map-obj": "1.0.1",
- "minimist": "1.2.0",
- "normalize-package-data": "2.4.0",
- "object-assign": "4.1.1",
- "read-pkg-up": "1.0.1",
- "redent": "1.0.0",
- "trim-newlines": "1.0.0"
- },
- "dependencies": {
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
- "dev": true
- }
+ "camelcase-keys": "^4.0.0",
+ "decamelize-keys": "^1.0.0",
+ "loud-rejection": "^1.0.0",
+ "minimist-options": "^3.0.1",
+ "normalize-package-data": "^2.3.4",
+ "read-pkg-up": "^3.0.0",
+ "redent": "^2.0.0",
+ "trim-newlines": "^2.0.0",
+ "yargs-parser": "^10.0.0"
}
},
+ "merge2": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.3.tgz",
+ "integrity": "sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA==",
+ "dev": true
+ },
"micromatch": {
- "version": "2.3.11",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
- "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
- "dev": true,
- "requires": {
- "arr-diff": "2.0.0",
- "array-unique": "0.2.1",
- "braces": "1.8.5",
- "expand-brackets": "0.1.5",
- "extglob": "0.3.2",
- "filename-regex": "2.0.1",
- "is-extglob": "1.0.0",
- "is-glob": "2.0.1",
- "kind-of": "3.2.2",
- "normalize-path": "2.1.1",
- "object.omit": "2.0.1",
- "parse-glob": "3.0.4",
- "regex-cache": "0.4.4"
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "braces": "^2.3.1",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "extglob": "^2.0.4",
+ "fragment-cache": "^0.2.1",
+ "kind-of": "^6.0.2",
+ "nanomatch": "^1.2.9",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.2"
}
},
"mime": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
- "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==",
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz",
+ "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==",
"dev": true
},
"mime-db": {
- "version": "1.30.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz",
- "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=",
+ "version": "1.40.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz",
+ "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==",
"dev": true
},
"mime-types": {
- "version": "2.1.17",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz",
- "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=",
+ "version": "2.1.24",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz",
+ "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==",
"dev": true,
"requires": {
- "mime-db": "1.30.0"
+ "mime-db": "1.40.0"
}
},
"mimic-fn": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz",
- "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+ "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"dev": true
},
"minimatch": {
@@ -3876,148 +8116,385 @@
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
- "brace-expansion": "1.1.8"
+ "brace-expansion": "^1.1.7"
}
},
"minimist": {
- "version": "0.0.8",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
- "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
- "mkdirp": {
- "version": "0.5.1",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
- "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+ "minimist-options": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz",
+ "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==",
"dev": true,
"requires": {
- "minimist": "0.0.8"
+ "arrify": "^1.0.1",
+ "is-plain-obj": "^1.1.0"
}
},
- "ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "multimatch": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz",
- "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=",
+ "mixin-deep": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
+ "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
"dev": true,
"requires": {
- "array-differ": "1.0.0",
- "array-union": "1.0.2",
- "arrify": "1.0.1",
- "minimatch": "3.0.4"
+ "for-in": "^1.0.2",
+ "is-extendable": "^1.0.1"
+ },
+ "dependencies": {
+ "is-extendable": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+ "dev": true,
+ "requires": {
+ "is-plain-object": "^2.0.4"
+ }
+ }
}
},
- "mute-stream": {
- "version": "0.0.7",
- "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
- "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
- "dev": true
- },
- "natural-compare": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
- "dev": true
- },
- "nested-error-stacks": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz",
- "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=",
+ "mkdirp": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
- "inherits": "2.0.3"
+ "minimist": "0.0.8"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ }
}
},
- "node-qunit-phantomjs": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/node-qunit-phantomjs/-/node-qunit-phantomjs-2.0.0.tgz",
- "integrity": "sha512-xZV0J8fBbe8h04IkBxLtwvGVbP0ViUhkJzjFx/tb7uWT02w6iMt5X6HDmdTZuQXBMsgahyaIGjW30l3HSlj2yA==",
+ "mocha": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.1.tgz",
+ "integrity": "sha512-VCcWkLHwk79NYQc8cxhkmI8IigTIhsCwZ6RTxQsqK6go4UvEhzJkYuHm8B2YtlSxcYq2fY+ucr4JBwoD6ci80A==",
"dev": true,
"requires": {
- "chalk": "2.3.0",
- "minimist": "1.2.0",
- "phantomjs-prebuilt": "2.1.16",
- "qunit-phantomjs-runner": "2.3.1"
+ "ansi-colors": "3.2.3",
+ "browser-stdout": "1.3.1",
+ "debug": "3.2.6",
+ "diff": "3.5.0",
+ "escape-string-regexp": "1.0.5",
+ "find-up": "3.0.0",
+ "glob": "7.1.3",
+ "growl": "1.10.5",
+ "he": "1.2.0",
+ "js-yaml": "3.13.1",
+ "log-symbols": "2.2.0",
+ "minimatch": "3.0.4",
+ "mkdirp": "0.5.1",
+ "ms": "2.1.1",
+ "node-environment-flags": "1.0.5",
+ "object.assign": "4.1.0",
+ "strip-json-comments": "2.0.1",
+ "supports-color": "6.0.0",
+ "which": "1.3.1",
+ "wide-align": "1.1.3",
+ "yargs": "13.3.0",
+ "yargs-parser": "13.1.1",
+ "yargs-unparser": "1.6.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
+ },
+ "camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "dev": true
+ },
+ "cliui": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+ "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
"dev": true,
"requires": {
- "color-convert": "1.9.0"
+ "string-width": "^3.1.0",
+ "strip-ansi": "^5.2.0",
+ "wrap-ansi": "^5.1.0"
}
},
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
+ "ms": "^2.1.1"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"dev": true
},
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
+ "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
- "qunit-phantomjs-runner": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/qunit-phantomjs-runner/-/qunit-phantomjs-runner-2.3.1.tgz",
- "integrity": "sha512-RLg51606zm6/HwZi29NciAMAqifyJE1oGg77tEuk05vEa7kuqEaI0Mkjw976Ynnq7GXurATnbFd+471c024tBQ==",
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
- "qunit-reporter-junit": "1.1.1"
+ "ansi-regex": "^4.1.0"
}
},
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "dev": true
+ },
"supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz",
+ "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ },
+ "wrap-ansi": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+ "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.0",
+ "string-width": "^3.0.0",
+ "strip-ansi": "^5.0.0"
+ }
+ },
+ "yargs": {
+ "version": "13.3.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
+ "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
+ "dev": true,
+ "requires": {
+ "cliui": "^5.0.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^3.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^13.1.1"
+ }
+ },
+ "yargs-parser": {
+ "version": "13.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
+ "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
}
}
}
},
- "normalize-package-data": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
- "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
+ "ms": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
+ "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
+ "dev": true
+ },
+ "mute-stream": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
+ "dev": true
+ },
+ "nan": {
+ "version": "2.12.1",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
+ "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==",
+ "dev": true,
+ "optional": true
+ },
+ "nanomatch": {
+ "version": "1.2.13",
+ "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
+ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
"dev": true,
"requires": {
- "hosted-git-info": "2.5.0",
- "is-builtin-module": "1.0.0",
- "semver": "5.4.1",
- "validate-npm-package-license": "3.0.1"
+ "arr-diff": "^4.0.0",
+ "array-unique": "^0.3.2",
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "fragment-cache": "^0.2.1",
+ "is-windows": "^1.0.2",
+ "kind-of": "^6.0.2",
+ "object.pick": "^1.3.0",
+ "regex-not": "^1.0.0",
+ "snapdragon": "^0.8.1",
+ "to-regex": "^3.0.1"
}
},
- "normalize-path": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
- "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
+ "natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "dev": true
+ },
+ "negotiator": {
+ "version": "0.6.2",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
+ "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==",
+ "dev": true
+ },
+ "neo-async": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz",
+ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==",
+ "dev": true
+ },
+ "nested-error-stacks": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz",
+ "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==",
+ "dev": true
+ },
+ "nice-try": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+ "dev": true
+ },
+ "no-case": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
+ "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
"dev": true,
"requires": {
- "remove-trailing-separator": "1.1.0"
+ "lower-case": "^1.1.1"
}
},
+ "node-environment-flags": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz",
+ "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==",
+ "dev": true,
+ "requires": {
+ "object.getownpropertydescriptors": "^2.0.3",
+ "semver": "^5.7.0"
+ },
+ "dependencies": {
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "dev": true
+ }
+ }
+ },
+ "node-fetch": {
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
+ "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.10.tgz",
+ "integrity": "sha512-KbUPCpfoBvb3oBkej9+nrU0/7xPlVhmhhUJ1PZqwIP5/1dJkRWKWD3OONjo6M2J7tSCBtDCumLwwqeI+DWWaLQ==",
+ "dev": true,
+ "requires": {
+ "semver": "^5.3.0"
+ }
+ },
+ "normalize-package-data": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "^2.1.4",
+ "resolve": "^1.10.0",
+ "semver": "2 || 3 || 4 || 5",
+ "validate-npm-package-license": "^3.0.1"
+ }
+ },
+ "normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true
+ },
"normalize-range": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
@@ -4031,123 +8508,35 @@
"dev": true
},
"normalize-url": {
- "version": "1.9.1",
- "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
- "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=",
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz",
+ "integrity": "sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg==",
+ "dev": true
+ },
+ "npm-path": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/npm-path/-/npm-path-2.0.4.tgz",
+ "integrity": "sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==",
"dev": true,
"requires": {
- "object-assign": "4.1.1",
- "prepend-http": "1.0.4",
- "query-string": "4.3.4",
- "sort-keys": "1.1.2"
+ "which": "^1.2.10"
}
},
"npm-run-all": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.2.tgz",
- "integrity": "sha512-Z2aRlajMK4SQ8u19ZA75NZZu7wupfCNQWdYosIi8S6FgBdGf/8Y6Hgyjdc8zU2cYmIRVCx1nM80tJPkdEd+UYg==",
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
+ "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "chalk": "2.3.0",
- "cross-spawn": "5.1.0",
- "memorystream": "0.3.1",
- "minimatch": "3.0.4",
- "ps-tree": "1.1.0",
- "read-pkg": "3.0.0",
- "shell-quote": "1.6.1",
- "string.prototype.padend": "3.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "load-json-file": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
- "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
- "dev": true,
- "requires": {
- "graceful-fs": "4.1.11",
- "parse-json": "4.0.0",
- "pify": "3.0.0",
- "strip-bom": "3.0.0"
- }
- },
- "parse-json": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
- "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
- "dev": true,
- "requires": {
- "error-ex": "1.3.1",
- "json-parse-better-errors": "1.0.1"
- }
- },
- "path-type": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
- "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
- "dev": true,
- "requires": {
- "pify": "3.0.0"
- }
- },
- "pify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
- "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
- "dev": true
- },
- "read-pkg": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
- "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
- "dev": true,
- "requires": {
- "load-json-file": "4.0.0",
- "normalize-package-data": "2.4.0",
- "path-type": "3.0.0"
- }
- },
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "ansi-styles": "^3.2.1",
+ "chalk": "^2.4.1",
+ "cross-spawn": "^6.0.5",
+ "memorystream": "^0.3.1",
+ "minimatch": "^3.0.4",
+ "pidtree": "^0.3.0",
+ "read-pkg": "^3.0.0",
+ "shell-quote": "^1.6.1",
+ "string.prototype.padend": "^3.0.0"
}
},
"npm-run-path": {
@@ -4156,7 +8545,27 @@
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"dev": true,
"requires": {
- "path-key": "2.0.1"
+ "path-key": "^2.0.0"
+ }
+ },
+ "npm-which": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/npm-which/-/npm-which-3.0.1.tgz",
+ "integrity": "sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo=",
+ "dev": true,
+ "requires": {
+ "commander": "^2.9.0",
+ "npm-path": "^2.0.2",
+ "which": "^1.2.10"
+ }
+ },
+ "nth-check": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
+ "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
+ "dev": true,
+ "requires": {
+ "boolbase": "~1.0.0"
}
},
"num2fraction": {
@@ -4171,32 +8580,136 @@
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true
},
- "oauth-sign": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
- "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
- "dev": true
- },
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true
},
+ "object-component": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
+ "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=",
+ "dev": true
+ },
+ "object-copy": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
+ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=",
+ "dev": true,
+ "requires": {
+ "copy-descriptor": "^0.1.0",
+ "define-property": "^0.2.5",
+ "kind-of": "^3.0.3"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
"object-keys": {
- "version": "1.0.11",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz",
- "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=",
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz",
+ "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==",
"dev": true
},
+ "object-visit": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
+ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.0"
+ }
+ },
+ "object.assign": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
+ "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.2",
+ "function-bind": "^1.1.1",
+ "has-symbols": "^1.0.0",
+ "object-keys": "^1.0.11"
+ }
+ },
+ "object.entries": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.0.tgz",
+ "integrity": "sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.12.0",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3"
+ }
+ },
+ "object.getownpropertydescriptors": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
+ "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.5.1"
+ }
+ },
"object.omit": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz",
"integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=",
"dev": true,
"requires": {
- "for-own": "0.1.5",
- "is-extendable": "0.1.1"
+ "for-own": "^0.1.4",
+ "is-extendable": "^0.1.1"
+ }
+ },
+ "object.pick": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
+ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=",
+ "dev": true,
+ "requires": {
+ "isobject": "^3.0.1"
+ }
+ },
+ "object.values": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz",
+ "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.3",
+ "es-abstract": "^1.12.0",
+ "function-bind": "^1.1.1",
+ "has": "^1.0.3"
+ }
+ },
+ "on-finished": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+ "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
+ "dev": true,
+ "requires": {
+ "ee-first": "1.1.1"
}
},
"once": {
@@ -4205,48 +8718,60 @@
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
- "wrappy": "1.0.2"
+ "wrappy": "1"
}
},
- "onecolor": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/onecolor/-/onecolor-3.0.4.tgz",
- "integrity": "sha1-daRvgNpseqpbTarhekcZi9llJJQ=",
- "dev": true
- },
"onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
"dev": true,
"requires": {
- "mimic-fn": "1.1.0"
+ "mimic-fn": "^1.0.0"
}
},
- "optionator": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
- "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
+ "opencollective-postinstall": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz",
+ "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
+ "dev": true
+ },
+ "optimist": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
+ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
"dev": true,
"requires": {
- "deep-is": "0.1.3",
- "fast-levenshtein": "2.0.6",
- "levn": "0.3.0",
- "prelude-ls": "1.1.2",
- "type-check": "0.3.2",
- "wordwrap": "1.0.0"
+ "minimist": "~0.0.1",
+ "wordwrap": "~0.0.2"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.10",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
+ "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
+ "dev": true
+ },
+ "wordwrap": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
+ "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
+ "dev": true
+ }
}
},
- "ora": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/ora/-/ora-1.3.0.tgz",
- "integrity": "sha1-gAeN0rkqk0r2ajrXKluRBpTt5Ro=",
+ "optionator": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
+ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "cli-cursor": "2.1.0",
- "cli-spinners": "1.1.0",
- "log-symbols": "1.0.2"
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.4",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "wordwrap": "~1.0.0"
}
},
"os-homedir": {
@@ -4256,14 +8781,40 @@
"dev": true
},
"os-locale": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz",
- "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
+ "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
"dev": true,
"requires": {
- "execa": "0.7.0",
- "lcid": "1.0.0",
- "mem": "1.1.0"
+ "execa": "^1.0.0",
+ "lcid": "^2.0.0",
+ "mem": "^4.0.0"
+ },
+ "dependencies": {
+ "execa": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+ "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^6.0.0",
+ "get-stream": "^4.0.0",
+ "is-stream": "^1.1.0",
+ "npm-run-path": "^2.0.0",
+ "p-finally": "^1.0.0",
+ "signal-exit": "^3.0.0",
+ "strip-eof": "^1.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "dev": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ }
}
},
"os-tmpdir": {
@@ -4272,25 +8823,40 @@
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
+ "p-defer": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
+ "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
+ "dev": true
+ },
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
"dev": true
},
- "p-limit": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz",
- "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=",
+ "p-is-promise": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz",
+ "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==",
"dev": true
},
+ "p-limit": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
+ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
+ "dev": true,
+ "requires": {
+ "p-try": "^1.0.0"
+ }
+ },
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
- "p-limit": "1.1.0"
+ "p-limit": "^1.1.0"
}
},
"p-map": {
@@ -4299,16 +8865,42 @@
"integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==",
"dev": true
},
- "package-json": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz",
- "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=",
+ "p-try": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
+ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
+ "dev": true
+ },
+ "param-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
+ "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
"dev": true,
"requires": {
- "got": "6.7.1",
- "registry-auth-token": "3.3.1",
- "registry-url": "3.1.0",
- "semver": "5.4.1"
+ "no-case": "^2.2.0"
+ }
+ },
+ "parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "requires": {
+ "callsites": "^3.0.0"
+ }
+ },
+ "parse-entities": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.2.tgz",
+ "integrity": "sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==",
+ "dev": true,
+ "requires": {
+ "character-entities": "^1.0.0",
+ "character-entities-legacy": "^1.0.0",
+ "character-reference-invalid": "^1.0.0",
+ "is-alphanumerical": "^1.0.0",
+ "is-decimal": "^1.0.0",
+ "is-hexadecimal": "^1.0.0"
}
},
"parse-glob": {
@@ -4317,30 +8909,100 @@
"integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=",
"dev": true,
"requires": {
- "glob-base": "0.3.0",
- "is-dotfile": "1.0.3",
- "is-extglob": "1.0.0",
- "is-glob": "2.0.1"
+ "glob-base": "^0.3.0",
+ "is-dotfile": "^1.0.0",
+ "is-extglob": "^1.0.0",
+ "is-glob": "^2.0.0"
+ },
+ "dependencies": {
+ "is-extglob": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ }
}
},
"parse-json": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
- "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
"dev": true,
"requires": {
- "error-ex": "1.3.1"
+ "error-ex": "^1.3.1",
+ "json-parse-better-errors": "^1.0.1"
}
},
- "path-exists": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
- "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
+ "parseqs": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
+ "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=",
+ "dev": true,
+ "requires": {
+ "better-assert": "~1.0.0"
+ }
+ },
+ "parseuri": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
+ "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=",
"dev": true,
"requires": {
- "pinkie-promise": "2.0.1"
+ "better-assert": "~1.0.0"
}
},
+ "parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "dev": true
+ },
+ "pascal-case": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-2.0.1.tgz",
+ "integrity": "sha1-LVeNNFX2YNpl7KGO+VtODekSdh4=",
+ "dev": true,
+ "requires": {
+ "camel-case": "^3.0.0",
+ "upper-case-first": "^1.1.0"
+ }
+ },
+ "pascalcase": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
+ "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=",
+ "dev": true
+ },
+ "path-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz",
+ "integrity": "sha1-lLgDfDctP+KQbkZbtF4l0ibo7qU=",
+ "dev": true,
+ "requires": {
+ "no-case": "^2.2.0"
+ }
+ },
+ "path-dirname": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
+ "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+ "dev": true
+ },
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
@@ -4360,30 +9022,25 @@
"dev": true
},
"path-parse": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
- "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
+ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"dev": true
},
"path-type": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
- "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "pify": "^3.0.0"
}
},
- "pause-stream": {
- "version": "0.0.11",
- "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
- "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
- "dev": true,
- "requires": {
- "through": "2.3.8"
- }
+ "pathval": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
+ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
+ "dev": true
},
"pend": {
"version": "1.2.0",
@@ -4391,41 +9048,22 @@
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
"dev": true
},
- "performance-now": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
- "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+ "picomatch": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz",
+ "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==",
"dev": true
},
- "phantomjs-prebuilt": {
- "version": "2.1.16",
- "resolved": "https://registry.npmjs.org/phantomjs-prebuilt/-/phantomjs-prebuilt-2.1.16.tgz",
- "integrity": "sha1-79ISpKOWbTZHaE6ouniFSb4q7+8=",
- "dev": true,
- "requires": {
- "es6-promise": "4.1.1",
- "extract-zip": "1.6.6",
- "fs-extra": "1.0.0",
- "hasha": "2.2.0",
- "kew": "0.7.0",
- "progress": "1.1.8",
- "request": "2.83.0",
- "request-progress": "2.0.1",
- "which": "1.3.0"
- },
- "dependencies": {
- "progress": {
- "version": "1.1.8",
- "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
- "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=",
- "dev": true
- }
- }
+ "pidtree": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz",
+ "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==",
+ "dev": true
},
"pify": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
- "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
},
"pinkie": {
@@ -4440,249 +9078,44 @@
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
"dev": true,
"requires": {
- "pinkie": "2.0.4"
- }
- },
- "pipetteur": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/pipetteur/-/pipetteur-2.0.3.tgz",
- "integrity": "sha1-GVV2CVno0aEcsqUOyD7sRwYz5J8=",
- "dev": true,
- "requires": {
- "onecolor": "3.0.4",
- "synesthesia": "1.0.1"
- }
- },
- "pixrem": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/pixrem/-/pixrem-4.0.1.tgz",
- "integrity": "sha1-LaSh3m7EQjxfw3lOkwuB1EkOxoY=",
- "dev": true,
- "requires": {
- "browserslist": "2.5.0",
- "postcss": "6.0.13",
- "reduce-css-calc": "1.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "pinkie": "^2.0.0"
}
},
"pkg-dir": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
- "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
- "dev": true,
- "requires": {
- "find-up": "1.1.2"
- }
- },
- "pleeease-filters": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/pleeease-filters/-/pleeease-filters-4.0.0.tgz",
- "integrity": "sha1-ZjKy+wVkjSdY2GU4T7zteeHMrsc=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
+ "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
"dev": true,
"requires": {
- "onecolor": "3.0.4",
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "find-up": "^2.1.0"
}
},
- "plur": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz",
- "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=",
+ "please-upgrade-node": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz",
+ "integrity": "sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ==",
"dev": true,
"requires": {
- "irregular-plurals": "1.3.0"
+ "semver-compare": "^1.0.0"
}
},
- "pluralize": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
- "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
+ "posix-character-classes": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
+ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=",
"dev": true
},
"postcss": {
- "version": "5.2.18",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz",
- "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==",
+ "version": "7.0.14",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.14.tgz",
+ "integrity": "sha512-NsbD6XUUMZvBxtQAJuWDJeeC4QFsmWsfozWxCJPWf3M55K9iu2iMDaKqyoOdTJ1R4usBXuxlVFAIo8rZPQD4Bg==",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "js-base64": "2.3.2",
- "source-map": "0.5.7",
- "supports-color": "3.2.3"
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
},
"dependencies": {
- "supports-color": {
- "version": "3.2.3",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
- "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
- "dev": true,
- "requires": {
- "has-flag": "1.0.0"
- }
- }
- }
- },
- "postcss-apply": {
- "version": "0.8.0",
- "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.8.0.tgz",
- "integrity": "sha1-FOVEu7XLbxweBIhXll15rgZrE0M=",
- "dev": true,
- "requires": {
- "babel-runtime": "6.26.0",
- "balanced-match": "0.4.2",
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
- "dev": true
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -4690,1070 +9123,169 @@
"dev": true
},
"supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "has-flag": "^3.0.0"
}
}
}
},
"postcss-attribute-case-insensitive": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-2.0.0.tgz",
- "integrity": "sha1-lNxCLI+QmX8WvTOjZUu77AhJY7Q=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-4.0.1.tgz",
+ "integrity": "sha512-L2YKB3vF4PetdTIthQVeT+7YiSzMoNMLLYxPXXppOOP7NoazEAy45sh2LvJ8leCQjfBcfkYQs8TtCcQjeZTp8A==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-selector-parser": "2.2.3"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2",
+ "postcss-selector-parser": "^5.0.0"
}
},
"postcss-calc": {
- "version": "5.3.1",
- "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz",
- "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-7.0.1.tgz",
+ "integrity": "sha512-oXqx0m6tb4N3JGdmeMSc/i91KppbYsFZKdH0xMOqK8V1rJlzrKlTdokz8ozUXLVejydRN6u2IddxpcijRj2FqQ==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "postcss-message-helpers": "2.0.0",
- "reduce-css-calc": "1.3.0"
+ "css-unit-converter": "^1.1.1",
+ "postcss": "^7.0.5",
+ "postcss-selector-parser": "^5.0.0-rc.4",
+ "postcss-value-parser": "^3.3.1"
}
},
"postcss-cli": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-4.1.1.tgz",
- "integrity": "sha1-uUvY//u3rB9i8mB+ePyTl/f2Ol0=",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "chokidar": "1.7.0",
- "dependency-graph": "0.5.1",
- "fs-extra": "4.0.2",
- "get-stdin": "5.0.1",
- "globby": "6.1.0",
- "ora": "1.3.0",
- "postcss": "6.0.13",
- "postcss-load-config": "1.2.0",
- "postcss-reporter": "5.0.0",
- "pretty-hrtime": "1.0.3",
- "read-cache": "1.0.0",
- "yargs": "8.0.2"
+ "version": "6.1.3",
+ "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-6.1.3.tgz",
+ "integrity": "sha512-eieqJU+OR1OFc/lQqMsDmROTJpoMZFvoAQ+82utBQ8/8qGMTfH9bBSPsTdsagYA8uvNzxHw2I2cNSSJkLAGhvw==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.1.0",
+ "chokidar": "^2.0.0",
+ "dependency-graph": "^0.8.0",
+ "fs-extra": "^7.0.0",
+ "get-stdin": "^6.0.0",
+ "globby": "^9.0.0",
+ "postcss": "^7.0.0",
+ "postcss-load-config": "^2.0.0",
+ "postcss-reporter": "^6.0.0",
+ "pretty-hrtime": "^1.0.3",
+ "read-cache": "^1.0.0",
+ "yargs": "^12.0.1"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "fs-extra": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz",
- "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=",
- "dev": true,
- "requires": {
- "graceful-fs": "4.1.11",
- "jsonfile": "4.0.0",
- "universalify": "0.1.1"
- }
- },
"get-stdin": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz",
- "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=",
- "dev": true
- },
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
- }
- },
- "globby": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
- "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
- "dev": true,
- "requires": {
- "array-union": "1.0.2",
- "glob": "7.1.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "jsonfile": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
- "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
- "dev": true,
- "requires": {
- "graceful-fs": "4.1.11"
- }
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
+ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
"dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
}
}
},
- "postcss-color-function": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-function/-/postcss-color-function-4.0.0.tgz",
- "integrity": "sha1-fgEG9Pah7LGtWzqFU6zl6Ciq4Yc=",
+ "postcss-color-functional-notation": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-color-functional-notation/-/postcss-color-functional-notation-2.0.1.tgz",
+ "integrity": "sha512-ZBARCypjEDofW4P6IdPVTLhDNXPRn8T2s1zHbZidW6rPaaZvcnCS2soYFIQJrMZSxiePJ2XIYTlcb2ztr/eT2g==",
"dev": true,
"requires": {
- "css-color-function": "1.3.3",
- "postcss": "6.0.13",
- "postcss-message-helpers": "2.0.0",
- "postcss-value-parser": "3.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
}
},
"postcss-color-gray": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-gray/-/postcss-color-gray-4.0.0.tgz",
- "integrity": "sha1-aBvzBQl91mv+8OHmKC1dmbWsyV0=",
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-color-gray/-/postcss-color-gray-5.0.0.tgz",
+ "integrity": "sha512-q6BuRnAGKM/ZRpfDascZlIZPjvwsRye7UDNalqVz3s7GDxMtqPY6+Q871liNxsonUw8oC61OG+PSaysYpl1bnw==",
"dev": true,
"requires": {
- "color": "1.0.3",
- "postcss": "6.0.13",
- "postcss-message-helpers": "2.0.0",
- "reduce-function-call": "1.0.2"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "color": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/color/-/color-1.0.3.tgz",
- "integrity": "sha1-5I6DLYXxTvaU+0aIEcLVz+cptV0=",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0",
- "color-string": "1.5.2"
- }
- },
- "color-string": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz",
- "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=",
- "dev": true,
- "requires": {
- "color-name": "1.1.3",
- "simple-swizzle": "0.2.2"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "@csstools/convert-colors": "^1.4.0",
+ "postcss": "^7.0.5",
+ "postcss-values-parser": "^2.0.0"
}
},
"postcss-color-hex-alpha": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-3.0.0.tgz",
- "integrity": "sha1-HlPmyKyyN5Vej9CLfs2xuLgwn5U=",
- "dev": true,
- "requires": {
- "color": "1.0.3",
- "postcss": "6.0.13",
- "postcss-message-helpers": "2.0.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "color": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/color/-/color-1.0.3.tgz",
- "integrity": "sha1-5I6DLYXxTvaU+0aIEcLVz+cptV0=",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0",
- "color-string": "1.5.2"
- }
- },
- "color-string": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz",
- "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=",
- "dev": true,
- "requires": {
- "color-name": "1.1.3",
- "simple-swizzle": "0.2.2"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
- }
- },
- "postcss-color-hsl": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-hsl/-/postcss-color-hsl-2.0.0.tgz",
- "integrity": "sha1-EnA2ZvoxBDDj8wpFTawThjF9WEQ=",
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-5.0.3.tgz",
+ "integrity": "sha512-PF4GDel8q3kkreVXKLAGNpHKilXsZ6xuu+mOQMHWHLPNyjiUBOr75sp5ZKJfmv1MCus5/DWUGcK9hm6qHEnXYw==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0",
- "units-css": "0.4.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.14",
+ "postcss-values-parser": "^2.0.1"
}
},
- "postcss-color-hwb": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-hwb/-/postcss-color-hwb-3.0.0.tgz",
- "integrity": "sha1-NAKxnvTYSXVAwftQcr6YY8qVVx4=",
+ "postcss-color-mod-function": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-color-mod-function/-/postcss-color-mod-function-3.0.3.tgz",
+ "integrity": "sha512-YP4VG+xufxaVtzV6ZmhEtc+/aTXH3d0JLpnYfxqTvwZPbJhWqp8bSY3nfNzNRFLgB4XSaBA82OE4VjOOKpCdVQ==",
"dev": true,
"requires": {
- "color": "1.0.3",
- "postcss": "6.0.13",
- "postcss-message-helpers": "2.0.0",
- "reduce-function-call": "1.0.2"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "color": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/color/-/color-1.0.3.tgz",
- "integrity": "sha1-5I6DLYXxTvaU+0aIEcLVz+cptV0=",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0",
- "color-string": "1.5.2"
- }
- },
- "color-string": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz",
- "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=",
- "dev": true,
- "requires": {
- "color-name": "1.1.3",
- "simple-swizzle": "0.2.2"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "@csstools/convert-colors": "^1.4.0",
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
}
},
"postcss-color-rebeccapurple": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-3.0.0.tgz",
- "integrity": "sha1-7rrwPTY7QwC5Z5K9MIHBntZlE9M=",
- "dev": true,
- "requires": {
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
- }
- },
- "postcss-color-rgb": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-rgb/-/postcss-color-rgb-2.0.0.tgz",
- "integrity": "sha1-FFOcinExSUtILg3RzCZf9lFLUmM=",
- "dev": true,
- "requires": {
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
- }
- },
- "postcss-color-rgba-fallback": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-color-rgba-fallback/-/postcss-color-rgba-fallback-3.0.0.tgz",
- "integrity": "sha1-N9XJNToHoJJwkSqCYGu0Kg1wLAQ=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-4.0.1.tgz",
+ "integrity": "sha512-aAe3OhkS6qJXBbqzvZth2Au4V3KieR5sRQ4ptb2b2O8wgvB3SJBsdG+jsn2BZbbwekDG8nTfcCNKcSfe/lEy8g==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0",
- "rgb-hex": "2.1.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
}
},
"postcss-colormin": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-2.2.2.tgz",
- "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-4.0.3.tgz",
+ "integrity": "sha512-WyQFAdDZpExQh32j0U0feWisZ0dmOtPl44qYmJKkq9xFWY3p+4qnRzCHeNrkeRhwPHz9bQ3mo0/yVkaply0MNw==",
"dev": true,
"requires": {
- "colormin": "1.1.2",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "browserslist": "^4.0.0",
+ "color": "^3.0.0",
+ "has": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-convert-values": {
- "version": "2.6.1",
- "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz",
- "integrity": "sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz",
+ "integrity": "sha512-Kisdo1y77KUC0Jmn0OXU/COOJbzM8cImvw1ZFsBgBgMgb1iL23Zs/LXRe3r+EZqM3vGYKdQ2YJVQ5VkJI+zEJQ==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
- }
- },
- "postcss-cssnext": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/postcss-cssnext/-/postcss-cssnext-3.0.2.tgz",
- "integrity": "sha512-jA6kGdcUMZqLUgw6MdpyNWGFhk0LIITVhC/jTnLRZLoXSTR88qT2cFOn3LbY06udt1PVdTCHDG3plBjxVKf8BQ==",
- "dev": true,
- "requires": {
- "autoprefixer": "7.1.5",
- "caniuse-api": "2.0.0",
- "chalk": "2.1.0",
- "pixrem": "4.0.1",
- "pleeease-filters": "4.0.0",
- "postcss": "6.0.13",
- "postcss-apply": "0.8.0",
- "postcss-attribute-case-insensitive": "2.0.0",
- "postcss-calc": "6.0.0",
- "postcss-color-function": "4.0.0",
- "postcss-color-gray": "4.0.0",
- "postcss-color-hex-alpha": "3.0.0",
- "postcss-color-hsl": "2.0.0",
- "postcss-color-hwb": "3.0.0",
- "postcss-color-rebeccapurple": "3.0.0",
- "postcss-color-rgb": "2.0.0",
- "postcss-color-rgba-fallback": "3.0.0",
- "postcss-custom-media": "6.0.0",
- "postcss-custom-properties": "6.2.0",
- "postcss-custom-selectors": "4.0.1",
- "postcss-font-family-system-ui": "2.0.1",
- "postcss-font-variant": "3.0.0",
- "postcss-image-set-polyfill": "0.3.5",
- "postcss-initial": "2.0.0",
- "postcss-media-minmax": "3.0.0",
- "postcss-nesting": "4.2.1",
- "postcss-pseudo-class-any-link": "4.0.0",
- "postcss-pseudoelements": "5.0.0",
- "postcss-replace-overflow-wrap": "2.0.0",
- "postcss-selector-matches": "3.0.1",
- "postcss-selector-not": "3.0.1"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "autoprefixer": {
- "version": "7.1.5",
- "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.1.5.tgz",
- "integrity": "sha512-sMN453qIm8Z+tunzYWW+Y490wWkICHhCYm/VohLjjl+N7ARSFuF5au7E6tr7oEbeeXj8mNjpSw2kxjJaO6YCOw==",
- "dev": true,
- "requires": {
- "browserslist": "2.5.0",
- "caniuse-lite": "1.0.30000744",
- "normalize-range": "0.1.2",
- "num2fraction": "1.2.2",
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0"
- }
- },
- "caniuse-api": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-2.0.0.tgz",
- "integrity": "sha1-sd21pZZrFvSNxJmERNS7xsfZ2DQ=",
- "dev": true,
- "requires": {
- "browserslist": "2.5.0",
- "caniuse-lite": "1.0.30000744",
- "lodash.memoize": "4.1.2",
- "lodash.uniq": "4.5.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "postcss-calc": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-6.0.0.tgz",
- "integrity": "sha1-toGyecbST74OM+2QRYA3BURdYTs=",
- "dev": true,
- "requires": {
- "css-unit-converter": "1.1.1",
- "postcss": "6.0.13",
- "postcss-selector-parser": "2.2.3",
- "reduce-css-calc": "2.0.5"
- }
- },
- "reduce-css-calc": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-2.0.5.tgz",
- "integrity": "sha1-M8l4OMXUxxGlwU74XOT95BSD970=",
- "dev": true,
- "requires": {
- "css-unit-converter": "1.1.1",
- "postcss-value-parser": "3.3.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-custom-media": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-6.0.0.tgz",
- "integrity": "sha1-vlMnhBEOyylQRPtTlaGABushpzc=",
+ "version": "7.0.8",
+ "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-7.0.8.tgz",
+ "integrity": "sha512-c9s5iX0Ge15o00HKbuRuTqNndsJUbaXdiNsksnVH8H4gdc+zbLzr/UasOwNG6CTDpLFekVY4672eWdiiWu2GUg==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.14"
}
},
"postcss-custom-properties": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-6.2.0.tgz",
- "integrity": "sha512-eNR2h9T9ciKMoQEORrPjH33XeN/nuvVuxArOKmHtsFbGbNss631tgTrKou3/pmjAZbA4QQkhLIkPQkIk3WW+8w==",
+ "version": "8.0.11",
+ "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-8.0.11.tgz",
+ "integrity": "sha512-nm+o0eLdYqdnJ5abAJeXp4CEU1c1k+eB2yMCvhgzsds/e0umabFrN6HoTy/8Q4K5ilxERdl/JD1LO5ANoYBeMA==",
"dev": true,
"requires": {
- "balanced-match": "1.0.0",
- "postcss": "6.0.13"
+ "postcss": "^7.0.17",
+ "postcss-values-parser": "^2.0.1"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
"postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "version": "7.0.17",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz",
+ "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
}
},
"source-map": {
@@ -5763,262 +9295,126 @@
"dev": true
},
"supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "has-flag": "^3.0.0"
}
}
}
},
"postcss-custom-selectors": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-4.0.1.tgz",
- "integrity": "sha1-eBOC+UxS5yfvXKR3bqKt9JphE4I=",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-5.1.2.tgz",
+ "integrity": "sha512-DSGDhqinCqXqlS4R7KGxL1OSycd1lydugJ1ky4iRXPHdBRiozyMHrdu0H3o7qNOCiZwySZTUI5MV0T8QhCLu+w==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-selector-matches": "3.0.1"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2",
+ "postcss-selector-parser": "^5.0.0-rc.3"
+ }
+ },
+ "postcss-dir-pseudo-class": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-dir-pseudo-class/-/postcss-dir-pseudo-class-5.0.0.tgz",
+ "integrity": "sha512-3pm4oq8HYWMZePJY+5ANriPs3P07q+LW6FAdTlkFH2XqDdP4HeeJYMOzn0HYLhRSjBO3fhiqSwwU9xEULSrPgw==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2",
+ "postcss-selector-parser": "^5.0.0-rc.3"
}
},
"postcss-discard-comments": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz",
- "integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-4.0.2.tgz",
+ "integrity": "sha512-RJutN259iuRf3IW7GZyLM5Sw4GLTOH8FmsXBnv8Ab/Tc2k4SR4qbV4DNbyyY4+Sjo362SyDmW2DQ7lBSChrpkg==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "postcss": "^7.0.0"
}
},
"postcss-discard-duplicates": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz",
- "integrity": "sha1-uavye4isGIFYpesSq8riAmO5GTI=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz",
+ "integrity": "sha512-ZNQfR1gPNAiXZhgENFfEglF93pciw0WxMkJeVmw8eF+JZBbMD7jp6C67GqJAXVZP2BWbOztKfbsdmMp/k8c6oQ==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "postcss": "^7.0.0"
}
},
"postcss-discard-empty": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz",
- "integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz",
+ "integrity": "sha512-B9miTzbznhDjTfjvipfHoqbWKwd0Mj+/fL5s1QOz06wufguil+Xheo4XpOnc4NqKYBCNqqEzgPv2aPBIJLox0w==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "postcss": "^7.0.0"
}
},
"postcss-discard-overridden": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz",
- "integrity": "sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz",
+ "integrity": "sha512-IYY2bEDD7g1XM1IDEsUT4//iEYCxAmP5oDSFMVU/JVvT7gh+l4fmjciLqGgwjdWpQIdb0Che2VX00QObS5+cTg==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "postcss": "^7.0.0"
}
},
- "postcss-discard-unused": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz",
- "integrity": "sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM=",
+ "postcss-double-position-gradients": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-double-position-gradients/-/postcss-double-position-gradients-1.0.0.tgz",
+ "integrity": "sha512-G+nV8EnQq25fOI8CH/B6krEohGWnF5+3A6H/+JEpOncu5dCnkS1QQ6+ct3Jkaepw1NGVqqOZH6lqrm244mCftA==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "uniqs": "2.0.0"
+ "postcss": "^7.0.5",
+ "postcss-values-parser": "^2.0.0"
}
},
- "postcss-filter-plugins": {
+ "postcss-env-function": {
"version": "2.0.2",
- "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz",
- "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=",
+ "resolved": "https://registry.npmjs.org/postcss-env-function/-/postcss-env-function-2.0.2.tgz",
+ "integrity": "sha512-rwac4BuZlITeUbiBq60h/xbLzXY43qOsIErngWa4l7Mt+RaSkT7QBjXVGTcBHupykkblHMDrBFh30zchYPaOUw==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "uniqid": "4.1.1"
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
}
},
- "postcss-font-family-system-ui": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-2.0.1.tgz",
- "integrity": "sha1-MYoHX9y4S4ZKqCOlGTXvClhy6RE=",
+ "postcss-focus-visible": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-focus-visible/-/postcss-focus-visible-4.0.0.tgz",
+ "integrity": "sha512-Z5CkWBw0+idJHSV6+Bgf2peDOFf/x4o+vX/pwcNYrWpXFrSfTkQ3JQ1ojrq9yS+upnAlNRHeg8uEwFTgorjI8g==",
"dev": true,
"requires": {
- "lodash": "4.17.4",
- "postcss": "6.0.13",
- "postcss-value-parser": "3.3.0"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2"
}
},
- "postcss-font-variant": {
+ "postcss-focus-within": {
"version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-3.0.0.tgz",
- "integrity": "sha1-CMzIj2BQuoLtjvLMdsDGprQfGD4=",
+ "resolved": "https://registry.npmjs.org/postcss-focus-within/-/postcss-focus-within-3.0.0.tgz",
+ "integrity": "sha512-W0APui8jQeBKbCGZudW37EeMCjDeVxKgiYfIIEo8Bdh5SpB9sxds/Iq8SEuzS0Q4YFOlG7EPFulbbxujpkrV2w==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2"
+ }
+ },
+ "postcss-font-variant": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-4.0.0.tgz",
+ "integrity": "sha512-M8BFYKOvCrI2aITzDad7kWuXXTm0YhGdP9Q8HanmN4EF1Hmcgs1KK5rSHylt/lUJe8yLxiSwWAHdScoEiIxztg==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2"
+ }
+ },
+ "postcss-gap-properties": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-gap-properties/-/postcss-gap-properties-2.0.0.tgz",
+ "integrity": "sha512-QZSqDaMgXCHuHTEzMsS2KfVDOq7ZFiknSpkrPJY6jmxbugUPTuSzs/vuE5I3zv0WAS+3vhrlqhijiprnuQfzmg==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2"
}
},
"postcss-header": {
@@ -6027,45 +9423,19 @@
"integrity": "sha512-YUcU2oHQNsNVUDPdQg6/TXBWvI7dBGf2bsLQdVlLiLM5kiGLGCcszYDlVTaicmXpKANdS1T7bxpJtCacrMButw==",
"dev": true,
"requires": {
- "babel-register": "6.26.0",
- "postcss": "6.0.13"
+ "babel-register": "^6.26.0",
+ "postcss": "^6.0.13"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
"postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "version": "6.0.23",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz",
+ "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
+ "chalk": "^2.4.1",
+ "source-map": "^0.6.1",
+ "supports-color": "^5.4.0"
}
},
"source-map": {
@@ -6073,248 +9443,115 @@
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
}
}
},
- "postcss-image-set-polyfill": {
- "version": "0.3.5",
- "resolved": "https://registry.npmjs.org/postcss-image-set-polyfill/-/postcss-image-set-polyfill-0.3.5.tgz",
- "integrity": "sha1-Dxk0E3AM8fgr05Bm7wFtZaShgYE=",
+ "postcss-html": {
+ "version": "0.36.0",
+ "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.36.0.tgz",
+ "integrity": "sha512-HeiOxGcuwID0AFsNAL0ox3mW6MHH5cstWN1Z3Y+n6H+g12ih7LHdYxWwEA/QmrebctLjo79xz9ouK3MroHwOJw==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-media-query-parser": "0.2.3"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "htmlparser2": "^3.10.0"
+ }
+ },
+ "postcss-image-set-function": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-image-set-function/-/postcss-image-set-function-3.0.1.tgz",
+ "integrity": "sha512-oPTcFFip5LZy8Y/whto91L9xdRHCWEMs3e1MdJxhgt4jy2WYXfhkng59fH5qLXSCPN8k4n94p1Czrfe5IOkKUw==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
+ }
+ },
+ "postcss-import": {
+ "version": "12.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-12.0.1.tgz",
+ "integrity": "sha512-3Gti33dmCjyKBgimqGxL3vcV8w9+bsHwO5UrBawp796+jdardbcFl4RP5w/76BwNL7aGzpKstIfF9I+kdE8pTw==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.1",
+ "postcss-value-parser": "^3.2.3",
+ "read-cache": "^1.0.0",
+ "resolve": "^1.1.7"
}
},
"postcss-initial": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-2.0.0.tgz",
- "integrity": "sha1-cnFfczbgu3k1HZnuZcSiU6hEG6Q=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-3.0.0.tgz",
+ "integrity": "sha512-WzrqZ5nG9R9fUtrA+we92R4jhVvEB32IIRTzfIG/PLL8UV4CvbF1ugTEHEFX6vWxl41Xt5RTCJPEZkuWzrOM+Q==",
"dev": true,
"requires": {
- "lodash.template": "4.4.0",
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "lodash.template": "^4.2.4",
+ "postcss": "^7.0.2"
+ }
+ },
+ "postcss-jsx": {
+ "version": "0.36.3",
+ "resolved": "https://registry.npmjs.org/postcss-jsx/-/postcss-jsx-0.36.3.tgz",
+ "integrity": "sha512-yV8Ndo6KzU8eho5mCn7LoLUGPkXrRXRjhMpX4AaYJ9wLJPv099xbtpbRQ8FrPnzVxb/cuMebbPR7LweSt+hTfA==",
+ "dev": true,
+ "requires": {
+ "@babel/core": ">=7.2.2"
+ }
+ },
+ "postcss-lab-function": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-lab-function/-/postcss-lab-function-2.0.1.tgz",
+ "integrity": "sha512-whLy1IeZKY+3fYdqQFuDBf8Auw+qFuVnChWjmxm/UhHWqNHZx+B99EwxTvGYmUBqe3Fjxs4L1BoZTJmPu6usVg==",
+ "dev": true,
+ "requires": {
+ "@csstools/convert-colors": "^1.4.0",
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
}
},
"postcss-less": {
- "version": "0.14.0",
- "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-0.14.0.tgz",
- "integrity": "sha1-xjGwicbM5CK5oQ86lY0r7dOBkyQ=",
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-3.1.4.tgz",
+ "integrity": "sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "postcss": "^7.0.14"
}
},
"postcss-load-config": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-1.2.0.tgz",
- "integrity": "sha1-U56a/J3chiASHr+djDZz4M5Q0oo=",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-2.1.0.tgz",
+ "integrity": "sha512-4pV3JJVPLd5+RueiVVB+gFOAa7GWc25XQcMp86Zexzke69mKf6Nx9LRcQywdz7yZI9n1udOxmLuAwTBypypF8Q==",
"dev": true,
"requires": {
- "cosmiconfig": "2.2.2",
- "object-assign": "4.1.1",
- "postcss-load-options": "1.2.0",
- "postcss-load-plugins": "2.3.0"
+ "cosmiconfig": "^5.0.0",
+ "import-cwd": "^2.0.0"
}
},
- "postcss-load-options": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/postcss-load-options/-/postcss-load-options-1.2.0.tgz",
- "integrity": "sha1-sJixVZ3awt8EvAuzdfmaXP4rbYw=",
+ "postcss-logical": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-logical/-/postcss-logical-3.0.0.tgz",
+ "integrity": "sha512-1SUKdJc2vuMOmeItqGuNaC+N8MzBWFWEkAnRnLpFYj1tGGa7NqyVBujfRtgNa2gXR+6RkGUiB2O5Vmh7E2RmiA==",
"dev": true,
"requires": {
- "cosmiconfig": "2.2.2",
- "object-assign": "4.1.1"
+ "postcss": "^7.0.2"
}
},
- "postcss-load-plugins": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz",
- "integrity": "sha1-dFdoEWWZrKLwCfrUJrABdQSdjZI=",
+ "postcss-markdown": {
+ "version": "0.36.0",
+ "resolved": "https://registry.npmjs.org/postcss-markdown/-/postcss-markdown-0.36.0.tgz",
+ "integrity": "sha512-rl7fs1r/LNSB2bWRhyZ+lM/0bwKv9fhl38/06gF6mKMo/NPnp55+K1dSTosSVjFZc0e1ppBlu+WT91ba0PMBfQ==",
"dev": true,
"requires": {
- "cosmiconfig": "2.2.2",
- "object-assign": "4.1.1"
+ "remark": "^10.0.1",
+ "unist-util-find-all-after": "^1.0.2"
}
},
"postcss-media-minmax": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-3.0.0.tgz",
- "integrity": "sha1-Z1JWA3pD70C8Twdgv9BtTcadSNI=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-4.0.0.tgz",
+ "integrity": "sha512-fo9moya6qyxsjbFAYl97qKO9gyre3qvbMnkOZeZwlsW6XYFsvs2DMGDlchVLfAd8LHPZDxivu/+qW2SMQeTHBw==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2"
}
},
"postcss-media-query-parser": {
@@ -6323,304 +9560,357 @@
"integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=",
"dev": true
},
- "postcss-merge-idents": {
- "version": "2.1.7",
- "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz",
- "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=",
- "dev": true,
- "requires": {
- "has": "1.0.1",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
- }
- },
"postcss-merge-longhand": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz",
- "integrity": "sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg=",
+ "version": "4.0.11",
+ "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-4.0.11.tgz",
+ "integrity": "sha512-alx/zmoeXvJjp7L4mxEMjh8lxVlDFX1gqWHzaaQewwMZiVhLo42TEClKaeHbRf6J7j82ZOdTJ808RtN0ZOZwvw==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "css-color-names": "0.0.4",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0",
+ "stylehacks": "^4.0.0"
}
},
"postcss-merge-rules": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz",
- "integrity": "sha1-0d9d+qexrMO+VT8OnhDofGG19yE=",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-4.0.3.tgz",
+ "integrity": "sha512-U7e3r1SbvYzO0Jr3UT/zKBVgYYyhAz0aitvGIYOYK5CPmkNih+WDSsS5tvPrJ8YMQYlEMvsZIiqmn7HdFUaeEQ==",
"dev": true,
"requires": {
- "browserslist": "1.7.7",
- "caniuse-api": "1.6.1",
- "postcss": "5.2.18",
- "postcss-selector-parser": "2.2.3",
- "vendors": "1.0.1"
+ "browserslist": "^4.0.0",
+ "caniuse-api": "^3.0.0",
+ "cssnano-util-same-parent": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-selector-parser": "^3.0.0",
+ "vendors": "^1.0.0"
},
"dependencies": {
- "browserslist": {
- "version": "1.7.7",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
- "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
+ "dot-prop": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
+ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
- "caniuse-db": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
+ "is-obj": "^1.0.0"
+ }
+ },
+ "postcss-selector-parser": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz",
+ "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=",
+ "dev": true,
+ "requires": {
+ "dot-prop": "^4.1.1",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
}
}
}
},
- "postcss-message-helpers": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz",
- "integrity": "sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4=",
- "dev": true
- },
"postcss-minify-font-values": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz",
- "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz",
+ "integrity": "sha512-j85oO6OnRU9zPf04+PZv1LYIYOprWm6IA6zkXkrJXyRveDEuQggG6tvoy8ir8ZwjLxLuGfNkCZEQG7zan+Hbtg==",
"dev": true,
"requires": {
- "object-assign": "4.1.1",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-minify-gradients": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz",
- "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-4.0.2.tgz",
+ "integrity": "sha512-qKPfwlONdcf/AndP1U8SJ/uzIJtowHlMaSioKzebAXSG4iJthlWC9iSWznQcX4f66gIWX44RSA841HTHj3wK+Q==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "cssnano-util-get-arguments": "^4.0.0",
+ "is-color-stop": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-minify-params": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz",
- "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-4.0.2.tgz",
+ "integrity": "sha512-G7eWyzEx0xL4/wiBBJxJOz48zAKV2WG3iZOqVhPet/9geefm/Px5uo1fzlHu+DOjT+m0Mmiz3jkQzVHe6wxAWg==",
"dev": true,
"requires": {
- "alphanum-sort": "1.0.2",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0",
- "uniqs": "2.0.0"
+ "alphanum-sort": "^1.0.0",
+ "browserslist": "^4.0.0",
+ "cssnano-util-get-arguments": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0",
+ "uniqs": "^2.0.0"
}
},
"postcss-minify-selectors": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz",
- "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=",
- "dev": true,
- "requires": {
- "alphanum-sort": "1.0.2",
- "has": "1.0.1",
- "postcss": "5.2.18",
- "postcss-selector-parser": "2.2.3"
- }
- },
- "postcss-nesting": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-4.2.1.tgz",
- "integrity": "sha512-IkyWXICwagCnlaviRexi7qOdwPw3+xVVjgFfGsxmztvRVaNxAlrypOIKqDE5mxY+BVxnId1rnUKBRQoNE2VDaA==",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-4.0.2.tgz",
+ "integrity": "sha512-D5S1iViljXBj9kflQo4YutWnJmwm8VvIsU1GeXJGiG9j8CIg9zs4voPMdQDUmIxetUOh60VilsNzCiAFTOqu3g==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
+ "alphanum-sort": "^1.0.0",
+ "has": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-selector-parser": "^3.0.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
+ "dot-prop": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
+ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
+ "is-obj": "^1.0.0"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "postcss-selector-parser": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz",
+ "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
+ "dot-prop": "^4.1.1",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
}
}
}
},
+ "postcss-nesting": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-7.0.0.tgz",
+ "integrity": "sha512-WSsbVd5Ampi3Y0nk/SKr5+K34n52PqMqEfswu6RtU4r7wA8vSD+gM8/D9qq4aJkHImwn1+9iEFTbjoWsQeqtaQ==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2"
+ }
+ },
"postcss-normalize-charset": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz",
- "integrity": "sha1-757nEhLX/nWceO0WL2HtYrXLk/E=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz",
+ "integrity": "sha512-gMXCrrlWh6G27U0hF3vNvR3w8I1s2wOBILvA87iNXaPvSNo5uZAMYsZG7XjCUf1eVxuPfyL4TJ7++SGZLc9A3g==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.0"
+ }
+ },
+ "postcss-normalize-display-values": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-4.0.2.tgz",
+ "integrity": "sha512-3F2jcsaMW7+VtRMAqf/3m4cPFhPD3EFRgNs18u+k3lTJJlVe7d0YPO+bnwqo2xg8YiRpDXJI2u8A0wqJxMsQuQ==",
+ "dev": true,
+ "requires": {
+ "cssnano-util-get-match": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-positions": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-4.0.2.tgz",
+ "integrity": "sha512-Dlf3/9AxpxE+NF1fJxYDeggi5WwV35MXGFnnoccP/9qDtFrTArZ0D0R+iKcg5WsUd8nUYMIl8yXDCtcrT8JrdA==",
+ "dev": true,
+ "requires": {
+ "cssnano-util-get-arguments": "^4.0.0",
+ "has": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-repeat-style": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-4.0.2.tgz",
+ "integrity": "sha512-qvigdYYMpSuoFs3Is/f5nHdRLJN/ITA7huIoCyqqENJe9PvPmLhNLMu7QTjPdtnVf6OcYYO5SHonx4+fbJE1+Q==",
+ "dev": true,
+ "requires": {
+ "cssnano-util-get-arguments": "^4.0.0",
+ "cssnano-util-get-match": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-string": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-4.0.2.tgz",
+ "integrity": "sha512-RrERod97Dnwqq49WNz8qo66ps0swYZDSb6rM57kN2J+aoyEAJfZ6bMx0sx/F9TIEX0xthPGCmeyiam/jXif0eA==",
+ "dev": true,
+ "requires": {
+ "has": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-timing-functions": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-4.0.2.tgz",
+ "integrity": "sha512-acwJY95edP762e++00Ehq9L4sZCEcOPyaHwoaFOhIwWCDfik6YvqsYNxckee65JHLKzuNSSmAdxwD2Cud1Z54A==",
+ "dev": true,
+ "requires": {
+ "cssnano-util-get-match": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-unicode": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-4.0.1.tgz",
+ "integrity": "sha512-od18Uq2wCYn+vZ/qCOeutvHjB5jm57ToxRaMeNuf0nWVHaP9Hua56QyMF6fs/4FSUnVIw0CBPsU0K4LnBPwYwg==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "browserslist": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-normalize-url": {
- "version": "3.0.8",
- "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz",
- "integrity": "sha1-EI90s/L82viRov+j6kWSJ5/HgiI=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz",
+ "integrity": "sha512-p5oVaF4+IHwu7VpMan/SSpmpYxcJMtkGppYf0VbdH5B6hN8YNmVyJLuY9FmLQTzY3fag5ESUUHDqM+heid0UVA==",
"dev": true,
"requires": {
- "is-absolute-url": "2.1.0",
- "normalize-url": "1.9.1",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "is-absolute-url": "^2.0.0",
+ "normalize-url": "^3.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
+ }
+ },
+ "postcss-normalize-whitespace": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-4.0.2.tgz",
+ "integrity": "sha512-tO8QIgrsI3p95r8fyqKV+ufKlSHh9hMJqACqbv2XknufqEDhDvbguXGBBqxw9nsQoXWf0qOqppziKJKHMD4GtA==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-ordered-values": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz",
- "integrity": "sha1-7sbCpntsQSqNsgQud/6NpD+VwR0=",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz",
+ "integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "cssnano-util-get-arguments": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
- "postcss-pseudo-class-any-link": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-4.0.0.tgz",
- "integrity": "sha1-kVKgYT00UHIFE+iJKFS65C0O5o4=",
+ "postcss-overflow-shorthand": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz",
+ "integrity": "sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g==",
"dev": true,
"requires": {
- "postcss": "6.0.13",
- "postcss-selector-parser": "2.2.3"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2"
}
},
- "postcss-pseudoelements": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/postcss-pseudoelements/-/postcss-pseudoelements-5.0.0.tgz",
- "integrity": "sha1-7vGU6NUkZFylIKlJ6V5RjoEkAss=",
+ "postcss-page-break": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-2.0.0.tgz",
+ "integrity": "sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
+ "postcss": "^7.0.2"
+ }
+ },
+ "postcss-place": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-place/-/postcss-place-4.0.1.tgz",
+ "integrity": "sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.2",
+ "postcss-values-parser": "^2.0.0"
+ }
+ },
+ "postcss-preset-env": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-6.7.0.tgz",
+ "integrity": "sha512-eU4/K5xzSFwUFJ8hTdTQzo2RBLbDVt83QZrAvI07TULOkmyQlnYlpwep+2yIK+K+0KlZO4BvFcleOCCcUtwchg==",
+ "dev": true,
+ "requires": {
+ "autoprefixer": "^9.6.1",
+ "browserslist": "^4.6.4",
+ "caniuse-lite": "^1.0.30000981",
+ "css-blank-pseudo": "^0.1.4",
+ "css-has-pseudo": "^0.10.0",
+ "css-prefers-color-scheme": "^3.1.1",
+ "cssdb": "^4.4.0",
+ "postcss": "^7.0.17",
+ "postcss-attribute-case-insensitive": "^4.0.1",
+ "postcss-color-functional-notation": "^2.0.1",
+ "postcss-color-gray": "^5.0.0",
+ "postcss-color-hex-alpha": "^5.0.3",
+ "postcss-color-mod-function": "^3.0.3",
+ "postcss-color-rebeccapurple": "^4.0.1",
+ "postcss-custom-media": "^7.0.8",
+ "postcss-custom-properties": "^8.0.11",
+ "postcss-custom-selectors": "^5.1.2",
+ "postcss-dir-pseudo-class": "^5.0.0",
+ "postcss-double-position-gradients": "^1.0.0",
+ "postcss-env-function": "^2.0.2",
+ "postcss-focus-visible": "^4.0.0",
+ "postcss-focus-within": "^3.0.0",
+ "postcss-font-variant": "^4.0.0",
+ "postcss-gap-properties": "^2.0.0",
+ "postcss-image-set-function": "^3.0.1",
+ "postcss-initial": "^3.0.0",
+ "postcss-lab-function": "^2.0.1",
+ "postcss-logical": "^3.0.0",
+ "postcss-media-minmax": "^4.0.0",
+ "postcss-nesting": "^7.0.0",
+ "postcss-overflow-shorthand": "^2.0.0",
+ "postcss-page-break": "^2.0.0",
+ "postcss-place": "^4.0.1",
+ "postcss-pseudo-class-any-link": "^6.0.0",
+ "postcss-replace-overflow-wrap": "^3.0.0",
+ "postcss-selector-matches": "^4.0.0",
+ "postcss-selector-not": "^4.0.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+ "browserslist": {
+ "version": "4.6.4",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.4.tgz",
+ "integrity": "sha512-ErJT8qGfRt/VWHSr1HeqZzz50DvxHtr1fVL1m5wf20aGrG8e1ce8fpZ2EjZEfs09DDZYSvtRaDlMpWslBf8Low==",
"dev": true,
"requires": {
- "color-convert": "1.9.0"
+ "caniuse-lite": "^1.0.30000981",
+ "electron-to-chromium": "^1.3.188",
+ "node-releases": "^1.1.25"
}
},
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
+ "caniuse-lite": {
+ "version": "1.0.30000983",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000983.tgz",
+ "integrity": "sha512-/llD1bZ6qwNkt41AsvjsmwNOoA4ZB+8iqmf5LVyeSXuBODT/hAMFNVOh84NdUzoiYiSKqo5vQ3ZzeYHSi/olDQ==",
+ "dev": true
+ },
+ "electron-to-chromium": {
+ "version": "1.3.188",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.188.tgz",
+ "integrity": "sha512-tEQcughYIMj8WDMc59EGEtNxdGgwal/oLLTDw+NEqJRJwGflQvH3aiyiexrWeZOETP4/ko78PVr6gwNhdozvuQ==",
+ "dev": true
+ },
+ "node-releases": {
+ "version": "1.1.25",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.25.tgz",
+ "integrity": "sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
+ "semver": "^5.3.0"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
"postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "version": "7.0.17",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.17.tgz",
+ "integrity": "sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
}
},
"source-map": {
@@ -6630,182 +9920,69 @@
"dev": true
},
"supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "has-flag": "^3.0.0"
}
}
}
},
- "postcss-reduce-idents": {
- "version": "2.4.0",
- "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz",
- "integrity": "sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM=",
+ "postcss-pseudo-class-any-link": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-6.0.0.tgz",
+ "integrity": "sha512-lgXW9sYJdLqtmw23otOzrtbDXofUdfYzNm4PIpNE322/swES3VU9XlXHeJS46zT2onFO7V1QFdD4Q9LiZj8mew==",
"dev": true,
"requires": {
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "postcss": "^7.0.2",
+ "postcss-selector-parser": "^5.0.0-rc.3"
}
},
"postcss-reduce-initial": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz",
- "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-4.0.3.tgz",
+ "integrity": "sha512-gKWmR5aUulSjbzOfD9AlJiHCGH6AEVLaM0AV+aSioxUDd16qXP1PCh8d1/BGVvpdWn8k/HiK7n6TjeoXN1F7DA==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "browserslist": "^4.0.0",
+ "caniuse-api": "^3.0.0",
+ "has": "^1.0.0",
+ "postcss": "^7.0.0"
}
},
"postcss-reduce-transforms": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz",
- "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.2.tgz",
+ "integrity": "sha512-EEVig1Q2QJ4ELpJXMZR8Vt5DQx8/mo+dGWSR7vWXqcob2gQLyQGsionYcGKATXvQzMPn6DSN1vTN7yFximdIAg==",
"dev": true,
"requires": {
- "has": "1.0.1",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0"
+ "cssnano-util-get-match": "^4.0.0",
+ "has": "^1.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0"
}
},
"postcss-replace-overflow-wrap": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-2.0.0.tgz",
- "integrity": "sha1-eU22+qVPjbEAhUOSqTr0V2i04ls=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-3.0.0.tgz",
+ "integrity": "sha512-2T5hcEHArDT6X9+9dVSPQdo7QHzG4XKclFT8rU5TzJPDN7RIRTbO9c4drUISOVemLj03aezStHCR2AIcr8XLpw==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.2"
}
},
"postcss-reporter": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-5.0.0.tgz",
- "integrity": "sha512-rBkDbaHAu5uywbCR2XE8a25tats3xSOsGNx6mppK6Q9kSFGKc/FyAzfci+fWM2l+K402p1D0pNcfDGxeje5IKg==",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz",
+ "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "lodash": "4.17.4",
- "log-symbols": "2.1.0",
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "log-symbols": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz",
- "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0"
- }
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "chalk": "^2.4.1",
+ "lodash": "^4.17.11",
+ "log-symbols": "^2.2.0",
+ "postcss": "^7.0.7"
}
},
"postcss-resolve-nested-selector": {
@@ -6814,190 +9991,84 @@
"integrity": "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4=",
"dev": true
},
+ "postcss-safe-parser": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz",
+ "integrity": "sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ==",
+ "dev": true,
+ "requires": {
+ "postcss": "^7.0.0"
+ }
+ },
+ "postcss-sass": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.4.1.tgz",
+ "integrity": "sha512-YDdykeDHylqiD2CdXuP7K1aDz7hCflGVB6H6lqabWVab5mVOWhguUuWZYpFU22/E12AEGiMlOfZnLqr343zhVA==",
+ "dev": true,
+ "requires": {
+ "gonzales-pe": "^4.2.4",
+ "postcss": "^7.0.14"
+ }
+ },
"postcss-scss": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-1.0.2.tgz",
- "integrity": "sha1-/0XPM1S4ee6JpOtoaA9GrJuxT5Q=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.0.0.tgz",
+ "integrity": "sha512-um9zdGKaDZirMm+kZFKKVsnKPF7zF7qBAtIfTSnZXD1jZ0JNZIxdB6TxQOjCnlSzLRInVl2v3YdBh/M881C4ug==",
"dev": true,
"requires": {
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "postcss": "^7.0.0"
}
},
"postcss-selector-matches": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/postcss-selector-matches/-/postcss-selector-matches-3.0.1.tgz",
- "integrity": "sha1-5WNAEeE5UIgYYbvdWMLQER/8lqs=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-matches/-/postcss-selector-matches-4.0.0.tgz",
+ "integrity": "sha512-LgsHwQR/EsRYSqlwdGzeaPKVT0Ml7LAT6E75T8W8xLJY62CE4S/l03BWIt3jT8Taq22kXP08s2SfTSzaraoPww==",
"dev": true,
"requires": {
- "balanced-match": "0.4.2",
- "postcss": "6.0.13"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
- "dev": true
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
- "dev": true,
- "requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "balanced-match": "^1.0.0",
+ "postcss": "^7.0.2"
}
},
"postcss-selector-not": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/postcss-selector-not/-/postcss-selector-not-3.0.1.tgz",
- "integrity": "sha1-Lk2y8JZTNsAefOx9tsYN/3ZzNdk=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-not/-/postcss-selector-not-4.0.0.tgz",
+ "integrity": "sha512-W+bkBZRhqJaYN8XAnbbZPLWMvZD1wKTu0UxtFKdhtGjWYmxhkUneoeOhRJKdAE5V7ZTlnbHfCR+6bNwK9e1dTQ==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "postcss": "^7.0.2"
+ }
+ },
+ "postcss-selector-parser": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz",
+ "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==",
+ "dev": true,
+ "requires": {
+ "cssesc": "^2.0.0",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
+ }
+ },
+ "postcss-sorting": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-sorting/-/postcss-sorting-5.0.1.tgz",
+ "integrity": "sha512-Y9fUFkIhfrm6i0Ta3n+89j56EFqaNRdUKqXyRp6kvTcSXnmgEjaVowCXH+JBe9+YKWqd4nc28r2sgwnzJalccA==",
"dev": true,
"requires": {
- "balanced-match": "0.4.2",
- "postcss": "6.0.13"
+ "lodash": "^4.17.14",
+ "postcss": "^7.0.17"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
- "dev": true
- },
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
"postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "version": "7.0.18",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.18.tgz",
+ "integrity": "sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
}
},
"source-map": {
@@ -7007,142 +10078,73 @@
"dev": true
},
"supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "has-flag": "^3.0.0"
}
}
}
},
- "postcss-selector-parser": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz",
- "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=",
- "dev": true,
- "requires": {
- "flatten": "1.0.2",
- "indexes-of": "1.0.1",
- "uniq": "1.0.1"
- }
- },
- "postcss-sorting": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/postcss-sorting/-/postcss-sorting-2.1.0.tgz",
- "integrity": "sha1-MrHpr6kTuyJaatB21QPY+YO7SoI=",
- "dev": true,
- "requires": {
- "lodash": "4.17.4",
- "postcss": "5.2.18"
- }
- },
"postcss-svgo": {
- "version": "2.1.6",
- "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz",
- "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-4.0.2.tgz",
+ "integrity": "sha512-C6wyjo3VwFm0QgBy+Fu7gCYOkCmgmClghO+pjcxvrcBKtiKt0uCF+hvbMO1fyv5BMImRK90SMb+dwUnfbGd+jw==",
"dev": true,
"requires": {
- "is-svg": "2.1.0",
- "postcss": "5.2.18",
- "postcss-value-parser": "3.3.0",
- "svgo": "0.7.2"
+ "is-svg": "^3.0.0",
+ "postcss": "^7.0.0",
+ "postcss-value-parser": "^3.0.0",
+ "svgo": "^1.0.0"
}
},
+ "postcss-syntax": {
+ "version": "0.36.2",
+ "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.36.2.tgz",
+ "integrity": "sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==",
+ "dev": true
+ },
"postcss-unique-selectors": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz",
- "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz",
+ "integrity": "sha512-+JanVaryLo9QwZjKrmJgkI4Fn8SBgRO6WXQBJi7KiAVPlmxikB5Jzc4EvXMT2H0/m0RjrVVm9rGNhZddm/8Spg==",
"dev": true,
"requires": {
- "alphanum-sort": "1.0.2",
- "postcss": "5.2.18",
- "uniqs": "2.0.0"
+ "alphanum-sort": "^1.0.0",
+ "postcss": "^7.0.0",
+ "uniqs": "^2.0.0"
}
},
"postcss-url": {
- "version": "7.3.0",
- "resolved": "https://registry.npmjs.org/postcss-url/-/postcss-url-7.3.0.tgz",
- "integrity": "sha512-VBP6uf6iL3AZra23nkPkOEkS/5azj1xf/toRrjfkolfFEgg9Gyzg9UhJZeIsz12EGKZTNVeGbPa2XtaZm/iZvg==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/postcss-url/-/postcss-url-8.0.0.tgz",
+ "integrity": "sha512-E2cbOQ5aii2zNHh8F6fk1cxls7QVFZjLPSrqvmiza8OuXLzIpErij8BDS5Y3STPfJgpIMNCPEr8JlKQWEoozUw==",
"dev": true,
"requires": {
- "mime": "1.4.1",
- "minimatch": "3.0.4",
- "mkdirp": "0.5.1",
- "postcss": "6.0.14",
- "xxhashjs": "0.2.1"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
- }
- },
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss": {
- "version": "6.0.14",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz",
- "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==",
- "dev": true,
- "requires": {
- "chalk": "2.3.0",
- "source-map": "0.6.1",
- "supports-color": "4.5.0"
- }
- },
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
- "dev": true
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
+ "mime": "^2.3.1",
+ "minimatch": "^3.0.4",
+ "mkdirp": "^0.5.0",
+ "postcss": "^7.0.2",
+ "xxhashjs": "^0.2.1"
}
},
"postcss-value-parser": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz",
- "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
+ "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
"dev": true
},
- "postcss-zindex": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz",
- "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=",
+ "postcss-values-parser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz",
+ "integrity": "sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg==",
"dev": true,
"requires": {
- "has": "1.0.1",
- "postcss": "5.2.18",
- "uniqs": "2.0.0"
+ "flatten": "^1.0.2",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
}
},
"prelude-ls": {
@@ -7151,12 +10153,6 @@
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
"dev": true
},
- "prepend-http": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
- "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
- "dev": true
- },
"preserve": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz",
@@ -7170,31 +10166,34 @@
"dev": true
},
"private": {
- "version": "0.1.7",
- "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
- "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=",
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
+ "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==",
"dev": true
},
"process-nextick-args": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
- "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
+ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true
},
"progress": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
- "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
"dev": true
},
- "ps-tree": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
- "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=",
- "dev": true,
- "requires": {
- "event-stream": "3.3.4"
- }
+ "property-expr": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-1.5.1.tgz",
+ "integrity": "sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g==",
+ "dev": true
+ },
+ "proxy-from-env": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz",
+ "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=",
+ "dev": true
},
"pseudomap": {
"version": "1.0.2",
@@ -7202,99 +10201,108 @@
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
"dev": true
},
+ "pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "dev": true,
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
"punycode": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
- "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
+ "puppeteer": {
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.20.0.tgz",
+ "integrity": "sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ==",
+ "dev": true,
+ "requires": {
+ "debug": "^4.1.0",
+ "extract-zip": "^1.6.6",
+ "https-proxy-agent": "^2.2.1",
+ "mime": "^2.0.3",
+ "progress": "^2.0.1",
+ "proxy-from-env": "^1.0.0",
+ "rimraf": "^2.6.1",
+ "ws": "^6.1.0"
+ },
+ "dependencies": {
+ "ws": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
+ "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
+ "dev": true,
+ "requires": {
+ "async-limiter": "~1.0.0"
+ }
+ }
+ }
+ },
"q": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/q/-/q-1.5.0.tgz",
- "integrity": "sha1-3QG6ydBtMObyGa7LglPunr3DCPE=",
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
+ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=",
"dev": true
},
- "qs": {
- "version": "6.5.1",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
- "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==",
+ "qjobs": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz",
+ "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==",
"dev": true
},
- "query-string": {
- "version": "4.3.4",
- "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz",
- "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=",
- "dev": true,
- "requires": {
- "object-assign": "4.1.1",
- "strict-uri-encode": "1.1.0"
- }
+ "qs": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
+ "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==",
+ "dev": true
},
- "qunit-reporter-junit": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/qunit-reporter-junit/-/qunit-reporter-junit-1.1.1.tgz",
- "integrity": "sha1-7rYiZFeJaZPnlaEZQPGK9q+lebQ=",
+ "quick-lru": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz",
+ "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
"dev": true
},
"randomatic": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz",
- "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
+ "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==",
"dev": true,
"requires": {
- "is-number": "3.0.0",
- "kind-of": "4.0.0"
+ "is-number": "^4.0.0",
+ "kind-of": "^6.0.0",
+ "math-random": "^1.0.1"
},
"dependencies": {
"is-number": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
- "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=",
- "dev": true,
- "requires": {
- "kind-of": "3.2.2"
- },
- "dependencies": {
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.5"
- }
- }
- }
- },
- "kind-of": {
"version": "4.0.0",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
- "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=",
- "dev": true,
- "requires": {
- "is-buffer": "1.1.5"
- }
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
+ "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
+ "dev": true
}
}
},
- "rc": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz",
- "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=",
+ "range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "dev": true
+ },
+ "raw-body": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
+ "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
"dev": true,
"requires": {
- "deep-extend": "0.4.2",
- "ini": "1.3.4",
- "minimist": "1.2.0",
- "strip-json-comments": "2.0.1"
- },
- "dependencies": {
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
- "dev": true
- }
+ "bytes": "3.1.0",
+ "http-errors": "1.7.2",
+ "iconv-lite": "0.4.24",
+ "unpipe": "1.0.0"
}
},
"read-cache": {
@@ -7303,133 +10311,102 @@
"integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=",
"dev": true,
"requires": {
- "pify": "2.3.0"
- }
- },
- "read-file-stdin": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/read-file-stdin/-/read-file-stdin-0.2.1.tgz",
- "integrity": "sha1-JezP86FTtoCa+ssj7hU4fbng7mE=",
- "dev": true,
- "requires": {
- "gather-stream": "1.0.0"
+ "pify": "^2.3.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ }
}
},
"read-pkg": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
- "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+ "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
"requires": {
- "load-json-file": "1.1.0",
- "normalize-package-data": "2.4.0",
- "path-type": "1.1.0"
+ "load-json-file": "^4.0.0",
+ "normalize-package-data": "^2.3.2",
+ "path-type": "^3.0.0"
}
},
"read-pkg-up": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
- "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz",
+ "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=",
"dev": true,
"requires": {
- "find-up": "1.1.2",
- "read-pkg": "1.1.0"
+ "find-up": "^2.0.0",
+ "read-pkg": "^3.0.0"
}
},
"readable-stream": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
- "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
+ "version": "2.3.6",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "isarray": "1.0.0",
- "process-nextick-args": "1.0.7",
- "safe-buffer": "5.1.1",
- "string_decoder": "1.0.3",
- "util-deprecate": "1.0.2"
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
}
},
"readdirp": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz",
- "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=",
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
+ "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "minimatch": "3.0.4",
- "readable-stream": "2.3.3",
- "set-immediate-shim": "1.0.1"
+ "graceful-fs": "^4.1.11",
+ "micromatch": "^3.1.10",
+ "readable-stream": "^2.0.2"
}
},
"redent": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
- "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz",
+ "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=",
"dev": true,
"requires": {
- "indent-string": "2.1.0",
- "strip-indent": "1.0.1"
+ "indent-string": "^3.0.0",
+ "strip-indent": "^2.0.0"
}
},
- "reduce-css-calc": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz",
- "integrity": "sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=",
- "dev": true,
- "requires": {
- "balanced-match": "0.4.2",
- "math-expression-evaluator": "1.2.17",
- "reduce-function-call": "1.0.2"
- },
- "dependencies": {
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
- "dev": true
- }
- }
+ "regenerate": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz",
+ "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==",
+ "dev": true
},
- "reduce-function-call": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/reduce-function-call/-/reduce-function-call-1.0.2.tgz",
- "integrity": "sha1-WiAL+S4ON3UXUv5FsKszD9S2vpk=",
+ "regenerate-unicode-properties": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz",
+ "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==",
"dev": true,
"requires": {
- "balanced-match": "0.4.2"
- },
- "dependencies": {
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
- "dev": true
- }
+ "regenerate": "^1.4.0"
}
},
- "regenerate": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz",
- "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==",
- "dev": true
- },
"regenerator-runtime": {
- "version": "0.11.0",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz",
- "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==",
+ "version": "0.11.1",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
+ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
"dev": true
},
"regenerator-transform": {
- "version": "0.10.1",
- "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz",
- "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==",
+ "version": "0.14.1",
+ "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.1.tgz",
+ "integrity": "sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ==",
"dev": true,
"requires": {
- "babel-runtime": "6.26.0",
- "babel-types": "6.26.0",
- "private": "0.1.7"
+ "private": "^0.1.6"
}
},
"regex-cache": {
@@ -7438,52 +10415,52 @@
"integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==",
"dev": true,
"requires": {
- "is-equal-shallow": "0.1.3"
+ "is-equal-shallow": "^0.1.3"
}
},
- "regexpu-core": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz",
- "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=",
+ "regex-not": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
+ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
"dev": true,
"requires": {
- "regenerate": "1.3.3",
- "regjsgen": "0.2.0",
- "regjsparser": "0.1.5"
+ "extend-shallow": "^3.0.2",
+ "safe-regex": "^1.1.0"
}
},
- "registry-auth-token": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.1.tgz",
- "integrity": "sha1-+w0yie4Nmtosu1KvXf5mywcNMAY=",
- "dev": true,
- "requires": {
- "rc": "1.2.2",
- "safe-buffer": "5.1.1"
- }
+ "regexpp": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
+ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
+ "dev": true
},
- "registry-url": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz",
- "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=",
+ "regexpu-core": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz",
+ "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==",
"dev": true,
"requires": {
- "rc": "1.2.2"
+ "regenerate": "^1.4.0",
+ "regenerate-unicode-properties": "^8.1.0",
+ "regjsgen": "^0.5.0",
+ "regjsparser": "^0.6.0",
+ "unicode-match-property-ecmascript": "^1.0.4",
+ "unicode-match-property-value-ecmascript": "^1.1.0"
}
},
"regjsgen": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
- "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz",
+ "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==",
"dev": true
},
"regjsparser": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz",
- "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=",
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz",
+ "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==",
"dev": true,
"requires": {
- "jsesc": "0.5.0"
+ "jsesc": "~0.5.0"
},
"dependencies": {
"jsesc": {
@@ -7494,6 +10471,62 @@
}
}
},
+ "remark": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/remark/-/remark-10.0.1.tgz",
+ "integrity": "sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ==",
+ "dev": true,
+ "requires": {
+ "remark-parse": "^6.0.0",
+ "remark-stringify": "^6.0.0",
+ "unified": "^7.0.0"
+ }
+ },
+ "remark-parse": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-6.0.3.tgz",
+ "integrity": "sha512-QbDXWN4HfKTUC0hHa4teU463KclLAnwpn/FBn87j9cKYJWWawbiLgMfP2Q4XwhxxuuuOxHlw+pSN0OKuJwyVvg==",
+ "dev": true,
+ "requires": {
+ "collapse-white-space": "^1.0.2",
+ "is-alphabetical": "^1.0.0",
+ "is-decimal": "^1.0.0",
+ "is-whitespace-character": "^1.0.0",
+ "is-word-character": "^1.0.0",
+ "markdown-escapes": "^1.0.0",
+ "parse-entities": "^1.1.0",
+ "repeat-string": "^1.5.4",
+ "state-toggle": "^1.0.0",
+ "trim": "0.0.1",
+ "trim-trailing-lines": "^1.0.0",
+ "unherit": "^1.0.4",
+ "unist-util-remove-position": "^1.0.0",
+ "vfile-location": "^2.0.0",
+ "xtend": "^4.0.1"
+ }
+ },
+ "remark-stringify": {
+ "version": "6.0.4",
+ "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-6.0.4.tgz",
+ "integrity": "sha512-eRWGdEPMVudijE/psbIDNcnJLRVx3xhfuEsTDGgH4GsFF91dVhw5nhmnBppafJ7+NWINW6C7ZwWbi30ImJzqWg==",
+ "dev": true,
+ "requires": {
+ "ccount": "^1.0.0",
+ "is-alphanumeric": "^1.0.0",
+ "is-decimal": "^1.0.0",
+ "is-whitespace-character": "^1.0.0",
+ "longest-streak": "^2.0.1",
+ "markdown-escapes": "^1.0.0",
+ "markdown-table": "^1.1.0",
+ "mdast-util-compact": "^1.0.0",
+ "parse-entities": "^1.0.2",
+ "repeat-string": "^1.5.4",
+ "state-toggle": "^1.0.0",
+ "stringify-entities": "^1.0.1",
+ "unherit": "^1.0.4",
+ "xtend": "^4.0.1"
+ }
+ },
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@@ -7501,9 +10534,9 @@
"dev": true
},
"repeat-element": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz",
- "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=",
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz",
+ "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==",
"dev": true
},
"repeat-string": {
@@ -7518,60 +10551,21 @@
"integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
"dev": true,
"requires": {
- "is-finite": "1.0.2"
- }
- },
- "request": {
- "version": "2.83.0",
- "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz",
- "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==",
- "dev": true,
- "requires": {
- "aws-sign2": "0.7.0",
- "aws4": "1.6.0",
- "caseless": "0.12.0",
- "combined-stream": "1.0.5",
- "extend": "3.0.1",
- "forever-agent": "0.6.1",
- "form-data": "2.3.1",
- "har-validator": "5.0.3",
- "hawk": "6.0.2",
- "http-signature": "1.2.0",
- "is-typedarray": "1.0.0",
- "isstream": "0.1.2",
- "json-stringify-safe": "5.0.1",
- "mime-types": "2.1.17",
- "oauth-sign": "0.8.2",
- "performance-now": "2.1.0",
- "qs": "6.5.1",
- "safe-buffer": "5.1.1",
- "stringstream": "0.0.5",
- "tough-cookie": "2.3.3",
- "tunnel-agent": "0.6.0",
- "uuid": "3.1.0"
- }
- },
- "request-progress": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-2.0.1.tgz",
- "integrity": "sha1-XTa7V5YcZzqlt4jbyBQf3yO0Tgg=",
- "dev": true,
- "requires": {
- "throttleit": "1.0.0"
+ "is-finite": "^1.0.0"
}
},
+ "replace-ext": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
+ "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=",
+ "dev": true
+ },
"require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
"dev": true
},
- "require-from-string": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz",
- "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=",
- "dev": true
- },
"require-main-filename": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
@@ -7584,29 +10578,40 @@
"integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=",
"dev": true
},
- "require-uncached": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
- "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
+ "requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
+ "dev": true
+ },
+ "resolve": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
+ "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
"dev": true,
"requires": {
- "caller-path": "0.1.0",
- "resolve-from": "1.0.1"
+ "path-parse": "^1.0.6"
}
},
- "resolve": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz",
- "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==",
+ "resolve-from": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
+ "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
+ "dev": true
+ },
+ "resolve-global": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz",
+ "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==",
"dev": true,
"requires": {
- "path-parse": "1.0.5"
+ "global-dirs": "^0.1.1"
}
},
- "resolve-from": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
- "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=",
+ "resolve-url": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
+ "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=",
"dev": true
},
"restore-cursor": {
@@ -7615,70 +10620,103 @@
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
"dev": true,
"requires": {
- "onetime": "2.0.1",
- "signal-exit": "3.0.2"
+ "onetime": "^2.0.0",
+ "signal-exit": "^3.0.2"
}
},
- "rgb": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/rgb/-/rgb-0.1.0.tgz",
- "integrity": "sha1-vieykej+/+rBvZlylyG/pA/AN7U=",
+ "ret": {
+ "version": "0.1.15",
+ "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
"dev": true
},
- "rgb-hex": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/rgb-hex/-/rgb-hex-2.1.0.tgz",
- "integrity": "sha1-x3PF/iJoolV42SU5qCp6XOU77aY=",
+ "reusify": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+ "dev": true
+ },
+ "rfdc": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz",
+ "integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug==",
+ "dev": true
+ },
+ "rgb-regex": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz",
+ "integrity": "sha1-wODWiC3w4jviVKR16O3UGRX+rrE=",
+ "dev": true
+ },
+ "rgba-regex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/rgba-regex/-/rgba-regex-1.0.0.tgz",
+ "integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
"dev": true
},
"rimraf": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
- "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
+ "version": "2.6.3",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
+ "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"dev": true,
"requires": {
- "glob": "7.1.2"
+ "glob": "^7.1.3"
+ }
+ },
+ "rollup": {
+ "version": "1.23.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.23.0.tgz",
+ "integrity": "sha512-/p72Z3NbHWV+Vi1p2X+BmPA3WqlZxpUqCy6E8U4crMohZnI+j9Ob8ZAfFyNfddT0LxgnJM0olO4mg+noH4SFbg==",
+ "dev": true,
+ "requires": {
+ "@types/estree": "*",
+ "@types/node": "^12.7.10",
+ "acorn": "^7.1.0"
},
"dependencies": {
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
- "dev": true,
- "requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
- }
+ "@types/node": {
+ "version": "12.7.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.11.tgz",
+ "integrity": "sha512-Otxmr2rrZLKRYIybtdG/sgeO+tHY20GxeDjcGmUnmmlCWyEnv2a2x1ZXBo3BTec4OiTXMQCiazB8NMBf0iRlFw==",
+ "dev": true
}
}
},
- "rollup": {
- "version": "0.53.3",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.53.3.tgz",
- "integrity": "sha512-MADFV0jpoh1QDB6U0U6YamGihGetxHEYgwTcGsc7map6JFIydPEfGNshK+ozxv1RKeUOQKn1vRb85IAcdjL22Q==",
- "dev": true
- },
"rollup-plugin-babel": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-3.0.3.tgz",
- "integrity": "sha512-5kzM/Rr4jQSRPLc2eN5NuD+CI/6AAy7S1O18Ogu4U3nq1Q42VJn0C9EMtqnvxtfwf1XrezOtdA9ro1VZI5B0mA==",
+ "version": "4.3.3",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz",
+ "integrity": "sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw==",
"dev": true,
"requires": {
- "rollup-pluginutils": "1.5.2"
+ "@babel/helper-module-imports": "^7.0.0",
+ "rollup-pluginutils": "^2.8.1"
+ },
+ "dependencies": {
+ "estree-walker": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz",
+ "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==",
+ "dev": true
+ },
+ "rollup-pluginutils": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz",
+ "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==",
+ "dev": true,
+ "requires": {
+ "estree-walker": "^0.6.1"
+ }
+ }
}
},
"rollup-pluginutils": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz",
- "integrity": "sha1-HhVud4+UtyVb+hs9AXi+j1xVJAg=",
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz",
+ "integrity": "sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==",
"dev": true,
"requires": {
- "estree-walker": "0.2.1",
- "minimatch": "3.0.4"
+ "estree-walker": "^0.6.0",
+ "micromatch": "^3.1.10"
}
},
"rollup-watch": {
@@ -7687,25 +10725,143 @@
"integrity": "sha512-6yjnIwfjpSrqA8IafyIu7fsEyeImNR4aDjA1bQ7KWeVuiA+Clfsx8+PGQkyABWIQzmauQ//tIJ5wAxLXsXs8qQ==",
"dev": true,
"requires": {
- "chokidar": "1.7.0",
+ "chokidar": "^1.7.0",
"require-relative": "0.8.7",
- "rollup-pluginutils": "2.0.1"
+ "rollup-pluginutils": "^2.0.1"
},
"dependencies": {
- "estree-walker": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.3.1.tgz",
- "integrity": "sha1-5rGlHPcpJSTnI3wxLl/mZgwc4ao=",
+ "anymatch": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
+ "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
+ "dev": true,
+ "requires": {
+ "micromatch": "^2.1.5",
+ "normalize-path": "^2.0.0"
+ }
+ },
+ "arr-diff": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
+ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.0.1"
+ }
+ },
+ "array-unique": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
+ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"dev": true
},
- "rollup-pluginutils": {
+ "braces": {
+ "version": "1.8.5",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
+ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
+ "dev": true,
+ "requires": {
+ "expand-range": "^1.8.1",
+ "preserve": "^0.2.0",
+ "repeat-element": "^1.1.2"
+ }
+ },
+ "chokidar": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
+ "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
+ "dev": true,
+ "requires": {
+ "anymatch": "^1.3.0",
+ "async-each": "^1.0.0",
+ "fsevents": "^1.0.0",
+ "glob-parent": "^2.0.0",
+ "inherits": "^2.0.1",
+ "is-binary-path": "^1.0.0",
+ "is-glob": "^2.0.0",
+ "path-is-absolute": "^1.0.0",
+ "readdirp": "^2.0.0"
+ }
+ },
+ "expand-brackets": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
+ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
+ "dev": true,
+ "requires": {
+ "is-posix-bracket": "^0.1.0"
+ }
+ },
+ "extglob": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
+ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
+ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
+ "dev": true,
+ "requires": {
+ "is-glob": "^2.0.0"
+ }
+ },
+ "is-extglob": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
+ "dev": true
+ },
+ "is-glob": {
"version": "2.0.1",
- "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz",
- "integrity": "sha1-fslbNXP2VDpGpkYb2afFRFJdD8A=",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ },
+ "micromatch": {
+ "version": "2.3.11",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
+ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
"dev": true,
"requires": {
- "estree-walker": "0.3.1",
- "micromatch": "2.3.11"
+ "arr-diff": "^2.0.0",
+ "array-unique": "^0.2.1",
+ "braces": "^1.8.2",
+ "expand-brackets": "^0.1.4",
+ "extglob": "^0.3.1",
+ "filename-regex": "^2.0.0",
+ "is-extglob": "^1.0.0",
+ "is-glob": "^2.0.1",
+ "kind-of": "^3.0.2",
+ "normalize-path": "^2.0.1",
+ "object.omit": "^2.0.0",
+ "parse-glob": "^3.0.4",
+ "regex-cache": "^0.4.2"
+ }
+ },
+ "normalize-path": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
+ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
+ "dev": true,
+ "requires": {
+ "remove-trailing-separator": "^1.0.1"
}
}
}
@@ -7716,28 +10872,49 @@
"integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
"dev": true,
"requires": {
- "is-promise": "2.1.0"
+ "is-promise": "^2.1.0"
}
},
- "rx-lite": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
- "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
+ "run-node": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz",
+ "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==",
"dev": true
},
- "rx-lite-aggregates": {
- "version": "4.0.8",
- "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
- "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
+ "run-parallel": {
+ "version": "1.1.9",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz",
+ "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==",
+ "dev": true
+ },
+ "rxjs": {
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz",
+ "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
"dev": true,
"requires": {
- "rx-lite": "4.0.8"
+ "tslib": "^1.9.0"
}
},
"safe-buffer": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
- "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "dev": true
+ },
+ "safe-regex": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
+ "dev": true,
+ "requires": {
+ "ret": "~0.1.10"
+ }
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"sax": {
@@ -7747,18 +10924,25 @@
"dev": true
},
"semver": {
- "version": "5.4.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
- "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
+ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
"dev": true
},
- "semver-diff": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz",
- "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=",
+ "semver-compare": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
+ "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
+ "dev": true
+ },
+ "sentence-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz",
+ "integrity": "sha1-H24t2jnBaL+S0T+G1KkYkz9mftQ=",
"dev": true,
"requires": {
- "semver": "5.4.1"
+ "no-case": "^2.2.0",
+ "upper-case-first": "^1.1.2"
}
},
"set-blocking": {
@@ -7767,10 +10951,33 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true
},
- "set-immediate-shim": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
- "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
+ "set-value": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
+ "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
+ "dev": true,
+ "requires": {
+ "extend-shallow": "^2.0.1",
+ "is-extendable": "^0.1.1",
+ "is-plain-object": "^2.0.3",
+ "split-string": "^3.0.1"
+ },
+ "dependencies": {
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ }
+ }
+ },
+ "setprototypeof": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
+ "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==",
"dev": true
},
"shebang-command": {
@@ -7779,7 +10986,7 @@
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
- "shebang-regex": "1.0.0"
+ "shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
@@ -7794,72 +11001,300 @@
"integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=",
"dev": true,
"requires": {
- "array-filter": "0.0.1",
- "array-map": "0.0.0",
- "array-reduce": "0.0.0",
- "jsonify": "0.0.0"
+ "array-filter": "~0.0.0",
+ "array-map": "~0.0.0",
+ "array-reduce": "~0.0.0",
+ "jsonify": "~0.0.0"
}
},
- "sigmund": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz",
- "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=",
- "dev": true
- },
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true
},
+ "simple-git": {
+ "version": "1.116.0",
+ "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.116.0.tgz",
+ "integrity": "sha512-Pbo3tceqMYy0j3U7jzMKabOWcx5+67GdgQUjpK83XUxGhA+1BX93UPvlWNzbCRoFwd7EJTyDSCC2XCoT4NTLYQ==",
+ "dev": true,
+ "requires": {
+ "debug": "^4.0.1"
+ }
+ },
"simple-swizzle": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
"integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=",
"dev": true,
"requires": {
- "is-arrayish": "0.3.1"
+ "is-arrayish": "^0.3.1"
},
"dependencies": {
"is-arrayish": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.1.tgz",
- "integrity": "sha1-wt/DhquqDD4zxI2z/ocFnmkGXv0=",
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
"dev": true
}
}
},
"slash": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
- "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
+ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
"dev": true
},
"slice-ansi": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
- "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
+ "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
"dev": true,
"requires": {
- "is-fullwidth-code-point": "2.0.0"
+ "ansi-styles": "^3.2.0",
+ "astral-regex": "^1.0.0",
+ "is-fullwidth-code-point": "^2.0.0"
}
},
- "sntp": {
+ "snake-case": {
"version": "2.1.0",
- "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz",
- "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==",
+ "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz",
+ "integrity": "sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8=",
"dev": true,
"requires": {
- "hoek": "4.2.0"
+ "no-case": "^2.2.0"
}
},
- "sort-keys": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
- "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
+ "snapdragon": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
+ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
+ "dev": true,
+ "requires": {
+ "base": "^0.11.1",
+ "debug": "^2.2.0",
+ "define-property": "^0.2.5",
+ "extend-shallow": "^2.0.1",
+ "map-cache": "^0.2.2",
+ "source-map": "^0.5.6",
+ "source-map-resolve": "^0.5.0",
+ "use": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ },
+ "extend-shallow": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
+ "dev": true,
+ "requires": {
+ "is-extendable": "^0.1.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "snapdragon-node": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
+ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
+ "dev": true,
+ "requires": {
+ "define-property": "^1.0.0",
+ "isobject": "^3.0.0",
+ "snapdragon-util": "^3.0.1"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^1.0.0"
+ }
+ },
+ "is-accessor-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-data-descriptor": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^6.0.0"
+ }
+ },
+ "is-descriptor": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+ "dev": true,
+ "requires": {
+ "is-accessor-descriptor": "^1.0.0",
+ "is-data-descriptor": "^1.0.0",
+ "kind-of": "^6.0.2"
+ }
+ }
+ }
+ },
+ "snapdragon-util": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
+ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
+ "dev": true,
+ "requires": {
+ "kind-of": "^3.2.0"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
+ }
+ },
+ "socket.io": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.1.1.tgz",
+ "integrity": "sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA==",
+ "dev": true,
+ "requires": {
+ "debug": "~3.1.0",
+ "engine.io": "~3.2.0",
+ "has-binary2": "~1.0.2",
+ "socket.io-adapter": "~1.1.0",
+ "socket.io-client": "2.1.1",
+ "socket.io-parser": "~3.2.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "socket.io-adapter": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz",
+ "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=",
+ "dev": true
+ },
+ "socket.io-client": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.1.1.tgz",
+ "integrity": "sha512-jxnFyhAuFxYfjqIgduQlhzqTcOEQSn+OHKVfAxWaNWa7ecP7xSNk2Dx/3UEsDcY7NcFafxvNvKPmmO7HTwTxGQ==",
+ "dev": true,
+ "requires": {
+ "backo2": "1.0.2",
+ "base64-arraybuffer": "0.1.5",
+ "component-bind": "1.0.0",
+ "component-emitter": "1.2.1",
+ "debug": "~3.1.0",
+ "engine.io-client": "~3.2.0",
+ "has-binary2": "~1.0.2",
+ "has-cors": "1.1.0",
+ "indexof": "0.0.1",
+ "object-component": "0.0.3",
+ "parseqs": "0.0.5",
+ "parseuri": "0.0.5",
+ "socket.io-parser": "~3.2.0",
+ "to-array": "0.1.4"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
+ }
+ },
+ "socket.io-parser": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz",
+ "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==",
"dev": true,
"requires": {
- "is-plain-obj": "1.1.0"
+ "component-emitter": "1.2.1",
+ "debug": "~3.1.0",
+ "isarray": "2.0.1"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "isarray": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
+ "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=",
+ "dev": true
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ }
}
},
"source-map": {
@@ -7868,58 +11303,88 @@
"integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"dev": true
},
+ "source-map-resolve": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz",
+ "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==",
+ "dev": true,
+ "requires": {
+ "atob": "^2.1.1",
+ "decode-uri-component": "^0.2.0",
+ "resolve-url": "^0.2.1",
+ "source-map-url": "^0.4.0",
+ "urix": "^0.1.0"
+ }
+ },
"source-map-support": {
"version": "0.4.18",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
"integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
"dev": true,
"requires": {
- "source-map": "0.5.7"
+ "source-map": "^0.5.6"
}
},
+ "source-map-url": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
+ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
+ "dev": true
+ },
"spdx-correct": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
- "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz",
+ "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==",
"dev": true,
"requires": {
- "spdx-license-ids": "1.2.2"
+ "spdx-expression-parse": "^3.0.0",
+ "spdx-license-ids": "^3.0.0"
}
},
- "spdx-expression-parse": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
- "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
+ "spdx-exceptions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz",
+ "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==",
"dev": true
},
+ "spdx-expression-parse": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
+ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
+ "dev": true,
+ "requires": {
+ "spdx-exceptions": "^2.1.0",
+ "spdx-license-ids": "^3.0.0"
+ }
+ },
"spdx-license-ids": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
- "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
+ "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==",
"dev": true
},
"specificity": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz",
- "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==",
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.4.1.tgz",
+ "integrity": "sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg==",
"dev": true
},
- "split": {
- "version": "0.3.3",
- "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz",
- "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=",
+ "split-string": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
+ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
"dev": true,
"requires": {
- "through": "2.3.8"
+ "extend-shallow": "^3.0.0"
}
},
"split2": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/split2/-/split2-0.2.1.tgz",
- "integrity": "sha1-At2smtwD7Au3jBKC7Aecpuha6QA=",
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz",
+ "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==",
"dev": true,
"requires": {
- "through2": "0.6.5"
+ "through2": "^2.0.2"
}
},
"sprintf-js": {
@@ -7928,41 +11393,79 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
- "sshpk": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz",
- "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=",
+ "stable": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
+ "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==",
+ "dev": true
+ },
+ "staged-git-files": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/staged-git-files/-/staged-git-files-1.1.2.tgz",
+ "integrity": "sha512-0Eyrk6uXW6tg9PYkhi/V/J4zHp33aNyi2hOCmhFLqLTIhbgqWn5jlSzI+IU0VqrZq6+DbHcabQl/WP6P3BG0QA==",
+ "dev": true
+ },
+ "state-toggle": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.2.tgz",
+ "integrity": "sha512-8LpelPGR0qQM4PnfLiplOQNJcIN1/r2Gy0xKB2zKnIW2YzPMt2sR4I/+gtPjhN7Svh9kw+zqEg2SFwpBO9iNiw==",
+ "dev": true
+ },
+ "static-extend": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
+ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=",
"dev": true,
"requires": {
- "asn1": "0.2.3",
- "assert-plus": "1.0.0",
- "bcrypt-pbkdf": "1.0.1",
- "dashdash": "1.14.1",
- "ecc-jsbn": "0.1.1",
- "getpass": "0.1.7",
- "jsbn": "0.1.1",
- "tweetnacl": "0.14.5"
+ "define-property": "^0.2.5",
+ "object-copy": "^0.1.0"
+ },
+ "dependencies": {
+ "define-property": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=",
+ "dev": true,
+ "requires": {
+ "is-descriptor": "^0.1.0"
+ }
+ }
}
},
- "stdin": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/stdin/-/stdin-0.0.1.tgz",
- "integrity": "sha1-0wQZgarsPf28d6GzjWNy449ftx4=",
+ "statuses": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
+ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
"dev": true
},
- "stream-combiner": {
- "version": "0.0.4",
- "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz",
- "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=",
+ "streamroller": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.6.tgz",
+ "integrity": "sha512-3QC47Mhv3/aZNFpDDVO44qQb9gwB9QggMEE0sQmkTAwBVYdBRWISdsywlkfm5II1Q5y/pmrHflti/IgmIzdDBg==",
"dev": true,
"requires": {
- "duplexer": "0.1.1"
+ "async": "^2.6.2",
+ "date-format": "^2.0.0",
+ "debug": "^3.2.6",
+ "fs-extra": "^7.0.1",
+ "lodash": "^4.17.14"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "dev": true,
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
}
},
- "strict-uri-encode": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
- "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
+ "string-argv": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.0.2.tgz",
+ "integrity": "sha1-2sMECGkMIfPDYwo/86BYd73L1zY=",
"dev": true
},
"string-width": {
@@ -7971,25 +11474,8 @@
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": {
- "is-fullwidth-code-point": "2.0.0",
- "strip-ansi": "4.0.0"
- },
- "dependencies": {
- "ansi-regex": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
- "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
- "dev": true
- },
- "strip-ansi": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
- "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
- "dev": true,
- "requires": {
- "ansi-regex": "3.0.0"
- }
- }
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^4.0.0"
}
},
"string.prototype.padend": {
@@ -7998,44 +11484,58 @@
"integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=",
"dev": true,
"requires": {
- "define-properties": "1.1.2",
- "es-abstract": "1.9.0",
- "function-bind": "1.1.1"
+ "define-properties": "^1.1.2",
+ "es-abstract": "^1.4.3",
+ "function-bind": "^1.0.2"
}
},
"string_decoder": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
- "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
- "safe-buffer": "5.1.1"
+ "safe-buffer": "~5.1.0"
}
},
- "stringstream": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
- "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=",
- "dev": true
+ "stringify-entities": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.2.tgz",
+ "integrity": "sha512-nrBAQClJAPN2p+uGCVJRPIPakKeKWZ9GtBCmormE7pWOSlHat7+x5A8gx85M7HM5Dt0BP3pP5RhVW77WdbJJ3A==",
+ "dev": true,
+ "requires": {
+ "character-entities-html4": "^1.0.0",
+ "character-entities-legacy": "^1.0.0",
+ "is-alphanumerical": "^1.0.0",
+ "is-hexadecimal": "^1.0.0"
+ }
},
- "strip-ansi": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
- "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "stringify-object": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz",
+ "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==",
"dev": true,
"requires": {
- "ansi-regex": "2.1.1"
+ "get-own-enumerable-property-symbols": "^3.0.0",
+ "is-obj": "^1.0.1",
+ "is-regexp": "^1.0.0"
}
},
- "strip-bom": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
- "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
- "is-utf8": "0.2.1"
+ "ansi-regex": "^3.0.0"
}
},
+ "strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
+ "dev": true
+ },
"strip-eof": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
@@ -8043,18 +11543,15 @@
"dev": true
},
"strip-indent": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
- "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
- "dev": true,
- "requires": {
- "get-stdin": "4.0.1"
- }
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
+ "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=",
+ "dev": true
},
"strip-json-comments": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
- "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
+ "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
"dev": true
},
"style-search": {
@@ -8063,368 +11560,333 @@
"integrity": "sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=",
"dev": true
},
- "stylefmt": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/stylefmt/-/stylefmt-6.0.0.tgz",
- "integrity": "sha1-yFHpwteLiplQL3S6PYY7MBY+7JM=",
+ "stylehacks": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz",
+ "integrity": "sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "css-color-list": "0.0.1",
- "diff": "3.4.0",
- "editorconfig": "0.13.3",
- "globby": "6.1.0",
- "minimist": "1.2.0",
- "postcss": "6.0.13",
- "postcss-scss": "1.0.2",
- "postcss-sorting": "2.1.0",
- "postcss-value-parser": "3.3.0",
- "stdin": "0.0.1",
- "stylelint": "7.13.0",
- "stylelint-order": "0.4.4"
+ "browserslist": "^4.0.0",
+ "postcss": "^7.0.0",
+ "postcss-selector-parser": "^3.0.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+ "dot-prop": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
+ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
- "color-convert": "1.9.0"
+ "is-obj": "^1.0.0"
}
},
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "postcss-selector-parser": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz",
+ "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=",
"dev": true,
"requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
+ "dot-prop": "^4.1.1",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
}
+ }
+ }
+ },
+ "stylelint": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-11.0.0.tgz",
+ "integrity": "sha512-esKkG7CUXI5yr4jgCNuwjiiV6NJ4BpodB0e47oFvUBaHgpiXXHRPOajpb0IXL7Ucpk+X3dcrlPxVHpmJ5XUDwg==",
+ "dev": true,
+ "requires": {
+ "autoprefixer": "^9.5.1",
+ "balanced-match": "^1.0.0",
+ "chalk": "^2.4.2",
+ "cosmiconfig": "^5.2.0",
+ "debug": "^4.1.1",
+ "execall": "^2.0.0",
+ "file-entry-cache": "^5.0.1",
+ "get-stdin": "^7.0.0",
+ "global-modules": "^2.0.0",
+ "globby": "^9.2.0",
+ "globjoin": "^0.1.4",
+ "html-tags": "^3.0.0",
+ "ignore": "^5.0.6",
+ "import-lazy": "^4.0.0",
+ "imurmurhash": "^0.1.4",
+ "known-css-properties": "^0.15.0",
+ "leven": "^3.1.0",
+ "lodash": "^4.17.14",
+ "log-symbols": "^3.0.0",
+ "mathml-tag-names": "^2.1.0",
+ "meow": "^5.0.0",
+ "micromatch": "^4.0.0",
+ "normalize-selector": "^0.2.0",
+ "postcss": "^7.0.14",
+ "postcss-html": "^0.36.0",
+ "postcss-jsx": "^0.36.3",
+ "postcss-less": "^3.1.4",
+ "postcss-markdown": "^0.36.0",
+ "postcss-media-query-parser": "^0.2.3",
+ "postcss-reporter": "^6.0.1",
+ "postcss-resolve-nested-selector": "^0.1.1",
+ "postcss-safe-parser": "^4.0.1",
+ "postcss-sass": "^0.4.1",
+ "postcss-scss": "^2.0.0",
+ "postcss-selector-parser": "^3.1.0",
+ "postcss-syntax": "^0.36.2",
+ "postcss-value-parser": "^4.0.2",
+ "resolve-from": "^5.0.0",
+ "signal-exit": "^3.0.2",
+ "slash": "^3.0.0",
+ "specificity": "^0.4.1",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^5.2.0",
+ "style-search": "^0.1.0",
+ "sugarss": "^2.0.0",
+ "svg-tags": "^1.0.0",
+ "table": "^5.2.3",
+ "v8-compile-cache": "^2.1.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
},
- "globby": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
- "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
- "array-union": "1.0.2",
- "glob": "7.1.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "fill-range": "^7.0.1"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
+ "dot-prop": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
+ "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
+ "dev": true,
+ "requires": {
+ "is-obj": "^1.0.0"
+ }
},
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true
},
- "postcss": {
- "version": "6.0.13",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz",
- "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==",
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
- "chalk": "2.1.0",
- "source-map": "0.6.1",
- "supports-color": "4.4.0"
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "globby": {
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz",
+ "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==",
+ "dev": true,
+ "requires": {
+ "@types/glob": "^7.1.1",
+ "array-union": "^1.0.2",
+ "dir-glob": "^2.2.2",
+ "fast-glob": "^2.2.6",
+ "glob": "^7.1.3",
+ "ignore": "^4.0.3",
+ "pify": "^4.0.1",
+ "slash": "^2.0.0"
},
"dependencies": {
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
- "dev": true,
- "requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
- }
+ "ignore": {
+ "version": "4.0.6",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+ "dev": true
+ },
+ "slash": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
+ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
+ "dev": true
}
}
},
- "source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "ignore": {
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz",
+ "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==",
"dev": true
},
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
- }
- }
- },
- "stylehacks": {
- "version": "2.3.2",
- "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-2.3.2.tgz",
- "integrity": "sha1-ZMg+BDimjJ7fRJ6MVSp9mrYAmws=",
- "dev": true,
- "requires": {
- "browserslist": "1.7.7",
- "chalk": "1.1.3",
- "log-symbols": "1.0.2",
- "minimist": "1.2.0",
- "plur": "2.1.2",
- "postcss": "5.2.18",
- "postcss-reporter": "1.4.1",
- "postcss-selector-parser": "2.2.3",
- "read-file-stdin": "0.2.1",
- "text-table": "0.2.0",
- "write-file-stdout": "0.0.2"
- },
- "dependencies": {
- "browserslist": {
- "version": "1.7.7",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz",
- "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
- "dev": true,
- "requires": {
- "caniuse-db": "1.0.30000744",
- "electron-to-chromium": "1.3.24"
- }
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
},
- "minimist": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
- "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
- "postcss-reporter": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-1.4.1.tgz",
- "integrity": "sha1-wTbwpbFhkV83ndN2XGEHX357mvI=",
+ "log-symbols": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz",
+ "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "lodash": "4.17.4",
- "log-symbols": "1.0.2",
- "postcss": "5.2.18"
+ "chalk": "^2.4.2"
}
- }
- }
- },
- "stylelint": {
- "version": "7.13.0",
- "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-7.13.0.tgz",
- "integrity": "sha1-ER+Xttpy53XICADWu29fhpmXeF0=",
- "dev": true,
- "requires": {
- "autoprefixer": "6.7.7",
- "balanced-match": "0.4.2",
- "chalk": "2.1.0",
- "colorguard": "1.2.0",
- "cosmiconfig": "2.2.2",
- "debug": "2.6.9",
- "doiuse": "2.6.0",
- "execall": "1.0.0",
- "file-entry-cache": "2.0.0",
- "get-stdin": "5.0.1",
- "globby": "6.1.0",
- "globjoin": "0.1.4",
- "html-tags": "2.0.0",
- "ignore": "3.3.5",
- "imurmurhash": "0.1.4",
- "known-css-properties": "0.2.0",
- "lodash": "4.17.4",
- "log-symbols": "1.0.2",
- "mathml-tag-names": "2.0.1",
- "meow": "3.7.0",
- "micromatch": "2.3.11",
- "normalize-selector": "0.2.0",
- "pify": "2.3.0",
- "postcss": "5.2.18",
- "postcss-less": "0.14.0",
- "postcss-media-query-parser": "0.2.3",
- "postcss-reporter": "3.0.0",
- "postcss-resolve-nested-selector": "0.1.1",
- "postcss-scss": "0.4.1",
- "postcss-selector-parser": "2.2.3",
- "postcss-value-parser": "3.3.0",
- "resolve-from": "3.0.0",
- "specificity": "0.3.2",
- "string-width": "2.1.1",
- "style-search": "0.1.0",
- "stylehacks": "2.3.2",
- "sugarss": "0.2.0",
- "svg-tags": "1.0.0",
- "table": "4.0.2"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+ },
+ "micromatch": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
+ "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
"dev": true,
"requires": {
- "color-convert": "1.9.0"
+ "braces": "^3.0.1",
+ "picomatch": "^2.0.5"
}
},
- "balanced-match": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz",
- "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=",
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true
},
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
+ "postcss-selector-parser": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz",
+ "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
+ "dot-prop": "^4.1.1",
+ "indexes-of": "^1.0.1",
+ "uniq": "^1.0.1"
}
},
- "get-stdin": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz",
- "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=",
+ "postcss-value-parser": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.2.tgz",
+ "integrity": "sha512-LmeoohTpp/K4UiyQCwuGWlONxXamGzCMtFxLq4W1nZVGIQLYvMCJx3yAF9qyyuFpflABI9yVdtJAqbihOsCsJQ==",
"dev": true
},
- "glob": {
- "version": "7.1.2",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "slash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
+ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz",
+ "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==",
"dev": true,
"requires": {
- "fs.realpath": "1.0.0",
- "inflight": "1.0.6",
- "inherits": "2.0.3",
- "minimatch": "3.0.4",
- "once": "1.4.0",
- "path-is-absolute": "1.0.1"
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^5.2.0"
}
},
- "globby": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
- "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": {
- "array-union": "1.0.2",
- "glob": "7.1.2",
- "object-assign": "4.1.1",
- "pify": "2.3.0",
- "pinkie-promise": "2.0.1"
+ "ansi-regex": "^4.1.0"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
- "dev": true
- },
- "postcss-reporter": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-3.0.0.tgz",
- "integrity": "sha1-CeoPN6RExWk4eGBuCbAY6+/3z48=",
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
- "chalk": "1.1.3",
- "lodash": "4.17.4",
- "log-symbols": "1.0.2",
- "postcss": "5.2.18"
- },
- "dependencies": {
- "ansi-styles": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
- "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
- "dev": true
- },
- "chalk": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
- "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
- "dev": true,
- "requires": {
- "ansi-styles": "2.2.1",
- "escape-string-regexp": "1.0.5",
- "has-ansi": "2.0.0",
- "strip-ansi": "3.0.1",
- "supports-color": "2.0.0"
- }
- },
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- }
+ "is-number": "^7.0.0"
}
- },
- "postcss-scss": {
- "version": "0.4.1",
- "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-0.4.1.tgz",
- "integrity": "sha1-rXcbgfD3L19IRdCKpg+TVXZT1Uw=",
+ }
+ }
+ },
+ "stylelint-config-recommended": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz",
+ "integrity": "sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==",
+ "dev": true
+ },
+ "stylelint-config-standard": {
+ "version": "19.0.0",
+ "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-19.0.0.tgz",
+ "integrity": "sha512-VvcODsL1PryzpYteWZo2YaA5vU/pWfjqBpOvmeA8iB2MteZ/ZhI1O4hnrWMidsS4vmEJpKtjdhLdfGJmmZm6Cg==",
+ "dev": true,
+ "requires": {
+ "stylelint-config-recommended": "^3.0.0"
+ }
+ },
+ "stylelint-order": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/stylelint-order/-/stylelint-order-3.1.1.tgz",
+ "integrity": "sha512-4gP/r8j/6JGZ/LL41b2sYtQqfwZl4VSqTp7WeIwI67v/OXNQ08dnn64BGXNwAUSgb2+YIvIOxQaMzqMyQMzoyQ==",
+ "dev": true,
+ "requires": {
+ "lodash": "^4.17.15",
+ "postcss": "^7.0.17",
+ "postcss-sorting": "^5.0.1"
+ },
+ "dependencies": {
+ "postcss": {
+ "version": "7.0.18",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.18.tgz",
+ "integrity": "sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "chalk": "^2.4.2",
+ "source-map": "^0.6.1",
+ "supports-color": "^6.1.0"
}
},
- "resolve-from": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
- "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=",
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+ "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "has-flag": "^3.0.0"
}
}
}
},
- "stylelint-order": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/stylelint-order/-/stylelint-order-0.4.4.tgz",
- "integrity": "sha1-2338oFQbUGIBDH4uIedFeR/AiKw=",
+ "sugarss": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz",
+ "integrity": "sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ==",
"dev": true,
"requires": {
- "lodash": "4.17.4",
- "postcss": "5.2.18",
- "stylelint": "7.13.0"
+ "postcss": "^7.0.2"
}
},
- "sugarss": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-0.2.0.tgz",
- "integrity": "sha1-rDQjdWMyfG/4l7ZHQr9q7BkK054=",
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
- "postcss": "5.2.18"
+ "has-flag": "^3.0.0"
}
},
- "supports-color": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
- "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
- "dev": true
- },
"svg-tags": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz",
@@ -8432,96 +11894,178 @@
"dev": true
},
"svgo": {
- "version": "0.7.2",
- "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz",
- "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.0.tgz",
+ "integrity": "sha512-xBfxJxfk4UeVN8asec9jNxHiv3UAMv/ujwBWGYvQhhMb2u3YTGKkiybPcLFDLq7GLLWE9wa73e0/m8L5nTzQbw==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.1",
+ "coa": "^2.0.2",
+ "css-select": "^2.0.0",
+ "css-select-base-adapter": "^0.1.1",
+ "css-tree": "1.0.0-alpha.28",
+ "css-url-regex": "^1.1.0",
+ "csso": "^3.5.1",
+ "js-yaml": "^3.12.0",
+ "mkdirp": "~0.5.1",
+ "object.values": "^1.1.0",
+ "sax": "~1.2.4",
+ "stable": "^0.1.8",
+ "unquote": "~1.1.1",
+ "util.promisify": "~1.0.0"
+ }
+ },
+ "swap-case": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.1.2.tgz",
+ "integrity": "sha1-w5IDpFhzhfrTyFCgvRvK+ggZdOM=",
"dev": true,
"requires": {
- "coa": "1.0.4",
- "colors": "1.1.2",
- "csso": "2.3.2",
- "js-yaml": "3.7.0",
- "mkdirp": "0.5.1",
- "sax": "1.2.4",
- "whet.extend": "0.9.9"
+ "lower-case": "^1.1.1",
+ "upper-case": "^1.1.1"
}
},
- "synesthesia": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/synesthesia/-/synesthesia-1.0.1.tgz",
- "integrity": "sha1-XvlepUjA1cbm+btLDQcx3/hkp3c=",
+ "symbol-observable": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz",
+ "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==",
+ "dev": true
+ },
+ "synchronous-promise": {
+ "version": "2.0.9",
+ "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.9.tgz",
+ "integrity": "sha512-LO95GIW16x69LuND1nuuwM4pjgFGupg7pZ/4lU86AmchPKrhk0o2tpMU2unXRrqo81iAFe1YJ0nAGEVwsrZAgg==",
+ "dev": true
+ },
+ "table": {
+ "version": "5.4.6",
+ "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
+ "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
"dev": true,
"requires": {
- "css-color-names": "0.0.3"
+ "ajv": "^6.10.2",
+ "lodash": "^4.17.14",
+ "slice-ansi": "^2.1.0",
+ "string-width": "^3.0.0"
},
"dependencies": {
- "css-color-names": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.3.tgz",
- "integrity": "sha1-3gzvFvTYqoIioyDVttfpu62nufY=",
+ "ansi-regex": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
}
}
},
- "table": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
- "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
+ "teeny-request": {
+ "version": "3.11.3",
+ "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz",
+ "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==",
"dev": true,
"requires": {
- "ajv": "5.2.3",
- "ajv-keywords": "2.1.0",
- "chalk": "2.1.0",
- "lodash": "4.17.4",
- "slice-ansi": "1.0.0",
- "string-width": "2.1.1"
+ "https-proxy-agent": "^2.2.1",
+ "node-fetch": "^2.2.0",
+ "uuid": "^3.3.2"
+ }
+ },
+ "test-exclude": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz",
+ "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==",
+ "dev": true,
+ "requires": {
+ "glob": "^7.1.3",
+ "minimatch": "^3.0.4",
+ "read-pkg-up": "^4.0.0",
+ "require-main-filename": "^2.0.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
"dev": true,
"requires": {
- "color-convert": "1.9.0"
+ "locate-path": "^3.0.0"
}
},
- "chalk": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
- "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.4.0"
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "p-limit": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
+ "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"dev": true
},
- "supports-color": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
- "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+ "read-pkg-up": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz",
+ "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==",
"dev": true,
"requires": {
- "has-flag": "2.0.0"
+ "find-up": "^3.0.0",
+ "read-pkg": "^3.0.0"
}
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
}
}
},
- "term-size": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
- "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=",
- "dev": true,
- "requires": {
- "execa": "0.7.0"
- }
+ "text-extensions": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz",
+ "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==",
+ "dev": true
},
"text-table": {
"version": "0.2.0",
@@ -8529,12 +12073,6 @@
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
"dev": true
},
- "throttleit": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz",
- "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=",
- "dev": true
- },
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
@@ -8542,75 +12080,122 @@
"dev": true
},
"through2": {
- "version": "0.6.5",
- "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz",
- "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
+ "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
"dev": true,
"requires": {
- "readable-stream": "1.0.34",
- "xtend": "4.0.1"
- },
- "dependencies": {
- "isarray": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
- "dev": true
- },
- "readable-stream": {
- "version": "1.0.34",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
- "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
- "dev": true,
- "requires": {
- "core-util-is": "1.0.2",
- "inherits": "2.0.3",
- "isarray": "0.0.1",
- "string_decoder": "0.10.31"
- }
- },
- "string_decoder": {
- "version": "0.10.31",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
- "dev": true
- }
+ "readable-stream": "~2.3.6",
+ "xtend": "~4.0.1"
}
},
- "timed-out": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
- "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=",
+ "timsort": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
+ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true
},
+ "title-case": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz",
+ "integrity": "sha1-PhJyFtpY0rxb7PE3q5Ha46fNj6o=",
+ "dev": true,
+ "requires": {
+ "no-case": "^2.2.0",
+ "upper-case": "^1.0.3"
+ }
+ },
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
"dev": true,
"requires": {
- "os-tmpdir": "1.0.2"
+ "os-tmpdir": "~1.0.2"
}
},
+ "to-array": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz",
+ "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=",
+ "dev": true
+ },
"to-fast-properties": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
- "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
"dev": true
},
- "tough-cookie": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz",
- "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=",
+ "to-object-path": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
+ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=",
"dev": true,
"requires": {
- "punycode": "1.4.1"
+ "kind-of": "^3.0.2"
+ },
+ "dependencies": {
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ }
}
},
- "trim-newlines": {
+ "to-regex": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
+ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
+ "dev": true,
+ "requires": {
+ "define-property": "^2.0.2",
+ "extend-shallow": "^3.0.2",
+ "regex-not": "^1.0.2",
+ "safe-regex": "^1.1.0"
+ }
+ },
+ "to-regex-range": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=",
+ "dev": true,
+ "requires": {
+ "is-number": "^3.0.0",
+ "repeat-string": "^1.6.1"
+ }
+ },
+ "toidentifier": {
"version": "1.0.0",
- "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
- "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
+ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
+ "dev": true
+ },
+ "toposort": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz",
+ "integrity": "sha1-riF2gXXRVZ1IvvNUILL0li8JwzA=",
+ "dev": true
+ },
+ "trim": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz",
+ "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=",
+ "dev": true
+ },
+ "trim-newlines": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz",
+ "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=",
+ "dev": true
+ },
+ "trim-off-newlines": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz",
+ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=",
"dev": true
},
"trim-right": {
@@ -8619,21 +12204,23 @@
"integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
"dev": true
},
- "tunnel-agent": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
- "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
- "dev": true,
- "requires": {
- "safe-buffer": "5.1.1"
- }
+ "trim-trailing-lines": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.2.tgz",
+ "integrity": "sha512-MUjYItdrqqj2zpcHFTkMa9WAv4JHTI6gnRQGPFLrt5L9a6tRMiDnIqYl8JBvu2d2Tc3lWJKQwlGCp0K8AvCM+Q==",
+ "dev": true
},
- "tweetnacl": {
- "version": "0.14.5",
- "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
- "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
- "dev": true,
- "optional": true
+ "trough": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.4.tgz",
+ "integrity": "sha512-tdzBRDGWcI1OpPVmChbdSKhvSVurznZ8X36AYURAcl+0o2ldlCY2XPzyXNNxwJwwyIU+rIglTCG4kxtNKBQH7Q==",
+ "dev": true
+ },
+ "tslib": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",
+ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
+ "dev": true
},
"type-check": {
"version": "0.3.2",
@@ -8641,7 +12228,29 @@
"integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
"dev": true,
"requires": {
- "prelude-ls": "1.1.2"
+ "prelude-ls": "~1.1.2"
+ }
+ },
+ "type-detect": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
+ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
+ "dev": true
+ },
+ "type-fest": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
+ "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==",
+ "dev": true
+ },
+ "type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "dev": true,
+ "requires": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
}
},
"typedarray": {
@@ -8651,21 +12260,15 @@
"dev": true
},
"uglify-js": {
- "version": "3.3.4",
- "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.4.tgz",
- "integrity": "sha512-hfIwuAQI5dlXP30UtdmWoYF9k+ypVqBXIdmd6ZKBiaNHHvA8ty7ZloMe3+7S5AEKVkxHbjByl4DfRHQ7QpZquw==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz",
+ "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==",
"dev": true,
"requires": {
- "commander": "2.12.2",
- "source-map": "0.6.1"
+ "commander": "~2.20.0",
+ "source-map": "~0.6.1"
},
"dependencies": {
- "commander": {
- "version": "2.12.2",
- "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz",
- "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==",
- "dev": true
- },
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -8674,119 +12277,252 @@
}
}
},
- "uniq": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
- "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=",
+ "ultron": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
+ "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==",
"dev": true
},
- "uniqid": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz",
- "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=",
+ "unherit": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.2.tgz",
+ "integrity": "sha512-W3tMnpaMG7ZY6xe/moK04U9fBhi6wEiCYHUW5Mop/wQHf12+79EQGwxYejNdhEz2mkqkBlGwm7pxmgBKMVUj0w==",
"dev": true,
"requires": {
- "macaddress": "0.2.8"
+ "inherits": "^2.0.1",
+ "xtend": "^4.0.1"
}
},
+ "unicode-canonical-property-names-ecmascript": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
+ "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==",
+ "dev": true
+ },
+ "unicode-match-property-ecmascript": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz",
+ "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==",
+ "dev": true,
+ "requires": {
+ "unicode-canonical-property-names-ecmascript": "^1.0.4",
+ "unicode-property-aliases-ecmascript": "^1.0.4"
+ }
+ },
+ "unicode-match-property-value-ecmascript": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz",
+ "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==",
+ "dev": true
+ },
+ "unicode-property-aliases-ecmascript": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz",
+ "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==",
+ "dev": true
+ },
+ "unified": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/unified/-/unified-7.1.0.tgz",
+ "integrity": "sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw==",
+ "dev": true,
+ "requires": {
+ "@types/unist": "^2.0.0",
+ "@types/vfile": "^3.0.0",
+ "bail": "^1.0.0",
+ "extend": "^3.0.0",
+ "is-plain-obj": "^1.1.0",
+ "trough": "^1.0.0",
+ "vfile": "^3.0.0",
+ "x-is-string": "^0.1.0"
+ }
+ },
+ "union-value": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+ "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
+ "dev": true,
+ "requires": {
+ "arr-union": "^3.1.0",
+ "get-value": "^2.0.6",
+ "is-extendable": "^0.1.1",
+ "set-value": "^2.0.1"
+ }
+ },
+ "uniq": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
+ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=",
+ "dev": true
+ },
"uniqs": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz",
"integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=",
"dev": true
},
- "unique-string": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
- "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=",
+ "unist-util-find-all-after": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.4.tgz",
+ "integrity": "sha512-CaxvMjTd+yF93BKLJvZnEfqdM7fgEACsIpQqz8vIj9CJnUb9VpyymFS3tg6TCtgrF7vfCJBF5jbT2Ox9CBRYRQ==",
"dev": true,
"requires": {
- "crypto-random-string": "1.0.0"
+ "unist-util-is": "^3.0.0"
}
},
- "units-css": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/units-css/-/units-css-0.4.0.tgz",
- "integrity": "sha1-1iKGU6UZg9fBb/KPi53Dsf/tOgc=",
+ "unist-util-is": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-3.0.0.tgz",
+ "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==",
+ "dev": true
+ },
+ "unist-util-remove-position": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.3.tgz",
+ "integrity": "sha512-CtszTlOjP2sBGYc2zcKA/CvNdTdEs3ozbiJ63IPBxh8iZg42SCCb8m04f8z2+V1aSk5a7BxbZKEdoDjadmBkWA==",
"dev": true,
"requires": {
- "isnumeric": "0.2.0",
- "viewport-dimensions": "0.2.0"
+ "unist-util-visit": "^1.1.0"
+ }
+ },
+ "unist-util-stringify-position": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz",
+ "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==",
+ "dev": true
+ },
+ "unist-util-visit": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.1.tgz",
+ "integrity": "sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==",
+ "dev": true,
+ "requires": {
+ "unist-util-visit-parents": "^2.0.0"
+ }
+ },
+ "unist-util-visit-parents": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz",
+ "integrity": "sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g==",
+ "dev": true,
+ "requires": {
+ "unist-util-is": "^3.0.0"
}
},
"universalify": {
- "version": "0.1.1",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
- "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=",
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
},
- "unzip-response": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz",
- "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=",
+ "unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
"dev": true
},
- "update-notifier": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz",
- "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=",
+ "unquote": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz",
+ "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=",
+ "dev": true
+ },
+ "unset-value": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
+ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=",
"dev": true,
"requires": {
- "boxen": "1.2.2",
- "chalk": "2.3.0",
- "configstore": "3.1.1",
- "import-lazy": "2.1.0",
- "is-installed-globally": "0.1.0",
- "is-npm": "1.0.0",
- "latest-version": "3.1.0",
- "semver-diff": "2.1.0",
- "xdg-basedir": "3.0.0"
+ "has-value": "^0.3.1",
+ "isobject": "^3.0.0"
},
"dependencies": {
- "ansi-styles": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
- "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
- "dev": true,
- "requires": {
- "color-convert": "1.9.0"
- }
- },
- "chalk": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
- "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
+ "has-value": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
+ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=",
"dev": true,
"requires": {
- "ansi-styles": "3.2.0",
- "escape-string-regexp": "1.0.5",
- "supports-color": "4.5.0"
+ "get-value": "^2.0.3",
+ "has-values": "^0.1.4",
+ "isobject": "^2.0.0"
+ },
+ "dependencies": {
+ "isobject": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+ "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=",
+ "dev": true,
+ "requires": {
+ "isarray": "1.0.0"
+ }
+ }
}
},
- "has-flag": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
- "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
+ "has-values": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
+ "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=",
"dev": true
- },
- "supports-color": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
- "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
- "dev": true,
- "requires": {
- "has-flag": "2.0.0"
- }
}
}
},
- "url-parse-lax": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
- "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=",
+ "upath": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.1.tgz",
+ "integrity": "sha512-D0yetkpIOKiZQquxjM2Syvy48Y1DbZ0SWxgsZiwd9GCWRpc75vN8ytzem14WDSg+oiX6+Qt31FpiS/ExODCrLg==",
+ "dev": true
+ },
+ "upper-case": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
+ "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
+ "dev": true
+ },
+ "upper-case-first": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz",
+ "integrity": "sha1-XXm+3P8UQZUY/S7bCgUHybaFkRU=",
+ "dev": true,
+ "requires": {
+ "upper-case": "^1.1.1"
+ }
+ },
+ "uri-js": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
+ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
- "prepend-http": "1.0.4"
+ "punycode": "^2.1.0"
+ }
+ },
+ "urix": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
+ "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=",
+ "dev": true
+ },
+ "urlgrey": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz",
+ "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=",
+ "dev": true
+ },
+ "use": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
+ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
+ "dev": true
+ },
+ "useragent": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz",
+ "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "4.1.x",
+ "tmp": "0.0.x"
}
},
"util-deprecate": {
@@ -8795,58 +12531,98 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true
},
+ "util.promisify": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
+ "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
+ "dev": true,
+ "requires": {
+ "define-properties": "^1.1.2",
+ "object.getownpropertydescriptors": "^2.0.3"
+ }
+ },
+ "utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
+ "dev": true
+ },
"uuid": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
- "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
+ "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
+ "dev": true
+ },
+ "v8-compile-cache": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz",
+ "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==",
"dev": true
},
"validate-npm-package-license": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
- "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
"dev": true,
"requires": {
- "spdx-correct": "1.0.2",
- "spdx-expression-parse": "1.0.4"
+ "spdx-correct": "^3.0.0",
+ "spdx-expression-parse": "^3.0.0"
}
},
"vendors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.1.tgz",
- "integrity": "sha1-N61zyO5Bf7PVgOeFMSMH0nSEfyI=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz",
+ "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==",
"dev": true
},
- "verror": {
- "version": "1.10.0",
- "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
- "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "vfile": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz",
+ "integrity": "sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ==",
"dev": true,
"requires": {
- "assert-plus": "1.0.0",
- "core-util-is": "1.0.2",
- "extsprintf": "1.3.0"
+ "is-buffer": "^2.0.0",
+ "replace-ext": "1.0.0",
+ "unist-util-stringify-position": "^1.0.0",
+ "vfile-message": "^1.0.0"
+ },
+ "dependencies": {
+ "is-buffer": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
+ "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==",
+ "dev": true
+ }
}
},
- "viewport-dimensions": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/viewport-dimensions/-/viewport-dimensions-0.2.0.tgz",
- "integrity": "sha1-3nQHR9tTh/0XJfUXXpG6x2r982w=",
+ "vfile-location": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.5.tgz",
+ "integrity": "sha512-Pa1ey0OzYBkLPxPZI3d9E+S4BmvfVwNAAXrrqGbwTVXWaX2p9kM1zZ+n35UtVM06shmWKH4RPRN8KI80qE3wNQ==",
"dev": true
},
- "whet.extend": {
- "version": "0.9.9",
- "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz",
- "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=",
+ "vfile-message": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz",
+ "integrity": "sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA==",
+ "dev": true,
+ "requires": {
+ "unist-util-stringify-position": "^1.1.1"
+ }
+ },
+ "void-elements": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz",
+ "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=",
"dev": true
},
"which": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
- "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
- "isexe": "2.0.0"
+ "isexe": "^2.0.0"
}
},
"which-module": {
@@ -8855,43 +12631,15 @@
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
- "widest-line": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-1.0.0.tgz",
- "integrity": "sha1-DAnIXCqUaD0Nfq+O4JfVZL8OEFw=",
+ "wide-align": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
+ "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
"requires": {
- "string-width": "1.0.2"
- },
- "dependencies": {
- "is-fullwidth-code-point": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
- "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
- "dev": true,
- "requires": {
- "number-is-nan": "1.0.1"
- }
- },
- "string-width": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
- "dev": true,
- "requires": {
- "code-point-at": "1.1.0",
- "is-fullwidth-code-point": "1.0.0",
- "strip-ansi": "3.0.1"
- }
- }
+ "string-width": "^1.0.2 || 2"
}
},
- "window-size": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
- "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=",
- "dev": true
- },
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
@@ -8899,35 +12647,13 @@
"dev": true
},
"wrap-ansi": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
- "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz",
+ "integrity": "sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo=",
"dev": true,
"requires": {
- "string-width": "1.0.2",
- "strip-ansi": "3.0.1"
- },
- "dependencies": {
- "is-fullwidth-code-point": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
- "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
- "dev": true,
- "requires": {
- "number-is-nan": "1.0.1"
- }
- },
- "string-width": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
- "dev": true,
- "requires": {
- "code-point-at": "1.1.0",
- "is-fullwidth-code-point": "1.0.0",
- "strip-ansi": "3.0.1"
- }
- }
+ "string-width": "^2.1.1",
+ "strip-ansi": "^4.0.0"
}
},
"wrappy": {
@@ -8937,56 +12663,56 @@
"dev": true
},
"write": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
- "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz",
+ "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==",
"dev": true,
"requires": {
- "mkdirp": "0.5.1"
+ "mkdirp": "^0.5.1"
}
},
- "write-file-atomic": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz",
- "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==",
+ "ws": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz",
+ "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "imurmurhash": "0.1.4",
- "signal-exit": "3.0.2"
+ "async-limiter": "~1.0.0",
+ "safe-buffer": "~5.1.0",
+ "ultron": "~1.1.0"
}
},
- "write-file-stdout": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/write-file-stdout/-/write-file-stdout-0.0.2.tgz",
- "integrity": "sha1-wlLXx8WxtAKJdjDjRTx7/mkNnKE=",
+ "x-is-string": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz",
+ "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=",
"dev": true
},
- "xdg-basedir": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
- "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=",
+ "xmlhttprequest-ssl": {
+ "version": "1.5.5",
+ "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
+ "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=",
"dev": true
},
"xtend": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
- "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true
},
"xxhashjs": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.1.tgz",
- "integrity": "sha1-m76b6JYUKXbfo0wGGy0GjEPTDeA=",
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz",
+ "integrity": "sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==",
"dev": true,
"requires": {
- "cuint": "0.2.2"
+ "cuint": "^0.2.2"
}
},
"y18n": {
- "version": "3.2.1",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
- "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
+ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
"yallist": {
@@ -8996,105 +12722,242 @@
"dev": true
},
"yargs": {
- "version": "8.0.2",
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
- "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
- "dev": true,
- "requires": {
- "camelcase": "4.1.0",
- "cliui": "3.2.0",
- "decamelize": "1.2.0",
- "get-caller-file": "1.0.2",
- "os-locale": "2.1.0",
- "read-pkg-up": "2.0.0",
- "require-directory": "2.1.1",
- "require-main-filename": "1.0.1",
- "set-blocking": "2.0.0",
- "string-width": "2.1.1",
- "which-module": "2.0.0",
- "y18n": "3.2.1",
- "yargs-parser": "7.0.0"
+ "version": "12.0.5",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
+ "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==",
+ "dev": true,
+ "requires": {
+ "cliui": "^4.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^1.0.1",
+ "os-locale": "^3.0.0",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^1.0.1",
+ "set-blocking": "^2.0.0",
+ "string-width": "^2.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^3.2.1 || ^4.0.0",
+ "yargs-parser": "^11.1.1"
},
"dependencies": {
"camelcase": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
- "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz",
+ "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==",
"dev": true
},
"find-up": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
- "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
"dev": true,
"requires": {
- "locate-path": "2.0.0"
+ "locate-path": "^3.0.0"
}
},
- "load-json-file": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
- "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"requires": {
- "graceful-fs": "4.1.11",
- "parse-json": "2.2.0",
- "pify": "2.3.0",
- "strip-bom": "3.0.0"
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
}
},
- "path-type": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
- "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
+ "p-limit": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
+ "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
"dev": true,
"requires": {
- "pify": "2.3.0"
+ "p-try": "^2.0.0"
}
},
- "read-pkg": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
- "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"dev": true,
"requires": {
- "load-json-file": "2.0.0",
- "normalize-package-data": "2.4.0",
- "path-type": "2.0.0"
+ "p-limit": "^2.0.0"
}
},
- "read-pkg-up": {
+ "p-try": {
"version": "2.0.0",
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
- "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz",
+ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==",
+ "dev": true
+ },
+ "yargs-parser": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz",
+ "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==",
"dev": true,
"requires": {
- "find-up": "2.1.0",
- "read-pkg": "2.0.0"
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
}
- },
- "strip-bom": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
- "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
- "dev": true
}
}
},
"yargs-parser": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
- "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=",
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
+ "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
"dev": true,
"requires": {
- "camelcase": "4.1.0"
+ "camelcase": "^4.1.0"
+ }
+ },
+ "yargs-unparser": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz",
+ "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==",
+ "dev": true,
+ "requires": {
+ "flat": "^4.1.0",
+ "lodash": "^4.17.15",
+ "yargs": "^13.3.0"
},
"dependencies": {
- "camelcase": {
+ "ansi-regex": {
"version": "4.1.0",
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
- "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
+ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
+ "dev": true
+ },
+ "camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"dev": true
+ },
+ "cliui": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+ "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
+ "dev": true,
+ "requires": {
+ "string-width": "^3.1.0",
+ "strip-ansi": "^5.2.0",
+ "wrap-ansi": "^5.1.0"
+ }
+ },
+ "find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^3.0.0"
+ }
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
+ "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+ "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^7.0.1",
+ "is-fullwidth-code-point": "^2.0.0",
+ "strip-ansi": "^5.1.0"
+ }
+ },
+ "strip-ansi": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+ "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^4.1.0"
+ }
+ },
+ "wrap-ansi": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+ "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.0",
+ "string-width": "^3.0.0",
+ "strip-ansi": "^5.0.0"
+ }
+ },
+ "yargs": {
+ "version": "13.3.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz",
+ "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==",
+ "dev": true,
+ "requires": {
+ "cliui": "^5.0.0",
+ "find-up": "^3.0.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^3.0.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^13.1.1"
+ }
+ },
+ "yargs-parser": {
+ "version": "13.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
+ "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ }
}
}
},
@@ -9104,7 +12967,27 @@
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
"dev": true,
"requires": {
- "fd-slicer": "1.0.1"
+ "fd-slicer": "~1.0.1"
+ }
+ },
+ "yeast": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
+ "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=",
+ "dev": true
+ },
+ "yup": {
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz",
+ "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==",
+ "dev": true,
+ "requires": {
+ "@babel/runtime": "^7.0.0",
+ "fn-name": "~2.0.1",
+ "lodash": "^4.17.11",
+ "property-expr": "^1.5.0",
+ "synchronous-promise": "^2.0.6",
+ "toposort": "^2.0.2"
}
}
}
diff --git a/library/cropperjs/package.json b/library/cropperjs/package.json
index f94100981..81647a36b 100644
--- a/library/cropperjs/package.json
+++ b/library/cropperjs/package.json
@@ -1,76 +1,138 @@
{
"name": "cropperjs",
"description": "JavaScript image cropper.",
- "version": "1.2.2",
+ "version": "1.5.6",
"main": "dist/cropper.common.js",
"module": "dist/cropper.esm.js",
"browser": "dist/cropper.js",
+ "types": "types/index.d.ts",
"style": "dist/cropper.css",
- "repository": "fengyuanchen/cropperjs",
- "homepage": "https://fengyuanchen.github.io/cropperjs",
- "license": "MIT",
- "author": {
- "name": "Chen Fengyuan",
- "url": "http://chenfengyuan.com"
- },
"files": [
"src",
- "dist"
+ "dist",
+ "types"
],
+ "scripts": {
+ "build": "npm run build:css && npm run build:js",
+ "build:css": "postcss src/index.css -o dist/cropper.css --no-map",
+ "build:js": "rollup -c",
+ "clear": "del-cli dist",
+ "codecov": "cat coverage/lcov.info | codecov",
+ "compress": "npm run compress:css && npm run compress:js",
+ "compress:css": "postcss dist/cropper.css -u cssnano -o dist/cropper.min.css --no-map",
+ "compress:js": "uglifyjs dist/cropper.js -o dist/cropper.min.js -c -m --comments /^!/",
+ "copy": "cpy dist/cropper.css docs/css",
+ "lint": "npm run lint:js && npm run lint:css",
+ "lint:css": "stylelint {src,docs,examples}/**/*.{css,scss,html} --fix",
+ "lint:js": "eslint src test *.js --fix",
+ "release": "npm run clear && npm run lint && npm run build && npm run compress && npm run copy && npm test",
+ "start": "npm-run-all --parallel watch:*",
+ "test": "cross-env NODE_ENV=test karma start test/karma.conf.js",
+ "watch:css": "postcss src/index.css -o docs/css/cropper.css -m -w",
+ "watch:js": "rollup -c -m -w"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/fengyuanchen/cropperjs.git"
+ },
"keywords": [
"image",
"crop",
- "cropping",
"move",
"zoom",
"rotate",
"scale",
"cropper",
- "cropperjs",
"cropper.js",
+ "cropping",
+ "processing",
"html",
"css",
"javascript",
"front-end",
- "web",
- "development"
+ "web"
],
- "scripts": {
- "build": "npm run build:css && npm run build:js",
- "build:css": "postcss src/css/cropper.css -o dist/cropper.css --no-map",
- "build:js": "rollup -c",
- "clear": "del-cli dist",
- "compress": "npm run compress:css && npm run compress:js",
- "compress:css": "postcss dist/cropper.css -u cssnano -o dist/cropper.min.css --no-map",
- "compress:js": "uglifyjs dist/cropper.js -o dist/cropper.min.js -c -m --comments /^!/",
- "copy": "cpy dist/cropper.css docs/css",
- "lint": "eslint src/js --fix",
- "release": "npm run clear && npm run lint && npm run build && npm run compress && npm run copy && npm test",
- "start": "npm-run-all --parallel watch:*",
- "test": "node-qunit-phantomjs test/index.html --timeout 10",
- "watch:css": "postcss src/css/cropper.css -o docs/css/cropper.css -m -w",
- "watch:js": "rollup -c -m -w"
+ "author": {
+ "name": "Chen Fengyuan",
+ "url": "https://chenfengyuan.com"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/fengyuanchen/cropperjs/issues"
},
+ "homepage": "https://fengyuanchen.github.io/cropperjs",
"devDependencies": {
- "babel-core": "^6.26.0",
- "babel-plugin-external-helpers": "^6.22.0",
- "babel-preset-env": "^1.6.1",
- "cpy-cli": "^1.0.1",
- "cssnano": "^3.10.0",
- "del-cli": "^1.1.0",
- "eslint": "^4.14.0",
- "eslint-config-airbnb-base": "^12.1.0",
- "eslint-plugin-import": "^2.8.0",
- "node-qunit-phantomjs": "^2.0.0",
- "npm-run-all": "^4.1.2",
- "postcss-cli": "^4.1.1",
- "postcss-cssnext": "^3.0.2",
+ "@babel/core": "^7.6.2",
+ "@babel/preset-env": "^7.6.2",
+ "@commitlint/cli": "^8.2.0",
+ "@commitlint/config-conventional": "^8.2.0",
+ "babel-plugin-istanbul": "^5.2.0",
+ "chai": "^4.2.0",
+ "change-case": "^3.1.0",
+ "codecov": "^3.6.1",
+ "cpy-cli": "^2.0.0",
+ "create-banner": "^1.0.0",
+ "cross-env": "^6.0.3",
+ "cssnano": "^4.1.10",
+ "del-cli": "^3.0.0",
+ "eslint": "^6.5.1",
+ "eslint-config-airbnb-base": "^14.0.0",
+ "eslint-plugin-import": "^2.18.2",
+ "husky": "^3.0.8",
+ "karma": "^4.3.0",
+ "karma-chai": "^0.1.0",
+ "karma-chrome-launcher": "^3.1.0",
+ "karma-coverage-istanbul-reporter": "^2.1.0",
+ "karma-mocha": "^1.3.0",
+ "karma-mocha-reporter": "^2.2.5",
+ "karma-rollup-preprocessor": "^7.0.2",
+ "lint-staged": "^8.2.1",
+ "mocha": "^6.2.1",
+ "npm-run-all": "^4.1.5",
+ "postcss-cli": "^6.1.3",
"postcss-header": "^1.0.0",
- "postcss-url": "^7.3.0",
- "rollup": "^0.53.3",
- "rollup-plugin-babel": "^3.0.3",
+ "postcss-import": "^12.0.1",
+ "postcss-preset-env": "^6.7.0",
+ "postcss-url": "^8.0.0",
+ "puppeteer": "^1.20.0",
+ "rollup": "^1.23.0",
+ "rollup-plugin-babel": "^4.3.3",
"rollup-watch": "^4.3.1",
- "stylefmt": "^6.0.0",
- "uglify-js": "^3.3.4"
+ "stylelint": "^11.0.0",
+ "stylelint-config-standard": "^19.0.0",
+ "stylelint-order": "^3.1.1",
+ "uglify-js": "^3.6.0"
+ },
+ "browserslist": [
+ "last 2 versions",
+ "> 1%",
+ "not ie <= 8"
+ ],
+ "commitlint": {
+ "extends": [
+ "@commitlint/config-conventional"
+ ]
+ },
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged",
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
+ }
+ },
+ "lint-staged": {
+ "linters": {
+ "*.js": [
+ "eslint --fix",
+ "git add"
+ ],
+ "*.{css,scss,html}": [
+ "stylelint --fix",
+ "git add"
+ ]
+ },
+ "ignore": [
+ "{dist,docs}/**/*.js",
+ "*.min.*"
+ ]
}
}
diff --git a/library/cropperjs/postcss.config.js b/library/cropperjs/postcss.config.js
index af7ec6024..29f9daf85 100644
--- a/library/cropperjs/postcss.config.js
+++ b/library/cropperjs/postcss.config.js
@@ -2,13 +2,21 @@ const rollupConfig = require('./rollup.config');
module.exports = {
plugins: {
- 'postcss-cssnext': {},
+ 'postcss-import': {},
+ 'postcss-preset-env': {
+ stage: 3,
+ features: {
+ 'nesting-rules': true,
+ },
+ },
'postcss-url': {
url: 'inline',
},
'postcss-header': {
- header: rollupConfig.banner,
+ header: rollupConfig.output[0].banner,
+ },
+ stylelint: {
+ fix: true,
},
- stylefmt: {},
},
};
diff --git a/library/cropperjs/rollup.config.js b/library/cropperjs/rollup.config.js
index b792a79a7..437684a11 100644
--- a/library/cropperjs/rollup.config.js
+++ b/library/cropperjs/rollup.config.js
@@ -1,50 +1,45 @@
const babel = require('rollup-plugin-babel');
+const changeCase = require('change-case');
+const createBanner = require('create-banner');
const pkg = require('./package');
-const now = new Date();
-const banner = `/*!
- * Cropper.js v${pkg.version}
- * https://github.com/${pkg.repository}
- *
- * Copyright (c) 2015-${now.getFullYear()} ${pkg.author.name}
- * Released under the ${pkg.license} license
- *
- * Date: ${now.toISOString()}
- */
-`;
+pkg.name = pkg.name.replace('js', '');
+
+const name = changeCase.pascalCase(pkg.name);
+const banner = createBanner({
+ data: {
+ name: `${name}.js`,
+ year: '2015-present',
+ },
+});
module.exports = {
- // Export banner for PostCSS
- banner,
- input: 'src/js/cropper.js',
+ input: 'src/index.js',
output: [
{
banner,
- file: 'dist/cropper.js',
+ name,
+ file: `dist/${pkg.name}.js`,
format: 'umd',
- name: 'Cropper',
},
{
banner,
- file: 'dist/cropper.common.js',
+ file: `dist/${pkg.name}.common.js`,
format: 'cjs',
},
{
banner,
- file: 'dist/cropper.esm.js',
- format: 'es',
+ file: `dist/${pkg.name}.esm.js`,
+ format: 'esm',
},
{
banner,
- file: 'docs/js/cropper.js',
+ name,
+ file: `docs/js/${pkg.name}.js`,
format: 'umd',
- name: 'Cropper',
},
],
plugins: [
- babel({
- exclude: 'node_modules/**',
- plugins: ['external-helpers'],
- }),
+ babel(),
],
};
diff --git a/library/cropperjs/src/css/cropper.css b/library/cropperjs/src/css/cropper.css
index d09c4f182..756a7e1c1 100644
--- a/library/cropperjs/src/css/cropper.css
+++ b/library/cropperjs/src/css/cropper.css
@@ -1,7 +1,3 @@
-:root {
- --blue: #39f;
-}
-
.cropper-container {
direction: ltr;
font-size: 0;
@@ -11,7 +7,6 @@
user-select: none;
& img {
- /* Avoid margin top issue (Occur only when margin-top <= -height) */
display: block;
height: 100%;
image-orientation: 0deg;
@@ -47,14 +42,14 @@
.cropper-modal {
background-color: #000;
- opacity: .5;
+ opacity: 0.5;
}
.cropper-view-box {
display: block;
height: 100%;
- outline-color: color(var(--blue) alpha(75%));
- outline: 1px solid var(--blue);
+ outline: 1px solid #39f;
+ outline-color: rgba(51, 153, 255, 0.75);
overflow: hidden;
width: 100%;
}
@@ -62,15 +57,15 @@
.cropper-dashed {
border: 0 dashed #eee;
display: block;
- opacity: .5;
+ opacity: 0.5;
position: absolute;
&.dashed-h {
border-bottom-width: 1px;
border-top-width: 1px;
- height: calc(100 / 3)%;
+ height: calc(100% / 3);
left: 0;
- top: calc(100 / 3)%;
+ top: calc(100% / 3);
width: 100%;
}
@@ -78,9 +73,9 @@
border-left-width: 1px;
border-right-width: 1px;
height: 100%;
- left: calc(100 / 3)%;
+ left: calc(100% / 3);
top: 0;
- width: calc(100 / 3)%;
+ width: calc(100% / 3);
}
}
@@ -88,27 +83,27 @@
display: block;
height: 0;
left: 50%;
- opacity: .75;
+ opacity: 0.75;
position: absolute;
top: 50%;
width: 0;
- &:before,
- &:after {
+ &::before,
+ &::after {
background-color: #eee;
content: ' ';
display: block;
position: absolute;
}
- &:before {
+ &::before {
height: 1px;
left: -3px;
top: 0;
width: 7px;
}
- &:after {
+ &::after {
height: 7px;
left: 0;
top: -3px;
@@ -121,7 +116,7 @@
.cropper-point {
display: block;
height: 100%;
- opacity: .1;
+ opacity: 0.1;
position: absolute;
width: 100%;
}
@@ -133,7 +128,7 @@
}
.cropper-line {
- background-color: var(--blue);
+ background-color: #39f;
&.line-e {
cursor: ew-resize;
@@ -165,9 +160,9 @@
}
.cropper-point {
- background-color: var(--blue);
+ background-color: #39f;
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
&.point-e {
@@ -236,13 +231,13 @@
@media (min-width: 1200px) {
height: 5px;
- opacity: .75;
+ opacity: 0.75;
width: 5px;
}
}
- &.point-se:before {
- background-color: var(--blue);
+ &.point-se::before {
+ background-color: #39f;
bottom: -50%;
content: ' ';
display: block;
@@ -287,4 +282,3 @@
.cropper-disabled .cropper-point {
cursor: not-allowed;
}
-
diff --git a/library/cropperjs/src/css/cropper.scss b/library/cropperjs/src/css/cropper.scss
new file mode 100644
index 000000000..cfca464b7
--- /dev/null
+++ b/library/cropperjs/src/css/cropper.scss
@@ -0,0 +1,286 @@
+.cropper {
+ &-container {
+ direction: ltr;
+ font-size: 0;
+ line-height: 0;
+ position: relative;
+ touch-action: none;
+ user-select: none;
+
+ img {
+ display: block;
+ height: 100%;
+ image-orientation: 0deg;
+ max-height: none !important;
+ max-width: none !important;
+ min-height: 0 !important;
+ min-width: 0 !important;
+ width: 100%;
+ }
+ }
+
+ &-wrap-box,
+ &-canvas,
+ &-drag-box,
+ &-crop-box,
+ &-modal {
+ bottom: 0;
+ left: 0;
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+
+ &-wrap-box,
+ &-canvas {
+ overflow: hidden;
+ }
+
+ &-drag-box {
+ background-color: #fff;
+ opacity: 0;
+ }
+
+ &-modal {
+ background-color: #000;
+ opacity: 0.5;
+ }
+
+ &-view-box {
+ display: block;
+ height: 100%;
+ outline: 1px solid #39f;
+ outline-color: rgba(51, 153, 255, 0.75);
+ overflow: hidden;
+ width: 100%;
+ }
+
+ &-dashed {
+ border: 0 dashed #eee;
+ display: block;
+ opacity: 0.5;
+ position: absolute;
+
+ &.dashed-h {
+ border-bottom-width: 1px;
+ border-top-width: 1px;
+ height: calc(100% / 3);
+ left: 0;
+ top: calc(100% / 3);
+ width: 100%;
+ }
+
+ &.dashed-v {
+ border-left-width: 1px;
+ border-right-width: 1px;
+ height: 100%;
+ left: calc(100% / 3);
+ top: 0;
+ width: calc(100% / 3);
+ }
+ }
+
+ &-center {
+ display: block;
+ height: 0;
+ left: 50%;
+ opacity: 0.75;
+ position: absolute;
+ top: 50%;
+ width: 0;
+
+ &::before,
+ &::after {
+ background-color: #eee;
+ content: ' ';
+ display: block;
+ position: absolute;
+ }
+
+ &::before {
+ height: 1px;
+ left: -3px;
+ top: 0;
+ width: 7px;
+ }
+
+ &::after {
+ height: 7px;
+ left: 0;
+ top: -3px;
+ width: 1px;
+ }
+ }
+
+ &-face,
+ &-line,
+ &-point {
+ display: block;
+ height: 100%;
+ opacity: 0.1;
+ position: absolute;
+ width: 100%;
+ }
+
+ &-face {
+ background-color: #fff;
+ left: 0;
+ top: 0;
+ }
+
+ &-line {
+ background-color: #39f;
+
+ &.line-e {
+ cursor: ew-resize;
+ right: -3px;
+ top: 0;
+ width: 5px;
+ }
+
+ &.line-n {
+ cursor: ns-resize;
+ height: 5px;
+ left: 0;
+ top: -3px;
+ }
+
+ &.line-w {
+ cursor: ew-resize;
+ left: -3px;
+ top: 0;
+ width: 5px;
+ }
+
+ &.line-s {
+ bottom: -3px;
+ cursor: ns-resize;
+ height: 5px;
+ left: 0;
+ }
+ }
+
+ &-point {
+ background-color: #39f;
+ height: 5px;
+ opacity: 0.75;
+ width: 5px;
+
+ &.point-e {
+ cursor: ew-resize;
+ margin-top: -3px;
+ right: -3px;
+ top: 50%;
+ }
+
+ &.point-n {
+ cursor: ns-resize;
+ left: 50%;
+ margin-left: -3px;
+ top: -3px;
+ }
+
+ &.point-w {
+ cursor: ew-resize;
+ left: -3px;
+ margin-top: -3px;
+ top: 50%;
+ }
+
+ &.point-s {
+ bottom: -3px;
+ cursor: s-resize;
+ left: 50%;
+ margin-left: -3px;
+ }
+
+ &.point-ne {
+ cursor: nesw-resize;
+ right: -3px;
+ top: -3px;
+ }
+
+ &.point-nw {
+ cursor: nwse-resize;
+ left: -3px;
+ top: -3px;
+ }
+
+ &.point-sw {
+ bottom: -3px;
+ cursor: nesw-resize;
+ left: -3px;
+ }
+
+ &.point-se {
+ bottom: -3px;
+ cursor: nwse-resize;
+ height: 20px;
+ opacity: 1;
+ right: -3px;
+ width: 20px;
+
+ @media (min-width: 768px) {
+ height: 15px;
+ width: 15px;
+ }
+
+ @media (min-width: 992px) {
+ height: 10px;
+ width: 10px;
+ }
+
+ @media (min-width: 1200px) {
+ height: 5px;
+ opacity: 0.75;
+ width: 5px;
+ }
+ }
+
+ &.point-se::before {
+ background-color: #39f;
+ bottom: -50%;
+ content: ' ';
+ display: block;
+ height: 200%;
+ opacity: 0;
+ position: absolute;
+ right: -50%;
+ width: 200%;
+ }
+ }
+
+ &-invisible {
+ opacity: 0;
+ }
+
+ &-bg {
+ background-image: url('../images/bg.png');
+ }
+
+ &-hide {
+ display: block;
+ height: 0;
+ position: absolute;
+ width: 0;
+ }
+
+ &-hidden {
+ display: none !important;
+ }
+
+ &-move {
+ cursor: move;
+ }
+
+ &-crop {
+ cursor: crosshair;
+ }
+
+ &-disabled &-drag-box,
+ &-disabled &-face,
+ &-disabled &-line,
+ &-disabled &-point {
+ cursor: not-allowed;
+ }
+}
diff --git a/library/cropperjs/src/index.css b/library/cropperjs/src/index.css
new file mode 100644
index 000000000..ac94e343e
--- /dev/null
+++ b/library/cropperjs/src/index.css
@@ -0,0 +1 @@
+@import './css/cropper.css';
diff --git a/library/cropperjs/src/index.js b/library/cropperjs/src/index.js
new file mode 100644
index 000000000..ac940610f
--- /dev/null
+++ b/library/cropperjs/src/index.js
@@ -0,0 +1,3 @@
+import Cropper from './js/cropper';
+
+export default Cropper;
diff --git a/library/cropperjs/src/index.scss b/library/cropperjs/src/index.scss
new file mode 100644
index 000000000..90695c59a
--- /dev/null
+++ b/library/cropperjs/src/index.scss
@@ -0,0 +1 @@
+@import './css/cropper.scss';
diff --git a/library/cropperjs/src/js/change.js b/library/cropperjs/src/js/change.js
index 014222ef0..c0ddf27ee 100644
--- a/library/cropperjs/src/js/change.js
+++ b/library/cropperjs/src/js/change.js
@@ -14,14 +14,14 @@ import {
CLASS_HIDDEN,
} from './constants';
import {
- each,
+ forEach,
getMaxZoomRatio,
getOffset,
removeClass,
} from './utilities';
export default {
- change(e) {
+ change(event) {
const {
options,
canvasData,
@@ -47,7 +47,7 @@ export default {
let offset;
// Locking aspect ratio in "free mode" by holding shift key
- if (!aspectRatio && e.shiftKey) {
+ if (!aspectRatio && event.shiftKey) {
aspectRatio = width && height ? width / height : 1;
}
@@ -113,8 +113,8 @@ export default {
// Resize crop box
case ACTION_EAST:
- if (range.x >= 0 && (right >= maxWidth || (aspectRatio &&
- (top <= minTop || bottom >= maxHeight)))) {
+ if (range.x >= 0 && (right >= maxWidth || (aspectRatio
+ && (top <= minTop || bottom >= maxHeight)))) {
renderable = false;
break;
}
@@ -122,21 +122,22 @@ export default {
check(ACTION_EAST);
width += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top -= (range.x / aspectRatio) / 2;
- }
-
if (width < 0) {
action = ACTION_WEST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
case ACTION_NORTH:
- if (range.y <= 0 && (top <= minTop || (aspectRatio &&
- (left <= minLeft || right >= maxWidth)))) {
+ if (range.y <= 0 && (top <= minTop || (aspectRatio
+ && (left <= minLeft || right >= maxWidth)))) {
renderable = false;
break;
}
@@ -145,21 +146,22 @@ export default {
height -= range.y;
top += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left += (range.y * aspectRatio) / 2;
- }
-
if (height < 0) {
action = ACTION_SOUTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
case ACTION_WEST:
- if (range.x <= 0 && (left <= minLeft || (aspectRatio &&
- (top <= minTop || bottom >= maxHeight)))) {
+ if (range.x <= 0 && (left <= minLeft || (aspectRatio
+ && (top <= minTop || bottom >= maxHeight)))) {
renderable = false;
break;
}
@@ -168,21 +170,22 @@ export default {
width -= range.x;
left += range.x;
- if (aspectRatio) {
- height = width / aspectRatio;
- top += (range.x / aspectRatio) / 2;
- }
-
if (width < 0) {
action = ACTION_EAST;
- width = 0;
+ width = -width;
+ left -= width;
+ }
+
+ if (aspectRatio) {
+ height = width / aspectRatio;
+ top += (cropBoxData.height - height) / 2;
}
break;
case ACTION_SOUTH:
- if (range.y >= 0 && (bottom >= maxHeight || (aspectRatio &&
- (left <= minLeft || right >= maxWidth)))) {
+ if (range.y >= 0 && (bottom >= maxHeight || (aspectRatio
+ && (left <= minLeft || right >= maxWidth)))) {
renderable = false;
break;
}
@@ -190,14 +193,15 @@ export default {
check(ACTION_SOUTH);
height += range.y;
- if (aspectRatio) {
- width = height * aspectRatio;
- left -= (range.y * aspectRatio) / 2;
- }
-
if (height < 0) {
action = ACTION_NORTH;
- height = 0;
+ height = -height;
+ top -= height;
+ }
+
+ if (aspectRatio) {
+ width = height * aspectRatio;
+ left += (cropBoxData.width - width) / 2;
}
break;
@@ -240,14 +244,18 @@ export default {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -263,7 +271,7 @@ export default {
height -= range.y;
top += range.y;
width = height * aspectRatio;
- left += range.y * aspectRatio;
+ left += cropBoxData.width - width;
} else {
check(ACTION_NORTH);
check(ACTION_WEST);
@@ -293,14 +301,18 @@ export default {
if (width < 0 && height < 0) {
action = ACTION_SOUTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_NORTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -343,14 +355,18 @@ export default {
if (width < 0 && height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_EAST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -390,14 +406,18 @@ export default {
if (width < 0 && height < 0) {
action = ACTION_NORTH_WEST;
- height = 0;
- width = 0;
+ height = -height;
+ width = -width;
+ top -= height;
+ left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_WEST;
- width = 0;
+ width = -width;
+ left -= width;
} else if (height < 0) {
action = ACTION_NORTH_EAST;
- height = 0;
+ height = -height;
+ top -= height;
}
break;
@@ -410,7 +430,7 @@ export default {
// Zoom canvas
case ACTION_ZOOM:
- this.zoom(getMaxZoomRatio(pointers), e);
+ this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
@@ -463,7 +483,7 @@ export default {
}
// Override
- each(pointers, (p) => {
+ forEach(pointers, (p) => {
p.startX = p.endX;
p.startY = p.endY;
});
diff --git a/library/cropperjs/src/js/constants.js b/library/cropperjs/src/js/constants.js
index c675d4d1c..015fcbcdd 100644
--- a/library/cropperjs/src/js/constants.js
+++ b/library/cropperjs/src/js/constants.js
@@ -1,4 +1,7 @@
-export const WINDOW = typeof window !== 'undefined' ? window : {};
+export const IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined';
+export const WINDOW = IS_BROWSER ? window : {};
+export const IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false;
+export const HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false;
export const NAMESPACE = 'cropper';
// Actions
@@ -25,8 +28,8 @@ export const CLASS_MODAL = `${NAMESPACE}-modal`;
export const CLASS_MOVE = `${NAMESPACE}-move`;
// Data keys
-export const DATA_ACTION = 'action';
-export const DATA_PREVIEW = 'preview';
+export const DATA_ACTION = `${NAMESPACE}Action`;
+export const DATA_PREVIEW = `${NAMESPACE}Preview`;
// Drag modes
export const DRAG_MODE_CROP = 'crop';
@@ -39,18 +42,27 @@ export const EVENT_CROP_END = 'cropend';
export const EVENT_CROP_MOVE = 'cropmove';
export const EVENT_CROP_START = 'cropstart';
export const EVENT_DBLCLICK = 'dblclick';
-export const EVENT_ERROR = 'error';
-export const EVENT_LOAD = 'load';
-export const EVENT_POINTER_DOWN = WINDOW.PointerEvent ? 'pointerdown' : 'touchstart mousedown';
-export const EVENT_POINTER_MOVE = WINDOW.PointerEvent ? 'pointermove' : 'touchmove mousemove';
-export const EVENT_POINTER_UP = WINDOW.PointerEvent ? 'pointerup pointercancel' : 'touchend touchcancel mouseup';
+export const EVENT_TOUCH_START = IS_TOUCH_DEVICE ? 'touchstart' : 'mousedown';
+export const EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? 'touchmove' : 'mousemove';
+export const EVENT_TOUCH_END = IS_TOUCH_DEVICE ? 'touchend touchcancel' : 'mouseup';
+export const EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? 'pointerdown' : EVENT_TOUCH_START;
+export const EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? 'pointermove' : EVENT_TOUCH_MOVE;
+export const EVENT_POINTER_UP = HAS_POINTER_EVENT ? 'pointerup pointercancel' : EVENT_TOUCH_END;
export const EVENT_READY = 'ready';
export const EVENT_RESIZE = 'resize';
-export const EVENT_WHEEL = 'wheel mousewheel DOMMouseScroll';
+export const EVENT_WHEEL = 'wheel';
export const EVENT_ZOOM = 'zoom';
+// Mime types
+export const MIME_TYPE_JPEG = 'image/jpeg';
+
// RegExps
-export const REGEXP_ACTIONS = /^(?:e|w|s|n|se|sw|ne|nw|all|crop|move|zoom)$/;
+export const REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
export const REGEXP_DATA_URL = /^data:/;
export const REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
-export const REGEXP_TAG_NAME = /^(?:img|canvas)$/i;
+export const REGEXP_TAG_NAME = /^img|canvas$/i;
+
+// Misc
+// Inspired by the default width and height of a canvas element.
+export const MIN_CONTAINER_WIDTH = 200;
+export const MIN_CONTAINER_HEIGHT = 100;
diff --git a/library/cropperjs/src/js/cropper.js b/library/cropperjs/src/js/cropper.js
index 97f3511df..24bf81426 100644
--- a/library/cropperjs/src/js/cropper.js
+++ b/library/cropperjs/src/js/cropper.js
@@ -11,13 +11,10 @@ import {
CLASS_HIDDEN,
CLASS_HIDE,
CLASS_INVISIBLE,
- CLASS_MODAL,
CLASS_MOVE,
DATA_ACTION,
- EVENT_CROP,
- EVENT_ERROR,
- EVENT_LOAD,
EVENT_READY,
+ MIME_TYPE_JPEG,
NAMESPACE,
REGEXP_DATA_URL,
REGEXP_DATA_URL_JPEG,
@@ -29,19 +26,15 @@ import {
addListener,
addTimestamp,
arrayBufferToDataURL,
+ assign,
dataURLToArrayBuffer,
dispatchEvent,
- extend,
- getData,
- getImageNaturalSizes,
- getOrientation,
isCrossOriginURL,
isFunction,
isPlainObject,
parseOrientation,
- proxy,
removeClass,
- removeListener,
+ resetAndGetOrientation,
setData,
} from './utilities';
@@ -59,21 +52,15 @@ class Cropper {
}
this.element = element;
- this.options = extend({}, DEFAULTS, isPlainObject(options) && options);
- this.complete = false;
+ this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
this.cropped = false;
this.disabled = false;
- this.isImg = false;
- this.limited = false;
- this.loaded = false;
+ this.pointers = {};
this.ready = false;
+ this.reloading = false;
this.replaced = false;
- this.wheeling = false;
- this.originalUrl = '';
- this.canvasData = null;
- this.cropBoxData = null;
- this.previews = null;
- this.pointers = {};
+ this.sized = false;
+ this.sizing = false;
this.init();
}
@@ -82,11 +69,11 @@ class Cropper {
const tagName = element.tagName.toLowerCase();
let url;
- if (getData(element, NAMESPACE)) {
+ if (element[NAMESPACE]) {
return;
}
- setData(element, NAMESPACE, this);
+ element[NAMESPACE] = this;
if (tagName === 'img') {
this.isImg = true;
@@ -119,38 +106,68 @@ class Cropper {
const { element, options } = this;
+ if (!options.rotatable && !options.scalable) {
+ options.checkOrientation = false;
+ }
+
+ // Only IE10+ supports Typed Arrays
if (!options.checkOrientation || !window.ArrayBuffer) {
this.clone();
return;
}
- // XMLHttpRequest disallows to open a Data URL in some browsers like IE11 and Safari
+ // Detect the mime type of the image directly if it is a Data URL
if (REGEXP_DATA_URL.test(url)) {
+ // Read ArrayBuffer from Data URL of JPEG images directly for better performance
if (REGEXP_DATA_URL_JPEG.test(url)) {
this.read(dataURLToArrayBuffer(url));
} else {
+ // Only a JPEG image may contains Exif Orientation information,
+ // the rest types of Data URLs are not necessary to check orientation at all.
this.clone();
}
return;
}
+ // 1. Detect the mime type of the image by a XMLHttpRequest.
+ // 2. Load the image as ArrayBuffer for reading orientation if its a JPEG image.
const xhr = new XMLHttpRequest();
-
- xhr.onerror = () => {
- this.clone();
+ const clone = this.clone.bind(this);
+
+ this.reloading = true;
+ this.xhr = xhr;
+
+ // 1. Cross origin requests are only supported for protocol schemes:
+ // http, https, data, chrome, chrome-extension.
+ // 2. Access to XMLHttpRequest from a Data URL will be blocked by CORS policy
+ // in some browsers as IE11 and Safari.
+ xhr.onabort = clone;
+ xhr.onerror = clone;
+ xhr.ontimeout = clone;
+
+ xhr.onprogress = () => {
+ // Abort the request directly if it not a JPEG image for better performance
+ if (xhr.getResponseHeader('content-type') !== MIME_TYPE_JPEG) {
+ xhr.abort();
+ }
};
xhr.onload = () => {
this.read(xhr.response);
};
- // Bust cache when there is a "crossOrigin" property
+ xhr.onloadend = () => {
+ this.reloading = false;
+ this.xhr = null;
+ };
+
+ // Bust cache when there is a "crossOrigin" property to avoid browser cache error
if (options.checkCrossOrigin && isCrossOriginURL(url) && element.crossOrigin) {
url = addTimestamp(url);
}
- xhr.open('get', url);
+ xhr.open('GET', url);
xhr.responseType = 'arraybuffer';
xhr.withCredentials = element.crossOrigin === 'use-credentials';
xhr.send();
@@ -158,13 +175,17 @@ class Cropper {
read(arrayBuffer) {
const { options, imageData } = this;
- const orientation = getOrientation(arrayBuffer);
+
+ // Reset the orientation value to its default value 1
+ // as some iOS browsers will render image with its orientation
+ const orientation = resetAndGetOrientation(arrayBuffer);
let rotate = 0;
let scaleX = 1;
let scaleY = 1;
if (orientation > 1) {
- this.url = arrayBufferToDataURL(arrayBuffer, 'image/jpeg');
+ // Generate a new URL which has the default orientation value
+ this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
({ rotate, scaleX, scaleY } = parseOrientation(orientation));
}
@@ -182,20 +203,16 @@ class Cropper {
clone() {
const { element, url } = this;
- let crossOrigin;
- let crossOriginUrl;
+ let { crossOrigin } = element;
+ let crossOriginUrl = url;
if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
- ({ crossOrigin } = element);
-
- if (crossOrigin) {
- crossOriginUrl = url;
- } else {
+ if (!crossOrigin) {
crossOrigin = 'anonymous';
-
- // Bust cache when there is not a "crossOrigin" property
- crossOriginUrl = addTimestamp(url);
}
+
+ // Bust cache when there is not a "crossOrigin" property (#519)
+ crossOriginUrl = addTimestamp(url);
}
this.crossOrigin = crossOrigin;
@@ -208,66 +225,88 @@ class Cropper {
}
image.src = crossOriginUrl || url;
-
- const start = proxy(this.start, this);
- const stop = proxy(this.stop, this);
-
+ image.alt = element.alt || 'The image to crop';
this.image = image;
- this.onStart = start;
- this.onStop = stop;
-
- if (this.isImg) {
- if (element.complete) {
- this.start();
- } else {
- addListener(element, EVENT_LOAD, start);
- }
- } else {
- addListener(image, EVENT_LOAD, start);
- addListener(image, EVENT_ERROR, stop);
- addClass(image, CLASS_HIDE);
- element.parentNode.insertBefore(image, element.nextSibling);
- }
+ image.onload = this.start.bind(this);
+ image.onerror = this.stop.bind(this);
+ addClass(image, CLASS_HIDE);
+ element.parentNode.insertBefore(image, element.nextSibling);
}
- start(event) {
- const image = this.isImg ? this.element : this.image;
+ start() {
+ const { image } = this;
- if (event) {
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
- }
+ image.onload = null;
+ image.onerror = null;
+ this.sizing = true;
- getImageNaturalSizes(image, (naturalWidth, naturalHeight) => {
- extend(this.imageData, {
+ // Match all browsers that use WebKit as the layout engine in iOS devices,
+ // such as Safari for iOS, Chrome for iOS, and in-app browsers.
+ const isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
+ const done = (naturalWidth, naturalHeight) => {
+ assign(this.imageData, {
naturalWidth,
naturalHeight,
aspectRatio: naturalWidth / naturalHeight,
});
- this.loaded = true;
+ this.sizing = false;
+ this.sized = true;
this.build();
- });
+ };
+
+ // Most modern browsers (excepts iOS WebKit)
+ if (image.naturalWidth && !isIOSWebKit) {
+ done(image.naturalWidth, image.naturalHeight);
+ return;
+ }
+
+ const sizingImage = document.createElement('img');
+ const body = document.body || document.documentElement;
+
+ this.sizingImage = sizingImage;
+
+ sizingImage.onload = () => {
+ done(sizingImage.width, sizingImage.height);
+
+ if (!isIOSWebKit) {
+ body.removeChild(sizingImage);
+ }
+ };
+
+ sizingImage.src = image.src;
+
+ // iOS WebKit will convert the image automatically
+ // with its orientation once append it into DOM (#279)
+ if (!isIOSWebKit) {
+ sizingImage.style.cssText = (
+ 'left:0;'
+ + 'max-height:none!important;'
+ + 'max-width:none!important;'
+ + 'min-height:0!important;'
+ + 'min-width:0!important;'
+ + 'opacity:0;'
+ + 'position:absolute;'
+ + 'top:0;'
+ + 'z-index:-1;'
+ );
+ body.appendChild(sizingImage);
+ }
}
stop() {
const { image } = this;
- removeListener(image, EVENT_LOAD, this.onStart);
- removeListener(image, EVENT_ERROR, this.onStop);
+ image.onload = null;
+ image.onerror = null;
image.parentNode.removeChild(image);
this.image = null;
}
build() {
- if (!this.loaded) {
+ if (!this.sized || this.ready) {
return;
}
- // Unbuild first when replace
- if (this.ready) {
- this.unbuild();
- }
-
const { element, options, image } = this;
// Create cropper elements
@@ -306,18 +345,11 @@ class Cropper {
this.initPreview();
this.bind();
+ options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
- this.cropped = options.autoCrop;
-
- if (options.autoCrop) {
- if (options.modal) {
- addClass(dragBox, CLASS_MODAL);
- }
- } else {
- addClass(cropBox, CLASS_HIDDEN);
- }
+ addClass(cropBox, CLASS_HIDDEN);
if (!options.guides) {
addClass(cropBox.getElementsByClassName(`${NAMESPACE}-dashed`), CLASS_HIDDEN);
@@ -345,24 +377,23 @@ class Cropper {
addClass(cropBox.getElementsByClassName(`${NAMESPACE}-point`), CLASS_HIDDEN);
}
- this.setDragMode(options.dragMode);
this.render();
this.ready = true;
- this.setData(options.data);
+ this.setDragMode(options.dragMode);
- // Call the "ready" option asynchronously to keep "image.cropper" is defined
- this.completing = setTimeout(() => {
- if (isFunction(options.ready)) {
- addListener(element, EVENT_READY, options.ready, {
- once: true,
- });
- }
+ if (options.autoCrop) {
+ this.crop();
+ }
+
+ this.setData(options.data);
- dispatchEvent(element, EVENT_READY);
- dispatchEvent(element, EVENT_CROP, this.getData());
+ if (isFunction(options.ready)) {
+ addListener(element, EVENT_READY, options.ready, {
+ once: true,
+ });
+ }
- this.complete = true;
- }, 0);
+ dispatchEvent(element, EVENT_READY);
}
unbuild() {
@@ -370,32 +401,28 @@ class Cropper {
return;
}
- if (!this.complete) {
- clearTimeout(this.completing);
- }
-
this.ready = false;
- this.complete = false;
- this.initialImageData = null;
-
- // Clear `initialCanvasData` is necessary when replace
- this.initialCanvasData = null;
- this.initialCropBoxData = null;
- this.containerData = null;
- this.canvasData = null;
-
- // Clear `cropBoxData` is necessary when replace
- this.cropBoxData = null;
this.unbind();
this.resetPreview();
- this.previews = null;
- this.viewBox = null;
- this.cropBox = null;
- this.dragBox = null;
- this.canvas = null;
- this.container = null;
this.cropper.parentNode.removeChild(this.cropper);
- this.cropper = null;
+ removeClass(this.element, CLASS_HIDDEN);
+ }
+
+ uncreate() {
+ if (this.ready) {
+ this.unbuild();
+ this.ready = false;
+ this.cropped = false;
+ } else if (this.sizing) {
+ this.sizingImage.onload = null;
+ this.sizing = false;
+ this.sized = false;
+ } else if (this.reloading) {
+ this.xhr.onabort = null;
+ this.xhr.abort();
+ } else if (this.image) {
+ this.stop();
+ }
}
/**
@@ -412,10 +439,10 @@ class Cropper {
* @param {Object} options - The new default options.
*/
static setDefaults(options) {
- extend(DEFAULTS, isPlainObject(options) && options);
+ assign(DEFAULTS, isPlainObject(options) && options);
}
}
-extend(Cropper.prototype, render, preview, events, handlers, change, methods);
+assign(Cropper.prototype, render, preview, events, handlers, change, methods);
export default Cropper;
diff --git a/library/cropperjs/src/js/defaults.js b/library/cropperjs/src/js/defaults.js
index aa469e73a..ce6ab9698 100644
--- a/library/cropperjs/src/js/defaults.js
+++ b/library/cropperjs/src/js/defaults.js
@@ -1,6 +1,4 @@
-import {
- DRAG_MODE_CROP,
-} from './constants';
+import { DRAG_MODE_CROP } from './constants';
export default {
// Define the view mode of the cropper
@@ -9,6 +7,9 @@ export default {
// Define the dragging mode of the cropper
dragMode: DRAG_MODE_CROP, // 'crop', 'move' or 'none'
+ // Define the initial aspect ratio of the crop box
+ initialAspectRatio: NaN,
+
// Define the aspect ratio of the crop box
aspectRatio: NaN,
diff --git a/library/cropperjs/src/js/events.js b/library/cropperjs/src/js/events.js
index 3753db022..e46888704 100644
--- a/library/cropperjs/src/js/events.js
+++ b/library/cropperjs/src/js/events.js
@@ -14,7 +14,6 @@ import {
import {
addListener,
isFunction,
- proxy,
removeListener,
} from './utilities';
@@ -42,29 +41,32 @@ export default {
addListener(element, EVENT_ZOOM, options.zoom);
}
- addListener(cropper, EVENT_POINTER_DOWN, (this.onCropStart = proxy(this.cropStart, this)));
+ addListener(cropper, EVENT_POINTER_DOWN, (this.onCropStart = this.cropStart.bind(this)));
if (options.zoomable && options.zoomOnWheel) {
- addListener(cropper, EVENT_WHEEL, (this.onWheel = proxy(this.wheel, this)));
+ addListener(cropper, EVENT_WHEEL, (this.onWheel = this.wheel.bind(this)), {
+ passive: false,
+ capture: true,
+ });
}
if (options.toggleDragModeOnDblclick) {
- addListener(cropper, EVENT_DBLCLICK, (this.onDblclick = proxy(this.dblclick, this)));
+ addListener(cropper, EVENT_DBLCLICK, (this.onDblclick = this.dblclick.bind(this)));
}
addListener(
element.ownerDocument,
EVENT_POINTER_MOVE,
- (this.onCropMove = proxy(this.cropMove, this)),
+ (this.onCropMove = this.cropMove.bind(this)),
);
addListener(
element.ownerDocument,
EVENT_POINTER_UP,
- (this.onCropEnd = proxy(this.cropEnd, this)),
+ (this.onCropEnd = this.cropEnd.bind(this)),
);
if (options.responsive) {
- addListener(window, EVENT_RESIZE, (this.onResize = proxy(this.resize, this)));
+ addListener(window, EVENT_RESIZE, (this.onResize = this.resize.bind(this)));
}
},
@@ -94,7 +96,10 @@ export default {
removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
if (options.zoomable && options.zoomOnWheel) {
- removeListener(cropper, EVENT_WHEEL, this.onWheel);
+ removeListener(cropper, EVENT_WHEEL, this.onWheel, {
+ passive: false,
+ capture: true,
+ });
}
if (options.toggleDragModeOnDblclick) {
diff --git a/library/cropperjs/src/js/handlers.js b/library/cropperjs/src/js/handlers.js
index 7b7b2469a..43f999767 100644
--- a/library/cropperjs/src/js/handlers.js
+++ b/library/cropperjs/src/js/handlers.js
@@ -10,27 +10,30 @@ import {
EVENT_CROP_END,
EVENT_CROP_MOVE,
EVENT_CROP_START,
+ MIN_CONTAINER_WIDTH,
+ MIN_CONTAINER_HEIGHT,
REGEXP_ACTIONS,
} from './constants';
import {
addClass,
+ assign,
dispatchEvent,
- each,
- extend,
+ forEach,
getData,
getPointer,
hasClass,
+ isNumber,
toggleClass,
} from './utilities';
export default {
resize() {
const { options, container, containerData } = this;
- const minContainerWidth = Number(options.minContainerWidth) || 200;
- const minContainerHeight = Number(options.minContainerHeight) || 100;
+ const minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH;
+ const minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT;
- if (this.disabled || containerData.width <= minContainerWidth ||
- containerData.height <= minContainerHeight) {
+ if (this.disabled || containerData.width <= minContainerWidth
+ || containerData.height <= minContainerHeight) {
return;
}
@@ -49,10 +52,10 @@ export default {
this.render();
if (options.restore) {
- this.setCanvasData(each(canvasData, (n, i) => {
+ this.setCanvasData(forEach(canvasData, (n, i) => {
canvasData[i] = n * ratio;
}));
- this.setCropBoxData(each(cropBoxData, (n, i) => {
+ this.setCropBoxData(forEach(cropBoxData, (n, i) => {
cropBoxData[i] = n * ratio;
}));
}
@@ -67,7 +70,7 @@ export default {
this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
},
- wheel(e) {
+ wheel(event) {
const ratio = Number(this.options.wheelZoomRatio) || 0.1;
let delta = 1;
@@ -75,7 +78,7 @@ export default {
return;
}
- e.preventDefault();
+ event.preventDefault();
// Limit wheel speed to prevent zoom too fast (#21)
if (this.wheeling) {
@@ -88,39 +91,56 @@ export default {
this.wheeling = false;
}, 50);
- if (e.deltaY) {
- delta = e.deltaY > 0 ? 1 : -1;
- } else if (e.wheelDelta) {
- delta = -e.wheelDelta / 120;
- } else if (e.detail) {
- delta = e.detail > 0 ? 1 : -1;
+ if (event.deltaY) {
+ delta = event.deltaY > 0 ? 1 : -1;
+ } else if (event.wheelDelta) {
+ delta = -event.wheelDelta / 120;
+ } else if (event.detail) {
+ delta = event.detail > 0 ? 1 : -1;
}
- this.zoom(-delta * ratio, e);
+ this.zoom(-delta * ratio, event);
},
- cropStart(e) {
- if (this.disabled) {
+ cropStart(event) {
+ const { buttons, button } = event;
+
+ if (
+ this.disabled
+
+ // Handle mouse event and pointer event and ignore touch event
+ || ((
+ event.type === 'mousedown'
+ || (event.type === 'pointerdown' && event.pointerType === 'mouse')
+ ) && (
+ // No primary button (Usually the left button)
+ (isNumber(buttons) && buttons !== 1)
+ || (isNumber(button) && button !== 0)
+
+ // Open context menu
+ || event.ctrlKey
+ ))
+ ) {
return;
}
const { options, pointers } = this;
let action;
- if (e.changedTouches) {
+ if (event.changedTouches) {
// Handle touch event
- each(e.changedTouches, (touch) => {
+ forEach(event.changedTouches, (touch) => {
pointers[touch.identifier] = getPointer(touch);
});
} else {
// Handle mouse event and pointer event
- pointers[e.pointerId || 0] = getPointer(e);
+ pointers[event.pointerId || 0] = getPointer(event);
}
if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
action = ACTION_ZOOM;
} else {
- action = getData(e.target, DATA_ACTION);
+ action = getData(event.target, DATA_ACTION);
}
if (!REGEXP_ACTIONS.test(action)) {
@@ -128,13 +148,14 @@ export default {
}
if (dispatchEvent(this.element, EVENT_CROP_START, {
- originalEvent: e,
+ originalEvent: event,
action,
}) === false) {
return;
}
- e.preventDefault();
+ // This line is required for preventing page zooming in iOS browsers
+ event.preventDefault();
this.action = action;
this.cropping = false;
@@ -145,7 +166,7 @@ export default {
}
},
- cropMove(e) {
+ cropMove(event) {
const { action } = this;
if (this.disabled || !action) {
@@ -154,46 +175,47 @@ export default {
const { pointers } = this;
- e.preventDefault();
+ event.preventDefault();
if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
- originalEvent: e,
+ originalEvent: event,
action,
}) === false) {
return;
}
- if (e.changedTouches) {
- each(e.changedTouches, (touch) => {
- extend(pointers[touch.identifier], getPointer(touch, true));
+ if (event.changedTouches) {
+ forEach(event.changedTouches, (touch) => {
+ // The first parameter should not be undefined (#432)
+ assign(pointers[touch.identifier] || {}, getPointer(touch, true));
});
} else {
- extend(pointers[e.pointerId || 0], getPointer(e, true));
+ assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
}
- this.change(e);
+ this.change(event);
},
- cropEnd(e) {
+ cropEnd(event) {
if (this.disabled) {
return;
}
const { action, pointers } = this;
- if (e.changedTouches) {
- each(e.changedTouches, (touch) => {
+ if (event.changedTouches) {
+ forEach(event.changedTouches, (touch) => {
delete pointers[touch.identifier];
});
} else {
- delete pointers[e.pointerId || 0];
+ delete pointers[event.pointerId || 0];
}
if (!action) {
return;
}
- e.preventDefault();
+ event.preventDefault();
if (!Object.keys(pointers).length) {
this.action = '';
@@ -205,7 +227,7 @@ export default {
}
dispatchEvent(this.element, EVENT_CROP_END, {
- originalEvent: e,
+ originalEvent: event,
action,
});
},
diff --git a/library/cropperjs/src/js/methods.js b/library/cropperjs/src/js/methods.js
index 3627d2bd1..574ac2a71 100644
--- a/library/cropperjs/src/js/methods.js
+++ b/library/cropperjs/src/js/methods.js
@@ -8,27 +8,23 @@ import {
DRAG_MODE_CROP,
DRAG_MODE_MOVE,
DRAG_MODE_NONE,
- EVENT_LOAD,
EVENT_ZOOM,
NAMESPACE,
} from './constants';
import {
addClass,
+ assign,
dispatchEvent,
- each,
- extend,
+ forEach,
getAdjustedSizes,
getOffset,
getPointersCenter,
getSourceCanvas,
- isFunction,
isNumber,
isPlainObject,
isUndefined,
normalizeDecimalNumber,
removeClass,
- removeData,
- removeListener,
setData,
toggleClass,
} from './utilities';
@@ -36,18 +32,15 @@ import {
export default {
// Show the crop box manually
crop() {
- if (this.ready && !this.disabled) {
- if (!this.cropped) {
- this.cropped = true;
- this.limitCropBox(true, true);
-
- if (this.options.modal) {
- addClass(this.dragBox, CLASS_MODAL);
- }
+ if (this.ready && !this.cropped && !this.disabled) {
+ this.cropped = true;
+ this.limitCropBox(true, true);
- removeClass(this.cropBox, CLASS_HIDDEN);
+ if (this.options.modal) {
+ addClass(this.dragBox, CLASS_MODAL);
}
+ removeClass(this.cropBox, CLASS_HIDDEN);
this.setCropBoxData(this.initialCropBoxData);
}
@@ -57,9 +50,9 @@ export default {
// Reset the image and crop box to their initial states
reset() {
if (this.ready && !this.disabled) {
- this.imageData = extend({}, this.initialImageData);
- this.canvasData = extend({}, this.initialCanvasData);
- this.cropBoxData = extend({}, this.initialCropBoxData);
+ this.imageData = assign({}, this.initialImageData);
+ this.canvasData = assign({}, this.initialCanvasData);
+ this.cropBoxData = assign({}, this.initialCropBoxData);
this.renderCanvas();
if (this.cropped) {
@@ -73,7 +66,7 @@ export default {
// Clear the crop box
clear() {
if (this.cropped && !this.disabled) {
- extend(this.cropBoxData, {
+ assign(this.cropBoxData, {
left: 0,
top: 0,
width: 0,
@@ -96,23 +89,23 @@ export default {
/**
* Replace the image's src and rebuild the cropper
* @param {string} url - The new URL.
- * @param {boolean} [onlyColorChanged] - Indicate if the new image only changed color.
- * @returns {Object} this
+ * @param {boolean} [hasSameSize] - Indicate if the new image has the same size as the old one.
+ * @returns {Cropper} this
*/
- replace(url, onlyColorChanged = false) {
+ replace(url, hasSameSize = false) {
if (!this.disabled && url) {
if (this.isImg) {
this.element.src = url;
}
- if (onlyColorChanged) {
+ if (hasSameSize) {
this.url = url;
this.image.src = url;
if (this.ready) {
- this.image2.src = url;
+ this.viewBoxImage.src = url;
- each(this.previews, (element) => {
+ forEach(this.previews, (element) => {
element.getElementsByTagName('img')[0].src = url;
});
}
@@ -121,8 +114,8 @@ export default {
this.replaced = true;
}
- // Clear previous data
this.options.data = null;
+ this.uncreate();
this.load(url);
}
}
@@ -132,7 +125,7 @@ export default {
// Enable (unfreeze) the cropper
enable() {
- if (this.ready) {
+ if (this.ready && this.disabled) {
this.disabled = false;
removeClass(this.cropper, CLASS_DISABLED);
}
@@ -142,7 +135,7 @@ export default {
// Disable (freeze) the cropper
disable() {
- if (this.ready) {
+ if (this.ready && !this.disabled) {
this.disabled = true;
addClass(this.cropper, CLASS_DISABLED);
}
@@ -150,35 +143,34 @@ export default {
return this;
},
- // Destroy the cropper and remove the instance from the image
+ /**
+ * Destroy the cropper and remove the instance from the image
+ * @returns {Cropper} this
+ */
destroy() {
- const { element, image } = this;
-
- if (this.loaded) {
- if (this.isImg && this.replaced) {
- element.src = this.originalUrl;
- }
+ const { element } = this;
- this.unbuild();
- removeClass(element, CLASS_HIDDEN);
- } else if (this.isImg) {
- removeListener(element, EVENT_LOAD, this.onStart);
- } else if (image) {
- image.parentNode.removeChild(image);
+ if (!element[NAMESPACE]) {
+ return this;
}
- removeData(element, NAMESPACE);
+ element[NAMESPACE] = undefined;
+ if (this.isImg && this.replaced) {
+ element.src = this.originalUrl;
+ }
+
+ this.uncreate();
return this;
},
/**
* Move the canvas with relative offsets
* @param {number} offsetX - The relative offset distance on the x-axis.
- * @param {number} offsetY - The relative offset distance on the y-axis.
- * @returns {Object} this
+ * @param {number} [offsetY=offsetX] - The relative offset distance on the y-axis.
+ * @returns {Cropper} this
*/
- move(offsetX, offsetY) {
+ move(offsetX, offsetY = offsetX) {
const { left, top } = this.canvasData;
return this.moveTo(
@@ -191,7 +183,7 @@ export default {
* Move the canvas to an absolute point
* @param {number} x - The x-axis coordinate.
* @param {number} [y=x] - The y-axis coordinate.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
moveTo(x, y = x) {
const { canvasData } = this;
@@ -223,7 +215,7 @@ export default {
* Zoom the canvas with a relative ratio
* @param {number} ratio - The target ratio.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoom(ratio, _originalEvent) {
const { canvasData } = this;
@@ -244,7 +236,7 @@ export default {
* @param {number} ratio - The target ratio.
* @param {Object} pivot - The zoom pivot point coordinate.
* @param {Event} _originalEvent - The original event if any.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
zoomTo(ratio, pivot, _originalEvent) {
const { options, canvasData } = this;
@@ -262,9 +254,9 @@ export default {
const newHeight = naturalHeight * ratio;
if (dispatchEvent(this.element, EVENT_ZOOM, {
- originalEvent: _originalEvent,
+ ratio,
oldRatio: width / naturalWidth,
- ratio: newWidth / naturalWidth,
+ originalEvent: _originalEvent,
}) === false) {
return this;
}
@@ -308,7 +300,7 @@ export default {
/**
* Rotate the canvas with a relative degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotate(degree) {
return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
@@ -317,7 +309,7 @@ export default {
/**
* Rotate the canvas to an absolute degree
* @param {number} degree - The rotate degree.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
rotateTo(degree) {
degree = Number(degree);
@@ -333,7 +325,7 @@ export default {
/**
* Scale the image on the x-axis.
* @param {number} scaleX - The scale ratio on the x-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleX(scaleX) {
const { scaleY } = this.imageData;
@@ -344,7 +336,7 @@ export default {
/**
* Scale the image on the y-axis.
* @param {number} scaleY - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scaleY(scaleY) {
const { scaleX } = this.imageData;
@@ -356,7 +348,7 @@ export default {
* Scale the image
* @param {number} scaleX - The scale ratio on the x-axis.
* @param {number} [scaleY=scaleX] - The scale ratio on the y-axis.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
scale(scaleX, scaleY = scaleX) {
const { imageData } = this;
@@ -408,10 +400,21 @@ export default {
const ratio = imageData.width / imageData.naturalWidth;
- each(data, (n, i) => {
- n /= ratio;
- data[i] = rounded ? Math.round(n) : n;
+ forEach(data, (n, i) => {
+ data[i] = n / ratio;
});
+
+ if (rounded) {
+ // In case rounding off leads to extra 1px in right or bottom border
+ // we should round the top-left corner and the dimension (#343).
+ const bottom = Math.round(data.y + data.height);
+ const right = Math.round(data.x + data.width);
+
+ data.x = Math.round(data.x);
+ data.y = Math.round(data.y);
+ data.width = right - data.x;
+ data.height = bottom - data.y;
+ }
} else {
data = {
x: 0,
@@ -436,16 +439,12 @@ export default {
/**
* Set the cropped area position and size with new data
* @param {Object} data - The new data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setData(data) {
const { options, imageData, canvasData } = this;
const cropBoxData = {};
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
let transformed = false;
@@ -501,7 +500,7 @@ export default {
* @returns {Object} The result container data.
*/
getContainerData() {
- return this.ready ? extend({}, this.containerData) : {};
+ return this.ready ? assign({}, this.containerData) : {};
},
/**
@@ -509,7 +508,7 @@ export default {
* @returns {Object} The result image data.
*/
getImageData() {
- return this.loaded ? extend({}, this.imageData) : {};
+ return this.sized ? assign({}, this.imageData) : {};
},
/**
@@ -521,7 +520,7 @@ export default {
const data = {};
if (this.ready) {
- each([
+ forEach([
'left',
'top',
'width',
@@ -539,16 +538,12 @@ export default {
/**
* Set the canvas position and size with new data.
* @param {Object} data - The new canvas data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCanvasData(data) {
const { canvasData } = this;
const { aspectRatio } = canvasData;
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
canvasData.left = data.left;
@@ -595,7 +590,7 @@ export default {
/**
* Set the crop box position and size with new data.
* @param {Object} data - The new crop box data.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setCropBoxData(data) {
const { cropBoxData } = this;
@@ -603,10 +598,6 @@ export default {
let widthChanged;
let heightChanged;
- if (isFunction(data)) {
- data = data.call(this.element);
- }
-
if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
cropBoxData.left = data.left;
@@ -761,8 +752,6 @@ export default {
dstHeight = srcHeight;
}
- // All the numerical parameters should be integer for `drawImage`
- // https://github.com/fengyuanchen/cropper/issues/476
const params = [
srcX,
srcY,
@@ -782,7 +771,9 @@ export default {
);
}
- context.drawImage(source, ...params.map(param => Math.floor(normalizeDecimalNumber(param))));
+ // All the numerical parameters should be integer for `drawImage`
+ // https://github.com/fengyuanchen/cropper/issues/476
+ context.drawImage(source, ...params.map((param) => Math.floor(normalizeDecimalNumber(param))));
return canvas;
},
@@ -790,7 +781,7 @@ export default {
/**
* Change the aspect ratio of the crop box.
* @param {number} aspectRatio - The new aspect ratio.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setAspectRatio(aspectRatio) {
const { options } = this;
@@ -814,17 +805,18 @@ export default {
/**
* Change the drag mode.
* @param {string} mode - The new drag mode.
- * @returns {Object} this
+ * @returns {Cropper} this
*/
setDragMode(mode) {
const { options, dragBox, face } = this;
- if (this.loaded && !this.disabled) {
+ if (this.ready && !this.disabled) {
const croppable = mode === DRAG_MODE_CROP;
const movable = options.movable && mode === DRAG_MODE_MOVE;
mode = (croppable || movable) ? mode : DRAG_MODE_NONE;
+ options.dragMode = mode;
setData(dragBox, DATA_ACTION, mode);
toggleClass(dragBox, CLASS_CROP, croppable);
toggleClass(dragBox, CLASS_MOVE, movable);
diff --git a/library/cropperjs/src/js/preview.js b/library/cropperjs/src/js/preview.js
index c47d03f4b..b73ac391c 100644
--- a/library/cropperjs/src/js/preview.js
+++ b/library/cropperjs/src/js/preview.js
@@ -1,10 +1,7 @@
+import { DATA_PREVIEW } from './constants';
import {
- DATA_PREVIEW,
-} from './constants';
-import {
- each,
- empty,
- extend,
+ assign,
+ forEach,
getData,
getTransforms,
removeData,
@@ -14,9 +11,10 @@ import {
export default {
initPreview() {
- const { crossOrigin } = this;
+ const { element, crossOrigin } = this;
const { preview } = this.options;
const url = crossOrigin ? this.crossOriginUrl : this.url;
+ const alt = element.alt || 'The image to preview';
const image = document.createElement('img');
if (crossOrigin) {
@@ -24,25 +22,32 @@ export default {
}
image.src = url;
+ image.alt = alt;
this.viewBox.appendChild(image);
- this.image2 = image;
+ this.viewBoxImage = image;
if (!preview) {
return;
}
- const previews = preview.querySelector ? [preview] : document.querySelectorAll(preview);
+ let previews = preview;
+
+ if (typeof preview === 'string') {
+ previews = element.ownerDocument.querySelectorAll(preview);
+ } else if (preview.querySelector) {
+ previews = [preview];
+ }
this.previews = previews;
- each(previews, (element) => {
+ forEach(previews, (el) => {
const img = document.createElement('img');
// Save the original size for recover
- setData(element, DATA_PREVIEW, {
- width: element.offsetWidth,
- height: element.offsetHeight,
- html: element.innerHTML,
+ setData(el, DATA_PREVIEW, {
+ width: el.offsetWidth,
+ height: el.offsetHeight,
+ html: el.innerHTML,
});
if (crossOrigin) {
@@ -50,6 +55,7 @@ export default {
}
img.src = url;
+ img.alt = alt;
/**
* Override img element styles
@@ -58,23 +64,23 @@ export default {
* (Occur only when margin-top <= -height)
*/
img.style.cssText = (
- 'display:block;' +
- 'width:100%;' +
- 'height:auto;' +
- 'min-width:0!important;' +
- 'min-height:0!important;' +
- 'max-width:none!important;' +
- 'max-height:none!important;' +
- 'image-orientation:0deg!important;"'
+ 'display:block;'
+ + 'width:100%;'
+ + 'height:auto;'
+ + 'min-width:0!important;'
+ + 'min-height:0!important;'
+ + 'max-width:none!important;'
+ + 'max-height:none!important;'
+ + 'image-orientation:0deg!important;"'
);
- empty(element);
- element.appendChild(img);
+ el.innerHTML = '';
+ el.appendChild(img);
});
},
resetPreview() {
- each(this.previews, (element) => {
+ forEach(this.previews, (element) => {
const data = getData(element, DATA_PREVIEW);
setStyle(element, {
@@ -98,15 +104,15 @@ export default {
return;
}
- setStyle(this.image2, extend({
+ setStyle(this.viewBoxImage, assign({
width,
height,
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left,
translateY: -top,
}, imageData))));
- each(this.previews, (element) => {
+ forEach(this.previews, (element) => {
const data = getData(element, DATA_PREVIEW);
const originalWidth = data.width;
const originalHeight = data.height;
@@ -130,10 +136,10 @@ export default {
height: newHeight,
});
- setStyle(element.getElementsByTagName('img')[0], extend({
+ setStyle(element.getElementsByTagName('img')[0], assign({
width: width * ratio,
height: height * ratio,
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: -left * ratio,
translateY: -top * ratio,
}, imageData))));
diff --git a/library/cropperjs/src/js/render.js b/library/cropperjs/src/js/render.js
index 09085ce41..ab8262d33 100644
--- a/library/cropperjs/src/js/render.js
+++ b/library/cropperjs/src/js/render.js
@@ -7,8 +7,8 @@ import {
} from './constants';
import {
addClass,
+ assign,
dispatchEvent,
- extend,
getAdjustedSizes,
getRotatedSizes,
getTransforms,
@@ -101,8 +101,8 @@ export default {
this.canvasData = canvasData;
this.limited = (viewMode === 1 || viewMode === 2);
this.limitCanvas(true, true);
- this.initialImageData = extend({}, imageData);
- this.initialCanvasData = extend({}, canvasData);
+ this.initialImageData = assign({}, imageData);
+ this.initialCanvasData = assign({}, canvasData);
},
limitCanvas(sizeLimited, positionLimited) {
@@ -158,7 +158,7 @@ export default {
aspectRatio,
width: minCanvasWidth,
height: minCanvasHeight,
- }, 'cover'));
+ }));
canvasData.minWidth = minCanvasWidth;
canvasData.minHeight = minCanvasHeight;
@@ -167,7 +167,7 @@ export default {
}
if (positionLimited) {
- if (viewMode) {
+ if (viewMode > (cropped ? 0 : 1)) {
const newCanvasLeft = containerData.width - canvasData.width;
const newCanvasTop = containerData.height - canvasData.height;
@@ -231,13 +231,13 @@ export default {
this.limitCanvas(true, false);
}
- if (canvasData.width > canvasData.maxWidth ||
- canvasData.width < canvasData.minWidth) {
+ if (canvasData.width > canvasData.maxWidth
+ || canvasData.width < canvasData.minWidth) {
canvasData.left = canvasData.oldLeft;
}
- if (canvasData.height > canvasData.maxHeight ||
- canvasData.height < canvasData.minHeight) {
+ if (canvasData.height > canvasData.maxHeight
+ || canvasData.height < canvasData.minHeight) {
canvasData.top = canvasData.oldTop;
}
@@ -263,7 +263,7 @@ export default {
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
- setStyle(this.canvas, extend({
+ setStyle(this.canvas, assign({
width: canvasData.width,
height: canvasData.height,
}, getTransforms({
@@ -283,16 +283,16 @@ export default {
const width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
const height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
- extend(imageData, {
+ assign(imageData, {
width,
height,
left: (canvasData.width - width) / 2,
top: (canvasData.height - height) / 2,
});
- setStyle(this.image, extend({
+ setStyle(this.image, assign({
width: imageData.width,
height: imageData.height,
- }, getTransforms(extend({
+ }, getTransforms(assign({
translateX: imageData.left,
translateY: imageData.top,
}, imageData))));
@@ -304,7 +304,7 @@ export default {
initCropBox() {
const { options, canvasData } = this;
- const { aspectRatio } = options;
+ const aspectRatio = options.aspectRatio || options.initialAspectRatio;
const autoCropArea = Number(options.autoCropArea) || 0.8;
const cropBoxData = {
width: canvasData.width,
@@ -350,7 +350,7 @@ export default {
cropBoxData.oldLeft = cropBoxData.left;
cropBoxData.oldTop = cropBoxData.top;
- this.initialCropBoxData = extend({}, cropBoxData);
+ this.initialCropBoxData = assign({}, cropBoxData);
},
limitCropBox(sizeLimited, positionLimited) {
@@ -366,14 +366,18 @@ export default {
if (sizeLimited) {
let minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
let minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
- let maxCropBoxWidth = Math.min(
+ let maxCropBoxWidth = limited ? Math.min(
containerData.width,
- limited ? canvasData.width : containerData.width,
- );
- let maxCropBoxHeight = Math.min(
+ canvasData.width,
+ canvasData.width + canvasData.left,
+ containerData.width - canvasData.left,
+ ) : containerData.width;
+ let maxCropBoxHeight = limited ? Math.min(
containerData.height,
- limited ? canvasData.height : containerData.height,
- );
+ canvasData.height,
+ canvasData.height + canvasData.top,
+ containerData.height - canvasData.top,
+ ) : containerData.height;
// The min/maxCropBoxWidth/Height must be less than container's width/height
minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
@@ -430,13 +434,13 @@ export default {
renderCropBox() {
const { options, containerData, cropBoxData } = this;
- if (cropBoxData.width > cropBoxData.maxWidth ||
- cropBoxData.width < cropBoxData.minWidth) {
+ if (cropBoxData.width > cropBoxData.maxWidth
+ || cropBoxData.width < cropBoxData.minWidth) {
cropBoxData.left = cropBoxData.oldLeft;
}
- if (cropBoxData.height > cropBoxData.maxHeight ||
- cropBoxData.height < cropBoxData.minHeight) {
+ if (cropBoxData.height > cropBoxData.maxHeight
+ || cropBoxData.height < cropBoxData.minHeight) {
cropBoxData.top = cropBoxData.oldTop;
}
@@ -464,11 +468,11 @@ export default {
if (options.movable && options.cropBoxMovable) {
// Turn to move the canvas when the crop box is equal to the container
- setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width &&
- cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
+ setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width
+ && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
}
- setStyle(this.cropBox, extend({
+ setStyle(this.cropBox, assign({
width: cropBoxData.width,
height: cropBoxData.height,
}, getTransforms({
@@ -487,9 +491,6 @@ export default {
output() {
this.preview();
-
- if (this.complete) {
- dispatchEvent(this.element, EVENT_CROP, this.getData());
- }
+ dispatchEvent(this.element, EVENT_CROP, this.getData());
},
};
diff --git a/library/cropperjs/src/js/template.js b/library/cropperjs/src/js/template.js
index 589b46a78..e14ce750b 100644
--- a/library/cropperjs/src/js/template.js
+++ b/library/cropperjs/src/js/template.js
@@ -1,27 +1,27 @@
export default (
- '<div class="cropper-container">' +
- '<div class="cropper-wrap-box">' +
- '<div class="cropper-canvas"></div>' +
- '</div>' +
- '<div class="cropper-drag-box"></div>' +
- '<div class="cropper-crop-box">' +
- '<span class="cropper-view-box"></span>' +
- '<span class="cropper-dashed dashed-h"></span>' +
- '<span class="cropper-dashed dashed-v"></span>' +
- '<span class="cropper-center"></span>' +
- '<span class="cropper-face"></span>' +
- '<span class="cropper-line line-e" data-action="e"></span>' +
- '<span class="cropper-line line-n" data-action="n"></span>' +
- '<span class="cropper-line line-w" data-action="w"></span>' +
- '<span class="cropper-line line-s" data-action="s"></span>' +
- '<span class="cropper-point point-e" data-action="e"></span>' +
- '<span class="cropper-point point-n" data-action="n"></span>' +
- '<span class="cropper-point point-w" data-action="w"></span>' +
- '<span class="cropper-point point-s" data-action="s"></span>' +
- '<span class="cropper-point point-ne" data-action="ne"></span>' +
- '<span class="cropper-point point-nw" data-action="nw"></span>' +
- '<span class="cropper-point point-sw" data-action="sw"></span>' +
- '<span class="cropper-point point-se" data-action="se"></span>' +
- '</div>' +
- '</div>'
+ '<div class="cropper-container" touch-action="none">'
+ + '<div class="cropper-wrap-box">'
+ + '<div class="cropper-canvas"></div>'
+ + '</div>'
+ + '<div class="cropper-drag-box"></div>'
+ + '<div class="cropper-crop-box">'
+ + '<span class="cropper-view-box"></span>'
+ + '<span class="cropper-dashed dashed-h"></span>'
+ + '<span class="cropper-dashed dashed-v"></span>'
+ + '<span class="cropper-center"></span>'
+ + '<span class="cropper-face"></span>'
+ + '<span class="cropper-line line-e" data-cropper-action="e"></span>'
+ + '<span class="cropper-line line-n" data-cropper-action="n"></span>'
+ + '<span class="cropper-line line-w" data-cropper-action="w"></span>'
+ + '<span class="cropper-line line-s" data-cropper-action="s"></span>'
+ + '<span class="cropper-point point-e" data-cropper-action="e"></span>'
+ + '<span class="cropper-point point-n" data-cropper-action="n"></span>'
+ + '<span class="cropper-point point-w" data-cropper-action="w"></span>'
+ + '<span class="cropper-point point-s" data-cropper-action="s"></span>'
+ + '<span class="cropper-point point-ne" data-cropper-action="ne"></span>'
+ + '<span class="cropper-point point-nw" data-cropper-action="nw"></span>'
+ + '<span class="cropper-point point-sw" data-cropper-action="sw"></span>'
+ + '<span class="cropper-point point-se" data-cropper-action="se"></span>'
+ + '</div>'
+ + '</div>'
);
diff --git a/library/cropperjs/src/js/utilities.js b/library/cropperjs/src/js/utilities.js
index 50b586a76..bb5c7c24c 100644
--- a/library/cropperjs/src/js/utilities.js
+++ b/library/cropperjs/src/js/utilities.js
@@ -1,6 +1,4 @@
-import {
- WINDOW,
-} from './constants';
+import { IS_BROWSER, WINDOW } from './constants';
/**
* Check if the given value is not a number.
@@ -17,6 +15,13 @@ export function isNumber(value) {
}
/**
+ * Check if the given value is a positive number.
+ * @param {*} value - The value to check.
+ * @returns {boolean} Returns `true` if the given value is a positive number, else `false`.
+ */
+export const isPositiveNumber = (value) => value > 0 && value < Infinity;
+
+/**
* Check if the given value is undefined.
* @param {*} value - The value to check.
* @returns {boolean} Returns `true` if the given value is undefined, else `false`.
@@ -51,7 +56,7 @@ export function isPlainObject(value) {
const { prototype } = constructor;
return constructor && prototype && hasOwnProperty.call(prototype, 'isPrototypeOf');
- } catch (e) {
+ } catch (error) {
return false;
}
}
@@ -65,23 +70,29 @@ export function isFunction(value) {
return typeof value === 'function';
}
+const { slice } = Array.prototype;
+
+/**
+ * Convert array-like or iterable object to an array.
+ * @param {*} value - The value to convert.
+ * @returns {Array} Returns a new array.
+ */
+export function toArray(value) {
+ return Array.from ? Array.from(value) : slice.call(value);
+}
+
/**
* Iterate the given data.
* @param {*} data - The data to iterate.
* @param {Function} callback - The process function for each element.
* @returns {*} The original data.
*/
-export function each(data, callback) {
+export function forEach(data, callback) {
if (data && isFunction(callback)) {
if (Array.isArray(data) || isNumber(data.length)/* array-like */) {
- const { length } = data;
- let i;
-
- for (i = 0; i < length; i += 1) {
- if (callback.call(data, data[i], i, data) === false) {
- break;
- }
- }
+ toArray(data).forEach((value, key) => {
+ callback.call(data, value, key, data);
+ });
} else if (isObject(data)) {
Object.keys(data).forEach((key) => {
callback.call(data, data[key], key, data);
@@ -94,43 +105,29 @@ export function each(data, callback) {
/**
* Extend the given object.
- * @param {*} obj - The object to be extended.
- * @param {*} args - The rest objects which will be merged to the first object.
+ * @param {*} target - The target object to extend.
+ * @param {*} args - The rest objects for merging to the target object.
* @returns {Object} The extended object.
*/
-export function extend(obj, ...args) {
- if (isObject(obj) && args.length > 0) {
- if (Object.assign) {
- return Object.assign(obj, ...args);
- }
-
+export const assign = Object.assign || function assign(target, ...args) {
+ if (isObject(target) && args.length > 0) {
args.forEach((arg) => {
if (isObject(arg)) {
Object.keys(arg).forEach((key) => {
- obj[key] = arg[key];
+ target[key] = arg[key];
});
}
});
}
- return obj;
-}
-
-/**
- * Takes a function and returns a new one that will always have a particular context.
- * @param {Function} fn - The target function.
- * @param {Object} context - The new context for the function.
- * @returns {boolean} The new function.
- */
-export function proxy(fn, context, ...args) {
- return (...args2) => fn.apply(context, args.concat(args2));
-}
+ return target;
+};
-const REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/i;
+const REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
/**
* Normalize decimal number.
- * Check out {@link http://0.30000000000000004.com/ }
+ * Check out {@link http://0.30000000000000004.com/}
* @param {number} value - The value to normalize.
* @param {number} [times=100000000000] - The times for normalizing.
* @returns {number} Returns the normalized number.
@@ -139,7 +136,7 @@ export function normalizeDecimalNumber(value, times = 100000000000) {
return REGEXP_DECIMALS.test(value) ? (Math.round(value * times) / times) : value;
}
-const REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/;
+const REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
/**
* Apply styles to the given element.
@@ -149,9 +146,9 @@ const REGEXP_SUFFIX = /^(?:width|height|left|top|marginLeft|marginTop)$/;
export function setStyle(element, styles) {
const { style } = element;
- each(styles, (value, property) => {
+ forEach(styles, (value, property) => {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
- value += 'px';
+ value = `${value}px`;
}
style[property] = value;
@@ -165,9 +162,9 @@ export function setStyle(element, styles) {
* @returns {boolean} Returns `true` if the special class was found.
*/
export function hasClass(element, value) {
- return element.classList ?
- element.classList.contains(value) :
- element.className.indexOf(value) > -1;
+ return element.classList
+ ? element.classList.contains(value)
+ : element.className.indexOf(value) > -1;
}
/**
@@ -181,7 +178,7 @@ export function addClass(element, value) {
}
if (isNumber(element.length)) {
- each(element, (elem) => {
+ forEach(element, (elem) => {
addClass(elem, value);
});
return;
@@ -212,7 +209,7 @@ export function removeClass(element, value) {
}
if (isNumber(element.length)) {
- each(element, (elem) => {
+ forEach(element, (elem) => {
removeClass(elem, value);
});
return;
@@ -240,7 +237,7 @@ export function toggleClass(element, value, added) {
}
if (isNumber(element.length)) {
- each(element, (elem) => {
+ forEach(element, (elem) => {
toggleClass(elem, value, added);
});
return;
@@ -254,15 +251,15 @@ export function toggleClass(element, value, added) {
}
}
-const REGEXP_HYPHENATE = /([a-z\d])([A-Z])/g;
+const REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
/**
- * Hyphenate the given value.
- * @param {string} value - The value to hyphenate.
- * @returns {string} The hyphenated value.
+ * Transform the given string from camelCase to kebab-case
+ * @param {string} value - The value to transform.
+ * @returns {string} The transformed value.
*/
-export function hyphenate(value) {
- return value.replace(REGEXP_HYPHENATE, '$1-$2').toLowerCase();
+export function toParamCase(value) {
+ return value.replace(REGEXP_CAMEL_CASE, '$1-$2').toLowerCase();
}
/**
@@ -274,11 +271,13 @@ export function hyphenate(value) {
export function getData(element, name) {
if (isObject(element[name])) {
return element[name];
- } else if (element.dataset) {
+ }
+
+ if (element.dataset) {
return element.dataset[name];
}
- return element.getAttribute(`data-${hyphenate(name)}`);
+ return element.getAttribute(`data-${toParamCase(name)}`);
}
/**
@@ -293,7 +292,7 @@ export function setData(element, name, data) {
} else if (element.dataset) {
element.dataset[name] = data;
} else {
- element.setAttribute(`data-${hyphenate(name)}`, data);
+ element.setAttribute(`data-${toParamCase(name)}`, data);
}
}
@@ -306,22 +305,50 @@ export function removeData(element, name) {
if (isObject(element[name])) {
try {
delete element[name];
- } catch (e) {
- element[name] = null;
+ } catch (error) {
+ element[name] = undefined;
}
} else if (element.dataset) {
// #128 Safari not allows to delete dataset property
try {
delete element.dataset[name];
- } catch (e) {
- element.dataset[name] = null;
+ } catch (error) {
+ element.dataset[name] = undefined;
}
} else {
- element.removeAttribute(`data-${hyphenate(name)}`);
+ element.removeAttribute(`data-${toParamCase(name)}`);
}
}
const REGEXP_SPACES = /\s\s*/;
+const onceSupported = (() => {
+ let supported = false;
+
+ if (IS_BROWSER) {
+ let once = false;
+ const listener = () => {};
+ const options = Object.defineProperty({}, 'once', {
+ get() {
+ supported = true;
+ return once;
+ },
+
+ /**
+ * This setter can fix a `TypeError` in strict mode
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only}
+ * @param {boolean} value - The value to set
+ */
+ set(value) {
+ once = value;
+ },
+ });
+
+ WINDOW.addEventListener('test', listener, options);
+ WINDOW.removeEventListener('test', listener, options);
+ }
+
+ return supported;
+})();
/**
* Remove event listener from the target element.
@@ -331,24 +358,28 @@ const REGEXP_SPACES = /\s\s*/;
* @param {Object} options - The event options.
*/
export function removeListener(element, type, listener, options = {}) {
- if (!isFunction(listener)) {
- return;
- }
+ let handler = listener;
- const types = type.trim().split(REGEXP_SPACES);
+ type.trim().split(REGEXP_SPACES).forEach((event) => {
+ if (!onceSupported) {
+ const { listeners } = element;
- if (types.length > 1) {
- each(types, (t) => {
- removeListener(element, t, listener, options);
- });
- return;
- }
+ if (listeners && listeners[event] && listeners[event][listener]) {
+ handler = listeners[event][listener];
+ delete listeners[event][listener];
- if (element.removeEventListener) {
- element.removeEventListener(type, listener, options);
- } else if (element.detachEvent) {
- element.detachEvent(`on${type}`, listener);
- }
+ if (Object.keys(listeners[event]).length === 0) {
+ delete listeners[event];
+ }
+
+ if (Object.keys(listeners).length === 0) {
+ delete element.listeners;
+ }
+ }
+ }
+
+ element.removeEventListener(event, handler, options);
+ });
}
/**
@@ -359,33 +390,32 @@ export function removeListener(element, type, listener, options = {}) {
* @param {Object} options - The event options.
*/
export function addListener(element, type, listener, options = {}) {
- if (!isFunction(listener)) {
- return;
- }
+ let handler = listener;
- const types = type.trim().split(REGEXP_SPACES);
+ type.trim().split(REGEXP_SPACES).forEach((event) => {
+ if (options.once && !onceSupported) {
+ const { listeners = {} } = element;
- if (types.length > 1) {
- each(types, (t) => {
- addListener(element, t, listener, options);
- });
- return;
- }
+ handler = (...args) => {
+ delete listeners[event][listener];
+ element.removeEventListener(event, handler, options);
+ listener.apply(element, args);
+ };
- if (options.once) {
- const originalListener = listener;
+ if (!listeners[event]) {
+ listeners[event] = {};
+ }
- listener = (...args) => {
- removeListener(element, type, listener, options);
- return originalListener.apply(element, args);
- };
- }
+ if (listeners[event][listener]) {
+ element.removeEventListener(event, listeners[event][listener], options);
+ }
- if (element.addEventListener) {
- element.addEventListener(type, listener, options);
- } else if (element.attachEvent) {
- element.attachEvent(`on${type}`, listener);
- }
+ listeners[event][listener] = handler;
+ element.listeners = listeners;
+ }
+
+ element.addEventListener(event, handler, options);
+ });
}
/**
@@ -396,39 +426,21 @@ export function addListener(element, type, listener, options = {}) {
* @returns {boolean} Indicate if the event is default prevented or not.
*/
export function dispatchEvent(element, type, data) {
- if (element.dispatchEvent) {
- let event;
-
- // Event and CustomEvent on IE9-11 are global objects, not constructors
- if (isFunction(Event) && isFunction(CustomEvent)) {
- if (isUndefined(data)) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true,
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true,
- });
- }
- } else if (isUndefined(data)) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
- } else {
- event = document.createEvent('CustomEvent');
- event.initCustomEvent(type, true, true, data);
- }
-
- // IE9+
- return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent(`on${type}`);
+ let event;
+
+ // Event and CustomEvent on IE9-11 are global objects, not constructors
+ if (isFunction(Event) && isFunction(CustomEvent)) {
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true,
+ });
+ } else {
+ event = document.createEvent('CustomEvent');
+ event.initCustomEvent(type, true, true, data);
}
- return true;
+ return element.dispatchEvent(event);
}
/**
@@ -437,31 +449,16 @@ export function dispatchEvent(element, type, data) {
* @returns {Object} The offset data.
*/
export function getOffset(element) {
- const doc = document.documentElement;
const box = element.getBoundingClientRect();
return {
- left: box.left + (
- (window.scrollX || (doc && doc.scrollLeft) || 0) - ((doc && doc.clientLeft) || 0)
- ),
- top: box.top + (
- (window.scrollY || (doc && doc.scrollTop) || 0) - ((doc && doc.clientTop) || 0)
- ),
+ left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
+ top: box.top + (window.pageYOffset - document.documentElement.clientTop),
};
}
-/**
- * Empty an element.
- * @param {Element} element - The element to empty.
- */
-export function empty(element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
- }
-}
-
const { location } = WINDOW;
-const REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
+const REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
/**
* Check if the given URL is a cross origin URL.
@@ -471,10 +468,10 @@ const REGEXP_ORIGINS = /^(https?:)\/\/([^:/?#]+):?(\d*)/i;
export function isCrossOriginURL(url) {
const parts = url.match(REGEXP_ORIGINS);
- return parts && (
- parts[1] !== location.protocol ||
- parts[2] !== location.hostname ||
- parts[3] !== location.port
+ return parts !== null && (
+ parts[1] !== location.protocol
+ || parts[2] !== location.hostname
+ || parts[3] !== location.port
);
}
@@ -486,7 +483,7 @@ export function isCrossOriginURL(url) {
export function addTimestamp(url) {
const timestamp = `timestamp=${(new Date()).getTime()}`;
- return (url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp);
+ return url + (url.indexOf('?') === -1 ? '?' : '&') + timestamp;
}
/**
@@ -533,65 +530,19 @@ export function getTransforms({
};
}
-const { navigator } = WINDOW;
-const IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
-
-/**
- * Get an image's natural sizes.
- * @param {string} image - The target image.
- * @param {Function} callback - The callback function.
- */
-export function getImageNaturalSizes(image, callback) {
- // Modern browsers (except Safari)
- if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) {
- callback(image.naturalWidth, image.naturalHeight);
- return;
- }
-
- const newImage = document.createElement('img');
- const body = document.body || document.documentElement;
-
- newImage.onload = () => {
- callback(newImage.width, newImage.height);
-
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- body.removeChild(newImage);
- }
- };
-
- newImage.src = image.src;
-
- // iOS Safari will convert the image automatically
- // with its orientation once append it into DOM (#279)
- if (!IS_SAFARI_OR_UIWEBVIEW) {
- newImage.style.cssText = (
- 'left:0;' +
- 'max-height:none!important;' +
- 'max-width:none!important;' +
- 'min-height:0!important;' +
- 'min-width:0!important;' +
- 'opacity:0;' +
- 'position:absolute;' +
- 'top:0;' +
- 'z-index:-1;'
- );
- body.appendChild(newImage);
- }
-}
-
/**
* Get the max ratio of a group of pointers.
* @param {string} pointers - The target pointers.
* @returns {number} The result ratio.
*/
export function getMaxZoomRatio(pointers) {
- const pointers2 = extend({}, pointers);
+ const pointers2 = { ...pointers };
const ratios = [];
- each(pointers, (pointer, pointerId) => {
+ forEach(pointers, (pointer, pointerId) => {
delete pointers2[pointerId];
- each(pointers2, (pointer2) => {
+ forEach(pointers2, (pointer2) => {
const x1 = Math.abs(pointer.startX - pointer2.startX);
const y1 = Math.abs(pointer.startY - pointer2.startY);
const x2 = Math.abs(pointer.endX - pointer2.endX);
@@ -621,14 +572,11 @@ export function getPointer({ pageX, pageY }, endOnly) {
endY: pageY,
};
- if (endOnly) {
- return end;
- }
-
- return extend({
+ return endOnly ? end : ({
startX: pageX,
startY: pageY,
- }, end);
+ ...end,
+ });
}
/**
@@ -641,7 +589,7 @@ export function getPointersCenter(pointers) {
let pageY = 0;
let count = 0;
- each(pointers, ({ startX, startY }) => {
+ forEach(pointers, ({ startX, startY }) => {
pageX += startX;
pageY += startY;
count += 1;
@@ -657,11 +605,6 @@ export function getPointersCenter(pointers) {
}
/**
- * Check if the given value is a finite number.
- */
-export const isFinite = Number.isFinite || WINDOW.isFinite;
-
-/**
* Get the max sizes in a rectangle under the given aspect ratio.
* @param {Object} data - The original sizes.
* @param {string} [type='contain'] - The adjust type.
@@ -675,9 +618,10 @@ export function getAdjustedSizes(
},
type = 'contain', // or 'cover'
) {
- const isValidNumber = value => isFinite(value) && value > 0;
+ const isValidWidth = isPositiveNumber(width);
+ const isValidHeight = isPositiveNumber(height);
- if (isValidNumber(width) && isValidNumber(height)) {
+ if (isValidWidth && isValidHeight) {
const adjustedWidth = height * aspectRatio;
if ((type === 'contain' && adjustedWidth > width) || (type === 'cover' && adjustedWidth < width)) {
@@ -685,9 +629,9 @@ export function getAdjustedSizes(
} else {
width = height * aspectRatio;
}
- } else if (isValidNumber(width)) {
+ } else if (isValidWidth) {
height = width / aspectRatio;
- } else if (isValidNumber(height)) {
+ } else if (isValidHeight) {
width = height * aspectRatio;
}
@@ -738,6 +682,9 @@ export function getRotatedSizes({ width, height, degree }) {
export function getSourceCanvas(
image,
{
+ aspectRatio: imageAspectRatio,
+ naturalWidth: imageNaturalWidth,
+ naturalHeight: imageNaturalHeight,
rotate = 0,
scaleX = 1,
scaleY = 1,
@@ -771,11 +718,32 @@ export function getSourceCanvas(
}, 'cover');
const width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
const height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
+
+ // Note: should always use image's natural sizes for drawing as
+ // imageData.naturalWidth === canvasData.naturalHeight when rotate % 180 === 90
+ const destMaxSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: maxWidth,
+ height: maxHeight,
+ });
+ const destMinSizes = getAdjustedSizes({
+ aspectRatio: imageAspectRatio,
+ width: minWidth,
+ height: minHeight,
+ }, 'cover');
+ const destWidth = Math.min(
+ destMaxSizes.width,
+ Math.max(destMinSizes.width, imageNaturalWidth),
+ );
+ const destHeight = Math.min(
+ destMaxSizes.height,
+ Math.max(destMinSizes.height, imageNaturalHeight),
+ );
const params = [
- -width / 2,
- -height / 2,
- width,
- height,
+ -destWidth / 2,
+ -destHeight / 2,
+ destWidth,
+ destHeight,
];
canvas.width = normalizeDecimalNumber(width);
@@ -788,7 +756,7 @@ export function getSourceCanvas(
context.scale(scaleX, scaleY);
context.imageSmoothingEnabled = imageSmoothingEnabled;
context.imageSmoothingQuality = imageSmoothingQuality;
- context.drawImage(image, ...params.map(param => Math.floor(normalizeDecimalNumber(param))));
+ context.drawImage(image, ...params.map((param) => Math.floor(normalizeDecimalNumber(param))));
context.restore();
return canvas;
}
@@ -804,11 +772,10 @@ const { fromCharCode } = String;
*/
export function getStringFromCharCode(dataView, start, length) {
let str = '';
- let i;
length += start;
- for (i = start; i < length; i += 1) {
+ for (let i = start; i < length; i += 1) {
str += fromCharCode(dataView.getUint8(i));
}
@@ -828,7 +795,7 @@ export function dataURLToArrayBuffer(dataURL) {
const arrayBuffer = new ArrayBuffer(binary.length);
const uint8 = new Uint8Array(arrayBuffer);
- each(uint8, (value, i) => {
+ forEach(uint8, (value, i) => {
uint8[i] = binary.charCodeAt(i);
});
@@ -842,15 +809,20 @@ export function dataURLToArrayBuffer(dataURL) {
* @returns {string} The result Data URL.
*/
export function arrayBufferToDataURL(arrayBuffer, mimeType) {
- const uint8 = new Uint8Array(arrayBuffer);
- let data = '';
+ const chunks = [];
- // TypedArray.prototype.forEach is not supported in some browsers.
- each(uint8, (value) => {
- data += fromCharCode(value);
- });
+ // Chunk Typed Array for better performance (#435)
+ const chunkSize = 8192;
+ let uint8 = new Uint8Array(arrayBuffer);
- return `data:${mimeType};base64,${btoa(data)}`;
+ while (uint8.length > 0) {
+ // XXX: Babel's `toConsumableArray` helper will throw error in IE or Safari 9
+ // eslint-disable-next-line prefer-spread
+ chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
+ uint8 = uint8.subarray(chunkSize);
+ }
+
+ return `data:${mimeType};base64,${btoa(chunks.join(''))}`;
}
/**
@@ -858,69 +830,75 @@ export function arrayBufferToDataURL(arrayBuffer, mimeType) {
* @param {ArrayBuffer} arrayBuffer - The array buffer to read.
* @returns {number} The read orientation value.
*/
-export function getOrientation(arrayBuffer) {
+export function resetAndGetOrientation(arrayBuffer) {
const dataView = new DataView(arrayBuffer);
let orientation;
- let littleEndian;
- let app1Start;
- let ifdStart;
-
- // Only handle JPEG image (start by 0xFFD8)
- if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
- const length = dataView.byteLength;
- let offset = 2;
-
- while (offset < length) {
- if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
- app1Start = offset;
- break;
- }
- offset += 1;
+ // Ignores range error when the image does not have correct Exif information
+ try {
+ let littleEndian;
+ let app1Start;
+ let ifdStart;
+
+ // Only handle JPEG image (start by 0xFFD8)
+ if (dataView.getUint8(0) === 0xFF && dataView.getUint8(1) === 0xD8) {
+ const length = dataView.byteLength;
+ let offset = 2;
+
+ while (offset + 1 < length) {
+ if (dataView.getUint8(offset) === 0xFF && dataView.getUint8(offset + 1) === 0xE1) {
+ app1Start = offset;
+ break;
+ }
+
+ offset += 1;
+ }
}
- }
- if (app1Start) {
- const exifIDCode = app1Start + 4;
- const tiffOffset = app1Start + 10;
+ if (app1Start) {
+ const exifIDCode = app1Start + 4;
+ const tiffOffset = app1Start + 10;
- if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
- const endianness = dataView.getUint16(tiffOffset);
+ if (getStringFromCharCode(dataView, exifIDCode, 4) === 'Exif') {
+ const endianness = dataView.getUint16(tiffOffset);
- littleEndian = endianness === 0x4949;
+ littleEndian = endianness === 0x4949;
- if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
- if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
- const firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
+ if (littleEndian || endianness === 0x4D4D /* bigEndian */) {
+ if (dataView.getUint16(tiffOffset + 2, littleEndian) === 0x002A) {
+ const firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
- if (firstIFDOffset >= 0x00000008) {
- ifdStart = tiffOffset + firstIFDOffset;
+ if (firstIFDOffset >= 0x00000008) {
+ ifdStart = tiffOffset + firstIFDOffset;
+ }
}
}
}
}
- }
- if (ifdStart) {
- const length = dataView.getUint16(ifdStart, littleEndian);
- let offset;
- let i;
+ if (ifdStart) {
+ const length = dataView.getUint16(ifdStart, littleEndian);
+ let offset;
+ let i;
- for (i = 0; i < length; i += 1) {
- offset = ifdStart + (i * 12) + 2;
+ for (i = 0; i < length; i += 1) {
+ offset = ifdStart + (i * 12) + 2;
- if (dataView.getUint16(offset, littleEndian) === 0x0112 /* Orientation */) {
- // 8 is the offset of the current tag's value
- offset += 8;
+ if (dataView.getUint16(offset, littleEndian) === 0x0112 /* Orientation */) {
+ // 8 is the offset of the current tag's value
+ offset += 8;
- // Get the original orientation value
- orientation = dataView.getUint16(offset, littleEndian);
+ // Get the original orientation value
+ orientation = dataView.getUint16(offset, littleEndian);
- // Override the orientation with its default value
- dataView.setUint16(offset, 1, littleEndian);
- break;
+ // Override the orientation with its default value
+ dataView.setUint16(offset, 1, littleEndian);
+ break;
+ }
}
}
+ } catch (error) {
+ orientation = 1;
}
return orientation;
diff --git a/library/cropperjs/test/css/main.css b/library/cropperjs/test/css/main.css
deleted file mode 100644
index 6a86d123c..000000000
--- a/library/cropperjs/test/css/main.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- max-width: 640px;
- max-height: 360px;
- margin: 20px auto;
-}
-
-.container > img {
- max-width: 100%;
-}
diff --git a/library/cropperjs/test/events/crop.js b/library/cropperjs/test/events/crop.js
deleted file mode 100644
index 1f769cf60..000000000
--- a/library/cropperjs/test/events/crop.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('events#crop', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- image.addEventListener('crop', function (e) {
- assert.ok(util.isNumber(e.detail.x));
- assert.ok(util.isNumber(e.detail.y));
- assert.ok(util.isNumber(e.detail.width));
- assert.ok(util.isNumber(e.detail.height));
- assert.ok(util.isNumber(e.detail.rotate));
- assert.ok(util.isNumber(e.detail.scaleX));
- assert.ok(util.isNumber(e.detail.scaleY));
-
- done();
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/events/cropend.js b/library/cropperjs/test/events/cropend.js
deleted file mode 100644
index 1f18fb435..000000000
--- a/library/cropperjs/test/events/cropend.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('events#cropend', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- image.addEventListener('ready', function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- });
-
- image.addEventListener('cropend', function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/events/cropmove.js b/library/cropperjs/test/events/cropmove.js
deleted file mode 100644
index c695b7fdd..000000000
--- a/library/cropperjs/test/events/cropmove.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('events#cropmove', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- image.addEventListener('ready', function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- });
-
- image.addEventListener('cropmove', function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/events/cropstart.js b/library/cropperjs/test/events/cropstart.js
deleted file mode 100644
index 7d9b597a0..000000000
--- a/library/cropperjs/test/events/cropstart.js
+++ /dev/null
@@ -1,56 +0,0 @@
-QUnit.test('events#cropstart', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- image.addEventListener('ready', function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- });
-
- image.addEventListener('cropstart', function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- });
-
- return new Cropper(image);
-});
-
-QUnit.test('events#cropstart: default prevented', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(0);
-
- image.addEventListener('ready', function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- });
-
- image.addEventListener('cropstart', function (e) {
- e.preventDefault();
- });
-
- image.addEventListener('cropmove', function () {
- assert.ok(false);
- });
-
- image.addEventListener('cropend', function () {
- assert.ok(false);
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/events/ready.js b/library/cropperjs/test/events/ready.js
deleted file mode 100644
index fbec2ff0c..000000000
--- a/library/cropperjs/test/events/ready.js
+++ /dev/null
@@ -1,15 +0,0 @@
-QUnit.test('events#ready', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- image.addEventListener('ready', function () {
- assert.ok(true);
-
- done();
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/events/zoom.js b/library/cropperjs/test/events/zoom.js
deleted file mode 100644
index 99fda34b5..000000000
--- a/library/cropperjs/test/events/zoom.js
+++ /dev/null
@@ -1,46 +0,0 @@
-QUnit.test('events#zoom', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(3);
-
- image.addEventListener('ready', function () {
- var cropper = this.cropper;
-
- cropper.zoom(0.1);
-
- done();
- });
-
- image.addEventListener('zoom', function (e) {
- assert.ok(e.detail.ratio > 0);
- assert.ok(e.detail.oldRatio > 0);
- assert.ok(e.detail.ratio > e.detail.oldRatio);
- });
-
- return new Cropper(image);
-});
-
-QUnit.test('events#zoom: default prevented', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- image.addEventListener('ready', function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
-
- assert.deepEqual(cropper.zoom(0.1).getCanvasData(), canvasData);
-
- done();
- });
-
- image.addEventListener('zoom', function (e) {
- e.preventDefault();
- });
-
- return new Cropper(image);
-});
diff --git a/library/cropperjs/test/helpers.js b/library/cropperjs/test/helpers.js
new file mode 100644
index 000000000..69d4f3132
--- /dev/null
+++ b/library/cropperjs/test/helpers.js
@@ -0,0 +1,46 @@
+window.createImage = (attrs = {}) => {
+ const container = document.createElement('div');
+ const image = document.createElement('img');
+
+ if (!attrs.src) {
+ attrs.src = '/base/docs/images/picture.jpg';
+ }
+
+ Object.keys(attrs).forEach((attr) => {
+ image[attr] = attrs[attr];
+ });
+
+ container.appendChild(image);
+ document.body.appendChild(container);
+
+ return image;
+};
+
+window.createEvent = (type, data) => {
+ let event;
+
+ if (typeof Event === 'function' && typeof CustomEvent === 'function') {
+ if (typeof data === 'undefined') {
+ event = new Event(type, {
+ bubbles: true,
+ cancelable: true,
+ });
+ } else {
+ event = new CustomEvent(type, {
+ detail: data,
+ bubbles: true,
+ cancelable: true,
+ });
+ }
+ } else if (typeof data === 'undefined') {
+ event = document.createEvent('Event');
+ event.initEvent(type, true, true);
+ } else {
+ event = document.createEvent('CustomEvent');
+ event.initCustomEvent(type, true, true, data);
+ }
+
+ event.buttons = 1;
+
+ return event;
+};
diff --git a/library/cropperjs/test/index.html b/library/cropperjs/test/index.html
deleted file mode 100644
index bdcaf6b21..000000000
--- a/library/cropperjs/test/index.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <title>Cropper.js</title>
- <link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.4.0.css">
- <link rel="stylesheet" href="../dist/cropper.css">
- <link rel="stylesheet" href="css/main.css">
-</head>
-<body>
- <div id="qunit"></div>
- <div id="qunit-fixture"></div>
- <script src="https://code.jquery.com/qunit/qunit-2.4.0.js"></script>
- <script src="../dist/cropper.js"></script>
- <script src="js/main.js"></script>
-
- <!-- Options -->
- <script src="options/viewMode.js"></script>
- <script src="options/dragMode.js"></script>
- <script src="options/aspectRatio.js"></script>
- <script src="options/data.js"></script>
- <!-- <script src="options/checkCrossOrigin.js"></script> -->
- <script src="options/checkOrientation.js"></script>
- <script src="options/modal.js"></script>
- <script src="options/guides.js"></script>
- <script src="options/center.js"></script>
- <script src="options/highlight.js"></script>
- <script src="options/background.js"></script>
- <script src="options/autoCrop.js"></script>
- <script src="options/movable.js"></script>
- <script src="options/rotatable.js"></script>
- <script src="options/scalable.js"></script>
- <script src="options/zoomable.js"></script>
- <script src="options/zoomOnWheel.js"></script>
- <script src="options/cropBoxMovable.js"></script>
- <script src="options/cropBoxResizable.js"></script>
- <script src="options/toggleDragModeOnDblclick.js"></script>
- <script src="options/minCanvasWidth.js"></script>
- <script src="options/minCanvasHeight.js"></script>
- <script src="options/minCropBoxWidth.js"></script>
- <script src="options/minCropBoxHeight.js"></script>
- <script src="options/minContainerWidth.js"></script>
- <script src="options/minContainerHeight.js"></script>
- <script src="options/ready.js"></script>
- <script src="options/cropstart.js"></script>
- <script src="options/cropmove.js"></script>
- <script src="options/cropend.js"></script>
- <script src="options/crop.js"></script>
- <script src="options/zoom.js"></script>
-
- <!-- Methods -->
- <script src="methods/crop.js"></script>
- <script src="methods/reset.js"></script>
- <script src="methods/clear.js"></script>
- <script src="methods/replace.js"></script>
- <script src="methods/enable.js"></script>
- <script src="methods/disable.js"></script>
- <script src="methods/destroy.js"></script>
- <script src="methods/move.js"></script>
- <script src="methods/moveTo.js"></script>
- <script src="methods/zoom.js"></script>
- <script src="methods/zoomTo.js"></script>
- <script src="methods/rotate.js"></script>
- <script src="methods/rotateTo.js"></script>
- <script src="methods/scale.js"></script>
- <script src="methods/scaleX.js"></script>
- <script src="methods/scaleY.js"></script>
- <script src="methods/getData.js"></script>
- <script src="methods/setData.js"></script>
- <script src="methods/getContainerData.js"></script>
- <script src="methods/getImageData.js"></script>
- <script src="methods/getCanvasData.js"></script>
- <script src="methods/setCanvasData.js"></script>
- <script src="methods/getCropBoxData.js"></script>
- <script src="methods/setCropBoxData.js"></script>
- <script src="methods/getCroppedCanvas.js"></script>
- <script src="methods/setAspectRatio.js"></script>
- <script src="methods/setDragMode.js"></script>
-
- <!-- Events -->
- <script src="events/ready.js"></script>
- <script src="events/cropstart.js"></script>
- <script src="events/cropmove.js"></script>
- <script src="events/cropend.js"></script>
- <script src="events/crop.js"></script>
- <script src="events/zoom.js"></script>
-</body>
-</html>
diff --git a/library/cropperjs/test/js/main.js b/library/cropperjs/test/js/main.js
deleted file mode 100644
index 79fda799f..000000000
--- a/library/cropperjs/test/js/main.js
+++ /dev/null
@@ -1,74 +0,0 @@
-window.Util = {
- isNumber: function (n) {
- return typeof n === 'number' && !isNaN(n);
- },
- isFunction: function (fn) {
- return typeof fn === 'function';
- },
- hasClass: function (element, className) {
- return element.classList.contains(className);
- },
- getByClass: function (element, className) {
- return element.getElementsByClassName ?
- element.getElementsByClassName(className) :
- element.querySelectorAll('.' + className);
- },
- createImage: function (attrs) {
- var container = document.createElement('div');
- var image = new Image();
- var attr;
-
- if (typeof attrs !== 'object') {
- attrs = {};
- }
-
- if (!attrs.src) {
- attrs.src = '../docs/images/picture.jpg';
- }
-
- for (attr in attrs) {
- if (attrs.hasOwnProperty(attr)) {
- image[attr] = attrs[attr];
- }
- }
-
- container.className = 'container';
- container.appendChild(image);
- document.body.appendChild(container);
-
- return image;
- },
- dispatchEvent: function (element, type, data) {
- var event;
-
- if (element.dispatchEvent) {
- // Event and CustomEvent on IE9-11 are global objects, not constructors
- if (typeof Event === 'function' && typeof CustomEvent === 'function') {
- if (!data) {
- event = new Event(type, {
- bubbles: true,
- cancelable: true
- });
- } else {
- event = new CustomEvent(type, {
- detail: data,
- bubbles: true,
- cancelable: true
- });
- }
- } else if (!data) {
- event = document.createEvent('Event');
- event.initEvent(type, true, true);
- } else {
- event = document.createEvent('CustomEvent');
- event.initCustomEvent(type, true, true, data);
- }
-
- // IE9+
- return element.dispatchEvent(event);
- } else if (element.fireEvent) {
- // IE6-10 (native events only)
- return element.fireEvent('on' + type);
- }
- }
-};
diff --git a/library/cropperjs/test/karma.conf.js b/library/cropperjs/test/karma.conf.js
new file mode 100644
index 000000000..1ccf4d6d7
--- /dev/null
+++ b/library/cropperjs/test/karma.conf.js
@@ -0,0 +1,46 @@
+const puppeteer = require('puppeteer');
+const rollupConfig = require('../rollup.config');
+
+process.env.CHROME_BIN = puppeteer.executablePath();
+
+module.exports = (config) => {
+ config.set({
+ autoWatch: false,
+ basePath: '..',
+ browsers: ['ChromeHeadless'],
+ client: {
+ mocha: {
+ timeout: 10000,
+ },
+ },
+ coverageIstanbulReporter: {
+ reports: ['html', 'lcovonly', 'text-summary'],
+ },
+ files: [
+ 'src/index.js',
+ 'dist/cropper.css',
+ 'test/helpers.js',
+ 'test/specs/**/*.spec.js',
+ {
+ pattern: 'docs/images/*',
+ included: false,
+ },
+ ],
+ frameworks: ['mocha', 'chai'],
+ preprocessors: {
+ 'src/index.js': ['rollup'],
+ 'test/helpers.js': ['rollup'],
+ 'test/specs/**/*.spec.js': ['rollup'],
+ },
+ reporters: ['mocha', 'coverage-istanbul'],
+ rollupPreprocessor: {
+ plugins: rollupConfig.plugins,
+ output: {
+ format: 'iife',
+ name: rollupConfig.output[0].name,
+ sourcemap: 'inline',
+ },
+ },
+ singleRun: true,
+ });
+};
diff --git a/library/cropperjs/test/methods/clear.js b/library/cropperjs/test/methods/clear.js
deleted file mode 100644
index 6510ebad2..000000000
--- a/library/cropperjs/test/methods/clear.js
+++ /dev/null
@@ -1,29 +0,0 @@
-QUnit.test('methods#clear', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.clear();
- assert.notOk(cropper.cropped);
- assert.deepEqual(cropper.getData(), {
- x: 0,
- y: 0,
- width: 0,
- height: 0,
- rotate: 0,
- scaleX: 1,
- scaleY: 1
- });
- assert.deepEqual(cropper.getCropBoxData(), {});
- assert.ok(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/crop.js b/library/cropperjs/test/methods/crop.js
deleted file mode 100644
index e4ae679f1..000000000
--- a/library/cropperjs/test/methods/crop.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('methods#crop', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- autoCrop: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notOk(cropper.cropped);
- assert.ok(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- cropper.crop();
- assert.ok(cropper.cropped);
- assert.notOk(util.hasClass(cropper.cropBox, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/destroy.js b/library/cropperjs/test/methods/destroy.js
deleted file mode 100644
index cb65e0696..000000000
--- a/library/cropperjs/test/methods/destroy.js
+++ /dev/null
@@ -1,22 +0,0 @@
-QUnit.test('methods#destroy', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(typeof cropper === 'object');
- assert.ok(util.hasClass(image, 'cropper-hidden'));
-
- cropper.destroy();
- assert.ok(typeof this.cropper === 'undefined');
- assert.notOk(util.hasClass(image, 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/disable.js b/library/cropperjs/test/methods/disable.js
deleted file mode 100644
index c87f7aa91..000000000
--- a/library/cropperjs/test/methods/disable.js
+++ /dev/null
@@ -1,60 +0,0 @@
-QUnit.test('methods#disable', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(11);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var options = cropper.options;
- var cropBoxData;
- var canvasData;
- var imageData;
- var action;
-
- cropper.disable();
- assert.ok(cropper.disabled);
- assert.ok(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- cropBoxData = cropper.getCropBoxData();
- cropper.clear();
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- imageData = cropper.getImageData();
- cropper.move(10, 10);
- assert.deepEqual(cropper.getImageData(), imageData);
-
- cropper.zoom(0.5);
- assert.strictEqual(cropper.getImageData().ratio, imageData.ratio);
-
- cropper.rotate(15);
- assert.strictEqual(cropper.getImageData().rotate, imageData.rotate);
-
- cropper.scale(-1);
- assert.strictEqual(cropper.getImageData().scaleX, imageData.scaleX);
-
- canvasData = cropper.getCanvasData();
- cropper.setCanvasData({
- width: canvasData.width - 160
- });
- assert.deepEqual(cropper.getCanvasData(), canvasData);
-
- cropBoxData = cropper.getCropBoxData();
- cropper.setCropBoxData({
- height: cropBoxData.height - 90
- });
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- cropper.setAspectRatio(0.618);
- assert.ok(isNaN(options.aspectRatio));
-
- action = cropper.dragBox.dataset.action;
- cropper.setDragMode('none');
- assert.strictEqual(cropper.dragBox.dataset.action, action);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/enable.js b/library/cropperjs/test/methods/enable.js
deleted file mode 100644
index ebd5b9529..000000000
--- a/library/cropperjs/test/methods/enable.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#enable', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.disable();
- assert.ok(cropper.disabled);
- assert.ok(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- cropper.enable();
- assert.notOk(cropper.disabled);
- assert.notOk(util.hasClass(cropper.cropper, 'cropper-disabled'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCanvasData.js b/library/cropperjs/test/methods/getCanvasData.js
deleted file mode 100644
index 60d96af4e..000000000
--- a/library/cropperjs/test/methods/getCanvasData.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#getCanvasData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(6);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
-
- assert.ok(util.isNumber(canvasData.left));
- assert.ok(util.isNumber(canvasData.top));
- assert.ok(util.isNumber(canvasData.width));
- assert.ok(util.isNumber(canvasData.height));
- assert.ok(util.isNumber(canvasData.naturalWidth));
- assert.ok(util.isNumber(canvasData.naturalHeight));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getContainerData.js b/library/cropperjs/test/methods/getContainerData.js
deleted file mode 100644
index 094421ba0..000000000
--- a/library/cropperjs/test/methods/getContainerData.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#getContainerData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var containerData = cropper.getContainerData();
-
- assert.ok(util.isNumber(containerData.width));
- assert.ok(util.isNumber(containerData.height));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCropBoxData.js b/library/cropperjs/test/methods/getCropBoxData.js
deleted file mode 100644
index 844c7953e..000000000
--- a/library/cropperjs/test/methods/getCropBoxData.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('methods#getCropBoxData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.getCropBoxData();
-
- assert.ok(util.isNumber(cropBoxData.left));
- assert.ok(util.isNumber(cropBoxData.top));
- assert.ok(util.isNumber(cropBoxData.width));
- assert.ok(util.isNumber(cropBoxData.height));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getCroppedCanvas.js b/library/cropperjs/test/methods/getCroppedCanvas.js
deleted file mode 100644
index 4117497a5..000000000
--- a/library/cropperjs/test/methods/getCroppedCanvas.js
+++ /dev/null
@@ -1,33 +0,0 @@
-QUnit.test('methods#getCroppedCanvas', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvas = cropper.getCroppedCanvas({
- width: 160,
- height: 90
- });
- var pixelData;
-
- assert.ok(canvas instanceof HTMLCanvasElement);
- assert.strictEqual(canvas.width, 160);
- assert.strictEqual(canvas.height, 90);
-
- canvas = cropper.rotate(90).getCroppedCanvas({
- fillColor: '#010101'
- });
- pixelData = canvas.getContext('2d').getImageData(0, 0, 1, 1).data;
- assert.strictEqual(pixelData[0], 1, 'red is 1');
- assert.strictEqual(pixelData[1], 1, 'green is 1');
- assert.strictEqual(pixelData[2], 1, 'blue is 1');
- assert.strictEqual(pixelData[3], 255, 'color is opaque');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getData.js b/library/cropperjs/test/methods/getData.js
deleted file mode 100644
index 9c519eb7f..000000000
--- a/library/cropperjs/test/methods/getData.js
+++ /dev/null
@@ -1,46 +0,0 @@
-QUnit.test('methods#getData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData();
-
- assert.ok(util.isNumber(data.x));
- assert.ok(util.isNumber(data.y));
- assert.ok(util.isNumber(data.width));
- assert.ok(util.isNumber(data.height));
- assert.ok(util.isNumber(data.rotate));
- assert.ok(util.isNumber(data.scaleX));
- assert.ok(util.isNumber(data.scaleY));
-
- done();
- }
- });
-});
-
-QUnit.test('methods#getData: rounded', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData(true);
-
- assert.ok(data.x % 1 === 0);
- assert.ok(data.y % 1 === 0);
- assert.ok(data.width % 1 === 0);
- assert.ok(data.height % 1 === 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/getImageData.js b/library/cropperjs/test/methods/getImageData.js
deleted file mode 100644
index bd6e1941d..000000000
--- a/library/cropperjs/test/methods/getImageData.js
+++ /dev/null
@@ -1,31 +0,0 @@
-QUnit.test('methods#getImageData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(10);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.getImageData();
-
- assert.ok(util.isNumber(imageData.naturalWidth));
- assert.ok(util.isNumber(imageData.naturalHeight));
- assert.ok(util.isNumber(imageData.aspectRatio));
- assert.ok(util.isNumber(imageData.left));
- assert.ok(util.isNumber(imageData.top));
- assert.ok(util.isNumber(imageData.width));
- assert.ok(util.isNumber(imageData.height));
-
- imageData = cropper.rotateTo(45).getImageData();
- assert.strictEqual(imageData.rotate, 45);
-
- imageData = cropper.scale(-1, -1).getImageData();
- assert.strictEqual(imageData.scaleX, -1);
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/move.js b/library/cropperjs/test/methods/move.js
deleted file mode 100644
index c2ead8412..000000000
--- a/library/cropperjs/test/methods/move.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#move', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.move(1, 1).getCanvasData();
-
- assert.strictEqual(changedCanvasData.left, canvasData.left + 1);
- assert.strictEqual(changedCanvasData.top, canvasData.top + 1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/moveTo.js b/library/cropperjs/test/methods/moveTo.js
deleted file mode 100644
index e8bf0eebd..000000000
--- a/library/cropperjs/test/methods/moveTo.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#moveTo', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.moveTo(0, 0).getCanvasData();
-
- assert.strictEqual(canvasData.left, 0);
- assert.strictEqual(canvasData.top, 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/replace.js b/library/cropperjs/test/methods/replace.js
deleted file mode 100644
index 3fc8fe0b6..000000000
--- a/library/cropperjs/test/methods/replace.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('methods#replace', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.options.ready = function () {
- assert.notOk(cropper.cropped);
- cropper.crop();
- assert.ok(cropper.cropped);
- done();
- };
-
- cropper.options.autoCrop = false;
- cropper.replace('../docs/images/picture-2.jpg');
- }
- });
-});
diff --git a/library/cropperjs/test/methods/reset.js b/library/cropperjs/test/methods/reset.js
deleted file mode 100644
index 3e047394c..000000000
--- a/library/cropperjs/test/methods/reset.js
+++ /dev/null
@@ -1,35 +0,0 @@
-QUnit.test('methods#reset', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var cropBoxData = cropper.getCropBoxData();
-
- cropper.setCanvasData({
- top: canvasData.top + 10,
- width: canvasData.width - 10
- });
-
- assert.notDeepEqual(cropper.getCanvasData(), canvasData);
-
- cropper.setCropBoxData({
- left: cropBoxData.left + 10,
- height: cropBoxData.height - 10
- });
-
- assert.notDeepEqual(cropper.getCropBoxData(), cropBoxData);
-
- cropper.reset();
- assert.deepEqual(cropper.getCanvasData(), canvasData);
- assert.deepEqual(cropper.getCropBoxData(), cropBoxData);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/rotate.js b/library/cropperjs/test/methods/rotate.js
deleted file mode 100644
index 749096f0b..000000000
--- a/library/cropperjs/test/methods/rotate.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#rotate', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(3);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.rotate(360).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotate(90).getImageData().rotate, 90);
- assert.strictEqual(cropper.rotate(-180).getImageData().rotate, -90);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/rotateTo.js b/library/cropperjs/test/methods/rotateTo.js
deleted file mode 100644
index 323431e76..000000000
--- a/library/cropperjs/test/methods/rotateTo.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#rotateTo', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.rotateTo(360).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotateTo(90).getImageData().rotate, 90);
- assert.strictEqual(cropper.rotateTo(0).getImageData().rotate, 0);
- assert.strictEqual(cropper.rotateTo(-180).getImageData().rotate, -180);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scale.js b/library/cropperjs/test/methods/scale.js
deleted file mode 100644
index be1caa589..000000000
--- a/library/cropperjs/test/methods/scale.js
+++ /dev/null
@@ -1,19 +0,0 @@
-QUnit.test('methods#scale', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scale(-1, -1).getImageData();
-
- assert.strictEqual(imageData.scaleX, -1);
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scaleX.js b/library/cropperjs/test/methods/scaleX.js
deleted file mode 100644
index c799df58d..000000000
--- a/library/cropperjs/test/methods/scaleX.js
+++ /dev/null
@@ -1,18 +0,0 @@
-QUnit.test('methods#scaleX', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scaleX(-1).getImageData();
-
- assert.strictEqual(imageData.scaleX, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/scaleY.js b/library/cropperjs/test/methods/scaleY.js
deleted file mode 100644
index 026b93a1f..000000000
--- a/library/cropperjs/test/methods/scaleY.js
+++ /dev/null
@@ -1,18 +0,0 @@
-QUnit.test('methods#scaleY', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scaleY(-1).getImageData();
-
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setAspectRatio.js b/library/cropperjs/test/methods/setAspectRatio.js
deleted file mode 100644
index ddf46798d..000000000
--- a/library/cropperjs/test/methods/setAspectRatio.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#setAspectRatio', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var options = cropper.options;
-
- assert.ok(isNaN(options.aspectRatio));
- cropper.setAspectRatio(1);
- assert.strictEqual(options.aspectRatio, 1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setCanvasData.js b/library/cropperjs/test/methods/setCanvasData.js
deleted file mode 100644
index e8f6511dc..000000000
--- a/library/cropperjs/test/methods/setCanvasData.js
+++ /dev/null
@@ -1,34 +0,0 @@
-QUnit.test('methods#setCanvasData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(6);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.setCanvasData({
- left: 16,
- top: 9
- }).getCanvasData();
-
- assert.notStrictEqual(changedCanvasData.left, canvasData.left);
- assert.notStrictEqual(changedCanvasData.top, canvasData.top);
- assert.strictEqual(changedCanvasData.width, canvasData.width);
- assert.strictEqual(changedCanvasData.height, canvasData.height);
-
- canvasData = cropper.getCanvasData();
- changedCanvasData = cropper.setCanvasData({
- width: 320,
- height: 180
- }).getCanvasData();
-
- assert.notStrictEqual(changedCanvasData.width, canvasData.width);
- assert.notStrictEqual(changedCanvasData.height, canvasData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setCropBoxData.js b/library/cropperjs/test/methods/setCropBoxData.js
deleted file mode 100644
index e78767cfc..000000000
--- a/library/cropperjs/test/methods/setCropBoxData.js
+++ /dev/null
@@ -1,36 +0,0 @@
-QUnit.test('methods#setCropBoxData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(8);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.getCropBoxData();
- var changedCropBoxData = cropper.setCropBoxData({
- left: 16,
- top: 9
- }).getCropBoxData();
-
- assert.notStrictEqual(changedCropBoxData.left, cropBoxData.left);
- assert.notStrictEqual(changedCropBoxData.top, cropBoxData.top);
- assert.strictEqual(changedCropBoxData.width, cropBoxData.width);
- assert.strictEqual(changedCropBoxData.height, cropBoxData.height);
-
- cropBoxData = cropper.getCropBoxData();
- changedCropBoxData = cropper.setCropBoxData({
- width: 320,
- height: 180
- }).getCropBoxData();
-
- assert.strictEqual(changedCropBoxData.left, cropBoxData.left);
- assert.strictEqual(changedCropBoxData.top, cropBoxData.top);
- assert.notStrictEqual(changedCropBoxData.width, cropBoxData.width);
- assert.notStrictEqual(changedCropBoxData.height, cropBoxData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setData.js b/library/cropperjs/test/methods/setData.js
deleted file mode 100644
index 4e1360f09..000000000
--- a/library/cropperjs/test/methods/setData.js
+++ /dev/null
@@ -1,36 +0,0 @@
-QUnit.test('methods#setData', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(8);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData();
- var changedData = cropper.setData({
- x: 16,
- y: 9
- }).getData();
-
- assert.notStrictEqual(changedData.x, data.x);
- assert.notStrictEqual(changedData.y, data.y);
- assert.strictEqual(changedData.width, data.width);
- assert.strictEqual(changedData.height, data.height);
-
- data = cropper.getData();
- changedData = cropper.setData({
- width: 320,
- height: 180
- }).getData();
-
- assert.strictEqual(changedData.x, data.x);
- assert.strictEqual(changedData.y, data.y);
- assert.notStrictEqual(changedData.width, data.width);
- assert.notStrictEqual(changedData.height, data.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/setDragMode.js b/library/cropperjs/test/methods/setDragMode.js
deleted file mode 100644
index 1b611af9b..000000000
--- a/library/cropperjs/test/methods/setDragMode.js
+++ /dev/null
@@ -1,27 +0,0 @@
-QUnit.test('methods#setDragMode', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var dragBox = cropper.dragBox;
-
- assert.strictEqual(dragBox.dataset.action, 'crop');
-
- cropper.setDragMode('move');
- assert.strictEqual(dragBox.dataset.action, 'move');
-
- cropper.setDragMode('crop');
- assert.strictEqual(dragBox.dataset.action, 'crop');
-
- cropper.setDragMode('none');
- assert.strictEqual(dragBox.dataset.action, 'none');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/zoom.js b/library/cropperjs/test/methods/zoom.js
deleted file mode 100644
index 70a1a763a..000000000
--- a/library/cropperjs/test/methods/zoom.js
+++ /dev/null
@@ -1,20 +0,0 @@
-QUnit.test('methods#zoom', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.zoom(0.1).getCanvasData();
-
- assert.ok(changedCanvasData.width > canvasData.width);
- assert.ok(changedCanvasData.height > canvasData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/methods/zoomTo.js b/library/cropperjs/test/methods/zoomTo.js
deleted file mode 100644
index dd9e81760..000000000
--- a/library/cropperjs/test/methods/zoomTo.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('methods#zoomTo', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(3);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.zoomTo(1).getImageData();
- var canvasData = cropper.getCanvasData();
-
- assert.strictEqual(imageData.width, imageData.naturalWidth);
- assert.strictEqual(canvasData.width, canvasData.naturalWidth);
- assert.strictEqual(canvasData.naturalWidth, imageData.naturalWidth);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/aspectRatio.js b/library/cropperjs/test/options/aspectRatio.js
deleted file mode 100644
index d7ba89401..000000000
--- a/library/cropperjs/test/options/aspectRatio.js
+++ /dev/null
@@ -1,39 +0,0 @@
-QUnit.test('options#aspectRatio: NaN', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // aspectRatio: NaN,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(isNaN(cropper.options.aspectRatio));
-
- done();
- }
- });
-});
-
-QUnit.test('options#aspectRatio: 1', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- aspectRatio: 1,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.options.aspectRatio, 1);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/autoCrop.js b/library/cropperjs/test/options/autoCrop.js
deleted file mode 100644
index f010966eb..000000000
--- a/library/cropperjs/test/options/autoCrop.js
+++ /dev/null
@@ -1,39 +0,0 @@
-QUnit.test('options#autoCrop: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // autoCrop: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(cropper.cropped);
-
- done();
- }
- });
-});
-
-QUnit.test('options#autoCrop: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- autoCrop: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notOk(cropper.cropped);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/background.js b/library/cropperjs/test/options/background.js
deleted file mode 100644
index 21dbb8b12..000000000
--- a/library/cropperjs/test/options/background.js
+++ /dev/null
@@ -1,40 +0,0 @@
-QUnit.test('options#background: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // background: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(util.hasClass(cropper.cropper, 'cropper-bg'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#background: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- background: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notOk(util.hasClass(cropper.cropper, 'cropper-bg'));
-
- done();
- }
- });
-
-});
diff --git a/library/cropperjs/test/options/center.js b/library/cropperjs/test/options/center.js
deleted file mode 100644
index 5d45eb021..000000000
--- a/library/cropperjs/test/options/center.js
+++ /dev/null
@@ -1,41 +0,0 @@
-QUnit.test('options#center: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // center: true,
-
- ready: function () {
- var cropper = this.cropper;
- var center = util.getByClass(cropper.cropBox, 'cropper-center');
-
- assert.notOk(util.hasClass(center[0], 'cropper-hidden'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#center: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- center: false,
-
- ready: function () {
- var cropper = this.cropper;
- var center = util.getByClass(cropper.cropBox, 'cropper-center');
-
- assert.ok(util.hasClass(center[0], 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/checkCrossOrigin.js b/library/cropperjs/test/options/checkCrossOrigin.js
deleted file mode 100644
index 86fde8f6f..000000000
--- a/library/cropperjs/test/options/checkCrossOrigin.js
+++ /dev/null
@@ -1,67 +0,0 @@
-QUnit.test('options#checkCrossOrigin: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage({
- src: 'https://fengyuanchen.github.io/cropperjs/images/picture.jpg'
- });
-
- assert.expect(2);
-
- return new Cropper(image, {
- // checkCrossOrigin: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.image.crossOrigin, 'anonymous');
- assert.ok(cropper.image.src.indexOf('timestamp') >= 0);
-
- done();
- }
- });
-});
-
-QUnit.test('options#checkCrossOrigin: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage({
- src: 'https://fengyuanchen.github.io/cropperjs/images/picture.jpg'
- });
-
- assert.expect(2);
-
- return new Cropper(image, {
- checkCrossOrigin: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notStrictEqual(cropper.image.crossOrigin, 'anonymous');
- assert.ok(cropper.image.src.indexOf('timestamp') < 0);
-
- done();
- }
- });
-});
-
-QUnit.test('options#checkCrossOrigin: exists crossOrigin attribute', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage({
- src: 'https://fengyuanchen.github.io/cropperjs/images/picture.jpg',
- crossOrigin: 'anonymous'
- });
-
- assert.expect(2);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.image.crossOrigin, 'anonymous');
- assert.ok(cropper.image.src.indexOf('timestamp') < 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/checkOrientation.js b/library/cropperjs/test/options/checkOrientation.js
deleted file mode 100644
index 0fe548404..000000000
--- a/library/cropperjs/test/options/checkOrientation.js
+++ /dev/null
@@ -1,43 +0,0 @@
-QUnit.test('options#checkOrientation: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage({
- src: '../docs/images/picture-3.jpg'
- });
-
- assert.expect(1);
-
- return new Cropper(image, {
- // checkOrientation: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notStrictEqual(cropper.getData().rotate, 0);
-
- done();
- }
- });
-});
-
-QUnit.test('options#checkOrientation: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage({
- src: '../docs/images/picture-3.jpg'
- });
-
- assert.expect(1);
-
- return new Cropper(image, {
- checkOrientation: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.getData().rotate, 0);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/crop.js b/library/cropperjs/test/options/crop.js
deleted file mode 100644
index a4b48585e..000000000
--- a/library/cropperjs/test/options/crop.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('options#crop', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(7);
-
- return new Cropper(image, {
- crop: function (e) {
- assert.ok(util.isNumber(e.detail.x));
- assert.ok(util.isNumber(e.detail.y));
- assert.ok(util.isNumber(e.detail.width));
- assert.ok(util.isNumber(e.detail.height));
- assert.ok(util.isNumber(e.detail.rotate));
- assert.ok(util.isNumber(e.detail.scaleX));
- assert.ok(util.isNumber(e.detail.scaleY));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/cropBoxMovable.js b/library/cropperjs/test/options/cropBoxMovable.js
deleted file mode 100644
index d5d3e1d7d..000000000
--- a/library/cropperjs/test/options/cropBoxMovable.js
+++ /dev/null
@@ -1,41 +0,0 @@
-QUnit.test('options#cropBoxMovable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // cropBoxMovable: true,
-
- ready: function () {
- var cropper = this.cropper;
- var face = util.getByClass(cropper.cropBox, 'cropper-face');
-
- assert.strictEqual(face[0].dataset.action, 'all');
-
- done();
- }
- });
-});
-
-QUnit.test('options#cropBoxMovable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- cropBoxMovable: false,
-
- ready: function () {
- var cropper = this.cropper;
- var face = util.getByClass(cropper.cropBox, 'cropper-face');
-
- assert.strictEqual(face[0].dataset.action, cropper.options.dragMode);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/cropBoxResizable.js b/library/cropperjs/test/options/cropBoxResizable.js
deleted file mode 100644
index 37093642b..000000000
--- a/library/cropperjs/test/options/cropBoxResizable.js
+++ /dev/null
@@ -1,65 +0,0 @@
-QUnit.test('options#cropBoxResizable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(12);
-
- return new Cropper(image, {
- // cropBoxResizable: true,
-
- ready: function () {
- var cropper = this.cropper;
- var line = util.getByClass(cropper.cropBox, 'cropper-line');
- var point = util.getByClass(cropper.cropBox, 'cropper-point');
-
- assert.notOk(util.hasClass(line[0], 'cropper-hidden'));
- assert.notOk(util.hasClass(line[1], 'cropper-hidden'));
- assert.notOk(util.hasClass(line[2], 'cropper-hidden'));
- assert.notOk(util.hasClass(line[3], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[0], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[1], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[2], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[3], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[4], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[5], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[6], 'cropper-hidden'));
- assert.notOk(util.hasClass(point[7], 'cropper-hidden'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#cropBoxResizable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(12);
-
- return new Cropper(image, {
- cropBoxResizable: false,
-
- ready: function () {
- var cropper = this.cropper;
- var line = util.getByClass(cropper.cropBox, 'cropper-line');
- var point = util.getByClass(cropper.cropBox, 'cropper-point');
-
- assert.ok(util.hasClass(line[0], 'cropper-hidden'));
- assert.ok(util.hasClass(line[1], 'cropper-hidden'));
- assert.ok(util.hasClass(line[2], 'cropper-hidden'));
- assert.ok(util.hasClass(line[3], 'cropper-hidden'));
- assert.ok(util.hasClass(point[0], 'cropper-hidden'));
- assert.ok(util.hasClass(point[1], 'cropper-hidden'));
- assert.ok(util.hasClass(point[2], 'cropper-hidden'));
- assert.ok(util.hasClass(point[3], 'cropper-hidden'));
- assert.ok(util.hasClass(point[4], 'cropper-hidden'));
- assert.ok(util.hasClass(point[5], 'cropper-hidden'));
- assert.ok(util.hasClass(point[6], 'cropper-hidden'));
- assert.ok(util.hasClass(point[7], 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/cropend.js b/library/cropperjs/test/options/cropend.js
deleted file mode 100644
index abfe815c0..000000000
--- a/library/cropperjs/test/options/cropend.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('options#cropend', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- },
-
- cropend: function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- }
- });
-});
diff --git a/library/cropperjs/test/options/cropmove.js b/library/cropperjs/test/options/cropmove.js
deleted file mode 100644
index fa20f4011..000000000
--- a/library/cropperjs/test/options/cropmove.js
+++ /dev/null
@@ -1,24 +0,0 @@
-QUnit.test('options#cropmove', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- },
-
- cropmove: function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- }
- });
-});
diff --git a/library/cropperjs/test/options/cropstart.js b/library/cropperjs/test/options/cropstart.js
deleted file mode 100644
index f547269cd..000000000
--- a/library/cropperjs/test/options/cropstart.js
+++ /dev/null
@@ -1,56 +0,0 @@
-QUnit.test('options#cropstart', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- },
-
- cropstart: function (e) {
- assert.strictEqual(e.detail.action, 'crop');
- }
- });
-});
-
-QUnit.test('options#cropstart: default prevented', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(0);
-
- return new Cropper(image, {
- ready: function () {
- var PointerEvent = window.PointerEvent;
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerdown' : 'mousedown');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointermove' : 'mousemove');
- util.dispatchEvent(cropper.dragBox, PointerEvent ? 'pointerup' : 'mouseup');
-
- done();
- },
-
- cropstart: function (e) {
- e.preventDefault();
- },
-
- cropmove: function () {
- assert.ok(false);
- },
-
- cropend: function () {
- assert.ok(false);
- }
- });
-});
diff --git a/library/cropperjs/test/options/data.js b/library/cropperjs/test/options/data.js
deleted file mode 100644
index e9da6a4dd..000000000
--- a/library/cropperjs/test/options/data.js
+++ /dev/null
@@ -1,35 +0,0 @@
-QUnit.test('options#data', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var initialData = {
- x: 360,
- y: 450,
- width: 640,
- height: 360,
- rotate: 45,
- scaleX: -1,
- scaleY: -1
- };
-
- assert.expect(7);
-
- return new Cropper(image, {
- data: initialData,
-
- ready: function () {
- var cropper = this.cropper;
- var data = cropper.getData(true);
-
- assert.strictEqual(data.x, initialData.x);
- assert.strictEqual(data.y, initialData.y);
- assert.strictEqual(data.width, initialData.width);
- assert.strictEqual(data.height, initialData.height);
- assert.strictEqual(data.rotate, initialData.rotate);
- assert.strictEqual(data.scaleX, initialData.scaleX);
- assert.strictEqual(data.scaleY, initialData.scaleY);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/dragMode.js b/library/cropperjs/test/options/dragMode.js
deleted file mode 100644
index 57f31ff13..000000000
--- a/library/cropperjs/test/options/dragMode.js
+++ /dev/null
@@ -1,60 +0,0 @@
-QUnit.test('options#dragMode: crop', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // dragMode: 'crop',
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.dragBox.dataset.action, 'crop');
-
- done();
- }
- });
-});
-
-QUnit.test('options#dragMode: move', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- dragMode: 'move',
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.dragBox.dataset.action, 'move');
-
- done();
- }
- });
-});
-
-
-QUnit.test('options#dragMode: none', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- dragMode: 'none',
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.dragBox.dataset.action, 'none');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/guides.js b/library/cropperjs/test/options/guides.js
deleted file mode 100644
index 298c3ad3a..000000000
--- a/library/cropperjs/test/options/guides.js
+++ /dev/null
@@ -1,43 +0,0 @@
-QUnit.test('options#guides: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- // guides: true,
-
- ready: function () {
- var cropper = this.cropper;
- var dashed = util.getByClass(cropper.cropBox, 'cropper-dashed');
-
- assert.notOk(util.hasClass(dashed[0], 'cropper-hidden'));
- assert.notOk(util.hasClass(dashed[1], 'cropper-hidden'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#guides: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- guides: false,
-
- ready: function () {
- var cropper = this.cropper;
- var dashed = util.getByClass(cropper.cropBox, 'cropper-dashed');
-
- assert.ok(util.hasClass(dashed[0], 'cropper-hidden'));
- assert.ok(util.hasClass(dashed[1], 'cropper-hidden'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/highlight.js b/library/cropperjs/test/options/highlight.js
deleted file mode 100644
index a1db4687f..000000000
--- a/library/cropperjs/test/options/highlight.js
+++ /dev/null
@@ -1,41 +0,0 @@
-QUnit.test('options#highlight: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // highlight: true,
-
- ready: function () {
- var cropper = this.cropper;
- var face = util.getByClass(cropper.cropBox, 'cropper-face');
-
- assert.notOk(util.hasClass(face[0], 'cropper-invisible'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#highlight: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- highlight: false,
-
- ready: function () {
- var cropper = this.cropper;
- var face = util.getByClass(cropper.cropBox, 'cropper-face');
-
- assert.ok(util.hasClass(face[0], 'cropper-invisible'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minCanvasHeight.js b/library/cropperjs/test/options/minCanvasHeight.js
deleted file mode 100644
index c9745a9b1..000000000
--- a/library/cropperjs/test/options/minCanvasHeight.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('options#minCanvasHeight', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minCanvasHeight = 270;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minCanvasHeight: minCanvasHeight,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.setCanvasData({
- height: 180
- }).getCanvasData();
-
- assert.strictEqual(Math.round(canvasData.height), minCanvasHeight);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minCanvasWidth.js b/library/cropperjs/test/options/minCanvasWidth.js
deleted file mode 100644
index 61601e4f9..000000000
--- a/library/cropperjs/test/options/minCanvasWidth.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('options#minCanvasWidth', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minCanvasWidth = 480;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minCanvasWidth: minCanvasWidth,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.setCanvasData({
- width: 320
- }).getCanvasData();
-
- assert.strictEqual(Math.round(canvasData.width), minCanvasWidth);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minContainerHeight.js b/library/cropperjs/test/options/minContainerHeight.js
deleted file mode 100644
index 85d7a70ef..000000000
--- a/library/cropperjs/test/options/minContainerHeight.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('options#minContainerHeight', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minContainerHeight = 361;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minContainerHeight: minContainerHeight,
-
- ready: function () {
- var cropper = this.cropper;
- var containerData = cropper.getContainerData();
-
- assert.strictEqual(Math.round(containerData.height), minContainerHeight);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minContainerWidth.js b/library/cropperjs/test/options/minContainerWidth.js
deleted file mode 100644
index 2119cc96e..000000000
--- a/library/cropperjs/test/options/minContainerWidth.js
+++ /dev/null
@@ -1,21 +0,0 @@
-QUnit.test('options#minContainerWidth', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minContainerWidth = 641;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minContainerWidth: minContainerWidth,
-
- ready: function () {
- var cropper = this.cropper;
- var containerData = cropper.getContainerData();
-
- assert.strictEqual(Math.round(containerData.width), minContainerWidth);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minCropBoxHeight.js b/library/cropperjs/test/options/minCropBoxHeight.js
deleted file mode 100644
index ccf50aefe..000000000
--- a/library/cropperjs/test/options/minCropBoxHeight.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('options#minCropBoxHeight', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minCropBoxHeight = 150;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minCropBoxHeight: minCropBoxHeight,
-
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.setCropBoxData({
- height: 100
- }).getCropBoxData();
-
- assert.strictEqual(Math.round(cropBoxData.height), minCropBoxHeight);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/minCropBoxWidth.js b/library/cropperjs/test/options/minCropBoxWidth.js
deleted file mode 100644
index acde5c366..000000000
--- a/library/cropperjs/test/options/minCropBoxWidth.js
+++ /dev/null
@@ -1,23 +0,0 @@
-QUnit.test('options#minCropBoxWidth', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
- var minCropBoxWidth = 300;
-
- assert.expect(1);
-
- return new Cropper(image, {
- minCropBoxWidth: minCropBoxWidth,
-
- ready: function () {
- var cropper = this.cropper;
- var cropBoxData = cropper.setCropBoxData({
- width: 200
- }).getCropBoxData();
-
- assert.strictEqual(Math.round(cropBoxData.width), minCropBoxWidth);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/modal.js b/library/cropperjs/test/options/modal.js
deleted file mode 100644
index 7284cb264..000000000
--- a/library/cropperjs/test/options/modal.js
+++ /dev/null
@@ -1,39 +0,0 @@
-QUnit.test('options#modal: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // modal: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.ok(util.hasClass(cropper.dragBox, 'cropper-modal'));
-
- done();
- }
- });
-});
-
-QUnit.test('options#modal: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- modal: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.notOk(util.hasClass(cropper.dragBox, 'cropper-modal'));
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/movable.js b/library/cropperjs/test/options/movable.js
deleted file mode 100644
index 0e2c53506..000000000
--- a/library/cropperjs/test/options/movable.js
+++ /dev/null
@@ -1,45 +0,0 @@
-QUnit.test('options#movable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- // movable: true,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.move(10, 10).getCanvasData();
-
- assert.strictEqual(changedCanvasData.left, canvasData.left + 10);
- assert.strictEqual(changedCanvasData.top, canvasData.top + 10);
-
- done();
- }
- });
-});
-
-QUnit.test('options#movable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- movable: false,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.move(10, 10).getCanvasData();
-
- assert.strictEqual(changedCanvasData.left, canvasData.left);
- assert.strictEqual(changedCanvasData.top, canvasData.top);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/ready.js b/library/cropperjs/test/options/ready.js
deleted file mode 100644
index e09e8369c..000000000
--- a/library/cropperjs/test/options/ready.js
+++ /dev/null
@@ -1,15 +0,0 @@
-QUnit.test('options#ready', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- assert.ok(true);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/rotatable.js b/library/cropperjs/test/options/rotatable.js
deleted file mode 100644
index 992e9362f..000000000
--- a/library/cropperjs/test/options/rotatable.js
+++ /dev/null
@@ -1,39 +0,0 @@
-QUnit.test('options#rotatable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // rotatable: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.rotate(90).getImageData().rotate, 90);
-
- done();
- }
- });
-});
-
-QUnit.test('options#rotatable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- rotatable: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- assert.strictEqual(cropper.rotate(90).getImageData().rotate, undefined);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/scalable.js b/library/cropperjs/test/options/scalable.js
deleted file mode 100644
index c523eaf63..000000000
--- a/library/cropperjs/test/options/scalable.js
+++ /dev/null
@@ -1,43 +0,0 @@
-QUnit.test('options#scalable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- // scalable: true,
-
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scale(-1, -1).getImageData();
-
- assert.strictEqual(imageData.scaleX, -1);
- assert.strictEqual(imageData.scaleY, -1);
-
- done();
- }
- });
-});
-
-QUnit.test('options#scalable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- scalable: false,
-
- ready: function () {
- var cropper = this.cropper;
- var imageData = cropper.scale(-1, -1).getImageData();
-
- assert.strictEqual(imageData.scaleX, undefined);
- assert.strictEqual(imageData.scaleY, undefined);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/toggleDragModeOnDblclick.js b/library/cropperjs/test/options/toggleDragModeOnDblclick.js
deleted file mode 100644
index df64327b2..000000000
--- a/library/cropperjs/test/options/toggleDragModeOnDblclick.js
+++ /dev/null
@@ -1,45 +0,0 @@
-QUnit.test('options#toggleDragModeOnDblclick: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- // toggleDragModeOnDblclick: true,
-
- ready: function () {
- var cropper = this.cropper;
- var dragBox = cropper.dragBox;
-
- util.dispatchEvent(dragBox, 'dblclick');
- assert.ok(util.hasClass(dragBox, 'cropper-move'));
- assert.strictEqual(dragBox.dataset.action, 'move');
-
- done();
- }
- });
-});
-
-QUnit.test('options#toggleDragModeOnDblclick: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- toggleDragModeOnDblclick: false,
-
- ready: function () {
- var cropper = this.cropper;
- var dragBox = cropper.dragBox;
-
- util.dispatchEvent(dragBox, 'dblclick');
- assert.ok(util.hasClass(dragBox, 'cropper-crop'));
- assert.strictEqual(dragBox.dataset.action, 'crop');
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/viewMode.js b/library/cropperjs/test/options/viewMode.js
deleted file mode 100644
index e39ec5fc1..000000000
--- a/library/cropperjs/test/options/viewMode.js
+++ /dev/null
@@ -1,100 +0,0 @@
-QUnit.test('options#viewMode: 0', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- // viewMode: 0,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = {
- left: 100,
- top: 100,
- width: 160,
- height: 90
- };
- var changedCanvasData = cropper.setCanvasData(canvasData).getCanvasData();
-
- assert.strictEqual(changedCanvasData.left, canvasData.left);
- assert.strictEqual(changedCanvasData.top, canvasData.top);
- assert.strictEqual(changedCanvasData.width, canvasData.width);
- assert.strictEqual(changedCanvasData.height, canvasData.height);
-
- done();
- }
- });
-});
-
-QUnit.test('options#viewMode: 1', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- viewMode: 1,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.zoom(-0.5).getCanvasData(); // Zoom out
- var cropBoxData = cropper.getCropBoxData();
-
- assert.ok(canvasData.width >= cropBoxData.width);
- assert.ok(canvasData.height >= cropBoxData.height);
-
- done();
- }
- });
-});
-
-QUnit.test('options#viewMode: 2', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- viewMode: 2,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.zoom(-0.5).getCanvasData(); // Zoom out
- var containerData = cropper.getContainerData();
-
- assert.ok(canvasData.width >= containerData.width ||
- canvasData.height >= containerData.height);
-
- done();
- }
- });
-});
-
-QUnit.test('options#viewMode: 3', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(4);
-
- return new Cropper(image, {
- viewMode: 3,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.zoom(-0.5).getCanvasData(); // Zoom out
- var containerData = cropper.getContainerData();
-
- assert.ok(canvasData.left <= 0);
- assert.ok(canvasData.top <= 0);
- assert.ok(canvasData.width >= containerData.width);
- assert.ok(canvasData.height >= containerData.height);
-
- done();
- }
- });
-});
diff --git a/library/cropperjs/test/options/zoom.js b/library/cropperjs/test/options/zoom.js
deleted file mode 100644
index 51ebc76ad..000000000
--- a/library/cropperjs/test/options/zoom.js
+++ /dev/null
@@ -1,46 +0,0 @@
-QUnit.test('options#zoom', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(3);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
-
- cropper.zoom(0.1);
-
- done();
- },
-
- zoom: function (e) {
- assert.ok(e.detail.ratio > 0);
- assert.ok(e.detail.oldRatio > 0);
- assert.ok(e.detail.ratio > e.detail.oldRatio);
- }
- });
-});
-
-QUnit.test('options#zoom: default prevented', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
-
- assert.deepEqual(cropper.zoom(0.1).getCanvasData(), canvasData);
-
- done();
- },
-
- zoom: function (e) {
- e.preventDefault();
- }
- });
-});
diff --git a/library/cropperjs/test/options/zoomOnWheel.js b/library/cropperjs/test/options/zoomOnWheel.js
deleted file mode 100644
index 1a1bf6dce..000000000
--- a/library/cropperjs/test/options/zoomOnWheel.js
+++ /dev/null
@@ -1,47 +0,0 @@
-QUnit.test('options#zoomOnWheel: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(1);
-
- return new Cropper(image, {
- // zoomOnWheel: true,
-
- ready: function () {
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.cropper, 'wheel');
-
- done();
- },
-
- zoom: function () {
- assert.ok(true);
- }
- });
-});
-
-QUnit.test('options#zoomOnWheel: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(0);
-
- return new Cropper(image, {
- zoomOnWheel: false,
-
- ready: function () {
- var cropper = this.cropper;
-
- util.dispatchEvent(cropper.cropper, 'wheel');
-
- done();
- },
-
- zoom: function () {
- assert.ok(false);
- }
- });
-});
diff --git a/library/cropperjs/test/options/zoomable.js b/library/cropperjs/test/options/zoomable.js
deleted file mode 100644
index 9f8ec6fce..000000000
--- a/library/cropperjs/test/options/zoomable.js
+++ /dev/null
@@ -1,51 +0,0 @@
-QUnit.test('options#zoomable: true', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(3);
-
- return new Cropper(image, {
- // zoomable: true,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.zoom(0.1).getCanvasData();
-
- assert.ok(changedCanvasData.width > canvasData.width);
- assert.ok(changedCanvasData.height > canvasData.height);
-
- done();
- },
- zoom: function () {
- assert.ok(true);
- }
- });
-});
-
-QUnit.test('options#zoomable: false', function (assert) {
- var done = assert.async();
- var util = window.Util;
- var image = util.createImage();
-
- assert.expect(2);
-
- return new Cropper(image, {
- zoomable: false,
-
- ready: function () {
- var cropper = this.cropper;
- var canvasData = cropper.getCanvasData();
- var changedCanvasData = cropper.zoom(0.1).getCanvasData();
-
- assert.ok(changedCanvasData.width === canvasData.width);
- assert.ok(changedCanvasData.height === canvasData.height);
-
- done();
- },
- zoom: function () {
- assert.ok(false);
- }
- });
-});
diff --git a/library/cropperjs/test/specs/Cropper.spec.js b/library/cropperjs/test/specs/Cropper.spec.js
new file mode 100644
index 000000000..ed20ad1fd
--- /dev/null
+++ b/library/cropperjs/test/specs/Cropper.spec.js
@@ -0,0 +1,11 @@
+describe('Cropper', () => {
+ it('should be a class (function)', () => {
+ expect(Cropper).to.be.a('function');
+ });
+
+ it('should throw error when the first argument is not an element', () => {
+ expect(() => {
+ new Cropper(document);
+ }).to.throw('The first argument is required and must be an <img> or <canvas> element.');
+ });
+});
diff --git a/library/cropperjs/test/specs/events/crop.spec.js b/library/cropperjs/test/specs/events/crop.spec.js
new file mode 100644
index 000000000..04ec1fd10
--- /dev/null
+++ b/library/cropperjs/test/specs/events/crop.spec.js
@@ -0,0 +1,30 @@
+describe('crop (event)', () => {
+ it('should trigger the `crop` event', (done) => {
+ const image = window.createImage();
+
+ image.addEventListener('crop', (event) => {
+ expect(event.type).to.equal('crop');
+ done();
+ });
+
+ new Cropper(image);
+ });
+
+ it('should have expected properties in `event.detail`', (done) => {
+ const image = window.createImage();
+
+ image.addEventListener('crop', (event) => {
+ expect(event.detail).to.be.an('object').that.has.all.keys(['x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY']);
+ expect(event.detail.x).to.be.a('number');
+ expect(event.detail.y).to.be.a('number');
+ expect(event.detail.width).to.be.a('number');
+ expect(event.detail.height).to.be.a('number');
+ expect(event.detail.rotate).to.be.a('number');
+ expect(event.detail.scaleX).to.be.a('number');
+ expect(event.detail.scaleY).to.be.a('number');
+ done();
+ });
+
+ new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/events/cropend.spec.js b/library/cropperjs/test/specs/events/cropend.spec.js
new file mode 100644
index 000000000..8bdbc92d7
--- /dev/null
+++ b/library/cropperjs/test/specs/events/cropend.spec.js
@@ -0,0 +1,47 @@
+describe('cropend (event)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should trigger the `cropend` event', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropend', (event) => {
+ expect(event.type).to.equal('cropend');
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should have expected properties in `event.detail`', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropend', (event) => {
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_UP);
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/events/cropmove.spec.js b/library/cropperjs/test/specs/events/cropmove.spec.js
new file mode 100644
index 000000000..1349bf3e2
--- /dev/null
+++ b/library/cropperjs/test/specs/events/cropmove.spec.js
@@ -0,0 +1,71 @@
+describe('cropmove (event)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should trigger the `cropmove` event', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropmove', (event) => {
+ expect(event.detail.action).to.equal('crop');
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should have expected properties in `event.detail`', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropmove', (event) => {
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_MOVE);
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should not trigger the `crop` event when default prevented', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ image.addEventListener('crop', () => {
+ expect.fail(1, 0);
+ });
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropmove', (event) => {
+ event.preventDefault();
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/events/cropstart.spec.js b/library/cropperjs/test/specs/events/cropstart.spec.js
new file mode 100644
index 000000000..41e21ce62
--- /dev/null
+++ b/library/cropperjs/test/specs/events/cropstart.spec.js
@@ -0,0 +1,75 @@
+describe('cropstart (event)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should trigger the `cropstart` event', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropstart', (event) => {
+ expect(event.type).to.equal('cropstart');
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should have expected properties in `event.detail`', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropstart', (event) => {
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_DOWN);
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should not trigger the `cropmove` and `cropend` events when default prevented', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ });
+
+ image.addEventListener('cropstart', (event) => {
+ event.preventDefault();
+ done();
+ });
+
+ image.addEventListener('cropmove', () => {
+ expect.fail(1, 0);
+ });
+
+ image.addEventListener('cropend', () => {
+ expect.fail(1, 0);
+ });
+
+ cropper = new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/events/ready.spec.js b/library/cropperjs/test/specs/events/ready.spec.js
new file mode 100644
index 000000000..fd88314f0
--- /dev/null
+++ b/library/cropperjs/test/specs/events/ready.spec.js
@@ -0,0 +1,26 @@
+describe('ready (event)', () => {
+ it('should trigger the `ready` event', (done) => {
+ const image = window.createImage();
+
+ image.addEventListener('ready', (event) => {
+ expect(event.type).to.equal('ready');
+ done();
+ });
+
+ new Cropper(image);
+ });
+
+ it('should trigger the `crop` event even though default prevented', (done) => {
+ const image = window.createImage();
+
+ image.addEventListener('ready', (event) => {
+ event.preventDefault();
+ });
+
+ image.addEventListener('crop', () => {
+ done();
+ });
+
+ new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/events/zoom.spec.js b/library/cropperjs/test/specs/events/zoom.spec.js
new file mode 100644
index 000000000..c827067b7
--- /dev/null
+++ b/library/cropperjs/test/specs/events/zoom.spec.js
@@ -0,0 +1,56 @@
+describe('zoom (event)', () => {
+ it('should trigger the `zoom` event', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ cropper.zoom(0.1);
+ });
+
+ image.addEventListener('zoom', (event) => {
+ expect(event.type).to.equal('zoom');
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should have correct properties in `event.detail`', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ cropper.zoom(0.1);
+ });
+
+ image.addEventListener('zoom', (event) => {
+ expect(event.detail).to.be.an('object').that.has.all.keys(['ratio', 'oldRatio', 'originalEvent']);
+ expect(event.detail.ratio).to.be.a('number');
+ expect(event.detail.oldRatio).to.be.a('number');
+ expect(event.detail.ratio).to.be.above(0);
+ expect(event.detail.oldRatio).to.be.above(0);
+ expect(event.detail.ratio).to.be.above(event.detail.oldRatio);
+ done();
+ });
+
+ cropper = new Cropper(image);
+ });
+
+ it('should not change the canvas sizes when default prevented', (done) => {
+ const image = window.createImage();
+ let cropper;
+
+ image.addEventListener('ready', () => {
+ const canvasData = cropper.getCanvasData();
+
+ expect(cropper.zoom(0.1).getCanvasData()).to.deep.equal(canvasData);
+ done();
+ });
+
+ image.addEventListener('zoom', (event) => {
+ event.preventDefault();
+ });
+
+ cropper = new Cropper(image);
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/clear.spec.js b/library/cropperjs/test/specs/methods/clear.spec.js
new file mode 100644
index 000000000..f9ccb6f6e
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/clear.spec.js
@@ -0,0 +1,37 @@
+describe('clear (method)', () => {
+ it('should match the expected behaviors after cleared', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.cropped).to.be.true;
+ cropper.clear();
+ expect(cropper.cropped).to.be.false;
+ expect(cropper.getData()).to.deep.equal({
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0,
+ rotate: 0,
+ scaleX: 1,
+ scaleY: 1,
+ });
+ expect(cropper.getCropBoxData()).to.be.an('object').that.is.empty;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.equal('none');
+ done();
+ },
+ });
+ });
+
+ it('should not clear when it is disabled', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.disable().clear();
+ expect(cropper.cropped).to.be.true;
+ expect(cropper.getCropBoxData()).to.be.an('object').that.is.not.empty;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.not.equal('none');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/crop.spec.js b/library/cropperjs/test/specs/methods/crop.spec.js
new file mode 100644
index 000000000..b760e7592
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/crop.spec.js
@@ -0,0 +1,50 @@
+describe('crop (method)', () => {
+ it('should match the expected behaviors by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ expect(cropper.cropped).to.be.false;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.equal('none');
+ cropper.crop();
+ expect(cropper.cropped).to.be.true;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.not.equal('none');
+ done();
+ },
+ });
+ });
+
+ it('should trigger the `crop` event', (done) => {
+ const image = window.createImage();
+
+ image.addEventListener('crop', () => {
+ done();
+ });
+
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ cropper.crop();
+ },
+ });
+ });
+
+ it('should not crop again when it is already cropped', (done) => {
+ const image = window.createImage();
+ let count = 0;
+ const cropper = new Cropper(image, {
+ crop() {
+ count += 1;
+
+ if (count > 1) {
+ expect.fail(1, 0);
+ } else {
+ cropper.crop();
+ done();
+ }
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/destroy.spec.js b/library/cropperjs/test/specs/methods/destroy.spec.js
new file mode 100644
index 000000000..c8df79ee8
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/destroy.spec.js
@@ -0,0 +1,30 @@
+describe('destroy (method)', () => {
+ it('should destroy before ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect.fail(1, 0);
+ },
+ });
+
+ expect(image.cropper).to.be.an.instanceof(Cropper);
+ expect(cropper.xhr).to.be.an.instanceof(XMLHttpRequest);
+ cropper.destroy();
+ expect(cropper.xhr).to.be.not.exist;
+ expect(image.cropper).to.be.not.exist;
+ });
+
+ it('should destroy after ready', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(this.cropper).to.be.an.instanceof(Cropper);
+ expect(window.getComputedStyle(image).display).to.equal('none');
+ cropper.destroy();
+ expect(this.cropper).to.be.not.exist;
+ expect(window.getComputedStyle(image).display).to.not.equal('none');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/disable.spec.js b/library/cropperjs/test/specs/methods/disable.spec.js
new file mode 100644
index 000000000..64deb16a3
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/disable.spec.js
@@ -0,0 +1,278 @@
+describe('disable (method)', () => {
+ it('should be disabled after call the method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.disabled).to.be.false;
+ expect(cropper.cropper.className).to.not.include('cropper-disabled');
+ cropper.disable();
+ expect(cropper.disabled).to.be.true;
+ expect(cropper.cropper.className).to.include('cropper-disabled');
+ done();
+ },
+ });
+ });
+
+ it('should disable the `crop` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ expect(cropper.cropped).to.be.false;
+ cropper.disable().crop();
+ expect(cropper.cropped).to.be.false;
+ done();
+ },
+ });
+ });
+
+ it('should disable the `reset` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.moveTo(0).getCanvasData();
+
+ cropper.disable().reset();
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `clear` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.cropped).to.be.true;
+ cropper.disable().clear();
+ expect(cropper.cropped).to.be.true;
+ done();
+ },
+ });
+ });
+
+ it('should disable the `replace` method', (done) => {
+ const image = window.createImage();
+ const imageURL = image.src;
+ const cropper = new Cropper(image, {
+ ready() {
+ if (!cropper.replaced) {
+ cropper.disable().replace('/base/docs/images/picture-2.jpg');
+ expect(image.src).to.equal(imageURL);
+ done();
+ } else {
+ expect.fail(1, 0);
+ }
+ },
+ });
+ });
+
+ it('should disable the `move` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().move(10, 10);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `moveTo` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().moveTo(0);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `zoom` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().zoom(0.1);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `zoomTo` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().zoomTo(1);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `rotate` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().rotate(45);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `rotateTo` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().rotateTo(45);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `scaleX` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().scaleX(2);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `scaleY` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().scaleY(2);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `scale` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().scale(2);
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `setData` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+
+ cropper.disable().setData({
+ width: 160,
+ });
+ expect(cropper.getData()).to.deep.equal(data);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `setCanvasData` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ cropper.disable().setCanvasData({
+ width: 160,
+ });
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `setCropBoxData` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const cropBoxData = cropper.getCropBoxData();
+
+ cropper.disable().setCropBoxData({
+ width: 160,
+ });
+ expect(cropper.getCropBoxData()).to.deep.equal(cropBoxData);
+ done();
+ },
+ });
+ });
+
+ it('should disable the `setAspectRatio` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.disable().setAspectRatio(0.618);
+ expect(cropper.options.aspectRatio).to.be.NaN;
+ done();
+ },
+ });
+ });
+
+ it('should disable the `setDragMode` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragMode } = cropper.options;
+
+ cropper.disable().setDragMode('none');
+ expect(cropper.options.dragMode).to.equal(dragMode);
+ done();
+ },
+ });
+ });
+
+ it('should not disable the `enable` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.disable().enable();
+ expect(cropper.disabled).to.be.false;
+ done();
+ },
+ });
+ });
+
+ it('should not disable the `destroy` method', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.disable().destroy();
+ expect(image.cropper).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/enable.spec.js b/library/cropperjs/test/specs/methods/enable.spec.js
new file mode 100644
index 000000000..9a8c16fed
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/enable.spec.js
@@ -0,0 +1,16 @@
+describe('enable (method)', () => {
+ it('should be enabled', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.disable();
+ expect(cropper.disabled).to.be.true;
+ expect(cropper.cropper.className).to.include('cropper-disabled');
+ cropper.enable();
+ expect(cropper.disabled).to.be.false;
+ expect(cropper.cropper.className).to.not.include('cropper-disabled');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getCanvasData.spec.js b/library/cropperjs/test/specs/methods/getCanvasData.spec.js
new file mode 100644
index 000000000..679c39269
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getCanvasData.spec.js
@@ -0,0 +1,27 @@
+describe('getCanvasData (method)', () => {
+ it('should get an empty object when it is not ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+ const canvasData = cropper.getCanvasData();
+
+ expect(canvasData).to.be.an('object').that.is.empty;
+ });
+
+ it('should get expect canvas data when ready', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ expect(canvasData).to.be.an('object').that.has.all.keys(['left', 'top', 'width', 'height', 'naturalWidth', 'naturalHeight']);
+ expect(canvasData.left).to.be.a('number');
+ expect(canvasData.top).to.be.a('number');
+ expect(canvasData.width).to.be.a('number');
+ expect(canvasData.height).to.be.a('number');
+ expect(canvasData.naturalWidth).to.be.a('number');
+ expect(canvasData.naturalHeight).to.be.a('number');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getContainerData.spec.js b/library/cropperjs/test/specs/methods/getContainerData.spec.js
new file mode 100644
index 000000000..7ab676277
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getContainerData.spec.js
@@ -0,0 +1,23 @@
+describe('getContainerData (method)', () => {
+ it('should get an empty object when it is not ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+ const containerData = cropper.getContainerData();
+
+ expect(containerData).to.be.an('object').that.is.empty;
+ });
+
+ it('should get expect container data when ready', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const containerData = cropper.getContainerData();
+
+ expect(containerData).to.be.an('object').that.has.all.keys(['width', 'height']);
+ expect(containerData.width).to.be.a('number');
+ expect(containerData.height).to.be.a('number');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getCropBoxData.spec.js b/library/cropperjs/test/specs/methods/getCropBoxData.spec.js
new file mode 100644
index 000000000..f2760ca99
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getCropBoxData.spec.js
@@ -0,0 +1,25 @@
+describe('getCropBoxData (method)', () => {
+ it('should get an empty object when it is not ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(cropBoxData).to.be.an('object').that.is.empty;
+ });
+
+ it('should get expect crop box data when ready', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(cropBoxData).to.be.an('object').that.has.all.keys(['left', 'top', 'width', 'height']);
+ expect(cropBoxData.left).to.be.a('number');
+ expect(cropBoxData.top).to.be.a('number');
+ expect(cropBoxData.width).to.be.a('number');
+ expect(cropBoxData.height).to.be.a('number');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getCroppedCanvas.spec.js b/library/cropperjs/test/specs/methods/getCroppedCanvas.spec.js
new file mode 100644
index 000000000..16441773f
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getCroppedCanvas.spec.js
@@ -0,0 +1,195 @@
+describe('getCroppedCanvas (method)', () => {
+ it('should get a canvas with the whole image drew when it is not cropped', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const canvas = cropper.getCroppedCanvas();
+
+ expect(canvas).to.be.an.instanceof(HTMLCanvasElement);
+ expect(canvas.width).to.equal(canvasData.naturalWidth);
+ expect(canvas.height).to.equal(canvasData.naturalHeight);
+ done();
+ },
+ });
+ });
+
+ it('should get a canvas with the cropped area of the image drew', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+ const canvas = cropper.getCroppedCanvas();
+
+ expect(canvas).to.be.an.instanceof(HTMLCanvasElement);
+ expect(canvas.width).to.equal(data.width);
+ expect(canvas.height).to.equal(data.height);
+ done();
+ },
+ });
+ });
+
+ it('should match the given width', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const width = 160;
+ const canvas = cropper.getCroppedCanvas({
+ width,
+ });
+
+ expect(canvas.width).to.equal(width);
+ done();
+ },
+ });
+ });
+
+ it('should match the given height', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const height = 90;
+ const canvas = cropper.getCroppedCanvas({
+ height,
+ });
+
+ expect(canvas.height).to.equal(height);
+ done();
+ },
+ });
+ });
+
+ it('should be contained when both width and height are given', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const width = 160;
+ const height = 90;
+ const canvas = cropper.getCroppedCanvas({
+ width,
+ height,
+ });
+
+ expect(canvas.width).to.be.most(width);
+ expect(canvas.height).to.be.most(height);
+ done();
+ },
+ });
+ });
+
+ it('should not be greater than the maximum width', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const maxWidth = 160;
+ const canvas = cropper.getCroppedCanvas({
+ maxWidth,
+ });
+
+ expect(canvas.width).to.be.most(maxWidth);
+ done();
+ },
+ });
+ });
+
+ it('should not be greater than the maximum height', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const maxHeight = 90;
+ const canvas = cropper.getCroppedCanvas({
+ maxHeight,
+ });
+
+ expect(canvas.height).to.be.most(maxHeight);
+ done();
+ },
+ });
+ });
+
+ it('should not be greater than both the maximum width and maximum height', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const maxWidth = 160;
+ const maxHeight = 90;
+ const canvas = cropper.getCroppedCanvas({
+ maxWidth,
+ maxHeight,
+ });
+
+ expect(canvas.width).to.be.most(maxWidth);
+ expect(canvas.height).to.be.most(maxHeight);
+ done();
+ },
+ });
+ });
+
+ it('should not be less than the minimum width', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const minWidth = 1600;
+ const canvas = cropper.getCroppedCanvas({
+ minWidth,
+ });
+
+ expect(canvas.width).to.be.least(minWidth);
+ done();
+ },
+ });
+ });
+
+ it('should not be less than the minimum height', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const minHeight = 900;
+ const canvas = cropper.getCroppedCanvas({
+ minHeight,
+ });
+
+ expect(canvas.height).to.be.least(minHeight);
+ done();
+ },
+ });
+ });
+
+ it('should not be less than both the minimum width and minimum height', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const minWidth = 1600;
+ const minHeight = 900;
+ const canvas = cropper.getCroppedCanvas({
+ minWidth,
+ minHeight,
+ });
+
+ expect(canvas.width).to.be.least(minWidth);
+ expect(canvas.height).to.be.least(minHeight);
+ done();
+ },
+ });
+ });
+
+ it('should match the given fill color', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvas = cropper.zoomTo(0.1).getCroppedCanvas({
+ fillColor: '#010101',
+ });
+ const pixelData = canvas.getContext('2d').getImageData(0, 0, 1, 1).data;
+
+ expect(pixelData[0]).to.equal(1, 'red is 1');
+ expect(pixelData[1]).to.equal(1, 'green is 1');
+ expect(pixelData[2]).to.equal(1, 'blue is 1');
+ expect(pixelData[3]).to.equal(255, 'color is opaque');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getData.spec.js b/library/cropperjs/test/specs/methods/getData.spec.js
new file mode 100644
index 000000000..13bcd2304
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getData.spec.js
@@ -0,0 +1,91 @@
+describe('getData (method)', () => {
+ const initialData = {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0,
+ rotate: 0,
+ scaleX: 1,
+ scaleY: 1,
+ };
+
+ it('should get initial data when it is not ready', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.getData()).to.deep.equal(initialData);
+ });
+
+ it('should get initial data when it is not cropped', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ expect(cropper.cropped).to.be.false;
+ expect(cropper.getData()).to.deep.equal(initialData);
+ done();
+ },
+ });
+ });
+
+ it('should get data with expected properties', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+
+ expect(data).to.be.an('object').that.has.all.keys(['x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY']);
+ expect(data.x).to.be.a('number');
+ expect(data.y).to.be.a('number');
+ expect(data.width).to.be.a('number');
+ expect(data.height).to.be.a('number');
+ expect(data.rotate).to.be.a('number');
+ expect(data.scaleX).to.be.a('number');
+ expect(data.scaleY).to.be.a('number');
+ done();
+ },
+ });
+ });
+
+ it('should get data with rounded property values', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData(true);
+
+ expect(data.x % 1).to.equal(0);
+ expect(data.y % 1).to.equal(0);
+ expect(data.width % 1).to.equal(0);
+ expect(data.height % 1).to.equal(0);
+ done();
+ },
+ });
+ });
+
+ it('should not exceed the natural width/height after rounded', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ viewMode: 1,
+
+ ready() {
+ const imageData = cropper.getImageData();
+ const left = 155.5;
+ const top = 155.5;
+
+ cropper.setData({
+ left,
+ top,
+ width: imageData.naturalWidth - left,
+ height: imageData.naturalHeight - top,
+ });
+
+ const roundedData = cropper.getData(true);
+
+ expect(roundedData.x + roundedData.width).to.be.at.most(imageData.naturalWidth);
+ expect(roundedData.y + roundedData.height).to.be.at.most(imageData.naturalHeight);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/getImageData.spec.js b/library/cropperjs/test/specs/methods/getImageData.spec.js
new file mode 100644
index 000000000..c8d9ea703
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/getImageData.spec.js
@@ -0,0 +1,62 @@
+describe('getImageData (method)', () => {
+ it('should get an empty object when it is not loaded', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+ const imageData = cropper.getImageData();
+
+ expect(imageData).to.be.an('object').that.is.empty;
+ });
+
+ it('should get expect image data when loaded', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.getImageData();
+
+ expect(imageData).to.have.all.keys(['left', 'top', 'width', 'height', 'rotate', 'scaleX', 'scaleY', 'naturalWidth', 'naturalHeight', 'aspectRatio']);
+ expect(imageData.left).to.be.a('number');
+ expect(imageData.top).to.be.a('number');
+ expect(imageData.width).to.be.a('number');
+ expect(imageData.height).to.be.a('number');
+ expect(imageData.rotate).to.be.a('number');
+ expect(imageData.scaleX).to.be.a('number');
+ expect(imageData.scaleY).to.be.a('number');
+ expect(imageData.naturalWidth).to.be.a('number');
+ expect(imageData.naturalHeight).to.be.a('number');
+ expect(imageData.aspectRatio).to.be.a('number');
+ done();
+ },
+ });
+ });
+
+ it('should not have the `rotate` property when it is not rotatable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ rotatable: false,
+
+ ready() {
+ const imageData = cropper.getImageData();
+
+ expect(imageData).to.have.all.keys(['left', 'top', 'width', 'height', 'scaleX', 'scaleY', 'naturalWidth', 'naturalHeight', 'aspectRatio']);
+ expect(imageData.rotate).to.be.undefined;
+ done();
+ },
+ });
+ });
+
+ it('should not have the `scaleX` and `scaleY` properties when it is not scalable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ scalable: false,
+
+ ready() {
+ const imageData = cropper.getImageData();
+
+ expect(imageData).to.have.all.keys(['left', 'top', 'width', 'height', 'rotate', 'naturalWidth', 'naturalHeight', 'aspectRatio']);
+ expect(imageData.scaleX).to.be.undefined;
+ expect(imageData.scaleY).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/move.spec.js b/library/cropperjs/test/specs/methods/move.spec.js
new file mode 100644
index 000000000..8f89ba5e8
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/move.spec.js
@@ -0,0 +1,31 @@
+describe('move (method)', () => {
+ it('should move with the given offsets', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.move(1, 1).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left + 1);
+ expect(changedCanvasData.top).to.equal(canvasData.top + 1);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not movable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ movable: false,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.move(1, 1).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left);
+ expect(changedCanvasData.top).to.equal(canvasData.top);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/moveTo.spec.js b/library/cropperjs/test/specs/methods/moveTo.spec.js
new file mode 100644
index 000000000..42403b41c
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/moveTo.spec.js
@@ -0,0 +1,29 @@
+describe('moveTo (method)', () => {
+ it('should move to the given coordinate', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.moveTo(100, 100).getCanvasData();
+
+ expect(canvasData.left).to.equal(100);
+ expect(canvasData.top).to.equal(100);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not movable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ movable: false,
+
+ ready() {
+ const canvasData = cropper.moveTo(100, 100).getCanvasData();
+
+ expect(canvasData.left).to.not.equal(100);
+ expect(canvasData.top).to.not.equal(100);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/noConflict.spec.js b/library/cropperjs/test/specs/methods/noConflict.spec.js
new file mode 100644
index 000000000..d5c1c43d8
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/noConflict.spec.js
@@ -0,0 +1,16 @@
+describe('noConflict', () => {
+ it('should be a static method', () => {
+ expect(Cropper.noConflict).to.be.a('function');
+ });
+
+ it('should return the Cropper class itself', () => {
+ const { Cropper } = window;
+ const ImageCropper = Cropper.noConflict();
+
+ expect(ImageCropper).to.equal(Cropper);
+ expect(window.Cropper).to.be.undefined;
+
+ // Reverts it for the rest test suites
+ window.Cropper = ImageCropper;
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/replace.spec.js b/library/cropperjs/test/specs/methods/replace.spec.js
new file mode 100644
index 000000000..378cb0af8
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/replace.spec.js
@@ -0,0 +1,17 @@
+describe('replace (method)', () => {
+ it('should replace the image url with a new one', (done) => {
+ const image = window.createImage();
+ const imageURL = '/base/docs/images/picture-2.jpg';
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.options.ready = () => {
+ expect(image.src).to.include(imageURL);
+ done();
+ };
+
+ expect(image.src).to.not.include(imageURL);
+ cropper.replace(imageURL);
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/reset.spec.js b/library/cropperjs/test/specs/methods/reset.spec.js
new file mode 100644
index 000000000..e060d9794
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/reset.spec.js
@@ -0,0 +1,30 @@
+describe('reset (method)', () => {
+ it('should reset the cropper to its initial state', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const cropBoxData = cropper.getCropBoxData();
+
+ cropper.setCanvasData({
+ top: canvasData.top + 10,
+ width: canvasData.width - 10,
+ });
+
+ expect(cropper.getCanvasData()).to.not.deep.equal(canvasData);
+
+ cropper.setCropBoxData({
+ left: cropBoxData.left + 10,
+ height: cropBoxData.height - 10,
+ });
+
+ expect(cropper.getCropBoxData()).to.not.deep.equal(cropBoxData);
+
+ cropper.reset();
+ expect(cropper.getCanvasData()).to.deep.equal(canvasData);
+ expect(cropper.getCropBoxData()).to.deep.equal(cropBoxData);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/rotate.spec.js b/library/cropperjs/test/specs/methods/rotate.spec.js
new file mode 100644
index 000000000..b4cfef511
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/rotate.spec.js
@@ -0,0 +1,27 @@
+describe('rotate (method)', () => {
+ it('should rotate with the given degree', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.rotate(360).getImageData().rotate).to.equal(0);
+ expect(cropper.rotate(90).getImageData().rotate).to.equal(90);
+ expect(cropper.rotate(-180).getImageData().rotate).to.equal(-90);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not rotatable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ rotatable: false,
+
+ ready() {
+ expect(cropper.rotate(360).getImageData().rotate).to.be.undefined;
+ expect(cropper.rotate(90).getImageData().rotate).to.be.undefined;
+ expect(cropper.rotate(-180).getImageData().rotate).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/rotateTo.spec.js b/library/cropperjs/test/specs/methods/rotateTo.spec.js
new file mode 100644
index 000000000..0ae59ee55
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/rotateTo.spec.js
@@ -0,0 +1,28 @@
+describe('rotateTo (method)', () => {
+ it('should rotate to the given degree', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.rotateTo(360).getImageData().rotate).to.equal(0);
+ expect(cropper.rotateTo(90).getImageData().rotate).to.equal(90);
+ expect(cropper.rotateTo(0).getImageData().rotate).to.equal(0);
+ expect(cropper.rotateTo(-180).getImageData().rotate).to.equal(-180);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not rotatable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ rotatable: false,
+
+ ready() {
+ expect(cropper.rotateTo(360).getImageData().rotate).to.be.undefined;
+ expect(cropper.rotateTo(90).getImageData().rotate).to.be.undefined;
+ expect(cropper.rotateTo(-180).getImageData().rotate).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/scale.spec.js b/library/cropperjs/test/specs/methods/scale.spec.js
new file mode 100644
index 000000000..9918cba3a
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/scale.spec.js
@@ -0,0 +1,29 @@
+describe('scale (method)', () => {
+ it('should scale with the given values', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.scale(-1, -1).getImageData();
+
+ expect(imageData.scaleX).to.equal(-1);
+ expect(imageData.scaleY).to.equal(-1);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not scalable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ scalable: false,
+
+ ready() {
+ const imageData = cropper.scale(-1, -1).getImageData();
+
+ expect(imageData.scaleX).to.be.undefined;
+ expect(imageData.scaleY).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/scaleX.spec.js b/library/cropperjs/test/specs/methods/scaleX.spec.js
new file mode 100644
index 000000000..72ac8e28a
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/scaleX.spec.js
@@ -0,0 +1,27 @@
+describe('scaleX (method)', () => {
+ it('should be scaled in the x-axis', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.scaleX(-1).getImageData();
+
+ expect(imageData.scaleX).to.equal(-1);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not scalable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ scalable: false,
+
+ ready() {
+ const imageData = cropper.scaleX(-1).getImageData();
+
+ expect(imageData.scaleX).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/scaleY.spec.js b/library/cropperjs/test/specs/methods/scaleY.spec.js
new file mode 100644
index 000000000..f983a2fbf
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/scaleY.spec.js
@@ -0,0 +1,27 @@
+describe('scaleY (method)', () => {
+ it('should be scaled in the y-axis', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.scaleY(-1).getImageData();
+
+ expect(imageData.scaleY).to.equal(-1);
+ done();
+ },
+ });
+ });
+
+ it('should not work when it is not scalable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ scalable: false,
+
+ ready() {
+ const imageData = cropper.scaleY(-1).getImageData();
+
+ expect(imageData.scaleY).to.be.undefined;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setAspectRatio.spec.js b/library/cropperjs/test/specs/methods/setAspectRatio.spec.js
new file mode 100644
index 000000000..dc76ad18f
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setAspectRatio.spec.js
@@ -0,0 +1,31 @@
+describe('setAspectRatio (method)', () => {
+ it('should change the aspect ratio to `1`', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { options } = cropper;
+
+ expect(options.aspectRatio).to.be.NaN;
+ cropper.setAspectRatio(1);
+ expect(options.aspectRatio).to.equal(1);
+ done();
+ },
+ });
+ });
+
+ it('should change the aspect ratio to `NaN`', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ aspectRatio: 1,
+
+ ready() {
+ const { options } = cropper;
+
+ expect(options.aspectRatio).to.equal(1);
+ cropper.setAspectRatio(NaN);
+ expect(options.aspectRatio).to.be.NaN;
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setCanvasData.spec.js b/library/cropperjs/test/specs/methods/setCanvasData.spec.js
new file mode 100644
index 000000000..316161acc
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setCanvasData.spec.js
@@ -0,0 +1,39 @@
+describe('setCanvasData (method)', () => {
+ it('should change the positions only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.setCanvasData({
+ left: 16,
+ top: 9,
+ }).getCanvasData();
+
+ expect(changedCanvasData.left).to.not.equal(canvasData.left);
+ expect(changedCanvasData.top).to.not.equal(canvasData.top);
+ expect(changedCanvasData.width).to.equal(canvasData.width);
+ expect(changedCanvasData.height).to.equal(canvasData.height);
+ done();
+ },
+ });
+ });
+
+ it('should change the sizes only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.setCanvasData({
+ width: 320,
+ height: 180,
+ }).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left);
+ expect(changedCanvasData.top).to.equal(canvasData.top);
+ expect(changedCanvasData.width).to.not.equal(canvasData.width);
+ expect(changedCanvasData.height).to.not.equal(canvasData.height);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setCropBoxData.spec.js b/library/cropperjs/test/specs/methods/setCropBoxData.spec.js
new file mode 100644
index 000000000..829c83419
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setCropBoxData.spec.js
@@ -0,0 +1,39 @@
+describe('setCropBoxData (method)', () => {
+ it('should change the positions only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const cropBoxData = cropper.getCropBoxData();
+ const changedCropBoxData = cropper.setCropBoxData({
+ left: 16,
+ top: 9,
+ }).getCropBoxData();
+
+ expect(changedCropBoxData.left).to.not.equal(cropBoxData.left);
+ expect(changedCropBoxData.top).to.not.equal(cropBoxData.top);
+ expect(changedCropBoxData.width).to.equal(cropBoxData.width);
+ expect(changedCropBoxData.height).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+ });
+
+ it('should change the sizes only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const cropBoxData = cropper.getCropBoxData();
+ const changedCropBoxData = cropper.setCropBoxData({
+ width: 320,
+ height: 180,
+ }).getCropBoxData();
+
+ expect(changedCropBoxData.left).to.equal(cropBoxData.left);
+ expect(changedCropBoxData.top).to.equal(cropBoxData.top);
+ expect(changedCropBoxData.width).to.not.equal(cropBoxData.width);
+ expect(changedCropBoxData.height).to.not.equal(cropBoxData.height);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setData.spec.js b/library/cropperjs/test/specs/methods/setData.spec.js
new file mode 100644
index 000000000..418052409
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setData.spec.js
@@ -0,0 +1,71 @@
+describe('setData (method)', () => {
+ it('should change the positions only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+ const changedData = cropper.setData({
+ x: 1,
+ y: 1,
+ }).getData();
+
+ expect(changedData.x).to.not.equal(data.x);
+ expect(changedData.y).to.not.equal(data.y);
+ expect(changedData.width).to.equal(data.width);
+ expect(changedData.height).to.equal(data.height);
+ done();
+ },
+ });
+ });
+
+ it('should change the positions only', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+ const changedData = cropper.setData({
+ width: 160,
+ height: 90,
+ }).getData();
+
+ expect(changedData.x).to.equal(data.x);
+ expect(changedData.y).to.equal(data.y);
+ expect(changedData.width).to.not.equal(data.width);
+ expect(changedData.height).to.not.equal(data.height);
+ done();
+ },
+ });
+ });
+
+ it('should change the rotate degrees', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+ const changedData = cropper.setData({
+ rotate: 90,
+ }).getData();
+
+ expect(changedData.rotate).to.not.equal(data.rotate);
+ done();
+ },
+ });
+ });
+
+ it('should change the scale in both x-axis and y-axis', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.getData();
+ const changedData = cropper.setData({
+ scaleX: -1,
+ scaleY: -1,
+ }).getData();
+
+ expect(changedData.scaleX).to.not.equal(data.scaleX);
+ expect(changedData.scaleY).to.not.equal(data.scaleY);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setDefaults.spec.js b/library/cropperjs/test/specs/methods/setDefaults.spec.js
new file mode 100644
index 000000000..fb894db3b
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setDefaults.spec.js
@@ -0,0 +1,30 @@
+describe('setDefaults', () => {
+ it('should be a static method', () => {
+ expect(Cropper.setDefaults).to.be.a('function');
+ });
+
+ it('should change the global default options', (done) => {
+ Cropper.setDefaults({
+ aspectRatio: 1,
+ });
+
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ aspectRatio: 1,
+
+ crop() {
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(cropBoxData.width).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.aspectRatio).to.equal(1);
+
+ // Reverts it for the rest test suites
+ Cropper.setDefaults({
+ aspectRatio: NaN,
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/setDragMode.spec.js b/library/cropperjs/test/specs/methods/setDragMode.spec.js
new file mode 100644
index 000000000..612220ec2
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/setDragMode.spec.js
@@ -0,0 +1,29 @@
+describe('setDragMode (method)', () => {
+ it('should set the drag mode to "move"', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ expect(dragBox.dataset.cropperAction).to.equal('crop');
+ cropper.setDragMode('move');
+ expect(dragBox.dataset.cropperAction).to.equal('move');
+ done();
+ },
+ });
+ });
+
+ it('should set the drag mode to "none"', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ expect(dragBox.dataset.cropperAction).to.equal('crop');
+ cropper.setDragMode('none');
+ expect(dragBox.dataset.cropperAction).to.equal('none');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/zoom.spec.js b/library/cropperjs/test/specs/methods/zoom.spec.js
new file mode 100644
index 000000000..4989d27e6
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/zoom.spec.js
@@ -0,0 +1,31 @@
+describe('zoom (method)', () => {
+ it('should be zoomed', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.zoom(0.1).getCanvasData();
+
+ expect(changedCanvasData.width).to.be.above(canvasData.width);
+ expect(changedCanvasData.height).to.be.above(canvasData.height);
+ done();
+ },
+ });
+ });
+
+ it('should not be zoomed when it is not zoomable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ zoomable: false,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.zoom(0.1).getCanvasData();
+
+ expect(changedCanvasData.width).to.equal(canvasData.width);
+ expect(changedCanvasData.height).to.equal(canvasData.height);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/methods/zoomTo.spec.js b/library/cropperjs/test/specs/methods/zoomTo.spec.js
new file mode 100644
index 000000000..a06730485
--- /dev/null
+++ b/library/cropperjs/test/specs/methods/zoomTo.spec.js
@@ -0,0 +1,33 @@
+describe('zoomTo (method)', () => {
+ it('should zoom to the certain ratio', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.zoomTo(1).getImageData();
+ const canvasData = cropper.getCanvasData();
+
+ expect(imageData.width).to.equal(imageData.naturalWidth);
+ expect(canvasData.width).to.equal(canvasData.naturalWidth);
+ expect(canvasData.naturalWidth).to.equal(imageData.naturalWidth);
+ done();
+ },
+ });
+ });
+
+ it('should not be zoomed when it is not zoomable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ zoomable: false,
+
+ ready() {
+ const imageData = cropper.zoomTo(1).getImageData();
+ const canvasData = cropper.getCanvasData();
+
+ expect(imageData.width).to.not.equal(imageData.naturalWidth);
+ expect(canvasData.width).to.not.equal(canvasData.naturalWidth);
+ expect(canvasData.naturalWidth).to.equal(imageData.naturalWidth);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/aspectRatio.spec.js b/library/cropperjs/test/specs/options/aspectRatio.spec.js
new file mode 100644
index 000000000..4524d2810
--- /dev/null
+++ b/library/cropperjs/test/specs/options/aspectRatio.spec.js
@@ -0,0 +1,24 @@
+describe('aspectRatio (option)', () => {
+ it('should be `NaN` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.aspectRatio).to.be.NaN;
+ });
+
+ it('should match the given aspect ratio', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ aspectRatio: 1,
+
+ crop() {
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(cropBoxData.width).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.aspectRatio).to.equal(1);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/autoCrop.spec.js b/library/cropperjs/test/specs/options/autoCrop.spec.js
new file mode 100644
index 000000000..19899e94d
--- /dev/null
+++ b/library/cropperjs/test/specs/options/autoCrop.spec.js
@@ -0,0 +1,29 @@
+describe('autoCrop (option)', () => {
+ it('should crop automatically by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.cropped).to.be.true;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.not.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.autoCrop).to.be.true;
+ });
+
+ it('should not crop automatically', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCrop: false,
+
+ ready() {
+ expect(cropper.cropped).to.be.false;
+ expect(window.getComputedStyle(cropper.cropBox).display).to.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.autoCrop).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/autoCropArea.spec.js b/library/cropperjs/test/specs/options/autoCropArea.spec.js
new file mode 100644
index 000000000..40513f4f3
--- /dev/null
+++ b/library/cropperjs/test/specs/options/autoCropArea.spec.js
@@ -0,0 +1,35 @@
+describe('autoCropArea (option)', () => {
+ it('should be 80% by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(canvasData.width * 0.8).to.equal(cropBoxData.width);
+ expect(canvasData.height * 0.8).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.autoCropArea).to.equal(0.8);
+ });
+
+ it('should be 100%', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ autoCropArea: 1,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(canvasData.width).to.equal(cropBoxData.width);
+ expect(canvasData.height).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.autoCropArea).to.equal(1);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/background.spec.js b/library/cropperjs/test/specs/options/background.spec.js
new file mode 100644
index 000000000..d1f9866e2
--- /dev/null
+++ b/library/cropperjs/test/specs/options/background.spec.js
@@ -0,0 +1,27 @@
+describe('background (option)', () => {
+ it('should show the background by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(window.getComputedStyle(cropper.cropper).backgroundImage).to.not.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.background).to.be.true;
+ });
+
+ it('should not show the background', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ background: false,
+
+ ready() {
+ expect(window.getComputedStyle(cropper.cropper).backgroundImage).to.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.background).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/center.spec.js b/library/cropperjs/test/specs/options/center.spec.js
new file mode 100644
index 000000000..37551435e
--- /dev/null
+++ b/library/cropperjs/test/specs/options/center.spec.js
@@ -0,0 +1,31 @@
+describe('center (option)', () => {
+ it('should show the center cross hair by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const center = cropper.cropper.querySelector('.cropper-center');
+
+ expect(window.getComputedStyle(center).display).to.not.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.center).to.be.true;
+ });
+
+ it('should hide the center cross hair', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ center: false,
+
+ ready() {
+ const center = cropper.cropper.querySelector('.cropper-center');
+
+ expect(window.getComputedStyle(center).display).to.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.center).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/checkCrossOrigin.spec.js b/library/cropperjs/test/specs/options/checkCrossOrigin.spec.js
new file mode 100644
index 000000000..52d9b4682
--- /dev/null
+++ b/library/cropperjs/test/specs/options/checkCrossOrigin.spec.js
@@ -0,0 +1,49 @@
+describe('checkCrossOrigin (option)', () => {
+ const crossOriginImageURL = 'https://fengyuanchen.github.io/cropperjs/images/picture.jpg';
+
+ it('should check cross origin by default', (done) => {
+ const image = window.createImage({
+ src: crossOriginImageURL,
+ });
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.image.crossOrigin).to.equal('anonymous');
+ expect(cropper.image.src).to.include('timestamp');
+ done();
+ },
+ });
+
+ expect(cropper.options.checkCrossOrigin).to.be.true;
+ });
+
+ it('should not check cross origin', (done) => {
+ const image = window.createImage({
+ src: crossOriginImageURL,
+ });
+ const cropper = new Cropper(image, {
+ checkCrossOrigin: false,
+
+ ready() {
+ expect(cropper.image.crossOrigin).to.be.null;
+ expect(cropper.image.src).to.not.include('timestamp');
+ done();
+ },
+ });
+
+ expect(cropper.options.checkCrossOrigin).to.be.false;
+ });
+
+ it('should add timestamp even though the image has the `crossOrigin` attribute', (done) => {
+ const image = window.createImage({
+ src: crossOriginImageURL,
+ crossOrigin: 'anonymous',
+ });
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.image.crossOrigin).to.equal('anonymous');
+ expect(cropper.image.src).to.include('timestamp');
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/checkOrientation.spec.js b/library/cropperjs/test/specs/options/checkOrientation.spec.js
new file mode 100644
index 000000000..6f37e6db2
--- /dev/null
+++ b/library/cropperjs/test/specs/options/checkOrientation.spec.js
@@ -0,0 +1,45 @@
+describe('checkOrientation (option)', () => {
+ const imageURL = '/base/docs/images/picture-3.jpg';
+
+ it('should check orientation be default', (done) => {
+ const image = window.createImage({
+ src: imageURL,
+ });
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.getData().rotate).to.not.equal(0);
+ done();
+ },
+ });
+
+ expect(cropper.options.checkOrientation).to.be.true;
+ });
+
+ it('should not check orientation', (done) => {
+ const image = window.createImage({
+ src: imageURL,
+ });
+ const cropper = new Cropper(image, {
+ checkOrientation: false,
+
+ ready() {
+ expect(cropper.getData().rotate).to.equal(0);
+ done();
+ },
+ });
+
+ expect(cropper.options.checkOrientation).to.be.false;
+ });
+
+ it('should not check orientation when it is not rotatable and not scalable', () => {
+ const image = window.createImage({
+ src: imageURL,
+ });
+ const cropper = new Cropper(image, {
+ rotatable: false,
+ scalable: false,
+ });
+
+ expect(cropper.options.checkOrientation).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/crop.spec.js b/library/cropperjs/test/specs/options/crop.spec.js
new file mode 100644
index 000000000..a3e11f2d7
--- /dev/null
+++ b/library/cropperjs/test/specs/options/crop.spec.js
@@ -0,0 +1,28 @@
+describe('crop (option)', () => {
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.crop).to.be.null;
+ });
+
+ it('should execute the `crop` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ crop(event) {
+ expect(event.type).to.equal('crop');
+ expect(event.detail).to.be.an('object').that.has.all.keys(['x', 'y', 'width', 'height', 'rotate', 'scaleX', 'scaleY']);
+ expect(event.detail.x).to.be.a('number');
+ expect(event.detail.y).to.be.a('number');
+ expect(event.detail.width).to.be.a('number');
+ expect(event.detail.height).to.be.a('number');
+ expect(event.detail.rotate).to.be.a('number');
+ expect(event.detail.scaleX).to.be.a('number');
+ expect(event.detail.scaleY).to.be.a('number');
+ done();
+ },
+ });
+
+ expect(cropper.options.crop).to.be.a('function');
+ });
+});
diff --git a/library/cropperjs/test/specs/options/cropBoxMovable.spec.js b/library/cropperjs/test/specs/options/cropBoxMovable.spec.js
new file mode 100644
index 000000000..8a1e52cc4
--- /dev/null
+++ b/library/cropperjs/test/specs/options/cropBoxMovable.spec.js
@@ -0,0 +1,31 @@
+describe('cropBoxMovable (option)', () => {
+ it('should by movable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const face = cropper.cropper.querySelector('.cropper-face');
+
+ expect(face.dataset.cropperAction).to.equal('all');
+ done();
+ },
+ });
+
+ expect(cropper.options.cropBoxMovable).to.be.true;
+ });
+
+ it('should not be movable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ cropBoxMovable: false,
+
+ ready() {
+ const face = cropper.cropper.querySelector('.cropper-face');
+
+ expect(face.dataset.cropperAction).to.not.equal('all');
+ done();
+ },
+ });
+
+ expect(cropper.options.cropBoxMovable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/cropBoxResizable.spec.js b/library/cropperjs/test/specs/options/cropBoxResizable.spec.js
new file mode 100644
index 000000000..2955a0407
--- /dev/null
+++ b/library/cropperjs/test/specs/options/cropBoxResizable.spec.js
@@ -0,0 +1,31 @@
+describe('cropBoxResizable (option)', () => {
+ it('should be resizable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ Array.from(cropper.cropper.querySelectorAll('.cropper-line, .cropper-point')).forEach((handler) => {
+ expect(window.getComputedStyle(handler).display).to.not.equal('none');
+ });
+ done();
+ },
+ });
+
+ expect(cropper.options.cropBoxResizable).to.be.true;
+ });
+
+ it('should not be resizable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ cropBoxResizable: false,
+
+ ready() {
+ Array.from(cropper.cropper.querySelectorAll('.cropper-line, .cropper-point')).forEach((handler) => {
+ expect(window.getComputedStyle(handler).display).to.equal('none');
+ });
+ done();
+ },
+ });
+
+ expect(cropper.options.cropBoxResizable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/cropend.spec.js b/library/cropperjs/test/specs/options/cropend.spec.js
new file mode 100644
index 000000000..c2e9f0f01
--- /dev/null
+++ b/library/cropperjs/test/specs/options/cropend.spec.js
@@ -0,0 +1,35 @@
+describe('cropend (option)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.cropend).to.be.null;
+ });
+
+ it('should execute the `cropend` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ },
+
+ cropend(event) {
+ expect(event.type).to.equal('cropend');
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_UP);
+ done();
+ },
+ });
+
+ expect(cropper.options.cropend).to.be.a('function');
+ });
+});
diff --git a/library/cropperjs/test/specs/options/cropmove.spec.js b/library/cropperjs/test/specs/options/cropmove.spec.js
new file mode 100644
index 000000000..d18735923
--- /dev/null
+++ b/library/cropperjs/test/specs/options/cropmove.spec.js
@@ -0,0 +1,57 @@
+describe('cropmove (option)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.cropmove).to.be.null;
+ });
+
+ it('should execute the `cropmove` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ },
+
+ cropmove(event) {
+ expect(event.type).to.equal('cropmove');
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_MOVE);
+ done();
+ },
+ });
+
+ expect(cropper.options.cropmove).to.be.a('function');
+ });
+
+ it('should not execute the `crop` hook function when default prevented', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ cropper.options.crop = () => {
+ expect.fail(1, 0);
+ };
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ },
+
+ cropmove(event) {
+ event.preventDefault();
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/cropstart.spec.js b/library/cropperjs/test/specs/options/cropstart.spec.js
new file mode 100644
index 000000000..cc261afb1
--- /dev/null
+++ b/library/cropperjs/test/specs/options/cropstart.spec.js
@@ -0,0 +1,61 @@
+describe('cropstart (option)', () => {
+ const POINTER_DOWN = window.PointerEvent ? 'pointerdown' : 'mousedown';
+ const POINTER_MOVE = window.PointerEvent ? 'pointermove' : 'mousemove';
+ const POINTER_UP = window.PointerEvent ? 'pointerup' : 'mouseup';
+
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.cropstart).to.be.null;
+ });
+
+ it('should execute the `cropstart` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ },
+
+ cropstart(event) {
+ expect(event.type).to.equal('cropstart');
+ expect(event.detail).to.be.an('object').that.has.all.keys(['action', 'originalEvent']);
+ expect(event.detail.action).to.equal('crop');
+ expect(event.detail.originalEvent.type).to.equal(POINTER_DOWN);
+ done();
+ },
+ });
+
+ expect(cropper.options.cropstart).to.be.a('function');
+ });
+
+ it('should not execute the `cropmove` and `cropend` callback function when default prevented', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const { dragBox } = cropper;
+
+ dragBox.dispatchEvent(window.createEvent(POINTER_DOWN));
+ dragBox.dispatchEvent(window.createEvent(POINTER_MOVE));
+ dragBox.dispatchEvent(window.createEvent(POINTER_UP));
+ },
+
+ cropstart(event) {
+ event.preventDefault();
+ done();
+ },
+
+ cropmove() {
+ expect.fail(1, 0);
+ },
+
+ cropend() {
+ expect.fail(1, 0);
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/data.spec.js b/library/cropperjs/test/specs/options/data.spec.js
new file mode 100644
index 000000000..99be19adb
--- /dev/null
+++ b/library/cropperjs/test/specs/options/data.spec.js
@@ -0,0 +1,40 @@
+describe('data (option)', () => {
+ it('should be null by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.data).to.be.null;
+ });
+
+ it('should match the given data', (done) => {
+ const image = window.createImage();
+ const initialData = {
+ x: 16,
+ y: 9,
+ width: 160,
+ height: 90,
+ // rotate: 45,
+ // scaleX: -1,
+ // scaleY: -1,
+ };
+
+ const cropper = new Cropper(image, {
+ data: initialData,
+
+ ready() {
+ const data = cropper.getData(true);
+
+ expect(data.x).to.equal(initialData.x);
+ expect(data.y).to.equal(initialData.y);
+ expect(data.width).to.equal(initialData.width);
+ expect(data.height).to.equal(initialData.height);
+ // expect(data.rotate).to.equal(initialData.rotate);
+ // expect(data.scaleX).to.equal(initialData.scaleX);
+ // expect(data.scaleY).to.equal(initialData.scaleY);
+ done();
+ },
+ });
+
+ expect(cropper.options.data).to.deep.equal(initialData);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/dragMode.spec.js b/library/cropperjs/test/specs/options/dragMode.spec.js
new file mode 100644
index 000000000..fb41c8791
--- /dev/null
+++ b/library/cropperjs/test/specs/options/dragMode.spec.js
@@ -0,0 +1,41 @@
+describe('dragMode (option)', () => {
+ it('should be "crop" by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.dragBox.dataset.cropperAction).to.equal('crop');
+ done();
+ },
+ });
+
+ expect(cropper.options.dragMode).to.equal('crop');
+ });
+
+ it('should be "move"', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ dragMode: 'move',
+
+ ready() {
+ expect(cropper.dragBox.dataset.cropperAction).to.equal('move');
+ done();
+ },
+ });
+
+ expect(cropper.options.dragMode).to.equal('move');
+ });
+
+ it('should be "none"', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ dragMode: 'none',
+
+ ready() {
+ expect(cropper.dragBox.dataset.cropperAction).to.equal('none');
+ done();
+ },
+ });
+
+ expect(cropper.options.dragMode).to.equal('none');
+ });
+});
diff --git a/library/cropperjs/test/specs/options/guides.spec.js b/library/cropperjs/test/specs/options/guides.spec.js
new file mode 100644
index 000000000..0ee8f521d
--- /dev/null
+++ b/library/cropperjs/test/specs/options/guides.spec.js
@@ -0,0 +1,31 @@
+describe('guides (option)', () => {
+ it('should show the guides by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ Array.from(cropper.cropper.querySelectorAll('.cropper-dashed')).forEach((dashed) => {
+ expect(window.getComputedStyle(dashed).display).to.not.equal('none');
+ });
+ done();
+ },
+ });
+
+ expect(cropper.options.guides).to.be.true;
+ });
+
+ it('should hide the guides', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ guides: false,
+
+ ready() {
+ Array.from(cropper.cropper.querySelectorAll('.cropper-dashed')).forEach((dashed) => {
+ expect(window.getComputedStyle(dashed).display).to.equal('none');
+ });
+ done();
+ },
+ });
+
+ expect(cropper.options.guides).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/highlight.spec.js b/library/cropperjs/test/specs/options/highlight.spec.js
new file mode 100644
index 000000000..16a63c205
--- /dev/null
+++ b/library/cropperjs/test/specs/options/highlight.spec.js
@@ -0,0 +1,31 @@
+describe('highlight (option)', () => {
+ it('should show the highlight mask by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const face = cropper.cropper.querySelector('.cropper-face');
+
+ expect(window.getComputedStyle(face).opacity).to.not.equal('0');
+ done();
+ },
+ });
+
+ expect(cropper.options.highlight).to.be.true;
+ });
+
+ it('should not show the highlight mask', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ highlight: false,
+
+ ready() {
+ const face = cropper.cropper.querySelector('.cropper-face');
+
+ expect(window.getComputedStyle(face).opacity).to.equal('0');
+ done();
+ },
+ });
+
+ expect(cropper.options.highlight).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/initialAspectRatio.spec.js b/library/cropperjs/test/specs/options/initialAspectRatio.spec.js
new file mode 100644
index 000000000..fc869f1e1
--- /dev/null
+++ b/library/cropperjs/test/specs/options/initialAspectRatio.spec.js
@@ -0,0 +1,40 @@
+describe('initialAspectRatio (option)', () => {
+ it('should be `NaN` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.initialAspectRatio).to.be.NaN;
+ });
+
+ it('should match the given aspect ratio', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ initialAspectRatio: 1,
+
+ ready() {
+ const cropBoxData = cropper.getCropBoxData();
+
+ expect(cropBoxData.width).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.initialAspectRatio).to.equal(1);
+ });
+
+ it('should allow to change the aspect ratio', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ initialAspectRatio: 2,
+
+ ready() {
+ let cropBoxData = cropper.getCropBoxData();
+
+ cropBoxData.width = cropBoxData.height;
+ cropBoxData = cropper.setCropBoxData(cropBoxData).getCropBoxData();
+ expect(cropBoxData.width).to.equal(cropBoxData.height);
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minCanvasHeight.spec.js b/library/cropperjs/test/specs/options/minCanvasHeight.spec.js
new file mode 100644
index 000000000..028d22e9f
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minCanvasHeight.spec.js
@@ -0,0 +1,27 @@
+describe('minCanvasHeight (option)', () => {
+ it('should be `0` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minCanvasHeight).to.equal(0);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+ const minCanvasHeight = 270;
+ const cropper = new Cropper(image, {
+ minCanvasHeight,
+
+ ready() {
+ const canvasData = cropper.setCanvasData({
+ height: 180,
+ }).getCanvasData();
+
+ expect(canvasData.height).to.equal(minCanvasHeight);
+ done();
+ },
+ });
+
+ expect(cropper.options.minCanvasHeight).to.equal(minCanvasHeight);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minCanvasWidth.spec.js b/library/cropperjs/test/specs/options/minCanvasWidth.spec.js
new file mode 100644
index 000000000..0c58f2a80
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minCanvasWidth.spec.js
@@ -0,0 +1,27 @@
+describe('minCanvasWidth (option)', () => {
+ it('should be `0` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minCanvasWidth).to.equal(0);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+ const minCanvasWidth = 480;
+ const cropper = new Cropper(image, {
+ minCanvasWidth,
+
+ ready() {
+ const canvasData = cropper.setCanvasData({
+ width: 320,
+ }).getCanvasData();
+
+ expect(canvasData.width).to.equal(minCanvasWidth);
+ done();
+ },
+ });
+
+ expect(cropper.options.minCanvasWidth).to.equal(minCanvasWidth);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minContainerHeight.spec.js b/library/cropperjs/test/specs/options/minContainerHeight.spec.js
new file mode 100644
index 000000000..9a71f59d3
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minContainerHeight.spec.js
@@ -0,0 +1,26 @@
+describe('minContainerHeight (option)', () => {
+ it('should be `100` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minContainerHeight).to.equal(100);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+
+ image.parentElement.style.height = '90px';
+
+ const minContainerHeight = 180;
+ const cropper = new Cropper(image, {
+ minContainerHeight,
+
+ ready() {
+ expect(cropper.getContainerData().height).to.equal(minContainerHeight);
+ done();
+ },
+ });
+
+ expect(cropper.options.minContainerHeight).to.equal(minContainerHeight);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minContainerWidth.spec.js b/library/cropperjs/test/specs/options/minContainerWidth.spec.js
new file mode 100644
index 000000000..aabbb5e97
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minContainerWidth.spec.js
@@ -0,0 +1,26 @@
+describe('minContainerWidth (option)', () => {
+ it('should be `200` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minContainerWidth).to.equal(200);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+
+ image.parentElement.style.width = '160px';
+
+ const minContainerWidth = 320;
+ const cropper = new Cropper(image, {
+ minContainerWidth,
+
+ ready() {
+ expect(cropper.getContainerData().width).to.equal(minContainerWidth);
+ done();
+ },
+ });
+
+ expect(cropper.options.minContainerWidth).to.equal(minContainerWidth);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js b/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js
new file mode 100644
index 000000000..a071c6e83
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js
@@ -0,0 +1,27 @@
+describe('minCropBoxHeight (option)', () => {
+ it('should be `0` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minCropBoxHeight).to.equal(0);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+ const minCropBoxHeight = 150;
+ const cropper = new Cropper(image, {
+ minCropBoxHeight,
+
+ ready() {
+ const cropBoxData = cropper.setCropBoxData({
+ height: 100,
+ }).getCropBoxData();
+
+ expect(cropBoxData.height).to.equal(minCropBoxHeight);
+ done();
+ },
+ });
+
+ expect(cropper.options.minCropBoxHeight).to.equal(minCropBoxHeight);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/minCropBoxWidth.spec.js b/library/cropperjs/test/specs/options/minCropBoxWidth.spec.js
new file mode 100644
index 000000000..5a2f44faa
--- /dev/null
+++ b/library/cropperjs/test/specs/options/minCropBoxWidth.spec.js
@@ -0,0 +1,27 @@
+describe('minCropBoxWidth (option)', () => {
+ it('should be `0` by default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.minCropBoxWidth).to.equal(0);
+ });
+
+ it('should match the given minimum size', (done) => {
+ const image = window.createImage();
+ const minCropBoxWidth = 300;
+ const cropper = new Cropper(image, {
+ minCropBoxWidth,
+
+ ready() {
+ const cropBoxData = cropper.setCropBoxData({
+ width: 200,
+ }).getCropBoxData();
+
+ expect(cropBoxData.width).to.equal(minCropBoxWidth);
+ done();
+ },
+ });
+
+ expect(cropper.options.minCropBoxWidth).to.equal(minCropBoxWidth);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/modal.spec.js b/library/cropperjs/test/specs/options/modal.spec.js
new file mode 100644
index 000000000..e82fbed82
--- /dev/null
+++ b/library/cropperjs/test/specs/options/modal.spec.js
@@ -0,0 +1,27 @@
+describe('modal (option)', () => {
+ it('should show the modal by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.dragBox.className).to.include('cropper-modal');
+ done();
+ },
+ });
+
+ expect(cropper.options.modal).to.be.true;
+ });
+
+ it('should not show the modal', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ modal: false,
+
+ ready() {
+ expect(cropper.dragBox.className).to.not.include('cropper-modal');
+ done();
+ },
+ });
+
+ expect(cropper.options.modal).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/movable.spec.js b/library/cropperjs/test/specs/options/movable.spec.js
new file mode 100644
index 000000000..2c7a06705
--- /dev/null
+++ b/library/cropperjs/test/specs/options/movable.spec.js
@@ -0,0 +1,35 @@
+describe('movable (option)', () => {
+ it('should be movable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.move(10, 10).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left + 10);
+ expect(changedCanvasData.top).to.equal(canvasData.top + 10);
+ done();
+ },
+ });
+
+ expect(cropper.options.movable).to.be.true;
+ });
+
+ it('should not be movable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ movable: false,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.move(10, 10).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left);
+ expect(changedCanvasData.top).to.equal(canvasData.top);
+ done();
+ },
+ });
+
+ expect(cropper.options.movable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/preview.spec.js b/library/cropperjs/test/specs/options/preview.spec.js
new file mode 100644
index 000000000..2d2bc34d4
--- /dev/null
+++ b/library/cropperjs/test/specs/options/preview.spec.js
@@ -0,0 +1,105 @@
+describe('preview (option)', () => {
+ it('should be an empty string be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.preview).to.be.a('string').that.is.empty;
+ });
+
+ it('should support element', (done) => {
+ const image = window.createImage();
+ const preview = document.createElement('div');
+
+ image.ownerDocument.body.appendChild(preview);
+
+ const cropper = new Cropper(image, {
+ preview,
+
+ ready() {
+ expect(preview.firstElementChild).to.not.be.null;
+ expect(preview.firstElementChild.src).to.equal(image.src);
+ done();
+ },
+ });
+
+ expect(cropper.options.preview).to.equal(preview);
+ });
+
+ it('should support array of elements', (done) => {
+ const image = window.createImage();
+ const previews = document.createElement('ul');
+ const preview1 = document.createElement('li');
+ const preview2 = document.createElement('li');
+ const preview = [preview1, preview2];
+
+ previews.appendChild(preview1);
+ previews.appendChild(preview2);
+ image.ownerDocument.body.appendChild(previews);
+
+ const cropper = new Cropper(image, {
+ preview,
+
+ ready() {
+ expect(preview1.firstElementChild).to.not.be.null;
+ expect(preview2.firstElementChild).to.not.be.null;
+ expect(preview1.firstElementChild.src).to.equal(image.src);
+ expect(preview2.firstElementChild.src).to.equal(image.src);
+ done();
+ },
+ });
+
+ expect(cropper.options.preview).to.equal(preview);
+ });
+
+ it('should support `NodeList` object', (done) => {
+ const image = window.createImage();
+ const previews = document.createElement('ul');
+ const preview1 = document.createElement('li');
+ const preview2 = document.createElement('li');
+
+ previews.appendChild(preview1);
+ previews.appendChild(preview2);
+ image.ownerDocument.body.appendChild(previews);
+
+ const cropper = new Cropper(image, {
+ preview: previews.children,
+
+ ready() {
+ expect(preview1.firstElementChild).to.not.be.null;
+ expect(preview2.firstElementChild).to.not.be.null;
+ expect(preview1.firstElementChild.src).to.equal(image.src);
+ expect(preview2.firstElementChild.src).to.equal(image.src);
+ done();
+ },
+ });
+
+ expect(cropper.options.preview).to.equal(previews.children);
+ });
+
+ it('should support selector', (done) => {
+ const image = window.createImage();
+ const previews = document.createElement('ul');
+ const preview1 = document.createElement('li');
+ const preview2 = document.createElement('li');
+
+ preview1.className = 'preview';
+ preview2.className = 'preview';
+ previews.appendChild(preview1);
+ previews.appendChild(preview2);
+ image.ownerDocument.body.appendChild(previews);
+
+ const cropper = new Cropper(image, {
+ preview: '.preview',
+
+ ready() {
+ expect(preview1.firstElementChild).to.not.be.null;
+ expect(preview2.firstElementChild).to.not.be.null;
+ expect(preview1.firstElementChild.src).to.equal(image.src);
+ expect(preview2.firstElementChild.src).to.equal(image.src);
+ done();
+ },
+ });
+
+ expect(cropper.options.preview).to.equal('.preview');
+ });
+});
diff --git a/library/cropperjs/test/specs/options/ready.spec.js b/library/cropperjs/test/specs/options/ready.spec.js
new file mode 100644
index 000000000..0e0f2338a
--- /dev/null
+++ b/library/cropperjs/test/specs/options/ready.spec.js
@@ -0,0 +1,34 @@
+describe('ready (option)', () => {
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.ready).to.be.null;
+ });
+
+ it('should execute the `ready` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready(event) {
+ expect(event.type).to.equal('ready');
+ done();
+ },
+ });
+
+ expect(cropper.options.ready).to.be.a('function');
+ });
+
+ it('should execute the `crop` hook function even though default prevented', (done) => {
+ const image = window.createImage();
+
+ new Cropper(image, {
+ ready(event) {
+ event.preventDefault();
+ },
+
+ crop() {
+ done();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/responsive.spec.js b/library/cropperjs/test/specs/options/responsive.spec.js
new file mode 100644
index 000000000..8e393f0ff
--- /dev/null
+++ b/library/cropperjs/test/specs/options/responsive.spec.js
@@ -0,0 +1,61 @@
+describe('responsive (option)', () => {
+ it('should be responsive be default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const containerData = cropper.getContainerData();
+ let newContainerWidth = containerData.width - 10;
+ let newContainerHeight = containerData.height - 10;
+
+ image.parentElement.style.width = `${newContainerWidth}px`;
+ image.parentElement.style.height = `${newContainerHeight}px`;
+ window.dispatchEvent(window.createEvent('resize'));
+
+ let newContainerData = cropper.getContainerData();
+
+ expect(newContainerData.width).to.equal(newContainerWidth);
+ expect(newContainerData.height).to.equal(newContainerHeight);
+
+ newContainerWidth = containerData.width + 10;
+ newContainerHeight = containerData.height + 10;
+
+ image.parentElement.style.width = `${newContainerWidth}px`;
+ image.parentElement.style.height = `${newContainerHeight}px`;
+ window.dispatchEvent(window.createEvent('resize'));
+
+ newContainerData = cropper.getContainerData();
+
+ expect(newContainerData.width).to.equal(newContainerWidth);
+ expect(newContainerData.height).to.equal(newContainerHeight);
+ done();
+ },
+ });
+
+ expect(cropper.options.responsive).to.be.true;
+ });
+
+ it('should not be responsive', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ responsive: false,
+
+ ready() {
+ const containerData = cropper.getContainerData();
+ const newContainerWidth = containerData.width - 10;
+ const newContainerHeight = containerData.height - 10;
+
+ image.parentElement.style.width = `${newContainerWidth}px`;
+ image.parentElement.style.height = `${newContainerHeight}px`;
+ window.dispatchEvent(window.createEvent('resize'));
+
+ const newContainerData = cropper.getContainerData();
+
+ expect(newContainerData.width).to.equal(containerData.width);
+ expect(newContainerData.height).to.equal(containerData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.responsive).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/restore.spec.js b/library/cropperjs/test/specs/options/restore.spec.js
new file mode 100644
index 000000000..3a011edc8
--- /dev/null
+++ b/library/cropperjs/test/specs/options/restore.spec.js
@@ -0,0 +1,38 @@
+describe('restore (option)', () => {
+ it('should restore the cropped area after resize the window be default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const data = cropper.zoomTo(1).getData(true);
+ const containerData = cropper.getContainerData();
+
+ image.parentElement.style.width = `${containerData.width - 10}px`;
+ image.parentElement.style.height = `${containerData.height - 10}px`;
+ window.dispatchEvent(window.createEvent('resize'));
+ expect(cropper.getData(true)).to.deep.equal(data);
+ done();
+ },
+ });
+
+ expect(cropper.options.restore).to.be.true;
+ });
+
+ it('should not be restore', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ restore: false,
+
+ ready() {
+ const data = cropper.zoomTo(1).getData(true);
+ const containerData = cropper.getContainerData();
+
+ image.parentElement.style.width = `${containerData.width / 2}px`;
+ window.dispatchEvent(window.createEvent('resize'));
+ expect(cropper.getData(true)).to.not.deep.equal(data);
+ done();
+ },
+ });
+
+ expect(cropper.options.restore).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/rotatable.spec.js b/library/cropperjs/test/specs/options/rotatable.spec.js
new file mode 100644
index 000000000..01a9ad09a
--- /dev/null
+++ b/library/cropperjs/test/specs/options/rotatable.spec.js
@@ -0,0 +1,28 @@
+describe('rotatable (option)', () => {
+ it('should be rotatable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+
+ ready() {
+ expect(cropper.rotate(90).getImageData().rotate).to.equal(90);
+ done();
+ },
+ });
+
+ expect(cropper.options.rotatable).to.be.true;
+ });
+
+ it('should not be rotatable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ rotatable: false,
+
+ ready() {
+ expect(cropper.rotate(90).getImageData().rotate).to.be.undefined;
+ done();
+ },
+ });
+
+ expect(cropper.options.rotatable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/scalable.spec.js b/library/cropperjs/test/specs/options/scalable.spec.js
new file mode 100644
index 000000000..3b6f1df4f
--- /dev/null
+++ b/library/cropperjs/test/specs/options/scalable.spec.js
@@ -0,0 +1,33 @@
+describe('scalable (option)', () => {
+ it('should be scalable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const imageData = cropper.scale(-1, -1).getImageData();
+
+ expect(imageData.scaleX).to.equal(-1);
+ expect(imageData.scaleY).to.equal(-1);
+ done();
+ },
+ });
+
+ expect(cropper.options.scalable).to.be.true;
+ });
+
+ it('should not be scalable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ scalable: false,
+
+ ready() {
+ const imageData = cropper.scale(-1, -1).getImageData();
+
+ expect(imageData.scaleX).to.be.undefined;
+ expect(imageData.scaleY).to.be.undefined;
+ done();
+ },
+ });
+
+ expect(cropper.options.scalable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/toggleDragModeOnDblclick.spec.js b/library/cropperjs/test/specs/options/toggleDragModeOnDblclick.spec.js
new file mode 100644
index 000000000..b67617f1d
--- /dev/null
+++ b/library/cropperjs/test/specs/options/toggleDragModeOnDblclick.spec.js
@@ -0,0 +1,40 @@
+describe('toggleDragModeOnDblclick (option)', () => {
+ it('should toggle drag mode on double click', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+
+ ready() {
+ const { dragBox } = cropper;
+
+ expect(dragBox.className).include('cropper-crop');
+ expect(dragBox.dataset.cropperAction).to.equal('crop');
+ dragBox.dispatchEvent(window.createEvent('dblclick'));
+ expect(dragBox.className).include('cropper-move');
+ expect(dragBox.dataset.cropperAction).to.equal('move');
+ done();
+ },
+ });
+
+ expect(cropper.options.toggleDragModeOnDblclick).to.be.true;
+ });
+
+ it('should not toggle drag mode on double click', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ toggleDragModeOnDblclick: false,
+
+ ready() {
+ const { dragBox } = cropper;
+
+ expect(dragBox.className).include('cropper-crop');
+ expect(dragBox.dataset.cropperAction).to.equal('crop');
+ dragBox.dispatchEvent(window.createEvent('dblclick'));
+ expect(dragBox.className).include('cropper-crop');
+ expect(dragBox.dataset.cropperAction).to.equal('crop');
+ done();
+ },
+ });
+
+ expect(cropper.options.toggleDragModeOnDblclick).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/viewMode.spec.js b/library/cropperjs/test/specs/options/viewMode.spec.js
new file mode 100644
index 000000000..7dde93d83
--- /dev/null
+++ b/library/cropperjs/test/specs/options/viewMode.spec.js
@@ -0,0 +1,89 @@
+describe('viewMode (option)', () => {
+ it('should not have any restrictions by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = {
+ left: 100,
+ top: 100,
+ width: 160,
+ height: 90,
+ };
+ const changedCanvasData = cropper.setCanvasData(canvasData).getCanvasData();
+
+ expect(changedCanvasData.left).to.equal(canvasData.left);
+ expect(changedCanvasData.top).to.equal(canvasData.top);
+ expect(changedCanvasData.width).to.equal(canvasData.width);
+ expect(changedCanvasData.height).to.equal(canvasData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.viewMode).to.equal(0);
+ });
+
+ it('should restrict the crop box to not exceed the size of the canvas', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ viewMode: 1,
+
+ ready() {
+ let canvasData = cropper.zoom(-0.5).getCanvasData();
+ let cropBoxData = cropper.getCropBoxData();
+
+ expect(canvasData.width).to.be.least(cropBoxData.width);
+ expect(canvasData.height).to.be.least(cropBoxData.height);
+
+ canvasData = cropper.clear().moveTo(-160, -90).getCanvasData();
+ cropBoxData = cropper.crop().setCropBoxData({
+ width: canvasData.naturalWidth,
+ height: canvasData.naturalHeight,
+ }).getCropBoxData();
+
+ expect(canvasData.width).to.be.above(cropBoxData.width);
+ expect(canvasData.height).to.be.above(cropBoxData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.viewMode).to.equal(1);
+ });
+
+ it('should restrict the minimum canvas size to fit within the container.', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ viewMode: 2,
+
+ ready() {
+ const canvasData = cropper.zoom(-0.5).getCanvasData();
+ const containerData = cropper.getContainerData();
+
+ expect(canvasData.width >= containerData.width
+ || canvasData.height >= containerData.height).to.be.true;
+ done();
+ },
+ });
+
+ expect(cropper.options.viewMode).to.equal(2);
+ });
+
+ it('should restrict the minimum canvas size to full fit the container.', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ viewMode: 3,
+
+ ready() {
+ const canvasData = cropper.zoom(-0.5).getCanvasData();
+ const containerData = cropper.getContainerData();
+
+ expect(canvasData.left).to.be.most(0);
+ expect(canvasData.top).to.be.most(0);
+ expect(canvasData.width).to.be.least(containerData.width);
+ expect(canvasData.height).to.be.least(containerData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.viewMode).to.equal(3);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/wheelZoomRatio.spec.js b/library/cropperjs/test/specs/options/wheelZoomRatio.spec.js
new file mode 100644
index 000000000..7d128358d
--- /dev/null
+++ b/library/cropperjs/test/specs/options/wheelZoomRatio.spec.js
@@ -0,0 +1,38 @@
+describe('wheelZoomRatio (option)', () => {
+ it('should be `0.1` by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const wheelEvent = window.createEvent('wheel');
+
+ wheelEvent.deltaY = -1;
+ cropper.cropper.dispatchEvent(wheelEvent);
+ expect(canvasData.width * 1.1).to.equal(cropper.getCanvasData().width);
+ done();
+ },
+ });
+
+ expect(cropper.options.wheelZoomRatio).to.equal(0.1);
+ });
+
+ it('should match the given zoom ratio', (done) => {
+ const image = window.createImage();
+ const wheelZoomRatio = 0.2;
+ const cropper = new Cropper(image, {
+ wheelZoomRatio,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const wheelEvent = window.createEvent('wheel');
+
+ wheelEvent.deltaY = -1;
+ cropper.cropper.dispatchEvent(wheelEvent);
+ expect(canvasData.width * (1 + wheelZoomRatio)).to.equal(cropper.getCanvasData().width);
+ done();
+ },
+ });
+
+ expect(cropper.options.wheelZoomRatio).to.equal(wheelZoomRatio);
+ });
+});
diff --git a/library/cropperjs/test/specs/options/zoom.spec.js b/library/cropperjs/test/specs/options/zoom.spec.js
new file mode 100644
index 000000000..3d11f3a2f
--- /dev/null
+++ b/library/cropperjs/test/specs/options/zoom.spec.js
@@ -0,0 +1,46 @@
+describe('zoom (option)', () => {
+ it('should be `null` be default', () => {
+ const image = window.createImage();
+ const cropper = new Cropper(image);
+
+ expect(cropper.options.zoom).to.be.null;
+ });
+
+ it('should execute the `zoom` hook function', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.zoom(0.1);
+ },
+
+ zoom(event) {
+ expect(event.type).to.equal('zoom');
+ expect(event.detail).to.be.an('object').that.has.all.keys(['ratio', 'oldRatio', 'originalEvent']);
+ expect(event.detail.ratio).to.be.a('number');
+ expect(event.detail.oldRatio).to.be.a('number');
+ expect(event.detail.ratio).to.be.above(0);
+ expect(event.detail.oldRatio).to.be.above(0);
+ expect(event.detail.ratio).to.be.above(event.detail.oldRatio);
+ done();
+ },
+ });
+
+ expect(cropper.options.zoom).to.be.a('function');
+ });
+
+ it('should not change the canvas sizes when default prevented', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+
+ expect(cropper.zoom(0.1).getCanvasData()).to.deep.equal(canvasData);
+ done();
+ },
+
+ zoom(event) {
+ event.preventDefault();
+ },
+ });
+ });
+});
diff --git a/library/cropperjs/test/specs/options/zoomOnTouch.spec.js b/library/cropperjs/test/specs/options/zoomOnTouch.spec.js
new file mode 100644
index 000000000..feb56b079
--- /dev/null
+++ b/library/cropperjs/test/specs/options/zoomOnTouch.spec.js
@@ -0,0 +1,176 @@
+describe('zoomOnTouch (option)', () => {
+ it('should zoom on touch by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ if (window.PointerEvent) {
+ const pointerDownEvent1 = window.createEvent('pointerdown');
+ const pointerDownEvent2 = window.createEvent('pointerdown');
+ const pointerMoveEvent1 = window.createEvent('pointermove');
+ const pointerMoveEvent2 = window.createEvent('pointermove');
+
+ pointerDownEvent1.pointerId = 1;
+ pointerDownEvent1.pageX = 100;
+ pointerDownEvent1.pageY = 100;
+ pointerDownEvent2.pointerId = 2;
+ pointerDownEvent2.pageX = 200;
+ pointerDownEvent2.pageY = 200;
+ pointerMoveEvent1.pointerId = 1;
+ pointerMoveEvent1.pageX = 125;
+ pointerMoveEvent1.pageY = 125;
+ pointerMoveEvent2.pointerId = 2;
+ pointerMoveEvent2.pageX = 175;
+ pointerMoveEvent2.pageY = 175;
+ cropper.cropper.dispatchEvent(pointerDownEvent1);
+ cropper.cropper.dispatchEvent(pointerDownEvent2);
+ cropper.cropper.dispatchEvent(pointerMoveEvent1);
+ cropper.cropper.dispatchEvent(pointerMoveEvent2);
+ } else {
+ const touchStartEvent1 = window.createEvent('touchstart');
+ const touchStartEvent2 = window.createEvent('touchstart');
+ const touchMoveEvent1 = window.createEvent('touchmove');
+ const touchMoveEvent2 = window.createEvent('touchmove');
+
+ touchStartEvent1.changedTouches = {
+ 0: {
+ identifier: 1,
+ pageX: 100,
+ pageY: 100,
+ },
+ length: 1,
+ };
+ touchStartEvent2.changedTouches = {
+ 0: {
+ identifier: 2,
+ pageX: 200,
+ pageY: 200,
+ },
+ length: 1,
+ };
+ touchMoveEvent1.changedTouches = {
+ 0: {
+ identifier: 1,
+ pageX: 125,
+ pageY: 125,
+ },
+ length: 1,
+ };
+ touchMoveEvent2.changedTouches = {
+ 0: {
+ identifier: 2,
+ pageX: 175,
+ pageY: 175,
+ },
+ length: 1,
+ };
+ cropper.cropper.dispatchEvent(touchStartEvent1);
+ cropper.cropper.dispatchEvent(touchStartEvent2);
+ cropper.cropper.dispatchEvent(touchMoveEvent1);
+ cropper.cropper.dispatchEvent(touchMoveEvent2);
+ }
+ },
+
+ zoom() {
+ done();
+ },
+ });
+
+ expect(cropper.options.zoomOnTouch).to.be.true;
+ });
+
+ it('should not zoom on touch', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ zoomOnTouch: false,
+
+ ready() {
+ if (window.PointerEvent) {
+ cropper.cropper.dispatchEvent(new PointerEvent('pointerdown', {
+ pointerId: 1,
+ pageX: 100,
+ pageY: 100,
+ }));
+ cropper.cropper.dispatchEvent(new PointerEvent('pointerdown', {
+ pointerId: 2,
+ pageX: 200,
+ pageY: 200,
+ }));
+ cropper.cropper.dispatchEvent(new PointerEvent('pointermove', {
+ pointerId: 1,
+ pageX: 125,
+ pageY: 125,
+ }));
+ cropper.cropper.dispatchEvent(new PointerEvent('pointermove', {
+ pointerId: 2,
+ pageX: 175,
+ pageY: 175,
+ }));
+ cropper.cropper.dispatchEvent(new PointerEvent('pointerup', {
+ pointerId: 1,
+ pageX: 125,
+ pageY: 125,
+ }));
+ cropper.cropper.dispatchEvent(new PointerEvent('pointerup', {
+ pointerId: 2,
+ pageX: 175,
+ pageY: 175,
+ }));
+ } else {
+ cropper.cropper.dispatchEvent(new TouchEvent('touchstart', {
+ changedTouches: {
+ 0: {
+ identifier: 1,
+ pageX: 100,
+ pageY: 100,
+ },
+ 1: {
+ identifier: 2,
+ pageX: 200,
+ pageY: 200,
+ },
+ length: 2,
+ },
+ }));
+ cropper.cropper.dispatchEvent(new TouchEvent('touchmove', {
+ changedTouches: {
+ 0: {
+ identifier: 1,
+ pageX: 125,
+ pageY: 125,
+ },
+ 1: {
+ identifier: 2,
+ pageX: 175,
+ pageY: 175,
+ },
+ length: 2,
+ },
+ }));
+ cropper.cropper.dispatchEvent(new TouchEvent('touchend', {
+ changedTouches: {
+ 0: {
+ identifier: 1,
+ pageX: 125,
+ pageY: 125,
+ },
+ 1: {
+ identifier: 2,
+ pageX: 175,
+ pageY: 175,
+ },
+ length: 2,
+ },
+ }));
+ }
+
+ done();
+ },
+
+ zoom() {
+ expect.fail(1, 0);
+ },
+ });
+
+ expect(cropper.options.zoomOnTouch).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/zoomOnWheel.spec.js b/library/cropperjs/test/specs/options/zoomOnWheel.spec.js
new file mode 100644
index 000000000..90e25e6a3
--- /dev/null
+++ b/library/cropperjs/test/specs/options/zoomOnWheel.spec.js
@@ -0,0 +1,34 @@
+describe('zoomOnWheel (option)', () => {
+ it('should zoom on wheel by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ cropper.cropper.dispatchEvent(window.createEvent('wheel'));
+ },
+
+ zoom() {
+ done();
+ },
+ });
+
+ expect(cropper.options.zoomOnWheel).to.be.true;
+ });
+
+ it('should not zoom on wheel', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ zoomOnWheel: false,
+
+ ready() {
+ cropper.cropper.dispatchEvent(window.createEvent('wheel'));
+ done();
+ },
+
+ zoom() {
+ expect.fail(1, 0);
+ },
+ });
+
+ expect(cropper.options.zoomOnWheel).to.be.false;
+ });
+});
diff --git a/library/cropperjs/test/specs/options/zoomable.spec.js b/library/cropperjs/test/specs/options/zoomable.spec.js
new file mode 100644
index 000000000..d0fbec5ec
--- /dev/null
+++ b/library/cropperjs/test/specs/options/zoomable.spec.js
@@ -0,0 +1,35 @@
+describe('zoomable (option)', () => {
+ it('should be zoomable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.zoom(0.1).getCanvasData();
+
+ expect(changedCanvasData.width).to.be.above(canvasData.width);
+ expect(changedCanvasData.height).to.be.above(canvasData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.zoomable).to.be.true;
+ });
+
+ it('should not be zoomable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ zoomable: false,
+
+ ready() {
+ const canvasData = cropper.getCanvasData();
+ const changedCanvasData = cropper.zoom(0.1).getCanvasData();
+
+ expect(changedCanvasData.width).to.equal(canvasData.width);
+ expect(changedCanvasData.height).to.equal(canvasData.height);
+ done();
+ },
+ });
+
+ expect(cropper.options.zoomable).to.be.false;
+ });
+});
diff --git a/library/cropperjs/types/index.d.ts b/library/cropperjs/types/index.d.ts
new file mode 100644
index 000000000..187290f92
--- /dev/null
+++ b/library/cropperjs/types/index.d.ts
@@ -0,0 +1,164 @@
+declare namespace Cropper {
+ type DragMode = 'crop' | 'move' | 'none';
+ type ViewMode = 0 | 1 | 2 | 3;
+ type ImageSmoothingQuality = 'low' | 'medium' | 'high';
+
+ export interface Data {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+ rotate: number;
+ scaleX: number;
+ scaleY: number;
+ }
+
+ export interface ContainerData {
+ width: number;
+ height: number;
+ }
+
+ export interface ImageData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ rotate: number;
+ scaleX: number;
+ scaleY: number;
+ naturalWidth: number;
+ naturalHeight: number;
+ aspectRatio: number;
+ }
+
+ export interface CanvasData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ naturalWidth: number;
+ naturalHeight: number;
+ }
+
+ export interface CropBoxData {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ }
+
+ export interface GetCroppedCanvasOptions {
+ width?: number;
+ height?: number;
+ minWidth?: number;
+ minHeight?: number;
+ maxWidth?: number;
+ maxHeight?: number;
+ fillColor?: string;
+ imageSmoothingEnabled?: boolean;
+ imageSmoothingQuality?: ImageSmoothingQuality;
+ }
+
+ export interface SetDataOptions {
+ x?: number;
+ y?: number;
+ width?: number;
+ height?: number;
+ rotate?: number;
+ scaleX?: number;
+ scaleY?: number;
+ }
+
+ export interface SetCanvasDataOptions {
+ left?: number;
+ top?: number;
+ width?: number;
+ height?: number;
+ }
+
+ export interface SetCropBoxDataOptions {
+ left?: number;
+ top?: number;
+ width?: number;
+ height?: number;
+ }
+
+ export interface Options {
+ aspectRatio?: number;
+ autoCrop?: boolean;
+ autoCropArea?: number;
+ background?: boolean;
+ center?: boolean;
+ checkCrossOrigin?: boolean;
+ checkOrientation?: boolean;
+ crop?(event: CustomEvent): void;
+ cropBoxMovable?: boolean;
+ cropBoxResizable?: boolean;
+ cropend?(event: CustomEvent): void;
+ cropmove?(event: CustomEvent): void;
+ cropstart?(event: CustomEvent): void;
+ data?: Data;
+ dragMode?: DragMode;
+ guides?: boolean;
+ highlight?: boolean;
+ initialAspectRatio?: number;
+ minCanvasHeight?: number;
+ minCanvasWidth?: number;
+ minContainerHeight?: number;
+ minContainerWidth?: number;
+ minCropBoxHeight?: number;
+ minCropBoxWidth?: number;
+ modal?: boolean;
+ movable?: boolean;
+ preview?: Element | Element[] | NodeList | string;
+ ready?(event: CustomEvent): void;
+ responsive?: boolean;
+ restore?: boolean;
+ rotatable?: boolean;
+ scalable?: boolean;
+ toggleDragModeOnDblclick?: boolean;
+ viewMode?: ViewMode;
+ wheelZoomRatio?: number;
+ zoom?(event: CustomEvent): void;
+ zoomOnTouch?: boolean;
+ zoomOnWheel?: boolean;
+ zoomable?: boolean;
+ }
+}
+
+declare class Cropper {
+ constructor(element: HTMLImageElement | HTMLCanvasElement, options?: Cropper.Options);
+ clear(): Cropper;
+ crop(): Cropper;
+ destroy(): Cropper;
+ disable(): Cropper;
+ enable(): Cropper;
+ getCanvasData(): Cropper.CanvasData;
+ getContainerData(): Cropper.ContainerData;
+ getCropBoxData(): Cropper.CropBoxData;
+ getCroppedCanvas(options?: Cropper.GetCroppedCanvasOptions): HTMLCanvasElement;
+ getData(rounded?: boolean): Cropper.Data;
+ getImageData(): Cropper.ImageData;
+ move(offsetX: number, offsetY?: number): Cropper;
+ moveTo(x: number, y?: number): Cropper;
+ replace(url: string, onlyColorChanged?: boolean): Cropper;
+ reset(): Cropper;
+ rotate(degree: number): Cropper;
+ rotateTo(degree: number): Cropper;
+ scale(scaleX: number, scaleY?: number): Cropper;
+ scaleX(scaleX: number): Cropper;
+ scaleY(scaleY: number): Cropper;
+ setAspectRatio(aspectRatio: number): Cropper;
+ setCanvasData(data: Cropper.SetCanvasDataOptions): Cropper;
+ setCropBoxData(data: Cropper.SetCropBoxDataOptions): Cropper;
+ setData(data: Cropper.SetDataOptions): Cropper;
+ setDragMode(dragMode: Cropper.DragMode): Cropper;
+ zoom(ratio: number): Cropper;
+ zoomTo(ratio: number, pivot?: {x: number; y: number}): Cropper;
+ static noConflict(): Cropper;
+ static setDefaults(options: Cropper.Options): void;
+}
+
+declare module 'cropperjs' {
+ export default Cropper;
+}
diff --git a/view/tpl/crophead.tpl b/view/tpl/crophead.tpl
index a5a80c187..db1915d22 100755
--- a/view/tpl/crophead.tpl
+++ b/view/tpl/crophead.tpl
@@ -1,3 +1,3 @@
-<script type="text/javascript" src="library/cropperjs/dist/cropper.js" language="javascript"></script>
-<link rel="stylesheet" href="library/cropperjs/dist/cropper.css" type="text/css" />
+<script type="text/javascript" src="library/cropperjs/dist/cropper.min.js" language="javascript"></script>
+<link rel="stylesheet" href="library/cropperjs/dist/cropper.min.css" type="text/css" />