commit d21f90672bd26192a4e74946b61c48a8e38abadf Author: Jane <272005125@qq.com> Date: Mon Feb 19 17:25:32 2024 +0800 first commit diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..1d93173 --- /dev/null +++ b/.babelrc @@ -0,0 +1,14 @@ +{ + "presets": [ + ["env", { "modules": false }], + "stage-2" + ], + "plugins": ["transform-runtime"], + "comments": false, + "env": { + "test": { + "presets": ["env", "stage-2"], + "plugins": ["transform-es2015-modules-commonjs", "dynamic-import-node"] + } + } +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..df87c63 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +node_modules +.git +dist +.history +images +docs +Dockerfile +README.md +build.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9d08a1a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..9907604 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +build/*.js +config/*.js +src/libs/*.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..3c6c4ba --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,44 @@ +// http://eslint.org/docs/user-guide/configuring + +module.exports = { + root: true, + parser: 'babel-eslint', + parserOptions: { + sourceType: 'module' + }, + env: { + browser: true, + }, + extends: 'airbnb-base', + // required to lint *.vue files + plugins: [ + 'html' + ], + globals: { + "NODE_ENV": false, + "VERSION": false + }, + // check if imports actually resolve + 'settings': { + 'import/resolver': { + 'webpack': { + 'config': 'build/webpack.base.conf.js' + } + } + }, + // add your custom rules here + 'rules': { + 'no-param-reassign': [2, { 'props': false }], + // don't require .vue extension when importing + 'import/extensions': ['error', 'always', { + 'js': 'never', + 'vue': 'never' + }], + // allow optionalDependencies + 'import/no-extraneous-dependencies': ['error', { + 'optionalDependencies': ['test/unit/index.js'] + }], + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc4299c --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +node_modules/ +dist/ +.history +.idea +npm-debug.log* +.vscode +stackedit_v4 +chrome-app/*.zip +/test/unit/coverage/ diff --git a/.postcssrc.js b/.postcssrc.js new file mode 100644 index 0000000..ea9a5ab --- /dev/null +++ b/.postcssrc.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + "plugins": { + // to edit target browsers: use "browserlist" field in package.json + "autoprefixer": {} + } +} diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 0000000..e9549f8 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,7 @@ +{ + "processors": ["stylelint-processor-html"], + "extends": "stylelint-config-standard", + "rules": { + "no-empty-source": null + } +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1d541e6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: node_js + +node_js: + - "12" + +services: + - docker + +before_deploy: + # Run docker build + - docker build -t benweet/stackedit . + # Install Helm + - curl -SL -o /tmp/get_helm.sh https://git.io/get_helm.sh + - chmod 700 /tmp/get_helm.sh + - /tmp/get_helm.sh + - helm init --client-only + +deploy: + provider: script + script: bash build/deploy.sh + on: + tags: true diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..6b8add1 --- /dev/null +++ b/build/build.js @@ -0,0 +1,35 @@ +require('./check-versions')() + +process.env.NODE_ENV = 'production' + +var ora = require('ora') +var rm = require('rimraf') +var path = require('path') +var chalk = require('chalk') +var webpack = require('webpack') +var config = require('../config') +var webpackConfig = require('./webpack.prod.conf') + +var spinner = ora('building for production...') +spinner.start() + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err + webpack(webpackConfig, function (err, stats) { + spinner.stop() + if (err) throw err + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false + }) + '\n\n') + + console.log(chalk.cyan(' Build complete.\n')) + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n' + )) + }) +}) diff --git a/build/check-versions.js b/build/check-versions.js new file mode 100644 index 0000000..100f3a0 --- /dev/null +++ b/build/check-versions.js @@ -0,0 +1,48 @@ +var chalk = require('chalk') +var semver = require('semver') +var packageConfig = require('../package.json') +var shell = require('shelljs') +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim() +} + +var versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node + }, +] + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +module.exports = function () { + var warnings = [] + for (var i = 0; i < versionRequirements.length; i++) { + var mod = versionRequirements[i] + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement) + ) + } + } + + if (warnings.length) { + console.log('') + console.log(chalk.yellow('To use this template, you must update following to modules:')) + console.log() + for (var i = 0; i < warnings.length; i++) { + var warning = warnings[i] + console.log(' ' + warning) + } + console.log() + process.exit(1) + } +} diff --git a/build/deploy.sh b/build/deploy.sh new file mode 100644 index 0000000..931f81a --- /dev/null +++ b/build/deploy.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +# Tag and push docker image +docker login -u benweet -p "$DOCKER_PASSWORD" +docker tag benweet/stackedit "benweet/stackedit:$TRAVIS_TAG" +docker push benweet/stackedit:$TRAVIS_TAG +docker tag benweet/stackedit:$TRAVIS_TAG benweet/stackedit:latest +docker push benweet/stackedit:latest + +# Build the chart +cd "$TRAVIS_BUILD_DIR" +npm run chart + +# Add chart to helm repository +git clone --branch master "https://benweet:$GITHUB_TOKEN@github.com/benweet/stackedit-charts.git" /tmp/charts +cd /tmp/charts +helm package "$TRAVIS_BUILD_DIR/dist/stackedit" +helm repo index --url https://benweet.github.io/stackedit-charts/ . +git config user.name "Benoit Schweblin" +git config user.email "benoit.schweblin@gmail.com" +git add . +git commit -m "Added $TRAVIS_TAG" +git push origin master diff --git a/build/dev-client.js b/build/dev-client.js new file mode 100644 index 0000000..18aa1e2 --- /dev/null +++ b/build/dev-client.js @@ -0,0 +1,9 @@ +/* eslint-disable */ +require('eventsource-polyfill') +var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') + +hotClient.subscribe(function (event) { + if (event.action === 'reload') { + window.location.reload() + } +}) diff --git a/build/dev-server.js b/build/dev-server.js new file mode 100644 index 0000000..a517b6c --- /dev/null +++ b/build/dev-server.js @@ -0,0 +1,94 @@ +require('./check-versions')() + +var config = require('../config') +Object.keys(config.dev.env).forEach((key) => { + if (!process.env[key]) { + process.env[key] = JSON.parse(config.dev.env[key]); + } +}); + +var opn = require('opn') +var path = require('path') +var express = require('express') +var webpack = require('webpack') +var proxyMiddleware = require('http-proxy-middleware') +var webpackConfig = require('./webpack.dev.conf') + +// default port where dev server listens for incoming traffic +var port = process.env.PORT || config.dev.port +// automatically open browser, if not set will be false +var autoOpenBrowser = !!config.dev.autoOpenBrowser +// Define HTTP proxies to your custom API backend +// https://github.com/chimurai/http-proxy-middleware +var proxyTable = config.dev.proxyTable + +var app = express() +var compiler = webpack(webpackConfig) + +// StackEdit custom middlewares +require('../server')(app); + +var devMiddleware = require('webpack-dev-middleware')(compiler, { + publicPath: webpackConfig.output.publicPath, + quiet: true +}) + +var hotMiddleware = require('webpack-hot-middleware')(compiler, { + log: () => {} +}) +// force page reload when html-webpack-plugin template changes +compiler.plugin('compilation', function (compilation) { + compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { + hotMiddleware.publish({ action: 'reload' }) + cb() + }) +}) + +// proxy api requests +Object.keys(proxyTable).forEach(function (context) { + var options = proxyTable[context] + if (typeof options === 'string') { + options = { target: options } + } + app.use(proxyMiddleware(options.filter || context, options)) +}) + +// handle fallback for HTML5 history API +app.use(require('connect-history-api-fallback')()) + +// serve webpack bundle output +app.use(devMiddleware) + +// enable hot-reload and state-preserving +// compilation error display +app.use(hotMiddleware) + +// serve pure static assets +var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) +app.use(staticPath, express.static('./static')) + +var uri = 'http://localhost:' + port + +var _resolve +var readyPromise = new Promise(resolve => { + _resolve = resolve +}) + +console.log('> Starting dev server...') +devMiddleware.waitUntilValid(() => { + console.log('> Listening at ' + uri + '\n') + // when env is testing, don't need open it + if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { + opn(uri) + } + _resolve() +}) + +var server = app.listen(port) + +module.exports = { + ready: readyPromise, + close: () => { + server.close() + } +} diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..b1d54b4 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,71 @@ +var path = require('path') +var config = require('../config') +var ExtractTextPlugin = require('extract-text-webpack-plugin') + +exports.assetsPath = function (_path) { + var assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory + return path.posix.join(assetsSubDirectory, _path) +} + +exports.cssLoaders = function (options) { + options = options || {} + + var cssLoader = { + loader: 'css-loader', + options: { + minimize: process.env.NODE_ENV === 'production', + sourceMap: options.sourceMap + } + } + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + var loaders = [cssLoader] + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader' + }) + } else { + return ['vue-style-loader'].concat(loaders) + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less'), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus') + } +} + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + var output = [] + var loaders = exports.cssLoaders(options) + for (var extension in loaders) { + var loader = loaders[extension] + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader + }) + } + return output +} diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js new file mode 100644 index 0000000..7aee79b --- /dev/null +++ b/build/vue-loader.conf.js @@ -0,0 +1,12 @@ +var utils = require('./utils') +var config = require('../config') +var isProduction = process.env.NODE_ENV === 'production' + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap, + extract: isProduction + }) +} diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..f0f27e4 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,109 @@ +var path = require('path') +var webpack = require('webpack') +var utils = require('./utils') +var config = require('../config') +var VueLoaderPlugin = require('vue-loader/lib/plugin') +var vueLoaderConfig = require('./vue-loader.conf') +var StylelintPlugin = require('stylelint-webpack-plugin') + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + +module.exports = { + entry: { + app: './src/' + }, + node: { + // For mermaid + fs: 'empty' // jison generated code requires 'fs' + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + '@': resolve('src') + } + }, + module: { + rules: [ + { + test: /\.(js|vue)$/, + loader: 'eslint-loader', + enforce: 'pre', + include: [resolve('src'), resolve('test')], + options: { + formatter: require('eslint-friendly-formatter') + } + }, + { + test: /\.vue$/, + loader: 'vue-loader', + options: vueLoaderConfig + }, + // We can't pass graphlibrary to babel + { + test: /\.js$/, + loader: 'string-replace-loader', + include: [ + resolve('node_modules/graphlibrary') + ], + options: { + search: '^\\s*(?:let|const) ', + replace: 'var ', + flags: 'gm' + } + }, + { + test: /\.js$/, + loader: 'babel-loader', + include: [ + resolve('src'), + resolve('test'), + resolve('node_modules/mermaid') + ], + exclude: [ + resolve('node_modules/mermaid/src/diagrams/class/parser'), + resolve('node_modules/mermaid/src/diagrams/flowchart/parser'), + resolve('node_modules/mermaid/src/diagrams/gantt/parser'), + resolve('node_modules/mermaid/src/diagrams/git/parser'), + resolve('node_modules/mermaid/src/diagrams/sequence/parser') + ], + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + test: /\.(ttf|eot|otf|woff2?)(\?.*)?$/, + loader: 'file-loader', + options: { + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + }, + { + test: /\.(md|yml|html)$/, + loader: 'raw-loader' + } + ] + }, + plugins: [ + new VueLoaderPlugin(), + new StylelintPlugin({ + files: ['**/*.vue', '**/*.scss'] + }), + new webpack.DefinePlugin({ + VERSION: JSON.stringify(require('../package.json').version) + }) + ] +} diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..6ec2eef --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,35 @@ +var utils = require('./utils') +var webpack = require('webpack') +var config = require('../config') +var merge = require('webpack-merge') +var baseWebpackConfig = require('./webpack.base.conf') +var HtmlWebpackPlugin = require('html-webpack-plugin') +var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') + +// add hot-reload related code to entry chunks +Object.keys(baseWebpackConfig.entry).forEach(function (name) { + baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) +}) + +module.exports = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) + }, + // cheap-module-eval-source-map is faster for development + devtool: 'source-map', + plugins: [ + new webpack.DefinePlugin({ + NODE_ENV: config.dev.env.NODE_ENV + }), + // https://github.com/glenjamin/webpack-hot-middleware#installation--usage + new webpack.HotModuleReplacementPlugin(), + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'index.html', + inject: true + }), + new FriendlyErrorsPlugin() + ] +}) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..94da9d8 --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,154 @@ +var path = require('path') +var utils = require('./utils') +var webpack = require('webpack') +var config = require('../config') +var merge = require('webpack-merge') +var baseWebpackConfig = require('./webpack.base.conf') +var CopyWebpackPlugin = require('copy-webpack-plugin') +var HtmlWebpackPlugin = require('html-webpack-plugin') +var ExtractTextPlugin = require('extract-text-webpack-plugin') +var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +var OfflinePlugin = require('offline-plugin'); +var WebpackPwaManifest = require('webpack-pwa-manifest') +var FaviconsWebpackPlugin = require('favicons-webpack-plugin') + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + +var env = config.build.env + +var webpackConfig = merge(baseWebpackConfig, { + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true + }) + }, + devtool: config.build.productionSourceMap ? '#source-map' : false, + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + NODE_ENV: env.NODE_ENV, + GOOGLE_CLIENT_ID: env.GOOGLE_CLIENT_ID, + GITHUB_CLIENT_ID: env.GITHUB_CLIENT_ID + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + sourceMap: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css') + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: { + safe: true + } + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'index.html', + inject: true, + minify: { + removeComments: true, + collapseWhitespace: true, + removeAttributeQuotes: true + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks: function (module, count) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + chunks: ['vendor'] + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]), + new FaviconsWebpackPlugin({ + logo: resolve('src/assets/favicon.png'), + title: 'StackEdit', + }), + new WebpackPwaManifest({ + name: 'StackEdit', + description: 'Full-featured, open-source Markdown editor', + display: 'standalone', + orientation: 'any', + start_url: 'app', + background_color: '#ffffff', + crossorigin: 'use-credentials', + icons: [{ + src: resolve('src/assets/favicon.png'), + sizes: [96, 128, 192, 256, 384, 512] + }] + }), + new OfflinePlugin({ + ServiceWorker: { + events: true + }, + AppCache: true, + excludes: ['**/.*', '**/*.map', '**/index.html', '**/static/oauth2/callback.html', '**/icons-*/*.png', '**/static/fonts/KaTeX_*'], + externals: ['/', '/app', '/oauth2/callback'] + }), + ] +}) + +if (config.build.productionGzip) { + var CompressionWebpackPlugin = require('compression-webpack-plugin') + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + asset: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$' + ), + threshold: 10240, + minRatio: 0.8 + }) + ) +} + +if (config.build.bundleAnalyzerReport) { + var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin + webpackConfig.plugins.push(new BundleAnalyzerPlugin()) +} + +module.exports = webpackConfig diff --git a/build/webpack.style.conf.js b/build/webpack.style.conf.js new file mode 100644 index 0000000..4f69e8a --- /dev/null +++ b/build/webpack.style.conf.js @@ -0,0 +1,56 @@ +var path = require('path') +var utils = require('./utils') +var webpack = require('webpack') +var utils = require('./utils') +var config = require('../config') +var vueLoaderConfig = require('./vue-loader.conf') +var StylelintPlugin = require('stylelint-webpack-plugin') +var ExtractTextPlugin = require('extract-text-webpack-plugin') +var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + +module.exports = { + entry: { + style: './src/styles/' + }, + module: { + rules: [{ + test: /\.(ttf|eot|otf|woff2?)(\?.*)?$/, + loader: 'file-loader', + options: { + name: utils.assetsPath('fonts/[name].[hash:7].[ext]') + } + }] + .concat(utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true + })), + }, + output: { + path: config.build.assetsRoot, + filename: '[name].js', + publicPath: config.build.assetsPublicPath + }, + plugins: [ + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + }, + sourceMap: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: '[name].css', + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: { + safe: true + } + }), + ] +} diff --git a/chart/.helmignore b/chart/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/chart/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/chart/Chart.yaml b/chart/Chart.yaml new file mode 100644 index 0000000..47e9e25 --- /dev/null +++ b/chart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: vSTACKEDIT_VERSION +description: In-browser Markdown editor +name: stackedit +version: STACKEDIT_VERSION diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt new file mode 100644 index 0000000..afce052 --- /dev/null +++ b/chart/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "stackedit.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "stackedit.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "stackedit.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "stackedit.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl new file mode 100644 index 0000000..dd36306 --- /dev/null +++ b/chart/templates/_helpers.tpl @@ -0,0 +1,45 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "stackedit.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "stackedit.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "stackedit.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "stackedit.labels" -}} +app.kubernetes.io/name: {{ include "stackedit.name" . }} +helm.sh/chart: {{ include "stackedit.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml new file mode 100644 index 0000000..530040c --- /dev/null +++ b/chart/templates/deployment.yaml @@ -0,0 +1,87 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "stackedit.fullname" . }} + labels: +{{ include "stackedit.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "stackedit.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "stackedit.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /run + name: run-volume + - mountPath: /tmp + name: tmp-volume + env: + - name: PORT + value: "80" + - name: PAYPAL_RECEIVER_EMAIL + value: {{ .Values.paypalReceiverEmail }} + - name: AWS_ACCESS_KEY_ID + value: {{ .Values.awsAccessKeyId }} + - name: AWS_SECRET_ACCESS_KEY + value: {{ .Values.awsSecretAccessKey }} + - name: DROPBOX_APP_KEY + value: {{ .Values.dropboxAppKey }} + - name: DROPBOX_APP_KEY_FULL + value: {{ .Values.dropboxAppKeyFull }} + - name: GOOGLE_CLIENT_ID + value: {{ .Values.googleClientId }} + - name: GOOGLE_API_KEY + value: {{ .Values.googleApiKey }} + - name: GITHUB_CLIENT_ID + value: {{ .Values.githubClientId }} + - name: GITHUB_CLIENT_SECRET + value: {{ .Values.githubClientSecret }} + - name: WORDPRESS_CLIENT_ID + value: {{ .Values.wordpressClientId }} + - name: WORDPRESS_SECRET + value: {{ .Values.wordpressSecret }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: run-volume + emptyDir: {} + - name: tmp-volume + emptyDir: {} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/chart/templates/ingress.yaml b/chart/templates/ingress.yaml new file mode 100644 index 0000000..d079953 --- /dev/null +++ b/chart/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "stackedit.fullname" . -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "stackedit.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + pathType: Prefix + backend: + service: + name: {{ $fullName }} + port: + name: http + {{- end }} + {{- end }} +{{- end }} diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml new file mode 100644 index 0000000..378f8a8 --- /dev/null +++ b/chart/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "stackedit.fullname" . }} + labels: +{{ include "stackedit.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "stackedit.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/chart/templates/tests/test-connection.yaml b/chart/templates/tests/test-connection.yaml new file mode 100644 index 0000000..ad2900c --- /dev/null +++ b/chart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "stackedit.fullname" . }}-test-connection" + labels: +{{ include "stackedit.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "stackedit.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/chart/values.yaml b/chart/values.yaml new file mode 100644 index 0000000..414aaa2 --- /dev/null +++ b/chart/values.yaml @@ -0,0 +1,71 @@ +# Default values for stackedit. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +dropboxAppKey: "" +dropboxAppKeyFull: "" +googleClientId: "" +googleApiKey: "" +githubClientId: "" +githubClientSecret: "" +giteeClientId: "" +giteeClientSecret: "" +wordpressClientId: "" +wordpressSecret: "" +paypalReceiverEmail: "" +awsAccessKeyId: "" +awsSecretAccessKey: "" +giteaClientId: "" +giteaClientSecret: "" +giteaUrl: "" +gitlabClientId: "" +gitlabUrl: "" + +replicaCount: 1 + +image: + repository: benweet/stackedit + tag: vSTACKEDIT_VERSION + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: + # kubernetes.io/ingress.class: nginx + # certmanager.k8s.io/issuer: letsencrypt-prod + # certmanager.k8s.io/acme-challenge-type: http01 + hosts: [] + # - host: stackedit.example.com + # paths: + # - / + + tls: [] + # - secretName: stackedit-tls + # hosts: + # - stackedit.example.com + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/chrome-app/icon-128.png b/chrome-app/icon-128.png new file mode 100644 index 0000000..498cb92 Binary files /dev/null and b/chrome-app/icon-128.png differ diff --git a/chrome-app/icon-16.png b/chrome-app/icon-16.png new file mode 100644 index 0000000..6432eb3 Binary files /dev/null and b/chrome-app/icon-16.png differ diff --git a/chrome-app/icon-256.png b/chrome-app/icon-256.png new file mode 100644 index 0000000..6e6c505 Binary files /dev/null and b/chrome-app/icon-256.png differ diff --git a/chrome-app/icon-32.png b/chrome-app/icon-32.png new file mode 100644 index 0000000..1c719cb Binary files /dev/null and b/chrome-app/icon-32.png differ diff --git a/chrome-app/icon-512.png b/chrome-app/icon-512.png new file mode 100644 index 0000000..8560f2e Binary files /dev/null and b/chrome-app/icon-512.png differ diff --git a/chrome-app/icon-64.png b/chrome-app/icon-64.png new file mode 100644 index 0000000..f16c067 Binary files /dev/null and b/chrome-app/icon-64.png differ diff --git a/chrome-app/manifest.json b/chrome-app/manifest.json new file mode 100644 index 0000000..afce6ee --- /dev/null +++ b/chrome-app/manifest.json @@ -0,0 +1,28 @@ +{ + "name": "StackEdit中文版", + "description": "支持Gitee仓库/粘贴图片自动上传的浏览器内 Markdown 编辑器", + "version": "5.15.17", + "manifest_version": 2, + "container" : "GITEE", + "api_console_project_id" : "241271498917", + "icons": { + "16": "icon-16.png", + "32": "icon-32.png", + "64": "icon-64.png", + "128": "icon-128.png", + "256": "icon-256.png", + "512": "icon-512.png" + }, + "app": { + "urls": [ + "https://stackedit.cn/" + ], + "launch": { + "web_url": "https://stackedit.cn/app" + } + }, + "offline_enabled": true, + "permissions": [ + "unlimitedStorage" + ] +} diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..4dc35d4 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,18 @@ +var merge = require('webpack-merge') +var prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"', + // 以下配置是开发临时用的配置 随时可能失效 请替换为自己的 + GITHUB_CLIENT_ID: '"845b8f75df48f2ee0563"', + GITHUB_CLIENT_SECRET: '"80df676597abded1450926861965cc3f9bead6a0"', + GITEE_CLIENT_ID: '"925ba7c78b85dec984f7877e4aca5cab10ae333c6d68e761bdb0b9dfb8f55672"', + GITEE_CLIENT_SECRET: '"f05731066e42d307339dc8ebbb037a103881dafc7207a359a393b87749f1c562"', + CLIENT_ID: '"thF3qCGLN39OtafjGnqHyj6n02WwE6xD"', + // GITEA_CLIENT_ID: '"fe30f8f9-b1e8-4531-8f72-c1a5d3912805"', + // GITEA_CLIENT_SECRET: '"lus7oMnb3H6M1hsChndphArE20Txr7erwJLf7SDBQWTw"', + // GITEA_URL: '"https://gitea.test.com"', + GITLAB_CLIENT_ID: '"074cd5103c62dea0f479dac861039656ac80935e304c8113a02cc64c629496ae"', + GITLAB_CLIENT_SECRET: '"6f406f24216b686d55d28313dec1913c2a8e599afdb08380d5e8ce838e16e41e"', + GITLAB_URL: '"http://gitlab.qicoder.com"', +}) \ No newline at end of file diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..8353371 --- /dev/null +++ b/config/index.js @@ -0,0 +1,39 @@ +// see http://vuejs-templates.github.io/webpack for documentation. +var path = require('path') + +module.exports = { + build: { + env: require('./prod.env'), + index: path.resolve(__dirname, '../dist/index.html'), + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: '/', + productionSourceMap: true, + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report + }, + dev: { + env: require('./dev.env'), + port: 80, + autoOpenBrowser: false, + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: {}, + // CSS Sourcemaps off by default because relative paths are "buggy" + // with this option, according to the CSS-Loader README + // (https://github.com/webpack/css-loader#sourcemaps) + // In our experience, they generally work as expected, + // just be aware of this issue when enabling this option. + // cssSourceMap: false + cssSourceMap: true + } +} diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..773d263 --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,3 @@ +module.exports = { + NODE_ENV: '"production"' +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..d8fa8ec --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,20 @@ +const path = require('path'); +const gulp = require('gulp'); +const concat = require('gulp-concat'); + +const prismScripts = [ + 'prismjs/components/prism-core', + 'prismjs/components/prism-markup', + 'prismjs/components/prism-clike', + 'prismjs/components/prism-c', + 'prismjs/components/prism-javascript', + 'prismjs/components/prism-css', + 'prismjs/components/prism-ruby', + 'prismjs/components/prism-cpp', +].map(require.resolve); +prismScripts.push( + path.join(path.dirname(require.resolve('prismjs/components/prism-core')), 'prism-!(*.min).js')); + +gulp.task('build-prism', () => gulp.src(prismScripts) + .pipe(concat('prism.js')) + .pipe(gulp.dest(path.dirname(require.resolve('prismjs'))))); diff --git a/index.html b/index.html new file mode 100644 index 0000000..3c4653c --- /dev/null +++ b/index.html @@ -0,0 +1,28 @@ + + + + + StackEdit中文版 + + + + + + + + + +
+ + + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..213acf6 --- /dev/null +++ b/index.js @@ -0,0 +1,27 @@ +const env = require('./config/prod.env'); + +Object.keys(env).forEach((key) => { + if (!process.env[key]) { + process.env[key] = JSON.parse(env[key]); + } +}); + +const http = require('http'); +const express = require('express'); + +const app = express(); + +require('./server')(app); + +const port = parseInt(process.env.PORT || 8080, 10); +const httpServer = http.createServer(app); +httpServer.listen(port, null, () => { + console.log(`HTTP server started: http://localhost:${port}`); +}); + +// Handle graceful shutdown +process.on('SIGTERM', () => { + httpServer.close(() => { + process.exit(0); + }); +}); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1875169 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,22028 @@ +{ + "name": "stackedit", + "version": "5.15.21", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", + "integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.44" + } + }, + "@babel/core": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.0.0-rc.1.tgz", + "integrity": "sha512-CvuSsq+LFs9N4SJG8MnNPI0hnl913HK1OqG3NEfejOKo+JqtVuxpmAFyXIDogX2x668xqFKAW6EQiCIcUHklMg==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-rc.1", + "@babel/generator": "7.0.0-rc.1", + "@babel/helpers": "7.0.0-rc.1", + "@babel/parser": "7.0.0-rc.1", + "@babel/template": "7.0.0-rc.1", + "@babel/traverse": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1", + "convert-source-map": "^1.1.0", + "debug": "^3.1.0", + "json5": "^0.5.0", + "lodash": "^4.17.10", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-rc.1.tgz", + "integrity": "sha512-qhQo3GqwqMUv03SxxjcEkWtlkEDvFYrBKbJUn4Dtd9amC2cLkJ3me4iYUVSBbVXWbfbVRalEeVBHzX4aQYKnBg==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-rc.1" + } + }, + "@babel/generator": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-rc.1.tgz", + "integrity": "sha512-Ak4n780/coo+L9GZUS7V/IGJilP11t4UoWl0J9cG3jso4KkDGQcqdx4Y6gJAiXng+sDfvzUmvWfM1hZwH82J0A==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-rc.1.tgz", + "integrity": "sha512-fDbWxdYYbFNzcI5jn3qsPxHI1UCXwvFk0kGytGce/FEBYEPXBqycKknC8Oqiub8DzGtmTcvnqcm/cl/qxzeuiQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-rc.1", + "@babel/template": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-rc.1.tgz", + "integrity": "sha512-5+ydaIRxT42FSDqvoXIDksCGlW1903xC73HQnQCFF1YuV7VcIf+9M4+tRZulLlYlshw7ILA+4SiYsKoDlC0Irg==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-rc.1.tgz", + "integrity": "sha512-hz6QmlnaBFYt4ra8DfRLCMgrI7yfwQ13kJtufSO5dVCasxmAng2LeeQiT6H4iN5TpFONcayp5f/2mXqHH/zn/g==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/highlight": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-rc.1.tgz", + "integrity": "sha512-5PgPDV6F5s69XNznTcP0za3qH7qgBkr9DVQTXfZtpF+3iEyuIZB1Mjxu52F5CFxgzQUQJoBYHVxtH4Itdb5MgA==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "@babel/template": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-rc.1.tgz", + "integrity": "sha512-gPLng2iedNlkaGD0UdwaUByQXK8k4bnaoq2RH5JgR2mqHvh2RyjkDdaMbZFlSss1Iu8+PrXwbIRworTl8iRqbA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-rc.1", + "@babel/parser": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1", + "lodash": "^4.17.10" + } + }, + "@babel/traverse": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-rc.1.tgz", + "integrity": "sha512-lNOpJ5xzakg+fCobQQHdeDRYeN54b+bAZpeTYMeeYPAvN+hTldg9/FSNKYEMRs5EWoQ0Yt74gwq98InSORdSDQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-rc.1", + "@babel/generator": "7.0.0-rc.1", + "@babel/helper-function-name": "7.0.0-rc.1", + "@babel/helper-split-export-declaration": "7.0.0-rc.1", + "@babel/parser": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1", + "debug": "^3.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + } + }, + "@babel/types": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-rc.1.tgz", + "integrity": "sha512-MBwO1JQKin9BwKTGydrYe4VDJbStCUy35IhJzeZt3FByOdx/q3CYaqMRrH70qVD2RA7+Xk8e3RN0mzKZkYBYuQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.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" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "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 + }, + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + }, + "to-fast-properties": { + "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 + } + } + }, + "@babel/generator": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", + "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44", + "jsesc": "^2.5.1", + "lodash": "^4.2.0", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", + "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.44", + "@babel/template": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", + "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", + "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helpers": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.0.0-rc.1.tgz", + "integrity": "sha512-4+AkDbZ0Usr7mNH4wGX8fVx4WJzHdrcjRkJy52EIWyBAQEoKqb5HXca1VjejWtnVwaGwW7zk/h6oQ9FQPywQfA==", + "dev": true, + "requires": { + "@babel/template": "7.0.0-rc.1", + "@babel/traverse": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-rc.1.tgz", + "integrity": "sha512-qhQo3GqwqMUv03SxxjcEkWtlkEDvFYrBKbJUn4Dtd9amC2cLkJ3me4iYUVSBbVXWbfbVRalEeVBHzX4aQYKnBg==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-rc.1" + } + }, + "@babel/generator": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-rc.1.tgz", + "integrity": "sha512-Ak4n780/coo+L9GZUS7V/IGJilP11t4UoWl0J9cG3jso4KkDGQcqdx4Y6gJAiXng+sDfvzUmvWfM1hZwH82J0A==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-rc.1.tgz", + "integrity": "sha512-fDbWxdYYbFNzcI5jn3qsPxHI1UCXwvFk0kGytGce/FEBYEPXBqycKknC8Oqiub8DzGtmTcvnqcm/cl/qxzeuiQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-rc.1", + "@babel/template": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-rc.1.tgz", + "integrity": "sha512-5+ydaIRxT42FSDqvoXIDksCGlW1903xC73HQnQCFF1YuV7VcIf+9M4+tRZulLlYlshw7ILA+4SiYsKoDlC0Irg==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-rc.1.tgz", + "integrity": "sha512-hz6QmlnaBFYt4ra8DfRLCMgrI7yfwQ13kJtufSO5dVCasxmAng2LeeQiT6H4iN5TpFONcayp5f/2mXqHH/zn/g==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-rc.1" + } + }, + "@babel/highlight": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-rc.1.tgz", + "integrity": "sha512-5PgPDV6F5s69XNznTcP0za3qH7qgBkr9DVQTXfZtpF+3iEyuIZB1Mjxu52F5CFxgzQUQJoBYHVxtH4Itdb5MgA==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "@babel/template": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-rc.1.tgz", + "integrity": "sha512-gPLng2iedNlkaGD0UdwaUByQXK8k4bnaoq2RH5JgR2mqHvh2RyjkDdaMbZFlSss1Iu8+PrXwbIRworTl8iRqbA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-rc.1", + "@babel/parser": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1", + "lodash": "^4.17.10" + } + }, + "@babel/traverse": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-rc.1.tgz", + "integrity": "sha512-lNOpJ5xzakg+fCobQQHdeDRYeN54b+bAZpeTYMeeYPAvN+hTldg9/FSNKYEMRs5EWoQ0Yt74gwq98InSORdSDQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-rc.1", + "@babel/generator": "7.0.0-rc.1", + "@babel/helper-function-name": "7.0.0-rc.1", + "@babel/helper-split-export-declaration": "7.0.0-rc.1", + "@babel/parser": "7.0.0-rc.1", + "@babel/types": "7.0.0-rc.1", + "debug": "^3.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + } + }, + "@babel/types": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-rc.1.tgz", + "integrity": "sha512-MBwO1JQKin9BwKTGydrYe4VDJbStCUy35IhJzeZt3FByOdx/q3CYaqMRrH70qVD2RA7+Xk8e3RN0mzKZkYBYuQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.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" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "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 + }, + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + }, + "to-fast-properties": { + "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 + } + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", + "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-rc.1.tgz", + "integrity": "sha512-rC+bIz2eZnJlacERmJO25UAbXVZttcSxh0Px0gRGinOTzug5tL7+L9urfIdSWlv1ZzP03+f2xkOFLOxZqSsVmQ==", + "dev": true + }, + "@babel/template": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", + "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "lodash": "^4.2.0" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + } + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz", + "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/generator": "7.0.0-beta.44", + "@babel/helper-function-name": "7.0.0-beta.44", + "@babel/helper-split-export-declaration": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.2.0" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + }, + "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" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", + "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "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 + } + } + }, + "@braintree/sanitize-url": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/@braintree/sanitize-url/-/sanitize-url-3.1.0.tgz", + "integrity": "sha512-GcIY79elgB+azP74j8vqkiXz8xLFfIzbQJdlwOPisgbKT00tviJQuEghOXSMVxJ00HoYJbGswr4kcllUc4xCcg==" + }, + "@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": { + "call-me-maybe": "^1.0.1", + "glob-to-regexp": "^0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz", + "integrity": "sha512-KU/VDjC5RwtDUZiz3d+DHXJF2lp5hB9dn552TXIyptj8SH1vXmR40mG0JgGq03IlYsOgGfcv8xrLpSQ0YUMQdA==", + "dev": true + }, + "@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-FKjsOVbC6B7bdSB5CuzyHCkK69I=", + "dev": true + }, + "@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, + "@vue/component-compiler-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-2.2.0.tgz", + "integrity": "sha512-pS4zlcdD7BvedyB+IfiTfrbi6C977UMIfulSk8r6uL0BU46ZE2+fUj/zbSNSfVxeaj9ElmnSni5OMwF9np+b+w==", + "dev": true, + "requires": { + "consolidate": "^0.15.1", + "hash-sum": "^1.0.2", + "lru-cache": "^4.1.2", + "merge-source-map": "^1.1.0", + "postcss": "^6.0.20", + "postcss-selector-parser": "^3.1.1", + "prettier": "1.13.7", + "source-map": "^0.5.6", + "vue-template-es2015-compiler": "^1.6.0" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.0" + }, + "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 + } + } + }, + "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" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "@vue/test-utils": { + "version": "1.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.0.0-beta.24.tgz", + "integrity": "sha512-GJyoAbyo1rEyohUziouJqDL7Nu7stSl3ByyYXLTppbrwdKZ9fFZPLZwKxkxS/Ks4Fo9YG5lALLLttypz0SC7FA==", + "requires": { + "lodash": "^4.17.4" + } + }, + "abab": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "abcjs": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/abcjs/-/abcjs-5.2.0.tgz", + "integrity": "sha512-VBTgtp2esnv6RR2N6Nsa+V7VE07H/TLtUju+Orh6anud5KDfUE6eEM8OWt2oKMwKR2zsrY8Y5KyH541uyV2DEw==", + "requires": { + "midi": "git+https://github.com/paulrosen/MIDI.js.git#abcjs" + } + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "requires": { + "mime-types": "~2.1.16", + "negotiator": "0.6.1" + } + }, + "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-dynamic-import": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "dev": true, + "requires": { + "acorn": "^4.0.3" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "acorn-globals": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.1.0.tgz", + "integrity": "sha512-KjZwU26uG3u6eZcfGbTULzFcsoz6pegNKtHPksZPOUsiKo5bUmiBPa38FuHZ/Eun+XYh/JCCkS9AS3Lu4McQOQ==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-errors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.0.tgz", + "integrity": "sha1-7PAh+hCP0X37Xms4Py3SM+Mf/Fk=", + "dev": true + }, + "ajv-keywords": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", + "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "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=" + }, + "ansi-colors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", + "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", + "dev": true, + "requires": { + "ansi-wrap": "^0.1.0" + } + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-gray": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", + "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", + "dev": true, + "requires": { + "ansi-wrap": "0.1.0" + } + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "ansi-wrap": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", + "dev": true + }, + "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" + } + }, + "append-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz", + "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", + "dev": true, + "requires": { + "buffer-equal": "^1.0.0" + }, + "dependencies": { + "buffer-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz", + "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74=", + "dev": true + } + } + }, + "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": { + "default-require-extensions": "^2.0.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "argsarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/argsarray/-/argsarray-0.0.1.tgz", + "integrity": "sha1-bnIHtOzbObCviDA/pa4ivajfYcs=" + }, + "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" + } + }, + "arr-filter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/arr-filter/-/arr-filter-1.1.2.tgz", + "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", + "dev": true, + "requires": { + "make-iterator": "^1.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 + }, + "arr-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/arr-map/-/arr-map-2.0.2.tgz", + "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", + "dev": true, + "requires": { + "make-iterator": "^1.0.0" + } + }, + "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-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "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": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-find/-/array-find-1.0.0.tgz", + "integrity": "sha1-bI4obRHtdoMn+OYuzuhzU8o+eLg=", + "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-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "array-initial": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz", + "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", + "dev": true, + "requires": { + "array-slice": "^1.0.0", + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "array-iterate": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-1.1.2.tgz", + "integrity": "sha512-1hWSHTIlG/8wtYD+PPX5AOBtKWngpDFjrsrHgZpe+JdgNGz0udYu6ZIkAa/xuenIUEqFv7DvE2Yr60jxweJSrQ==", + "dev": true + }, + "array-last": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array-last/-/array-last-1.3.0.tgz", + "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", + "dev": true, + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "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-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true + }, + "array-sort": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-sort/-/array-sort-1.0.0.tgz", + "integrity": "sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==", + "dev": true, + "requires": { + "default-compare": "^1.0.0", + "get-value": "^2.0.6", + "kind-of": "^5.0.2" + }, + "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 + } + } + }, + "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": { + "array-uniq": "^1.0.1" + } + }, + "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.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", + "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "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": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "async-done": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/async-done/-/async-done-1.3.2.tgz", + "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.2", + "process-nextick-args": "^2.0.0", + "stream-exhaust": "^1.0.1" + }, + "dependencies": { + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + } + } + }, + "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-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, + "async-settle": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz", + "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", + "dev": true, + "requires": { + "async-done": "^1.2.2" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.0.3.tgz", + "integrity": "sha1-GcenYEc3dEaPILLS0DNyrX1Mv10=", + "dev": true + }, + "autoprefixer": { + "version": "6.7.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", + "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", + "dev": true, + "requires": { + "browserslist": "^1.7.6", + "caniuse-db": "^1.0.30000634", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^5.2.16", + "postcss-value-parser": "^3.2.3" + } + }, + "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=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "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=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "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": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "babel-eslint": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz", + "integrity": "sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/traverse": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "^1.0.0" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "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": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "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-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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "dev": true, + "requires": { + "babel-helper-bindify-decorators": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-vue-jsx-merge-props": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz", + "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg==", + "dev": true + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-jest": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-21.2.0.tgz", + "integrity": "sha512-O0W2qLoWu1QOoOGgxiR2JID4O6WSpxPiQanrkyi9SSlM0PJ60Ptzlck47lhtnr9YZO3zYOsxHwnyeWJ6AffoBQ==", + "dev": true, + "requires": { + "babel-plugin-istanbul": "^4.0.0", + "babel-preset-jest": "^21.2.0" + } + }, + "babel-loader": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", + "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", + "dev": true, + "requires": { + "find-cache-dir": "^1.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1" + }, + "dependencies": { + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "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-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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.2.0.tgz", + "integrity": "sha512-yeDwKaLgGdTpXL7RgGt5r6T4LmnTza/hUn5Ul8uZSGGMtEjYo13Nxai7SQaGCTEzUtg9Zq9qJn0EjEr7SeSlTQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0" + } + }, + "babel-plugin-istanbul": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "find-up": "^2.1.0", + "istanbul-lib-instrument": "^1.10.1", + "test-exclude": "^4.2.1" + }, + "dependencies": { + "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" + } + } + } + }, + "babel-plugin-jest-hoist": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.2.0.tgz", + "integrity": "sha512-yi5QuiVyyvhBUDLP4ButAnhYzkdrUwWDtvUJv71hjH3fclhnZg4HkDeqaitcR2dZZx/E67kGkRcPVjtVu+SJfQ==", + "dev": true + }, + "babel-plugin-jsx-event-modifiers": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/babel-plugin-jsx-event-modifiers/-/babel-plugin-jsx-event-modifiers-2.0.5.tgz", + "integrity": "sha512-tWGnCk0whZ+nZcj9tYLw4+y08tPJXqaEjIxRJZS6DkUUae72Kz4BsoGpxt/Kow7mmgQJpvFCw8IPLSNh5rkZCg==", + "dev": true + }, + "babel-plugin-jsx-v-model": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jsx-v-model/-/babel-plugin-jsx-v-model-2.0.3.tgz", + "integrity": "sha512-SIx3Y3XxwGEz56Q1atwr5GaZsxJ2IRYmn5dl38LFkaTAvjnbNQxsZHO+ylJPsd+Hmv+ixJBYYFEekPBTHwiGfQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-jsx": "^6.18.0", + "html-tags": "^2.0.0", + "svg-tags": "^1.0.0" + } + }, + "babel-plugin-jsx-vue-functional": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jsx-vue-functional/-/babel-plugin-jsx-vue-functional-2.1.0.tgz", + "integrity": "sha1-VjCgyG/hkE0owwRl5r8c9xI1ojk=", + "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=", + "dev": true + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "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=", + "dev": true + }, + "babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "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=", + "dev": true + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-generators": "^6.5.0", + "babel-runtime": "^6.22.0" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "dev": true, + "requires": { + "babel-helper-explode-class": "^6.24.1", + "babel-plugin-syntax-decorators": "^6.13.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "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=", + "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" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "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.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "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=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "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" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "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=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.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=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "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=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-runtime": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", + "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-strict-mode": { + "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=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-vue-jsx": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-3.7.0.tgz", + "integrity": "sha512-W39X07/n3oJMQd8tALBO+440NraGSF//Lo1ydd/9Nme3+QiRGFBb1Q39T9iixh0jZPPbfv3so18tNoIgLatymw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "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.22.0", + "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.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "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.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + }, + "dependencies": { + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "electron-to-chromium": { + "version": "1.3.70", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.70.tgz", + "integrity": "sha512-WYMjqCnPVS5JA+XvwEnpwucJpVi2+q9cdCFpbhxgWGsCtforFBEkuP9+nCyy/wnU/0SyLcLRIeZct9ayMGcXoQ==", + "dev": true + } + } + }, + "babel-preset-jest": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-21.2.0.tgz", + "integrity": "sha512-hm9cBnr2h3J7yXoTtAVV0zg+3vg0Q/gT2GYuzlreTU0EPkJRtlNgKJJ3tBKEn0+VjAi3JykV6xCJkuUYttEEfA==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^21.2.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-preset-stage-3": "^6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "dev": true, + "requires": { + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-exponentiation-operator": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.22.0" + } + }, + "babel-preset-vue": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/babel-preset-vue/-/babel-preset-vue-1.2.1.tgz", + "integrity": "sha512-a/Z+6SJ4GXyAoCMfYidDH6OzXnccPNJ5nEaPMjALqCkP9SJkqxz9V0uUS//sGuWszcD8kibdwJRzU+brl8DdFQ==", + "dev": true, + "requires": { + "babel-helper-vue-jsx-merge-props": "^2.0.2", + "babel-plugin-jsx-event-modifiers": "^2.0.2", + "babel-plugin-jsx-v-model": "^2.0.1", + "babel-plugin-jsx-vue-functional": "^2.1.0", + "babel-plugin-syntax-jsx": "^6.18.0", + "babel-plugin-transform-vue-jsx": "^3.5.0" + } + }, + "babel-preset-vue-app": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/babel-preset-vue-app/-/babel-preset-vue-app-1.3.2.tgz", + "integrity": "sha512-PLyyyVdrvgL4szMF7D5SuUhy85aBzy0+s5MO2QhpTwVqfW0qVaPFJi6K3d25CKz1nOV437JgpVvPj1W6tLGJ5g==", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-runtime": "^6.15.0", + "babel-preset-env": "^1.6.0", + "babel-preset-vue": "^1.2.1", + "babel-runtime": "^6.20.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "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": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + } + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "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-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "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.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "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" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "bach": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/bach/-/bach-1.2.0.tgz", + "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", + "dev": true, + "requires": { + "arr-filter": "^1.1.1", + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "array-each": "^1.0.0", + "array-initial": "^1.0.0", + "array-last": "^1.1.1", + "async-done": "^1.2.2", + "async-settle": "^1.0.0", + "now-and-later": "^2.0.0" + } + }, + "bail": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.3.tgz", + "integrity": "sha512-1X8CnjFVQ+a+KW36uBNMTU5s8+v5FzeqrP7hTG5aTb4aPreSbZJlhwPon9VKMuEVgV++JM+SQrALY3kr7eswdg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "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": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "base64-arraybuffer-es6": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/base64-arraybuffer-es6/-/base64-arraybuffer-es6-0.3.1.tgz", + "integrity": "sha512-TrhBheudYaff9adiTAqjSScjvtmClQ4vF9l4cqkPNkVsA11m4/NRdH4LkZ/tAMmpzzwfI20BXnJ/PTtafECCNA==" + }, + "base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bezier-easing": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bezier-easing/-/bezier-easing-1.1.1.tgz", + "integrity": "sha1-ni8OJwsasgT/JD0hbR+rUhctomw=" + }, + "bfj": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/bfj/-/bfj-6.1.1.tgz", + "integrity": "sha512-+GUNvzHR4nRyGybQc2WpNJL4MJazMuvf92ueIyA0bIkPRwhhQu3IfZQ2PSoVPpCBJfmoSdOxu5rnotfFLlvYRQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "check-types": "^7.3.0", + "hoopy": "^0.1.2", + "tryer": "^1.0.0" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "bignumber.js": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.4.0.tgz", + "integrity": "sha1-g4qZLan51zfg9LLbC+YrsJ3Qxeg=", + "dev": true + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "requires": { + "inherits": "~2.0.0" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bmp-js": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.0.3.tgz", + "integrity": "sha1-ZBE+nHzxICs3btYHvzBibr5XsYo=", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.1", + "http-errors": "~1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "~2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "~1.6.15" + } + }, + "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=", + "requires": { + "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=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-process-hrtime": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", + "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", + "dev": true + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "browserify-aes": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "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.30000639", + "electron-to-chromium": "^1.2.7" + } + }, + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "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": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "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-equal": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", + "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=", + "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/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + }, + "dependencies": { + "y18n": { + "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 + } + } + }, + "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" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "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-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "requires": { + "no-case": "^2.2.0", + "upper-case": "^1.1.1" + } + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + } + } + }, + "caniuse-api": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", + "integrity": "sha1-tTTnxzTE+B7F++isoq0kNUuWLGw=", + "dev": true, + "requires": { + "browserslist": "^1.3.6", + "caniuse-db": "^1.0.30000529", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "caniuse-db": { + "version": "1.0.30000791", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000791.tgz", + "integrity": "sha1-Bnh/VsrvQwChfjXRN0RxI731Nvk=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000885", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000885.tgz", + "integrity": "sha512-cXKbYwpxBLd7qHyej16JazPoUacqoVuDhvR61U7Fr5vSxMUiodzcYa1rQYRYfZ5GexV03vGZHd722vNPLjPJGQ==", + "dev": true + }, + "capture-exit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", + "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "dev": true, + "requires": { + "rsvp": "^3.3.3" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "ccount": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz", + "integrity": "sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw==", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "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" + }, + "dependencies": { + "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 + } + } + }, + "character-entities": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.2.tgz", + "integrity": "sha512-sMoHX6/nBiy3KKfC78dnEalnpn0Az0oSNvqUWYTtYrhRI5iUIYsROU48G+E+kMFQzqXaJ8kHJZ85n7y6/PHgwQ==", + "dev": true + }, + "character-entities-html4": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.2.tgz", + "integrity": "sha512-sIrXwyna2+5b0eB9W149izTPJk/KkJTg6mEzDGibwBUkyH1SbDa+nf515Ppdi3MaH35lW0JFJDWeq9Luzes1Iw==", + "dev": true + }, + "character-entities-legacy": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz", + "integrity": "sha512-9NB2VbXtXYWdXzqrvAHykE/f0QJxzaKIpZ5QzNZrrgQ7Iyxr2vnfS8fCBNVW9nUEZE0lo57nxKRqnzY/dKrwlA==", + "dev": true + }, + "character-reference-invalid": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz", + "integrity": "sha512-7I/xceXfKyUJmSAn/jw8ve/9DyOP7XxufNYLI9Px7CmsKgEUaZLUTax6nZxGQtaoiZCjpu6cHPj20xC/vqRReQ==", + "dev": true + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "check-types": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/check-types/-/check-types-7.4.0.tgz", + "integrity": "sha512-YbulWHdfP99UfZ73NcUDlNJhEIDgm9Doq9GhpyXbF+7Aegi3CVV7qqMCKTTqJxlvEvnQBp9IA+dxsGN6xK/nSg==", + "dev": true + }, + "cheerio": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.19.0.tgz", + "integrity": "sha1-dy5wFfLuKZZQltcepBdbdas1SSU=", + "dev": true, + "requires": { + "css-select": "~1.0.0", + "dom-serializer": "~0.1.0", + "entities": "~1.1.1", + "htmlparser2": "~3.8.1", + "lodash": "^3.2.0" + }, + "dependencies": { + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + }, + "dependencies": { + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "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.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "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 + } + } + }, + "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" + }, + "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" + } + } + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true + }, + "ci-info": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.3.1.tgz", + "integrity": "sha512-l4wK/SFEN8VVTQ9RO1I5yzIL2vw1w6My29qA6Gwaec80QeHxfXbruuUWqn1knyMoJn/X5kav3zVY1TlRHSKeIA==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "clap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", + "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", + "dev": true, + "requires": { + "chalk": "^1.1.3" + } + }, + "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": { + "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" + } + }, + "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-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-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" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + } + } + }, + "clean-css": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.1.tgz", + "integrity": "sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g==", + "requires": { + "source-map": "~0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "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-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "clipboard": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-1.7.1.tgz", + "integrity": "sha1-Ng1taUbpmnof7zleQrqStem1oWs=", + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + } + } + }, + "clone": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", + "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "clone-regexp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.1.tgz", + "integrity": "sha512-Fcij9IwRW27XedRIJnSOEupS7RVcXtObJXbcUOX93UCLqqOdRpkvzKywOOSizmEK/Is3S/RHX9dLdfo6R1Q1mw==", + "dev": true, + "requires": { + "is-regexp": "^1.0.0", + "is-supported-regexp-flag": "^1.0.0" + } + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", + "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "process-nextick-args": "^1.0.6", + "through2": "^2.0.1" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "coa": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/coa/-/coa-1.0.4.tgz", + "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=", + "dev": true, + "requires": { + "q": "^1.1.2" + } + }, + "coalescy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/coalescy/-/coalescy-1.0.0.tgz", + "integrity": "sha1-SwZYRrg2NhrabEtKSr9LwcrDG/E=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collapse-white-space": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz", + "integrity": "sha512-YfQ1tAUZm561vpYD+5eyWN8+UsceQbSrqqlc/6zDY2gtAE+uZLSdkkovhnGpmCThsvKBFakq4EdY/FF93E8XIw==", + "dev": true + }, + "collection-map": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-map/-/collection-map-1.0.0.tgz", + "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", + "dev": true, + "requires": { + "arr-map": "^2.0.2", + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + } + } + }, + "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=", + "dev": true, + "requires": { + "clone": "^1.0.2", + "color-convert": "^1.3.0", + "color-string": "^0.3.0" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "^1.1.1" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "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=", + "dev": true, + "requires": { + "color-name": "^1.0.0" + } + }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, + "colormin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colormin/-/colormin-1.1.2.tgz", + "integrity": "sha1-6i90IKcrlogaOKrlnsEkpvcpgTM=", + "dev": true, + "requires": { + "color": "^0.11.0", + "css-color-names": "0.0.4", + "has": "^1.0.1" + } + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==" + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "compare-versions": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.3.1.tgz", + "integrity": "sha512-GkIcfJ9sDt4+gS+RWH3X+kR7ezuKdu3fg2oA9nRA8HZoqZwAKv3ml3TyfB9OyV2iFXxCw7q5XfV6SyPbSCT2pw==", + "dev": true + }, + "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 + }, + "compressible": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.12.tgz", + "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", + "requires": { + "mime-db": ">= 1.30.0 < 2" + } + }, + "compression": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.1.tgz", + "integrity": "sha1-7/JgPvwuIs+G810uuTWJ+YdTc9s=", + "requires": { + "accepts": "~1.3.4", + "bytes": "3.0.0", + "compressible": "~2.0.11", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.1", + "vary": "~1.1.2" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "concat-with-sourcemaps": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", + "dev": true, + "requires": { + "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 + } + } + }, + "condense-newlines": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/condense-newlines/-/condense-newlines-0.2.1.tgz", + "integrity": "sha1-PemFVTE5R10yUCyDsC9gaE0kxV8=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-whitespace": "^0.3.0", + "kind-of": "^3.0.2" + } + }, + "config-chain": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", + "integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=", + "dev": true, + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "connect-history-api-fallback": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", + "integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, + "consolidate": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/consolidate/-/consolidate-0.15.1.tgz", + "integrity": "sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw==", + "dev": true, + "requires": { + "bluebird": "^3.1.1" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "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==" + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "copy-props": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/copy-props/-/copy-props-2.0.5.tgz", + "integrity": "sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw==", + "dev": true, + "requires": { + "each-props": "^1.3.2", + "is-plain-object": "^5.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + } + } + }, + "copy-webpack-plugin": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz", + "integrity": "sha512-OlTo6DYg0XfTKOF8eLf79wcHm4Ut10xU2cRBRPMW/NA5F9VMjZGTfRHWDIYC3s+1kObGYrBLshXWU1K0hILkNQ==", + "dev": true, + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "globby": "^7.1.1", + "is-glob": "^4.0.0", + "loader-utils": "^1.1.0", + "minimatch": "^3.0.4", + "p-limit": "^1.0.0", + "serialize-javascript": "^1.4.0" + }, + "dependencies": { + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "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" + } + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + } + } + }, + "core-js": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", + "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cosmiconfig": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.6.tgz", + "integrity": "sha512-6DWfizHriCrFWURP1/qyhsiFvYdlJzbCzmtFWh744+KyWsJo5+kPzUZZaMRSSItoYc0pxFX7gEO7ZC1/gN/7AQ==", + "dev": true, + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.9.0", + "parse-json": "^4.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "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=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css-b64-images": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/css-b64-images/-/css-b64-images-0.2.5.tgz", + "integrity": "sha1-QgBdgyBLK0pdk7axpWRBM7WSegI=" + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true + }, + "css-loader": { + "version": "0.28.11", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", + "integrity": "sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "css-selector-tokenizer": "^0.7.0", + "cssnano": "^3.10.0", + "icss-utils": "^2.1.0", + "loader-utils": "^1.0.2", + "lodash.camelcase": "^4.3.0", + "object-assign": "^4.1.1", + "postcss": "^5.0.6", + "postcss-modules-extract-imports": "^1.2.0", + "postcss-modules-local-by-default": "^1.2.0", + "postcss-modules-scope": "^1.1.0", + "postcss-modules-values": "^1.3.0", + "postcss-value-parser": "^3.3.0", + "source-list-map": "^2.0.0" + }, + "dependencies": { + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "css-select": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.0.0.tgz", + "integrity": "sha1-sRIcpRhI3SZOIkTQWM7iVN7rRLA=", + "dev": true, + "requires": { + "boolbase": "~1.0.0", + "css-what": "1.0", + "domutils": "1.4", + "nth-check": "~1.0.0" + }, + "dependencies": { + "domutils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", + "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", + "dev": true, + "requires": { + "domelementtype": "1" + } + } + } + }, + "css-selector-tokenizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz", + "integrity": "sha1-5piEdK6MlTR3v15+/s/OzNnPTIY=", + "dev": true, + "requires": { + "cssesc": "^0.1.0", + "fastparse": "^1.1.1", + "regexpu-core": "^1.0.0" + }, + "dependencies": { + "regexpu-core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + } + } + }, + "css-what": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-1.0.0.tgz", + "integrity": "sha1-18wt9FGAZm+Z0rFEYmOUaeAPc2w=", + "dev": true + }, + "cssesc": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", + "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", + "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.3.1", + "decamelize": "^1.1.2", + "defined": "^1.0.0", + "has": "^1.0.1", + "object-assign": "^4.0.1", + "postcss": "^5.0.14", + "postcss-calc": "^5.2.0", + "postcss-colormin": "^2.1.8", + "postcss-convert-values": "^2.3.4", + "postcss-discard-comments": "^2.0.4", + "postcss-discard-duplicates": "^2.0.1", + "postcss-discard-empty": "^2.0.1", + "postcss-discard-overridden": "^0.1.1", + "postcss-discard-unused": "^2.2.1", + "postcss-filter-plugins": "^2.0.0", + "postcss-merge-idents": "^2.1.5", + "postcss-merge-longhand": "^2.0.1", + "postcss-merge-rules": "^2.0.3", + "postcss-minify-font-values": "^1.0.2", + "postcss-minify-gradients": "^1.0.1", + "postcss-minify-params": "^1.0.4", + "postcss-minify-selectors": "^2.0.4", + "postcss-normalize-charset": "^1.1.0", + "postcss-normalize-url": "^3.0.7", + "postcss-ordered-values": "^2.1.0", + "postcss-reduce-idents": "^2.2.2", + "postcss-reduce-initial": "^1.0.0", + "postcss-reduce-transforms": "^1.0.3", + "postcss-svgo": "^2.1.1", + "postcss-unique-selectors": "^2.0.2", + "postcss-value-parser": "^3.2.3", + "postcss-zindex": "^2.0.1" + } + }, + "csso": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/csso/-/csso-2.3.2.tgz", + "integrity": "sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U=", + "dev": true, + "requires": { + "clap": "^1.0.9", + "source-map": "^0.5.3" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "cssom": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", + "dev": true + }, + "cssstyle": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", + "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "d3": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-5.16.0.tgz", + "integrity": "sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==", + "requires": { + "d3-array": "1", + "d3-axis": "1", + "d3-brush": "1", + "d3-chord": "1", + "d3-collection": "1", + "d3-color": "1", + "d3-contour": "1", + "d3-dispatch": "1", + "d3-drag": "1", + "d3-dsv": "1", + "d3-ease": "1", + "d3-fetch": "1", + "d3-force": "1", + "d3-format": "1", + "d3-geo": "1", + "d3-hierarchy": "1", + "d3-interpolate": "1", + "d3-path": "1", + "d3-polygon": "1", + "d3-quadtree": "1", + "d3-random": "1", + "d3-scale": "2", + "d3-scale-chromatic": "1", + "d3-selection": "1", + "d3-shape": "1", + "d3-time": "1", + "d3-time-format": "2", + "d3-timer": "1", + "d3-transition": "1", + "d3-voronoi": "1", + "d3-zoom": "1" + } + }, + "d3-array": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", + "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" + }, + "d3-axis": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-1.0.12.tgz", + "integrity": "sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==" + }, + "d3-brush": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-1.1.6.tgz", + "integrity": "sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==", + "requires": { + "d3-dispatch": "1", + "d3-drag": "1", + "d3-interpolate": "1", + "d3-selection": "1", + "d3-transition": "1" + } + }, + "d3-chord": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-1.0.6.tgz", + "integrity": "sha512-JXA2Dro1Fxw9rJe33Uv+Ckr5IrAa74TlfDEhE/jfLOaXegMQFQTAgAw9WnZL8+HxVBRXaRGCkrNU7pJeylRIuA==", + "requires": { + "d3-array": "1", + "d3-path": "1" + } + }, + "d3-collection": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/d3-collection/-/d3-collection-1.0.7.tgz", + "integrity": "sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==" + }, + "d3-color": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz", + "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" + }, + "d3-contour": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-1.3.2.tgz", + "integrity": "sha512-hoPp4K/rJCu0ladiH6zmJUEz6+u3lgR+GSm/QdM2BBvDraU39Vr7YdDCicJcxP1z8i9B/2dJLgDC1NcvlF8WCg==", + "requires": { + "d3-array": "^1.1.1" + } + }, + "d3-dispatch": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz", + "integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==" + }, + "d3-drag": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-1.2.5.tgz", + "integrity": "sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==", + "requires": { + "d3-dispatch": "1", + "d3-selection": "1" + } + }, + "d3-dsv": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.2.0.tgz", + "integrity": "sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g==", + "requires": { + "commander": "2", + "iconv-lite": "0.4", + "rw": "1" + } + }, + "d3-ease": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", + "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" + }, + "d3-fetch": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-1.2.0.tgz", + "integrity": "sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==", + "requires": { + "d3-dsv": "1" + } + }, + "d3-force": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-1.2.1.tgz", + "integrity": "sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==", + "requires": { + "d3-collection": "1", + "d3-dispatch": "1", + "d3-quadtree": "1", + "d3-timer": "1" + } + }, + "d3-format": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.5.tgz", + "integrity": "sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==" + }, + "d3-geo": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", + "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", + "requires": { + "d3-array": "1" + } + }, + "d3-hierarchy": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz", + "integrity": "sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==" + }, + "d3-interpolate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", + "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "requires": { + "d3-color": "1" + } + }, + "d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" + }, + "d3-polygon": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-1.0.6.tgz", + "integrity": "sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ==" + }, + "d3-quadtree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-1.0.7.tgz", + "integrity": "sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==" + }, + "d3-random": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-1.1.2.tgz", + "integrity": "sha512-6AK5BNpIFqP+cx/sreKzNjWbwZQCSUatxq+pPRmFIQaWuoD+NrbVWw7YWpHiXpCQ/NanKdtGDuB+VQcZDaEmYQ==" + }, + "d3-scale": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-2.2.2.tgz", + "integrity": "sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw==", + "requires": { + "d3-array": "^1.2.0", + "d3-collection": "1", + "d3-format": "1", + "d3-interpolate": "1", + "d3-time": "1", + "d3-time-format": "2" + } + }, + "d3-scale-chromatic": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-1.5.0.tgz", + "integrity": "sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg==", + "requires": { + "d3-color": "1", + "d3-interpolate": "1" + } + }, + "d3-selection": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" + }, + "d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "requires": { + "d3-path": "1" + } + }, + "d3-time": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-1.1.0.tgz", + "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" + }, + "d3-time-format": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz", + "integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==", + "requires": { + "d3-time": "1" + } + }, + "d3-timer": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" + }, + "d3-transition": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", + "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", + "requires": { + "d3-color": "1", + "d3-dispatch": "1", + "d3-ease": "1", + "d3-interpolate": "1", + "d3-selection": "^1.1.0", + "d3-timer": "1" + } + }, + "d3-voronoi": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/d3-voronoi/-/d3-voronoi-1.1.4.tgz", + "integrity": "sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==" + }, + "d3-zoom": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-1.8.3.tgz", + "integrity": "sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==", + "requires": { + "d3-dispatch": "1", + "d3-drag": "1", + "d3-interpolate": "1", + "d3-selection": "1", + "d3-transition": "1" + } + }, + "dagre": { + "version": "0.8.5", + "resolved": "https://registry.npmmirror.com/dagre/-/dagre-0.8.5.tgz", + "integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==", + "requires": { + "graphlib": "^2.1.8", + "lodash": "^4.17.15" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + } + } + }, + "dagre-d3": { + "version": "0.6.4", + "resolved": "https://registry.npmmirror.com/dagre-d3/-/dagre-d3-0.6.4.tgz", + "integrity": "sha512-e/6jXeCP7/ptlAM48clmX4xTZc5Ek6T6kagS7Oz2HrYSdqcLZFLqpAfh7ldbZRFfxCZVyh61NEPR08UQRVxJzQ==", + "requires": { + "d3": "^5.14", + "dagre": "^0.8.5", + "graphlib": "^2.1.8", + "lodash": "^4.17.15" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.0.1.tgz", + "integrity": "sha512-0HdcMZzK6ubMUnsMmQmG0AcLQPvbvb47R0+7CCZQCYgcd8OUWG91CG7sM6GoXgjz+WLl4ArFzHtBMy/QqSF4eg==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "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" + } + }, + "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 + }, + "deep-extend": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "dev": true + }, + "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 + }, + "default-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-compare/-/default-compare-1.0.0.tgz", + "integrity": "sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==", + "dev": true, + "requires": { + "kind-of": "^5.0.2" + }, + "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 + } + } + }, + "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": { + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "default-resolution": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-resolution/-/default-resolution-2.0.0.tgz", + "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=", + "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" + } + }, + "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" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "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=" + }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "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.0" + } + }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "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 + }, + "diff-match-patch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.0.tgz", + "integrity": "sha1-HMPIOkkNZ/ldkeOfatHy4Ia2MEg=" + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "path-type": "^3.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-converter": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.1.4.tgz", + "integrity": "sha1-pF71cnuJDJv/5tfIduexnLDhfzs=", + "dev": true, + "requires": { + "utila": "~0.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "dom-walk": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz", + "integrity": "sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg=", + "dev": true + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "domhandler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", + "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domino": { + "version": "2.1.6", + "resolved": "https://registry.npmmirror.com/domino/-/domino-2.1.6.tgz", + "integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==" + }, + "domutils": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.6.2.tgz", + "integrity": "sha1-GVjMC0yUJuntNn+xyOhUiRsPo/8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "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" + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexify": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", + "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "each-props": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz", + "integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.1", + "object.defaults": "^1.1.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "editorconfig": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.3.tgz", + "integrity": "sha512-WkjsUNVCu+ITKDj73QDvi0trvpdDWdkDyHybDGSXPfekLCqwmpD7CP7iPbvBgosNuLcI96XTDwNa75JyFl7tEQ==", + "dev": true, + "requires": { + "bluebird": "^3.0.5", + "commander": "^2.9.0", + "lru-cache": "^3.2.0", + "semver": "^5.1.0", + "sigmund": "^1.0.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=", + "dev": true, + "requires": { + "pseudomap": "^1.0.1" + } + } + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "ejs": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz", + "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=", + "dev": true + }, + "electron-releases": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/electron-releases/-/electron-releases-2.1.0.tgz", + "integrity": "sha512-cyKFD1bTE/UgULXfaueIN1k5EPFzs+FRc/rvCY5tIynefAPqopQEgjr0EzY+U3Dqrk/G4m9tXSPuZ77v6dL/Rw==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.30", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.30.tgz", + "integrity": "sha512-zx1Prv7kYLfc4OA60FhxGbSo4qrEjgSzpo1/37i7l9ltXPYOoQBtjQxY9KmsgfHnBxHlBGXwLlsbt/gub1w5lw==", + "dev": true, + "requires": { + "electron-releases": "^2.1.0" + } + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "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 + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "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, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", + "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.2.0", + "tapable": "^0.1.8" + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=" + }, + "entity-decode": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/entity-decode/-/entity-decode-2.0.2.tgz", + "integrity": "sha512-5CCY/3ci4MC1m2jlumNjWd7VBFt4VfFnmSqSNmVcXq4gxM3Vmarxtt+SvmBnzwLS669MWdVuXboNVj1qN2esVg==", + "requires": { + "he": "^1.1.1" + } + }, + "errno": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.6.tgz", + "integrity": "sha512-IsORQDpaaSwcDP4ZZnHxgE85werpo34VYn1Ud3mq+eUsF593faR8oCZNXrROVkpFu2TsbrNhHin0aUrTsQ9vNw==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "error-stack-parser": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.2.tgz", + "integrity": "sha512-E1fPutRDdIj/hohG0UpT5mayXNCxXP9d+snxFsPU9X0XgccOumKraa3juDMwTUyi7+Bu5+mCGagjg4IYeNbOdw==", + "dev": true, + "requires": { + "stackframe": "^1.0.4" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "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": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-promise": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", + "dev": true + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "es6-weak-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.3.tgz", + "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "es6-symbol": "^3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "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, + "optional": true + } + } + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "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.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "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", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", + "table": "4.0.2", + "text-table": "~0.2.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 + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.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" + } + }, + "globals": { + "version": "11.7.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz", + "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==", + "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 + }, + "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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.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==", + "dev": true, + "requires": { + "eslint-restricted-globals": "^0.1.1" + } + }, + "eslint-friendly-formatter": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-friendly-formatter/-/eslint-friendly-formatter-4.0.1.tgz", + "integrity": "sha1-J9UE3IN/fK3b8gGy6EpO5zC6Pvo=", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "coalescy": "1.0.0", + "extend": "^3.0.0", + "minimist": "^1.2.0", + "strip-ansi": "^4.0.0", + "text-table": "^0.2.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 + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "eslint-import-resolver-node": { + "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.5.0" + } + }, + "eslint-import-resolver-webpack": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-webpack/-/eslint-import-resolver-webpack-0.9.0.tgz", + "integrity": "sha1-IxzhV4rVEk2leZ8Cm9M9KBN2I+M=", + "dev": true, + "requires": { + "array-find": "^1.0.0", + "debug": "^2.6.8", + "enhanced-resolve": "~0.9.0", + "find-root": "^1.1.0", + "has": "^1.0.1", + "interpret": "^1.0.0", + "is-absolute": "^0.2.3", + "lodash.get": "^4.4.2", + "node-libs-browser": "^1.0.0 || ^2.0.0", + "resolve": "^1.4.0", + "semver": "^5.3.0" + } + }, + "eslint-loader": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-2.1.0.tgz", + "integrity": "sha512-f4A/Yk7qF+HcFSz5Tck2QoKIwJVHlX0soJk5MkROYahb5uvspad5Ba60rrz4u/V2/MEj1dtp/uBi6LlLWVaY7Q==", + "dev": true, + "requires": { + "loader-fs-cache": "^1.0.0", + "loader-utils": "^1.0.2", + "object-assign": "^4.0.1", + "object-hash": "^1.1.4", + "rimraf": "^2.6.1" + }, + "dependencies": { + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", + "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^1.0.0" + }, + "dependencies": { + "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.0.0" + } + } + } + }, + "eslint-plugin-html": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.5.tgz", + "integrity": "sha512-yULqYldzhYXTwZEaJXM30HhfgJdtTzuVH3LeoANybESHZ5+2ztLD72BsB2wR124/kk/PvQqZofDFSdNIk+kykw==", + "dev": true, + "requires": { + "htmlparser2": "^3.8.2" + } + }, + "eslint-plugin-import": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz", + "integrity": "sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==", + "dev": true, + "requires": { + "contains-path": "^0.1.0", + "debug": "^2.6.8", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.1", + "eslint-module-utils": "^2.2.0", + "has": "^1.0.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.3", + "read-pkg-up": "^2.0.0", + "resolve": "^1.6.0" + }, + "dependencies": { + "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" + } + }, + "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" + } + }, + "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": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^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=", + "dev": true, + "requires": { + "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.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "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=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "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==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "esquery": { + "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.0.0" + } + }, + "esrecurse": { + "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.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "eventsource-polyfill": { + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/eventsource-polyfill/-/eventsource-polyfill-0.9.6.tgz", + "integrity": "sha1-EODRh/ERsWfyj9q5GIQ859gY8Tw=", + "dev": true + }, + "eventtargeter": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/eventtargeter/-/eventtargeter-0.4.0.tgz", + "integrity": "sha512-SAMC9heSSwhL2rxYF+iM0zFCQsXx3QKb3H5r5vcsYzKQVNb/jdVQ3VWxC2jpzWA3ecrLAzXVzoT7WB4D1yN59w==" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exec-sh": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", + "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", + "dev": true, + "requires": { + "merge": "^1.2.0" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.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" + }, + "dependencies": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + } + } + }, + "execall": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execall/-/execall-1.0.0.tgz", + "integrity": "sha1-c9CQTjlbPKsGWLCNCewlMH8pu3M=", + "dev": true, + "requires": { + "clone-regexp": "^1.0.0" + } + }, + "exif-parser": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", + "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "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" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "express": { + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.3", + "qs": "6.5.1", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "dev": true, + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "dev": true, + "requires": { + "mime-db": "~1.35.0" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.18" + } + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "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" + } + }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "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" + }, + "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 + } + } + }, + "extract-text-webpack-plugin": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-2.1.2.tgz", + "integrity": "sha1-dW7076gVXDaBgz+8NNpTuUF0bWw=", + "dev": true, + "requires": { + "async": "^2.1.2", + "loader-utils": "^1.0.2", + "schema-utils": "^0.3.0", + "webpack-sources": "^1.0.1" + }, + "dependencies": { + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "^4.14.0" + } + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "extract-zip": { + "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.2", + "debug": "2.6.9", + "mkdirp": "0.5.1", + "yauzl": "2.4.1" + }, + "dependencies": { + "concat-stream": { + "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": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fancy-log": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", + "dev": true, + "requires": { + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", + "time-stamp": "^1.0.0" + } + }, + "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=" + }, + "fast-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", + "integrity": "sha512-TR6zxCKftDQnUAPvkrCWdBgDq/gbqx8A3ApnBrR5rMvpp6+KMJI0Igw7fkWPgeVK0uhRXTXdvO3O+YP0CaUX2g==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.0.1", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.1", + "micromatch": "^3.1.10" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "glob-parent": { + "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": "^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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + }, + "micromatch": { + "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" + } + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "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" + } + }, + "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" + }, + "dependencies": { + "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": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + } + } + } + } + }, + "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", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastparse": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.1.tgz", + "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=", + "dev": true + }, + "favicons": { + "version": "4.8.6", + "resolved": "https://registry.npmjs.org/favicons/-/favicons-4.8.6.tgz", + "integrity": "sha1-orE4AKs/7CcVvI8n+oQdA41HYeI=", + "dev": true, + "requires": { + "async": "^1.5.0", + "cheerio": "^0.19.0", + "clone": "^1.0.2", + "colors": "^1.1.2", + "harmony-reflect": "^1.4.2", + "image-size": "^0.4.0", + "jimp": "^0.2.13", + "jsontoxml": "0.0.11", + "merge-defaults": "^0.2.1", + "mkdirp": "^0.5.1", + "node-rest-client": "^1.5.1", + "require-directory": "^2.1.1", + "svg2png": "~3.0.1", + "through2": "^2.0.0", + "tinycolor2": "^1.1.2", + "to-ico": "^1.1.2", + "underscore": "^1.8.3", + "vinyl": "^1.1.0" + } + }, + "favicons-webpack-plugin": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/favicons-webpack-plugin/-/favicons-webpack-plugin-0.0.9.tgz", + "integrity": "sha1-32PoDFVrgE5JJeyOBb7jY5FXPck=", + "dev": true, + "requires": { + "favicons": "^4.8.3", + "loader-utils": "^0.2.14", + "lodash": "^4.11.1" + } + }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "^2.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" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "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=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "file-loader": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", + "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", + "dev": true, + "requires": { + "loader-utils": "^1.0.2", + "schema-utils": "^0.4.5" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "fast-deep-equal": { + "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 + }, + "json-schema-traverse": { + "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 + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "file-saver": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-1.3.8.tgz", + "integrity": "sha512-spKHSBQIxxS81N/O21WmuXA2F6wppUCsutpzenOeZzOCCJ5gEfcbqJP983IrpLXzYmXnMUa6J03SubcNPdKrlg==" + }, + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "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" + } + }, + "filesize": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", + "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", + "dev": true + }, + "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" + }, + "dependencies": { + "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 + }, + "randomatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.0.tgz", + "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + } + } + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + } + }, + "find-babel-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.1.0.tgz", + "integrity": "sha1-rMAQQ6Z0n+w0Qpvmtk9ULrtdY1U=", + "dev": true, + "requires": { + "json5": "^0.5.1", + "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 + } + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "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" + } + } + } + }, + "fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + } + }, + "flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "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=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, + "flatten": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", + "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", + "dev": true + }, + "flush-write-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", + "integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "follow-redirects": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.5.tgz", + "integrity": "sha512-GHjtHDlY/ehslqv0Gr5N0PUJppgg/q0rOBvX0na1s7y1A3LWxPqCYU76s3Z1bM4+UZB4QF0usaXLT5wFpof5PA==", + "dev": true, + "requires": { + "debug": "^3.1.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" + } + } + } + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "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": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "friendly-errors-webpack-plugin": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.0.tgz", + "integrity": "sha512-K27M3VK30wVoOarP651zDmb93R9zF28usW4ocaK3mfQeIEI5BPht/EzZs5E8QLLwbLRJQMwscAjDxYPb1FuNiw==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "error-stack-parser": "^2.0.0", + "string-width": "^2.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 + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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" + } + } + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-extra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz", + "integrity": "sha1-zTzl9+fLYUWIP8rjGR6Yd/hYeVA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0" + } + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "requires": { + "minipass": "^2.2.1" + } + }, + "fs-mkdirp-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", + "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.3.0", + "node-pre-gyp": "^0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "optional": true, + "requires": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "integrity": "sha1-ldNgDwdxCqDpKYxyatXs8urLq6s=", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true, + "optional": true + }, + "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, + "optional": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "optional": true, + "requires": { + "inherits": "~2.0.0" + } + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "optional": true, + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", + "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", + "dev": true, + "optional": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "optional": 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, + "optional": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "optional": true, + "requires": { + "boom": "2.x.x" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true, + "optional": 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, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.2.tgz", + "integrity": "sha1-ca1dIEvxempsqPRQxhRUBm70YeE=", + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", + "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", + "dev": true, + "optional": 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, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "optional": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "optional": true + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "dev": true, + "optional": true, + "requires": { + "fstream": "^1.0.0", + "inherits": "2", + "minimatch": "^3.0.0" + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "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" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "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" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true, + "optional": true + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "optional": true, + "requires": { + "ajv": "^4.9.1", + "har-schema": "^1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "optional": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true, + "optional": true + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true, + "optional": 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, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "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, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", + "integrity": "sha1-BtSRIlUJNBlHfUJWM2BuDpB4KWc=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true, + "optional": 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, + "optional": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "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, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", + "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", + "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=", + "dev": true, + "optional": true + }, + "mime-types": { + "version": "2.1.15", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", + "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", + "dev": true, + "optional": true, + "requires": { + "mime-db": "~1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "optional": true, + "requires": { + "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=", + "dev": true, + "optional": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz", + "integrity": "sha512-OsJV74qxnvz/AMGgcfZoDaeDXKD3oY3QVIbBmwszTFkRisTSXbMQyn4UWzUMOtA5SVhrBZOTp0wcoSBgfMfMmQ==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "hawk": "3.1.3", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "request": "2.81.0", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^2.2.1", + "tar-pack": "^3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.0.tgz", + "integrity": "sha512-ocolIkZYZt8UveuiDS0yAkkIjid1o7lPG8cYm05yNYzBn8ykQtaiPMEGp8fY9tKdDgm8okpdKzkvu1y9hUYugA==", + "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", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "optional": 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, + "optional": 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, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "optional": true + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true, + "optional": 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=", + "dev": true, + "optional": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", + "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "~0.4.0", + "ini": "~1.3.0", + "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, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.9.tgz", + "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", + "dev": true, + "optional": true, + "requires": { + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + } + }, + "rimraf": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz", + "integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=", + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": 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, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "optional": true, + "requires": { + "hoek": "2.x.x" + } + }, + "sshpk": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.0.tgz", + "integrity": "sha1-/yo+T9BEl1Vf7Zezmg/YL6+zozw=", + "dev": true, + "optional": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "optional": 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, + "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.0.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz", + "integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true, + "optional": 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, + "optional": true, + "requires": { + "ansi-regex": "^2.0.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, + "optional": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "optional": true, + "requires": { + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" + } + }, + "tar-pack": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.0.tgz", + "integrity": "sha1-I74tf2cagzk3bL2wuP4/3r8xeYQ=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.2.0", + "fstream": "^1.0.10", + "fstream-ignore": "^1.0.5", + "once": "^1.3.3", + "readable-stream": "^2.1.4", + "rimraf": "^2.5.1", + "tar": "^2.2.1", + "uid-number": "^0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", + "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "dev": true, + "optional": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "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 + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "uuid": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=", + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", + "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "optional": true + } + } + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "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" + } + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.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=", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "dependencies": { + "has": { + "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" + } + } + } + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.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=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "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" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.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" + } + } + } + }, + "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" + }, + "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" + } + } + } + }, + "glob-stream": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz", + "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", + "dev": true, + "requires": { + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" + }, + "dependencies": { + "glob-parent": { + "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": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "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 + }, + "glob-watcher": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-5.0.5.tgz", + "integrity": "sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-done": "^1.2.0", + "chokidar": "^2.0.0", + "is-negated-glob": "^1.0.0", + "just-debounce": "^1.0.0", + "normalize-path": "^3.0.0", + "object.defaults": "^1.1.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "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" + } + } + } + }, + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "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.1" + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "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": "^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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "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" + } + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "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 + }, + "readdirp": { + "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", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + } + } + }, + "global": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz", + "integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=", + "dev": true, + "requires": { + "min-document": "^2.19.0", + "process": "~0.5.1" + }, + "dependencies": { + "process": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz", + "integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=", + "dev": true + } + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + } + }, + "globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=", + "dev": true + }, + "globule": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", + "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", + "dev": true, + "requires": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + } + }, + "glogg": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", + "dev": true, + "requires": { + "sparkles": "^1.0.0" + } + }, + "gonzales-pe": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.3.tgz", + "integrity": "sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw==", + "dev": true, + "requires": { + "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 + } + } + }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "requires": { + "delegate": "^3.1.2" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmmirror.com/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "requires": { + "lodash": "^4.17.15" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + } + } + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "gulp": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz", + "integrity": "sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA==", + "dev": true, + "requires": { + "glob-watcher": "^5.0.3", + "gulp-cli": "^2.2.0", + "undertaker": "^1.2.1", + "vinyl-fs": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "gulp-cli": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/gulp-cli/-/gulp-cli-2.3.0.tgz", + "integrity": "sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A==", + "dev": true, + "requires": { + "ansi-colors": "^1.0.1", + "archy": "^1.0.0", + "array-sort": "^1.0.0", + "color-support": "^1.1.3", + "concat-stream": "^1.6.0", + "copy-props": "^2.0.1", + "fancy-log": "^1.3.2", + "gulplog": "^1.0.0", + "interpret": "^1.4.0", + "isobject": "^3.0.1", + "liftoff": "^3.1.0", + "matchdep": "^2.0.0", + "mute-stdout": "^1.0.0", + "pretty-hrtime": "^1.0.0", + "replace-homedir": "^1.0.0", + "semver-greatest-satisfied-range": "^1.1.0", + "v8flags": "^3.2.0", + "yargs": "^7.1.0" + } + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "yargs": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.1.tgz", + "integrity": "sha512-huO4Fr1f9PmiJJdll5kwoS2e4GqzGSsMT3PPMpOwoVkOK8ckqAewMTZyA6LXVQWflleb/Z8oPBEvNsMft0XE+g==", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "5.0.0-security.0" + } + }, + "yargs-parser": { + "version": "5.0.0-security.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0-security.0.tgz", + "integrity": "sha512-T69y4Ps64LNesYxeYGYPvfoMTt/7y1XtfpIslUeK4um+9Hu7hlGoRtaDLvdXb7+/tfq4opVa2HRY5xGip022rQ==", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "object.assign": "^4.1.0" + } + } + } + }, + "gulp-concat": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", + "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", + "dev": true, + "requires": { + "concat-with-sourcemaps": "^1.0.0", + "through2": "^2.0.0", + "vinyl": "^2.0.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "^1.0.0" + } + }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", + "integrity": "sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA==", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.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 + } + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "harmony-reflect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.0.tgz", + "integrity": "sha512-0kZ1XcoelFOLEjEtvWAZyq/1S55eDSieWEJwme311MNVNcRpvjlr2zA66kBV6WAB8C1XI1p1cXCnFPqd1BxlPg==", + "dev": true + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "^1.0.2" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, + "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": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "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": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "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.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" + } + } + } + }, + "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" + } + } + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "^2.0.1" + } + }, + "hash-sum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz", + "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=", + "dev": true + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "hasha": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-2.2.0.tgz", + "integrity": "sha1-eNfL/B5tZjA/55g3NlmEUXsvbuE=", + "dev": true, + "requires": { + "is-stream": "^1.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hoopy": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", + "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==", + "dev": true + }, + "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==", + "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=", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "html-entities": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", + "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=", + "dev": true + }, + "html-minifier": { + "version": "3.5.20", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.20.tgz", + "integrity": "sha512-ZmgNLaTp54+HFKkONyLFEfs5dd/ZOtlquKaTnqIWFmx3Av5zG6ZPcV2d0o9XM2fXOTxxIf6eDcwzFFotke/5zA==", + "dev": true, + "requires": { + "camel-case": "3.0.x", + "clean-css": "4.2.x", + "commander": "2.17.x", + "he": "1.1.x", + "param-case": "2.1.x", + "relateurl": "0.2.x", + "uglify-js": "3.4.x" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "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 + }, + "uglify-js": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.7.tgz", + "integrity": "sha512-J0M2i1mQA+ze3EdN9SBi751DNdAXmeFLfJrd/MDIkRc3G3Gbb9OPVSx7GIQvVwfWxQARcYV2DTxIkMyDAk3o9Q==", + "dev": true, + "requires": { + "commander": "~2.16.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz", + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "dev": true + } + } + } + } + }, + "html-tags": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz", + "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=", + "dev": true + }, + "html-webpack-plugin": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz", + "integrity": "sha1-sBq71yOsqqeze2r0SS69oD2d03s=", + "dev": true, + "requires": { + "html-minifier": "^3.2.3", + "loader-utils": "^0.2.16", + "lodash": "^4.17.3", + "pretty-error": "^2.0.2", + "tapable": "^1.0.0", + "toposort": "^1.0.0", + "util.promisify": "1.0.0" + }, + "dependencies": { + "tapable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==", + "dev": true + } + } + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "^1.3.0", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" + } + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + } + } + }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "dev": true, + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", + "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==", + "dev": true, + "requires": { + "http-proxy": "^1.16.2", + "is-glob": "^4.0.0", + "lodash": "^4.17.5", + "micromatch": "^3.1.9" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "micromatch": { + "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" + } + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "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" + } + }, + "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" + }, + "dependencies": { + "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": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + } + } + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "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==" + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", + "dev": true + }, + "icss-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", + "dev": true, + "requires": { + "postcss": "^6.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "identity-obj-proxy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", + "integrity": "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=", + "dev": true, + "requires": { + "harmony-reflect": "^1.4.6" + } + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "ignore-loader": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ignore-loader/-/ignore-loader-0.1.2.tgz", + "integrity": "sha1-2B8kA3bQuk8Nd4lyw60lh0EXpGM=", + "dev": true + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "requires": { + "minimatch": "^3.0.4" + } + }, + "image-size": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.4.0.tgz", + "integrity": "sha1-1LTh9hlS5MvBzqmmsMkV/stwdRA=", + "dev": true + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "import-lazy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-3.1.0.tgz", + "integrity": "sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ==", + "dev": true + }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "in-publish": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", + "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", + "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.0" + } + }, + "indexeddbshim": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/indexeddbshim/-/indexeddbshim-3.8.0.tgz", + "integrity": "sha512-DnQii9KFogcj2U/ai805/k7OTCAksWCtXV3MpATNXG84L9/+Xou9mTIXmBCmQa1X2ZdXXS229c1NWmztSRwPWw==", + "requires": { + "babel-polyfill": "6.26.0", + "eventtargeter": "0.4.0", + "sync-promise": "git+https://github.com/brettz9/sync-promise.git#full-sync-missing-promise-features", + "typeson": "5.8.2", + "typeson-registry": "1.0.0-alpha.20", + "websql": "git+https://github.com/brettz9/node-websql.git#configurable-secure2" + }, + "dependencies": { + "sync-promise": { + "version": "git+https://github.com/brettz9/sync-promise.git#25845a49a00aa2d2c985a5149b97c86a1fcdc75a", + "from": "git+https://github.com/brettz9/sync-promise.git#full-sync-missing-promise-features" + }, + "websql": { + "version": "git+https://github.com/brettz9/node-websql.git#5149bc0763376ca757fc32dc74345ada0467bfbb", + "from": "git+https://github.com/brettz9/node-websql.git#configurable-secure2", + "requires": { + "argsarray": "^0.0.1", + "immediate": "^3.2.2", + "noop-fn": "^1.0.0", + "sqlite3": "^4.0.0", + "tiny-queue": "^0.2.1" + } + } + } + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "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=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "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.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.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.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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "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 + }, + "ip-regex": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz", + "integrity": "sha1-3FiQdvZZ9BnCIgOaMzFvHHOH7/0=", + "dev": true + }, + "ipaddr.js": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", + "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", + "dev": true + }, + "is-absolute": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", + "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "dev": true, + "requires": { + "is-relative": "^0.2.1", + "is-windows": "^0.2.0" + }, + "dependencies": { + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "dev": true + } + } + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "dev": true + }, + "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" + }, + "dependencies": { + "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 + } + } + }, + "is-alphabetical": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.2.tgz", + "integrity": "sha512-V0xN4BYezDHcBSKb1QHUFMlR4as/XEuCZBzMJUU4n7+Cbt33SmUnSol+pnXFvLxSHNq2CemUXNdaXV6Flg7+xg==", + "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.2", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz", + "integrity": "sha512-pyfU/0kHdISIgslFfZN9nfY1Gk3MquQgUm1mJTjdkEPpkAKNWuBTSqFwewOpR7N351VkErCiyV71zX7mlQQqsg==", + "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", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "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=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "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": "1.2.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.0.tgz", + "integrity": "sha512-plgvKjQtalH2P3Gytb7L61Lmz95g2DlpzFiQyRSFew8WoJKxtKRzrZMeyRN2supblm3Psc8OQGy7Xjb6XG11jw==", + "dev": true, + "requires": { + "ci-info": "^1.3.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" + }, + "dependencies": { + "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 + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-decimal": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.2.tgz", + "integrity": "sha512-TRzl7mOCchnhchN+f3ICUCzYvL9ul7R+TYOsZ8xia++knyZAJfv/uA1FvQXsAnYIl1T3B2X5E/J7Wb1QXiIBXg==", + "dev": true + }, + "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" + }, + "dependencies": { + "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 + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "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": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "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=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "dev": true + }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "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": "^2.1.1" + } + }, + "is-hexadecimal": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz", + "integrity": "sha512-but/G3sapV3MNyqiDBLrOi4x8uCIw0RY3o/Vb5GT0sMFHrVV7731wFSVy41T5FO1og7G0gXLJh0MkgPRouko/A==", + "dev": true + }, + "is-negated-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz", + "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=", + "dev": true + }, + "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" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "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": { + "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.1" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "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" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "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" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "dev": true, + "requires": { + "is-unc-path": "^0.1.1" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-supported-regexp-flag": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-supported-regexp-flag/-/is-supported-regexp-flag-1.0.1.tgz", + "integrity": "sha512-3vcJecUUrpgCqc/ca0aWeNu64UGgxcvO60K/Fkr1N6RSvfGCTU60UKN68JDmKokgba0rFFJs12EnzOQa14ubKQ==", + "dev": true + }, + "is-svg": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz", + "integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=", + "dev": true, + "requires": { + "html-comment-regex": "^1.1.0" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "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-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.0" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz", + "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=", + "dev": true + }, + "is-whitespace": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-whitespace/-/is-whitespace-0.3.0.tgz", + "integrity": "sha1-Fjnssb4DauxppUy7QBz77XEUq38=", + "dev": true + }, + "is-whitespace-character": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz", + "integrity": "sha512-SzM+T5GKUCtLhlHFKt2SDAX2RFzfS6joT91F2/WSi9LxgFdsnhfPK/UIA+JhRR2xuyLdrCys2PiFDrtn1fU5hQ==", + "dev": true + }, + "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-word-character": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.2.tgz", + "integrity": "sha512-T3FlsX8rCHAH8e7RE7PfOPZVFQlcV3XRF9eOOBQ1uf70OxO7CjjSOjeImMPCADBdYWcStAbVbYvJ1m2D3tb+EA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "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" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul-api": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz", + "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==", + "dev": true, + "requires": { + "async": "^2.1.4", + "compare-versions": "^3.1.0", + "fileset": "^2.0.2", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-hook": "^1.2.0", + "istanbul-lib-instrument": "^1.10.1", + "istanbul-lib-report": "^1.1.4", + "istanbul-lib-source-maps": "^1.2.4", + "istanbul-reports": "^1.3.0", + "js-yaml": "^3.7.0", + "mkdirp": "^0.5.1", + "once": "^1.4.0" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + } + } + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz", + "integrity": "sha512-eLAMkPG9FU0v5L02lIkcj/2/Zlz9OuluaXikdr5iStk8FDbSwAixTK9TkYxbF0eNnzAJTwM2fkV2A1tpsIp4Jg==", + "dev": true, + "requires": { + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", + "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.1", + "semver": "^5.3.0" + }, + "dependencies": { + "istanbul-lib-coverage": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", + "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz", + "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", + "integrity": "sha512-8O2T/3VhrQHn0XcJbP1/GN7kXMiRAlPi+fj3uEHrjBD8Oz7Py0prSC25C09NuAZS6bgW1NNKAvCSHZXB0irSGA==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.0", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + }, + "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" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz", + "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==", + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "jest": { + "version": "23.5.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-23.5.0.tgz", + "integrity": "sha512-+X3Fk4rD8dTnHoIxHJymZthbtYllvSOnXAApQltvyLkHsv+fqyC/SZptUJDbXkFsqZJyyIXMySkdzerz3fv4oQ==", + "dev": true, + "requires": { + "import-local": "^1.0.0", + "jest-cli": "^23.5.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 + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "babel-jest": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", + "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", + "dev": true, + "requires": { + "babel-plugin-istanbul": "^4.1.6", + "babel-preset-jest": "^23.2.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz", + "integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=", + "dev": true + }, + "babel-preset-jest": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz", + "integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^23.2.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "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": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "expect": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-23.6.0.tgz", + "integrity": "sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "jest-diff": "^23.6.0", + "jest-get-type": "^22.1.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0" + } + }, + "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" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "invariant": { + "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.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "jest-cli": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.6.0.tgz", + "integrity": "sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "import-local": "^1.0.0", + "is-ci": "^1.0.10", + "istanbul-api": "^1.3.1", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-instrument": "^1.10.1", + "istanbul-lib-source-maps": "^1.2.4", + "jest-changed-files": "^23.4.2", + "jest-config": "^23.6.0", + "jest-environment-jsdom": "^23.4.0", + "jest-get-type": "^22.1.0", + "jest-haste-map": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0", + "jest-resolve-dependencies": "^23.6.0", + "jest-runner": "^23.6.0", + "jest-runtime": "^23.6.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "jest-watcher": "^23.4.0", + "jest-worker": "^23.2.0", + "micromatch": "^2.3.11", + "node-notifier": "^5.2.1", + "prompts": "^0.1.9", + "realpath-native": "^1.0.0", + "rimraf": "^2.5.4", + "slash": "^1.0.0", + "string-length": "^2.0.0", + "strip-ansi": "^4.0.0", + "which": "^1.2.12", + "yargs": "^11.0.0" + }, + "dependencies": { + "jest-config": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.6.0.tgz", + "integrity": "sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-jest": "^23.6.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^23.4.0", + "jest-environment-node": "^23.4.0", + "jest-get-type": "^22.1.0", + "jest-jasmine2": "^23.6.0", + "jest-regex-util": "^23.3.0", + "jest-resolve": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "micromatch": "^2.3.11", + "pretty-format": "^23.6.0" + } + }, + "jest-haste-map": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.6.0.tgz", + "integrity": "sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg==", + "dev": true, + "requires": { + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.1.11", + "invariant": "^2.2.4", + "jest-docblock": "^23.2.0", + "jest-serializer": "^23.0.1", + "jest-worker": "^23.2.0", + "micromatch": "^2.3.11", + "sane": "^2.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz", + "integrity": "sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA==", + "dev": true, + "requires": { + "jest-regex-util": "^23.3.0", + "jest-snapshot": "^23.6.0" + } + }, + "jest-runner": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.6.0.tgz", + "integrity": "sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA==", + "dev": true, + "requires": { + "exit": "^0.1.2", + "graceful-fs": "^4.1.11", + "jest-config": "^23.6.0", + "jest-docblock": "^23.2.0", + "jest-haste-map": "^23.6.0", + "jest-jasmine2": "^23.6.0", + "jest-leak-detector": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-runtime": "^23.6.0", + "jest-util": "^23.4.0", + "jest-worker": "^23.2.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + } + }, + "jest-runtime": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.6.0.tgz", + "integrity": "sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-plugin-istanbul": "^4.1.6", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "exit": "^0.1.2", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.11", + "jest-config": "^23.6.0", + "jest-haste-map": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0", + "jest-resolve": "^23.6.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "micromatch": "^2.3.11", + "realpath-native": "^1.0.0", + "slash": "^1.0.0", + "strip-bom": "3.0.0", + "write-file-atomic": "^2.1.0", + "yargs": "^11.0.0" + } + }, + "jest-snapshot": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz", + "integrity": "sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg==", + "dev": true, + "requires": { + "babel-types": "^6.0.0", + "chalk": "^2.0.1", + "jest-diff": "^23.6.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-resolve": "^23.6.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^23.6.0", + "semver": "^5.5.0" + } + }, + "jest-validate": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.6.0.tgz", + "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^23.6.0" + } + } + } + }, + "jest-diff": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.6.0.tgz", + "integrity": "sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "diff": "^3.2.0", + "jest-get-type": "^22.1.0", + "pretty-format": "^23.6.0" + } + }, + "jest-each": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.6.0.tgz", + "integrity": "sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "pretty-format": "^23.6.0" + } + }, + "jest-jasmine2": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz", + "integrity": "sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ==", + "dev": true, + "requires": { + "babel-traverse": "^6.0.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^23.6.0", + "is-generator-fn": "^1.0.0", + "jest-diff": "^23.6.0", + "jest-each": "^23.6.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "pretty-format": "^23.6.0" + }, + "dependencies": { + "jest-snapshot": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz", + "integrity": "sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg==", + "dev": true, + "requires": { + "babel-types": "^6.0.0", + "chalk": "^2.0.1", + "jest-diff": "^23.6.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-resolve": "^23.6.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^23.6.0", + "semver": "^5.5.0" + } + } + } + }, + "jest-leak-detector": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz", + "integrity": "sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg==", + "dev": true, + "requires": { + "pretty-format": "^23.6.0" + } + }, + "jest-matcher-utils": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz", + "integrity": "sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "pretty-format": "^23.6.0" + } + }, + "jest-resolve": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.6.0.tgz", + "integrity": "sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA==", + "dev": true, + "requires": { + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "realpath-native": "^1.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "pretty-format": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.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 + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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" + } + }, + "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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.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", + "yargs-parser": "^9.0.2" + } + } + } + }, + "jest-changed-files": { + "version": "23.4.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-23.4.2.tgz", + "integrity": "sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA==", + "dev": true, + "requires": { + "throat": "^4.0.0" + } + }, + "jest-docblock": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-23.2.0.tgz", + "integrity": "sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c=", + "dev": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-environment-jsdom": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz", + "integrity": "sha1-BWp5UrP+pROsYqFAosNox52eYCM=", + "dev": true, + "requires": { + "jest-mock": "^23.2.0", + "jest-util": "^23.4.0", + "jsdom": "^11.5.1" + } + }, + "jest-environment-node": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-23.4.0.tgz", + "integrity": "sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA=", + "dev": true, + "requires": { + "jest-mock": "^23.2.0", + "jest-util": "^23.4.0" + } + }, + "jest-get-type": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "dev": true + }, + "jest-message-util": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.4.0.tgz", + "integrity": "sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0-beta.35", + "chalk": "^2.0.1", + "micromatch": "^2.3.11", + "slash": "^1.0.0", + "stack-utils": "^1.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-mock": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-23.2.0.tgz", + "integrity": "sha1-rRxg8p6HGdR8JuETgJi20YsmETQ=", + "dev": true + }, + "jest-raw-loader": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/jest-raw-loader/-/jest-raw-loader-1.0.1.tgz", + "integrity": "sha1-zp9W1UZQ8VfEp9FtIkul1hO81iY=", + "dev": true + }, + "jest-regex-util": { + "version": "23.3.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-23.3.0.tgz", + "integrity": "sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U=", + "dev": true + }, + "jest-serializer": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-23.0.1.tgz", + "integrity": "sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU=", + "dev": true + }, + "jest-serializer-vue": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/jest-serializer-vue/-/jest-serializer-vue-0.3.0.tgz", + "integrity": "sha512-Id1x3XabYu2r6BnmTfGk2tY172BEqR+vAzSvPk4VF8HyVqwebxZQbqiZ/giAtCnRSqi6lzxuyvzQbwQ6bo6Hbg==", + "dev": true, + "requires": { + "pretty": "2.0.0" + } + }, + "jest-util": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-23.4.0.tgz", + "integrity": "sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE=", + "dev": true, + "requires": { + "callsites": "^2.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.11", + "is-ci": "^1.0.10", + "jest-message-util": "^23.4.0", + "mkdirp": "^0.5.1", + "slash": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-watcher": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-23.4.0.tgz", + "integrity": "sha1-0uKM50+NrWxq/JIrksq+9u0FyRw=", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "string-length": "^2.0.0" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-worker": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.2.0.tgz", + "integrity": "sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk=", + "dev": true, + "requires": { + "merge-stream": "^1.0.1" + } + }, + "jimp": { + "version": "0.2.28", + "resolved": "https://registry.npmjs.org/jimp/-/jimp-0.2.28.tgz", + "integrity": "sha1-3VKak3GQ9ClXp5N9Gsw6d2KZbqI=", + "dev": true, + "requires": { + "bignumber.js": "^2.1.0", + "bmp-js": "0.0.3", + "es6-promise": "^3.0.2", + "exif-parser": "^0.1.9", + "file-type": "^3.1.0", + "jpeg-js": "^0.2.0", + "load-bmfont": "^1.2.3", + "mime": "^1.3.4", + "mkdirp": "0.5.1", + "pixelmatch": "^4.0.0", + "pngjs": "^3.0.0", + "read-chunk": "^1.0.1", + "request": "^2.65.0", + "stream-to-buffer": "^0.1.0", + "tinycolor2": "^1.1.2", + "url-regex": "^3.0.0" + } + }, + "jpeg-js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.2.0.tgz", + "integrity": "sha1-U+RI7J0mPmgyZkZ+lELSxaLvVII=", + "dev": true + }, + "js-base64": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", + "integrity": "sha512-Wehd+7Pf9tFvGb+ydPm9TjYjV8X1YHOVyG8QyELZxEMqOhemVwGRmoG8iQ/soqI3n8v4xn59zaLxiCJiaaRzKA==", + "dev": true + }, + "js-beautify": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.7.5.tgz", + "integrity": "sha512-9OhfAqGOrD7hoQBLJMTA+BKuKmoEtTJXzZ7WDF/9gvjtey1koVLuZqIY6c51aPDjbNdNtIXAkiWKVhziawE9Og==", + "dev": true, + "requires": { + "config-chain": "~1.1.5", + "editorconfig": "^0.13.2", + "mkdirp": "~0.5.0", + "nopt": "~3.0.1" + } + }, + "js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==", + "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=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "requires": { + "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=", + "optional": true + }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-loader": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", + "dev": true + }, + "json-parse-better-errors": { + "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": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "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=" + }, + "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=" + }, + "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=", + "dev": true, + "requires": { + "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 + }, + "jsontoxml": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/jsontoxml/-/jsontoxml-0.0.11.tgz", + "integrity": "sha1-Nzq1sgcL43N6X7PjL9G3uBhwyqQ=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "just-debounce": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.1.0.tgz", + "integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==", + "dev": true + }, + "katex": { + "version": "0.16.2", + "resolved": "https://registry.npmmirror.com/katex/-/katex-0.16.2.tgz", + "integrity": "sha512-70DJdQAyh9EMsthw3AaQlDyFf54X7nWEUIa5W+rq8XOpEk//w5Th7/8SqFqpvi/KZ2t6MHUj4f9wLmztBmAYQA==", + "requires": { + "commander": "^8.0.0" + }, + "dependencies": { + "commander": { + "version": "8.3.0", + "resolved": "https://registry.npmmirror.com/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==" + } + } + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true + }, + "khroma": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/khroma/-/khroma-1.3.0.tgz", + "integrity": "sha512-fpi0vIulP3FrM3BQOsEs+0ujWUNrg/YyHtEAcnvPxIHbASHNXEKEsDHtU2mADnJss7KvEdz7z2pUCQAEfFaFbA==" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "kleur": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.1.tgz", + "integrity": "sha512-Zq/jyANIJ2uX8UZjWlqLwbyhcxSXJtT/Y89lClyeZd3l++3ztL1I5SSCYrbcbwSunTjC88N3WuMk0kRDQD6gzA==", + "dev": true + }, + "known-css-properties": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.6.1.tgz", + "integrity": "sha512-nQRpMcHm1cQ6gmztdvLcIvxocznSMqH/y6XtERrWrHaymOYdDGroRqetJvJycxGEr1aakXiigDgn7JnzuXlk6A==", + "dev": true + }, + "last-run": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/last-run/-/last-run-1.1.1.tgz", + "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", + "dev": true, + "requires": { + "default-resolution": "^2.0.0", + "es6-weak-map": "^2.0.1" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lead": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz", + "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", + "dev": true, + "requires": { + "flush-write-stream": "^1.0.2" + } + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "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": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "liftoff": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", + "integrity": "sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog==", + "dev": true, + "requires": { + "extend": "^3.0.0", + "findup-sync": "^3.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" + } + }, + "linkify-it": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", + "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "load-bmfont": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.3.1.tgz", + "integrity": "sha512-lQkEawgez06lM2iw1vQEEOtVLJXyMzFcUqbwWMrB0g6zwhdUs/+e0KNd1zEJ7OFBbMVz0tbzQyjgjtTB47+PBg==", + "dev": true, + "requires": { + "buffer-equal": "0.0.1", + "mime": "^1.3.4", + "parse-bmfont-ascii": "^1.0.3", + "parse-bmfont-binary": "^1.0.5", + "parse-bmfont-xml": "^1.1.4", + "xhr": "^2.0.1", + "xtend": "^4.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=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "loader-fs-cache": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz", + "integrity": "sha1-VuC/CL2XCLJqdltoUJhAyN7J/bw=", + "dev": true, + "requires": { + "find-cache-dir": "^0.1.1", + "mkdirp": "0.5.1" + }, + "dependencies": { + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "mkdirp": "^0.5.1", + "pkg-dir": "^1.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.0.0" + } + } + } + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", + "dev": true + }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0", + "object-assign": "^4.0.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "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 + } + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "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": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "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=", + "dev": true, + "requires": { + "chalk": "^1.0.0" + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "longest-streak": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.2.tgz", + "integrity": "sha512-TmYTeEYxiAmSVdpbnQDXGtvYOIRsCMg89CVZzwzc2o7GFL1CjoiRPjH5ec0NFAVlAx3fVof9dX/t6KKRAo2OWA==", + "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=", + "dev": true, + "requires": { + "js-tokens": "^3.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" + }, + "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==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "macaddress": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.9.tgz", + "integrity": "sha512-k4F1JUof6cQXxNFzx3thLby4oJzXTXQueAOOts944Vqizn+Rjc2QNFenT9FJSLU1CH3PmrHRSyZs2E+Cqw+P2w==", + "dev": true + }, + "make-dir": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "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=", + "dev": true + }, + "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.2", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.2.tgz", + "integrity": "sha512-lbRZ2mE3Q9RtLjxZBZ9+IMl68DKIXaVAhwvwn9pmjnPLS0h/6kyBMgNhqi1xFJ/2yv6cSyv0jbiZavZv93JkkA==", + "dev": true + }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-abbr": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz", + "integrity": "sha1-1mtTZFIcuz3Yqlna37ovtoZcj9g=" + }, + "markdown-it-deflist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/markdown-it-deflist/-/markdown-it-deflist-2.0.3.tgz", + "integrity": "sha512-/BNZ8ksW42bflm1qQLnRI09oqU2847Z7MVavrR0MORyKLtiUYOMpwtlAfMSZAQU9UCvaUZMpgVAqoS3vpToJxw==" + }, + "markdown-it-emoji": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz", + "integrity": "sha1-m+4OmpkKljupbfaYDE/dsF37Tcw=" + }, + "markdown-it-footnote": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-footnote/-/markdown-it-footnote-3.0.1.tgz", + "integrity": "sha1-fzcwdHysyG4v4L+KF6cQ80eRUXo=" + }, + "markdown-it-imsize": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-imsize/-/markdown-it-imsize-2.0.1.tgz", + "integrity": "sha1-zKBCeQXQUziiR8ucqdloxc3dUXA=" + }, + "markdown-it-mark": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-mark/-/markdown-it-mark-2.0.0.tgz", + "integrity": "sha1-RqGqlHEFrtgYiXjgoBYXnkBPQsc=" + }, + "markdown-it-pandoc-renderer": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/markdown-it-pandoc-renderer/-/markdown-it-pandoc-renderer-1.1.3.tgz", + "integrity": "sha1-d/GltIjFRgqx4dy8/MB9EmdPejo=" + }, + "markdown-it-sub": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz", + "integrity": "sha1-N1/WAm6ufdywEkl/ZBEZXqHjr+g=" + }, + "markdown-it-sup": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz", + "integrity": "sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=" + }, + "markdown-table": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.2.tgz", + "integrity": "sha512-NcWuJFHDA8V3wkDgR/j4+gZx+YQwstPgfQDV8ndUeWWzta3dnDTBxpVzqS9lkmJAuV5YX35lmyojl6HO5JXAgw==", + "dev": true + }, + "matchdep": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz", + "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", + "dev": true, + "requires": { + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", + "stack-trace": "0.0.10" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "findup-sync": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "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-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-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" + } + }, + "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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "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" + } + } + } + }, + "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=", + "dev": true + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "mathml-tag-names": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.0.tgz", + "integrity": "sha512-3Zs9P/0zzwTob2pdgT0CHZuMbnSUSp8MB1bddfm+HDmnFWHGT4jvEZRf+2RuPoa+cjdn/z25SEt5gFTqdhvJAg==", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + } + } + }, + "mdast-util-compact": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz", + "integrity": "sha1-zbX4TitqLTEU3zO9BdnLMuPECDo=", + "dev": true, + "requires": { + "unist-util-modify-children": "^1.0.0", + "unist-util-visit": "^1.1.0" + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "memory-fs": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", + "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "merge-defaults": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/merge-defaults/-/merge-defaults-0.2.1.tgz", + "integrity": "sha1-3UIkjrlrtqUVIXJDIccv+Vg93oA=", + "dev": true, + "requires": { + "lodash": "~2.4.1" + }, + "dependencies": { + "lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", + "dev": true + } + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "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 + } + } + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "merge2": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz", + "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==", + "dev": true + }, + "mermaid": { + "version": "8.9.2", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.9.2.tgz", + "integrity": "sha512-XWEaraDRDlHZexdeHSSr/MH4VJAOksRSPudchi69ecZJ7IUjjlzHsg32n4ZwJUh6lFO+NMYLHwHNNYUyxIjGPg==", + "requires": { + "@braintree/sanitize-url": "^3.1.0", + "d3": "^5.7.0", + "dagre": "^0.8.4", + "dagre-d3": "^0.6.4", + "entity-decode": "^2.0.2", + "graphlib": "^2.1.7", + "he": "^1.2.0", + "khroma": "^1.1.0", + "minify": "^4.1.1", + "moment-mini": "^2.22.1", + "stylis": "^3.5.2" + }, + "dependencies": { + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "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.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" + }, + "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" + } + } + } + }, + "midi": { + "version": "git+https://github.com/paulrosen/MIDI.js.git#e593ffef81a0350f99448e3ab8111957145ff6b2", + "from": "git+https://github.com/paulrosen/MIDI.js.git#abcjs" + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "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=", + "requires": { + "mime-db": "~1.30.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "^0.1.0" + } + }, + "minify": { + "version": "4.1.3", + "resolved": "https://registry.npmmirror.com/minify/-/minify-4.1.3.tgz", + "integrity": "sha512-ykuscavxivSmVpcCzsXmsVTukWYLUUtPhHj0w2ILvHDGqC+hsuTCihBn9+PJBd58JNvWTNg9132J9nrrI2anzA==", + "requires": { + "clean-css": "^4.1.6", + "css-b64-images": "~0.2.5", + "debug": "^4.1.0", + "html-minifier": "^4.0.0", + "terser": "^4.0.0", + "try-catch": "^2.0.0", + "try-to-catch": "^1.0.2" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, + "html-minifier": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/html-minifier/-/html-minifier-4.0.0.tgz", + "integrity": "sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==", + "requires": { + "camel-case": "^3.0.0", + "clean-css": "^4.2.1", + "commander": "^2.19.0", + "he": "^1.2.0", + "param-case": "^2.1.1", + "relateurl": "^0.2.7", + "uglify-js": "^3.5.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "uglify-js": { + "version": "3.13.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.3.tgz", + "integrity": "sha512-otIc7O9LyxpUcQoXzj2hL4LPWKklO6LJWoJUzNa8A17Xgi4fOeDC8FBDOLHnC/Slo1CQgsZMcM6as0M76BZaig==" + } + } + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "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": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "minipass": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.4.tgz", + "integrity": "sha512-mlouk1OHlaUE8Odt1drMtG1bAJA4ZA6B/ehysgV0LUIrDHdKgo1KorZq3pK0b/7Z7LJIQ12MNM6aC+Tn6lUZ5w==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "yallist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=" + } + } + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.0.tgz", + "integrity": "sha512-dgaCvoh6i1nosAUBKb0l0pfJ78K8+S9fluyIR2YvAeUD/QuMahnFnF3xYty5eYXMjhGSsB0DsW6A0uAZyetoAg==", + "dev": true, + "requires": { + "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" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "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=" + } + } + }, + "moment-mini": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment-mini/-/moment-mini-2.24.0.tgz", + "integrity": "sha512-9ARkWHBs+6YJIvrIp0Ik5tyTTtP9PoV0Ssu2Ocq5y9v8+NOOpWiRshAp8c4rZVWTOe+157on/5G+zj5pwIQFEQ==" + }, + "mousetrap": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mousetrap/-/mousetrap-1.6.1.tgz", + "integrity": "sha1-KghfXHUSlMdefoH27CVFspy/Qtk=" + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mute-stdout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz", + "integrity": "sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==", + "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.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", + "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": { + "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" + }, + "dependencies": { + "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 + }, + "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 + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "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": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "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" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "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 + }, + "needle": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.2.tgz", + "integrity": "sha512-mW7W8dKuVYefCpNzE3Z7xUmPI9wSrSL/1qH31YGMxmSOAnjatS3S9Zv3cmiHrhx3Jkp1SrWWBdOFXjfF48Uq3A==", + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "dependencies": { + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + } + } + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "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==", + "requires": { + "lower-case": "^1.1.1" + } + }, + "node-cache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-4.2.0.tgz", + "integrity": "sha512-obRu6/f7S024ysheAjoYFEEBqqDWv4LOMNJEuO8vMeEw2AT4z+NCzO4hlc2lhI4vATzbCQv6kke9FVdx0RbCOw==", + "dev": true, + "requires": { + "clone": "2.x", + "lodash": "4.x" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + } + } + }, + "node-gyp": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "dev": true, + "requires": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.0", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + } + } + }, + "node-notifier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", + "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "semver": "^5.4.1", + "shellwords": "^0.1.1", + "which": "^1.3.0" + } + }, + "node-releases": { + "version": "1.0.0-alpha.11", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.0-alpha.11.tgz", + "integrity": "sha512-CaViu+2FqTNYOYNihXa5uPS/zry92I3vPU4nCB6JB3OeZ2UGtOpF5gRwuN4+m3hbEcL47bOXyun1jX2iC+3uEQ==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "node-rest-client": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/node-rest-client/-/node-rest-client-1.8.0.tgz", + "integrity": "sha1-jTxWa4F+JzlMtyc3g6Qcrv4+WVU=", + "dev": true, + "requires": { + "debug": "~2.2.0", + "xml2js": ">=0.2.4" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "node-sass": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", + "dev": true, + "requires": { + "async-foreach": "^0.1.3", + "chalk": "^1.1.1", + "cross-spawn": "^3.0.0", + "gaze": "^1.0.0", + "get-stdin": "^4.0.1", + "glob": "^7.0.3", + "in-publish": "^2.0.0", + "lodash": "^4.17.15", + "meow": "^3.7.0", + "mkdirp": "^0.5.1", + "nan": "^2.13.2", + "node-gyp": "^3.8.0", + "npmlog": "^4.0.0", + "request": "^2.88.0", + "sass-graph": "2.2.5", + "stdout-stream": "^1.4.0", + "true-case-path": "^1.0.2" + }, + "dependencies": { + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true + } + } + }, + "noop-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/noop-fn/-/noop-fn-1.0.0.tgz", + "integrity": "sha1-XzPUfxPSFQ35PgywNmmemC94/78=" + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "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==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^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=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "normalize-scss": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/normalize-scss/-/normalize-scss-7.0.1.tgz", + "integrity": "sha512-qj16bWnYs+9/ac29IgGjySg4R5qQTp1lXfm7ApFOZNVBYFY8RZ3f8+XQNDDLHeDtI3Ba7Jj4+LuPgz9v/fne2A==" + }, + "normalize-selector": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/normalize-selector/-/normalize-selector-0.2.0.tgz", + "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=", + "dev": true + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "now-and-later": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz", + "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", + "dev": true, + "requires": { + "once": "^1.3.2" + } + }, + "npm-bump": { + "version": "0.0.23", + "resolved": "https://registry.npmjs.org/npm-bump/-/npm-bump-0.0.23.tgz", + "integrity": "sha512-MeuiKsRgtND54G87WcUvt72drsnj2yr2XRalAWqm9A1KUaGVyOBhsbr0kYL65lQ35UugcYdvvRGpQoNR1h3zqQ==", + "dev": true, + "requires": { + "inquirer": "^3.2.2", + "semver": "^5.4.1", + "shell-quote": "^1.6.1" + }, + "dependencies": { + "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": "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.1.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^4.0.0" + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "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.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "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 + }, + "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.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "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=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "npm-bundled": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", + "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==" + }, + "npm-packlist": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.11.tgz", + "integrity": "sha512-CxKlZ24urLkJk+9kCm48RTQ7L4hsmgSVzEk0TLGPzzyuFxD7VNgy5Sl24tOLMzQv773a/NeJ1ce1DKeacqffEA==", + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "~1.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "nwsapi": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.8.tgz", + "integrity": "sha512-7RZ+qbFGiVc6v14Y8DSZjPN1wZPOaMbiiP4tzf5eNuyOITAeOIA3cMhjuKUypVIqBgCSg1KaSyAv8Ocq/0ZJ1A==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "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" + } + }, + "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" + } + }, + "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" + } + }, + "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 + } + } + } + } + }, + "object-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz", + "integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==", + "dev": true + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "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" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "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.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.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.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" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.reduce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.reduce/-/object.reduce-1.0.1.tgz", + "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", + "dev": true, + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + } + } + }, + "offline-plugin": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/offline-plugin/-/offline-plugin-5.0.5.tgz", + "integrity": "sha1-6bFsVp0ZiZr5ySP1vCYHBVeP/ro=", + "dev": true, + "requires": { + "deep-extend": "^0.5.1", + "ejs": "^2.3.4", + "loader-utils": "0.2.x", + "minimatch": "^3.0.3", + "slash": "^1.0.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "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.0.0" + } + }, + "opener": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", + "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", + "dev": true + }, + "opn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + } + }, + "optimize-css-assets-webpack-plugin": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-1.3.2.tgz", + "integrity": "sha1-6ydFbiHu+9gIDzHoNoxZaE5YWiw=", + "dev": true, + "requires": { + "cssnano": "^3.4.0", + "underscore": "^1.8.3", + "webpack-sources": "^0.1.0" + }, + "dependencies": { + "source-list-map": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", + "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "webpack-sources": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.5.tgz", + "integrity": "sha1-qh86vw8NdNtxEcQOUAuE+WZkB1A=", + "dev": true, + "requires": { + "source-list-map": "~0.1.7", + "source-map": "~0.5.3" + } + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "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" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, + "ora": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-1.3.0.tgz", + "integrity": "sha1-gAeN0rkqk0r2ajrXKluRBpTt5Ro=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "cli-cursor": "^2.1.0", + "cli-spinners": "^1.0.0", + "log-symbols": "^1.0.2" + }, + "dependencies": { + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "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.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + } + } + }, + "ordered-read-streams": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz", + "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "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-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "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-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 + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "requires": { + "no-case": "^2.2.0" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "parse-bmfont-ascii": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", + "integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=", + "dev": true + }, + "parse-bmfont-binary": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", + "integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=", + "dev": true + }, + "parse-bmfont-xml": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz", + "integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==", + "dev": true, + "requires": { + "xml-parse-from-string": "^1.0.0", + "xml2js": "^0.4.5" + } + }, + "parse-entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.2.tgz", + "integrity": "sha512-5N9lmQ7tmxfXf+hO3X6KRG6w7uYO/HL9fHalSySTdyn63C3WNvTM/1R8tn1u1larNcEbo3Slcy2bsVDQqvEpUg==", + "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-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + }, + "dependencies": { + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + } + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "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-headers": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.1.tgz", + "integrity": "sha1-aug6eqJanZtwCswoaYzR8e1+lTY=", + "dev": true, + "requires": { + "for-each": "^0.3.2", + "trim": "0.0.1" + } + }, + "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": { + "error-ex": "^1.2.0" + } + }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parse-png": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/parse-png/-/parse-png-1.1.2.tgz", + "integrity": "sha1-9cKtfHmTSQmGAgooTBmu5FlxH/I=", + "dev": true, + "requires": { + "pngjs": "^3.2.0" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "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": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "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=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "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" + } + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "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=" + }, + "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.0.3", + "extract-zip": "^1.6.5", + "fs-extra": "^1.0.0", + "hasha": "^2.2.0", + "kew": "^0.7.0", + "progress": "^1.1.8", + "request": "^2.81.0", + "request-progress": "^2.0.1", + "which": "^1.2.10" + }, + "dependencies": { + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "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 + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pixelmatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz", + "integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=", + "dev": true, + "requires": { + "pngjs": "^3.0.0" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + }, + "dependencies": { + "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" + } + } + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "pngjs": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.3.3.tgz", + "integrity": "sha512-1n3Z4p3IOxArEs1VRXnZ/RXdfEniAUS9jb68g58FIXMNkPJeZd+Qh4Uq7/e0LVxAQGos1eIUrqrt4FpjdnEd+Q==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "js-base64": "^2.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "postcss-calc": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", + "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", + "dev": true, + "requires": { + "postcss": "^5.0.2", + "postcss-message-helpers": "^2.0.0", + "reduce-css-calc": "^1.2.6" + } + }, + "postcss-colormin": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-2.2.2.tgz", + "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=", + "dev": true, + "requires": { + "colormin": "^1.0.5", + "postcss": "^5.0.13", + "postcss-value-parser": "^3.2.3" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.11", + "postcss-value-parser": "^3.1.2" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.14" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.14" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.16" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.14", + "uniqs": "^2.0.0" + } + }, + "postcss-filter-plugins": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz", + "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "uniqid": "^4.0.0" + } + }, + "postcss-html": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.33.0.tgz", + "integrity": "sha512-3keDoRG0o8bJZKe/QzkOPUD3GQQvAmYhIAtsGrgTxIXB6xZnSQq3gwPjCEd2IAUtz9/Fkus70XGm6xJEZ+bAmg==", + "dev": true, + "requires": { + "htmlparser2": "^3.9.2" + } + }, + "postcss-jsx": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/postcss-jsx/-/postcss-jsx-0.33.0.tgz", + "integrity": "sha512-+ZH4FyxQel2O5uYkNKBnDdW2jCwIb5HwwyFsKuEI164Vmq9Wm07nT2lj65P1qDSRXP2Ik05DrSHzY8Hmt5VP4A==", + "dev": true, + "requires": { + "@babel/core": "^7.0.0-rc.1", + "postcss-styled": ">=0.33.0" + } + }, + "postcss-less": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-2.0.0.tgz", + "integrity": "sha512-pPNsVnpCB13nBMOcl5GVh8JGmB0JGFjqkLUDzKdVpptFFKEe9wFdEzvh2j4lD2AD+7qcrUfw9Ta+oi5+Fw7jjQ==", + "dev": true, + "requires": { + "postcss": "^5.2.16" + } + }, + "postcss-markdown": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/postcss-markdown/-/postcss-markdown-0.33.0.tgz", + "integrity": "sha512-JZtetO15t5nNpymHDbRhuiOF8yJm1btrbUBP3iL39yLTiY8oChCsnCKfQjEuHB9+85fku5MoU/bRgQ8K45klMg==", + "dev": true, + "requires": { + "remark": "^9.0.0", + "unist-util-find-all-after": "^1.0.2" + } + }, + "postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "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.0.10", + "postcss-value-parser": "^3.1.1" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "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=", + "dev": true, + "requires": { + "browserslist": "^1.5.2", + "caniuse-api": "^1.5.2", + "postcss": "^5.0.4", + "postcss-selector-parser": "^2.2.2", + "vendors": "^1.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.2" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.12", + "postcss-value-parser": "^3.3.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=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.1", + "postcss": "^5.0.2", + "postcss-value-parser": "^3.0.2", + "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.0.14", + "postcss-selector-parser": "^2.0.0" + } + }, + "postcss-modules-extract-imports": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz", + "integrity": "sha1-ZhQOzs447wa/DT41XWm/WdFB6oU=", + "dev": true, + "requires": { + "postcss": "^6.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-local-by-default": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", + "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-scope": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", + "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "dev": true, + "requires": { + "css-selector-tokenizer": "^0.7.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-values": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", + "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", + "dev": true, + "requires": { + "icss-replace-symbols": "^1.1.0", + "postcss": "^6.0.1" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.5" + } + }, + "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=", + "dev": true, + "requires": { + "is-absolute-url": "^2.0.0", + "normalize-url": "^1.4.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.1" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.2" + } + }, + "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=", + "dev": true, + "requires": { + "postcss": "^5.0.4" + } + }, + "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=", + "dev": true, + "requires": { + "has": "^1.0.1", + "postcss": "^5.0.8", + "postcss-value-parser": "^3.0.1" + } + }, + "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==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "lodash": "^4.17.4", + "log-symbols": "^2.0.0", + "postcss": "^6.0.8" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "log-symbols": { + "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" + } + }, + "postcss": { + "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.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "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" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.2.tgz", + "integrity": "sha512-fmaUY5370keLUTx+CnwRxtGiuFTcNBLQBqr1oE3WZ/euIYmGAo0OAgOhVJ3ByDnVmOR3PK+0V9VebzfjRIUcqw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-sass": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.3.2.tgz", + "integrity": "sha512-0HgxikiZ07VKYr98KT+k7/rAzyMgZlP+3+R8vUti56T2dPdhW0OhPGDQzddxY/N2iDtBVZQqCHRDA09j5I6EWg==", + "dev": true, + "requires": { + "gonzales-pe": "4.2.3", + "postcss": "6.0.22" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-scss": { + "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": "^7.0.0" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.2.tgz", + "integrity": "sha512-fmaUY5370keLUTx+CnwRxtGiuFTcNBLQBqr1oE3WZ/euIYmGAo0OAgOhVJ3ByDnVmOR3PK+0V9VebzfjRIUcqw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "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-styled": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/postcss-styled/-/postcss-styled-0.33.0.tgz", + "integrity": "sha512-ybKIBKYY6q0hADQUECW2F4fDybDFIiAfpMf06/2maxU0yp0FvMTeABrDjzSmKu+99Nj2Gsxe80Xn56FbhzIZZQ==", + "dev": true + }, + "postcss-svgo": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", + "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=", + "dev": true, + "requires": { + "is-svg": "^2.0.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3", + "svgo": "^0.7.0" + } + }, + "postcss-syntax": { + "version": "0.33.0", + "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.33.0.tgz", + "integrity": "sha512-A9ABlaRy7KWUfG5E39GVTUoc5TXNuNTts5GzwDLwnSaVG151CSLCTcr51/m8cHi4KXcYa+5ImLyeSfBOhEYtGw==", + "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=", + "dev": true, + "requires": { + "alphanum-sort": "^1.0.1", + "postcss": "^5.0.4", + "uniqs": "^2.0.0" + } + }, + "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=", + "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=", + "dev": true, + "requires": { + "has": "^1.0.1", + "postcss": "^5.0.4", + "uniqs": "^2.0.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "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", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "prettier": { + "version": "1.13.7", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.13.7.tgz", + "integrity": "sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w==", + "dev": true + }, + "pretty": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pretty/-/pretty-2.0.0.tgz", + "integrity": "sha1-rbx5YLe7/iiaVX3F9zdhmiINBqU=", + "dev": true, + "requires": { + "condense-newlines": "^0.2.1", + "extend-shallow": "^2.0.1", + "js-beautify": "^1.6.12" + } + }, + "pretty-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", + "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "dev": true, + "requires": { + "renderkid": "^2.0.1", + "utila": "~0.4" + } + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "prismjs": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.9.0.tgz", + "integrity": "sha1-+j4tntw8OIfB8fMJXUHx+bQgDw8=", + "requires": { + "clipboard": "^1.7.1" + } + }, + "private": { + "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": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "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=" + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prompts": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz", + "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==", + "dev": true, + "requires": { + "kleur": "^2.0.1", + "sisteransi": "^0.1.1" + } + }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true + }, + "proxy-addr": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", + "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.8.0" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", + "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", + "dev": true, + "requires": { + "duplexify": "^3.5.3", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + }, + "q": { + "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==" + }, + "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.0", + "strict-uri-encode": "^1.0.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "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 + }, + "ramda": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", + "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==", + "dev": true + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", + "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "raw-loader": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=", + "dev": true + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "read-chunk": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-1.0.1.tgz", + "integrity": "sha1-X2jKswfmY/GZk1J9m1icrORmEZQ=", + "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=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "dependencies": { + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^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-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=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.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==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "realpath-native": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.1.tgz", + "integrity": "sha512-W14EcXuqUvKP8dkWkD7B95iMy77lpMnlFXbbk409bQtNCbeu0kvRE5reo+yIZ3JXxg6frbGsz2DLQ39lrCB40g==", + "dev": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "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.14", + "reduce-function-call": "^1.0.1" + }, + "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 + } + } + }, + "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=", + "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": { + "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.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.0.tgz", + "integrity": "sha1-Qvg+OXcWIt+CawKvF2Ul1qXxV/k=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=" + }, + "remark": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/remark/-/remark-9.0.0.tgz", + "integrity": "sha512-amw8rGdD5lHbMEakiEsllmkdBP+/KpjW/PRK6NSGPZKCQowh0BT4IWXDAkRMyG3SB9dKPXWMviFjNusXzXNn3A==", + "dev": true, + "requires": { + "remark-parse": "^5.0.0", + "remark-stringify": "^5.0.0", + "unified": "^6.0.0" + } + }, + "remark-parse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz", + "integrity": "sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA==", + "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": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-5.0.0.tgz", + "integrity": "sha512-Ws5MdA69ftqQ/yhRF9XhVV29mhxbfGhbz0Rx5bQH+oJcNhhSM6nCu1EpLod+DjrFGrU0BMPs+czVmJZU7xiS7w==", + "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-bom-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz", + "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", + "dev": true, + "requires": { + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" + } + }, + "remove-bom-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz", + "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", + "dev": true, + "requires": { + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "renderkid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.1.tgz", + "integrity": "sha1-iYyr/Ivt5Le5ETWj/9Mj5YwNsxk=", + "dev": true, + "requires": { + "css-select": "^1.1.0", + "dom-converter": "~0.1", + "htmlparser2": "~3.3.0", + "strip-ansi": "^3.0.0", + "utila": "~0.3" + }, + "dependencies": { + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "~1.0.0", + "css-what": "2.1", + "domutils": "1.5.1", + "nth-check": "~1.0.1" + } + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "domhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.1.0.tgz", + "integrity": "sha1-0mRvXlf2w7qxHPbLBdPArPdBJZQ=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "htmlparser2": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz", + "integrity": "sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.1", + "domutils": "1.1", + "readable-stream": "1.0" + }, + "dependencies": { + "domutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.1.6.tgz", + "integrity": "sha1-vdw94Jm5ou+sxRxiPyj0FuzFdIU=", + "dev": true, + "requires": { + "domelementtype": "1" + } + } + } + }, + "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.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "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 + }, + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "replace-homedir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-homedir/-/replace-homedir-1.0.0.tgz", + "integrity": "sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1", + "is-absolute": "^1.0.0", + "remove-trailing-separator": "^1.1.0" + }, + "dependencies": { + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + } + } + }, + "replace-in-file": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-4.1.0.tgz", + "integrity": "sha512-5IANGPAQZVO9PHEjaRz3EHs7eQulv1cvOu2hRi7+Ern+zXIzdslSGX9MIfcI1anaGCpICK2l4R4YOOdThsFryQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "glob": "^7.1.3", + "yargs": "^13.2.2" + }, + "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 + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "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": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "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" + } + }, + "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": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": 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-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "invert-kv": { + "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-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "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" + } + }, + "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" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "os-locale": { + "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": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.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 + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "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": { + "has-flag": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "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" + } + }, + "y18n": { + "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 + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "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.0" + } + }, + "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" + } + } + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "~1.35.0" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + } + } + }, + "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" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "dev": true, + "requires": { + "lodash": "^4.13.1" + } + }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "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-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resize-img": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/resize-img/-/resize-img-1.1.2.tgz", + "integrity": "sha1-+tZQ+vPvLFPqYxErwnLZXp2SVQ4=", + "dev": true, + "requires": { + "bmp-js": "0.0.1", + "file-type": "^3.8.0", + "get-stream": "^2.0.0", + "jimp": "^0.2.21", + "jpeg-js": "^0.1.1", + "parse-png": "^1.1.1" + }, + "dependencies": { + "bmp-js": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.0.1.tgz", + "integrity": "sha1-WtAUcJnROp84qnuZrx1ueGZu038=", + "dev": true + }, + "jpeg-js": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.1.2.tgz", + "integrity": "sha1-E1uZLAV1yYXPoPSUoyJ+0jhYPs4=", + "dev": true + } + } + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "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 + } + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "resolve-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz", + "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", + "dev": true, + "requires": { + "value-or-function": "^3.0.0" + } + }, + "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": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "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 + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "^2.0.0", + "inherits": "^2.0.1" + } + }, + "rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "dev": true + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha1-P4Yt+pGrdmsUiF700BEkv9oHT7Q=" + }, + "rx-lite": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "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=", + "dev": true, + "requires": { + "rx-lite": "*" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "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==" + }, + "sane": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", + "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "capture-exit": "^1.2.0", + "exec-sh": "^0.2.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.3", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5", + "watch": "~0.18.0" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": false, + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": false, + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "resolved": false, + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "resolved": false, + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "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.2", + "resolved": false, + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "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", + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "resolved": false, + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.2.4", + "resolved": false, + "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "resolved": false, + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": false, + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "resolved": false, + "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "resolved": false, + "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "resolved": false, + "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "resolved": false, + "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "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", + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "resolved": false, + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "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.2", + "resolved": false, + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": false, + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "resolved": false, + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "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", + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "resolved": false, + "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "resolved": false, + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.2", + "resolved": false, + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "dev": true, + "optional": 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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + }, + "micromatch": { + "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" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "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": { + "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" + } + }, + "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" + }, + "dependencies": { + "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": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + } + } + } + } + }, + "sass-graph": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz", + "integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "lodash": "^4.0.0", + "scss-tokenizer": "^0.2.3", + "yargs": "^13.3.2" + }, + "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 + }, + "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": { + "color-convert": "^1.9.0" + } + }, + "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 + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "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.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "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 + }, + "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 + }, + "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" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "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" + } + }, + "y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "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.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "sass-loader": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.3.1.tgz", + "integrity": "sha512-tuU7+zm0pTCynKYHpdqaPpe+MMTQ76I9TPZ7i4/5dZsigE350shQWe5EZNl5dBidM49TPET75tNqRbcsUZWeNA==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.0.1", + "neo-async": "^2.5.0", + "pify": "^4.0.1", + "semver": "^6.3.0" + }, + "dependencies": { + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=", + "dev": true + }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "^5.0.0" + } + }, + "scss-tokenizer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", + "dev": true, + "requires": { + "js-base64": "^2.1.8", + "source-map": "^0.4.2" + } + }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" + }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==" + }, + "semver-greatest-satisfied-range": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", + "integrity": "sha1-E+jCZYq5aRywzXEJMkAoDTb3els=", + "dev": true, + "requires": { + "sver-compat": "^1.5.0" + } + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + } + }, + "serialize-javascript": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.4.0.tgz", + "integrity": "sha1-fJWFFNtqwkQ6irwGLcn3iGp/YAU=", + "dev": true + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + }, + "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + } + } + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "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=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + }, + "sha.js": { + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", + "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" + } + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, + "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=" + }, + "sisteransi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz", + "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g==", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "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==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "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": { + "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" + } + }, + "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-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-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" + } + }, + "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 + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "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 + } + } + }, + "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": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "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" + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "dev": true, + "requires": { + "is-plain-obj": "^1.0.0" + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": ">=0.0.4" + } + }, + "source-map-resolve": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", + "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "dev": true, + "requires": { + "atob": "^2.0.0", + "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.6" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "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 + }, + "sparkles": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", + "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=", + "dev": true, + "requires": { + "spdx-license-ids": "^1.0.2" + } + }, + "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=", + "dev": true + }, + "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=", + "dev": true + }, + "specificity": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.4.0.tgz", + "integrity": "sha512-nGUlURFuoSsmJQ2TBKaO2l7+dBHtRnofSSQdiFKEpd+HBDWXR9/+gtJfgNpe3Nh6o5mqSxDpin/M4YoN7AijGg==", + "dev": true + }, + "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": { + "extend-shallow": "^3.0.0" + }, + "dependencies": { + "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": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "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" + } + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sqlite3": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.0.9.tgz", + "integrity": "sha512-IkvzjmsWQl9BuBiM4xKpl5X8WCR4w0AeJHRdobCdXZ8dT/lNc1XS6WqvY35N6+YzIIgzSBeY5prdFObID9F9tA==", + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.11.0", + "request": "^2.87.0" + }, + "dependencies": { + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" + }, + "minipass": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "requires": { + "minipass": "^2.2.1" + } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + }, + "node-pre-gyp": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", + "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", + "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", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "tar": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz", + "integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==", + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.5", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + } + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + } + } + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.2.4.tgz", + "integrity": "sha512-UnEAgMZa15973iH7cUi0AHjJn1ACDIkaMyZILoqwN6yzt+4P81I8tBc5Hl+qwi5auMplZtPQsHrPBR5vJLcQtQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", + "dev": true + }, + "stackframe": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.0.4.tgz", + "integrity": "sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==", + "dev": true + }, + "state-toggle": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.1.tgz", + "integrity": "sha512-Qe8QntFrrpWTnHwvwj2FZTgv+PKIsp0B9VxLzLLbSpPXWOgRgc5LVj/aTiSfK1RqIeF9jeC1UeOH8Q8y60A7og==", + "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": { + "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" + } + }, + "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-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-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" + } + }, + "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 + } + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "stdout-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-exhaust": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-exhaust/-/stream-exhaust-1.0.2.tgz", + "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==", + "dev": true + }, + "stream-http": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.2.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-to": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stream-to/-/stream-to-0.2.2.tgz", + "integrity": "sha1-hDBgmNhf25kLn6MAsbPM9V6O8B0=", + "dev": true + }, + "stream-to-buffer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-to-buffer/-/stream-to-buffer-0.1.0.tgz", + "integrity": "sha1-JnmdkDqyAlyb1VCsRxcbAPjdgKk=", + "dev": true, + "requires": { + "stream-to": "~0.2.0" + } + }, + "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=", + "dev": true + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.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" + } + } + } + }, + "string-replace-loader": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-replace-loader/-/string-replace-loader-2.1.1.tgz", + "integrity": "sha512-0Nvw1LDclF45AFNuYPcD2Jvkv0mwb/dQSnJZMvhqGrT+zzmrpG3OJFD600qfQfNUd5aqfp7fCm2mQMfF7zLbyQ==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "schema-utils": "^0.4.5" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "fast-deep-equal": { + "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 + }, + "json-schema-traverse": { + "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 + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "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==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "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=", + "requires": { + "ansi-regex": "^2.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=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "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" + } + }, + "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=" + }, + "style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=", + "dev": true + }, + "stylelint": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-9.5.0.tgz", + "integrity": "sha512-63R/DGDjMekFwS4xaHSLy26N19pT1Jsxj7u5QNcJrUWBvvPoBCYx3ObINRgsvNMoupzhV7N0PjylxrDHyh4cKQ==", + "dev": true, + "requires": { + "autoprefixer": "^9.0.0", + "balanced-match": "^1.0.0", + "chalk": "^2.4.1", + "cosmiconfig": "^5.0.0", + "debug": "^3.0.0", + "execall": "^1.0.0", + "file-entry-cache": "^2.0.0", + "get-stdin": "^6.0.0", + "globby": "^8.0.0", + "globjoin": "^0.1.4", + "html-tags": "^2.0.0", + "ignore": "^4.0.0", + "import-lazy": "^3.1.0", + "imurmurhash": "^0.1.4", + "known-css-properties": "^0.6.0", + "lodash": "^4.17.4", + "log-symbols": "^2.0.0", + "mathml-tag-names": "^2.0.1", + "meow": "^5.0.0", + "micromatch": "^2.3.11", + "normalize-selector": "^0.2.0", + "pify": "^4.0.0", + "postcss": "^7.0.0", + "postcss-html": "^0.33.0", + "postcss-jsx": "^0.33.0", + "postcss-less": "^2.0.0", + "postcss-markdown": "^0.33.0", + "postcss-media-query-parser": "^0.2.3", + "postcss-reporter": "^5.0.0", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^4.0.0", + "postcss-sass": "^0.3.0", + "postcss-scss": "^2.0.0", + "postcss-selector-parser": "^3.1.0", + "postcss-styled": "^0.33.0", + "postcss-syntax": "^0.33.0", + "postcss-value-parser": "^3.3.0", + "resolve-from": "^4.0.0", + "signal-exit": "^3.0.2", + "specificity": "^0.4.0", + "string-width": "^2.1.0", + "style-search": "^0.1.0", + "sugarss": "^2.0.0", + "svg-tags": "^1.0.0", + "table": "^4.0.1" + }, + "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.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": { + "color-convert": "^1.9.0" + } + }, + "autoprefixer": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.1.2.tgz", + "integrity": "sha512-deo8jkqEIQALuN4OMbVPmtH8BUTRUW2PtINom/ZZBX6MvDUPcFaxTVB2USkWyeLlfd9garISbhjGN5WDHgRH2w==", + "dev": true, + "requires": { + "browserslist": "^4.0.2", + "caniuse-lite": "^1.0.30000877", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.2", + "postcss-value-parser": "^3.2.3" + } + }, + "browserslist": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.0.2.tgz", + "integrity": "sha512-lpujC4zv1trcKUUwfD4pFVNga4YSpB3sLB+/I+A8gvGQxno1c0dMB2aCQy0FE5oUNIDjD9puFiFF0zeS6Ji48w==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000876", + "electron-to-chromium": "^1.3.57", + "node-releases": "^1.0.0-alpha.11" + } + }, + "camelcase": { + "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": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "caniuse-lite": { + "version": "1.0.30000877", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000877.tgz", + "integrity": "sha512-h04kV/lcuhItU1CZTJOxUEk/9R+1XeJqgc67E+XC8J9TjPM8kzVgOn27ZtRdDUo8O5F8U4QRCzDWJrVym3w3Cg==", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.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" + } + }, + "electron-to-chromium": { + "version": "1.3.58", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.58.tgz", + "integrity": "sha512-AGJxlBEn2wOohxqWZkISVsOjZueKTQljfEODTDSEiMqSpH0S+xzV+/5oEM9AGaqhu7DzrpKOgU7ocQRjj0nJmg==", + "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" + } + }, + "get-stdin": { + "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 + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "fast-glob": "^2.0.2", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "dependencies": { + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "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 + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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 + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "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.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "log-symbols": { + "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" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "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" + } + }, + "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" + } + }, + "pify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.0.tgz", + "integrity": "sha512-zrSP/KDf9DH3K3VePONoCstgPiYJy9z0SCatZuTpOc7YdnWIqwkWdXOuwlr4uDc7em8QZRsFWsT/685x5InjYg==", + "dev": true + }, + "postcss": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.2.tgz", + "integrity": "sha512-fmaUY5370keLUTx+CnwRxtGiuFTcNBLQBqr1oE3WZ/euIYmGAo0OAgOhVJ3ByDnVmOR3PK+0V9VebzfjRIUcqw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.4.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" + } + }, + "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.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "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": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "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 + }, + "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 + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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" + } + }, + "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-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + }, + "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 + }, + "yargs-parser": { + "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" + } + } + } + }, + "stylelint-config-standard": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-16.0.0.tgz", + "integrity": "sha1-u3OHv/HX3XGGpSs+v4hbJAXWkb8=", + "dev": true + }, + "stylelint-processor-html": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stylelint-processor-html/-/stylelint-processor-html-1.0.0.tgz", + "integrity": "sha1-aJK2soVaRfApHNhFGR1pCBMKKRg=", + "dev": true, + "requires": { + "htmlparser2": "^3.9.1" + } + }, + "stylelint-webpack-plugin": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/stylelint-webpack-plugin/-/stylelint-webpack-plugin-0.10.5.tgz", + "integrity": "sha512-jtYx3aJ2qDMvBMswe5NRPTO7kJgAKafc6GilAkWDp/ewoAmnoxA6TsYMnIPtLECRLwXevaCPvlh2JEUMGZCoUQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "ramda": "^0.25.0" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + }, + "micromatch": { + "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" + } + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "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" + } + }, + "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" + }, + "dependencies": { + "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": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + } + } + } + } + }, + "stylis": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-3.5.4.tgz", + "integrity": "sha512-8/3pSmthWM7lsPBKv7NXkzn2Uc9W7NotcwGNpJaa3k7WMM1XDCA4MgT5k/8BIexd5ydZdboXtU90XH9Ec4Bv/Q==" + }, + "sugarss": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz", + "integrity": "sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ==", + "dev": true, + "requires": { + "postcss": "^7.0.2" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.2.tgz", + "integrity": "sha512-fmaUY5370keLUTx+CnwRxtGiuFTcNBLQBqr1oE3WZ/euIYmGAo0OAgOhVJ3ByDnVmOR3PK+0V9VebzfjRIUcqw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "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" + } + }, + "sver-compat": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", + "integrity": "sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg=", + "dev": true, + "requires": { + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, + "svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=", + "dev": true + }, + "svg2png": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svg2png/-/svg2png-3.0.1.tgz", + "integrity": "sha1-omRNaLAjGsAK9DGqFjcU/xcQZEc=", + "dev": true, + "requires": { + "phantomjs-prebuilt": "^2.1.10", + "pn": "^1.0.0", + "yargs": "^3.31.0" + }, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "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 + }, + "yargs": { + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz", + "integrity": "sha1-AwiOnr+edWtpdRYR0qXvWRSCyZU=", + "dev": true, + "requires": { + "camelcase": "^2.0.1", + "cliui": "^3.0.3", + "decamelize": "^1.1.1", + "os-locale": "^1.4.0", + "string-width": "^1.0.1", + "window-size": "^0.1.4", + "y18n": "^3.2.0" + } + } + } + }, + "svgo": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", + "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", + "dev": true, + "requires": { + "coa": "~1.0.1", + "colors": "~1.1.2", + "csso": "~2.3.1", + "js-yaml": "~3.7.0", + "mkdirp": "~0.5.1", + "sax": "~1.2.1", + "whet.extend": "~0.9.9" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "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=", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^2.6.0" + } + } + } + }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "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" + }, + "dependencies": { + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^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": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "tapable": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", + "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", + "dev": true + }, + "tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "dev": true, + "requires": { + "block-stream": "*", + "fstream": "^1.0.12", + "inherits": "2" + } + }, + "terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "test-exclude": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^3.1.8", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + }, + "dependencies": { + "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 + }, + "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 + }, + "braces": { + "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" + } + } + } + }, + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "expand-brackets": { + "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": { + "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" + } + }, + "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" + } + }, + "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 + } + } + }, + "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": { + "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": "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" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "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" + } + } + } + }, + "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-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-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.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" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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 + }, + "micromatch": { + "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" + } + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "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" + } + }, + "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" + }, + "dependencies": { + "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": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + } + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "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", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", + "dev": true, + "requires": { + "through2": "~2.0.0", + "xtend": "~4.0.0" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", + "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "tiny-emitter": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", + "integrity": "sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow==" + }, + "tiny-queue": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tiny-queue/-/tiny-queue-0.2.1.tgz", + "integrity": "sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY=" + }, + "tinycolor2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz", + "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-absolute-glob": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", + "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "dev": true, + "requires": { + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" + }, + "dependencies": { + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "requires": { + "unc-path-regex": "^0.1.2" + } + } + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "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=", + "dev": true + }, + "to-ico": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/to-ico/-/to-ico-1.1.5.tgz", + "integrity": "sha512-5kIh7m7bkIlqIESEZkL8gAMMzucXKfPe3hX2FoDY5HEAfD9OJU+Qh9b6Enp74w0qRcxVT5ejss66PHKqc3AVkg==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "buffer-alloc": "^1.1.0", + "image-size": "^0.5.0", + "parse-png": "^1.0.0", + "resize-img": "^1.1.0" + }, + "dependencies": { + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "dev": true + } + } + }, + "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": { + "kind-of": "^3.0.2" + } + }, + "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" + }, + "dependencies": { + "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": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "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": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "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" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "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": { + "extend-shallow": "^3.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" + }, + "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.0.2" + } + } + } + }, + "to-through": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz", + "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", + "dev": true, + "requires": { + "through2": "^2.0.3" + } + }, + "toposort": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", + "integrity": "sha1-LmhELZ9k7HILjMieZEOsbKqVACk=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + } + } + }, + "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": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "trim-trailing-lines": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz", + "integrity": "sha512-bWLv9BbWbbd7mlqqs2oQYnLD/U/ZqeJeJwbO0FG2zA1aTq+HTvxfHNKFa/HGCVyJpDiioUYaBhfiT6rgk+l4mg==", + "dev": true + }, + "trough": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.3.tgz", + "integrity": "sha512-fwkLWH+DimvA4YCy+/nvJd61nWQQ2liO/nF/RjkTpiOGi+zxZzVkhb1mvbHIIW4b/8nDsYI8uTmAlc0nNkRMOw==", + "dev": true + }, + "true-case-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", + "dev": true, + "requires": { + "glob": "^7.1.2" + } + }, + "try-catch": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/try-catch/-/try-catch-2.0.1.tgz", + "integrity": "sha512-LsOrmObN/2WdM+y2xG+t16vhYrQsnV8wftXIcIOWZhQcBJvKGYuamJGwnU98A7Jxs2oZNkJztXlphEOoA0DWqg==" + }, + "try-to-catch": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/try-to-catch/-/try-to-catch-1.1.1.tgz", + "integrity": "sha512-ikUlS+/BcImLhNYyIgZcEmq4byc31QpC+46/6Jm5ECWkVFhf8SM2Fp/0pMVXPX6vk45SMCwrP4Taxucne8I0VA==" + }, + "tryer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", + "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", + "dev": true + }, + "tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "requires": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "turndown": { + "version": "7.1.1", + "resolved": "https://registry.npmmirror.com/turndown/-/turndown-7.1.1.tgz", + "integrity": "sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA==", + "requires": { + "domino": "^2.1.6" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.15" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typeson": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/typeson/-/typeson-5.8.2.tgz", + "integrity": "sha512-AFuyvVdHdkGlVIalOrSFjylmeLeWFtKu77uDjEilP4B9+Jk0DCM1m1A4Q2s3AwROhgiFFVPI8oARaD9S61lOkg==" + }, + "typeson-registry": { + "version": "1.0.0-alpha.20", + "resolved": "https://registry.npmjs.org/typeson-registry/-/typeson-registry-1.0.0-alpha.20.tgz", + "integrity": "sha512-Gj4ppRuwKWXilgz2Vc13Bn7UR97MpdiUVYinmMFJuS+B1TktUhMS5Gb4cGbyDjvXNiG6TvE5DHI2ip1qiGZiYA==", + "requires": { + "base64-arraybuffer-es6": "0.3.1", + "typeson": "5.8.2", + "uuid": "3.2.1", + "whatwg-url": "6.4.0" + }, + "dependencies": { + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + } + } + }, + "uc.micro": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz", + "integrity": "sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg==" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "dev": true + }, + "undertaker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.3.0.tgz", + "integrity": "sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg==", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1", + "arr-map": "^2.0.0", + "bach": "^1.0.0", + "collection-map": "^1.0.0", + "es6-weak-map": "^2.0.1", + "fast-levenshtein": "^1.0.0", + "last-run": "^1.1.0", + "object.defaults": "^1.0.0", + "object.reduce": "^1.0.0", + "undertaker-registry": "^1.0.0" + }, + "dependencies": { + "fast-levenshtein": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz", + "integrity": "sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk=", + "dev": true + } + } + }, + "undertaker-registry": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/undertaker-registry/-/undertaker-registry-1.0.1.tgz", + "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=", + "dev": true + }, + "unherit": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.1.tgz", + "integrity": "sha512-+XZuV691Cn4zHsK0vkKYwBEwB74T3IZIcxrgn2E4rKwTfFyI1zCh7X7grwh9Re08fdPlarIdyWgI8aVB3F5A5g==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "xtend": "^4.0.1" + } + }, + "unified": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz", + "integrity": "sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA==", + "dev": true, + "requires": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^1.1.0", + "trough": "^1.0.0", + "vfile": "^2.0.0", + "x-is-string": "^0.1.0" + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqid": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", + "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", + "dev": true, + "requires": { + "macaddress": "^0.2.8" + } + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" + } + }, + "unist-util-find-all-after": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.2.tgz", + "integrity": "sha512-nDl79mKpffXojLpCimVXnxhlH/jjaTnDuScznU9J4jjsaUtBdDbxmlc109XtcqxY4SDO0SwzngsxxW8DIISt1w==", + "dev": true, + "requires": { + "unist-util-is": "^2.0.0" + } + }, + "unist-util-is": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-2.1.2.tgz", + "integrity": "sha512-YkXBK/H9raAmG7KXck+UUpnKiNmUdB+aBGrknfQ4EreE1banuzrKABx3jP6Z5Z3fMSPMQQmeXBlKpCbMwBkxVw==", + "dev": true + }, + "unist-util-modify-children": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-1.1.2.tgz", + "integrity": "sha512-GRi04yhng1WqBf5RBzPkOtWAadcZS2gvuOgNn/cyJBYNxtTuyYqTKN0eg4rC1YJwGnzrqfRB3dSKm8cNCjNirg==", + "dev": true, + "requires": { + "array-iterate": "^1.0.0" + } + }, + "unist-util-remove-position": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz", + "integrity": "sha512-XxoNOBvq1WXRKXxgnSYbtCF76TJrRoe5++pD4cCBsssSiWSnPEktyFrFLE8LTk3JW5mt9hB0Sk5zn4x/JeWY7Q==", + "dev": true, + "requires": { + "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.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.0.tgz", + "integrity": "sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==", + "dev": true, + "requires": { + "unist-util-visit-parents": "^2.0.0" + } + }, + "unist-util-visit-parents": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz", + "integrity": "sha512-6B0UTiMfdWql4cQ03gDTCSns+64Zkfo2OCbK31Ov0uMizEz+CJeAp0cgZVb5Fhmcd7Bct2iRNywejT0orpbqUA==", + "dev": true, + "requires": { + "unist-util-is": "^2.1.2" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "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": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "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": { + "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-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 + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" + }, + "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": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "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 + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url-loader": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.1.1.tgz", + "integrity": "sha512-vugEeXjyYFBCUOpX+ZuaunbK3QXMKaQ3zUnRfIpRBlGkY7QizCnzyyn2ASfcxsvyU3ef+CJppVywnl3Kgf13Gg==", + "dev": true, + "requires": { + "loader-utils": "^1.1.0", + "mime": "^2.0.3", + "schema-utils": "^1.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "fast-deep-equal": { + "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 + }, + "json-schema-traverse": { + "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 + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "mime": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==", + "dev": true + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "url-regex": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/url-regex/-/url-regex-3.2.0.tgz", + "integrity": "sha1-260eDJ4p4QXdCx8J9oYvf9tIJyQ=", + "dev": true, + "requires": { + "ip-regex": "^1.0.1" + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "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" + } + }, + "utila": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", + "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "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=", + "dev": true, + "requires": { + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" + } + }, + "value-or-function": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", + "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM=", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "vendors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.1.tgz", + "integrity": "sha1-N61zyO5Bf7PVgOeFMSMH0nSEfyI=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vfile": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz", + "integrity": "sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w==", + "dev": true, + "requires": { + "is-buffer": "^1.1.4", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^1.0.0", + "vfile-message": "^1.0.0" + }, + "dependencies": { + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + } + } + }, + "vfile-location": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.3.tgz", + "integrity": "sha512-zM5/l4lfw1CBoPx3Jimxoc5RNDAHHpk6AM6LM0pTIkm5SUSsx8ZekZ0PVdf0WEZ7kjlhSt7ZlqbRL6Cd6dBs6A==", + "dev": true + }, + "vfile-message": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.0.1.tgz", + "integrity": "sha512-vSGCkhNvJzO6VcWC6AlJW4NtYOVtS+RgCaqFIYUjoGIlHnFL+i0LbtYvonDWOMcB97uTPT4PRsyYY7REWC9vug==", + "dev": true, + "requires": { + "unist-util-stringify-position": "^1.1.1" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "^1.0.0", + "clone-stats": "^0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz", + "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", + "dev": true, + "requires": { + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "vinyl-sourcemap": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz", + "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", + "dev": true, + "requires": { + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" + }, + "dependencies": { + "clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.1.tgz", + "integrity": "sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw==", + "dev": true + }, + "vinyl": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.1.tgz", + "integrity": "sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==", + "dev": true, + "requires": { + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" + } + } + } + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "vue": { + "version": "2.5.17", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.17.tgz", + "integrity": "sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ==" + }, + "vue-hot-reload-api": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.0.tgz", + "integrity": "sha512-2j/t+wIbyVMP5NvctQoSUvLkYKoWAAk2QlQiilrM2a6/ulzFgdcLUJfTvs4XQ/3eZhHiBmmEojbjmM4AzZj8JA==", + "dev": true + }, + "vue-jest": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/vue-jest/-/vue-jest-1.4.0.tgz", + "integrity": "sha512-X5YXTXcpklijK3wXG/CiW8Frkz+YPBjR+//FD5rcmlnmEelz+8AQpKA8vhbAHJx3gOhA2tkWt8XEjvxq1S0heg==", + "dev": true, + "requires": { + "babel-core": "^6.25.0", + "babel-preset-vue-app": "^1.3.1", + "chalk": "^2.1.0", + "find-babel-config": "^1.1.0", + "js-beautify": "^1.6.14", + "node-cache": "^4.1.1", + "object-assign": "^4.1.1", + "source-map": "^0.5.6", + "tsconfig": "^7.0.0", + "vue-template-es2015-compiler": "^1.5.3" + }, + "dependencies": { + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "vue-loader": { + "version": "15.4.0", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.4.0.tgz", + "integrity": "sha512-qhc1fnflEVhFq5dYLDXXTXf3PoRiGxeMhBmGDeLqlg0XAaikZEU224ZLqsTkQQVUT2uA2PN9haYlBUqq/6iEtA==", + "dev": true, + "requires": { + "@vue/component-compiler-utils": "^2.0.0", + "hash-sum": "^1.0.2", + "loader-utils": "^1.1.0", + "vue-hot-reload-api": "^2.3.0", + "vue-style-loader": "^4.1.0" + }, + "dependencies": { + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "vue-style-loader": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz", + "integrity": "sha512-0ip8ge6Gzz/Bk0iHovU9XAUQaFt/G2B61bnWa2tCcqqdgfHs1lF9xXorFbE55Gmy92okFT+8bfmySuUOu13vxQ==", + "dev": true, + "requires": { + "hash-sum": "^1.0.2", + "loader-utils": "^1.0.2" + }, + "dependencies": { + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + } + } + }, + "vue-template-compiler": { + "version": "2.5.17", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.5.17.tgz", + "integrity": "sha512-63uI4syCwtGR5IJvZM0LN5tVsahrelomHtCxvRkZPJ/Tf3ADm1U1wG6KWycK3qCfqR+ygM5vewUvmJ0REAYksg==", + "dev": true, + "requires": { + "de-indent": "^1.0.2", + "he": "^1.1.0" + } + }, + "vue-template-es2015-compiler": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz", + "integrity": "sha512-x3LV3wdmmERhVCYy3quqA57NJW7F3i6faas++pJQWtknWT+n7k30F4TVdHvCLn48peTJFRvCpxs3UuFPqgeELg==", + "dev": true + }, + "vuex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz", + "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==" + }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "watch": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", + "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", + "dev": true, + "requires": { + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" + }, + "webpack": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-2.7.0.tgz", + "integrity": "sha512-MjAA0ZqO1ba7ZQJRnoCdbM56mmFpipOPUv/vQpwwfSI42p5PVDdoiuK2AL2FwFUVgT859Jr43bFZXRg/LNsqvg==", + "dev": true, + "requires": { + "acorn": "^5.0.0", + "acorn-dynamic-import": "^2.0.0", + "ajv": "^4.7.0", + "ajv-keywords": "^1.1.1", + "async": "^2.1.2", + "enhanced-resolve": "^3.3.0", + "interpret": "^1.0.0", + "json-loader": "^0.5.4", + "json5": "^0.5.1", + "loader-runner": "^2.3.0", + "loader-utils": "^0.2.16", + "memory-fs": "~0.4.1", + "mkdirp": "~0.5.0", + "node-libs-browser": "^2.0.0", + "source-map": "^0.5.3", + "supports-color": "^3.1.0", + "tapable": "~0.2.5", + "uglify-js": "^2.8.27", + "watchpack": "^1.3.1", + "webpack-sources": "^1.0.1", + "yargs": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + } + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "^4.14.0" + } + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "enhanced-resolve": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", + "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "object-assign": "^4.0.1", + "tapable": "^0.2.7" + } + }, + "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=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^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": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.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=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "tapable": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", + "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "dev": true + }, + "watchpack": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", + "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", + "dev": true, + "requires": { + "async": "^2.1.2", + "chokidar": "^1.7.0", + "graceful-fs": "^4.1.2" + } + }, + "yargs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.2.0" + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + } + } + } + }, + "webpack-bundle-analyzer": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.3.2.tgz", + "integrity": "sha512-7qvJLPKB4rRWZGjVp5U1KEjwutbDHSKboAl0IfafnrdXMrgC0tOtZbQD6Rw0u4cmpgRN4O02Fc0t8eAT+FgGzA==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-walk": "^6.1.1", + "bfj": "^6.1.1", + "chalk": "^2.4.1", + "commander": "^2.18.0", + "ejs": "^2.6.1", + "express": "^4.16.3", + "filesize": "^3.6.1", + "gzip-size": "^5.0.0", + "lodash": "^4.17.10", + "mkdirp": "^0.5.1", + "opener": "^1.5.1", + "ws": "^6.0.0" + }, + "dependencies": { + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "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": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "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": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "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 + }, + "ejs": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.2.tgz", + "integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q==", + "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 + }, + "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": { + "has-flag": "^3.0.0" + } + } + } + }, + "webpack-dev-middleware": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.2.tgz", + "integrity": "sha512-FCrqPy1yy/sN6U/SaEZcHKRXGlqU0DUaEBL45jkUYoB8foVb6wCnbIJ1HKIx+qUFTW+3JpVcCJCxZ8VATL4e+A==", + "dev": true, + "requires": { + "memory-fs": "~0.4.1", + "mime": "^1.5.0", + "path-is-absolute": "^1.0.0", + "range-parser": "^1.0.3", + "time-stamp": "^2.0.0" + }, + "dependencies": { + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "time-stamp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-2.0.0.tgz", + "integrity": "sha1-lcakRTDhW6jW9KPsuMOj+sRto1c=", + "dev": true + } + } + }, + "webpack-hot-middleware": { + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.21.0.tgz", + "integrity": "sha512-P6xiOLy10QlSVSO7GanU9PLxN6zLLQ7RG16MPTvmFwf2KUG7jMp6m+fmdgsR7xoaVVLA7OlX3YO6JjoZEKjCuA==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "html-entities": "^1.2.0", + "querystring": "^0.2.0", + "strip-ansi": "^3.0.0" + } + }, + "webpack-merge": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.4.tgz", + "integrity": "sha512-TmSe1HZKeOPey3oy1Ov2iS3guIZjWvMT2BBJDzzT5jScHTjVC3mpjJofgueEzaEd6ibhxRDD6MIblDr8tzh8iQ==", + "dev": true, + "requires": { + "lodash": "^4.17.5" + }, + "dependencies": { + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + } + } + }, + "webpack-pwa-manifest": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/webpack-pwa-manifest/-/webpack-pwa-manifest-3.7.1.tgz", + "integrity": "sha512-G37fVCa1ndij3jyz6WaOaxHLHdp2URyOHwp2GLmxt39sXL8ZdOFM1qvHagEJBkNh+3hu25eIgy6TD5J/8sgQcQ==", + "dev": true, + "requires": { + "css-color-names": "0.0.4", + "jimp": "^0.2.28", + "mime": "^1.6.0" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + } + } + }, + "webpack-sources": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "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 + } + } + }, + "whatwg-encoding": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz", + "integrity": "sha512-vM9KWN6MP2mIHZ86ytcyIv7e8Cj3KTfO2nd2c8PFDqcI4bxFmQp83ibq4wadq7rL9l9sZV6o9B0LTt8ygGAAXg==", + "dev": true, + "requires": { + "iconv-lite": "0.4.23" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, + "whatwg-mimetype": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", + "integrity": "sha512-FKxhYLytBQiUKjkYteN71fAUA3g6KpNXoho1isLiLSB3N1G4F35Q5vUxWfKFhBwi5IWF27VE6WxhrnnC+m0Mew==", + "dev": true + }, + "whatwg-url": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.4.0.tgz", + "integrity": "sha512-Z0CVh/YE217Foyb488eo+iBv+r7eAQ0wSTyApi9n06jhcA3z6Nidg/EGvl0UFkg7kMdKxfBzzr+o9JF+cevgMg==", + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.0", + "webidl-conversions": "^4.0.1" + } + }, + "whet.extend": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", + "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "requires": { + "string-width": "^1.0.2" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, + "worker-loader": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-1.1.1.tgz", + "integrity": "sha512-qJZLVS/jMCBITDzPo/RuweYSIG8VJP5P67mP/71alGyTZRe1LYJFdwLjLalY3T5ifx0bMDRD3OB6P2p1escvlg==", + "dev": true, + "requires": { + "loader-utils": "^1.0.0", + "schema-utils": "^0.4.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.3.tgz", + "integrity": "sha512-LqZ9wY+fx3UMiiPd741yB2pj3hhil+hQc8taf4o2QGRFpWgZ2V5C8HA165DY9sS3fJwsk7uT7ZlFEyC3Ig3lLg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", + "dev": true + }, + "fast-deep-equal": { + "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 + }, + "json-schema-traverse": { + "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 + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "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": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "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==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "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" + } + }, + "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 + }, + "xhr": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz", + "integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==", + "dev": true, + "requires": { + "global": "~4.3.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xml-parse-from-string": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", + "integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=", + "dev": true + }, + "xml2js": { + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.17.tgz", + "integrity": "sha1-F76T6q4/O3eTWceVtBlwWogX6Gg=", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "^4.1.0" + } + }, + "xmlbuilder": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.2.1.tgz", + "integrity": "sha1-qlijBBoGb5DqoWwvU4n/GfP0YaU=", + "dev": true, + "requires": { + "lodash": "^4.0.0" + } + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "dev": true, + "requires": { + "fd-slicer": "~1.0.1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9075587 --- /dev/null +++ b/package.json @@ -0,0 +1,141 @@ +{ + "name": "stackedit", + "version": "5.15.21", + "description": "免费, 开源, 功能齐全的 Markdown 编辑器", + "author": "Benoit Schweblin, 豆萁", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/mafgwo/stackedit/issues" + }, + "main": "index.js", + "scripts": { + "postinstall": "gulp build-prism", + "start": "node build/dev-server.js", + "build": "node build/build.js && npm run build-style", + "build-style": "webpack --config build/webpack.style.conf.js", + "lint": "eslint --ext .js,.vue src server", + "unit": "jest --config test/unit/jest.conf.js --runInBand", + "unit-with-coverage": "jest --config test/unit/jest.conf.js --runInBand --coverage", + "test": "npm run lint && npm run unit", + "preversion": "npm run test", + "postversion": "git push origin master --tags && npm publish", + "patch": "npm version patch -m \"Tag v%s\"", + "minor": "npm version minor -m \"Tag v%s\"", + "major": "npm version major -m \"Tag v%s\"", + "chart": "mkdir -p dist && rm -rf dist/stackedit && cp -r chart dist/stackedit && sed -i.bak -e s/STACKEDIT_VERSION/$npm_package_version/g dist/stackedit/*.yaml && rm dist/stackedit/*.yaml.bak" + }, + "dependencies": { + "@vue/test-utils": "^1.0.0-beta.16", + "abcjs": "^5.2.0", + "babel-runtime": "^6.26.0", + "bezier-easing": "^1.1.0", + "body-parser": "^1.18.2", + "clipboard": "^1.7.1", + "compression": "^1.7.0", + "diff-match-patch": "^1.0.0", + "file-saver": "^1.3.8", + "handlebars": "^4.0.10", + "indexeddbshim": "^3.6.2", + "js-yaml": "^3.11.0", + "katex": "^0.16.2", + "markdown-it": "^8.4.1", + "markdown-it-abbr": "^1.0.4", + "markdown-it-deflist": "^2.0.2", + "markdown-it-emoji": "^1.3.0", + "markdown-it-footnote": "^3.0.1", + "markdown-it-imsize": "^2.0.1", + "markdown-it-mark": "^2.0.0", + "markdown-it-pandoc-renderer": "1.1.3", + "markdown-it-sub": "^1.0.0", + "markdown-it-sup": "^1.0.0", + "mermaid": "^8.9.2", + "mousetrap": "^1.6.1", + "normalize-scss": "^7.0.1", + "prismjs": "^1.6.0", + "request": "^2.85.0", + "serve-static": "^1.13.2", + "tmp": "^0.0.33", + "turndown": "^7.1.1", + "vue": "^2.5.16", + "vuex": "^3.0.1" + }, + "devDependencies": { + "autoprefixer": "^6.7.2", + "babel-core": "^6.26.3", + "babel-eslint": "^8.2.3", + "babel-jest": "^21.0.2", + "babel-loader": "^7.1.4", + "babel-plugin-dynamic-import-node": "^1.2.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-polyfill": "^6.23.0", + "babel-preset-env": "^1.7.0", + "babel-preset-stage-2": "^6.22.0", + "babel-register": "^6.22.0", + "chalk": "^1.1.3", + "connect-history-api-fallback": "^1.3.0", + "copy-webpack-plugin": "^4.5.1", + "css-loader": "^0.28.11", + "eslint": "^4.19.1", + "eslint-config-airbnb-base": "^12.1.0", + "eslint-friendly-formatter": "^4.0.1", + "eslint-import-resolver-webpack": "^0.9.0", + "eslint-loader": "^2.0.0", + "eslint-plugin-html": "^4.0.3", + "eslint-plugin-import": "^2.11.0", + "eventsource-polyfill": "^0.9.6", + "express": "^4.16.3", + "extract-text-webpack-plugin": "^2.0.0", + "favicons-webpack-plugin": "^0.0.9", + "file-loader": "^1.1.11", + "friendly-errors-webpack-plugin": "^1.7.0", + "gulp": "^4.0.2", + "gulp-concat": "^2.6.1", + "html-webpack-plugin": "^3.2.0", + "http-proxy-middleware": "^0.18.0", + "identity-obj-proxy": "^3.0.0", + "ignore-loader": "^0.1.2", + "jest": "^23.0.0", + "jest-raw-loader": "^1.0.1", + "jest-serializer-vue": "^0.3.0", + "js-md5": "^0.7.3", + "node-sass": "^4.0.0", + "npm-bump": "^0.0.23", + "offline-plugin": "^5.0.3", + "opn": "^4.0.2", + "optimize-css-assets-webpack-plugin": "^1.3.2", + "ora": "^1.2.0", + "raw-loader": "^0.5.1", + "replace-in-file": "^4.1.0", + "rimraf": "^2.6.0", + "sass-loader": "^7.0.1", + "semver": "^5.5.0", + "shelljs": "^0.8.1", + "string-replace-loader": "^2.1.1", + "stylelint": "^9.2.0", + "stylelint-config-standard": "^16.0.0", + "stylelint-processor-html": "^1.0.0", + "stylelint-webpack-plugin": "^0.10.4", + "url-loader": "^1.0.1", + "vue-jest": "^1.0.2", + "vue-loader": "^15.0.9", + "vue-style-loader": "^4.1.0", + "vue-template-compiler": "^2.5.16", + "webpack": "^2.6.1", + "webpack-bundle-analyzer": "^3.3.2", + "webpack-dev-middleware": "^1.10.0", + "webpack-hot-middleware": "^2.18.0", + "webpack-merge": "^4.1.2", + "webpack-pwa-manifest": "^3.7.1", + "worker-loader": "^1.1.1" + }, + "engines": { + "node": ">= 8.0.0", + "npm": ">= 5.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 10" + ] +} diff --git a/server/conf.js b/server/conf.js new file mode 100644 index 0000000..d9ef0c0 --- /dev/null +++ b/server/conf.js @@ -0,0 +1,54 @@ +const pandocPath = process.env.PANDOC_PATH || 'pandoc'; +const wkhtmltopdfPath = process.env.WKHTMLTOPDF_PATH || 'wkhtmltopdf'; +const paypalReceiverEmail = process.env.PAYPAL_RECEIVER_EMAIL; + +const dropboxAppKey = process.env.DROPBOX_APP_KEY; +const dropboxAppKeyFull = process.env.DROPBOX_APP_KEY_FULL; +const githubClientId = process.env.GITHUB_CLIENT_ID; +const githubClientSecret = process.env.GITHUB_CLIENT_SECRET; +const giteeClientId = process.env.GITEE_CLIENT_ID; +const giteeClientSecret = process.env.GITEE_CLIENT_SECRET; +const googleClientId = process.env.GOOGLE_CLIENT_ID; +const googleApiKey = process.env.GOOGLE_API_KEY; +const wordpressClientId = process.env.WORDPRESS_CLIENT_ID; +const giteaClientId = process.env.GITEA_CLIENT_ID; +const giteaClientSecret = process.env.GITEA_CLIENT_SECRET; +const giteaUrl = process.env.GITEA_URL; +const gitlabClientId = process.env.GITLAB_CLIENT_ID; +const gitlabClientSecret = process.env.GITLAB_CLIENT_SECRET; +const gitlabUrl = process.env.GITLAB_URL; + +exports.values = { + pandocPath, + wkhtmltopdfPath, + paypalReceiverEmail, + dropboxAppKey, + dropboxAppKeyFull, + githubClientId, + githubClientSecret, + giteeClientId, + giteeClientSecret, + googleClientId, + googleApiKey, + wordpressClientId, + giteaClientId, + giteaClientSecret, + giteaUrl, + gitlabClientId, + gitlabClientSecret, + gitlabUrl, +}; + +exports.publicValues = { + dropboxAppKey, + dropboxAppKeyFull, + githubClientId, + googleClientId, + googleApiKey, + wordpressClientId, + allowSponsorship: !!paypalReceiverEmail, + giteaClientId, + giteaUrl, + gitlabClientId, + gitlabUrl, +}; diff --git a/server/gitea.js b/server/gitea.js new file mode 100644 index 0000000..1fd0d25 --- /dev/null +++ b/server/gitea.js @@ -0,0 +1,40 @@ +const request = require('request'); +const conf = require('./conf'); + +function giteaToken(queryParam) { + return new Promise((resolve, reject) => { + request({ + method: 'POST', + url: `${conf.values.giteaUrl}/login/oauth/access_token`, + headers: { + 'content-type': 'application/json', + }, + json: true, + body: { + ...queryParam, + client_id: conf.values.giteaClientId, + client_secret: conf.values.giteaClientSecret, + }, + }, (err, res, body) => { + if (err) { + reject(err); + } + const token = body.access_token; + if (token) { + resolve(body); + } else { + reject(res.statusCode + ',body:' + JSON.stringify(body)); + } + }); + }); +} + +exports.giteaToken = (req, res) => { + giteaToken(req.query) + .then( + tokenBody => res.send(tokenBody), + err => res + .status(400) + .send(err ? err.message || err.toString() : 'bad_code'), + ); +}; diff --git a/server/gitee.js b/server/gitee.js new file mode 100644 index 0000000..8f5c6fd --- /dev/null +++ b/server/gitee.js @@ -0,0 +1,42 @@ +const qs = require('qs'); // eslint-disable-line import/no-extraneous-dependencies +const request = require('request'); +const conf = require('./conf'); + +function giteeToken(clientId, code, oauth2RedirectUri) { + const clientIndex = conf.values.giteeClientId.split(',').indexOf(clientId); + const clientSecret = conf.values.giteeClientSecret.split(',')[clientIndex]; + return new Promise((resolve, reject) => { + request({ + method: 'POST', + url: 'https://gitee.com/oauth/token', + form: { + client_id: clientId, + client_secret: clientSecret, + code, + grant_type: 'authorization_code', + redirect_uri: oauth2RedirectUri, + }, + json: true + }, (err, res, body) => { + if (err) { + reject(err); + } + const token = body.access_token; + if (token) { + resolve(body); + } else { + reject(res.statusCode + ',body:' + JSON.stringify(body)); + } + }); + }); +} + +exports.giteeToken = (req, res) => { + giteeToken(req.query.clientId, req.query.code, req.query.oauth2RedirectUri) + .then( + tokenBody => res.send(tokenBody), + err => res + .status(400) + .send(err ? err.message || err.toString() : 'bad_code'), + ); +}; diff --git a/server/github.js b/server/github.js new file mode 100644 index 0000000..83aff9e --- /dev/null +++ b/server/github.js @@ -0,0 +1,37 @@ +const qs = require('qs'); // eslint-disable-line import/no-extraneous-dependencies +const request = require('request'); +const conf = require('./conf'); + +function githubToken(clientId, code) { + return new Promise((resolve, reject) => { + request({ + method: 'POST', + url: 'https://github.com/login/oauth/access_token', + qs: { + client_id: clientId, + client_secret: conf.values.githubClientSecret, + code, + }, + }, (err, res, body) => { + if (err) { + reject(err); + } + const token = qs.parse(body).access_token; + if (token) { + resolve(token); + } else { + reject(res.statusCode); + } + }); + }); +} + +exports.githubToken = (req, res) => { + githubToken(req.query.clientId, req.query.code) + .then( + token => res.send(token), + err => res + .status(400) + .send(err ? err.message || err.toString() : 'bad_code'), + ); +}; diff --git a/server/gitlab.js b/server/gitlab.js new file mode 100644 index 0000000..170cde3 --- /dev/null +++ b/server/gitlab.js @@ -0,0 +1,40 @@ +const request = require('request'); +const conf = require('./conf'); + +function gitlabToken(queryParam) { + return new Promise((resolve, reject) => { + request({ + method: 'POST', + url: `${conf.values.gitlabUrl}/oauth/token`, + headers: { + 'content-type': 'application/json', + }, + json: true, + qs: { + ...queryParam, + client_id: conf.values.gitlabClientId, + client_secret: conf.values.gitlabClientSecret, + }, + }, (err, res, body) => { + if (err) { + reject(err); + } + const token = body.access_token; + if (token) { + resolve(body); + } else { + reject(res.statusCode + ',body:' + JSON.stringify(body)); + } + }); + }); +} + +exports.gitlabToken = (req, res) => { + gitlabToken(req.query) + .then( + tokenBody => res.send(tokenBody), + err => res + .status(400) + .send(err ? err.message || err.toString() : 'bad_code'), + ); +}; diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..2b60425 --- /dev/null +++ b/server/index.js @@ -0,0 +1,89 @@ +const compression = require('compression'); +const serveStatic = require('serve-static'); +const bodyParser = require('body-parser'); +const path = require('path'); +const github = require('./github'); +const gitee = require('./gitee'); +const gitea = require('./gitea'); +const gitlab = require('./gitlab'); +const pdf = require('./pdf'); +const pandoc = require('./pandoc'); +const conf = require('./conf'); + +const resolvePath = pathToResolve => path.join(__dirname, '..', pathToResolve); + +module.exports = (app) => { + if (process.env.NODE_ENV === 'production') { + // Enable CORS for fonts + app.all('*', (req, res, next) => { + if (/\.(eot|ttf|woff2?|svg)$/.test(req.url)) { + res.header('Access-Control-Allow-Origin', '*'); + } + next(); + }); + + // Use gzip compression + app.use(compression()); + } + + app.get('/oauth2/githubToken', github.githubToken); + app.get('/oauth2/giteeToken', gitee.giteeToken); + app.get('/oauth2/giteaToken', gitea.giteaToken); + app.get('/oauth2/gitlabToken', gitlab.gitlabToken); + app.get('/conf', (req, res) => res.send(conf.publicValues)); + app.post('/pdfExport', pdf.generate); + app.post('/pandocExport', pandoc.generate); + app.get('/giteeClientId', (req, res) => { + const giteeClientIds = conf.values.giteeClientId.split(','); + // 仅一个 则直接返回 + if (giteeClientIds.length === 1) { + res.send(giteeClientIds[0]); + return; + } + // 是否随机一个clientId 默认第一个 如果random 为1 则使用随机 避免单个应用接口次数用满无法自动切换其他应用 + const random = req.query.random; + if (!random) { + res.send(giteeClientIds[0]); + return; + } + // 随机一个 排除第一个 因为第一个应用接口次数用完了 + const clientId = giteeClientIds[Math.floor(((giteeClientIds.length - 1) * Math.random())) + 1]; + res.send(clientId); + }); + // Serve landing.html + app.get('/', (req, res) => res.sendFile(resolvePath('static/landing/index.html'))); + // Serve privacy_policy.html + app.get('/privacy_policy.html', (req, res) => res.sendFile(resolvePath('static/landing/privacy_policy.html'))); + // Serve sitemap.xml + app.get('/sitemap.xml', (req, res) => res.sendFile(resolvePath('static/sitemap.xml'))); + // Serve callback.html + app.get('/oauth2/callback', (req, res) => res.sendFile(resolvePath('static/oauth2/callback.html'))); + // Google Drive action receiver + app.get('/googleDriveAction', (req, res) => + res.redirect(`./app#providerId=googleDrive&state=${encodeURIComponent(req.query.state)}`)); + // Serve the static folder with 30 day max-age + app.use('/themes', serveStatic(resolvePath('static/themes'), { + maxAge: '5d', + })); + + // Serve style.css with 1 day max-age + app.get('/style.css', (req, res) => res.sendFile(resolvePath('dist/style.css'), { + maxAge: '1d', + })); + // Serve share.html + app.get('/share.html', (req, res) => res.sendFile(resolvePath('static/landing/share.html'))); + app.get('/gistshare.html', (req, res) => res.sendFile(resolvePath('static/landing/gistshare.html'))); + + // Serve static resources + if (process.env.NODE_ENV === 'production') { + // Serve index.html in /app + app.get('/app', (req, res) => res.sendFile(resolvePath('dist/index.html'))); + + // Serve the static folder with 1 year max-age + app.use('/static', serveStatic(resolvePath('dist/static'), { + maxAge: '1y', + })); + + app.use(serveStatic(resolvePath('dist'))); + } +}; diff --git a/server/pandoc.js b/server/pandoc.js new file mode 100644 index 0000000..cf93ac5 --- /dev/null +++ b/server/pandoc.js @@ -0,0 +1,141 @@ +/* global window */ +const { spawn } = require('child_process'); +const fs = require('fs'); +const tmp = require('tmp'); +const conf = require('./conf'); + +const outputFormats = { + asciidoc: 'text/plain', + context: 'application/x-latex', + epub: 'application/epub+zip', + epub3: 'application/epub+zip', + latex: 'application/x-latex', + odt: 'application/vnd.oasis.opendocument.text', + pdf: 'application/pdf', + rst: 'text/plain', + rtf: 'application/rtf', + textile: 'text/plain', + docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', +}; + +const highlightStyles = [ + 'pygments', + 'kate', + 'monochrome', + 'espresso', + 'zenburn', + 'haddock', + 'tango', +]; + +const readJson = (str) => { + try { + return JSON.parse(str); + } catch (e) { + return {}; + } +}; + +exports.generate = (req, res) => { + let pandocError = ''; + const outputFormat = Object.prototype.hasOwnProperty.call(outputFormats, req.query.format) + ? req.query.format + : 'pdf'; + new Promise((resolve, reject) => { + tmp.file({ + postfix: `.${outputFormat}`, + }, (err, filePath, fd, cleanupCallback) => { + if (err) { + reject(err); + } else { + resolve({ + filePath, + cleanupCallback, + }); + } + }); + }).then(({ filePath, cleanupCallback }) => new Promise((resolve, reject) => { + const options = readJson(req.query.options); + const metadata = readJson(req.query.metadata); + const params = []; + + params.push('--pdf-engine=xelatex'); + params.push('--webtex=http://chart.apis.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chco=000000&chl='); + if (options.toc) { + params.push('--toc'); + } + options.tocDepth = parseInt(options.tocDepth, 10); + if (!Number.isNaN(options.tocDepth)) { + params.push('--toc-depth', options.tocDepth); + } + options.highlightStyle = highlightStyles.includes(options.highlightStyle) ? options.highlightStyle : 'kate'; + params.push('--highlight-style', options.highlightStyle); + Object.keys(metadata).forEach((key) => { + params.push('-M', `${key}=${metadata[key]}`); + }); + + let finished = false; + + function onError(error) { + finished = true; + cleanupCallback(); + reject(error); + } + + const format = outputFormat === 'pdf' ? 'latex' : outputFormat; + params.push('-f', 'json', '-t', format, '-o', filePath); + const pandoc = spawn(conf.values.pandocPath, params, { + stdio: [ + 'pipe', + 'ignore', + 'pipe', + ], + }); + let timeoutId = setTimeout(() => { + timeoutId = null; + pandoc.kill(); + }, 50000); + pandoc.on('error', onError); + pandoc.stdin.on('error', onError); + pandoc.stderr.on('data', (data) => { + pandocError += `${data}`; + }); + pandoc.on('close', (code) => { + if (!finished) { + clearTimeout(timeoutId); + if (!timeoutId) { + res.statusCode = 408; + cleanupCallback(); + reject(new Error('timeout')); + } else if (code) { + cleanupCallback(); + reject(); + } else { + res.set('Content-Type', outputFormats[outputFormat]); + const readStream = fs.createReadStream(filePath); + readStream.on('open', () => readStream.pipe(res)); + readStream.on('close', () => cleanupCallback()); + readStream.on('error', () => { + cleanupCallback(); + reject(); + }); + } + } + }); + req.pipe(pandoc.stdin); + })) + .catch((err) => { + console.error(err); + const message = err && err.message; + if (message === 'unauthorized') { + res.statusCode = 401; + res.end('Unauthorized.'); + } else if (message === 'timeout') { + res.statusCode = 408; + res.end('Request timeout.'); + } else { + res.statusCode = 400; + res.end(pandocError || 'Unknown error.'); + } + }); +}; diff --git a/server/pdf.js b/server/pdf.js new file mode 100644 index 0000000..f898b8a --- /dev/null +++ b/server/pdf.js @@ -0,0 +1,178 @@ +/* global window,MathJax */ +const { spawn } = require('child_process'); +const fs = require('fs'); +const tmp = require('tmp'); +const conf = require('./conf'); + +/* eslint-disable no-var, prefer-arrow-callback, func-names */ +function waitForJavaScript() { + if (window.MathJax) { + // Amazon EC2: fix TeX font detection + MathJax.Hub.Register.StartupHook('HTML-CSS Jax Startup', function () { + var htmlCss = MathJax.OutputJax['HTML-CSS']; + htmlCss.Font.checkWebFont = function (check, font, callback) { + if (check.time(callback)) { + return; + } + if (check.total === 0) { + htmlCss.Font.testFont(font); + setTimeout(check, 200); + } else { + callback(check.STATUS.OK); + } + }; + }); + MathJax.Hub.Queue(function () { + window.status = 'done'; + }); + } else { + setTimeout(function () { + window.status = 'done'; + }, 2000); + } +} +/* eslint-disable no-var, prefer-arrow-callback, func-names */ + +const authorizedPageSizes = [ + 'A3', + 'A4', + 'Legal', + 'Letter', +]; + +const readJson = (str) => { + try { + return JSON.parse(str); + } catch (e) { + return {}; + } +}; + +exports.generate = (req, res) => { + let wkhtmltopdfError = ''; + new Promise((resolve, reject) => { + tmp.file((err, filePath, fd, cleanupCallback) => { + if (err) { + reject(err); + } else { + resolve({ + filePath, + cleanupCallback, + }); + } + }); + }).then(({ filePath, cleanupCallback }) => new Promise((resolve, reject) => { + let finished = false; + + function onError(err) { + finished = true; + cleanupCallback(); + reject(err); + } + const options = readJson(req.query.options); + const params = []; + + // Margins + const marginTop = parseInt(`${options.marginTop}`, 10); + params.push('-T', Number.isNaN(marginTop) ? 25 : marginTop); + const marginRight = parseInt(`${options.marginRight}`, 10); + params.push('-R', Number.isNaN(marginRight) ? 25 : marginRight); + const marginBottom = parseInt(`${options.marginBottom}`, 10); + params.push('-B', Number.isNaN(marginBottom) ? 25 : marginBottom); + const marginLeft = parseInt(`${options.marginLeft}`, 10); + params.push('-L', Number.isNaN(marginLeft) ? 25 : marginLeft); + + // Header + if (options.headerCenter) { + params.push('--header-center', `${options.headerCenter}`); + } + if (options.headerLeft) { + params.push('--header-left', `${options.headerLeft}`); + } + if (options.headerRight) { + params.push('--header-right', `${options.headerRight}`); + } + if (options.headerFontName) { + params.push('--header-font-name', `${options.headerFontName}`); + } + if (options.headerFontSize) { + params.push('--header-font-size', `${options.headerFontSize}`); + } + + // Footer + if (options.footerCenter) { + params.push('--footer-center', `${options.footerCenter}`); + } + if (options.footerLeft) { + params.push('--footer-left', `${options.footerLeft}`); + } + if (options.footerRight) { + params.push('--footer-right', `${options.footerRight}`); + } + if (options.footerFontName) { + params.push('--footer-font-name', `${options.footerFontName}`); + } + if (options.footerFontSize) { + params.push('--footer-font-size', `${options.footerFontSize}`); + } + + // Page size + params.push('--page-size', !authorizedPageSizes.includes(options.pageSize) ? 'A4' : options.pageSize); + + // Use a temp file as wkhtmltopdf can't access /dev/stdout on Amazon EC2 for some reason + params.push('--run-script', `${waitForJavaScript.toString()}waitForJavaScript()`); + params.push('--window-status', 'done'); + const wkhtmltopdf = spawn(conf.values.wkhtmltopdfPath, params.concat('-', filePath), { + stdio: [ + 'pipe', + 'ignore', + 'pipe', + ], + }); + let timeoutId = setTimeout(function () { + timeoutId = null; + wkhtmltopdf.kill(); + }, 50000); + wkhtmltopdf.on('error', onError); + wkhtmltopdf.stdin.on('error', onError); + wkhtmltopdf.stderr.on('data', (data) => { + wkhtmltopdfError += `${data}`; + }); + wkhtmltopdf.on('close', (code) => { + if (!finished) { + clearTimeout(timeoutId); + if (!timeoutId) { + cleanupCallback(); + reject(new Error('timeout')); + } else if (code) { + cleanupCallback(); + reject(); + } else { + res.set('Content-Type', 'application/pdf'); + const readStream = fs.createReadStream(filePath); + readStream.on('open', () => readStream.pipe(res)); + readStream.on('close', () => cleanupCallback()); + readStream.on('error', () => { + cleanupCallback(); + reject(); + }); + } + } + }); + req.pipe(wkhtmltopdf.stdin); + })) + .catch((err) => { + console.error(err); + const message = err && err.message; + if (message === 'unauthorized') { + res.statusCode = 401; + res.end('Unauthorized.'); + } else if (message === 'timeout') { + res.statusCode = 408; + res.end('Request timeout.'); + } else { + res.statusCode = 400; + res.end(wkhtmltopdfError || 'Unknown error.'); + } + }); +}; diff --git a/src/assets/favicon.png b/src/assets/favicon.png new file mode 100644 index 0000000..8560f2e Binary files /dev/null and b/src/assets/favicon.png differ diff --git a/src/assets/fonts/RobotoMono-Bold.woff b/src/assets/fonts/RobotoMono-Bold.woff new file mode 100644 index 0000000..780aa1b Binary files /dev/null and b/src/assets/fonts/RobotoMono-Bold.woff differ diff --git a/src/assets/fonts/RobotoMono-Regular.woff b/src/assets/fonts/RobotoMono-Regular.woff new file mode 100644 index 0000000..8cb9e6f Binary files /dev/null and b/src/assets/fonts/RobotoMono-Regular.woff differ diff --git a/src/assets/fonts/lato-black-italic.woff b/src/assets/fonts/lato-black-italic.woff new file mode 100644 index 0000000..30f2c71 Binary files /dev/null and b/src/assets/fonts/lato-black-italic.woff differ diff --git a/src/assets/fonts/lato-black.woff b/src/assets/fonts/lato-black.woff new file mode 100644 index 0000000..a0ab25e Binary files /dev/null and b/src/assets/fonts/lato-black.woff differ diff --git a/src/assets/fonts/lato-normal-italic.woff b/src/assets/fonts/lato-normal-italic.woff new file mode 100644 index 0000000..76114bc Binary files /dev/null and b/src/assets/fonts/lato-normal-italic.woff differ diff --git a/src/assets/fonts/lato-normal.woff b/src/assets/fonts/lato-normal.woff new file mode 100644 index 0000000..ae1307f Binary files /dev/null and b/src/assets/fonts/lato-normal.woff differ diff --git a/src/assets/iconBlogger.svg b/src/assets/iconBlogger.svg new file mode 100644 index 0000000..3d7a03f --- /dev/null +++ b/src/assets/iconBlogger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/iconCouchdb.svg b/src/assets/iconCouchdb.svg new file mode 100644 index 0000000..5827634 --- /dev/null +++ b/src/assets/iconCouchdb.svg @@ -0,0 +1,4 @@ + + + diff --git a/src/assets/iconCustom.svg b/src/assets/iconCustom.svg new file mode 100644 index 0000000..774ece8 --- /dev/null +++ b/src/assets/iconCustom.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/assets/iconDropbox.svg b/src/assets/iconDropbox.svg new file mode 100644 index 0000000..480a0bc --- /dev/null +++ b/src/assets/iconDropbox.svg @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/src/assets/iconGitea.svg b/src/assets/iconGitea.svg new file mode 100644 index 0000000..3aaeb85 --- /dev/null +++ b/src/assets/iconGitea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/iconGitee.svg b/src/assets/iconGitee.svg new file mode 100644 index 0000000..816bb79 --- /dev/null +++ b/src/assets/iconGitee.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/assets/iconGithub.svg b/src/assets/iconGithub.svg new file mode 100644 index 0000000..1f6605a --- /dev/null +++ b/src/assets/iconGithub.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/src/assets/iconGithubDark.svg b/src/assets/iconGithubDark.svg new file mode 100644 index 0000000..7e46f50 --- /dev/null +++ b/src/assets/iconGithubDark.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/src/assets/iconGitlab.svg b/src/assets/iconGitlab.svg new file mode 100644 index 0000000..c87fa3b --- /dev/null +++ b/src/assets/iconGitlab.svg @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/src/assets/iconGoogle.svg b/src/assets/iconGoogle.svg new file mode 100644 index 0000000..956716d --- /dev/null +++ b/src/assets/iconGoogle.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/src/assets/iconGoogleDrive.svg b/src/assets/iconGoogleDrive.svg new file mode 100644 index 0000000..8593ea8 --- /dev/null +++ b/src/assets/iconGoogleDrive.svg @@ -0,0 +1,8 @@ + + + + + + + diff --git a/src/assets/iconGooglePhotos.svg b/src/assets/iconGooglePhotos.svg new file mode 100644 index 0000000..ab6635d --- /dev/null +++ b/src/assets/iconGooglePhotos.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/src/assets/iconSmms.svg b/src/assets/iconSmms.svg new file mode 100644 index 0000000..f7c237d --- /dev/null +++ b/src/assets/iconSmms.svg @@ -0,0 +1,25 @@ + + \ No newline at end of file diff --git a/src/assets/iconStackedit.svg b/src/assets/iconStackedit.svg new file mode 100644 index 0000000..01baa7b --- /dev/null +++ b/src/assets/iconStackedit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/iconWordpress.svg b/src/assets/iconWordpress.svg new file mode 100644 index 0000000..1c24b9b --- /dev/null +++ b/src/assets/iconWordpress.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/src/assets/iconZendesk.svg b/src/assets/iconZendesk.svg new file mode 100644 index 0000000..7eec78a --- /dev/null +++ b/src/assets/iconZendesk.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 0000000..5611016 --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/App.vue b/src/components/App.vue new file mode 100644 index 0000000..3b7795f --- /dev/null +++ b/src/components/App.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/components/ButtonBar.vue b/src/components/ButtonBar.vue new file mode 100644 index 0000000..b4ca7e8 --- /dev/null +++ b/src/components/ButtonBar.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/components/CodeEditor.vue b/src/components/CodeEditor.vue new file mode 100644 index 0000000..145e477 --- /dev/null +++ b/src/components/CodeEditor.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/components/ContextMenu.vue b/src/components/ContextMenu.vue new file mode 100644 index 0000000..236ca5d --- /dev/null +++ b/src/components/ContextMenu.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/src/components/Editor.vue b/src/components/Editor.vue new file mode 100644 index 0000000..6569c0a --- /dev/null +++ b/src/components/Editor.vue @@ -0,0 +1,171 @@ + + + + + diff --git a/src/components/EditorInPageButtons.vue b/src/components/EditorInPageButtons.vue new file mode 100644 index 0000000..546d6c7 --- /dev/null +++ b/src/components/EditorInPageButtons.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/components/Explorer.vue b/src/components/Explorer.vue new file mode 100644 index 0000000..406b74a --- /dev/null +++ b/src/components/Explorer.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/src/components/ExplorerNode.vue b/src/components/ExplorerNode.vue new file mode 100644 index 0000000..abbcea1 --- /dev/null +++ b/src/components/ExplorerNode.vue @@ -0,0 +1,292 @@ + + + + + diff --git a/src/components/FindReplace.vue b/src/components/FindReplace.vue new file mode 100644 index 0000000..cb5dba3 --- /dev/null +++ b/src/components/FindReplace.vue @@ -0,0 +1,395 @@ + + + + + diff --git a/src/components/Layout.vue b/src/components/Layout.vue new file mode 100644 index 0000000..5db9eb3 --- /dev/null +++ b/src/components/Layout.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/src/components/Modal.vue b/src/components/Modal.vue new file mode 100644 index 0000000..6cd5288 --- /dev/null +++ b/src/components/Modal.vue @@ -0,0 +1,489 @@ + + + + + diff --git a/src/components/NavigationBar.vue b/src/components/NavigationBar.vue new file mode 100644 index 0000000..6688063 --- /dev/null +++ b/src/components/NavigationBar.vue @@ -0,0 +1,543 @@ + + + + + diff --git a/src/components/Notification.vue b/src/components/Notification.vue new file mode 100644 index 0000000..038af70 --- /dev/null +++ b/src/components/Notification.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/src/components/Preview.vue b/src/components/Preview.vue new file mode 100644 index 0000000..c93f357 --- /dev/null +++ b/src/components/Preview.vue @@ -0,0 +1,181 @@ + + + + + + diff --git a/src/components/PreviewInPageButtons.vue b/src/components/PreviewInPageButtons.vue new file mode 100644 index 0000000..aaec6bd --- /dev/null +++ b/src/components/PreviewInPageButtons.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue new file mode 100644 index 0000000..052e337 --- /dev/null +++ b/src/components/SideBar.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/components/SplashScreen.vue b/src/components/SplashScreen.vue new file mode 100644 index 0000000..b1ecd09 --- /dev/null +++ b/src/components/SplashScreen.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/components/StatusBar.vue b/src/components/StatusBar.vue new file mode 100644 index 0000000..b3180ce --- /dev/null +++ b/src/components/StatusBar.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/src/components/Toc.vue b/src/components/Toc.vue new file mode 100644 index 0000000..8d0a324 --- /dev/null +++ b/src/components/Toc.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/src/components/Tour.vue b/src/components/Tour.vue new file mode 100644 index 0000000..5b4e11e --- /dev/null +++ b/src/components/Tour.vue @@ -0,0 +1,254 @@ + + + + + + diff --git a/src/components/UserImage.vue b/src/components/UserImage.vue new file mode 100644 index 0000000..a46340d --- /dev/null +++ b/src/components/UserImage.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/UserName.vue b/src/components/UserName.vue new file mode 100644 index 0000000..d30b505 --- /dev/null +++ b/src/components/UserName.vue @@ -0,0 +1,27 @@ + + + diff --git a/src/components/common/DropdownMenu.vue b/src/components/common/DropdownMenu.vue new file mode 100644 index 0000000..09aeb70 --- /dev/null +++ b/src/components/common/DropdownMenu.vue @@ -0,0 +1,137 @@ + + + + + + \ No newline at end of file diff --git a/src/components/common/EditorClassApplier.js b/src/components/common/EditorClassApplier.js new file mode 100644 index 0000000..bc9bf9d --- /dev/null +++ b/src/components/common/EditorClassApplier.js @@ -0,0 +1,89 @@ +import cledit from '../../services/editor/cledit'; +import editorSvc from '../../services/editorSvc'; +import utils from '../../services/utils'; + +let savedSelection = null; +const nextTickCbs = []; +const nextTickExecCbs = cledit.Utils.debounce(() => { + while (nextTickCbs.length) { + nextTickCbs.shift()(); + } + if (savedSelection) { + editorSvc.clEditor.selectionMgr.setSelectionStartEnd( + savedSelection.start, + savedSelection.end, + ); + } + savedSelection = null; +}); + +const nextTick = (cb) => { + nextTickCbs.push(cb); + nextTickExecCbs(); +}; + +const nextTickRestoreSelection = () => { + savedSelection = { + start: editorSvc.clEditor.selectionMgr.selectionStart, + end: editorSvc.clEditor.selectionMgr.selectionEnd, + }; + nextTickExecCbs(); +}; + +export default class EditorClassApplier { + constructor(classGetter, offsetGetter, properties) { + this.classGetter = typeof classGetter === 'function' ? classGetter : () => classGetter; + this.offsetGetter = typeof offsetGetter === 'function' ? offsetGetter : () => offsetGetter; + this.properties = properties || {}; + this.eltCollection = editorSvc.editorElt.getElementsByClassName(this.classGetter()[0]); + this.lastEltCount = this.eltCollection.length; + + this.restoreClass = () => { + if (!this.eltCollection.length || this.eltCollection.length !== this.lastEltCount) { + this.removeClass(); + this.applyClass(); + } + }; + + editorSvc.clEditor.on('contentChanged', this.restoreClass); + nextTick(() => this.restoreClass()); + } + + applyClass() { + if (!this.stopped) { + const offset = this.offsetGetter(); + if (offset && offset.start !== offset.end) { + const range = editorSvc.clEditor.selectionMgr.createRange( + Math.min(offset.start, offset.end), + Math.max(offset.start, offset.end), + ); + const properties = { + ...this.properties, + className: this.classGetter().join(' '), + }; + editorSvc.clEditor.watcher.noWatch(() => { + utils.wrapRange(range, properties); + }); + if (editorSvc.clEditor.selectionMgr.hasFocus()) { + nextTickRestoreSelection(); + } + this.lastEltCount = this.eltCollection.length; + } + } + } + + removeClass() { + editorSvc.clEditor.watcher.noWatch(() => { + utils.unwrapRange(this.eltCollection); + }); + if (editorSvc.clEditor.selectionMgr.hasFocus()) { + nextTickRestoreSelection(); + } + } + + stop() { + editorSvc.clEditor.off('contentChanged', this.restoreClass); + nextTick(() => this.removeClass()); + this.stopped = true; + } +} diff --git a/src/components/common/PreviewClassApplier.js b/src/components/common/PreviewClassApplier.js new file mode 100644 index 0000000..58d9bd5 --- /dev/null +++ b/src/components/common/PreviewClassApplier.js @@ -0,0 +1,82 @@ +import cledit from '../../services/editor/cledit'; +import editorSvc from '../../services/editorSvc'; +import utils from '../../services/utils'; + +const nextTickCbs = []; +const nextTickExecCbs = cledit.Utils.debounce(() => { + while (nextTickCbs.length) { + nextTickCbs.shift()(); + } +}); + +const nextTick = (cb) => { + nextTickCbs.push(cb); + nextTickExecCbs(); +}; + +export default class PreviewClassApplier { + constructor(classGetter, offsetGetter, properties) { + this.classGetter = typeof classGetter === 'function' ? classGetter : () => classGetter; + this.offsetGetter = typeof offsetGetter === 'function' ? offsetGetter : () => offsetGetter; + this.properties = properties || {}; + this.eltCollection = editorSvc.previewElt.getElementsByClassName(this.classGetter()[0]); + this.lastEltCount = this.eltCollection.length; + + this.restoreClass = () => { + if (!editorSvc.previewCtxWithDiffs) { + this.removeClass(); + } else if (!this.eltCollection.length || this.eltCollection.length !== this.lastEltCount) { + this.removeClass(); + this.applyClass(); + } + }; + + editorSvc.$on('previewCtxWithDiffs', this.restoreClass); + nextTick(() => this.restoreClass()); + } + + applyClass() { + if (!this.stopped) { + const offset = this.offsetGetter(); + if (offset) { + const offsetStart = editorSvc.getPreviewOffset( + offset.start, + editorSvc.previewCtx.sectionDescList, + ); + const offsetEnd = editorSvc.getPreviewOffset( + offset.end, + editorSvc.previewCtx.sectionDescList, + ); + if (offsetStart != null && offsetEnd != null && offsetStart !== offsetEnd) { + const start = cledit.Utils.findContainer( + editorSvc.previewElt, + Math.min(offsetStart, offsetEnd), + ); + const end = cledit.Utils.findContainer( + editorSvc.previewElt, + Math.max(offsetStart, offsetEnd), + ); + const range = document.createRange(); + range.setStart(start.container, start.offsetInContainer); + range.setEnd(end.container, end.offsetInContainer); + const properties = { + ...this.properties, + className: this.classGetter().join(' '), + }; + utils.wrapRange(range, properties); + this.lastEltCount = this.eltCollection.length; + } + } + } + } + + removeClass() { + utils.unwrapRange(this.eltCollection); + } + + stop() { + editorSvc.$off('previewCtxWithDiffs', this.restoreClass); + nextTick(() => this.removeClass()); + this.stopped = true; + } +} diff --git a/src/components/common/vueGlobals.js b/src/components/common/vueGlobals.js new file mode 100644 index 0000000..d63c1ea --- /dev/null +++ b/src/components/common/vueGlobals.js @@ -0,0 +1,80 @@ +import Vue from 'vue'; +import Clipboard from 'clipboard'; +import timeSvc from '../../services/timeSvc'; +import store from '../../store'; + +// Global directives +Vue.directive('focus', { + inserted(el) { + el.focus(); + const { value } = el; + if (value && el.setSelectionRange) { + el.setSelectionRange(0, value.length); + } + }, +}); + +const setVisible = (el, value) => { + el.style.display = value ? '' : 'none'; + if (value) { + el.removeAttribute('aria-hidden'); + } else { + el.setAttribute('aria-hidden', 'true'); + } +}; +Vue.directive('show', { + bind(el, { value }) { + setVisible(el, value); + }, + update(el, { value, oldValue }) { + if (value !== oldValue) { + setVisible(el, value); + } + }, +}); + +const setElTitle = (el, title) => { + el.title = title; + el.setAttribute('aria-label', title); +}; +Vue.directive('title', { + bind(el, { value }) { + setElTitle(el, value); + }, + update(el, { value, oldValue }) { + if (value !== oldValue) { + setElTitle(el, value); + } + }, +}); + +// Clipboard directive +const createClipboard = (el, value) => { + el.seClipboard = new Clipboard(el, { text: () => value }); +}; +const destroyClipboard = (el) => { + if (el.seClipboard) { + el.seClipboard.destroy(); + el.seClipboard = null; + } +}; +Vue.directive('clipboard', { + bind(el, { value }) { + createClipboard(el, value); + }, + update(el, { value, oldValue }) { + if (value !== oldValue) { + destroyClipboard(el); + createClipboard(el, value); + } + }, + unbind(el) { + destroyClipboard(el); + }, +}); + +// Global filters +Vue.filter('formatTime', time => + // Access the time counter for reactive refresh + timeSvc.format(time, store.state.timeCounter)); + diff --git a/src/components/gutters/Comment.vue b/src/components/gutters/Comment.vue new file mode 100644 index 0000000..7941e5e --- /dev/null +++ b/src/components/gutters/Comment.vue @@ -0,0 +1,83 @@ + + + diff --git a/src/components/gutters/CommentList.vue b/src/components/gutters/CommentList.vue new file mode 100644 index 0000000..5e33c9c --- /dev/null +++ b/src/components/gutters/CommentList.vue @@ -0,0 +1,362 @@ + + + + + diff --git a/src/components/gutters/CurrentDiscussion.vue b/src/components/gutters/CurrentDiscussion.vue new file mode 100644 index 0000000..494149a --- /dev/null +++ b/src/components/gutters/CurrentDiscussion.vue @@ -0,0 +1,177 @@ + + + + + diff --git a/src/components/gutters/EditorNewDiscussionButton.vue b/src/components/gutters/EditorNewDiscussionButton.vue new file mode 100644 index 0000000..a9b7d8e --- /dev/null +++ b/src/components/gutters/EditorNewDiscussionButton.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/gutters/NewComment.vue b/src/components/gutters/NewComment.vue new file mode 100644 index 0000000..cd1db02 --- /dev/null +++ b/src/components/gutters/NewComment.vue @@ -0,0 +1,168 @@ + + + diff --git a/src/components/gutters/PreviewNewDiscussionButton.vue b/src/components/gutters/PreviewNewDiscussionButton.vue new file mode 100644 index 0000000..ac51d42 --- /dev/null +++ b/src/components/gutters/PreviewNewDiscussionButton.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/components/gutters/StickyComment.vue b/src/components/gutters/StickyComment.vue new file mode 100644 index 0000000..7988305 --- /dev/null +++ b/src/components/gutters/StickyComment.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/components/menus/EditThemeMenu.vue b/src/components/menus/EditThemeMenu.vue new file mode 100644 index 0000000..8291505 --- /dev/null +++ b/src/components/menus/EditThemeMenu.vue @@ -0,0 +1,116 @@ + + + + + + \ No newline at end of file diff --git a/src/components/menus/HistoryMenu.vue b/src/components/menus/HistoryMenu.vue new file mode 100644 index 0000000..90c13e9 --- /dev/null +++ b/src/components/menus/HistoryMenu.vue @@ -0,0 +1,474 @@ + + + + + diff --git a/src/components/menus/ImportExportMenu.vue b/src/components/menus/ImportExportMenu.vue new file mode 100644 index 0000000..0e83a0e --- /dev/null +++ b/src/components/menus/ImportExportMenu.vue @@ -0,0 +1,127 @@ + + + diff --git a/src/components/menus/MainMenu.vue b/src/components/menus/MainMenu.vue new file mode 100644 index 0000000..8fe5971 --- /dev/null +++ b/src/components/menus/MainMenu.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/components/menus/PreviewThemeMenu.vue b/src/components/menus/PreviewThemeMenu.vue new file mode 100644 index 0000000..7667074 --- /dev/null +++ b/src/components/menus/PreviewThemeMenu.vue @@ -0,0 +1,116 @@ + + + + + + \ No newline at end of file diff --git a/src/components/menus/PublishMenu.vue b/src/components/menus/PublishMenu.vue new file mode 100644 index 0000000..bdf03b8 --- /dev/null +++ b/src/components/menus/PublishMenu.vue @@ -0,0 +1,307 @@ + + + diff --git a/src/components/menus/SyncMenu.vue b/src/components/menus/SyncMenu.vue new file mode 100644 index 0000000..61f9ee8 --- /dev/null +++ b/src/components/menus/SyncMenu.vue @@ -0,0 +1,388 @@ + + + diff --git a/src/components/menus/WorkspaceBackupMenu.vue b/src/components/menus/WorkspaceBackupMenu.vue new file mode 100644 index 0000000..ad2f5e9 --- /dev/null +++ b/src/components/menus/WorkspaceBackupMenu.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/components/menus/WorkspacesMenu.vue b/src/components/menus/WorkspacesMenu.vue new file mode 100644 index 0000000..bb1f415 --- /dev/null +++ b/src/components/menus/WorkspacesMenu.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/src/components/menus/common/MenuEntry.vue b/src/components/menus/common/MenuEntry.vue new file mode 100644 index 0000000..36f0ca2 --- /dev/null +++ b/src/components/menus/common/MenuEntry.vue @@ -0,0 +1,97 @@ + + + diff --git a/src/components/menus/common/MenuItem.vue b/src/components/menus/common/MenuItem.vue new file mode 100644 index 0000000..6697bb3 --- /dev/null +++ b/src/components/menus/common/MenuItem.vue @@ -0,0 +1,93 @@ + + + diff --git a/src/components/modals/AboutModal.vue b/src/components/modals/AboutModal.vue new file mode 100644 index 0000000..145430e --- /dev/null +++ b/src/components/modals/AboutModal.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/modals/AccountManagementModal.vue b/src/components/modals/AccountManagementModal.vue new file mode 100644 index 0000000..3f7ea14 --- /dev/null +++ b/src/components/modals/AccountManagementModal.vue @@ -0,0 +1,369 @@ + + + + + diff --git a/src/components/modals/BadgeManagementModal.vue b/src/components/modals/BadgeManagementModal.vue new file mode 100644 index 0000000..12a4c50 --- /dev/null +++ b/src/components/modals/BadgeManagementModal.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/components/modals/ChatGptModal.vue b/src/components/modals/ChatGptModal.vue new file mode 100644 index 0000000..9101c8d --- /dev/null +++ b/src/components/modals/ChatGptModal.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/components/modals/CommitMessageModal.vue b/src/components/modals/CommitMessageModal.vue new file mode 100644 index 0000000..0159bce --- /dev/null +++ b/src/components/modals/CommitMessageModal.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/components/modals/FilePropertiesModal.vue b/src/components/modals/FilePropertiesModal.vue new file mode 100644 index 0000000..ec46e78 --- /dev/null +++ b/src/components/modals/FilePropertiesModal.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/src/components/modals/HtmlExportModal.vue b/src/components/modals/HtmlExportModal.vue new file mode 100644 index 0000000..a8e9b4e --- /dev/null +++ b/src/components/modals/HtmlExportModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/components/modals/ImageModal.vue b/src/components/modals/ImageModal.vue new file mode 100644 index 0000000..b5c8239 --- /dev/null +++ b/src/components/modals/ImageModal.vue @@ -0,0 +1,314 @@ + + + + diff --git a/src/components/modals/LinkModal.vue b/src/components/modals/LinkModal.vue new file mode 100644 index 0000000..20b4397 --- /dev/null +++ b/src/components/modals/LinkModal.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/components/modals/PandocExportModal.vue b/src/components/modals/PandocExportModal.vue new file mode 100644 index 0000000..84ea4d1 --- /dev/null +++ b/src/components/modals/PandocExportModal.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/modals/PdfExportModal.vue b/src/components/modals/PdfExportModal.vue new file mode 100644 index 0000000..df13a7b --- /dev/null +++ b/src/components/modals/PdfExportModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/components/modals/PublishManagementModal.vue b/src/components/modals/PublishManagementModal.vue new file mode 100644 index 0000000..323d053 --- /dev/null +++ b/src/components/modals/PublishManagementModal.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/src/components/modals/SettingsModal.vue b/src/components/modals/SettingsModal.vue new file mode 100644 index 0000000..826be27 --- /dev/null +++ b/src/components/modals/SettingsModal.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/src/components/modals/SponsorModal.vue b/src/components/modals/SponsorModal.vue new file mode 100644 index 0000000..db648fd --- /dev/null +++ b/src/components/modals/SponsorModal.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/components/modals/SyncManagementModal.vue b/src/components/modals/SyncManagementModal.vue new file mode 100644 index 0000000..38d0f12 --- /dev/null +++ b/src/components/modals/SyncManagementModal.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/src/components/modals/TemplatesModal.vue b/src/components/modals/TemplatesModal.vue new file mode 100644 index 0000000..71dd44a --- /dev/null +++ b/src/components/modals/TemplatesModal.vue @@ -0,0 +1,186 @@ + + + + + diff --git a/src/components/modals/WorkspaceImgPathModal.vue b/src/components/modals/WorkspaceImgPathModal.vue new file mode 100644 index 0000000..eb78d8c --- /dev/null +++ b/src/components/modals/WorkspaceImgPathModal.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/components/modals/WorkspaceManagementModal.vue b/src/components/modals/WorkspaceManagementModal.vue new file mode 100644 index 0000000..3e5017f --- /dev/null +++ b/src/components/modals/WorkspaceManagementModal.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/src/components/modals/common/FormEntry.vue b/src/components/modals/common/FormEntry.vue new file mode 100644 index 0000000..09f7512 --- /dev/null +++ b/src/components/modals/common/FormEntry.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/modals/common/ModalInner.vue b/src/components/modals/common/ModalInner.vue new file mode 100644 index 0000000..ffb8bc9 --- /dev/null +++ b/src/components/modals/common/ModalInner.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/components/modals/common/Tab.vue b/src/components/modals/common/Tab.vue new file mode 100644 index 0000000..6d5d55e --- /dev/null +++ b/src/components/modals/common/Tab.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/components/modals/common/modalTemplate.js b/src/components/modals/common/modalTemplate.js new file mode 100644 index 0000000..0a494ff --- /dev/null +++ b/src/components/modals/common/modalTemplate.js @@ -0,0 +1,79 @@ +import ModalInner from './ModalInner'; +import FormEntry from './FormEntry'; +import store from '../../../store'; + +const collator = new Intl.Collator(undefined, { sensitivity: 'base' }); + +export default (desc) => { + const component = { + ...desc, + data: () => ({ + ...desc.data ? desc.data() : {}, + errorTimeouts: {}, + }), + components: { + ...desc.components || {}, + ModalInner, + FormEntry, + }, + computed: { + ...desc.computed || {}, + config() { + return store.getters['modal/config']; + }, + currentFileName() { + return store.getters['file/current'].name; + }, + }, + methods: { + ...desc.methods || {}, + openFileProperties: () => store.dispatch('modal/open', 'fileProperties'), + setError(name) { + clearTimeout(this.errorTimeouts[name]); + const formEntry = this.$el.querySelector(`.form-entry[error=${name}]`); + if (formEntry) { + formEntry.classList.add('form-entry--error'); + this.errorTimeouts[name] = setTimeout(() => { + formEntry.classList.remove('form-entry--error'); + }, 1000); + } + }, + }, + }; + Object.entries(desc.computedLocalSettings || {}).forEach(([key, id]) => { + component.computed[key] = { + get() { + return store.getters['data/localSettings'][id]; + }, + set(value) { + store.dispatch('data/patchLocalSettings', { + [id]: value, + }); + }, + }; + if (key === 'selectedTemplate') { + component.computed.allTemplatesById = () => { + const allTemplatesById = store.getters['data/allTemplatesById']; + const sortedTemplatesById = {}; + Object.entries(allTemplatesById) + .sort(([, template1], [, template2]) => collator.compare(template1.name, template2.name)) + .forEach(([templateId, template]) => { + sortedTemplatesById[templateId] = template; + }); + return sortedTemplatesById; + }; + // Make use of `function` to have `this` bound to the component + component.methods.configureTemplates = async function () { // eslint-disable-line func-names + const { selectedId } = await store.dispatch('modal/open', { + type: 'templates', + selectedId: this.selectedTemplate, + }); + store.dispatch('data/patchLocalSettings', { + [id]: selectedId, + }); + }; + } + }); + component.computedLocalSettings = null; + return component; +}; diff --git a/src/components/modals/providers/BloggerPagePublishModal.vue b/src/components/modals/providers/BloggerPagePublishModal.vue new file mode 100644 index 0000000..9d8f96f --- /dev/null +++ b/src/components/modals/providers/BloggerPagePublishModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/components/modals/providers/BloggerPublishModal.vue b/src/components/modals/providers/BloggerPublishModal.vue new file mode 100644 index 0000000..beffde0 --- /dev/null +++ b/src/components/modals/providers/BloggerPublishModal.vue @@ -0,0 +1,68 @@ + + + diff --git a/src/components/modals/providers/CouchdbCredentialsModal.vue b/src/components/modals/providers/CouchdbCredentialsModal.vue new file mode 100644 index 0000000..b18b501 --- /dev/null +++ b/src/components/modals/providers/CouchdbCredentialsModal.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/modals/providers/CouchdbWorkspaceModal.vue b/src/components/modals/providers/CouchdbWorkspaceModal.vue new file mode 100644 index 0000000..9c906be --- /dev/null +++ b/src/components/modals/providers/CouchdbWorkspaceModal.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/components/modals/providers/CustomAccountModal.vue b/src/components/modals/providers/CustomAccountModal.vue new file mode 100644 index 0000000..e1d1e7c --- /dev/null +++ b/src/components/modals/providers/CustomAccountModal.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/components/modals/providers/DropboxAccountModal.vue b/src/components/modals/providers/DropboxAccountModal.vue new file mode 100644 index 0000000..1582662 --- /dev/null +++ b/src/components/modals/providers/DropboxAccountModal.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/components/modals/providers/DropboxPublishModal.vue b/src/components/modals/providers/DropboxPublishModal.vue new file mode 100644 index 0000000..e90e252 --- /dev/null +++ b/src/components/modals/providers/DropboxPublishModal.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/components/modals/providers/DropboxSaveModal.vue b/src/components/modals/providers/DropboxSaveModal.vue new file mode 100644 index 0000000..da8471a --- /dev/null +++ b/src/components/modals/providers/DropboxSaveModal.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/components/modals/providers/GistPublishModal.vue b/src/components/modals/providers/GistPublishModal.vue new file mode 100644 index 0000000..294e47d --- /dev/null +++ b/src/components/modals/providers/GistPublishModal.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/components/modals/providers/GistSyncModal.vue b/src/components/modals/providers/GistSyncModal.vue new file mode 100644 index 0000000..5899e0a --- /dev/null +++ b/src/components/modals/providers/GistSyncModal.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/components/modals/providers/GiteaAccountModal.vue b/src/components/modals/providers/GiteaAccountModal.vue new file mode 100644 index 0000000..1d4e04e --- /dev/null +++ b/src/components/modals/providers/GiteaAccountModal.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/modals/providers/GiteaImgStorageModal.vue b/src/components/modals/providers/GiteaImgStorageModal.vue new file mode 100644 index 0000000..f409fe3 --- /dev/null +++ b/src/components/modals/providers/GiteaImgStorageModal.vue @@ -0,0 +1,77 @@ + + + diff --git a/src/components/modals/providers/GiteaOpenModal.vue b/src/components/modals/providers/GiteaOpenModal.vue new file mode 100644 index 0000000..bcfacda --- /dev/null +++ b/src/components/modals/providers/GiteaOpenModal.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/components/modals/providers/GiteaPublishModal.vue b/src/components/modals/providers/GiteaPublishModal.vue new file mode 100644 index 0000000..250dba0 --- /dev/null +++ b/src/components/modals/providers/GiteaPublishModal.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/components/modals/providers/GiteaSaveModal.vue b/src/components/modals/providers/GiteaSaveModal.vue new file mode 100644 index 0000000..c30d9a3 --- /dev/null +++ b/src/components/modals/providers/GiteaSaveModal.vue @@ -0,0 +1,72 @@ + + + diff --git a/src/components/modals/providers/GiteaWorkspaceModal.vue b/src/components/modals/providers/GiteaWorkspaceModal.vue new file mode 100644 index 0000000..77fb9b7 --- /dev/null +++ b/src/components/modals/providers/GiteaWorkspaceModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/components/modals/providers/GiteeAccountModal.vue b/src/components/modals/providers/GiteeAccountModal.vue new file mode 100644 index 0000000..72dab6b --- /dev/null +++ b/src/components/modals/providers/GiteeAccountModal.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/modals/providers/GiteeGistPublishModal.vue b/src/components/modals/providers/GiteeGistPublishModal.vue new file mode 100644 index 0000000..f3da97c --- /dev/null +++ b/src/components/modals/providers/GiteeGistPublishModal.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/components/modals/providers/GiteeGistSyncModal.vue b/src/components/modals/providers/GiteeGistSyncModal.vue new file mode 100644 index 0000000..a23dd62 --- /dev/null +++ b/src/components/modals/providers/GiteeGistSyncModal.vue @@ -0,0 +1,64 @@ + + + diff --git a/src/components/modals/providers/GiteeOpenModal.vue b/src/components/modals/providers/GiteeOpenModal.vue new file mode 100644 index 0000000..7bc476c --- /dev/null +++ b/src/components/modals/providers/GiteeOpenModal.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/modals/providers/GiteePublishModal.vue b/src/components/modals/providers/GiteePublishModal.vue new file mode 100644 index 0000000..02c8f58 --- /dev/null +++ b/src/components/modals/providers/GiteePublishModal.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/components/modals/providers/GiteeSaveModal.vue b/src/components/modals/providers/GiteeSaveModal.vue new file mode 100644 index 0000000..b093b10 --- /dev/null +++ b/src/components/modals/providers/GiteeSaveModal.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/components/modals/providers/GiteeWorkspaceModal.vue b/src/components/modals/providers/GiteeWorkspaceModal.vue new file mode 100644 index 0000000..3a69564 --- /dev/null +++ b/src/components/modals/providers/GiteeWorkspaceModal.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/components/modals/providers/GithubAccountModal.vue b/src/components/modals/providers/GithubAccountModal.vue new file mode 100644 index 0000000..753be89 --- /dev/null +++ b/src/components/modals/providers/GithubAccountModal.vue @@ -0,0 +1,31 @@ + + + diff --git a/src/components/modals/providers/GithubImgStorageModal.vue b/src/components/modals/providers/GithubImgStorageModal.vue new file mode 100644 index 0000000..58673cd --- /dev/null +++ b/src/components/modals/providers/GithubImgStorageModal.vue @@ -0,0 +1,78 @@ + + + diff --git a/src/components/modals/providers/GithubOpenModal.vue b/src/components/modals/providers/GithubOpenModal.vue new file mode 100644 index 0000000..b902014 --- /dev/null +++ b/src/components/modals/providers/GithubOpenModal.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/modals/providers/GithubPublishModal.vue b/src/components/modals/providers/GithubPublishModal.vue new file mode 100644 index 0000000..d6fafd7 --- /dev/null +++ b/src/components/modals/providers/GithubPublishModal.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/components/modals/providers/GithubSaveModal.vue b/src/components/modals/providers/GithubSaveModal.vue new file mode 100644 index 0000000..39e84d1 --- /dev/null +++ b/src/components/modals/providers/GithubSaveModal.vue @@ -0,0 +1,73 @@ + + + diff --git a/src/components/modals/providers/GithubWorkspaceModal.vue b/src/components/modals/providers/GithubWorkspaceModal.vue new file mode 100644 index 0000000..b6a7c96 --- /dev/null +++ b/src/components/modals/providers/GithubWorkspaceModal.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/components/modals/providers/GitlabAccountModal.vue b/src/components/modals/providers/GitlabAccountModal.vue new file mode 100644 index 0000000..d62ec28 --- /dev/null +++ b/src/components/modals/providers/GitlabAccountModal.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/modals/providers/GitlabOpenModal.vue b/src/components/modals/providers/GitlabOpenModal.vue new file mode 100644 index 0000000..3966886 --- /dev/null +++ b/src/components/modals/providers/GitlabOpenModal.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/components/modals/providers/GitlabPublishModal.vue b/src/components/modals/providers/GitlabPublishModal.vue new file mode 100644 index 0000000..328311d --- /dev/null +++ b/src/components/modals/providers/GitlabPublishModal.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/components/modals/providers/GitlabSaveModal.vue b/src/components/modals/providers/GitlabSaveModal.vue new file mode 100644 index 0000000..247bff3 --- /dev/null +++ b/src/components/modals/providers/GitlabSaveModal.vue @@ -0,0 +1,72 @@ + + + diff --git a/src/components/modals/providers/GitlabWorkspaceModal.vue b/src/components/modals/providers/GitlabWorkspaceModal.vue new file mode 100644 index 0000000..38b68f9 --- /dev/null +++ b/src/components/modals/providers/GitlabWorkspaceModal.vue @@ -0,0 +1,67 @@ + + + diff --git a/src/components/modals/providers/GoogleDriveAccountModal.vue b/src/components/modals/providers/GoogleDriveAccountModal.vue new file mode 100644 index 0000000..f5a0c7c --- /dev/null +++ b/src/components/modals/providers/GoogleDriveAccountModal.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/components/modals/providers/GoogleDrivePublishModal.vue b/src/components/modals/providers/GoogleDrivePublishModal.vue new file mode 100644 index 0000000..5fb8fd4 --- /dev/null +++ b/src/components/modals/providers/GoogleDrivePublishModal.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/components/modals/providers/GoogleDriveSaveModal.vue b/src/components/modals/providers/GoogleDriveSaveModal.vue new file mode 100644 index 0000000..280da35 --- /dev/null +++ b/src/components/modals/providers/GoogleDriveSaveModal.vue @@ -0,0 +1,69 @@ + + + diff --git a/src/components/modals/providers/GoogleDriveWorkspaceModal.vue b/src/components/modals/providers/GoogleDriveWorkspaceModal.vue new file mode 100644 index 0000000..c8f69b8 --- /dev/null +++ b/src/components/modals/providers/GoogleDriveWorkspaceModal.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/components/modals/providers/GooglePhotoModal.vue b/src/components/modals/providers/GooglePhotoModal.vue new file mode 100644 index 0000000..47b7f7a --- /dev/null +++ b/src/components/modals/providers/GooglePhotoModal.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/components/modals/providers/SmmsAccountModal.vue b/src/components/modals/providers/SmmsAccountModal.vue new file mode 100644 index 0000000..71b136f --- /dev/null +++ b/src/components/modals/providers/SmmsAccountModal.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/components/modals/providers/WordpressPublishModal.vue b/src/components/modals/providers/WordpressPublishModal.vue new file mode 100644 index 0000000..0ba2d20 --- /dev/null +++ b/src/components/modals/providers/WordpressPublishModal.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/components/modals/providers/ZendeskAccountModal.vue b/src/components/modals/providers/ZendeskAccountModal.vue new file mode 100644 index 0000000..197032c --- /dev/null +++ b/src/components/modals/providers/ZendeskAccountModal.vue @@ -0,0 +1,65 @@ + + + diff --git a/src/components/modals/providers/ZendeskPublishModal.vue b/src/components/modals/providers/ZendeskPublishModal.vue new file mode 100644 index 0000000..3d8ab5c --- /dev/null +++ b/src/components/modals/providers/ZendeskPublishModal.vue @@ -0,0 +1,76 @@ + + + diff --git a/src/data/constants.js b/src/data/constants.js new file mode 100644 index 0000000..31bfbe8 --- /dev/null +++ b/src/data/constants.js @@ -0,0 +1,27 @@ +const origin = `${window.location.protocol}//${window.location.host}`; + +export default { + cleanTrashAfter: 7 * 24 * 60 * 60 * 1000, // 7 days + origin, + oauth2RedirectUri: `${origin}/oauth2/callback`, + types: [ + 'contentState', + 'syncedContent', + 'content', + 'file', + 'folder', + 'syncLocation', + 'publishLocation', + 'data', + ], + localStorageDataIds: [ + 'workspaces', + 'settings', + 'layoutSettings', + 'tokens', + 'badgeCreations', + 'serverConf', + ], + textMaxLength: 10000000, + defaultName: 'Untitled', +}; diff --git a/src/data/defaults/defaultLayoutSettings.js b/src/data/defaults/defaultLayoutSettings.js new file mode 100644 index 0000000..7746d26 --- /dev/null +++ b/src/data/defaults/defaultLayoutSettings.js @@ -0,0 +1,14 @@ +export default () => ({ + showNavigationBar: true, + showEditor: true, + showSidePreview: true, + showStatusBar: true, + showSideBar: false, + showExplorer: false, + scrollSync: true, + focusMode: false, + findCaseSensitive: false, + findUseRegexp: false, + sideBarPanel: 'menu', + welcomeTourFinished: false, +}); diff --git a/src/data/defaults/defaultLocalSettings.js b/src/data/defaults/defaultLocalSettings.js new file mode 100644 index 0000000..7fe337c --- /dev/null +++ b/src/data/defaults/defaultLocalSettings.js @@ -0,0 +1,44 @@ +export default () => ({ + welcomeFileHashes: {}, + filePropertiesTab: '', + htmlExportTemplate: 'styledHtml', + pdfExportTemplate: 'styledHtml', + pandocExportFormat: 'pdf', + googleDriveRestrictedAccess: false, + googleDriveFolderId: '', + googleDriveWorkspaceFolderId: '', + googleDrivePublishFormat: 'markdown', + googleDrivePublishTemplate: 'styledHtml', + bloggerBlogUrl: '', + bloggerPublishTemplate: 'plainHtml', + dropboxRestrictedAccess: false, + dropboxPublishTemplate: 'styledHtml', + githubRepoFullAccess: false, + githubRepoUrl: '', + githubWorkspaceRepoUrl: '', + githubPublishTemplate: 'jekyllSite', + gistIsPublic: false, + gistPublishTemplate: 'plainText', + giteeRepoUrl: '', + giteeWorkspaceRepoUrl: '', + giteePublishTemplate: 'jekyllSite', + gitlabServerUrl: '', + gitlabApplicationId: '', + gitlabApplicationSecret: '', + gitlabProjectUrl: '', + gitlabWorkspaceProjectUrl: '', + gitlabPublishTemplate: 'plainText', + giteaServerUrl: '', + giteaApplicationId: '', + giteaApplicationSecret: '', + giteaProjectUrl: '', + giteaWorkspaceProjectUrl: '', + giteaPublishTemplate: 'plainText', + wordpressDomain: '', + wordpressPublishTemplate: 'plainHtml', + zendeskSiteUrl: '', + zendeskClientId: '', + zendescPublishSectionId: '', + zendescPublishLocale: '', + zendeskPublishTemplate: 'plainHtml', +}); diff --git a/src/data/defaults/defaultSettings.yml b/src/data/defaults/defaultSettings.yml new file mode 100644 index 0000000..7692d99 --- /dev/null +++ b/src/data/defaults/defaultSettings.yml @@ -0,0 +1,131 @@ +# light or dark +colorTheme: light +# Adjust font size in editor and preview +fontSizeFactor: 1 +# Adjust maximum text width in editor and preview +maxWidthFactor: 1 +# Auto-sync frequency (in ms). Minimum is 60000. +autoSyncEvery: 90000 + +# Editor settings +editor: + # Automatic list numbering + listAutoNumber: true + # Display images in the editor + inlineImages: true + # Use monospaced font only + monospacedFontOnly: false + # 是否显示右上角图标 + showInPageButtons: true + # 头部的按钮是否显示独立设置 + headButtons: + # 加粗 + bold: true + # 斜体 + italic: true + # 标题 + heading: true + # 删除线 + strikethrough: true + # 无序列表 + ulist: true + # 有序列表 + olist: true + # 可选列表 + clist: true + # 块引用 + quote: true + # 代码 + code: true + # 表格 + table: true + # 链接 + link: true + # 图片 + image: true + # ChatGPT + chatgpt: true + +# Keyboard shortcuts +# See https://craig.is/killing/mice +shortcuts: + mod+s: sync + mod+f: find + mod+alt+f: replace + mod+g: replace + mod+shift+b: bold + mod+shift+c: clist + mod+shift+k: code + mod+shift+h: heading + mod+shift+r: hr + mod+shift+g: image + mod+shift+p: chatgpt + mod+shift+i: italic + mod+shift+l: link + mod+shift+o: olist + mod+shift+q: quote + mod+shift+s: strikethrough + mod+shift+t: table + mod+shift+u: ulist + mod+shift+f: inlineformula + # 切换编辑与预览模式 + mod+shift+e: toggleeditor + '= = > space': + method: expand + params: + - '==> ' + - '⇒ ' + '< = = space': + method: expand + params: + - '<== ' + - '⇐ ' + +# Options passed to wkhtmltopdf +# See https://wkhtmltopdf.org/usage/wkhtmltopdf.txt +wkhtmltopdf: + marginTop: 25 + marginRight: 25 + marginBottom: 25 + marginLeft: 25 + # A3, A4, Legal or Letter + pageSize: A4 + +# Options passed to pandoc +# See https://pandoc.org/MANUAL.html +pandoc: + highlightStyle: kate + toc: true + tocDepth: 3 + +# HTML to Markdown converter options +# See https://github.com/domchristie/turndown +turndown: + headingStyle: atx + hr: ---------- + bulletListMarker: '-' + codeBlockStyle: fenced + fence: '```' + emDelimiter: _ + strongDelimiter: '**' + linkStyle: inlined + linkReferenceStyle: full + +# GitHub/GitLab/Gitee/Gitea commit messages +git: + createFileMessage: '{{path}} created' + updateFileMessage: '{{path}} updated' + deleteFileMessage: '{{path}} deleted' + +# Default content for new files +newFileContent: | + + + + > Written with [StackEdit中文版](https://stackedit.cn/). + +# Default properties for new files +newFileProperties: | +# extensions: +# preset: gfm + diff --git a/src/data/defaults/defaultWorkspaces.js b/src/data/defaults/defaultWorkspaces.js new file mode 100644 index 0000000..c1f66e3 --- /dev/null +++ b/src/data/defaults/defaultWorkspaces.js @@ -0,0 +1,7 @@ +export default () => ({ + main: { + id: 'main', + name: '主文档空间', + // The rest will be filled by the workspace/workspacesById getter + }, +}); diff --git a/src/data/empties/emptyContent.js b/src/data/empties/emptyContent.js new file mode 100644 index 0000000..fca704e --- /dev/null +++ b/src/data/empties/emptyContent.js @@ -0,0 +1,9 @@ +export default (id = null) => ({ + id, + type: 'content', + text: '\n', + properties: '\n', + discussions: {}, + comments: {}, + hash: 0, +}); diff --git a/src/data/empties/emptyContentState.js b/src/data/empties/emptyContentState.js new file mode 100644 index 0000000..b750717 --- /dev/null +++ b/src/data/empties/emptyContentState.js @@ -0,0 +1,8 @@ +export default (id = null) => ({ + id, + type: 'contentState', + selectionStart: 0, + selectionEnd: 0, + scrollPosition: null, + hash: 0, +}); diff --git a/src/data/empties/emptyFile.js b/src/data/empties/emptyFile.js new file mode 100644 index 0000000..a76b76d --- /dev/null +++ b/src/data/empties/emptyFile.js @@ -0,0 +1,7 @@ +export default (id = null) => ({ + id, + type: 'file', + name: '', + parentId: null, + hash: 0, +}); diff --git a/src/data/empties/emptyFolder.js b/src/data/empties/emptyFolder.js new file mode 100644 index 0000000..10a2536 --- /dev/null +++ b/src/data/empties/emptyFolder.js @@ -0,0 +1,7 @@ +export default (id = null) => ({ + id, + type: 'folder', + name: '', + parentId: null, + hash: 0, +}); diff --git a/src/data/empties/emptyPublishLocation.js b/src/data/empties/emptyPublishLocation.js new file mode 100644 index 0000000..dd37fc0 --- /dev/null +++ b/src/data/empties/emptyPublishLocation.js @@ -0,0 +1,8 @@ +export default (id = null) => ({ + id, + type: 'publishLocation', + providerId: null, + fileId: null, + templateId: null, + hash: 0, +}); diff --git a/src/data/empties/emptySyncLocation.js b/src/data/empties/emptySyncLocation.js new file mode 100644 index 0000000..479ea3a --- /dev/null +++ b/src/data/empties/emptySyncLocation.js @@ -0,0 +1,7 @@ +export default (id = null) => ({ + id, + type: 'syncLocation', + providerId: null, + fileId: null, + hash: 0, +}); diff --git a/src/data/empties/emptySyncedContent.js b/src/data/empties/emptySyncedContent.js new file mode 100644 index 0000000..2089140 --- /dev/null +++ b/src/data/empties/emptySyncedContent.js @@ -0,0 +1,8 @@ +export default (id = null) => ({ + id, + type: 'syncedContent', + historyData: {}, + syncHistory: {}, + v: 0, + hash: 0, +}); diff --git a/src/data/empties/emptyTemplateHelpers.js b/src/data/empties/emptyTemplateHelpers.js new file mode 100644 index 0000000..8187b8d --- /dev/null +++ b/src/data/empties/emptyTemplateHelpers.js @@ -0,0 +1,16 @@ +/* Add your custom Handlebars helpers here. + +For example: + +Handlebars.registerHelper('transform', function (options) { + var result = options.fn(this); + return new Handlebars.SafeString( + result.replace(/]*>/g, '
')
+  );
+});
+
+Then use the helper in your template:
+
+{{#transform}}{{{files.0.content.html}}}{{/transform}}
+*/
+
diff --git a/src/data/empties/emptyTemplateValue.html b/src/data/empties/emptyTemplateValue.html
new file mode 100644
index 0000000..189e9cc
--- /dev/null
+++ b/src/data/empties/emptyTemplateValue.html
@@ -0,0 +1,38 @@
+
+
diff --git a/src/data/faq.md b/src/data/faq.md
new file mode 100644
index 0000000..65a4d6b
--- /dev/null
+++ b/src/data/faq.md
@@ -0,0 +1,9 @@
+**我的数据存储在哪里?**
+
+如果您的文档空间没有同步,则文件存储在浏览器中,无处可寻。
+
+我们建议同步您的文档空间,以确保在清除浏览器数据的情况下不会丢失文件。自托管Gitea后端非常适合保证隐私。
+
+**StackEdit中文版可以访问我的数据而不告诉我吗?**
+
+StackEdit中文版是一个基于浏览器的应用程序。Gitee,Github,Dropbox ...发出的访问令牌存储在您的浏览器中,不会发送到任何形式的后端或第三方,因此任何人都不会访问您的数据。
diff --git a/src/data/features.js b/src/data/features.js
new file mode 100644
index 0000000..0baf337
--- /dev/null
+++ b/src/data/features.js
@@ -0,0 +1,622 @@
+class Feature {
+  constructor(id, badgeName, description, children = null) {
+    this.id = id;
+    this.badgeName = badgeName;
+    this.description = description;
+    this.children = children;
+  }
+
+  toBadge(badgeCreations) {
+    const children = this.children
+      ? this.children.map(child => child.toBadge(badgeCreations))
+      : null;
+    return {
+      featureId: this.id,
+      name: this.badgeName,
+      description: this.description,
+      children,
+      isEarned: children
+        ? children.every(child => child.isEarned)
+        : !!badgeCreations[this.id],
+      hasSomeEarned: children && children.some(child => child.isEarned),
+    };
+  }
+}
+
+export default [
+  new Feature(
+    'navigationBar',
+    '丰富的导航栏',
+    '通过格式化一些Markdown和重命名当前文件掌握导航栏',
+    [
+      new Feature(
+        'formatButtons',
+        '格式化',
+        '使用格式化按钮更改 Markdown 文件中的格式。',
+      ),
+      new Feature(
+        'editCurrentFileName',
+        '重命名',
+        '使用导航栏中的名称字段重命名当前文件。',
+      ),
+      new Feature(
+        'toggleExplorer',
+        '资源管理器切换',
+        '使用导航栏切换资源管理器。',
+      ),
+      new Feature(
+        'toggleSideBar',
+        '切换侧边栏',
+        '使用导航栏来切换侧边栏。',
+      ),
+    ],
+  ),
+  new Feature(
+    'explorer',
+    '资源管理器',
+    '使用文件资源管理器管理文档空间中的文件和文件夹。',
+    [
+      new Feature(
+        'createFile',
+        '文件创建',
+        '使用文件资源管理器在文档空间中创建一个新文件。',
+      ),
+      new Feature(
+        'switchFile',
+        '文件切换',
+        '使用文件资源管理器在文档空间中从一个文件切换到另一个文件。',
+      ),
+      new Feature(
+        'createFolder',
+        '文件夹创建',
+        '使用文件资源管理器在文档空间中创建一个新文件夹。',
+      ),
+      new Feature(
+        'moveFile',
+        '文件移动',
+        '在文件管理器中拖动一个文件到另一个文件夹。',
+      ),
+      new Feature(
+        'moveFolder',
+        '文件夹移动',
+        '在文件管理器中拖动一个文件夹到另一个文件夹。',
+      ),
+      new Feature(
+        'renameFile',
+        '文件重命名',
+        '使用文件资源管理器重命名文档空间中的文件。',
+      ),
+      new Feature(
+        'renameFolder',
+        '文件夹重命名',
+        '使用文件资源管理器重命名文档空间中的文件夹。',
+      ),
+      new Feature(
+        'removeFile',
+        '文件删除',
+        '使用文件资源管理器删除文档空间中的文件。',
+      ),
+      new Feature(
+        'removeFolder',
+        '文件夹删除',
+        '使用文件资源管理器删除文档空间中的文件夹。',
+      ),
+      new Feature(
+        'searchFile',
+        '文件搜索',
+        '使用文件资源管理器搜索文档空间中的文件。',
+      ),
+    ],
+  ),
+  new Feature(
+    'buttonBar',
+    '按钮栏',
+    '使用按钮栏自定义编辑器布局并切换功能。',
+    [
+      new Feature(
+        'toggleNavigationBar',
+        '导航栏切换',
+        '使用按钮栏切换导航栏。',
+      ),
+      new Feature(
+        'toggleSidePreview',
+        '切换侧边预览',
+        '使用按钮栏切换侧边预览。',
+      ),
+      new Feature(
+        'toggleEditor',
+        '切换编辑器',
+        '使用按钮栏切换编辑器。',
+      ),
+      new Feature(
+        'toggleFocusMode',
+        '切换焦点模式',
+        '使用按钮栏切换焦点模式。此模式在键入时将其垂直居中。',
+      ),
+      new Feature(
+        'toggleScrollSync',
+        '换滚动同步',
+        '使用按钮栏切换滚动同步功能。此功能链接编辑器和预览滚动条。',
+      ),
+      new Feature(
+        'toggleStatusBar',
+        '状态栏切换器',
+        '使用按钮栏切换状态栏。',
+      ),
+    ],
+  ),
+  new Feature(
+    'signIn',
+    '登录',
+    '使用 Gitee 登录,同步您的主文档空间并解锁功能。',
+    [
+      new Feature(
+        'syncMainWorkspace',
+        '主文档空间已同步',
+        '使用 Gitee 登录以将您的主文档空间与您的默认空间stackedit-app-data仓库数据同步。',
+      ),
+      new Feature(
+        'sponsor',
+        '赞助',
+        '使用 Gitee 登录并赞助 StackEdit 以解锁 PDF 和 Pandoc 导出。(暂不支持赞助)',
+      ),
+    ],
+  ),
+  new Feature(
+    'githubSignIn',
+    '登录',
+    '使用 Gitee 登录,同步您的主文档空间并解锁功能。',
+    [
+      new Feature(
+        'githubSyncMainWorkspace',
+        '主文档空间已同步',
+        '使用 GitHub 登录以将您的主文档空间与您的默认空间stackedit-app-data仓库数据同步。',
+      ),
+    ],
+  ),
+  new Feature(
+    'workspaces',
+    '文档空间菜单',
+    '使用文档空间菜单创建各种文档空间并对其进行管理。',
+    [
+      new Feature(
+        'addCouchdbWorkspace',
+        '创建CouchDB文档空间',
+        '使用文档空间菜单创建CouchDB文档空间。',
+      ),
+      new Feature(
+        'addGithubWorkspace',
+        '创建GitHub文档空间',
+        '使用文档空间菜单创建GitHub文档空间。',
+      ),
+      new Feature(
+        'addGiteeWorkspace',
+        '创建Gitee文档空间',
+        '使用文档空间菜单创建Gitee文档空间。',
+      ),
+      new Feature(
+        'addGitlabWorkspace',
+        '创建Gitlab文档空间',
+        '使用文档空间菜单创建GitLab文档空间。',
+      ),
+      new Feature(
+        'addGiteaWorkspace',
+        '创建Gitea文档空间',
+        '使用文档空间菜单创建Gitea文档空间。',
+      ),
+      new Feature(
+        'addGoogleDriveWorkspace',
+        '创建Google Drive文档空间',
+        '使用文档空间菜单创建Google Drive文档空间。',
+      ),
+      new Feature(
+        'renameWorkspace',
+        '文档空间重命名',
+        '使用“管理文档空间”对话框重命名文档空间。',
+      ),
+      new Feature(
+        'removeWorkspace',
+        '文档空间删除',
+        '使用“管理文档空间”对话框在本地删除文档空间。',
+      ),
+      new Feature(
+        'autoSyncWorkspace',
+        '文档空间启用自动同步',
+        '使用“管理文档空间”对话框启用自动同步。',
+      ),
+      new Feature(
+        'stopAutoSyncWorkspace',
+        '文档空间关闭自动同步',
+        '使用“管理文档空间”对话框关闭自动同步。',
+      ),
+    ],
+  ),
+  new Feature(
+    'manageAccounts',
+    '账号管理',
+    '链接各种外部账号,并使用“账号”对话框来管理它们。',
+    [
+      new Feature(
+        'addBloggerAccount',
+        'Blogger账号',
+        '将您的Blogger账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addDropboxAccount',
+        'Dropbox账号',
+        '将您的Dropbox账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGitHubAccount',
+        'GitHub账号',
+        '将您的Github账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGiteeAccount',
+        'Gitee账号',
+        '将您的Gitee账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGitLabAccount',
+        'GitLab账号',
+        '将您的Gitlab账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGiteaAccount',
+        'Gitea账号',
+        '将您的Gitea账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGoogleDriveAccount',
+        'Google Drive账号',
+        '将您的Google Drive账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addGooglePhotosAccount',
+        'Google Photos账号',
+        '将您的Google Photos账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addWordpressAccount',
+        'WordPress账号',
+        '将您的WordPress账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addZendeskAccount',
+        'Zendesk账号',
+        '将您的Zendesk账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addSmmsAccount',
+        'SM.MS账号',
+        '将您的SM.MS账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'addCustomAccount',
+        '自定义图床账号',
+        '将您的自定义图床账号链接到StackEdit中文版。',
+      ),
+      new Feature(
+        'removeAccount',
+        '移除账号',
+        '使用“账号”对话框删除对外部账号的访问。',
+      ),
+    ],
+  ),
+  new Feature(
+    'syncFiles',
+    '文件同步器',
+    '通过打开和保存各种外部账号的文件来掌握“同步”菜单。',
+    [
+      new Feature(
+        'openFromDropbox',
+        'Dropbox阅读器',
+        '使用“同步”菜单从您的Dropbox账号打开文件。',
+      ),
+      new Feature(
+        'saveOnDropbox',
+        'Dropbox保存',
+        '使用“同步”菜单将文件保存在您的Dropbox账号中。',
+      ),
+      new Feature(
+        'openFromGithub',
+        'Github阅读器',
+        '使用“同步”菜单从GitHub仓库打开文件。',
+      ),
+      new Feature(
+        'saveOnGithub',
+        'GitHub保存',
+        '使用“同步”菜单将文件保存在GitHub仓库中。',
+      ),
+      new Feature(
+        'saveOnGist',
+        'GitHubGist保存',
+        '使用“同步”菜单将文件保存在GitHubGist中。',
+      ),
+      new Feature(
+        'openFromGitee',
+        'Gitee阅读器',
+        '使用“同步”菜单从Gitee仓库打开文件。',
+      ),
+      new Feature(
+        'saveOnGitee',
+        'Gitee保存',
+        '使用“同步”菜单将文件保存在Gitee仓库中。',
+      ),
+      new Feature(
+        'saveOnGiteeGist',
+        'GiteeGist保存',
+        '使用“同步”菜单将文件保存在GiteeGist中。',
+      ),
+      new Feature(
+        'openFromGitlab',
+        'GitLab阅读器',
+        '使用“同步”菜单从GitLab仓库打开文件。',
+      ),
+      new Feature(
+        'saveOnGitlab',
+        'GitLab保存',
+        '使用“同步”菜单将文件保存在GitLab仓库中。',
+      ),
+      new Feature(
+        'openFromGitea',
+        'Gitea阅读器',
+        '使用“同步”菜单从Gitea仓库打开文件。',
+      ),
+      new Feature(
+        'saveOnGitea',
+        'Gitea保存',
+        '使用“同步”菜单将文件保存在Gitea仓库中。',
+      ),
+      new Feature(
+        'openFromGoogleDrive',
+        'Google Drive阅读器',
+        '使用“同步”菜单从您的Google Drive账号打开文件。',
+      ),
+      new Feature(
+        'saveOnGoogleDrive',
+        'Google Drive保存',
+        '使用“同步”菜单将文件保存在您的Google Drive账号中。',
+      ),
+      new Feature(
+        'triggerSync',
+        '同步触发器',
+        '使用“同步”菜单或导航栏手动触发同步。',
+      ),
+      new Feature(
+        'syncMultipleLocations',
+        '多方同步',
+        '使用“同步”菜单将文件与多个外部位置同步。',
+      ),
+      new Feature(
+        'removeSyncLocation',
+        '删除同步',
+        '使用“文件同步”对话框删除同步位置。',
+      ),
+    ],
+  ),
+  new Feature(
+    'publishFiles',
+    '文件发布',
+    '通过将文件发布到各种外部账号中来掌握“发布”菜单。',
+    [
+      new Feature(
+        'publishToBlogger',
+        'Blogger发布',
+        '使用“发布”菜单发布博客文章。',
+      ),
+      new Feature(
+        'publishToBloggerPage',
+        'Blogger页面发布',
+        '使用“发布”菜单发布Blogger页面。',
+      ),
+      new Feature(
+        'publishToDropbox',
+        'Dropbox发布',
+        '使用“发布”菜单将文件发布到您的Dropbox账号。',
+      ),
+      new Feature(
+        'publishToGithub',
+        'GitHub发布',
+        '使用“发布”菜单将文件发布到GitHub仓库。',
+      ),
+      new Feature(
+        'publishToGist',
+        'GitHubGist发布',
+        '使用“发布”菜单将文件发布到GitHubGist。',
+      ),
+      new Feature(
+        'publishToGitee',
+        'Gitee发布',
+        '使用“发布”菜单将文件发布到Gitee仓库。',
+      ),
+      new Feature(
+        'publishToGiteeGist',
+        'GiteeGist发布',
+        '使用“发布”菜单将文件发布到GiteeGist。',
+      ),
+      new Feature(
+        'publishToGitlab',
+        'GitLab发布',
+        '使用“发布”菜单将文件发布到GitLab仓库中。',
+      ),
+      new Feature(
+        'publishToGitea',
+        'Gitea发布',
+        '使用“发布”菜单将文件发布到Gitea仓库。',
+      ),
+      new Feature(
+        'publishToGoogleDrive',
+        'Google Drive发布',
+        '使用“发布”菜单将文件发布到您的Google Drive账号。',
+      ),
+      new Feature(
+        'publishToWordPress',
+        'WordPress发布',
+        '使用“发布”菜单发布WordPress文章。',
+      ),
+      new Feature(
+        'publishToZendesk',
+        'Zendesk发布',
+        '使用“发布”菜单发布Zendesk帮助中心文章。',
+      ),
+      new Feature(
+        'triggerPublish',
+        '更新发布',
+        '使用“发布”菜单或导航栏手动更新发布。',
+      ),
+      new Feature(
+        'publishMultipleLocations',
+        '多方发布',
+        '使用“发布”菜单将文件发布到多个外部位置。',
+      ),
+      new Feature(
+        'removePublishLocation',
+        '删除发布',
+        '使用“文件发布”对话框删除发布位置。',
+      ),
+    ],
+  ),
+  new Feature(
+    'manageHistory',
+    '文件历史记录',
+    '使用“文件历史记录”菜单查看版本历史记录并恢复当前文件的旧版本。',
+    [
+      new Feature(
+        'restoreVersion',
+        '恢复',
+        '使用“文件历史记录”菜单来还原当前文件的旧版本。',
+      ),
+      new Feature(
+        'chooseHistory',
+        '历史版本选择',
+        '选择与多个外部位置同步的文件的不同历史记录。',
+      ),
+    ],
+  ),
+  new Feature(
+    'manageProperties',
+    '文件属性',
+    '使用“文件属性”对话框更改当前文件的属性。',
+    [
+      new Feature(
+        'setMetadata',
+        '元数据设置',
+        '使用“文件属性”对话框为当前文件设置元数据。',
+      ),
+      new Feature(
+        'changePreset',
+        '预设更改',
+        '使用“文件属性”对话框更改Markdown引擎预设。',
+      ),
+      new Feature(
+        'changeExtension',
+        '扩展配置',
+        '使用“文件属性”对话框启用,禁用或配置Markdown引擎扩展。',
+      ),
+    ],
+  ),
+  new Feature(
+    'comment',
+    '评论',
+    '添加和删除批注,添加和删除评论。',
+    [
+      new Feature(
+        'createDiscussion',
+        '添加批注',
+        '使用“批注”按钮图标添加新的批注。',
+      ),
+      new Feature(
+        'addComment',
+        '添加批注评论',
+        '使用“评论”按钮在现有批注中添加评论。',
+      ),
+      new Feature(
+        'removeComment',
+        '删除批注评论',
+        '使用“删除评论”按钮图标删除批注评论。',
+      ),
+      new Feature(
+        'removeDiscussion',
+        '删除批注',
+        '使用“删除批注”按钮图标删除批注。',
+      ),
+    ],
+  ),
+  new Feature(
+    'importExport',
+    '导入/导出',
+    '使用“导入/导出”菜单以导入和导出文件。',
+    [
+      new Feature(
+        'importMarkdown',
+        'Markdown导入',
+        '使用“导入/导出”菜单从磁盘导入Markdown文件。',
+      ),
+      new Feature(
+        'exportMarkdown',
+        'Markdown导出',
+        '使用“导入/导出”菜单将Markdown文件导出到磁盘。',
+      ),
+      new Feature(
+        'importHtml',
+        'HTML导入',
+        '使用“导入/导出”菜单从磁盘导入HTML文件,然后将其转换为Markdown。',
+      ),
+      new Feature(
+        'exportHtml',
+        'HTML导出',
+        '使用“导入/导出”菜单和Handlebars模板将文件导出到磁盘作为HTML文件。',
+      ),
+      new Feature(
+        'exportPdf',
+        'PDF导出',
+        '使用“导入/导出”菜单将文件导出到磁盘作为PDF文件。',
+      ),
+      new Feature(
+        'exportPandoc',
+        'Pandoc导出',
+        '使用“导入/导出”菜单将文件导出到使用Pandoc的磁盘。',
+      ),
+    ],
+  ),
+  new Feature(
+    'manageSettings',
+    '管理设置',
+    '使用“设置”对话框调整应用程序行为并更改键盘快捷键。',
+    [
+      new Feature(
+        'changeSettings',
+        '更新设置',
+        '使用“设置”对话框调整应用程序行为。',
+      ),
+      new Feature(
+        'switchTheme',
+        '切换主题',
+        '使用“主题切换”按钮切换主题。',
+      ),
+      new Feature(
+        'changeShortcuts',
+        '编辑快捷键',
+        '使用“设置”对话框更改键盘快捷键。',
+      ),
+    ],
+  ),
+  new Feature(
+    'manageTemplates',
+    '管理模板',
+    '使用“模板”对话框创建,删除或修改Handlebars模板。',
+    [
+      new Feature(
+        'addTemplate',
+        '模板创建',
+        '使用“模板”对话框创建一个Handlebars模板。',
+      ),
+      new Feature(
+        'removeTemplate',
+        '模板删除',
+        '使用“模板”对话框删除Handlebars模板。',
+      ),
+    ],
+  ),
+];
diff --git a/src/data/markdownSample.md b/src/data/markdownSample.md
new file mode 100644
index 0000000..d5ca0bb
--- /dev/null
+++ b/src/data/markdownSample.md
@@ -0,0 +1,129 @@
+标题
+---------------------------
+
+# 标题1
+
+## 标题2
+
+### 标题3
+
+
+
+样式
+---------------------------
+
+*强调* _强调_
+
+**加粗** __加粗__
+
+==标记文本==
+
+~~删除线文本~~
+
+> 块引用文本
+
+H~2~O是一种液体
+
+2^10^是1024
+
+
+
+列表
+---------------------------
+
+- 列表项
+  * 列表项
+    + 列表项
+
+1. 列表项 1
+2. 列表项 2
+3. 列表项 3
+
+- [ ] 未完成项
+- [x] 已完成项
+
+
+
+链接
+---------------------------
+
+一个[链接](http://example.com).
+
+一张图片: ![图片描述](img.jpg)
+
+一张调整大小的图片: ![图片描述](img.jpg =60x50)
+
+
+
+代码
+---------------------------
+
+一些`行内代码`.
+
+```
+// 一个代码块
+var foo = 'bar';
+```
+
+```javascript
+// 一个高亮代码块
+var foo = 'bar';
+```
+
+
+
+表格
+---------------------------
+
+Item     | Value
+-------- | -----
+Computer | $1600
+Phone    | $12
+Pipe     | $1
+
+
+| Column 1 | Column 2      |
+|:--------:| -------------:|
+| centered | right-aligned |
+
+
+
+定义列表
+---------------------------
+
+Markdown
+:  文本到HTML转换工具
+
+作者
+:  张三
+:  李四
+
+
+
+脚注
+---------------------------
+
+一些带有脚注的文本。[^1]
+
+[^1]: 脚注内容。
+
+
+
+缩写
+---------------------------
+
+Markdown将文本转换为 HTML。
+
+*[HTML]: 超文本标记语言
+
+
+
+LaTeX数学表达式
+---------------------------
+
+满足 $\Gamma(n) = (n-1)!\quad\forall
+n\in\mathbb N$ 的Gamma函数是通过欧拉积分
+
+$$
+\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
+$$
diff --git a/src/data/pagedownButtons.js b/src/data/pagedownButtons.js
new file mode 100644
index 0000000..d952ee2
--- /dev/null
+++ b/src/data/pagedownButtons.js
@@ -0,0 +1,56 @@
+export default [{
+}, {
+  method: 'bold',
+  title: '加粗',
+  icon: 'format-bold',
+}, {
+  method: 'italic',
+  title: '斜体',
+  icon: 'format-italic',
+}, {
+  method: 'heading',
+  title: '标题',
+  icon: 'format-size',
+}, {
+  method: 'strikethrough',
+  title: '删除线',
+  icon: 'format-strikethrough',
+// }, {
+}, {
+  method: 'ulist',
+  title: '无序列表',
+  icon: 'format-list-bulleted',
+}, {
+  method: 'olist',
+  title: '有序列表',
+  icon: 'format-list-numbers',
+}, {
+  method: 'clist',
+  title: '可选列表',
+  icon: 'format-list-checks',
+// }, {
+}, {
+  method: 'quote',
+  title: '块引用',
+  icon: 'format-quote-close',
+}, {
+  method: 'code',
+  title: '代码',
+  icon: 'code-tags',
+}, {
+  method: 'table',
+  title: '表格',
+  icon: 'table',
+}, {
+  method: 'link',
+  title: '链接',
+  icon: 'link-variant',
+}, {
+  method: 'image',
+  title: '图片',
+  icon: 'file-image',
+}, {
+  method: 'chatgpt',
+  title: 'ChatGPT',
+  icon: 'chat-gpt',
+}];
diff --git a/src/data/presets.js b/src/data/presets.js
new file mode 100644
index 0000000..fb60a50
--- /dev/null
+++ b/src/data/presets.js
@@ -0,0 +1,114 @@
+const zero = {
+  // Markdown extensions
+  markdown: {
+    abbr: false,
+    breaks: false,
+    deflist: false,
+    del: false,
+    fence: false,
+    footnote: false,
+    imgsize: false,
+    linkify: false,
+    mark: false,
+    sub: false,
+    sup: false,
+    table: false,
+    tasklist: false,
+    typographer: false,
+    toc: false,
+  },
+  // Emoji extension
+  emoji: {
+    enabled: false,
+    // Enable shortcuts like :) :-(
+    shortcuts: false,
+  },
+  /*
+  ABC Notation extension
+  Render abc-notation code blocks to music sheets
+  See https://abcjs.net/
+  */
+  abc: {
+    enabled: false,
+  },
+  /*
+  Katex extension
+  Render LaTeX mathematical expressions using:
+    $...$ for inline formulas
+    $$...$$ for displayed formulas.
+  See https://math.meta.stackexchange.com/questions/5020
+  */
+  katex: {
+    enabled: false,
+  },
+  /*
+  Mermaid extension
+  Convert code blocks starting with ```mermaid
+  into diagrams and flowcharts.
+  See https://mermaidjs.github.io/
+  */
+  mermaid: {
+    enabled: false,
+  },
+  /*
+  Toc extension
+  把 [TOC] 转换为目录
+  */
+  toc: {
+    enabled: false,
+  },
+};
+
+export default {
+  zero: [zero],
+  commonmark: [zero, {
+    markdown: {
+      fence: true,
+    },
+  }],
+  gfm: [zero, {
+    markdown: {
+      breaks: true,
+      del: true,
+      fence: true,
+      linkify: true,
+      table: true,
+      tasklist: true,
+      toc: true,
+    },
+    emoji: {
+      enabled: true,
+    },
+  }],
+  default: [zero, {
+    markdown: {
+      abbr: true,
+      breaks: true,
+      deflist: true,
+      del: true,
+      fence: true,
+      footnote: true,
+      imgsize: true,
+      linkify: true,
+      mark: true,
+      sub: true,
+      sup: true,
+      table: true,
+      tasklist: true,
+      toc: true,
+      typographer: true,
+    },
+    emoji: {
+      enabled: true,
+    },
+    katex: {
+      enabled: true,
+    },
+    mermaid: {
+      enabled: true,
+    },
+    abc: {
+      enabled: true,
+    },
+  }],
+};
diff --git a/src/data/simpleModals.js b/src/data/simpleModals.js
new file mode 100644
index 0000000..3628027
--- /dev/null
+++ b/src/data/simpleModals.js
@@ -0,0 +1,136 @@
+const simpleModal = (contentHtml, rejectText, resolveText, resolveArray) => ({
+  contentHtml: typeof contentHtml === 'function' ? contentHtml : () => contentHtml,
+  rejectText,
+  resolveArray,
+  resolveText,
+});
+
+/* eslint sort-keys: "error" */
+export default {
+  autoSyncWorkspace: simpleModal(
+    config => `

您将启动文档空间 ${config.name}的自动同步。
启动后无法自定义提交信息。
你确定吗?

`, + '取消', + '确认启动', + ), + commentDeletion: simpleModal( + '

您将要删除评论。你确定吗?

', + '取消', + '确认删除', + ), + discussionDeletion: simpleModal( + '

您将要删除批注。你确定吗?

', + '取消', + '确认删除', + ), + fileRestoration: simpleModal( + '

您将要恢复一些更改。你确定吗?

', + '取消', + '确认恢复', + ), + folderDeletion: simpleModal( + config => `

您将删除文件夹${config.item.name}。它的文件将移至回收站。你确定吗?

`, + '取消', + '确认删除', + ), + imgStorageDeletion: simpleModal( + '

您将要删除图床,你确定吗?

', + '取消', + '确认删除', + ), + pathConflict: simpleModal( + config => `

${config.item.name}已经存在。您要添加后缀吗?

`, + '取消', + '确认添加', + ), + paymentSuccess: simpleModal( + '

感谢您的付款!

您的赞助将在一分钟内活跃。

', + '好的', + ), + providerRedirection: simpleModal( + config => `

您将跳转到 ${config.name} 授权页面。

`, + '取消', + '确认跳转', + ), + removeWorkspace: simpleModal( + config => `

您将要在本地删除文档空间${config.name}。你确定吗?

`, + '取消', + '确认删除', + ), + reset: simpleModal( + '

这将在本地清理所有文档空间,你确定吗?

', + '取消', + '确认清理', + ), + shareHtml: simpleModal( + config => `

给文档 "${config.name}" 创建了分享链接如下:
${config.url}
关闭该窗口后可以到发布中查看分享链接。

`, + '关闭窗口', + ), + shareHtmlPre: simpleModal( + config => `

将给文档 "${config.name}" 创建分享链接,创建后将会把文档公开发布到默认空间账号的Gist中。您确定吗?

`, + '取消', + '确认分享', + ), + signInForComment: simpleModal( + `

您必须使用 Gitee或GitHub 登录默认文档空间后才能开始评论。

+ `, + '取消', + '', + [{ + text: 'Gitee登录', + value: 'gitee', + }, { + text: 'GitHub登录', + value: 'github', + }], + ), + signInForSponsorship: simpleModal( + `

您必须使用 Gitee或GitHub 登录才能赞助。

+ `, + '取消', + '', + [{ + text: 'Gitee登录', + value: 'gitee', + }, { + text: 'GitHub登录', + value: 'github', + }], + ), + sponsorOnly: simpleModal( + '

此功能仅限于赞助商,因为它依赖于服务器资源。

', + '好的,我明白了', + ), + stopAutoSyncWorkspace: simpleModal( + config => `

您将关闭文档空间 ${config.name} 的自动同步。
关闭后您需要手动触发同步,但可以自定义提交信息。
你确定吗?

`, + '取消', + '确认关闭', + ), + stripName: simpleModal( + config => `

${config.item.name}包含非法字符。你想去掉它们吗?

`, + '取消', + '确认去掉', + ), + tempFileDeletion: simpleModal( + config => `

您将永久删除临时文件${config.item.name}。你确定吗?

`, + '取消', + '确认删除', + ), + tempFolderDeletion: simpleModal( + '

您将永久删除所有临时文件。你确定吗?

', + '取消', + '确认删除', + ), + trashDeletion: simpleModal( + '

回收站中的文件在不活动7天后会自动删除。

', + '好的', + ), + unauthorizedName: simpleModal( + config => `

${config.item.name}>是未经授权的名称。

`, + '好的', + ), + workspaceGoogleRedirection: simpleModal( + '

StackEdit中文版需要完整的Google Drive访问才能打开此文档空间。

', + '取消', + '确认授权', + ), +}; diff --git a/src/data/templates/jekyllSiteTemplate.html b/src/data/templates/jekyllSiteTemplate.html new file mode 100644 index 0000000..69da7fb --- /dev/null +++ b/src/data/templates/jekyllSiteTemplate.html @@ -0,0 +1,5 @@ +--- +{{{files.0.content.yamlProperties}}} +--- + +{{{files.0.content.html}}} diff --git a/src/data/templates/plainHtmlTemplate.html b/src/data/templates/plainHtmlTemplate.html new file mode 100644 index 0000000..42b6b5d --- /dev/null +++ b/src/data/templates/plainHtmlTemplate.html @@ -0,0 +1 @@ +{{{files.0.content.html}}} diff --git a/src/data/templates/styledHtmlTemplate.html b/src/data/templates/styledHtmlTemplate.html new file mode 100644 index 0000000..d6e3b59 --- /dev/null +++ b/src/data/templates/styledHtmlTemplate.html @@ -0,0 +1,19 @@ + + + + + + + {{files.0.name}} + + + +{{#if pdf}} + +{{else}} + +{{/if}} +
{{{files.0.content.html}}}
+ + + diff --git a/src/data/templates/styledHtmlWithThemeAndTocTemplate.html b/src/data/templates/styledHtmlWithThemeAndTocTemplate.html new file mode 100644 index 0000000..1ccb208 --- /dev/null +++ b/src/data/templates/styledHtmlWithThemeAndTocTemplate.html @@ -0,0 +1,43 @@ + + + + + + + {{files.0.name}} + + + + +{{#if pdf}} + +{{else}} + +{{/if}} +
+
+ {{#tocToHtml files.0.content.toc 2}}{{/tocToHtml}} +
+
+
+
+
+ {{{files.0.content.html}}} +
+
+
+ + + diff --git a/src/data/templates/styledHtmlWithThemeTemplate.html b/src/data/templates/styledHtmlWithThemeTemplate.html new file mode 100644 index 0000000..78ede0c --- /dev/null +++ b/src/data/templates/styledHtmlWithThemeTemplate.html @@ -0,0 +1,36 @@ + + + + + + + {{files.0.name}} + + + + +{{#if pdf}} + +{{else}} + +{{/if}} +
+
+ {{{files.0.content.html}}} +
+
+ + + diff --git a/src/data/templates/styledHtmlWithTocTemplate.html b/src/data/templates/styledHtmlWithTocTemplate.html new file mode 100644 index 0000000..3952991 --- /dev/null +++ b/src/data/templates/styledHtmlWithTocTemplate.html @@ -0,0 +1,28 @@ + + + + + + + {{files.0.name}} + + + +{{#if pdf}} + +{{else}} + +{{/if}} +
+
+ {{#tocToHtml files.0.content.toc 2}}{{/tocToHtml}} +
+
+
+
+ {{{files.0.content.html}}} +
+
+ + + diff --git a/src/data/welcomeFile.md b/src/data/welcomeFile.md new file mode 100644 index 0000000..efa57c4 --- /dev/null +++ b/src/data/welcomeFile.md @@ -0,0 +1,145 @@ +# 欢迎来到 StackEdit 中文版! + +你好!我是你在 **StackEdit中文版** 中的第一个 Markdown 文件。如果你想了解 StackEdit中文版,可以阅读此文章。如果你想玩 Markdown,你也可以编辑此文章。另外,您可以通过打开导航栏左边的**文件资源管理器**来创建新文件。 + +# 文件 + +StackEdit中文版 将您的文件存储在您的浏览器中,这意味着您的所有文件都会自动保存在本地并且可以**离线访问!** + +## 创建文件和文件夹 + +使用导航栏左边的文件夹图标可以访问文件资源管理器。您可以通过单击文件资源管理器中的 **创建文件** 图标来创建新文件。您还可以通过单击 **创建文件夹** 图标来创建文件夹。 + +## 切换到另一个文件 + +您的所有文件和文件夹在文件资源管理器中都显示为树。您可以通过单击树中的文件从一个文件切换到另一个文件。 + +## 重命名文件 + +您可以通过单击导航栏中的文件名或单击文件资源管理器中的**重命名**图标来重命名当前文件。 + +## 搜索文件 + +您可以通过单击文件资源管理器中的**搜索文件**图标来通过关键字在整个文档空间中搜索文件。 + +## 删除一个文件 + +您可以通过单击文件资源管理器中的 **删除** 图标来删除当前文件。该文件将被移至 **回收站** 文件夹并在 7 天不活动后自动删除。 + +## 导出文件 + +您可以通过单击菜单中的 **导入/导出** 来导出当前文件。您可以选择将文件导出为纯 Markdown、使用 Handlebars 模板的 HTML 或 PDF。 + + +# 同步 + +同步是 StackEdit中文版 的最大特点之一。它使您可以将文档空间中的任何文件与存储在**Gitee** 和 **GitHub** 账号中的其他文件同步。这使您可以继续在其他设备上写作,与您共享文件的人协作,轻松集成到您的工作流程中......同步机制在后台每分钟触发一次,下载、合并和上传文件修改。 + +有两种类型的同步,它们可以相互补充: + +- 文档空间同步将自动同步您的所有文件、文件夹和设置。这将允许您在任何其他设备上获取您的文档空间。 +> 要开始同步您的文档空间,只需在菜单中使用 Gitee 登录。 + +- 文件同步将保持文档空间的一个文件与**Gitee**或**GitHub**中的一个或多个文件同步。 +> 在开始同步文件之前,您必须在**同步**子菜单中链接一个账号。 + +## 打开一个文件 + +您可以通过打开 **同步** 子菜单并单击 **从...打开** 从**Gitee** 或 **GitHub** 打开文件。在文档空间中打开后,文件中的任何修改都将自动同步。 + +## 保存文件 + +您可以通过打开 **同步** 子菜单并单击 **在...保存** 将文档空间的任何文件保存到**Gitee** 或 **GitHub**。即使文档空间中的文件已经同步,您也可以将其保存到另一个位置。 StackEdit中文版 可以将一个文件与多个位置和账号同步。 + +## 同步文件 + +一旦您的文件链接到同步位置,StackEdit中文版 将通过下载/上传任何修改来定期同步它。如有必要,将执行合并并解决冲突。 + +如果您刚刚修改了文件并且想要强制同步,请单击导航栏中的 **立即同步** 按钮。 + +> **注意:** 如果您没有要同步的文件,**立即同步**按钮将被禁用。 + +## 管理文件同步 + +由于一个文件可以与多个位置同步,您可以通过单击**同步**子菜单中的**文件同步**列出和管理同步位置。这允许您列出和删除链接到您的文件的同步位置。 + + +# 发布 + +在 StackEdit中文版 中发布使您可以轻松地在线发布文件。对文件感到满意后,您可以将其发布到不同的托管平台,例如 **Blogger**、**Gitee**、**Gist**、**GitHub**、**WordPress** 和 **Zendesk**。使用 [Handlebars 模板](http://handlebarsjs.com/),您可以完全控制导出的内容。 + +> 在开始发布之前,您必须在**发布**子菜单中链接一个账号。 + +## 发布文件 + +您可以通过打开 **发布** 子菜单并单击 **发布到** 来发布您的文件。对于某些位置,您可以选择以下格式: + +- Markdown:在可以解释的网站上发布 Markdown 文本(例如**GitHub**), +- HTML:通过 Handlebars 模板发布转换为 HTML 的文件(例如在博客上)。 + +## 更新发布 + +发布后,StackEdit中文版 会将您的文件链接到该发布,这使您可以轻松地重新发布它。一旦您修改了文件并想要更新您的发布,请单击导航栏中的**立即发布**按钮。 + +> **注意:** 如果您没有要同步的文件,**立即同步**按钮将被禁用。 + +## 管理文件同步 + +由于一个文件可以与多个位置同步,您可以通过单击**同步**子菜单中的**文件同步**列出和管理同步位置。这允许您列出和删除链接到您的文件的同步位置。 + +# Markdown扩展 + +StackEdit中文版 通过添加额外的 **Markdown扩展** 扩展了标准 Markdown 语法,为您提供了一些不错的功能。 + +> **提示:** 您可以在 **文件属性** 对话框中禁用任何 **Markdown 扩展名**。 + + +## SmartyPants + +SmartyPants 将 ASCII 标点字符转换为“智能”印刷标点 HTML 实体。例如: + +| |ASCII |HTML | +|----------------|--------------------------------| ------------------------------| +|单反引号|`'这不好玩吗?'` |'这不好玩吗?' | +|引用|`“这不好玩吗?”` |“这不好玩吗?” | +|破折号 |`-- 是破折号,--- 是破折号`|-- 是破折号,--- 是破折号| + + +## KaTeX + +您可以使用 [KaTeX](https://khan.github.io/KaTeX/) 渲染 LaTeX 数学表达式: + +满足 $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ 的 *Gamma 函数* 是通过欧拉积分 + +$$ +\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,. +$$ + +> 您可以在 [这里](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference) 找到有关 **LaTeX** 数学表达式的更多信息。 + + +## UML 图 + +您可以使用 [Mermaid](https://mermaidjs.github.io/) 渲染 UML 图。例如,这将产生一个序列图: + +```mermaid +sequenceDiagram +爱丽丝 ->> 鲍勃: 你好鲍勃,你好吗? +鲍勃-->>约翰: 约翰,你呢? +鲍勃--x 爱丽丝: 我很好,谢谢! +鲍勃-x 约翰: 我很好,谢谢! +Note right of 约翰: 鲍勃想了很长
很长的时间,太长了
文本确实
不能放在一行中。 + +鲍勃-->爱丽丝: 正在和 John 核对... +爱丽丝->约翰: 是的……约翰,你好吗? +``` + +这将产生一个流程图: + +```mermaid +graph LR +A[长方形] -- 链接文本 --> B((圆形)) +A --> C(圆角矩形) +B --> D{菱形} +C --> D +``` diff --git a/src/extensions/abcExtension.js b/src/extensions/abcExtension.js new file mode 100644 index 0000000..850773a --- /dev/null +++ b/src/extensions/abcExtension.js @@ -0,0 +1,21 @@ +import renderAbc from 'abcjs/src/api/abc_tunebook_svg'; +import extensionSvc from '../services/extensionSvc'; + +const render = (elt) => { + const content = elt.textContent; + // Create a div element + const divElt = document.createElement('div'); + divElt.className = 'abc-notation-block'; + // Replace the pre element with the div + elt.parentNode.parentNode.replaceChild(divElt, elt.parentNode); + renderAbc(divElt, content, {}); +}; + +extensionSvc.onGetOptions((options, properties) => { + options.abc = properties.extensions.abc.enabled; +}); + +extensionSvc.onSectionPreview((elt) => { + elt.querySelectorAll('.prism.language-abc') + .cl_each(notationElt => render(notationElt)); +}); diff --git a/src/extensions/emojiExtension.js b/src/extensions/emojiExtension.js new file mode 100644 index 0000000..7146ced --- /dev/null +++ b/src/extensions/emojiExtension.js @@ -0,0 +1,13 @@ +import markdownItEmoji from 'markdown-it-emoji'; +import extensionSvc from '../services/extensionSvc'; + +extensionSvc.onGetOptions((options, properties) => { + options.emoji = properties.extensions.emoji.enabled; + options.emojiShortcuts = properties.extensions.emoji.shortcuts; +}); + +extensionSvc.onInitConverter(1, (markdown, options) => { + if (options.emoji) { + markdown.use(markdownItEmoji, options.emojiShortcuts ? {} : { shortcuts: {} }); + } +}); diff --git a/src/extensions/index.js b/src/extensions/index.js new file mode 100644 index 0000000..347b396 --- /dev/null +++ b/src/extensions/index.js @@ -0,0 +1,5 @@ +import './emojiExtension'; +import './abcExtension'; +import './katexExtension'; +import './markdownExtension'; +import './mermaidExtension'; diff --git a/src/extensions/katexExtension.js b/src/extensions/katexExtension.js new file mode 100644 index 0000000..4eb3d19 --- /dev/null +++ b/src/extensions/katexExtension.js @@ -0,0 +1,32 @@ +import katex from 'katex'; +import markdownItMath from './libs/markdownItMath'; +import extensionSvc from '../services/extensionSvc'; + +extensionSvc.onGetOptions((options, properties) => { + options.math = properties.extensions.katex.enabled; +}); + +extensionSvc.onInitConverter(2, (markdown, options) => { + if (options.math) { + markdown.use(markdownItMath); + markdown.renderer.rules.inline_math = (tokens, idx) => + `${markdown.utils.escapeHtml(tokens[idx].content)}`; + markdown.renderer.rules.display_math = (tokens, idx) => + `${markdown.utils.escapeHtml(tokens[idx].content)}`; + } +}); + +extensionSvc.onSectionPreview((elt) => { + const highlighter = displayMode => (katexElt) => { + if (!katexElt.highlighted) { + try { + katex.render(katexElt.textContent, katexElt, { displayMode }); + } catch (e) { + katexElt.textContent = `${e.message}`; + } + } + katexElt.highlighted = true; + }; + elt.querySelectorAll('.katex--inline').cl_each(highlighter(false)); + elt.querySelectorAll('.katex--display').cl_each(highlighter(true)); +}); diff --git a/src/extensions/libs/markdownItAnchor.js b/src/extensions/libs/markdownItAnchor.js new file mode 100644 index 0000000..8281c4a --- /dev/null +++ b/src/extensions/libs/markdownItAnchor.js @@ -0,0 +1,133 @@ +function groupHeadings(headings, level = 1) { + const result = []; + let currentItem; + + function pushCurrentItem() { + if (currentItem) { + if (currentItem.children.length > 0) { + currentItem.children = groupHeadings(currentItem.children, level + 1); + } + result.push(currentItem); + } + } + headings.forEach((heading) => { + if (heading.level !== level) { + currentItem = currentItem || { + children: [], + }; + currentItem.children.push(heading); + } else { + pushCurrentItem(); + currentItem = heading; + } + }); + pushCurrentItem(); + return result; +} + +function arrayToHtml(arr) { + if (!arr || !arr.length) { + return ''; + } + const ulHtml = arr.map((item) => { + let result = `
  • `; + if (item.anchor && item.title) { + result += `${item.title}`; + } + result += arrayToHtml(item.children); + return `${result}
  • `; + }).join('\n'); + return ``; +} + +export default (md) => { + md.core.ruler.before('replacements', 'anchors', (state) => { + const anchorHash = {}; + let headingOpenToken; + let headingContent; + const tocTokens = []; + const headings = []; + state.tokens.forEach((token) => { + if (token.type === 'heading_open') { + headingContent = ''; + headingOpenToken = token; + } else if (token.type === 'heading_close') { + headingOpenToken.headingContent = headingContent; + + // According to http://pandoc.org/README.html#extension-auto_identifiers + let slug = headingContent + .replace(/]*>/g, '') // Replace image to empty + .replace(/\s/g, '-') // Replace all spaces and newlines with hyphens + .replace(/[\0-,/:-@[-^`{-~]/g, '') // Remove all punctuation, except underscores, hyphens, and periods + .toLowerCase(); // Convert all alphabetic characters to lowercase + + // Remove everything up to the first letter + let i; + for (i = 0; i < slug.length; i += 1) { + const charCode = slug.charCodeAt(i); + if ((charCode >= 0x30 && charCode <= 0x39) || // 0-9 + (charCode >= 0x61 && charCode <= 0x7A) || // a-z + charCode > 0x7E) { + break; + } + } + + // If nothing left after this, use `section` + slug = slug.slice(i) || 'section'; + + let anchor = slug; + let index = 1; + while (Object.prototype.hasOwnProperty.call(anchorHash, anchor)) { + anchor = `${slug}-${index}`; + index += 1; + } + anchorHash[anchor] = true; + headingOpenToken.headingAnchor = anchor; + headingOpenToken.attrs = [ + ['id', anchor], + ]; + headings.push({ + title: headingOpenToken.headingContent, + anchor: headingOpenToken.headingAnchor, + level: parseInt(headingOpenToken.tag.slice(1), 10), + children: [], + }); + headingOpenToken = undefined; + } else if (headingOpenToken) { + headingContent += token.children.reduce((result, child) => { + if (child.type !== 'footnote_ref') { + return result + child.content; + } + return result; + }, ''); + } + if (token.type === 'inline' && (token.content === '[TOC]' || token.content === '[toc]')) { + tocTokens.push(token); + } + }); + // 没有TOC 直接返回 + if (tocTokens.length === 0) { + return; + } + // 没有header + if (headings.length === 0) { + // 置空[TOC]文案为空字符串 + tocTokens.forEach((tocToken) => { + tocToken.children[0].content = ''; + tocToken.content = ''; + }); + } else { + tocTokens.forEach((tocToken) => { + // toc目录 + const toc = groupHeadings(headings); + // 拼接为html + const tocHtml = arrayToHtml(toc); + const tocDiv = new state.Token('html_inline', '', 0); + tocDiv.content = `
    ${tocHtml}
    `; + tocToken.children.unshift(tocDiv); + tocToken.children[1].content = ''; + tocToken.content = ''; + }); + } + }); +}; diff --git a/src/extensions/libs/markdownItMath.js b/src/extensions/libs/markdownItMath.js new file mode 100644 index 0000000..3b07c79 --- /dev/null +++ b/src/extensions/libs/markdownItMath.js @@ -0,0 +1,69 @@ +function texMath(state, silent) { + let startMathPos = state.pos; + if (state.src.charCodeAt(startMathPos) !== 0x24 /* $ */) { + return false; + } + + // Parse tex math according to http://pandoc.org/README.html#math + let endMarker = '$'; + startMathPos += 1; + const afterStartMarker = state.src.charCodeAt(startMathPos); + if (afterStartMarker === 0x24 /* $ */) { + endMarker = '$$'; + startMathPos += 1; + if (state.src.charCodeAt(startMathPos) === 0x24 /* $ */) { + // 3 markers are too much + return false; + } + } else if ( + // Skip if opening $ is succeeded by a space character + afterStartMarker === 0x20 /* space */ + || afterStartMarker === 0x09 /* \t */ + || afterStartMarker === 0x0a /* \n */ + ) { + return false; + } + function getIndex(tempStartMathPos) { + const tempEndMarkerPos = state.src.indexOf(endMarker, tempStartMathPos); + if (tempEndMarkerPos === -1) { + return tempEndMarkerPos; + } + if (state.src.charCodeAt(tempEndMarkerPos - 1) === 0x5C /* \ */) { + if (state.src.length - 1 > tempEndMarkerPos) { + return getIndex(tempEndMarkerPos + 1); + } + return -1; + } + return tempEndMarkerPos; + } + const endMarkerPos = getIndex(startMathPos); + if (endMarkerPos === -1) { + return false; + } + const nextPos = endMarkerPos + endMarker.length; + if (endMarker.length === 1) { + // Skip if $ is preceded by a space character + const beforeEndMarker = state.src.charCodeAt(endMarkerPos - 1); + if (beforeEndMarker === 0x20 /* space */ + || beforeEndMarker === 0x09 /* \t */ + || beforeEndMarker === 0x0a /* \n */) { + return false; + } + // Skip if closing $ is succeeded by a digit (eg $5 $10 ...) + const suffix = state.src.charCodeAt(nextPos); + if (suffix >= 0x30 && suffix < 0x3A) { + return false; + } + } + + if (!silent) { + const token = state.push(endMarker.length === 1 ? 'inline_math' : 'display_math', '', 0); + token.content = state.src.slice(startMathPos, endMarkerPos); + } + state.pos = nextPos; + return true; +} + +export default (md) => { + md.inline.ruler.push('texMath', texMath); +}; diff --git a/src/extensions/libs/markdownItTasklist.js b/src/extensions/libs/markdownItTasklist.js new file mode 100644 index 0000000..45fccc2 --- /dev/null +++ b/src/extensions/libs/markdownItTasklist.js @@ -0,0 +1,40 @@ +function attrSet(token, name, value) { + const index = token.attrIndex(name); + const attr = [name, value]; + + if (index < 0) { + token.attrPush(attr); + } else { + token.attrs[index] = attr; + } +} + +module.exports = (md) => { + md.core.ruler.after('inline', 'tasklist', ({ tokens, Token }) => { + for (let i = 2; i < tokens.length; i += 1) { + const token = tokens[i]; + if (token.content + && token.content.charCodeAt(0) === 0x5b /* [ */ + && token.content.charCodeAt(2) === 0x5d /* ] */ + && token.content.charCodeAt(3) === 0x20 /* space */ + && token.type === 'inline' + && tokens[i - 1].type === 'paragraph_open' + && tokens[i - 2].type === 'list_item_open' + ) { + const cross = token.content[1].toLowerCase(); + if (cross === ' ' || cross === 'x') { + const checkbox = new Token('html_inline', '', 0); + if (cross === ' ') { + checkbox.content = ''; + } else { + checkbox.content = ''; + } + token.children.unshift(checkbox); + token.children[1].content = token.children[1].content.slice(3); + token.content = token.content.slice(3); + attrSet(tokens[i - 2], 'class', 'task-list-item'); + } + } + } + }); +}; diff --git a/src/extensions/markdownExtension.js b/src/extensions/markdownExtension.js new file mode 100644 index 0000000..f2c33e0 --- /dev/null +++ b/src/extensions/markdownExtension.js @@ -0,0 +1,163 @@ +import Prism from 'prismjs'; +import markdownitAbbr from 'markdown-it-abbr'; +import markdownitDeflist from 'markdown-it-deflist'; +import markdownitFootnote from 'markdown-it-footnote'; +import markdownitMark from 'markdown-it-mark'; +import markdownitImgsize from 'markdown-it-imsize'; +import markdownitSub from 'markdown-it-sub'; +import markdownitSup from 'markdown-it-sup'; +import markdownitTasklist from './libs/markdownItTasklist'; +import markdownitAnchor from './libs/markdownItAnchor'; +import extensionSvc from '../services/extensionSvc'; + +const coreBaseRules = [ + 'normalize', + 'block', + 'inline', + 'linkify', + 'replacements', + 'smartquotes', +]; +const blockBaseRules = [ + 'code', + 'fence', + 'blockquote', + 'hr', + 'list', + 'reference', + 'heading', + 'lheading', + 'html_block', + 'table', + 'paragraph', +]; +const inlineBaseRules = [ + 'text', + 'newline', + 'escape', + 'backticks', + 'strikethrough', + 'emphasis', + 'link', + 'image', + 'autolink', + 'html_inline', + 'entity', +]; +const inlineBaseRules2 = [ + 'balance_pairs', + 'strikethrough', + 'emphasis', + 'text_collapse', +]; + +extensionSvc.onGetOptions((options, properties) => Object + .assign(options, properties.extensions.markdown)); + +extensionSvc.onInitConverter(0, (markdown, options) => { + markdown.set({ + html: true, + breaks: !!options.breaks, + linkify: !!options.linkify, + typographer: !!options.typographer, + langPrefix: 'prism language-', + }); + + markdown.core.ruler.enable(coreBaseRules); + + const blockRules = blockBaseRules.slice(); + if (!options.fence) { + blockRules.splice(blockRules.indexOf('fence'), 1); + } + if (!options.table) { + blockRules.splice(blockRules.indexOf('table'), 1); + } + markdown.block.ruler.enable(blockRules); + + const inlineRules = inlineBaseRules.slice(); + const inlineRules2 = inlineBaseRules2.slice(); + if (!options.del) { + inlineRules.splice(blockRules.indexOf('strikethrough'), 1); + inlineRules2.splice(blockRules.indexOf('strikethrough'), 1); + } + markdown.inline.ruler.enable(inlineRules); + markdown.inline.ruler2.enable(inlineRules2); + + if (options.abbr) { + markdown.use(markdownitAbbr); + } + if (options.deflist) { + markdown.use(markdownitDeflist); + } + if (options.footnote) { + markdown.use(markdownitFootnote); + } + if (options.imgsize) { + markdown.use(markdownitImgsize); + } + if (options.mark) { + markdown.use(markdownitMark); + } + if (options.sub) { + markdown.use(markdownitSub); + } + if (options.sup) { + markdown.use(markdownitSup); + } + if (options.tasklist) { + markdown.use(markdownitTasklist); + } + markdown.use(markdownitAnchor); + + // Wrap tables into a div for scrolling + markdown.renderer.rules.table_open = (tokens, idx, opts) => + `
    ${markdown.renderer.renderToken(tokens, idx, opts)}`; + markdown.renderer.rules.table_close = (tokens, idx, opts) => + `${markdown.renderer.renderToken(tokens, idx, opts)}
    `; + + // Transform style into align attribute to pass the HTML sanitizer + const textAlignLength = 'text-align:'.length; + markdown.renderer.rules.td_open = (tokens, idx, opts) => { + const token = tokens[idx]; + if (token.attrs && token.attrs.length && token.attrs[0][0] === 'style') { + token.attrs = [ + ['align', token.attrs[0][1].slice(textAlignLength)], + ]; + } + return markdown.renderer.renderToken(tokens, idx, opts); + }; + markdown.renderer.rules.th_open = markdown.renderer.rules.td_open; + + markdown.renderer.rules.footnote_ref = (tokens, idx) => { + const n = `${Number(tokens[idx].meta.id + 1)}`; + let id = `fnref${n}`; + if (tokens[idx].meta.subId > 0) { + id += `:${tokens[idx].meta.subId}`; + } + return `[${n}]`; + }; +}); + +extensionSvc.onSectionPreview((elt, options, isEditor) => { + // Highlight with Prism + elt.querySelectorAll('.prism').cl_each((prismElt) => { + if (!prismElt.$highlightedWithPrism) { + Prism.highlightElement(prismElt); + prismElt.$highlightedWithPrism = true; + } + }); + + // Transform task spans into checkboxes + elt.querySelectorAll('span.task-list-item-checkbox').cl_each((spanElt) => { + const checkboxElt = document.createElement('input'); + checkboxElt.type = 'checkbox'; + checkboxElt.className = 'task-list-item-checkbox'; + if (spanElt.classList.contains('checked')) { + checkboxElt.setAttribute('checked', true); + } + if (!isEditor) { + checkboxElt.disabled = 'disabled'; + } + spanElt.parentNode.replaceChild(checkboxElt, spanElt); + }); +}); diff --git a/src/extensions/mermaidExtension.js b/src/extensions/mermaidExtension.js new file mode 100644 index 0000000..bd70f4e --- /dev/null +++ b/src/extensions/mermaidExtension.js @@ -0,0 +1,73 @@ +import 'mermaid'; +import extensionSvc from '../services/extensionSvc'; +import utils from '../services/utils'; + +const config = { + logLevel: 5, + startOnLoad: false, + arrowMarkerAbsolute: false, + theme: 'neutral', + flowchart: { + htmlLabels: true, + curve: 'linear', + }, + sequence: { + diagramMarginX: 50, + diagramMarginY: 10, + actorMargin: 50, + width: 150, + height: 65, + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + messageMargin: 35, + mirrorActors: true, + bottomMarginAdj: 1, + useMaxWidth: true, + }, + gantt: { + titleTopMargin: 25, + barHeight: 20, + barGap: 4, + topPadding: 50, + leftPadding: 75, + gridLineStartPadding: 35, + fontSize: 11, + fontFamily: '"Open-Sans", "sans-serif"', + numberSectionStyles: 4, + axisFormat: '%Y-%m-%d', + }, +}; + +const containerElt = document.createElement('div'); +containerElt.className = 'hidden-rendering-container'; +document.body.appendChild(containerElt); + +let init = () => { + window.mermaid.initialize(config); + init = () => {}; +}; + +const render = (elt) => { + try { + init(); + const svgId = `mermaid-svg-${utils.uid()}`; + window.mermaid.mermaidAPI.render(svgId, elt.textContent, () => { + while (elt.firstChild) { + elt.removeChild(elt.lastChild); + } + elt.appendChild(containerElt.querySelector(`#${svgId}`)); + }, containerElt); + } catch (e) { + console.error(e); // eslint-disable-line no-console + } +}; + +extensionSvc.onGetOptions((options, properties) => { + options.mermaid = properties.extensions.mermaid.enabled; +}); + +extensionSvc.onSectionPreview((elt) => { + elt.querySelectorAll('.prism.language-mermaid') + .cl_each(diagramElt => render(diagramElt.parentNode)); +}); diff --git a/src/icons/Alert.vue b/src/icons/Alert.vue new file mode 100644 index 0000000..cd0928a --- /dev/null +++ b/src/icons/Alert.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ArrowLeft.vue b/src/icons/ArrowLeft.vue new file mode 100644 index 0000000..2fc8bf0 --- /dev/null +++ b/src/icons/ArrowLeft.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ChatGpt.vue b/src/icons/ChatGpt.vue new file mode 100644 index 0000000..18bf3df --- /dev/null +++ b/src/icons/ChatGpt.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/icons/CheckCircle.vue b/src/icons/CheckCircle.vue new file mode 100644 index 0000000..7436ca9 --- /dev/null +++ b/src/icons/CheckCircle.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/CheckCircleUn.vue b/src/icons/CheckCircleUn.vue new file mode 100644 index 0000000..698c3c3 --- /dev/null +++ b/src/icons/CheckCircleUn.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Close.vue b/src/icons/Close.vue new file mode 100644 index 0000000..1802bf1 --- /dev/null +++ b/src/icons/Close.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/CodeBraces.vue b/src/icons/CodeBraces.vue new file mode 100644 index 0000000..e77a3ea --- /dev/null +++ b/src/icons/CodeBraces.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/CodeTags.vue b/src/icons/CodeTags.vue new file mode 100644 index 0000000..b12e7b0 --- /dev/null +++ b/src/icons/CodeTags.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ContentCopy.vue b/src/icons/ContentCopy.vue new file mode 100644 index 0000000..6aacf0c --- /dev/null +++ b/src/icons/ContentCopy.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ContentSave.vue b/src/icons/ContentSave.vue new file mode 100644 index 0000000..6478822 --- /dev/null +++ b/src/icons/ContentSave.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Copy.vue b/src/icons/Copy.vue new file mode 100644 index 0000000..2a962b0 --- /dev/null +++ b/src/icons/Copy.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/icons/Database.vue b/src/icons/Database.vue new file mode 100644 index 0000000..7f7be0b --- /dev/null +++ b/src/icons/Database.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Delete.vue b/src/icons/Delete.vue new file mode 100644 index 0000000..ca1d02d --- /dev/null +++ b/src/icons/Delete.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/DotsHorizontal.vue b/src/icons/DotsHorizontal.vue new file mode 100644 index 0000000..4376aee --- /dev/null +++ b/src/icons/DotsHorizontal.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Download.vue b/src/icons/Download.vue new file mode 100644 index 0000000..f49fba9 --- /dev/null +++ b/src/icons/Download.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Ellipsis.vue b/src/icons/Ellipsis.vue new file mode 100644 index 0000000..f0e7caf --- /dev/null +++ b/src/icons/Ellipsis.vue @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/icons/Eye.vue b/src/icons/Eye.vue new file mode 100644 index 0000000..376d0c5 --- /dev/null +++ b/src/icons/Eye.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FileImage.vue b/src/icons/FileImage.vue new file mode 100644 index 0000000..360af23 --- /dev/null +++ b/src/icons/FileImage.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FileMultiple.vue b/src/icons/FileMultiple.vue new file mode 100644 index 0000000..aa4bd3f --- /dev/null +++ b/src/icons/FileMultiple.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FilePlus.vue b/src/icons/FilePlus.vue new file mode 100644 index 0000000..2a10812 --- /dev/null +++ b/src/icons/FilePlus.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FileSearch.vue b/src/icons/FileSearch.vue new file mode 100644 index 0000000..18d3011 --- /dev/null +++ b/src/icons/FileSearch.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FindReplace.vue b/src/icons/FindReplace.vue new file mode 100644 index 0000000..3fea316 --- /dev/null +++ b/src/icons/FindReplace.vue @@ -0,0 +1,3 @@ + diff --git a/src/icons/Folder.vue b/src/icons/Folder.vue new file mode 100644 index 0000000..71f2cf3 --- /dev/null +++ b/src/icons/Folder.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FolderMultiple.vue b/src/icons/FolderMultiple.vue new file mode 100644 index 0000000..d2e5b07 --- /dev/null +++ b/src/icons/FolderMultiple.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FolderPlus.vue b/src/icons/FolderPlus.vue new file mode 100644 index 0000000..db1814a --- /dev/null +++ b/src/icons/FolderPlus.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatBold.vue b/src/icons/FormatBold.vue new file mode 100644 index 0000000..807b93d --- /dev/null +++ b/src/icons/FormatBold.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatItalic.vue b/src/icons/FormatItalic.vue new file mode 100644 index 0000000..d8f4e33 --- /dev/null +++ b/src/icons/FormatItalic.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatListBulleted.vue b/src/icons/FormatListBulleted.vue new file mode 100644 index 0000000..0eef620 --- /dev/null +++ b/src/icons/FormatListBulleted.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatListChecks.vue b/src/icons/FormatListChecks.vue new file mode 100644 index 0000000..77e403c --- /dev/null +++ b/src/icons/FormatListChecks.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatListNumbers.vue b/src/icons/FormatListNumbers.vue new file mode 100644 index 0000000..4383c3f --- /dev/null +++ b/src/icons/FormatListNumbers.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatQuoteClose.vue b/src/icons/FormatQuoteClose.vue new file mode 100644 index 0000000..878d0b6 --- /dev/null +++ b/src/icons/FormatQuoteClose.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatSize.vue b/src/icons/FormatSize.vue new file mode 100644 index 0000000..ccd3608 --- /dev/null +++ b/src/icons/FormatSize.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/FormatStrikethrough.vue b/src/icons/FormatStrikethrough.vue new file mode 100644 index 0000000..9e60453 --- /dev/null +++ b/src/icons/FormatStrikethrough.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/HelpCircle.vue b/src/icons/HelpCircle.vue new file mode 100644 index 0000000..ceb97b6 --- /dev/null +++ b/src/icons/HelpCircle.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/History.vue b/src/icons/History.vue new file mode 100644 index 0000000..b9e7c06 --- /dev/null +++ b/src/icons/History.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Information.vue b/src/icons/Information.vue new file mode 100644 index 0000000..f2a9c4e --- /dev/null +++ b/src/icons/Information.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Key.vue b/src/icons/Key.vue new file mode 100644 index 0000000..45478fd --- /dev/null +++ b/src/icons/Key.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/LinkVariant.vue b/src/icons/LinkVariant.vue new file mode 100644 index 0000000..1ea9b97 --- /dev/null +++ b/src/icons/LinkVariant.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Login.vue b/src/icons/Login.vue new file mode 100644 index 0000000..31ffcdb --- /dev/null +++ b/src/icons/Login.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Logout.vue b/src/icons/Logout.vue new file mode 100644 index 0000000..3c4564b --- /dev/null +++ b/src/icons/Logout.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Magnify.vue b/src/icons/Magnify.vue new file mode 100644 index 0000000..fe12842 --- /dev/null +++ b/src/icons/Magnify.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Menu.vue b/src/icons/Menu.vue new file mode 100644 index 0000000..461e3b9 --- /dev/null +++ b/src/icons/Menu.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Message.vue b/src/icons/Message.vue new file mode 100644 index 0000000..5afa933 --- /dev/null +++ b/src/icons/Message.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/NavigationBar.vue b/src/icons/NavigationBar.vue new file mode 100644 index 0000000..6e40d08 --- /dev/null +++ b/src/icons/NavigationBar.vue @@ -0,0 +1,6 @@ + diff --git a/src/icons/OpenInNew.vue b/src/icons/OpenInNew.vue new file mode 100644 index 0000000..04ba2ec --- /dev/null +++ b/src/icons/OpenInNew.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Pen.vue b/src/icons/Pen.vue new file mode 100644 index 0000000..01a2591 --- /dev/null +++ b/src/icons/Pen.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Printer.vue b/src/icons/Printer.vue new file mode 100644 index 0000000..45f9c07 --- /dev/null +++ b/src/icons/Printer.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Provider.vue b/src/icons/Provider.vue new file mode 100644 index 0000000..422e59e --- /dev/null +++ b/src/icons/Provider.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/icons/Redo.vue b/src/icons/Redo.vue new file mode 100644 index 0000000..8b3da65 --- /dev/null +++ b/src/icons/Redo.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ScrollSync.vue b/src/icons/ScrollSync.vue new file mode 100644 index 0000000..4f3745a --- /dev/null +++ b/src/icons/ScrollSync.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Seal.vue b/src/icons/Seal.vue new file mode 100644 index 0000000..c2ee5ea --- /dev/null +++ b/src/icons/Seal.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Search.vue b/src/icons/Search.vue new file mode 100644 index 0000000..a8d8834 --- /dev/null +++ b/src/icons/Search.vue @@ -0,0 +1,3 @@ + diff --git a/src/icons/SelectTheme.vue b/src/icons/SelectTheme.vue new file mode 100644 index 0000000..9760698 --- /dev/null +++ b/src/icons/SelectTheme.vue @@ -0,0 +1,3 @@ + diff --git a/src/icons/Settings.vue b/src/icons/Settings.vue new file mode 100644 index 0000000..7f99b66 --- /dev/null +++ b/src/icons/Settings.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Share.vue b/src/icons/Share.vue new file mode 100644 index 0000000..86e1a54 --- /dev/null +++ b/src/icons/Share.vue @@ -0,0 +1,3 @@ + diff --git a/src/icons/SidePreview.vue b/src/icons/SidePreview.vue new file mode 100644 index 0000000..90734db --- /dev/null +++ b/src/icons/SidePreview.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/SignalOff.vue b/src/icons/SignalOff.vue new file mode 100644 index 0000000..4eb3d29 --- /dev/null +++ b/src/icons/SignalOff.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/StatusBar.vue b/src/icons/StatusBar.vue new file mode 100644 index 0000000..ad5ac2c --- /dev/null +++ b/src/icons/StatusBar.vue @@ -0,0 +1,6 @@ + diff --git a/src/icons/SwitchTheme.vue b/src/icons/SwitchTheme.vue new file mode 100644 index 0000000..9d1c6b9 --- /dev/null +++ b/src/icons/SwitchTheme.vue @@ -0,0 +1,3 @@ + diff --git a/src/icons/Sync.vue b/src/icons/Sync.vue new file mode 100644 index 0000000..e287161 --- /dev/null +++ b/src/icons/Sync.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/SyncAuto.vue b/src/icons/SyncAuto.vue new file mode 100644 index 0000000..3549561 --- /dev/null +++ b/src/icons/SyncAuto.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/SyncOff.vue b/src/icons/SyncOff.vue new file mode 100644 index 0000000..615392c --- /dev/null +++ b/src/icons/SyncOff.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/SyncStop.vue b/src/icons/SyncStop.vue new file mode 100644 index 0000000..fef923a --- /dev/null +++ b/src/icons/SyncStop.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Table.vue b/src/icons/Table.vue new file mode 100644 index 0000000..df610e8 --- /dev/null +++ b/src/icons/Table.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Target.vue b/src/icons/Target.vue new file mode 100644 index 0000000..9bf2d86 --- /dev/null +++ b/src/icons/Target.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Toc.vue b/src/icons/Toc.vue new file mode 100644 index 0000000..ea38dee --- /dev/null +++ b/src/icons/Toc.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Undo.vue b/src/icons/Undo.vue new file mode 100644 index 0000000..75b2a0f --- /dev/null +++ b/src/icons/Undo.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/Upload.vue b/src/icons/Upload.vue new file mode 100644 index 0000000..8de403f --- /dev/null +++ b/src/icons/Upload.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/ViewList.vue b/src/icons/ViewList.vue new file mode 100644 index 0000000..8094fa3 --- /dev/null +++ b/src/icons/ViewList.vue @@ -0,0 +1,5 @@ + diff --git a/src/icons/index.js b/src/icons/index.js new file mode 100644 index 0000000..3ddd1ee --- /dev/null +++ b/src/icons/index.js @@ -0,0 +1,136 @@ +import Vue from 'vue'; +import Provider from './Provider'; +import FormatBold from './FormatBold'; +import FormatItalic from './FormatItalic'; +import FormatQuoteClose from './FormatQuoteClose'; +import LinkVariant from './LinkVariant'; +import FileImage from './FileImage'; +import Table from './Table'; +import FormatListNumbers from './FormatListNumbers'; +import FormatListBulleted from './FormatListBulleted'; +import FormatSize from './FormatSize'; +import FormatStrikethrough from './FormatStrikethrough'; +import StatusBar from './StatusBar'; +import NavigationBar from './NavigationBar'; +import SidePreview from './SidePreview'; +import Eye from './Eye'; +import Settings from './Settings'; +import FilePlus from './FilePlus'; +import FileMultiple from './FileMultiple'; +import FileSearch from './FileSearch'; +import FolderPlus from './FolderPlus'; +import Delete from './Delete'; +import Close from './Close'; +import Pen from './Pen'; +import Target from './Target'; +import ArrowLeft from './ArrowLeft'; +import HelpCircle from './HelpCircle'; +import Toc from './Toc'; +import Login from './Login'; +import Logout from './Logout'; +import Sync from './Sync'; +import SyncOff from './SyncOff'; +import SyncAuto from './SyncAuto'; +import SyncStop from './SyncStop'; +import Upload from './Upload'; +import ViewList from './ViewList'; +import Download from './Download'; +import CodeTags from './CodeTags'; +import CodeBraces from './CodeBraces'; +import OpenInNew from './OpenInNew'; +import Information from './Information'; +import Alert from './Alert'; +import SignalOff from './SignalOff'; +import Folder from './Folder'; +import ScrollSync from './ScrollSync'; +import Printer from './Printer'; +import Undo from './Undo'; +import Redo from './Redo'; +import ContentSave from './ContentSave'; +import Message from './Message'; +import History from './History'; +import Database from './Database'; +import Magnify from './Magnify'; +import FormatListChecks from './FormatListChecks'; +import CheckCircle from './CheckCircle'; +import CheckCircleUn from './CheckCircleUn'; +import ContentCopy from './ContentCopy'; +import Key from './Key'; +import DotsHorizontal from './DotsHorizontal'; +import Seal from './Seal'; +import SwitchTheme from './SwitchTheme'; +import Search from './Search'; +import FindReplace from './FindReplace'; +import SelectTheme from './SelectTheme'; +import Copy from './Copy'; +import Ellipsis from './Ellipsis'; +import Share from './Share'; +import ChatGpt from './ChatGpt'; + +Vue.component('iconProvider', Provider); +Vue.component('iconFormatBold', FormatBold); +Vue.component('iconFormatItalic', FormatItalic); +Vue.component('iconFormatQuoteClose', FormatQuoteClose); +Vue.component('iconLinkVariant', LinkVariant); +Vue.component('iconFileImage', FileImage); +Vue.component('iconTable', Table); +Vue.component('iconFormatListNumbers', FormatListNumbers); +Vue.component('iconFormatListBulleted', FormatListBulleted); +Vue.component('iconFormatSize', FormatSize); +Vue.component('iconFormatStrikethrough', FormatStrikethrough); +Vue.component('iconStatusBar', StatusBar); +Vue.component('iconNavigationBar', NavigationBar); +Vue.component('iconSidePreview', SidePreview); +Vue.component('iconEye', Eye); +Vue.component('iconSettings', Settings); +Vue.component('iconFilePlus', FilePlus); +Vue.component('iconFileMultiple', FileMultiple); +Vue.component('iconFileSearch', FileSearch); +Vue.component('iconFolderPlus', FolderPlus); +Vue.component('iconDelete', Delete); +Vue.component('iconClose', Close); +Vue.component('iconPen', Pen); +Vue.component('iconTarget', Target); +Vue.component('iconArrowLeft', ArrowLeft); +Vue.component('iconHelpCircle', HelpCircle); +Vue.component('iconToc', Toc); +Vue.component('iconLogin', Login); +Vue.component('iconLogout', Logout); +Vue.component('iconSync', Sync); +Vue.component('iconSyncOff', SyncOff); +Vue.component('iconSyncAuto', SyncAuto); +Vue.component('iconSyncStop', SyncStop); +Vue.component('iconUpload', Upload); +Vue.component('iconViewList', ViewList); +Vue.component('iconDownload', Download); +Vue.component('iconCodeTags', CodeTags); +Vue.component('iconCodeBraces', CodeBraces); +Vue.component('iconOpenInNew', OpenInNew); +Vue.component('iconInformation', Information); +Vue.component('iconAlert', Alert); +Vue.component('iconSignalOff', SignalOff); +Vue.component('iconFolder', Folder); +Vue.component('iconScrollSync', ScrollSync); +Vue.component('iconPrinter', Printer); +Vue.component('iconUndo', Undo); +Vue.component('iconRedo', Redo); +Vue.component('iconContentSave', ContentSave); +Vue.component('iconMessage', Message); +Vue.component('iconHistory', History); +Vue.component('iconDatabase', Database); +Vue.component('iconMagnify', Magnify); +Vue.component('iconFormatListChecks', FormatListChecks); +Vue.component('iconCheckCircle', CheckCircle); +Vue.component('iconCheckCircleUn', CheckCircleUn); +Vue.component('iconContentCopy', ContentCopy); +Vue.component('iconKey', Key); +Vue.component('iconDotsHorizontal', DotsHorizontal); +Vue.component('iconSeal', Seal); +Vue.component('iconSwitchTheme', SwitchTheme); +Vue.component('iconSearch', Search); +Vue.component('iconFindReplace', FindReplace); +Vue.component('iconSelectTheme', SelectTheme); +Vue.component('iconCopy', Copy); +Vue.component('iconEllipsis', Ellipsis); +Vue.component('iconShare', Share); +Vue.component('iconChatGpt', ChatGpt); diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..303c052 --- /dev/null +++ b/src/index.js @@ -0,0 +1,59 @@ +import Vue from 'vue'; +import 'babel-polyfill'; +import 'indexeddbshim/dist/indexeddbshim'; +import * as OfflinePluginRuntime from 'offline-plugin/runtime'; +import './extensions'; +import './services/optional'; +import './icons'; +import App from './components/App'; +import store from './store'; +import localDbSvc from './services/localDbSvc'; + +if (!indexedDB) { + throw new Error('不支持您的浏览器,请升级到最新版本。'); +} + +OfflinePluginRuntime.install({ + onUpdateReady: () => { + // Tells to new SW to take control immediately + OfflinePluginRuntime.applyUpdate(); + }, + onUpdated: async () => { + if (!store.state.light) { + await localDbSvc.sync(); + localStorage.updated = true; + // Reload the webpage to load into the new version + window.location.reload(); + } + }, +}); + +if (localStorage.updated) { + store.dispatch('notification/info', 'StackEdit中文版刚刚更新了!'); + setTimeout(() => localStorage.removeItem('updated'), 3000); +} + +if (!localStorage.installPrompted) { + window.addEventListener('beforeinstallprompt', async (promptEvent) => { + // Prevent Chrome 67 and earlier from automatically showing the prompt + promptEvent.preventDefault(); + + try { + await store.dispatch('notification/confirm', '将StackEdit中文版添加到您的主屏幕上?'); + promptEvent.prompt(); + await promptEvent.userChoice; + } catch (err) { + // Cancel + } + localStorage.installPrompted = true; + }); +} + +Vue.config.productionTip = false; + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + store, + render: h => h(App), +}); diff --git a/src/libs/clunderscore.js b/src/libs/clunderscore.js new file mode 100644 index 0000000..de2f239 --- /dev/null +++ b/src/libs/clunderscore.js @@ -0,0 +1,171 @@ +var arrayProperties = {} +var liveCollectionProperties = {} +var functionProperties = {} +var objectProperties = {} +var slice = Array.prototype.slice + +arrayProperties.cl_each = function (cb) { + var i = 0 + var length = this.length + for (; i < length; i++) { + cb(this[i], i, this) + } +} + +arrayProperties.cl_map = function (cb) { + var i = 0 + var length = this.length + var result = Array(length) + for (; i < length; i++) { + result[i] = cb(this[i], i, this) + } + return result +} + +arrayProperties.cl_reduce = function (cb, memo) { + var i = 0 + var length = this.length + for (; i < length; i++) { + memo = cb(memo, this[i], i, this) + } + return memo +} + +arrayProperties.cl_some = function (cb) { + var i = 0 + var length = this.length + for (; i < length; i++) { + if (cb(this[i], i, this)) { + return true + } + } +} + +arrayProperties.cl_filter = function (cb) { + var i = 0 + var length = this.length + var result = [] + for (; i < length; i++) { + cb(this[i], i, this) && result.push(this[i]) + } + return result +} + +liveCollectionProperties.cl_each = function (cb) { + slice.call(this).cl_each(cb) +} + +liveCollectionProperties.cl_map = function (cb) { + return slice.call(this).cl_map(cb) +} + +liveCollectionProperties.cl_filter = function (cb) { + return slice.call(this).cl_filter(cb) +} + +liveCollectionProperties.cl_reduce = function (cb, memo) { + return slice.call(this).cl_reduce(cb, memo) +} + +functionProperties.cl_bind = function (context) { + var self = this + var args = slice.call(arguments, 1) + context = context || null + return args.length + ? function () { + return arguments.length + ? self.apply(context, args.concat(slice.call(arguments))) + : self.apply(context, args) + } + : function () { + return arguments.length + ? self.apply(context, arguments) + : self.call(context) + } +} + +objectProperties.cl_each = function (cb) { + var i = 0 + var keys = Object.keys(this) + var length = keys.length + for (; i < length; i++) { + cb(this[keys[i]], keys[i], this) + } +} + +objectProperties.cl_map = function (cb) { + var i = 0 + var keys = Object.keys(this) + var length = keys.length + var result = Array(length) + for (; i < length; i++) { + result[i] = cb(this[keys[i]], keys[i], this) + } + return result +} + +objectProperties.cl_reduce = function (cb, memo) { + var i = 0 + var keys = Object.keys(this) + var length = keys.length + for (; i < length; i++) { + memo = cb(memo, this[keys[i]], keys[i], this) + } + return memo +} + +objectProperties.cl_some = function (cb) { + var i = 0 + var keys = Object.keys(this) + var length = keys.length + for (; i < length; i++) { + if (cb(this[keys[i]], keys[i], this)) { + return true + } + } +} + +objectProperties.cl_extend = function (obj) { + if (obj) { + var i = 0 + var keys = Object.keys(obj) + var length = keys.length + for (; i < length; i++) { + this[keys[i]] = obj[keys[i]] + } + } + return this +} + +function build(properties) { + return objectProperties.cl_reduce.call(properties, function (memo, value, key) { + memo[key] = { + value: value, + configurable: true + } + return memo + }, {}) +} + +arrayProperties = build(arrayProperties) +liveCollectionProperties = build(liveCollectionProperties) +functionProperties = build(functionProperties) +objectProperties = build(objectProperties) + +/* eslint-disable no-extend-native */ +Object.defineProperties(Array.prototype, arrayProperties) +Object.defineProperties(Int8Array.prototype, arrayProperties) +Object.defineProperties(Uint8Array.prototype, arrayProperties) +Object.defineProperties(Uint8ClampedArray.prototype, arrayProperties) +Object.defineProperties(Int16Array.prototype, arrayProperties) +Object.defineProperties(Uint16Array.prototype, arrayProperties) +Object.defineProperties(Int32Array.prototype, arrayProperties) +Object.defineProperties(Uint32Array.prototype, arrayProperties) +Object.defineProperties(Float32Array.prototype, arrayProperties) +Object.defineProperties(Float64Array.prototype, arrayProperties) +Object.defineProperties(Function.prototype, functionProperties) +Object.defineProperties(Object.prototype, objectProperties) +if (typeof window !== 'undefined') { + Object.defineProperties(HTMLCollection.prototype, liveCollectionProperties) + Object.defineProperties(NodeList.prototype, liveCollectionProperties) +} diff --git a/src/libs/htmlSanitizer.js b/src/libs/htmlSanitizer.js new file mode 100644 index 0000000..b11f29b --- /dev/null +++ b/src/libs/htmlSanitizer.js @@ -0,0 +1,424 @@ +const aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/; +const imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; + +const urlParsingNode = window.document.createElement('a'); + +function sanitizeUri(uri, isImage) { + const regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; + urlParsingNode.setAttribute('href', uri); + const normalizedVal = urlParsingNode.href; + if (normalizedVal !== '' && !normalizedVal.match(regex)) { + return `unsafe:${normalizedVal}`; + } + return uri; +} + +var buf; + +/* jshint -W083 */ + +// Regular Expressions for parsing tags and attributes +var START_TAG_REGEXP = + /^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/, + END_TAG_REGEXP = /^<\/\s*([\w:-]+)[^>]*>/, + ATTR_REGEXP = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g, + BEGIN_TAG_REGEXP = /^/g, + DOCTYPE_REGEXP = /]*?)>/i, + CDATA_REGEXP = //g, + SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + // Match everything outside of normal chars and " (quote character) + NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g; + + +// Good source of info about elements and attributes +// http://dev.w3.org/html5/spec/Overview.html#semantics +// http://simon.html5.org/html-elements + +// Safe Void Elements - HTML5 +// http://dev.w3.org/html5/spec/Overview.html#void-elements +var voidElements = makeMap("area,br,col,hr,img,wbr"); + +// Elements that you can, intentionally, leave open (and which close themselves) +// http://dev.w3.org/html5/spec/Overview.html#optional-tags +var optionalEndTagBlockElements = makeMap("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"), + optionalEndTagInlineElements = makeMap("rp,rt"), + optionalEndTagElements = { + ...optionalEndTagInlineElements, + ...optionalEndTagBlockElements, + }; + +// Safe Block Elements - HTML5 +var blockElements = { + ...optionalEndTagBlockElements, + ...makeMap("address,article," + + "aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5," + + "h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul") +}; + +// benweet: Add iframe +blockElements.iframe = true; + +// Inline Elements - HTML5 +var inlineElements = { + ...optionalEndTagInlineElements, + ...makeMap("a,abbr,acronym,b," + + "bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s," + + "samp,small,span,strike,strong,sub,sup,time,tt,u,var") +}; + +// SVG Elements +// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements +// Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. +// They can potentially allow for arbitrary javascript to be executed. See #11290 +var svgElements = makeMap("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph," + + "hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline," + + "radialGradient,rect,stop,svg,switch,text,title,tspan,use"); + +// Special Elements (can contain anything) +var specialElements = makeMap("script,style"); + +var validElements = { + ...voidElements, + ...blockElements, + ...inlineElements, + ...optionalEndTagElements, + ...svgElements, +}; + +//Attributes that have href and hence need to be sanitized +var uriAttrs = makeMap("background,cite,href,longdesc,src,usemap,xlink:href"); + +var htmlAttrs = makeMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + + 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + + 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + + 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + + 'valign,value,vspace,width'); + +// SVG attributes (without "id" and "name" attributes) +// https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes +var svgAttrs = makeMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + + 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + + 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + + 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + + 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + + 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + + 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + + 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + + 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + + 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + + 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + + 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + + 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + + 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + + 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); + +var validAttrs = { + ...uriAttrs, + ...svgAttrs, + ...htmlAttrs, +}; + +// benweet: Add id and allowfullscreen (YouTube iframe) +validAttrs.id = true; +validAttrs.allowfullscreen = true; + +function makeMap(str, lowercaseKeys) { + var obj = {}, + items = str.split(','), + i; + for (i = 0; i < items.length; i++) { + obj[lowercaseKeys ? items[i].toLowerCase() : items[i]] = true; + } + return obj; +} + + +/** + * @example + * htmlParser(htmlString, { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * }); + * + * @param {string} html string + * @param {object} handler + */ +function htmlParser(html, handler) { + if (typeof html !== 'string') { + if (html === null || typeof html === 'undefined') { + html = ''; + } else { + html = '' + html; + } + } + var index, chars, match, stack = [], + last = html, + text; + stack.last = function () { + return stack[stack.length - 1]; + }; + + while (html) { + text = ''; + chars = true; + + // Make sure we're not in a script or style element + if (!stack.last() || !specialElements[stack.last()]) { + + // Comment + if (html.indexOf("", index) === index) { + if (handler.comment) handler.comment(html.substring(4, index)); + html = html.substring(index + 3); + chars = false; + } + // DOCTYPE + } else if (DOCTYPE_REGEXP.test(html)) { + match = html.match(DOCTYPE_REGEXP); + + if (match) { + html = html.replace(match[0], ''); + chars = false; + } + // end tag + } else if (BEGING_END_TAGE_REGEXP.test(html)) { + match = html.match(END_TAG_REGEXP); + + if (match) { + html = html.substring(match[0].length); + match[0].replace(END_TAG_REGEXP, parseEndTag); + chars = false; + } + + // start tag + } else if (BEGIN_TAG_REGEXP.test(html)) { + match = html.match(START_TAG_REGEXP); + + if (match) { + // We only have a valid start-tag if there is a '>'. + if (match[4]) { + html = html.substring(match[0].length); + match[0].replace(START_TAG_REGEXP, parseStartTag); + } + chars = false; + } else { + // no ending tag found --- this piece should be encoded as an entity. + text += '<'; + html = html.substring(1); + } + } + + if (chars) { + index = html.indexOf("<"); + + text += index < 0 ? html : html.substring(0, index); + html = index < 0 ? "" : html.substring(index); + + if (handler.chars) handler.chars(decodeEntities(text)); + } + + } else { + // IE versions 9 and 10 do not understand the regex '[^]', so using a workaround with [\W\w]. + html = html.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*" + stack.last() + "[^>]*>", 'i'), + function (all, text) { + text = text.replace(COMMENT_REGEXP, "$1").replace(CDATA_REGEXP, "$1"); + + if (handler.chars) handler.chars(decodeEntities(text)); + + return ""; + }); + + parseEndTag("", stack.last()); + } + + if (html == last) { + // benweet + // throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block " + + // "of html: {0}", html); + stack.reverse(); + return stack.cl_each(function (tag) { + buf.push(''); + }); + } + last = html; + } + + // Clean up any remaining tags + parseEndTag(); + + function parseStartTag(tag, tagName, rest, unary) { + tagName = tagName && tagName.toLowerCase(); + if (blockElements[tagName]) { + while (stack.last() && inlineElements[stack.last()]) { + parseEndTag("", stack.last()); + } + } + + if (optionalEndTagElements[tagName] && stack.last() == tagName) { + parseEndTag("", tagName); + } + + unary = voidElements[tagName] || !!unary; + + if (!unary) { + stack.push(tagName); + } + + var attrs = {}; + + rest.replace(ATTR_REGEXP, + function (match, name, doubleQuotedValue, singleQuotedValue, unquotedValue) { + var value = doubleQuotedValue || singleQuotedValue || unquotedValue || ''; + + attrs[name] = decodeEntities(value); + }); + if (handler.start) handler.start(tagName, attrs, unary); + } + + function parseEndTag(tag, tagName) { + var pos = 0, + i; + tagName = tagName && tagName.toLowerCase(); + if (tagName) { + // Find the closest opened tag of the same type + for (pos = stack.length - 1; pos >= 0; pos--) { + if (stack[pos] == tagName) break; + } + } + + if (pos >= 0) { + // Close all the open elements, up the stack + for (i = stack.length - 1; i >= pos; i--) + if (handler.end) handler.end(stack[i]); + + // Remove the open elements from the stack + stack.length = pos; + } + } +} + +var hiddenPre = document.createElement("pre"); +/** + * decodes all entities into regular string + * @param value + * @returns {string} A string with decoded entities. + */ +function decodeEntities(value) { + if (!value) { + return ''; + } + + hiddenPre.innerHTML = value.replace(//g, '>'); +} + +/** + * create an HTML/XML writer which writes to buffer + * @param {Array} buf use buf.jain('') to get out sanitized html string + * @returns {object} in the form of { + * start: function(tag, attrs, unary) {}, + * end: function(tag) {}, + * chars: function(text) {}, + * comment: function(text) {} + * } + */ +function htmlSanitizeWriter(buf, uriValidator) { + var ignore = false; + var out = buf.push.bind(buf); + return { + start: function (tag, attrs, unary) { + tag = tag && tag.toLowerCase(); + if (!ignore && specialElements[tag]) { + ignore = tag; + } + if (!ignore && validElements[tag] === true) { + out('<'); + out(tag); + Object.keys(attrs).forEach(function (key) { + var value = attrs[key]; + var lkey = key && key.toLowerCase(); + var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); + if (validAttrs[lkey] === true && + (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { + out(' '); + out(key); + out('="'); + out(encodeEntities(value)); + out('"'); + } + }); + out(unary ? '/>' : '>'); + } + }, + end: function (tag) { + tag = tag && tag.toLowerCase(); + if (!ignore && validElements[tag] === true) { + out(''); + } + if (tag == ignore) { + ignore = false; + } + }, + chars: function (chars) { + if (!ignore) { + out(encodeEntities(chars)); + } + }, + comment: function (comment) { + if (!ignore) { + out(''); + } + } + }; +} + +function sanitizeHtml(html) { + buf = []; + htmlParser(html, htmlSanitizeWriter(buf, function (uri, isImage) { + return !/^unsafe/.test(sanitizeUri(uri, isImage)); + })); + return buf.join(''); +} + + +export default { + sanitizeHtml, + sanitizeUri, +} diff --git a/src/libs/pagedown.js b/src/libs/pagedown.js new file mode 100644 index 0000000..f4144d9 --- /dev/null +++ b/src/libs/pagedown.js @@ -0,0 +1,1423 @@ +var util = {}, + re = window.RegExp, + SETTINGS = { + lineLength: 72 + }; + +var defaultsStrings = { + bold: "Strong Ctrl/Cmd+B", + boldexample: "加粗文本", + + italic: "Emphasis Ctrl/Cmd+I", + italicexample: "强调文本", + + strikethrough: "Strikethrough Ctrl/Cmd+I", + strikethroughexample: "删除线文本", + + link: "Hyperlink Ctrl/Cmd+L", + linkdescription: "这里输入链接描述", + linkdialog: "

    Insert Hyperlink

    http://example.com/ \"optional title\"

    ", + + quote: "Blockquote
    Ctrl/Cmd+Q", + quoteexample: "块引用", + + code: "Code Sample
     Ctrl/Cmd+K",
    +  codeexample: "这里输入代码",
    +
    +  image: "Image  Ctrl/Cmd+G",
    +  imagedescription: "输入图片说明",
    +  imagedialog: "

    Insert Image

    http://example.com/images/diagram.jpg \"optional title\"

    Need
    free image hosting?

    ", + + olist: "Numbered List
      Ctrl/Cmd+O", + ulist: "Bulleted List
        Ctrl/Cmd+U", + litem: "这里是列表文本", + + heading: "Heading

        /

        Ctrl/Cmd+H", + headingexample: "标题", + + hr: "Horizontal Rule
        Ctrl/Cmd+R", + + undo: "Undo - Ctrl/Cmd+Z", + redo: "Redo - Ctrl/Cmd+Y", + + help: "Markdown Editing Help", + + formulaexample: "这里输入Latex表达式", +}; + +// options, if given, can have the following properties: +// options.helpButton = { handler: yourEventHandler } +// options.strings = { italicexample: "slanted text" } +// `yourEventHandler` is the click handler for the help button. +// If `options.helpButton` isn't given, not help button is created. +// `options.strings` can have any or all of the same properties as +// `defaultStrings` above, so you can just override some string displayed +// to the user on a case-by-case basis, or translate all strings to +// a different language. +// +// For backwards compatibility reasons, the `options` argument can also +// be just the `helpButton` object, and `strings.help` can also be set via +// `helpButton.title`. This should be considered legacy. +// +// The constructed editor object has the methods: +// - getConverter() returns the markdown converter object that was passed to the constructor +// - run() actually starts the editor; should be called after all necessary plugins are registered. Calling this more than once is a no-op. +// - refreshPreview() forces the preview to be updated. This method is only available after run() was called. +function Pagedown(options) { + + options = options || {}; + + if (typeof options.handler === "function") { //backwards compatible behavior + options = { + helpButton: options + }; + } + options.strings = options.strings || {}; + var getString = function (identifier) { + return options.strings[identifier] || defaultsStrings[identifier]; + }; + + function identity(x) { + return x; + } + + function returnFalse() { + return false; + } + + function HookCollection() { } + HookCollection.prototype = { + + chain: function (hookname, func) { + var original = this[hookname]; + if (!original) { + throw new Error("unknown hook " + hookname); + } + + if (original === identity) { + this[hookname] = func; + } else { + this[hookname] = function () { + var args = Array.prototype.slice.call(arguments, 0); + args[0] = original.apply(null, args); + return func.apply(null, args); + }; + } + }, + set: function (hookname, func) { + if (!this[hookname]) { + throw new Error("unknown hook " + hookname); + } + this[hookname] = func; + }, + addNoop: function (hookname) { + this[hookname] = identity; + }, + addFalse: function (hookname) { + this[hookname] = returnFalse; + } + }; + + var hooks = this.hooks = new HookCollection(); + hooks.addNoop("onPreviewRefresh"); // called with no arguments after the preview has been refreshed + hooks.addNoop("postBlockquoteCreation"); // called with the user's selection *after* the blockquote was created; should return the actual to-be-inserted text + hooks.addFalse("insertImageDialog"); + hooks.addFalse("insertChatGptDialog"); + /* called with one parameter: a callback to be called with the URL of the image. If the application creates + * its own image insertion dialog, this hook should return true, and the callback should be called with the chosen + * image url (or null if the user cancelled). If this hook returns false, the default dialog will be used. + */ + hooks.addFalse("insertLinkDialog"); + // 插入图片占位字符 + hooks.addFalse("insertImageUploading"); + + var that = this, + input; + + this.run = function () { + if (input) + return; // already initialized + + input = options.input; + var commandManager = new CommandManager(hooks, getString); + var uiManager; + + uiManager = new UIManager(input, commandManager); + + that.uiManager = uiManager; + }; + +} + +// before: contains all the text in the input box BEFORE the selection. +// after: contains all the text in the input box AFTER the selection. +function Chunks() { } + +// startRegex: a regular expression to find the start tag +// endRegex: a regular expresssion to find the end tag +Chunks.prototype.findTags = function (startRegex, endRegex) { + + var chunkObj = this; + var regex; + + if (startRegex) { + + regex = util.extendRegExp(startRegex, "", "$"); + + this.before = this.before.replace(regex, + function (match) { + chunkObj.startTag = chunkObj.startTag + match; + return ""; + }); + + regex = util.extendRegExp(startRegex, "^", ""); + + this.selection = this.selection.replace(regex, + function (match) { + chunkObj.startTag = chunkObj.startTag + match; + return ""; + }); + } + + if (endRegex) { + + regex = util.extendRegExp(endRegex, "", "$"); + + this.selection = this.selection.replace(regex, + function (match) { + chunkObj.endTag = match + chunkObj.endTag; + return ""; + }); + + regex = util.extendRegExp(endRegex, "^", ""); + + this.after = this.after.replace(regex, + function (match) { + chunkObj.endTag = match + chunkObj.endTag; + return ""; + }); + } +}; + +// If remove is false, the whitespace is transferred +// to the before/after regions. +// +// If remove is true, the whitespace disappears. +Chunks.prototype.trimWhitespace = function (remove) { + var beforeReplacer, afterReplacer, that = this; + if (remove) { + beforeReplacer = afterReplacer = ""; + } else { + beforeReplacer = function (s) { + that.before += s; + return ""; + }; + afterReplacer = function (s) { + that.after = s + that.after; + return ""; + }; + } + + this.selection = this.selection.replace(/^(\s*)/, beforeReplacer).replace(/(\s*)$/, afterReplacer); +}; + + +Chunks.prototype.skipLines = function (nLinesBefore, nLinesAfter, findExtraNewlines) { + + if (nLinesBefore === undefined) { + nLinesBefore = 1; + } + + if (nLinesAfter === undefined) { + nLinesAfter = 1; + } + + nLinesBefore++; + nLinesAfter++; + + var regexText; + var replacementText; + + // chrome bug ... documented at: http://meta.stackoverflow.com/questions/63307/blockquote-glitch-in-editor-in-chrome-6-and-7/65985#65985 + if (navigator.userAgent.match(/Chrome/)) { + "X".match(/()./); + } + + this.selection = this.selection.replace(/(^\n*)/, ""); + + this.startTag = this.startTag + re.$1; + + this.selection = this.selection.replace(/(\n*$)/, ""); + this.endTag = this.endTag + re.$1; + this.startTag = this.startTag.replace(/(^\n*)/, ""); + this.before = this.before + re.$1; + this.endTag = this.endTag.replace(/(\n*$)/, ""); + this.after = this.after + re.$1; + + if (this.before) { + + regexText = replacementText = ""; + + while (nLinesBefore--) { + regexText += "\\n?"; + replacementText += "\n"; + } + + if (findExtraNewlines) { + regexText = "\\n*"; + } + this.before = this.before.replace(new re(regexText + "$", ""), replacementText); + } + + if (this.after) { + + regexText = replacementText = ""; + + while (nLinesAfter--) { + regexText += "\\n?"; + replacementText += "\n"; + } + if (findExtraNewlines) { + regexText = "\\n*"; + } + + this.after = this.after.replace(new re(regexText, ""), replacementText); + } +}; + +// end of Chunks + +// Converts \r\n and \r to \n. +util.fixEolChars = function (text) { + text = text.replace(/\r\n/g, "\n"); + text = text.replace(/\r/g, "\n"); + return text; +}; + +// Extends a regular expression. Returns a new RegExp +// using pre + regex + post as the expression. +// Used in a few functions where we have a base +// expression and we want to pre- or append some +// conditions to it (e.g. adding "$" to the end). +// The flags are unchanged. +// +// regex is a RegExp, pre and post are strings. +util.extendRegExp = function (regex, pre, post) { + + if (pre === null || pre === undefined) { + pre = ""; + } + if (post === null || post === undefined) { + post = ""; + } + + var pattern = regex.toString(); + var flags; + + // Replace the flags with empty space and store them. + pattern = pattern.replace(/\/([gim]*)$/, function (wholeMatch, flagsPart) { + flags = flagsPart; + return ""; + }); + + // Remove the slash delimiters on the regular expression. + pattern = pattern.replace(/(^\/|\/$)/g, ""); + pattern = pre + pattern + post; + + return new re(pattern, flags); +}; + +// The input textarea state/contents. +// This is used to implement undo/redo by the undo manager. +function TextareaState(input) { + + // Aliases + var stateObj = this; + var inputArea = input; + this.init = function () { + this.setInputAreaSelectionStartEnd(); + this.text = inputArea.getContent(); + }; + + // Sets the selected text in the input box after we've performed an + // operation. + this.setInputAreaSelection = function () { + inputArea.focus(); + inputArea.setSelection(stateObj.start, stateObj.end); + }; + + this.setInputAreaSelectionStartEnd = function () { + stateObj.start = Math.min( + inputArea.selectionMgr.selectionStart, + inputArea.selectionMgr.selectionEnd + ); + stateObj.end = Math.max( + inputArea.selectionMgr.selectionStart, + inputArea.selectionMgr.selectionEnd + ); + }; + + // Restore this state into the input area. + this.restore = function () { + + if (stateObj.text !== undefined && stateObj.text != inputArea.getContent()) { + inputArea.setContent(stateObj.text); + } + this.setInputAreaSelection(); + }; + + // Gets a collection of HTML chunks from the inptut textarea. + this.getChunks = function () { + + var chunk = new Chunks(); + chunk.before = util.fixEolChars(stateObj.text.substring(0, stateObj.start)); + chunk.startTag = ""; + chunk.selection = util.fixEolChars(stateObj.text.substring(stateObj.start, stateObj.end)); + chunk.endTag = ""; + chunk.after = util.fixEolChars(stateObj.text.substring(stateObj.end)); + + return chunk; + }; + + // Sets the TextareaState properties given a chunk of markdown. + this.setChunks = function (chunk) { + + chunk.before = chunk.before + chunk.startTag; + chunk.after = chunk.endTag + chunk.after; + + this.start = chunk.before.length; + this.end = chunk.before.length + chunk.selection.length; + this.text = chunk.before + chunk.selection + chunk.after; + }; + this.init(); +} + +function UIManager(input, commandManager) { + + var inputBox = input, + buttons = {}; // buttons.undo, buttons.link, etc. The actual DOM elements. + + makeSpritedButtonRow(); + + // Perform the button's action. + function doClick(buttonName) { + var button = buttons[buttonName]; + if (!button) { + return; + } + + inputBox.focus(); + var linkOrImage = button === buttons.link || button.id === buttons.image; + + var state = new TextareaState(input); + + if (!state) { + return; + } + + var chunks = state.getChunks(); + + // Some commands launch a "modal" prompt dialog. Javascript + // can't really make a modal dialog box and the WMD code + // will continue to execute while the dialog is displayed. + // This prevents the dialog pattern I'm used to and means + // I can't do something like this: + // + // var link = CreateLinkDialog(); + // makeMarkdownLink(link); + // + // Instead of this straightforward method of handling a + // dialog I have to pass any code which would execute + // after the dialog is dismissed (e.g. link creation) + // in a function parameter. + // + // Yes this is awkward and I think it sucks, but there's + // no real workaround. Only the image and link code + // create dialogs and require the function pointers. + var fixupInputArea = function () { + + inputBox.focus(); + + if (chunks) { + state.setChunks(chunks); + } + + state.restore(); + }; + + var noCleanup = button(chunks, fixupInputArea); + + if (!noCleanup) { + fixupInputArea(); + if (!linkOrImage) { + inputBox.adjustCursorPosition(); + } + } + } + + function bindCommand(method) { + if (typeof method === "string") + method = commandManager[method]; + return function () { + method.apply(commandManager, arguments); + }; + } + + function makeSpritedButtonRow() { + + buttons.bold = bindCommand("doBold"); + buttons.italic = bindCommand("doItalic"); + buttons.strikethrough = bindCommand("doStrikethrough"); + buttons.inlineformula = bindCommand("doInlinkeFormula"); + buttons.imageUploading = bindCommand("doImageUploading"); + buttons.link = bindCommand(function (chunk, postProcessing) { + return this.doLinkOrImage(chunk, postProcessing, false); + }); + buttons.quote = bindCommand("doBlockquote"); + buttons.code = bindCommand("doCode"); + buttons.image = bindCommand(function (chunk, postProcessing) { + return this.doLinkOrImage(chunk, postProcessing, true); + }); + buttons.chatgpt = bindCommand("doChatGpt"); + buttons.olist = bindCommand(function (chunk, postProcessing) { + this.doList(chunk, postProcessing, true); + }); + buttons.ulist = bindCommand(function (chunk, postProcessing) { + this.doList(chunk, postProcessing, false); + }); + buttons.clist = bindCommand(function (chunk, postProcessing) { + this.doList(chunk, postProcessing, false, true); + }); + buttons.heading = bindCommand("doHeading"); + buttons.hr = bindCommand("doHorizontalRule"); + buttons.table = bindCommand("doTable"); + } + + this.doClick = doClick; + +} + +function CommandManager(pluginHooks, getString) { + this.hooks = pluginHooks; + this.getString = getString; +} + +var commandProto = CommandManager.prototype; + +// The markdown symbols - 4 spaces = code, > = blockquote, etc. +commandProto.prefixes = "(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)"; + +// Remove markdown symbols from the chunk selection. +commandProto.unwrap = function (chunk) { + var txt = new re("([^\\n])\\n(?!(\\n|" + this.prefixes + "))", "g"); + chunk.selection = chunk.selection.replace(txt, "$1 $2"); +}; + +commandProto.wrap = function (chunk, len) { + this.unwrap(chunk); + var regex = new re("(.{1," + len + "})( +|$\\n?)", "gm"), + that = this; + + chunk.selection = chunk.selection.replace(regex, function (line, marked) { + if (new re("^" + that.prefixes, "").test(line)) { + return line; + } + return marked + "\n"; + }); + + chunk.selection = chunk.selection.replace(/\s+$/, ""); +}; + +commandProto.doBold = function (chunk, postProcessing) { + return this.doBorI(chunk, postProcessing, 2, this.getString("boldexample")); +}; + +commandProto.doItalic = function (chunk, postProcessing) { + return this.doBorI(chunk, postProcessing, 1, this.getString("italicexample")); +}; + +// chunk: The selected region that will be enclosed with */** +// nStars: 1 for italics, 2 for bold +// insertText: If you just click the button without highlighting text, this gets inserted +commandProto.doBorI = function (chunk, postProcessing, nStars, insertText) { + + // Get rid of whitespace and fixup newlines. + chunk.trimWhitespace(); + chunk.selection = chunk.selection.replace(/\n{2,}/g, "\n"); + + // Look for stars before and after. Is the chunk already marked up? + // note that these regex matches cannot fail + var starsBefore = /(\**$)/.exec(chunk.before)[0]; + var starsAfter = /(^\**)/.exec(chunk.after)[0]; + + var prevStars = Math.min(starsBefore.length, starsAfter.length); + + // Remove stars if we have to since the button acts as a toggle. + if ((prevStars >= nStars) && (prevStars != 2 || nStars != 1)) { + chunk.before = chunk.before.replace(re("[*]{" + nStars + "}$", ""), ""); + chunk.after = chunk.after.replace(re("^[*]{" + nStars + "}", ""), ""); + } else if (!chunk.selection && starsAfter) { + // It's not really clear why this code is necessary. It just moves + // some arbitrary stuff around. + chunk.after = chunk.after.replace(/^([*_]*)/, ""); + chunk.before = chunk.before.replace(/(\s?)$/, ""); + var whitespace = re.$1; + chunk.before = chunk.before + starsAfter + whitespace; + } else { + + // In most cases, if you don't have any selected text and click the button + // you'll get a selected, marked up region with the default text inserted. + if (!chunk.selection && !starsAfter) { + chunk.selection = insertText; + } + + // Add the true markup. + var markup = nStars <= 1 ? "*" : "**"; // shouldn't the test be = ? + chunk.before = chunk.before + markup; + chunk.after = markup + chunk.after; + } + + return; +}; + +commandProto.doStrikethrough = function (chunk, postProcessing) { + + // Get rid of whitespace and fixup newlines. + chunk.trimWhitespace(); + chunk.selection = chunk.selection.replace(/\n{2,}/g, "\n"); + + // Look for stars before and after. Is the chunk already marked up? + // note that these regex matches cannot fail + var starsBefore = /(~*$)/.exec(chunk.before)[0]; + var starsAfter = /(^~*)/.exec(chunk.after)[0]; + + var prevStars = Math.min(starsBefore.length, starsAfter.length); + + var nStars = 2; + + // Remove stars if we have to since the button acts as a toggle. + if ((prevStars >= nStars) && (prevStars != 2 || nStars != 1)) { + chunk.before = chunk.before.replace(re("[~]{" + nStars + "}$", ""), ""); + chunk.after = chunk.after.replace(re("^[~]{" + nStars + "}", ""), ""); + } else if (!chunk.selection && starsAfter) { + // It's not really clear why this code is necessary. It just moves + // some arbitrary stuff around. + chunk.after = chunk.after.replace(/^(~*)/, ""); + chunk.before = chunk.before.replace(/(\s?)$/, ""); + var whitespace = re.$1; + chunk.before = chunk.before + starsAfter + whitespace; + } else { + + // In most cases, if you don't have any selected text and click the button + // you'll get a selected, marked up region with the default text inserted. + if (!chunk.selection && !starsAfter) { + chunk.selection = this.getString("strikethroughexample"); + } + + // Add the true markup. + var markup = "~~"; // shouldn't the test be = ? + chunk.before = chunk.before + markup; + chunk.after = markup + chunk.after; + } + + return; +}; + +commandProto.doInlinkeFormula = function (chunk, postProcessing) { + + // Get rid of whitespace and fixup newlines. + chunk.trimWhitespace(); + chunk.selection = chunk.selection.replace(/\n{2,}/g, "\n"); + + // Look for stars before and after. Is the chunk already marked up? + // note that these regex matches cannot fail + var starsBefore = /(\$*$)/.exec(chunk.before)[0]; + var starsAfter = /(^\$*)/.exec(chunk.after)[0]; + + var prevStars = Math.min(starsBefore.length, starsAfter.length); + + var nStars = 2; + + // Remove stars if we have to since the button acts as a toggle. + if ((prevStars >= nStars) && (prevStars != 2 || nStars != 1)) { + chunk.before = chunk.before.replace(re("[\$]{" + nStars + "}$", ""), ""); + chunk.after = chunk.after.replace(re("^[\$]{" + nStars + "}", ""), ""); + } else if (!chunk.selection && starsAfter) { + // It's not really clear why this code is necessary. It just moves + // some arbitrary stuff around. + chunk.after = chunk.after.replace(/^(\$*)/, ""); + chunk.before = chunk.before.replace(/(\s?)$/, ""); + var whitespace = re.$1; + chunk.before = chunk.before + starsAfter + whitespace; + } else { + + // In most cases, if you don't have any selected text and click the button + // you'll get a selected, marked up region with the default text inserted. + if (!chunk.selection && !starsAfter) { + chunk.selection = this.getString("formulaexample"); + } + + // Add the true markup. + var markup = "$"; // shouldn't the test be = ? + chunk.before = chunk.before + markup; + chunk.after = markup + chunk.after; + } + + return; +}; + +commandProto.doImageUploading = function (chunk, postProcessing) { + var enteredCallback = function (imgId) { + if (imgId !== null) { + chunk.before = `${chunk.before}[图片上传中...(image-${imgId})]`; + chunk.selection = ''; + } + postProcessing(); + }; + this.hooks.insertImageUploading(enteredCallback); +} + +commandProto.stripLinkDefs = function (text, defsToAdd) { + + text = text.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm, + function (totalMatch, id, link, newlines, title) { + defsToAdd[id] = totalMatch.replace(/\s*$/, ""); + if (newlines) { + // Strip the title and return that separately. + defsToAdd[id] = totalMatch.replace(/["(](.+?)[")]$/, ""); + return newlines + title; + } + return ""; + }); + + return text; +}; + +commandProto.addLinkDef = function (chunk, linkDef) { + + var refNumber = 0; // The current reference number + var defsToAdd = {}; // + // Start with a clean slate by removing all previous link definitions. + chunk.before = this.stripLinkDefs(chunk.before, defsToAdd); + chunk.selection = this.stripLinkDefs(chunk.selection, defsToAdd); + chunk.after = this.stripLinkDefs(chunk.after, defsToAdd); + + var defs = ""; + var regex = /(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g; + + var addDefNumber = function (def) { + refNumber++; + def = def.replace(/^[ ]{0,3}\[(\d+)\]:/, " [" + refNumber + "]:"); + defs += "\n" + def; + }; + + // note that + // a) the recursive call to getLink cannot go infinite, because by definition + // of regex, inner is always a proper substring of wholeMatch, and + // b) more than one level of nesting is neither supported by the regex + // nor making a lot of sense (the only use case for nesting is a linked image) + var getLink = function (wholeMatch, before, inner, afterInner, id, end) { + inner = inner.replace(regex, getLink); + if (defsToAdd[id]) { + addDefNumber(defsToAdd[id]); + return before + inner + afterInner + refNumber + end; + } + return wholeMatch; + }; + + chunk.before = chunk.before.replace(regex, getLink); + + if (linkDef) { + addDefNumber(linkDef); + } else { + chunk.selection = chunk.selection.replace(regex, getLink); + } + + var refOut = refNumber; + + chunk.after = chunk.after.replace(regex, getLink); + + if (chunk.after) { + chunk.after = chunk.after.replace(/\n*$/, ""); + } + if (!chunk.after) { + chunk.selection = chunk.selection.replace(/\n*$/, ""); + } + + chunk.after += "\n\n" + defs; + + return refOut; +}; + +// takes the line as entered into the add link/as image dialog and makes +// sure the URL and the optinal title are "nice". +function properlyEncoded(linkdef) { + return linkdef.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/, function (wholematch, link, title) { + link = link.replace(/\?.*$/, function (querypart) { + return querypart.replace(/\+/g, " "); // in the query string, a plus and a space are identical + }); + link = decodeURIComponent(link); // unencode first, to prevent double encoding + link = encodeURI(link).replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29'); + link = link.replace(/\?.*$/, function (querypart) { + return querypart.replace(/\+/g, "%2b"); // since we replaced plus with spaces in the query part, all pluses that now appear where originally encoded + }); + if (title) { + title = title.trim ? title.trim() : title.replace(/^\s*/, "").replace(/\s*$/, ""); + title = title.replace(/"/g, "quot;").replace(/\(/g, "(").replace(/\)/g, ")").replace(//g, ">"); + } + return title ? link + ' "' + title + '"' : link; + }); +} + +commandProto.doLinkOrImage = function (chunk, postProcessing, isImage) { + + chunk.trimWhitespace(); + //chunk.findTags(/\s*!?\[/, /\][ ]?(?:\n[ ]*)?(\[.*?\])?/); + chunk.findTags(/\s*!?\[/, /\][ ]?(?:\n[ ]*)?(\(.*?\))?/); + + if (chunk.endTag.length > 1 && chunk.startTag.length > 0) { + + chunk.startTag = chunk.startTag.replace(/!?\[/, ""); + chunk.endTag = ""; + this.addLinkDef(chunk, null); + + } else { + + // We're moving start and end tag back into the selection, since (as we're in the else block) we're not + // *removing* a link, but *adding* one, so whatever findTags() found is now back to being part of the + // link text. linkEnteredCallback takes care of escaping any brackets. + chunk.selection = chunk.startTag + chunk.selection + chunk.endTag; + chunk.startTag = chunk.endTag = ""; + + if (/\n\n/.test(chunk.selection)) { + this.addLinkDef(chunk, null); + return; + } + var that = this; + // The function to be executed when you enter a link and press OK or Cancel. + // Marks up the link and adds the ref. + var linkEnteredCallback = function (link) { + + if (link !== null) { + // ( $1 + // [^\\] anything that's not a backslash + // (?:\\\\)* an even number (this includes zero) of backslashes + // ) + // (?= followed by + // [[\]] an opening or closing bracket + // ) + // + // In other words, a non-escaped bracket. These have to be escaped now to make sure they + // don't count as the end of the link or similar. + // Note that the actual bracket has to be a lookahead, because (in case of to subsequent brackets), + // the bracket in one match may be the "not a backslash" character in the next match, so it + // should not be consumed by the first match. + // The "prepend a space and finally remove it" steps makes sure there is a "not a backslash" at the + // start of the string, so this also works if the selection begins with a bracket. We cannot solve + // this by anchoring with ^, because in the case that the selection starts with two brackets, this + // would mean a zero-width match at the start. Since zero-width matches advance the string position, + // the first bracket could then not act as the "not a backslash" for the second. + chunk.selection = (" " + chunk.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1); + + /* + var linkDef = " [999]: " + properlyEncoded(link); + + var num = that.addLinkDef(chunk, linkDef); + */ + chunk.startTag = isImage ? "![" : "["; + //chunk.endTag = "][" + num + "]"; + chunk.endTag = "](" + properlyEncoded(link) + ")"; + + if (!chunk.selection) { + if (isImage) { + chunk.selection = that.getString("imagedescription"); + } else { + chunk.selection = that.getString("linkdescription"); + } + } + } + postProcessing(); + }; + + if (isImage) { + this.hooks.insertImageDialog(linkEnteredCallback); + } else { + this.hooks.insertLinkDialog(linkEnteredCallback); + } + return true; + } +}; + +commandProto.doChatGpt = function (chunk, postProcessing) { + var enteredCallback = function (content) { + if (content !== null) { + chunk.before = `${chunk.before}${content}`; + chunk.selection = ''; + } + postProcessing(); + }; + this.hooks.insertChatGptDialog(enteredCallback); +}; + +// When making a list, hitting shift-enter will put your cursor on the next line +// at the current indent level. +commandProto.doAutoindent = function (chunk) { + + var commandMgr = this, + fakeSelection = false; + + chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/, "\n\n"); + chunk.before = chunk.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/, "\n\n"); + chunk.before = chunk.before.replace(/(\n|^)[ \t]+\n$/, "\n\n"); + + // There's no selection, end the cursor wasn't at the end of the line: + // The user wants to split the current list item / code line / blockquote line + // (for the latter it doesn't really matter) in two. Temporarily select the + // (rest of the) line to achieve this. + if (!chunk.selection && !/^[ \t]*(?:\n|$)/.test(chunk.after)) { + chunk.after = chunk.after.replace(/^[^\n]*/, function (wholeMatch) { + chunk.selection = wholeMatch; + return ""; + }); + fakeSelection = true; + } + + if (/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(chunk.before)) { + if (commandMgr.doList) { + commandMgr.doList(chunk); + } + } + if (/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(chunk.before)) { + if (commandMgr.doBlockquote) { + commandMgr.doBlockquote(chunk); + } + } + if (/(\n|^)(\t|[ ]{4,}).*\n$/.test(chunk.before)) { + if (commandMgr.doCode) { + commandMgr.doCode(chunk); + } + } + + if (fakeSelection) { + chunk.after = chunk.selection + chunk.after; + chunk.selection = ""; + } +}; + +commandProto.doBlockquote = function (chunk) { + + chunk.selection = chunk.selection.replace(/^(\n*)([^\r]+?)(\n*)$/, + function (totalMatch, newlinesBefore, text, newlinesAfter) { + chunk.before += newlinesBefore; + chunk.after = newlinesAfter + chunk.after; + return text; + }); + + chunk.before = chunk.before.replace(/(>[ \t]*)$/, + function (totalMatch, blankLine) { + chunk.selection = blankLine + chunk.selection; + return ""; + }); + + chunk.selection = chunk.selection.replace(/^(\s|>)+$/, ""); + chunk.selection = chunk.selection || this.getString("quoteexample"); + + // The original code uses a regular expression to find out how much of the + // text *directly before* the selection already was a blockquote: + + /* + if (chunk.before) { + chunk.before = chunk.before.replace(/\n?$/, "\n"); + } + chunk.before = chunk.before.replace(/(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*$)/, + function (totalMatch) { + chunk.startTag = totalMatch; + return ""; + }); + */ + + // This comes down to: + // Go backwards as many lines a possible, such that each line + // a) starts with ">", or + // b) is almost empty, except for whitespace, or + // c) is preceeded by an unbroken chain of non-empty lines + // leading up to a line that starts with ">" and at least one more character + // and in addition + // d) at least one line fulfills a) + // + // Since this is essentially a backwards-moving regex, it's susceptible to + // catstrophic backtracking and can cause the browser to hang; + // see e.g. http://meta.stackoverflow.com/questions/9807. + // + // Hence we replaced this by a simple state machine that just goes through the + // lines and checks for a), b), and c). + + var match = "", + leftOver = "", + line; + if (chunk.before) { + var lines = chunk.before.replace(/\n$/, "").split("\n"); + var inChain = false; + for (var i = 0; i < lines.length; i++) { + var good = false; + line = lines[i]; + inChain = inChain && line.length > 0; // c) any non-empty line continues the chain + if (/^>/.test(line)) { // a) + good = true; + if (!inChain && line.length > 1) // c) any line that starts with ">" and has at least one more character starts the chain + inChain = true; + } else if (/^[ \t]*$/.test(line)) { // b) + good = true; + } else { + good = inChain; // c) the line is not empty and does not start with ">", so it matches if and only if we're in the chain + } + if (good) { + match += line + "\n"; + } else { + leftOver += match + line; + match = "\n"; + } + } + if (!/(^|\n)>/.test(match)) { // d) + leftOver += match; + match = ""; + } + } + + chunk.startTag = match; + chunk.before = leftOver; + + // end of change + + if (chunk.after) { + chunk.after = chunk.after.replace(/^\n?/, "\n"); + } + + chunk.after = chunk.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/, + function (totalMatch) { + chunk.endTag = totalMatch; + return ""; + } + ); + + var replaceBlanksInTags = function (useBracket) { + + var replacement = useBracket ? "> " : ""; + + if (chunk.startTag) { + chunk.startTag = chunk.startTag.replace(/\n((>|\s)*)\n$/, + function (totalMatch, markdown) { + return "\n" + markdown.replace(/^[ ]{0,3}>?[ \t]*$/gm, replacement) + "\n"; + }); + } + if (chunk.endTag) { + chunk.endTag = chunk.endTag.replace(/^\n((>|\s)*)\n/, + function (totalMatch, markdown) { + return "\n" + markdown.replace(/^[ ]{0,3}>?[ \t]*$/gm, replacement) + "\n"; + }); + } + }; + + if (/^(?![ ]{0,3}>)/m.test(chunk.selection)) { + this.wrap(chunk, SETTINGS.lineLength - 2); + chunk.selection = chunk.selection.replace(/^/gm, "> "); + replaceBlanksInTags(true); + chunk.skipLines(); + } else { + chunk.selection = chunk.selection.replace(/^[ ]{0,3}> ?/gm, ""); + this.unwrap(chunk); + replaceBlanksInTags(false); + + if (!/^(\n|^)[ ]{0,3}>/.test(chunk.selection) && chunk.startTag) { + chunk.startTag = chunk.startTag.replace(/\n{0,2}$/, "\n\n"); + } + + if (!/(\n|^)[ ]{0,3}>.*$/.test(chunk.selection) && chunk.endTag) { + chunk.endTag = chunk.endTag.replace(/^\n{0,2}/, "\n\n"); + } + } + + chunk.selection = this.hooks.postBlockquoteCreation(chunk.selection); + + if (!/\n/.test(chunk.selection)) { + chunk.selection = chunk.selection.replace(/^(> *)/, + function (wholeMatch, blanks) { + chunk.startTag += blanks; + return ""; + }); + } +}; + +commandProto.doCode = function (chunk) { + + var hasTextBefore = /\S[ ]*$/.test(chunk.before); + var hasTextAfter = /^[ ]*\S/.test(chunk.after); + + // Use 'four space' markdown if the selection is on its own + // line or is multiline. + if ((!hasTextAfter && !hasTextBefore) || /\n/.test(chunk.selection)) { + if (/[\n]+```\n$/.test(chunk.before) && /^\n```[ ]*\n/.test(chunk.after)) { + chunk.before = chunk.before.replace(/```\n$/, ""); + chunk.after = chunk.after.replace(/^\n```/, ""); + } else { + chunk.before += '```\n'; + chunk.after = '\n```' + chunk.after; + } + if (!chunk.selection) { + chunk.selection = this.getString("codeexample"); + } + } else { + // Use backticks (`) to delimit the code block. + + chunk.trimWhitespace(); + chunk.findTags(/`/, /`/); + + if (!chunk.startTag && !chunk.endTag) { + chunk.startTag = chunk.endTag = "`"; + if (!chunk.selection) { + chunk.selection = this.getString("codeexample"); + } + } else if (chunk.endTag && !chunk.startTag) { + chunk.before += chunk.endTag; + chunk.endTag = ""; + } else { + chunk.startTag = chunk.endTag = ""; + } + } +}; + +commandProto.doList = function (chunk, postProcessing, isNumberedList, isCheckList) { + + // These are identical except at the very beginning and end. + // Should probably use the regex extension function to make this clearer. + var previousItemsRegex = /(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/; + var nextItemsRegex = /^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/; + + // The default bullet is a dash but others are possible. + // This has nothing to do with the particular HTML bullet, + // it's just a markdown bullet. + var bullet = "-"; + + // The number in a numbered list. + var num = 1; + + // Get the item prefix - e.g. " 1. " for a numbered list, " - " for a bulleted list. + var getItemPrefix = function (checkListContent) { + var prefix; + if (isNumberedList) { + prefix = " " + num + ". "; + num++; + } else { + prefix = " " + bullet + " "; + if (isCheckList) { + prefix += '['; + prefix += checkListContent || ' '; + prefix += '] '; + } + } + return prefix; + }; + + // Fixes the prefixes of the other list items. + var getPrefixedItem = function (itemText) { + + // The numbering flag is unset when called by autoindent. + if (isNumberedList === undefined) { + isNumberedList = /^\s*\d/.test(itemText); + } + + // Renumber/bullet the list element. + itemText = itemText.replace(isCheckList + ? /^[ ]{0,3}([*+-]|\d+[.])\s+\[([ xX])\]\s/gm + : /^[ ]{0,3}([*+-]|\d+[.])\s/gm, + function (match, p1, p2) { + return getItemPrefix(p2); + }); + + return itemText; + }; + + chunk.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/, null); + + if (chunk.before && !/\n$/.test(chunk.before) && !/^\n/.test(chunk.startTag)) { + chunk.before += chunk.startTag; + chunk.startTag = ""; + } + + if (chunk.startTag) { + + var hasDigits = /\d+[.]/.test(chunk.startTag); + chunk.startTag = ""; + chunk.selection = chunk.selection.replace(/\n[ ]{4}/g, "\n"); + this.unwrap(chunk); + chunk.skipLines(); + + if (hasDigits) { + // Have to renumber the bullet points if this is a numbered list. + chunk.after = chunk.after.replace(nextItemsRegex, getPrefixedItem); + } + if (isNumberedList == hasDigits) { + return; + } + } + + var nLinesUp = 1; + + chunk.before = chunk.before.replace(previousItemsRegex, + function (itemText) { + if (/^\s*([*+-])/.test(itemText)) { + bullet = re.$1; + } + nLinesUp = /[^\n]\n\n[^\n]/.test(itemText) ? 1 : 0; + return getPrefixedItem(itemText); + }); + + if (!chunk.selection) { + chunk.selection = this.getString("litem"); + } + + var prefix = getItemPrefix(); + + var nLinesDown = 1; + + chunk.after = chunk.after.replace(nextItemsRegex, + function (itemText) { + nLinesDown = /[^\n]\n\n[^\n]/.test(itemText) ? 1 : 0; + return getPrefixedItem(itemText); + }); + + chunk.trimWhitespace(true); + chunk.skipLines(nLinesUp, nLinesDown, true); + chunk.startTag = prefix; + var spaces = prefix.replace(/./g, " "); + this.wrap(chunk, SETTINGS.lineLength - spaces.length); + chunk.selection = chunk.selection.replace(/\n/g, "\n" + spaces); + +}; + +commandProto.doTable = function (chunk) { + // Credit: https://github.com/fcrespo82/atom-markdown-table-formatter + + var keepFirstAndLastPipes = true, + /* + ( # header capture + (?: + (?:[^\n]*?\|[^\n]*) # line w/ at least one pipe + \ * # maybe trailing whitespace + )? # maybe header + (?:\n|^) # newline + ) + ( # format capture + (?: + \|\ *:?-+:?\ * # format starting w/pipe + |\|?(?:\ *:?-+:?\ *\|)+ # or separated by pipe + ) + (?:\ *:?-+:?\ *)? # maybe w/o trailing pipe + \ * # maybe trailing whitespace + \n # newline + ) + ( # body capture + (?: + (?:[^\n]*?\|[^\n]*) # line w/ at least one pipe + \ * # maybe trailing whitespace + (?:\n|$) # newline + )+ # at least one + ) + */ + regex = /((?:(?:[^\n]*?\|[^\n]*) *)?(?:\r?\n|^))((?:\| *:?-+:? *|\|?(?: *:?-+:? *\|)+)(?: *:?-+:? *)? *\r?\n)((?:(?:[^\n]*?\|[^\n]*) *(?:\r?\n|$))+)/; + + + function padding(len, str) { + var result = ''; + str = str || ' '; + len = Math.floor(len); + for (var i = 0; i < len; i++) { + result += str; + } + return result; + } + + function stripTailPipes(str) { + return str.trim().replace(/(^\||\|$)/g, ""); + } + + function splitCells(str) { + return str.split('|'); + } + + function addTailPipes(str) { + if (keepFirstAndLastPipes) { + return "|" + str + "|"; + } else { + return str; + } + } + + function joinCells(arr) { + return arr.join('|'); + } + + function formatTable(text, appendNewline) { + var i, j, len1, ref1, ref2, ref3, k, len2, results, formatline, headerline, just, formatrow, data, line, lines, justify, cell, cells, first, last, ends, columns, content, widths, formatted, front, back; + formatline = text[2].trim(); + headerline = text[1].trim(); + ref1 = headerline.length === 0 ? [0, text[3]] : [1, text[1] + text[3]], formatrow = ref1[0], data = ref1[1]; + lines = data.trim().split('\n'); + justify = []; + ref2 = splitCells(stripTailPipes(formatline)); + for (j = 0, len1 = ref2.length; j < len1; j++) { + cell = ref2[j]; + ref3 = cell.trim(), first = ref3[0], last = ref3[ref3.length - 1]; + switch ((ends = (first ? first : ':') + (last ? last : ''))) { + case '::': + case '-:': + case ':-': + justify.push(ends); + break; + default: + justify.push('--'); + } + } + columns = justify.length; + content = []; + for (j = 0, len1 = lines.length; j < len1; j++) { + line = lines[j]; + cells = splitCells(stripTailPipes(line)); + cells[columns - 1] = joinCells(cells.slice(columns - 1)); + results = []; + for (k = 0, len2 = cells.length; k < len2; k++) { + cell = cells[k]; + results.push(padding(' ') + ((ref2 = cell ? typeof cell.trim === "function" ? cell.trim() : void 0 : void 0) ? ref2 : '') + padding(' ')); + } + content.push(results); + } + widths = []; + for (i = j = 0, ref2 = columns - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) { + results = []; + for (k = 0, len1 = content.length; k < len1; k++) { + cells = content[k]; + results.push(cells[i].length); + } + widths.push(Math.max.apply(Math, [2].concat(results))); + } + just = function (string, col) { + var back, front, length; + length = widths[col] - string.length; + switch (justify[col]) { + case '::': + front = padding[0], back = padding[1]; + return padding(length / 2) + string + padding((length + 1) / 2); + case '-:': + return padding(length) + string; + default: + return string + padding(length); + } + }; + formatted = []; + for (j = 0, len1 = content.length; j < len1; j++) { + cells = content[j]; + results = []; + for (i = k = 0, ref2 = columns - 1; 0 <= ref2 ? k <= ref2 : k >= ref2; i = 0 <= ref2 ? ++k : --k) { + results.push(just(cells[i], i)); + } + formatted.push(addTailPipes(joinCells(results))); + } + formatline = addTailPipes(joinCells((function () { + var j, ref2, ref3, results; + results = []; + for (i = j = 0, ref2 = columns - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) { + ref3 = justify[i], front = ref3[0], back = ref3[1]; + results.push(front + padding(widths[i] - 2, '-') + back); + } + return results; + })())); + formatted.splice(formatrow, 0, formatline); + var result = (headerline.length === 0 && text[1] !== '' ? '\n' : '') + formatted.join('\n'); + if (appendNewline !== false) { + result += '\n' + } + return result; + } + + if (chunk.before.slice(-1) !== '\n') { + chunk.before += '\n'; + } + var match = chunk.selection.match(regex); + if (match) { + chunk.selection = formatTable(match, chunk.selection.slice(-1) === '\n'); + } else { + var table = chunk.selection + '|\n-|-\n|'; + match = table.match(regex); + if (!match || match[0].slice(0, table.length) !== table) { + return; + } + table = formatTable(match); + var selectionOffset = keepFirstAndLastPipes ? 1 : 0; + var pipePos = table.indexOf('|', selectionOffset); + chunk.before += table.slice(0, selectionOffset); + chunk.selection = table.slice(selectionOffset, pipePos); + chunk.after = table.slice(pipePos) + chunk.after; + } +}; + +commandProto.doHeading = function (chunk) { + + // Remove leading/trailing whitespace and reduce internal spaces to single spaces. + chunk.selection = chunk.selection.replace(/\s+/g, " "); + chunk.selection = chunk.selection.replace(/(^\s+|\s+$)/g, ""); + + // If we clicked the button with no selected text, we just + // make a level 2 hash header around some default text. + if (!chunk.selection) { + chunk.startTag = "## "; + chunk.selection = this.getString("headingexample"); + return; + } + + var headerLevel = 0; // The existing header level of the selected text. + + // Remove any existing hash heading markdown and save the header level. + chunk.findTags(/#+[ ]*/, /[ ]*#+/); + if (/#+/.test(chunk.startTag)) { + headerLevel = re.lastMatch.length; + } + chunk.startTag = chunk.endTag = ""; + + // Try to get the current header level by looking for - and = in the line + // below the selection. + chunk.findTags(null, /\s?(-+|=+)/); + if (/=+/.test(chunk.endTag)) { + headerLevel = 1; + } + if (/-+/.test(chunk.endTag)) { + headerLevel = 2; + } + + // Skip to the next line so we can create the header markdown. + chunk.startTag = chunk.endTag = ""; + chunk.skipLines(1, 1); + + // We make a level 2 header if there is no current header. + // If there is a header level, we substract one from the header level. + // If it's already a level 1 header, it's removed. + var headerLevelToCreate = headerLevel === 0 ? 2 : headerLevel - 1; + + if (headerLevelToCreate > 0) { + + chunk.startTag = ''; + while (headerLevelToCreate--) { + chunk.startTag += '#'; + } + chunk.startTag += ' '; + } +}; + +commandProto.doHorizontalRule = function (chunk) { + chunk.startTag = "----------\n"; + chunk.selection = ""; + chunk.skipLines(2, 1, true); +}; + +export default function (options) { + return new Pagedown(options); +}; diff --git a/src/services/animationSvc.js b/src/services/animationSvc.js new file mode 100644 index 0000000..49ae61b --- /dev/null +++ b/src/services/animationSvc.js @@ -0,0 +1,237 @@ +import bezierEasing from 'bezier-easing'; + +const easings = { + materialIn: bezierEasing(0.75, 0, 0.8, 0.25), + materialOut: bezierEasing(0.25, 0.8, 0.25, 1), + inOut: bezierEasing(0.25, 0.1, 0.67, 1), +}; + +const vendors = ['moz', 'webkit']; +for (let x = 0; x < vendors.length && !window.requestAnimationFrame; x += 1) { + window.requestAnimationFrame = window[`${vendors[x]}RequestAnimationFrame`]; + window.cancelAnimationFrame = window[`${vendors[x]}CancelAnimationFrame`] || + window[`${vendors[x]}CancelRequestAnimationFrame`]; +} + +const transformStyles = [ + 'WebkitTransform', + 'MozTransform', + 'msTransform', + 'OTransform', + 'transform', +]; + +const transitionEndEvents = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + msTransition: 'MSTransitionEnd', + OTransition: 'oTransitionEnd', + transition: 'transitionend', +}; + +function getStyle(styles) { + const elt = document.createElement('div'); + return styles.reduce((result, style) => { + if (elt.style[style] === undefined) { + return undefined; + } + return style; + }, undefined); +} + +const transformStyle = getStyle(transformStyles); +const transitionStyle = getStyle(Object.keys(transitionEndEvents)); +const transitionEndEvent = transitionEndEvents[transitionStyle]; + +function identity(x) { + return x; +} + +function ElementAttribute(name) { + this.name = name; + this.setStart = (animation) => { + const value = animation.elt[name]; + animation.$start[name] = value; + return value !== undefined && animation.$end[name] !== undefined; + }; + this.applyCurrent = (animation) => { + animation.elt[name] = animation.$current[name]; + }; +} + +function StyleAttribute(name, unit, defaultValue, wrap = identity) { + this.name = name; + this.setStart = (animation) => { + let value = parseFloat(animation.elt.style[name]); + if (Number.isNaN(value)) { + value = animation.$current[name] || defaultValue; + } + animation.$start[name] = value; + return animation.$end[name] !== undefined; + }; + this.applyCurrent = (animation) => { + animation.elt.style[name] = wrap(animation.$current[name]) + unit; + }; +} + +function TransformAttribute(name, unit, defaultValue, wrap = identity) { + this.name = name; + this.setStart = (animation) => { + let value = animation.$current[name]; + if (value === undefined) { + value = defaultValue; + } + animation.$start[name] = value; + if (animation.$end[name] === undefined) { + animation.$end[name] = value; + } + return value !== undefined; + }; + this.applyCurrent = (animation) => { + const value = animation.$current[name]; + return value !== defaultValue && `${name}(${wrap(value)}${unit})`; + }; +} + +const attributes = [ + new ElementAttribute('scrollTop'), + new ElementAttribute('scrollLeft'), + new StyleAttribute('opacity', '', 1), + new StyleAttribute('zIndex', '', 0), + new TransformAttribute('translateX', 'px', 0, Math.round), + new TransformAttribute('translateY', 'px', 0, Math.round), + new TransformAttribute('scale', '', 1), + new TransformAttribute('rotate', 'deg', 0), +].concat([ + 'width', + 'height', + 'top', + 'right', + 'bottom', + 'left', +].map(name => new StyleAttribute(name, 'px', 0, Math.round))); + +class Animation { + constructor(elt) { + this.elt = elt; + this.$current = {}; + this.$pending = {}; + } + + start(param1, param2, param3) { + let endCb = param1; + let stepCb = param2; + let useTransition = false; + if (typeof param1 === 'boolean') { + useTransition = param1; + endCb = param2; + stepCb = param3; + } + + this.stop(); + this.$start = {}; + this.$end = this.$pending; + this.$pending = {}; + this.$attributes = attributes.filter(attribute => attribute.setStart(this)); + this.$end.duration = this.$end.duration || 0; + this.$end.delay = this.$end.delay || 0; + this.$end.easing = easings[this.$end.easing] || easings.materialOut; + this.$end.endCb = typeof endCb === 'function' && endCb; + this.$end.stepCb = typeof stepCb === 'function' && stepCb; + this.$startTime = Date.now() + this.$end.delay; + if (!this.$end.duration) { + this.loop(false); + } else if (useTransition) { + this.loop(true); + } else { + this.$requestId = window.requestAnimationFrame(() => this.loop(false)); + } + return this.elt; + } + + stop() { + window.cancelAnimationFrame(this.$requestId); + } + + loop(useTransition) { + const onTransitionEnd = (evt) => { + if (evt.target === this.elt) { + this.elt.removeEventListener(transitionEndEvent, onTransitionEnd); + const { endCb } = this.$end; + this.$end.endCb = undefined; + if (endCb) { + endCb(); + } + } + }; + + let progress = (Date.now() - this.$startTime) / this.$end.duration; + let transition = ''; + if (useTransition) { + progress = 1; + const transitions = [ + 'all', + `${this.$end.duration}ms`, + this.$end.easing.toCSS(), + ]; + if (this.$end.delay) { + transitions.push(`${this.$end.duration}ms`); + } + transition = transitions.join(' '); + if (this.$end.endCb) { + this.elt.addEventListener(transitionEndEvent, onTransitionEnd); + } + } else if (progress < 1) { + this.$requestId = window.requestAnimationFrame(() => this.loop(false)); + if (progress < 0) { + return; + } + } else if (this.$end.endCb) { + this.$requestId = window.requestAnimationFrame(this.$end.endCb); + } + + const coeff = this.$end.easing.get(progress); + const transforms = this.$attributes.reduce((result, attribute) => { + if (progress < 1) { + const diff = this.$end[attribute.name] - this.$start[attribute.name]; + this.$current[attribute.name] = this.$start[attribute.name] + (diff * coeff); + } else { + this.$current[attribute.name] = this.$end[attribute.name]; + } + const transform = attribute.applyCurrent(this); + if (transform) { + result.push(transform); + } + return result; + }, []); + + if (transforms.length) { + transforms.push('translateZ(0)'); // activate GPU + } + const transform = transforms.join(' '); + this.elt.style[transformStyle] = transform; + this.elt.style[transitionStyle] = transition; + if (this.$end.stepCb) { + this.$end.stepCb(); + } + } +} + +attributes.map(attribute => attribute.name).concat('duration', 'easing', 'delay') + .forEach((name) => { + Animation.prototype[name] = function setter(val) { + this.$pending[name] = val; + return this; + }; + }); + +function animate(elt) { + if (!elt.$animation) { + elt.$animation = new Animation(elt); + } + return elt.$animation; +} + +export default { + animate, +}; diff --git a/src/services/backupSvc.js b/src/services/backupSvc.js new file mode 100644 index 0000000..3d9070f --- /dev/null +++ b/src/services/backupSvc.js @@ -0,0 +1,74 @@ +import workspaceSvc from './workspaceSvc'; +import utils from './utils'; + +export default { + async importBackup(jsonValue) { + const fileNameMap = {}; + const folderNameMap = {}; + const parentIdMap = {}; + const textMap = {}; + const propertiesMap = {}; + const discussionsMap = {}; + const commentsMap = {}; + const folderIdMap = { + trash: 'trash', + }; + + // Parse JSON value + const parsedValue = JSON.parse(jsonValue); + Object.entries(parsedValue).forEach(([id, value]) => { + if (value) { + const v4Match = id.match(/^file\.([^.]+)\.([^.]+)$/); + if (v4Match) { + // StackEdit v4 format + const [, v4Id, type] = v4Match; + if (type === 'title') { + fileNameMap[v4Id] = value; + } else if (type === 'content') { + textMap[v4Id] = value; + } + } else if (value.type === 'folder') { + // StackEdit v5 folder + folderIdMap[id] = utils.uid(); + folderNameMap[id] = value.name; + parentIdMap[id] = `${value.parentId || ''}`; + } else if (value.type === 'file') { + // StackEdit v5 file + fileNameMap[id] = value.name; + parentIdMap[id] = `${value.parentId || ''}`; + } else if (value.type === 'content') { + // StackEdit v5 content + const [fileId] = id.split('/'); + if (fileId) { + textMap[fileId] = value.text; + propertiesMap[fileId] = value.properties; + discussionsMap[fileId] = value.discussions; + commentsMap[fileId] = value.comments; + } + } + } + }); + + await utils.awaitSequence( + Object.keys(folderNameMap), + async externalId => workspaceSvc.setOrPatchItem({ + id: folderIdMap[externalId], + type: 'folder', + name: folderNameMap[externalId], + parentId: folderIdMap[parentIdMap[externalId]], + }), + ); + + await utils.awaitSequence( + Object.keys(fileNameMap), + async externalId => workspaceSvc.createFile({ + name: fileNameMap[externalId], + parentId: folderIdMap[parentIdMap[externalId]], + text: textMap[externalId], + properties: propertiesMap[externalId], + discussions: discussionsMap[externalId], + comments: commentsMap[externalId], + }, true), + ); + }, +}; diff --git a/src/services/badgeSvc.js b/src/services/badgeSvc.js new file mode 100644 index 0000000..964aea8 --- /dev/null +++ b/src/services/badgeSvc.js @@ -0,0 +1,37 @@ +import store from '../store'; + +let lastEarnedFeatureIds = null; +let debounceTimeoutId; + +const showInfo = () => { + const earnedBadges = store.getters['data/allBadges'] + .filter(badge => badge.isEarned && !lastEarnedFeatureIds.has(badge.featureId)); + if (earnedBadges.length) { + store.dispatch('notification/badge', earnedBadges.length > 1 + ? `您已获得 ${earnedBadges.length} 个徽章: ${earnedBadges.map(badge => `"${badge.name}"`).join(', ')}.` + : `您已获得 1 个徽章: "${earnedBadges[0].name}".`); + } + lastEarnedFeatureIds = null; +}; + +export default { + addBadge(featureId) { + if (!store.getters['data/badgeCreations'][featureId]) { + if (!lastEarnedFeatureIds) { + const earnedFeatureIds = store.getters['data/allBadges'] + .filter(badge => badge.isEarned) + .map(badge => badge.featureId); + lastEarnedFeatureIds = new Set(earnedFeatureIds); + } + + store.dispatch('data/patchBadgeCreations', { + [featureId]: { + created: Date.now(), + }, + }); + + clearTimeout(debounceTimeoutId); + debounceTimeoutId = setTimeout(() => showInfo(), 5000); + } + }, +}; diff --git a/src/services/chatGptSvc.js b/src/services/chatGptSvc.js new file mode 100644 index 0000000..0bd8c3b --- /dev/null +++ b/src/services/chatGptSvc.js @@ -0,0 +1,42 @@ +import store from '../store'; + +export default { + chat({ content }, callback) { + const xhr = new XMLHttpRequest(); + const url = 'https://api.openai-proxy.com/v1/chat/completions'; + xhr.open('POST', url); + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.setRequestHeader('Authorization', `Bearer ${window.my_api_key}`); + xhr.send(JSON.stringify({ + model: 'gpt-3.5-turbo', + max_tokens: 3000, + top_p: 0, + temperature: 0.9, + frequency_penalty: 0, + presence_penalty: 0, + messages: [{ role: 'user', content }], + stream: true, + })); + let lastRespLen = 0; + xhr.onprogress = () => { + const responseText = xhr.response.substr(lastRespLen); + lastRespLen = xhr.response.length; + responseText.split('\n\n') + .filter(l => l.length > 0) + .forEach((text) => { + const item = text.substr(6); + if (item === '[DONE]') { + callback({ done: true }); + } else { + const data = JSON.parse(item); + callback({ content: data.choices[0].delta.content }); + } + }); + }; + xhr.onerror = () => { + store.dispatch('notification/error', 'ChatGPT接口请求异常!'); + callback({ error: 'ChatGPT接口请求异常!' }); + }; + return xhr; + }, +}; diff --git a/src/services/diffUtils.js b/src/services/diffUtils.js new file mode 100644 index 0000000..2bc1b19 --- /dev/null +++ b/src/services/diffUtils.js @@ -0,0 +1,201 @@ +import DiffMatchPatch from 'diff-match-patch'; +import utils from './utils'; + +const diffMatchPatch = new DiffMatchPatch(); +diffMatchPatch.Match_Distance = 10000; + +function makePatchableText(content, markerKeys, markerIdxMap) { + if (!content || !content.discussions) { + return null; + } + const markers = []; + // Sort keys to have predictable marker positions in case of same offset + const discussionKeys = Object.keys(content.discussions).sort(); + discussionKeys.forEach((discussionId) => { + const discussion = content.discussions[discussionId]; + + function addMarker(offsetName) { + const markerKey = discussionId + offsetName; + if (discussion[offsetName] !== undefined) { + let idx = markerIdxMap[markerKey]; + if (idx === undefined) { + idx = markerKeys.length; + markerIdxMap[markerKey] = idx; + markerKeys.push({ + id: discussionId, + offsetName, + }); + } + markers.push({ + idx, + offset: discussion[offsetName], + }); + } + } + + addMarker('start'); + addMarker('end'); + }); + + let lastOffset = 0; + let result = ''; + markers + .sort((marker1, marker2) => marker1.offset - marker2.offset) + .forEach((marker) => { + result += + content.text.slice(lastOffset, marker.offset) + + String.fromCharCode(0xe000 + marker.idx); // Use a character from the private use area + lastOffset = marker.offset; + }); + return result + content.text.slice(lastOffset); +} + +function stripDiscussionOffsets(objectMap) { + if (objectMap == null) { + return objectMap; + } + const result = {}; + Object.keys(objectMap).forEach((id) => { + result[id] = { + text: objectMap[id].text, + }; + }); + return result; +} + +function restoreDiscussionOffsets(content, markerKeys) { + if (markerKeys.length) { + // Go through markers + let count = 0; + content.text = content.text.replace( + new RegExp(`[\ue000-${String.fromCharCode((0xe000 + markerKeys.length) - 1)}]`, 'g'), + (match, offset) => { + const idx = match.charCodeAt(0) - 0xe000; + const markerKey = markerKeys[idx]; + const discussion = content.discussions[markerKey.id]; + if (discussion) { + discussion[markerKey.offsetName] = offset - count; + } + count += 1; + return ''; + }, + ); + // Sanitize offsets + Object.keys(content.discussions).forEach((discussionId) => { + const discussion = content.discussions[discussionId]; + if (discussion.start === undefined) { + discussion.start = discussion.end || 0; + } + if (discussion.end === undefined || discussion.end < discussion.start) { + discussion.end = discussion.start; + } + }); + } +} + +function mergeText(serverText, clientText, lastMergedText) { + const serverClientDiffs = diffMatchPatch.diff_main(serverText, clientText); + diffMatchPatch.diff_cleanupSemantic(serverClientDiffs); + // Fusion text is a mix of both server and client contents + const fusionText = serverClientDiffs.map(diff => diff[1]).join(''); + if (!lastMergedText) { + return fusionText; + } + // Let's try to find out what text has to be removed from fusion + const intersectionText = serverClientDiffs + // Keep only equalities + .filter(diff => diff[0] === DiffMatchPatch.DIFF_EQUAL) + .map(diff => diff[1]).join(''); + const lastMergedTextDiffs = diffMatchPatch.diff_main(lastMergedText, intersectionText) + // Keep only equalities and deletions + .filter(diff => diff[0] !== DiffMatchPatch.DIFF_INSERT); + diffMatchPatch.diff_cleanupSemantic(lastMergedTextDiffs); + // Make a patch with deletions only + const patches = diffMatchPatch.patch_make(lastMergedText, lastMergedTextDiffs); + // Apply patch to fusion text + return diffMatchPatch.patch_apply(patches, fusionText)[0]; +} + +function mergeValues(serverValue, clientValue, lastMergedValue) { + if (!lastMergedValue) { + return serverValue || clientValue; // Take the server value in priority + } + const newSerializedValue = utils.serializeObject(clientValue); + const serverSerializedValue = utils.serializeObject(serverValue); + if (newSerializedValue === serverSerializedValue) { + return serverValue; // no conflict + } + const oldSerializedValue = utils.serializeObject(lastMergedValue); + if (oldSerializedValue !== newSerializedValue && !serverValue) { + return clientValue; // Removed on server but changed on client + } + if (oldSerializedValue !== serverSerializedValue && !clientValue) { + return serverValue; // Removed on client but changed on server + } + if (oldSerializedValue !== newSerializedValue && oldSerializedValue === serverSerializedValue) { + return clientValue; // Take the client value + } + return serverValue; // Take the server value +} + +function mergeObjects(serverObject, clientObject, lastMergedObject = {}) { + const mergedObject = {}; + Object.keys({ + ...clientObject, + ...serverObject, + }).forEach((key) => { + const mergedValue = mergeValues(serverObject[key], clientObject[key], lastMergedObject[key]); + if (mergedValue != null) { + mergedObject[key] = mergedValue; + } + }); + return utils.deepCopy(mergedObject); +} + +function mergeContent(serverContent, clientContent, lastMergedContent = {}) { + const markerKeys = []; + const markerIdxMap = Object.create(null); + const lastMergedText = makePatchableText(lastMergedContent, markerKeys, markerIdxMap); + const serverText = makePatchableText(serverContent, markerKeys, markerIdxMap); + const clientText = makePatchableText(clientContent, markerKeys, markerIdxMap); + const isServerTextChanges = lastMergedText !== serverText; + const isClientTextChanges = lastMergedText !== clientText; + const isTextSynchronized = serverText === clientText; + let text = clientText; + if (!isTextSynchronized && isServerTextChanges) { + text = serverText; + if (isClientTextChanges) { + text = mergeText(serverText, clientText, lastMergedText); + } + } + + const result = { + text, + properties: mergeValues( + serverContent.properties, + clientContent.properties, + lastMergedContent.properties, + ), + discussions: mergeObjects( + stripDiscussionOffsets(serverContent.discussions), + stripDiscussionOffsets(clientContent.discussions), + stripDiscussionOffsets(lastMergedContent.discussions), + ), + comments: mergeObjects( + serverContent.comments, + clientContent.comments, + lastMergedContent.comments, + ), + // 服务端和本地都变更了 + mergeFlag: isServerTextChanges && isClientTextChanges, + }; + restoreDiscussionOffsets(result, markerKeys); + return result; +} + +export default { + makePatchableText, + restoreDiscussionOffsets, + mergeObjects, + mergeContent, +}; diff --git a/src/services/editor/cledit/cleditCore.js b/src/services/editor/cledit/cleditCore.js new file mode 100644 index 0000000..79ca06a --- /dev/null +++ b/src/services/editor/cledit/cleditCore.js @@ -0,0 +1,445 @@ +import DiffMatchPatch from 'diff-match-patch'; +import TurndownService from 'turndown/lib/turndown.browser.umd'; +import htmlSanitizer from '../../../libs/htmlSanitizer'; +import store from '../../../store'; + +function cledit(contentElt, scrollEltOpt, isMarkdown = false) { + const scrollElt = scrollEltOpt || contentElt; + const editor = { + $contentElt: contentElt, + $scrollElt: scrollElt, + $keystrokes: [], + $markers: {}, + }; + cledit.Utils.createEventHooks(editor); + const { debounce } = cledit.Utils; + + contentElt.setAttribute('tabindex', '0'); // To have focus even when disabled + editor.toggleEditable = (isEditable) => { + contentElt.contentEditable = isEditable == null ? !contentElt.contentEditable : isEditable; + }; + editor.toggleEditable(true); + + function getTextContent() { + // Markdown-it sanitization (Mac/DOS to Unix) + let textContent = contentElt.textContent.replace(/\r[\n\u0085]?|[\u2424\u2028\u0085]/g, '\n'); + if (textContent.slice(-1) !== '\n') { + textContent += '\n'; + } + return textContent; + } + + let lastTextContent = getTextContent(); + const highlighter = new cledit.Highlighter(editor); + + /* eslint-disable new-cap */ + const diffMatchPatch = new DiffMatchPatch(); + /* eslint-enable new-cap */ + const selectionMgr = new cledit.SelectionMgr(editor); + + function adjustCursorPosition(force) { + selectionMgr.saveSelectionState(true, true, force); + } + + function replaceContent(selectionStart, selectionEnd, replacement) { + const min = Math.min(selectionStart, selectionEnd); + const max = Math.max(selectionStart, selectionEnd); + const range = selectionMgr.createRange(min, max); + const rangeText = `${range}`; + // Range can contain a br element, which is not taken into account in rangeText + if (rangeText.length === max - min && rangeText === replacement) { + return null; + } + range.deleteContents(); + range.insertNode(document.createTextNode(replacement)); + return range; + } + + let ignoreUndo = false; + let noContentFix = false; + + function setContent(value, noUndo, maxStartOffsetOpt) { + const textContent = getTextContent(); + const maxStartOffset = maxStartOffsetOpt != null && maxStartOffsetOpt < textContent.length + ? maxStartOffsetOpt + : textContent.length - 1; + const startOffset = Math.min( + diffMatchPatch.diff_commonPrefix(textContent, value), + maxStartOffset, + ); + const endOffset = Math.min( + diffMatchPatch.diff_commonSuffix(textContent, value), + textContent.length - startOffset, + value.length - startOffset, + ); + const replacement = value.substring(startOffset, value.length - endOffset); + const range = replaceContent(startOffset, textContent.length - endOffset, replacement); + if (range) { + ignoreUndo = noUndo; + noContentFix = true; + } + return { + start: startOffset, + end: value.length - endOffset, + range, + }; + } + + const undoMgr = new cledit.UndoMgr(editor); + + function replace(selectionStart, selectionEnd, replacement) { + undoMgr.setDefaultMode('single'); + replaceContent(selectionStart, selectionEnd, replacement); + const startOffset = Math.min(selectionStart, selectionEnd); + const endOffset = startOffset + replacement.length; + selectionMgr.setSelectionStartEnd(endOffset, endOffset); + selectionMgr.updateCursorCoordinates(true); + } + + function replaceAll(search, replacement, startOffset = 0) { + undoMgr.setDefaultMode('single'); + const text = getTextContent(); + const subtext = getTextContent().slice(startOffset); + const value = subtext.replace(search, replacement); + if (value !== subtext) { + const offset = editor.setContent(text.slice(0, startOffset) + value); + selectionMgr.setSelectionStartEnd(offset.end, offset.end); + selectionMgr.updateCursorCoordinates(true); + } + } + + function focus() { + selectionMgr.restoreSelection(); + contentElt.focus(); + } + + function addMarker(marker) { + editor.$markers[marker.id] = marker; + } + + function removeMarker(marker) { + delete editor.$markers[marker.id]; + } + + const triggerSpellCheck = debounce(() => { + // Hack for Chrome to trigger the spell checker + const selection = window.getSelection(); + if (selectionMgr.hasFocus() + && !highlighter.isComposing + && selectionMgr.selectionStart === selectionMgr.selectionEnd + && selection.modify + ) { + if (selectionMgr.selectionStart) { + selection.modify('move', 'backward', 'character'); + selection.modify('move', 'forward', 'character'); + } else { + selection.modify('move', 'forward', 'character'); + selection.modify('move', 'backward', 'character'); + } + } + }, 10); + + let watcher; + let skipSaveSelection; + function checkContentChange(mutations) { + watcher.noWatch(() => { + const removedSections = []; + const modifiedSections = []; + + function markModifiedSection(node) { + let currentNode = node; + while (currentNode && currentNode !== contentElt) { + if (currentNode.section) { + const array = currentNode.parentNode ? modifiedSections : removedSections; + if (array.indexOf(currentNode.section) === -1) { + array.push(currentNode.section); + } + return; + } + currentNode = currentNode.parentNode; + } + } + + mutations.cl_each((mutation) => { + markModifiedSection(mutation.target); + mutation.addedNodes.cl_each(markModifiedSection); + mutation.removedNodes.cl_each(markModifiedSection); + }); + highlighter.fixContent(modifiedSections, removedSections, noContentFix); + noContentFix = false; + }); + + if (!skipSaveSelection) { + selectionMgr.saveSelectionState(); + } + skipSaveSelection = false; + + const newTextContent = getTextContent(); + const diffs = diffMatchPatch.diff_main(lastTextContent, newTextContent); + editor.$markers.cl_each((marker) => { + marker.adjustOffset(diffs); + }); + + const sectionList = highlighter.parseSections(newTextContent); + editor.$trigger('contentChanged', newTextContent, diffs, sectionList); + if (!ignoreUndo) { + undoMgr.addDiffs(lastTextContent, newTextContent, diffs); + undoMgr.setDefaultMode('typing'); + undoMgr.saveState(); + } + ignoreUndo = false; + lastTextContent = newTextContent; + triggerSpellCheck(); + } + + // Detect editor changes + watcher = new cledit.Watcher(editor, checkContentChange); + watcher.startWatching(); + + function setSelection(start, end) { + selectionMgr.setSelectionStartEnd(start, end == null ? start : end); + selectionMgr.updateCursorCoordinates(); + } + + function keydownHandler(handler) { + return (evt) => { + if ( + evt.which !== 17 && // Ctrl + evt.which !== 91 && // Cmd + evt.which !== 18 && // Alt + evt.which !== 16 // Shift + ) { + handler(evt); + } + }; + } + + let windowKeydownListener; + let windowMouseListener; + let windowResizeListener; + function tryDestroy() { + if (document.contains(contentElt)) { + return false; + } + watcher.stopWatching(); + window.removeEventListener('keydown', windowKeydownListener); + window.removeEventListener('mousedown', windowMouseListener); + window.removeEventListener('mouseup', windowMouseListener); + window.removeEventListener('resize', windowResizeListener); + editor.$trigger('destroy'); + return true; + } + + // In case of Ctrl/Cmd+A outside the editor element + windowKeydownListener = (evt) => { + if (!tryDestroy()) { + keydownHandler(() => { + adjustCursorPosition(); + })(evt); + } + }; + window.addEventListener('keydown', windowKeydownListener); + + // Mouseup can happen outside the editor element + windowMouseListener = () => { + if (!tryDestroy()) { + selectionMgr.saveSelectionState(true, false); + } + }; + window.addEventListener('mousedown', windowMouseListener); + window.addEventListener('mouseup', windowMouseListener); + + // Resize provokes cursor coordinate changes + windowResizeListener = () => { + if (!tryDestroy()) { + selectionMgr.updateCursorCoordinates(); + } + }; + window.addEventListener('resize', windowResizeListener); + + // Provokes selection changes and does not fire mouseup event on Chrome/OSX + contentElt.addEventListener( + 'contextmenu', + selectionMgr.saveSelectionState.cl_bind(selectionMgr, true, false), + ); + + contentElt.addEventListener('keydown', keydownHandler((evt) => { + selectionMgr.saveSelectionState(); + + // Perform keystroke + let contentChanging = false; + const textContent = getTextContent(); + let min = Math.min(selectionMgr.selectionStart, selectionMgr.selectionEnd); + let max = Math.max(selectionMgr.selectionStart, selectionMgr.selectionEnd); + const state = { + before: textContent.slice(0, min), + after: textContent.slice(max), + selection: textContent.slice(min, max), + isBackwardSelection: selectionMgr.selectionStart > selectionMgr.selectionEnd, + }; + editor.$keystrokes.cl_some((keystroke) => { + if (!keystroke.handler(evt, state, editor)) { + return false; + } + const newContent = state.before + state.selection + state.after; + if (newContent !== getTextContent()) { + editor.setContent(newContent, false, min); + contentChanging = true; + skipSaveSelection = true; + highlighter.cancelComposition = true; + } + min = state.before.length; + max = min + state.selection.length; + selectionMgr.setSelectionStartEnd( + state.isBackwardSelection ? max : min, + state.isBackwardSelection ? min : max, + !contentChanging, // Expect a restore selection on mutation event + ); + return true; + }); + + if (!contentChanging) { + // Optimization to avoid saving selection + adjustCursorPosition(); + } + })); + + contentElt.addEventListener('compositionstart', () => { + highlighter.isComposing += 1; + }); + + contentElt.addEventListener('compositionend', () => { + setTimeout(() => { + if (highlighter.isComposing) { + highlighter.isComposing -= 1; + if (!highlighter.isComposing) { + checkContentChange([]); + } + } + }, 1); + }); + + let turndownService; + if (isMarkdown) { + contentElt.addEventListener('copy', (evt) => { + if (evt.clipboardData) { + evt.clipboardData.setData('text/plain', selectionMgr.getSelectedText()); + evt.preventDefault(); + } + }); + + contentElt.addEventListener('cut', (evt) => { + if (evt.clipboardData) { + evt.clipboardData.setData('text/plain', selectionMgr.getSelectedText()); + evt.preventDefault(); + replace(selectionMgr.selectionStart, selectionMgr.selectionEnd, ''); + } else { + undoMgr.setCurrentMode('single'); + } + adjustCursorPosition(); + }); + + turndownService = new TurndownService(store.getters['data/computedSettings'].turndown); + turndownService.escape = str => str; // Disable escaping + } + + contentElt.addEventListener('paste', (evt) => { + undoMgr.setCurrentMode('single'); + evt.preventDefault(); + let data; + let { clipboardData } = evt; + if (clipboardData) { + data = clipboardData.getData('text/plain'); + if (turndownService) { + try { + const html = clipboardData.getData('text/html'); + if (html) { + const sanitizedHtml = htmlSanitizer.sanitizeHtml(html) + .replace(/ /g, ' '); // Replace non-breaking spaces with classic spaces + if (sanitizedHtml) { + data = turndownService.turndown(sanitizedHtml); + } + } + } catch (e) { + // Ignore + } + } + } else { + ({ clipboardData } = window.clipboardData); + data = clipboardData && clipboardData.getData('Text'); + } + if (!data) { + return; + } + replace(selectionMgr.selectionStart, selectionMgr.selectionEnd, data); + adjustCursorPosition(); + }); + + contentElt.addEventListener('focus', () => { + editor.$trigger('focus'); + }); + + contentElt.addEventListener('blur', () => { + editor.$trigger('blur'); + }); + + function addKeystroke(keystroke) { + const keystrokes = Array.isArray(keystroke) ? keystroke : [keystroke]; + editor.$keystrokes = editor.$keystrokes + .concat(keystrokes) + .sort((keystroke1, keystroke2) => keystroke1.priority - keystroke2.priority); + } + addKeystroke(cledit.defaultKeystrokes); + + editor.selectionMgr = selectionMgr; + editor.undoMgr = undoMgr; + editor.highlighter = highlighter; + editor.watcher = watcher; + editor.adjustCursorPosition = adjustCursorPosition; + editor.setContent = setContent; + editor.replace = replace; + editor.replaceAll = replaceAll; + editor.getContent = getTextContent; + editor.focus = focus; + editor.setSelection = setSelection; + editor.addKeystroke = addKeystroke; + editor.addMarker = addMarker; + editor.removeMarker = removeMarker; + + editor.init = (opts = {}) => { + const options = ({ + getCursorFocusRatio() { + return 0.1; + }, + sectionHighlighter(section) { + return section.text.replace(/&/g, '&').replace(/ document.head.contains(styleElt))) { + createStyleSheet(document); + } + + const contentElt = editor.$contentElt; + this.isComposing = 0; + + let sectionList = []; + let insertBeforeSection; + const useBr = cledit.Utils.isWebkit; + const trailingNodeTag = 'div'; + const hiddenLfInnerHtml = '
        '; + + const lfHtml = `${useBr ? hiddenLfInnerHtml : '\n'}`; + + this.fixContent = (modifiedSections, removedSections, noContentFix) => { + modifiedSections.cl_each((section) => { + section.forceHighlighting = true; + if (!noContentFix) { + if (useBr) { + section.elt.getElementsByClassName('hd-lf') + .cl_each(lfElt => lfElt.parentNode.removeChild(lfElt)); + section.elt.getElementsByTagName('br') + .cl_each(brElt => brElt.parentNode.replaceChild(document.createTextNode('\n'), brElt)); + } + if (section.elt.textContent.slice(-1) !== '\n') { + section.elt.appendChild(document.createTextNode('\n')); + } + } + }); + }; + + this.addTrailingNode = () => { + this.trailingNode = document.createElement(trailingNodeTag); + contentElt.appendChild(this.trailingNode); + }; + + class Section { + constructor(text) { + this.text = text.text === undefined ? text : text.text; + this.data = text.data; + } + setElement(elt) { + this.elt = elt; + elt.section = this; + } + } + + this.parseSections = (content, isInit) => { + if (this.isComposing && !this.cancelComposition) { + return sectionList; + } + + this.cancelComposition = false; + const newSectionList = (editor.options.sectionParser + ? editor.options.sectionParser(content) + : [content]) + .cl_map(sectionText => new Section(sectionText)); + + let modifiedSections = []; + let sectionsToRemove = []; + insertBeforeSection = undefined; + + if (isInit) { + // Render everything if isInit + sectionsToRemove = sectionList; + sectionList = newSectionList; + modifiedSections = newSectionList; + } else { + // Find modified section starting from top + let leftIndex = sectionList.length; + sectionList.cl_some((section, index) => { + const newSection = newSectionList[index]; + if (index >= newSectionList.length || + section.forceHighlighting || + // Check text modification + section.text !== newSection.text || + // Check that section has not been detached or moved + section.elt.parentNode !== contentElt || + // Check also the content since nodes can be injected in sections via copy/paste + section.elt.textContent !== newSection.text + ) { + leftIndex = index; + return true; + } + return false; + }); + + // Find modified section starting from bottom + let rightIndex = -sectionList.length; + sectionList.slice().reverse().cl_some((section, index) => { + const newSection = newSectionList[newSectionList.length - index - 1]; + if (index >= newSectionList.length || + section.forceHighlighting || + // Check modified + section.text !== newSection.text || + // Check that section has not been detached or moved + section.elt.parentNode !== contentElt || + // Check also the content since nodes can be injected in sections via copy/paste + section.elt.textContent !== newSection.text + ) { + rightIndex = -index; + return true; + } + return false; + }); + + if (leftIndex - rightIndex > sectionList.length) { + // Prevent overlap + rightIndex = leftIndex - sectionList.length; + } + + const leftSections = sectionList.slice(0, leftIndex); + modifiedSections = newSectionList.slice(leftIndex, newSectionList.length + rightIndex); + const rightSections = sectionList.slice(sectionList.length + rightIndex, sectionList.length); + [insertBeforeSection] = rightSections; + sectionsToRemove = sectionList.slice(leftIndex, sectionList.length + rightIndex); + sectionList = leftSections.concat(modifiedSections).concat(rightSections); + } + + const highlight = (section) => { + const html = editor.options.sectionHighlighter(section).replace(/\n/g, lfHtml); + const sectionElt = document.createElement('div'); + sectionElt.className = 'cledit-section'; + sectionElt.innerHTML = html; + section.setElement(sectionElt); + this.$trigger('sectionHighlighted', section); + }; + + const newSectionEltList = document.createDocumentFragment(); + modifiedSections.cl_each((section) => { + section.forceHighlighting = false; + highlight(section); + newSectionEltList.appendChild(section.elt); + }); + editor.watcher.noWatch(() => { + if (isInit) { + contentElt.innerHTML = ''; + contentElt.appendChild(newSectionEltList); + this.addTrailingNode(); + return; + } + + // Remove outdated sections + sectionsToRemove.cl_each((section) => { + // section may be already removed + if (section.elt.parentNode === contentElt) { + contentElt.removeChild(section.elt); + } + // To detect sections that come back with built-in undo + section.elt.section = undefined; + }); + + if (insertBeforeSection !== undefined) { + contentElt.insertBefore(newSectionEltList, insertBeforeSection.elt); + } else { + contentElt.appendChild(newSectionEltList); + } + + // Remove unauthorized nodes (text nodes outside of sections or + // duplicated sections via copy/paste) + let childNode = contentElt.firstChild; + while (childNode) { + const nextNode = childNode.nextSibling; + if (!childNode.section) { + contentElt.removeChild(childNode); + } + childNode = nextNode; + } + this.addTrailingNode(); + this.$trigger('highlighted'); + + if (editor.selectionMgr.hasFocus()) { + editor.selectionMgr.restoreSelection(); + editor.selectionMgr.updateCursorCoordinates(); + } + }); + + return sectionList; + }; +} + +cledit.Highlighter = Highlighter; + diff --git a/src/services/editor/cledit/cleditKeystroke.js b/src/services/editor/cledit/cleditKeystroke.js new file mode 100644 index 0000000..b2d6387 --- /dev/null +++ b/src/services/editor/cledit/cleditKeystroke.js @@ -0,0 +1,188 @@ +import cledit from './cleditCore'; + +function Keystroke(handler, priority) { + this.handler = handler; + this.priority = priority || 100; +} + +cledit.Keystroke = Keystroke; + +let clearNewline; +const charTypes = Object.create(null); + +// Word separators, as in Sublime Text +'./\\()"\'-:,.;<>~!@#$%^&*|+=[]{}`~?'.split('').cl_each((wordSeparator) => { + charTypes[wordSeparator] = 'wordSeparator'; +}); +charTypes[' '] = 'space'; +charTypes['\t'] = 'space'; +charTypes['\n'] = 'newLine'; + +function getNextWordOffset(text, offset, isBackward) { + let previousType; + let result = offset; + while ((isBackward && result > 0) || (!isBackward && result < text.length)) { + const currentType = charTypes[isBackward ? text[result - 1] : text[result]] || 'word'; + if (previousType && currentType !== previousType) { + if (previousType === 'word' || currentType === 'space' || previousType === 'newLine' || currentType === 'newLine') { + break; + } + } + previousType = currentType; + if (isBackward) { + result -= 1; + } else { + result += 1; + } + } + return result; +} + +cledit.defaultKeystrokes = [ + + new Keystroke((evt, state, editor) => { + if ((!evt.ctrlKey && !evt.metaKey) || evt.altKey) { + return false; + } + const keyCode = evt.charCode || evt.keyCode; + const keyCodeChar = String.fromCharCode(keyCode).toLowerCase(); + let action; + switch (keyCodeChar) { + case 'y': + action = 'redo'; + break; + case 'z': + action = evt.shiftKey ? 'redo' : 'undo'; + break; + default: + } + if (action) { + evt.preventDefault(); + setTimeout(() => editor.undoMgr[action](), 10); + return true; + } + return false; + }), + + new Keystroke((evt, state) => { + if (evt.which !== 9 /* tab */ || evt.metaKey || evt.ctrlKey) { + return false; + } + + const strSplice = (str, i, remove, add = '') => + str.slice(0, i) + add + str.slice(i + (+remove || 0)); + + evt.preventDefault(); + const isInverse = evt.shiftKey; + const lf = state.before.lastIndexOf('\n') + 1; + if (isInverse) { + if (/\s/.test(state.before.charAt(lf))) { + state.before = strSplice(state.before, lf, 1); + } + state.selection = state.selection.replace(/^[ \t]/gm, ''); + } else if (state.selection) { + state.before = strSplice(state.before, lf, 0, '\t'); + state.selection = state.selection.replace(/\n(?=[\s\S])/g, '\n\t'); + } else { + state.before += '\t'; + } + return true; + }), + + new Keystroke((evt, state, editor) => { + if (evt.which !== 13 /* enter */) { + clearNewline = false; + return false; + } + + evt.preventDefault(); + const lf = state.before.lastIndexOf('\n') + 1; + if (clearNewline) { + state.before = state.before.substring(0, lf); + state.selection = ''; + clearNewline = false; + return true; + } + clearNewline = false; + const previousLine = state.before.slice(lf); + const indent = previousLine.match(/^\s*/)[0]; + if (indent.length) { + clearNewline = true; + } + + editor.undoMgr.setCurrentMode('single'); + state.before += `\n${indent}`; + state.selection = ''; + return true; + }), + + new Keystroke((evt, state, editor) => { + if (evt.which !== 8 /* backspace */ && evt.which !== 46 /* delete */) { + return false; + } + + editor.undoMgr.setCurrentMode('delete'); + if (!state.selection) { + const isJump = (cledit.Utils.isMac && evt.altKey) || (!cledit.Utils.isMac && evt.ctrlKey); + if (isJump) { + // Custom kill word behavior + const text = state.before + state.after; + const offset = getNextWordOffset(text, state.before.length, evt.which === 8); + if (evt.which === 8) { + state.before = state.before.slice(0, offset); + } else { + state.after = state.after.slice(offset - text.length); + } + evt.preventDefault(); + return true; + } else if (evt.which === 8 && state.before.slice(-1) === '\n') { + // Special treatment for end of lines + state.before = state.before.slice(0, -1); + evt.preventDefault(); + return true; + } else if (evt.which === 46 && state.after.slice(0, 1) === '\n') { + state.after = state.after.slice(1); + evt.preventDefault(); + return true; + } + } else { + state.selection = ''; + evt.preventDefault(); + return true; + } + return false; + }), + + new Keystroke((evt, state, editor) => { + if (evt.which !== 37 /* left arrow */ && evt.which !== 39 /* right arrow */) { + return false; + } + const isJump = (cledit.Utils.isMac && evt.altKey) || (!cledit.Utils.isMac && evt.ctrlKey); + if (!isJump) { + return false; + } + + // Custom jump behavior + const textContent = editor.getContent(); + const offset = getNextWordOffset( + textContent, + editor.selectionMgr.selectionEnd, + evt.which === 37, + ); + if (evt.shiftKey) { + // rebuild the state completely + const min = Math.min(editor.selectionMgr.selectionStart, offset); + const max = Math.max(editor.selectionMgr.selectionStart, offset); + state.before = textContent.slice(0, min); + state.after = textContent.slice(max); + state.selection = textContent.slice(min, max); + state.isBackwardSelection = editor.selectionMgr.selectionStart > offset; + } else { + state.before = textContent.slice(0, offset); + state.after = textContent.slice(offset); + state.selection = ''; + } + evt.preventDefault(); + return true; + }), +]; diff --git a/src/services/editor/cledit/cleditMarker.js b/src/services/editor/cledit/cleditMarker.js new file mode 100644 index 0000000..f4ff550 --- /dev/null +++ b/src/services/editor/cledit/cleditMarker.js @@ -0,0 +1,49 @@ +import cledit from './cleditCore'; + +const DIFF_DELETE = -1; +const DIFF_INSERT = 1; +const DIFF_EQUAL = 0; + +let idCounter = 0; + +class Marker { + constructor(offset, trailing) { + this.id = idCounter; + idCounter += 1; + this.offset = offset; + this.trailing = trailing; + } + + adjustOffset(diffs) { + let startOffset = 0; + diffs.cl_each((diff) => { + const diffType = diff[0]; + const diffText = diff[1]; + const diffOffset = diffText.length; + switch (diffType) { + case DIFF_EQUAL: + startOffset += diffOffset; + break; + case DIFF_INSERT: + if ( + this.trailing + ? this.offset > startOffset + : this.offset >= startOffset + ) { + this.offset += diffOffset; + } + startOffset += diffOffset; + break; + case DIFF_DELETE: + if (this.offset > startOffset) { + this.offset -= Math.min(diffOffset, this.offset - startOffset); + } + break; + default: + } + }); + } +} + + +cledit.Marker = Marker; diff --git a/src/services/editor/cledit/cleditSelectionMgr.js b/src/services/editor/cledit/cleditSelectionMgr.js new file mode 100644 index 0000000..56a8170 --- /dev/null +++ b/src/services/editor/cledit/cleditSelectionMgr.js @@ -0,0 +1,431 @@ +import cledit from './cleditCore'; + +function SelectionMgr(editor) { + const { debounce } = cledit.Utils; + const contentElt = editor.$contentElt; + const scrollElt = editor.$scrollElt; + cledit.Utils.createEventHooks(this); + + let lastSelectionStart = 0; + let lastSelectionEnd = 0; + this.selectionStart = 0; + this.selectionEnd = 0; + this.cursorCoordinates = {}; + + this.findContainer = (offset) => { + const result = cledit.Utils.findContainer(contentElt, offset); + if (result.container.nodeValue === '\n') { + const hdLfElt = result.container.parentNode; + if (hdLfElt.className === 'hd-lf' && hdLfElt.previousSibling && hdLfElt.previousSibling.tagName === 'BR') { + result.container = hdLfElt.parentNode; + result.offsetInContainer = Array.prototype.indexOf.call( + result.container.childNodes, + result.offsetInContainer === 0 ? hdLfElt.previousSibling : hdLfElt, + ); + } + } + return result; + }; + + this.createRange = (start, end) => { + const range = document.createRange(); + const startContainer = typeof start === 'number' + ? this.findContainer(start < 0 ? 0 : start) + : start; + let endContainer = startContainer; + if (start !== end) { + endContainer = typeof end === 'number' + ? this.findContainer(end < 0 ? 0 : end) + : end; + } + range.setStart(startContainer.container, startContainer.offsetInContainer); + range.setEnd(endContainer.container, endContainer.offsetInContainer); + return range; + }; + + let adjustScroll; + const debouncedUpdateCursorCoordinates = debounce(() => { + const coordinates = this.getCoordinates( + this.selectionEnd, + this.selectionEndContainer, + this.selectionEndOffset, + ); + if (this.cursorCoordinates.top !== coordinates.top || + this.cursorCoordinates.height !== coordinates.height || + this.cursorCoordinates.left !== coordinates.left + ) { + this.cursorCoordinates = coordinates; + this.$trigger('cursorCoordinatesChanged', coordinates); + } + if (adjustScroll) { + let scrollEltHeight = scrollElt.clientHeight; + if (typeof adjustScroll === 'number') { + scrollEltHeight -= adjustScroll; + } + const adjustment = (scrollEltHeight / 2) * editor.options.getCursorFocusRatio(); + let cursorTop = this.cursorCoordinates.top + (this.cursorCoordinates.height / 2); + // Adjust cursorTop with contentElt position relative to scrollElt + cursorTop += (contentElt.getBoundingClientRect().top - scrollElt.getBoundingClientRect().top) + + scrollElt.scrollTop; + const minScrollTop = cursorTop - adjustment; + const maxScrollTop = (cursorTop + adjustment) - scrollEltHeight; + if (scrollElt.scrollTop > minScrollTop) { + scrollElt.scrollTop = minScrollTop; + } else if (scrollElt.scrollTop < maxScrollTop) { + scrollElt.scrollTop = maxScrollTop; + } + } + adjustScroll = false; + }); + + this.updateCursorCoordinates = (adjustScrollParam) => { + adjustScroll = adjustScroll || adjustScrollParam; + debouncedUpdateCursorCoordinates(); + }; + + let oldSelectionRange; + + const checkSelection = (selectionRange) => { + if (!oldSelectionRange || + oldSelectionRange.startContainer !== selectionRange.startContainer || + oldSelectionRange.startOffset !== selectionRange.startOffset || + oldSelectionRange.endContainer !== selectionRange.endContainer || + oldSelectionRange.endOffset !== selectionRange.endOffset + ) { + oldSelectionRange = selectionRange; + this.$trigger('selectionChanged', this.selectionStart, this.selectionEnd, selectionRange); + return true; + } + return false; + }; + + this.hasFocus = () => contentElt === document.activeElement; + + this.restoreSelection = () => { + const min = Math.min(this.selectionStart, this.selectionEnd); + const max = Math.max(this.selectionStart, this.selectionEnd); + const selectionRange = this.createRange(min, max); + if (!document.contains(selectionRange.commonAncestorContainer)) { + return null; + } + const selection = window.getSelection(); + selection.removeAllRanges(); + const isBackward = this.selectionStart > this.selectionEnd; + if (isBackward && selection.extend) { + const beginRange = selectionRange.cloneRange(); + beginRange.collapse(false); + selection.addRange(beginRange); + selection.extend(selectionRange.startContainer, selectionRange.startOffset); + } else { + selection.addRange(selectionRange); + } + checkSelection(selectionRange); + return selectionRange; + }; + + const saveLastSelection = debounce(() => { + lastSelectionStart = this.selectionStart; + lastSelectionEnd = this.selectionEnd; + }, 50); + + const setSelection = (start = this.selectionStart, end = this.selectionEnd) => { + this.selectionStart = start < 0 ? 0 : start; + this.selectionEnd = end < 0 ? 0 : end; + saveLastSelection(); + }; + + this.setSelectionStartEnd = (start, end, restoreSelection = true) => { + setSelection(start, end); + if (restoreSelection && this.hasFocus()) { + return this.restoreSelection(); + } + return null; + }; + + this.saveSelectionState = (() => { + // Credit: https://github.com/timdown/rangy + function arrayContains(arr, val) { + let i = arr.length; + while (i) { + i -= 1; + if (arr[i] === val) { + return true; + } + } + return false; + } + + function getClosestAncestorIn(node, ancestor, selfIsAncestor) { + let p; + let n = selfIsAncestor ? node : node.parentNode; + while (n) { + p = n.parentNode; + if (p === ancestor) { + return n; + } + n = p; + } + return null; + } + + function getNodeIndex(node) { + let i = 0; + let { previousSibling } = node; + while (previousSibling) { + i += 1; + ({ previousSibling } = previousSibling); + } + return i; + } + + function getCommonAncestor(node1, node2) { + const ancestors = []; + let n; + for (n = node1; n; n = n.parentNode) { + ancestors.push(n); + } + + for (n = node2; n; n = n.parentNode) { + if (arrayContains(ancestors, n)) { + return n; + } + } + + return null; + } + + function comparePoints(nodeA, offsetA, nodeB, offsetB) { + // See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Comparing + let n; + if (nodeA === nodeB) { + // Case 1: nodes are the same + if (offsetA === offsetB) { + return 0; + } + return offsetA < offsetB ? -1 : 1; + } + let nodeC = getClosestAncestorIn(nodeB, nodeA, true); + if (nodeC) { + // Case 2: node C (container B or an ancestor) is a child node of A + return offsetA <= getNodeIndex(nodeC) ? -1 : 1; + } + nodeC = getClosestAncestorIn(nodeA, nodeB, true); + if (nodeC) { + // Case 3: node C (container A or an ancestor) is a child node of B + return getNodeIndex(nodeC) < offsetB ? -1 : 1; + } + const root = getCommonAncestor(nodeA, nodeB); + if (!root) { + throw new Error('comparePoints error: nodes have no common ancestor'); + } + + // Case 4: containers are siblings or descendants of siblings + const childA = (nodeA === root) ? root : getClosestAncestorIn(nodeA, root, true); + const childB = (nodeB === root) ? root : getClosestAncestorIn(nodeB, root, true); + + if (childA === childB) { + // This shouldn't be possible + throw module.createError('comparePoints got to case 4 and childA and childB are the same!'); + } + n = root.firstChild; + while (n) { + if (n === childA) { + return -1; + } else if (n === childB) { + return 1; + } + n = n.nextSibling; + } + return 0; + } + + const save = () => { + let result; + if (this.hasFocus()) { + let { selectionStart } = this; + let { selectionEnd } = this; + const selection = window.getSelection(); + if (selection.rangeCount > 0) { + const selectionRange = selection.getRangeAt(0); + let node = selectionRange.startContainer; + // eslint-disable-next-line no-bitwise + if ((contentElt.compareDocumentPosition(node) + & window.Node.DOCUMENT_POSITION_CONTAINED_BY) + || contentElt === node + ) { + let offset = selectionRange.startOffset; + if (node.firstChild && offset > 0) { + node = node.childNodes[offset - 1]; + offset = node.textContent.length; + } + let container = node; + while (node !== contentElt) { + node = node.previousSibling; + while (node) { + offset += (node.textContent || '').length; + node = node.previousSibling; + } + node = container.parentNode; + container = node; + } + let selectionText = `${selectionRange}`; + // Fix end of line when only br is selected + const brElt = selectionRange.endContainer.firstChild; + if (brElt && brElt.tagName === 'BR' && selectionRange.endOffset === 1) { + selectionText += '\n'; + } + if (comparePoints( + selection.anchorNode, + selection.anchorOffset, + selection.focusNode, + selection.focusOffset, + ) === 1) { + selectionStart = offset + selectionText.length; + selectionEnd = offset; + } else { + selectionStart = offset; + selectionEnd = offset + selectionText.length; + } + + if (selectionStart === selectionEnd && selectionStart === editor.getContent().length) { + // If cursor is after the trailingNode + selectionEnd -= 1; + selectionStart = selectionEnd; + result = this.setSelectionStartEnd(selectionStart, selectionEnd); + } else { + setSelection(selectionStart, selectionEnd); + result = checkSelection(selectionRange); + // selectionRange doesn't change when selection is at the start of a section + result = result || lastSelectionStart !== this.selectionStart; + } + } + } + } + return result; + }; + + const saveCheckChange = () => save() && ( + lastSelectionStart !== this.selectionStart || lastSelectionEnd !== this.selectionEnd); + + let nextTickAdjustScroll = false; + const longerDebouncedSave = debounce(() => { + this.updateCursorCoordinates(saveCheckChange() && nextTickAdjustScroll); + nextTickAdjustScroll = false; + }, 10); + const debouncedSave = debounce(() => { + this.updateCursorCoordinates(saveCheckChange() && nextTickAdjustScroll); + // In some cases we have to wait a little longer to see the + // selection change (Cmd+A on Chrome OSX) + longerDebouncedSave(); + }); + + return (debounced, adjustScrollParam, forceAdjustScroll) => { + if (forceAdjustScroll) { + lastSelectionStart = undefined; + lastSelectionEnd = undefined; + } + if (debounced) { + nextTickAdjustScroll = nextTickAdjustScroll || adjustScrollParam; + debouncedSave(); + } else { + save(); + } + }; + })(); + + this.getSelectedText = () => { + const min = Math.min(this.selectionStart, this.selectionEnd); + const max = Math.max(this.selectionStart, this.selectionEnd); + return editor.getContent().substring(min, max); + }; + + this.getCoordinates = (inputOffset, containerParam, offsetInContainerParam) => { + let container = containerParam; + let offsetInContainer = offsetInContainerParam; + if (!container) { + const offset = this.findContainer(inputOffset); + ({ container } = offset); + ({ offsetInContainer } = offset); + } + let containerElt = container; + if (!containerElt.hasChildNodes() && container.parentNode) { + containerElt = container.parentNode; + } + let isInvisible = false; + while (!containerElt.offsetHeight) { + isInvisible = true; + if (containerElt.previousSibling) { + containerElt = containerElt.previousSibling; + } else { + containerElt = containerElt.parentNode; + if (!containerElt) { + return { + top: 0, + height: 0, + left: 0, + }; + } + } + } + let rect; + let left = 'left'; + if (isInvisible || container.textContent === '\n') { + rect = containerElt.getBoundingClientRect(); + } else { + const selectedChar = editor.getContent()[inputOffset]; + let startOffset = { + container, + offsetInContainer, + }; + let endOffset = { + container, + offsetInContainer, + }; + if (inputOffset > 0 && (selectedChar === undefined || selectedChar === '\n')) { + left = 'right'; + if (startOffset.offsetInContainer === 0) { + // Need to calculate offset-1 + startOffset = inputOffset - 1; + } else { + startOffset.offsetInContainer -= 1; + } + } else if (endOffset.offsetInContainer === container.textContent.length) { + // Need to calculate offset+1 + endOffset = inputOffset + 1; + } else { + endOffset.offsetInContainer += 1; + } + const range = this.createRange(startOffset, endOffset); + rect = range.getBoundingClientRect(); + } + const contentRect = contentElt.getBoundingClientRect(); + return { + top: Math.round((rect.top - contentRect.top) + contentElt.scrollTop), + height: Math.round(rect.height), + left: Math.round((rect[left] - contentRect.left) + contentElt.scrollLeft), + }; + }; + + this.getClosestWordOffset = (offset) => { + let offsetStart = 0; + let offsetEnd = 0; + let nextOffset = 0; + editor.getContent().split(/\s/).cl_some((word) => { + if (word) { + offsetStart = nextOffset; + offsetEnd = nextOffset + word.length; + if (offsetEnd > offset) { + return true; + } + } + nextOffset += word.length + 1; + return false; + }); + return { + start: offsetStart, + end: offsetEnd, + }; + }; +} + +cledit.SelectionMgr = SelectionMgr; diff --git a/src/services/editor/cledit/cleditUndoMgr.js b/src/services/editor/cledit/cleditUndoMgr.js new file mode 100644 index 0000000..70adf6e --- /dev/null +++ b/src/services/editor/cledit/cleditUndoMgr.js @@ -0,0 +1,176 @@ +import DiffMatchPatch from 'diff-match-patch'; +import cledit from './cleditCore'; + +function UndoMgr(editor) { + cledit.Utils.createEventHooks(this); + + /* eslint-disable new-cap */ + const diffMatchPatch = new DiffMatchPatch(); + /* eslint-enable new-cap */ + + const self = this; + let selectionMgr; + const undoStack = []; + const redoStack = []; + let currentState; + let previousPatches = []; + let currentPatches = []; + const { debounce } = cledit.Utils; + + this.options = { + undoStackMaxSize: 200, + bufferStateUntilIdle: 1000, + patchHandler: { + makePatches(oldContent, newContent, diffs) { + return diffMatchPatch.patch_make(oldContent, diffs); + }, + applyPatches(patches, content) { + return diffMatchPatch.patch_apply(patches, content)[0]; + }, + reversePatches(patches) { + const reversedPatches = diffMatchPatch.patch_deepCopy(patches).reverse(); + reversedPatches.cl_each((patch) => { + patch.diffs.cl_each((diff) => { + diff[0] = -diff[0]; + }); + }); + return reversedPatches; + }, + }, + }; + + let stateMgr; + function StateMgr() { + let currentTime; + let lastTime; + let lastMode; + + this.isBufferState = () => { + currentTime = Date.now(); + return this.currentMode !== 'single' && + this.currentMode === lastMode && + currentTime - lastTime < self.options.bufferStateUntilIdle; + }; + + this.setDefaultMode = (mode) => { + this.currentMode = this.currentMode || mode; + }; + + this.resetMode = () => { + stateMgr.currentMode = undefined; + lastMode = undefined; + }; + + this.saveMode = () => { + lastMode = this.currentMode; + this.currentMode = undefined; + lastTime = currentTime; + }; + } + + class State { + addToUndoStack() { + undoStack.push(this); + this.patches = previousPatches; + previousPatches = []; + } + addToRedoStack() { + redoStack.push(this); + this.patches = previousPatches; + previousPatches = []; + } + } + + stateMgr = new StateMgr(); + this.setCurrentMode = (mode) => { + stateMgr.currentMode = mode; + }; + this.setDefaultMode = stateMgr.setDefaultMode.cl_bind(stateMgr); + + this.addDiffs = (oldContent, newContent, diffs) => { + const patches = this.options.patchHandler.makePatches(oldContent, newContent, diffs); + patches.cl_each(patch => currentPatches.push(patch)); + }; + + function saveCurrentPatches() { + // Move currentPatches into previousPatches + Array.prototype.push.apply(previousPatches, currentPatches); + currentPatches = []; + } + + this.saveState = debounce(() => { + redoStack.length = 0; + if (!stateMgr.isBufferState()) { + currentState.addToUndoStack(); + + // Limit the size of the stack + while (undoStack.length > this.options.undoStackMaxSize) { + undoStack.shift(); + } + } + saveCurrentPatches(); + currentState = new State(); + stateMgr.saveMode(); + this.$trigger('undoStateChange'); + }); + + this.canUndo = () => !!undoStack.length; + this.canRedo = () => !!redoStack.length; + + const restoreState = (patchesParam, isForward) => { + let patches = patchesParam; + // Update editor + const content = editor.getContent(); + if (!isForward) { + patches = this.options.patchHandler.reversePatches(patches); + } + + const newContent = this.options.patchHandler.applyPatches(patches, content); + const newContentText = newContent.text || newContent; + const range = editor.setContent(newContentText, true); + const selection = newContent.selection || { + start: range.end, + end: range.end, + }; + + selectionMgr.setSelectionStartEnd(selection.start, selection.end); + selectionMgr.updateCursorCoordinates(true); + + stateMgr.resetMode(); + this.$trigger('undoStateChange'); + editor.adjustCursorPosition(); + }; + + this.undo = () => { + const state = undoStack.pop(); + if (!state) { + return; + } + saveCurrentPatches(); + currentState.addToRedoStack(); + restoreState(currentState.patches); + previousPatches = state.patches; + currentState = state; + }; + + this.redo = () => { + const state = redoStack.pop(); + if (!state) { + return; + } + currentState.addToUndoStack(); + restoreState(state.patches, true); + previousPatches = state.patches; + currentState = state; + }; + + this.init = (options) => { + this.options.cl_extend(options || {}); + ({ selectionMgr } = editor); + if (!currentState) { + currentState = new State(); + } + }; +} + +cledit.UndoMgr = UndoMgr; diff --git a/src/services/editor/cledit/cleditUtils.js b/src/services/editor/cledit/cleditUtils.js new file mode 100644 index 0000000..bbb365d --- /dev/null +++ b/src/services/editor/cledit/cleditUtils.js @@ -0,0 +1,129 @@ +import cledit from './cleditCore'; + +const Utils = { + isGecko: 'MozAppearance' in document.documentElement.style, + isWebkit: 'WebkitAppearance' in document.documentElement.style, + isMsie: 'msTransform' in document.documentElement.style, + isMac: navigator.userAgent.indexOf('Mac OS X') !== -1, +}; + +// Faster than setTimeout(0). Credit: https://github.com/stefanpenner/es6-promise +Utils.defer = (() => { + const queue = new Array(1000); + let queueLength = 0; + function flush() { + for (let i = 0; i < queueLength; i += 1) { + try { + queue[i](); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e.message, e.stack); + } + queue[i] = undefined; + } + queueLength = 0; + } + + let iterations = 0; + const observer = new window.MutationObserver(flush); + const node = document.createTextNode(''); + observer.observe(node, { characterData: true }); + + return (fn) => { + queue[queueLength] = fn; + queueLength += 1; + if (queueLength === 1) { + iterations = (iterations + 1) % 2; + node.data = iterations; + } + }; +})(); + +Utils.debounce = (func, wait) => { + let timeoutId; + let isExpected; + return wait + ? () => { + clearTimeout(timeoutId); + timeoutId = setTimeout(func, wait); + } + : () => { + if (!isExpected) { + isExpected = true; + Utils.defer(() => { + isExpected = false; + func(); + }); + } + }; +}; + +Utils.createEventHooks = (object) => { + const listenerMap = Object.create(null); + object.$trigger = (eventType, ...args) => { + const listeners = listenerMap[eventType]; + if (listeners) { + listeners.cl_each((listener) => { + try { + listener.apply(object, args); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e.message, e.stack); + } + }); + } + }; + object.on = (eventType, listener) => { + let listeners = listenerMap[eventType]; + if (!listeners) { + listeners = []; + listenerMap[eventType] = listeners; + } + listeners.push(listener); + }; + object.off = (eventType, listener) => { + const listeners = listenerMap[eventType]; + if (listeners) { + const index = listeners.indexOf(listener); + if (index !== -1) { + listeners.splice(index, 1); + } + } + }; +}; + +Utils.findContainer = (elt, offset) => { + let containerOffset = 0; + let container; + let child = elt; + do { + container = child; + child = child.firstChild; + if (child) { + do { + const len = child.textContent.length; + if (containerOffset <= offset && containerOffset + len > offset) { + break; + } + containerOffset += len; + child = child.nextSibling; + } while (child); + } + } while (child && child.firstChild && child.nodeType !== 3); + + if (child) { + return { + container: child, + offsetInContainer: offset - containerOffset, + }; + } + while (container.lastChild) { + container = container.lastChild; + } + return { + container, + offsetInContainer: container.nodeType === 3 ? container.textContent.length : 0, + }; +}; + +cledit.Utils = Utils; diff --git a/src/services/editor/cledit/cleditWatcher.js b/src/services/editor/cledit/cleditWatcher.js new file mode 100644 index 0000000..a1ec617 --- /dev/null +++ b/src/services/editor/cledit/cleditWatcher.js @@ -0,0 +1,34 @@ +import cledit from './cleditCore'; + +function Watcher(editor, listener) { + this.isWatching = false; + let contentObserver; + this.startWatching = () => { + this.stopWatching(); + this.isWatching = true; + contentObserver = new window.MutationObserver(listener); + contentObserver.observe(editor.$contentElt, { + childList: true, + subtree: true, + characterData: true, + }); + }; + this.stopWatching = () => { + if (contentObserver) { + contentObserver.disconnect(); + contentObserver = undefined; + } + this.isWatching = false; + }; + this.noWatch = (cb) => { + if (this.isWatching === true) { + this.stopWatching(); + cb(); + this.startWatching(); + } else { + cb(); + } + }; +} + +cledit.Watcher = Watcher; diff --git a/src/services/editor/cledit/index.js b/src/services/editor/cledit/index.js new file mode 100644 index 0000000..ba5167b --- /dev/null +++ b/src/services/editor/cledit/index.js @@ -0,0 +1,11 @@ +import '../../../libs/clunderscore'; +import cledit from './cleditCore'; +import './cleditHighlighter'; +import './cleditKeystroke'; +import './cleditMarker'; +import './cleditSelectionMgr'; +import './cleditUndoMgr'; +import './cleditUtils'; +import './cleditWatcher'; + +export default cledit; diff --git a/src/services/editor/editorSvcDiscussions.js b/src/services/editor/editorSvcDiscussions.js new file mode 100644 index 0000000..3805e1e --- /dev/null +++ b/src/services/editor/editorSvcDiscussions.js @@ -0,0 +1,256 @@ +import DiffMatchPatch from 'diff-match-patch'; +import cledit from './cledit'; +import utils from '../utils'; +import diffUtils from '../diffUtils'; +import store from '../../store'; +import EditorClassApplier from '../../components/common/EditorClassApplier'; +import PreviewClassApplier from '../../components/common/PreviewClassApplier'; + +let clEditor; +// let discussionIds = {}; +let discussionMarkers = {}; +let markerKeys; +let markerIdxMap; +let previousPatchableText; +let currentPatchableText; +let isChangePatch; +let contentId; +let editorClassAppliers = {}; +let previewClassAppliers = {}; + +function getDiscussionMarkers(discussion, discussionId, onMarker) { + const getMarker = (offsetName) => { + const markerKey = `${discussionId}:${offsetName}`; + let marker = discussionMarkers[markerKey]; + if (!marker) { + marker = new cledit.Marker(discussion[offsetName], offsetName === 'end'); + marker.discussionId = discussionId; + marker.offsetName = offsetName; + clEditor.addMarker(marker); + discussionMarkers[markerKey] = marker; + } + onMarker(marker); + }; + getMarker('start'); + getMarker('end'); +} + +function syncDiscussionMarkers(content, writeOffsets) { + const discussions = { + ...content.discussions, + }; + const newDiscussion = store.getters['discussion/newDiscussion']; + if (newDiscussion) { + discussions[store.state.discussion.newDiscussionId] = { + ...newDiscussion, + }; + } + Object.entries(discussionMarkers).forEach(([markerKey, marker]) => { + // Remove marker if discussion was removed + const discussion = discussions[marker.discussionId]; + if (!discussion) { + clEditor.removeMarker(marker); + delete discussionMarkers[markerKey]; + } + }); + + Object.entries(discussions).forEach(([discussionId, discussion]) => { + getDiscussionMarkers(discussion, discussionId, writeOffsets + ? (marker) => { + discussion[marker.offsetName] = marker.offset; + } + : (marker) => { + marker.offset = discussion[marker.offsetName]; + }); + }); + + if (writeOffsets && newDiscussion) { + store.commit( + 'discussion/patchNewDiscussion', + discussions[store.state.discussion.newDiscussionId], + ); + } +} + +function removeDiscussionMarkers() { + Object.entries(discussionMarkers).forEach(([, marker]) => { + clEditor.removeMarker(marker); + }); + discussionMarkers = {}; + markerKeys = []; + markerIdxMap = Object.create(null); +} + +const diffMatchPatch = new DiffMatchPatch(); + +function makePatches() { + const diffs = diffMatchPatch.diff_main(previousPatchableText, currentPatchableText); + return diffMatchPatch.patch_make(previousPatchableText, diffs); +} + +function applyPatches(patches) { + const newPatchableText = diffMatchPatch.patch_apply(patches, currentPatchableText)[0]; + let result = newPatchableText; + if (markerKeys.length) { + // Strip text markers + result = result.replace(new RegExp(`[\ue000-${String.fromCharCode((0xe000 + markerKeys.length) - 1)}]`, 'g'), ''); + } + // Expect a `contentChanged` event + if (result !== clEditor.getContent()) { + previousPatchableText = currentPatchableText; + currentPatchableText = newPatchableText; + isChangePatch = true; + } + return result; +} + +function reversePatches(patches) { + const result = diffMatchPatch.patch_deepCopy(patches).reverse(); + result.forEach((patch) => { + patch.diffs.forEach((diff) => { + diff[0] = -diff[0]; + }); + }); + return result; +} + +export default { + createClEditor(editorElt) { + this.clEditor = cledit(editorElt, editorElt.parentNode, true); + ({ clEditor } = this); + clEditor.on('contentChanged', (text) => { + const oldContent = store.getters['content/current']; + const newContent = { + ...utils.deepCopy(oldContent), + text: utils.sanitizeText(text), + }; + syncDiscussionMarkers(newContent, true); + if (!isChangePatch) { + previousPatchableText = currentPatchableText; + currentPatchableText = diffUtils.makePatchableText(newContent, markerKeys, markerIdxMap); + } else { + // Take a chance to restore discussion offsets on undo/redo + newContent.text = currentPatchableText; + diffUtils.restoreDiscussionOffsets(newContent, markerKeys); + syncDiscussionMarkers(newContent, false); + } + store.dispatch('content/patchCurrent', newContent); + isChangePatch = false; + }); + clEditor.on('focus', () => store.commit('discussion/setNewCommentFocus', false)); + }, + initClEditorInternal(opts) { + const content = store.getters['content/current']; + if (content) { + removeDiscussionMarkers(); // Markers will be recreated on contentChanged + const contentState = store.getters['contentState/current']; + const options = Object.assign({ + selectionStart: contentState.selectionStart, + selectionEnd: contentState.selectionEnd, + patchHandler: { + makePatches, + applyPatches, + reversePatches, + }, + }, opts); + + if (contentId !== content.id) { + contentId = content.id; + currentPatchableText = diffUtils.makePatchableText(content, markerKeys, markerIdxMap); + previousPatchableText = currentPatchableText; + syncDiscussionMarkers(content, false); + options.content = content.text; + } + + clEditor.init(options); + } + }, + applyContent() { + if (clEditor) { + const content = store.getters['content/current']; + if (clEditor.setContent(content.text, true).range) { + // Marker will be recreated on contentChange + removeDiscussionMarkers(); + } else { + syncDiscussionMarkers(content, false); + } + } + }, + getTrimmedSelection() { + const { selectionMgr } = clEditor; + let start = Math.min(selectionMgr.selectionStart, selectionMgr.selectionEnd); + let end = Math.max(selectionMgr.selectionStart, selectionMgr.selectionEnd); + const text = clEditor.getContent(); + while ((text[start] || '').match(/\s/)) { + start += 1; + } + while ((text[end - 1] || '').match(/\s/)) { + end -= 1; + } + return start < end && { start, end }; + }, + initHighlighters() { + store.watch( + () => store.getters['discussion/newDiscussion'], + () => syncDiscussionMarkers(store.getters['content/current'], false), + ); + + store.watch( + () => store.getters['discussion/currentFileDiscussions'], + (discussions) => { + const classGetter = (type, discussionId) => () => { + const classes = [`discussion-${type}-highlighting--${discussionId}`, `discussion-${type}-highlighting`]; + if (store.state.discussion.currentDiscussionId === discussionId) { + classes.push(`discussion-${type}-highlighting--selected`); + } + return classes; + }; + const offsetGetter = discussionId => () => { + const startMarker = discussionMarkers[`${discussionId}:start`]; + const endMarker = discussionMarkers[`${discussionId}:end`]; + return startMarker && endMarker && { + start: startMarker.offset, + end: endMarker.offset, + }; + }; + + // Editor class appliers + const oldEditorClassAppliers = editorClassAppliers; + editorClassAppliers = {}; + Object.keys(discussions).forEach((discussionId) => { + const classApplier = oldEditorClassAppliers[discussionId] || new EditorClassApplier( + classGetter('editor', discussionId), + offsetGetter(discussionId), + { discussionId }, + ); + editorClassAppliers[discussionId] = classApplier; + }); + // Clean unused class appliers + Object.entries(oldEditorClassAppliers).forEach(([discussionId, classApplier]) => { + if (!editorClassAppliers[discussionId]) { + classApplier.stop(); + } + }); + + // Preview class appliers + const oldPreviewClassAppliers = previewClassAppliers; + previewClassAppliers = {}; + Object.keys(discussions).forEach((discussionId) => { + const classApplier = oldPreviewClassAppliers[discussionId] || new PreviewClassApplier( + classGetter('preview', discussionId), + offsetGetter(discussionId), + { discussionId }, + ); + previewClassAppliers[discussionId] = classApplier; + }); + // Clean unused class appliers + Object.entries(oldPreviewClassAppliers).forEach(([discussionId, classApplier]) => { + if (!previewClassAppliers[discussionId]) { + classApplier.stop(); + } + }); + }, + ); + }, +}; + diff --git a/src/services/editor/editorSvcUtils.js b/src/services/editor/editorSvcUtils.js new file mode 100644 index 0000000..6edc584 --- /dev/null +++ b/src/services/editor/editorSvcUtils.js @@ -0,0 +1,151 @@ +import DiffMatchPatch from 'diff-match-patch'; +import cledit from './cledit'; +import animationSvc from '../animationSvc'; +import store from '../../store'; + +const diffMatchPatch = new DiffMatchPatch(); + +export default { + /** + * Get an object describing the position of the scroll bar in the file. + */ + getScrollPosition(elt = store.getters['layout/styles'].showEditor + ? this.editorElt : this.previewElt) { + const dimensionKey = elt === this.editorElt + ? 'editorDimension' + : 'previewDimension'; + const { scrollTop } = elt.parentNode; + let result; + if (this.previewCtxMeasured) { + this.previewCtxMeasured.sectionDescList.some((sectionDesc, sectionIdx) => { + if (scrollTop >= sectionDesc[dimensionKey].endOffset) { + return false; + } + const posInSection = (scrollTop - sectionDesc[dimensionKey].startOffset) / + (sectionDesc[dimensionKey].height || 1); + result = { + sectionIdx, + posInSection, + }; + return true; + }); + } + return result; + }, + + /** + * Restore the scroll position from the current file content state. + */ + restoreScrollPosition() { + const { scrollPosition } = store.getters['contentState/current']; + if (scrollPosition && this.previewCtxMeasured) { + const sectionDesc = this.previewCtxMeasured.sectionDescList[scrollPosition.sectionIdx]; + if (sectionDesc) { + const editorScrollTop = sectionDesc.editorDimension.startOffset + + (sectionDesc.editorDimension.height * scrollPosition.posInSection); + this.editorElt.parentNode.scrollTop = Math.floor(editorScrollTop); + const previewScrollTop = sectionDesc.previewDimension.startOffset + + (sectionDesc.previewDimension.height * scrollPosition.posInSection); + this.previewElt.parentNode.scrollTop = Math.floor(previewScrollTop); + } + } + }, + + /** + * Get the offset in the preview corresponding to the offset of the markdown in the editor + */ + getPreviewOffset( + editorOffset, + sectionDescList = (this.previewCtxWithDiffs || {}).sectionDescList, + ) { + if (!sectionDescList) { + return null; + } + let offset = editorOffset; + let previewOffset = 0; + sectionDescList.some((sectionDesc) => { + if (!sectionDesc.textToPreviewDiffs) { + previewOffset = null; + return true; + } + if (sectionDesc.section.text.length >= offset) { + previewOffset += diffMatchPatch.diff_xIndex(sectionDesc.textToPreviewDiffs, offset); + return true; + } + offset -= sectionDesc.section.text.length; + previewOffset += sectionDesc.previewText.length; + return false; + }); + return previewOffset; + }, + + /** + * Get the offset of the markdown in the editor corresponding to the offset in the preview + */ + getEditorOffset( + previewOffset, + sectionDescList = (this.previewCtxWithDiffs || {}).sectionDescList, + ) { + if (!sectionDescList) { + return null; + } + let offset = previewOffset; + let editorOffset = 0; + sectionDescList.some((sectionDesc) => { + if (!sectionDesc.textToPreviewDiffs) { + editorOffset = null; + return true; + } + if (sectionDesc.previewText.length >= offset) { + const previewToTextDiffs = sectionDesc.textToPreviewDiffs + .map(diff => [-diff[0], diff[1]]); + editorOffset += diffMatchPatch.diff_xIndex(previewToTextDiffs, offset); + return true; + } + offset -= sectionDesc.previewText.length; + editorOffset += sectionDesc.section.text.length; + return false; + }); + return editorOffset; + }, + + /** + * Get the coordinates of an offset in the preview + */ + getPreviewOffsetCoordinates(offset) { + const start = cledit.Utils.findContainer(this.previewElt, offset && offset - 1); + const end = cledit.Utils.findContainer(this.previewElt, offset || offset + 1); + const range = document.createRange(); + range.setStart(start.container, start.offsetInContainer); + range.setEnd(end.container, end.offsetInContainer); + const rect = range.getBoundingClientRect(); + const contentRect = this.previewElt.getBoundingClientRect(); + return { + top: Math.round((rect.top - contentRect.top) + this.previewElt.scrollTop), + height: Math.round(rect.height), + left: Math.round((rect.right - contentRect.left) + this.previewElt.scrollLeft), + }; + }, + + /** + * Scroll the preview (or the editor if preview is hidden) to the specified anchor + */ + scrollToAnchor(anchor) { + let scrollTop = 0; + const scrollerElt = this.previewElt.parentNode; + const elt = document.getElementById(anchor); + if (elt) { + scrollTop = elt.offsetTop; + } + const maxScrollTop = scrollerElt.scrollHeight - scrollerElt.offsetHeight; + if (scrollTop < 0) { + scrollTop = 0; + } else if (scrollTop > maxScrollTop) { + scrollTop = maxScrollTop; + } + animationSvc.animate(scrollerElt) + .scrollTop(scrollTop) + .duration(360) + .start(); + }, +}; diff --git a/src/services/editor/sectionUtils.js b/src/services/editor/sectionUtils.js new file mode 100644 index 0000000..86fe120 --- /dev/null +++ b/src/services/editor/sectionUtils.js @@ -0,0 +1,114 @@ +class SectionDimension { + constructor(startOffset, endOffset) { + this.startOffset = startOffset; + this.endOffset = endOffset; + this.height = endOffset - startOffset; + } +} + +const dimensionNormalizer = dimensionName => (editorSvc) => { + const dimensionList = editorSvc.previewCtx.sectionDescList + .map(sectionDesc => sectionDesc[dimensionName]); + let dimension; + let i; + let j; + for (i = 0; i < dimensionList.length; i += 1) { + dimension = dimensionList[i]; + if (dimension.height) { + for (j = i + 1; j < dimensionList.length && dimensionList[j].height === 0; j += 1) { + // Loop + } + const normalizeFactor = j - i; + if (normalizeFactor !== 1) { + const normalizedHeight = dimension.height / normalizeFactor; + dimension.height = normalizedHeight; + dimension.endOffset = dimension.startOffset + dimension.height; + for (j = i + 1; j < i + normalizeFactor; j += 1) { + const startOffset = dimension.endOffset; + dimension = dimensionList[j]; + dimension.startOffset = startOffset; + dimension.height = normalizedHeight; + dimension.endOffset = dimension.startOffset + dimension.height; + } + i = j - 1; + } + } + } +}; + +const normalizeEditorDimensions = dimensionNormalizer('editorDimension'); +const normalizePreviewDimensions = dimensionNormalizer('previewDimension'); +const normalizeTocDimensions = dimensionNormalizer('tocDimension'); + +export default { + measureSectionDimensions(editorSvc) { + let editorSectionOffset = 0; + let previewSectionOffset = 0; + let tocSectionOffset = 0; + let sectionDesc = editorSvc.previewCtx.sectionDescList[0]; + let nextSectionDesc; + let i = 1; + for (; i < editorSvc.previewCtx.sectionDescList.length; i += 1) { + nextSectionDesc = editorSvc.previewCtx.sectionDescList[i]; + + // Measure editor section + let newEditorSectionOffset = nextSectionDesc.editorElt + ? nextSectionDesc.editorElt.offsetTop + : editorSectionOffset; + newEditorSectionOffset = newEditorSectionOffset > editorSectionOffset + ? newEditorSectionOffset + : editorSectionOffset; + sectionDesc.editorDimension = new SectionDimension( + editorSectionOffset, + newEditorSectionOffset, + ); + editorSectionOffset = newEditorSectionOffset; + + // Measure preview section + let newPreviewSectionOffset = nextSectionDesc.previewElt + ? nextSectionDesc.previewElt.offsetTop + : previewSectionOffset; + newPreviewSectionOffset = newPreviewSectionOffset > previewSectionOffset + ? newPreviewSectionOffset + : previewSectionOffset; + sectionDesc.previewDimension = new SectionDimension( + previewSectionOffset, + newPreviewSectionOffset, + ); + previewSectionOffset = newPreviewSectionOffset; + + // Measure TOC section + let newTocSectionOffset = nextSectionDesc.tocElt + ? nextSectionDesc.tocElt.offsetTop + (nextSectionDesc.tocElt.offsetHeight / 2) + : tocSectionOffset; + newTocSectionOffset = newTocSectionOffset > tocSectionOffset + ? newTocSectionOffset + : tocSectionOffset; + sectionDesc.tocDimension = new SectionDimension(tocSectionOffset, newTocSectionOffset); + tocSectionOffset = newTocSectionOffset; + + sectionDesc = nextSectionDesc; + } + + // Last section + sectionDesc = editorSvc.previewCtx.sectionDescList[i - 1]; + if (sectionDesc) { + sectionDesc.editorDimension = new SectionDimension( + editorSectionOffset, + editorSvc.editorElt.scrollHeight, + ); + sectionDesc.previewDimension = new SectionDimension( + previewSectionOffset, + editorSvc.previewElt.scrollHeight, + ); + sectionDesc.tocDimension = new SectionDimension( + tocSectionOffset, + editorSvc.tocElt.scrollHeight, + ); + } + + normalizeEditorDimensions(editorSvc); + normalizePreviewDimensions(editorSvc); + normalizeTocDimensions(editorSvc); + }, +}; diff --git a/src/services/editorSvc.js b/src/services/editorSvc.js new file mode 100644 index 0000000..d59d0cf --- /dev/null +++ b/src/services/editorSvc.js @@ -0,0 +1,685 @@ +import Vue from 'vue'; +import DiffMatchPatch from 'diff-match-patch'; +import Prism from 'prismjs'; +import markdownItPandocRenderer from 'markdown-it-pandoc-renderer'; +import md5 from 'js-md5'; +import cledit from './editor/cledit'; +import pagedown from '../libs/pagedown'; +import htmlSanitizer from '../libs/htmlSanitizer'; +import markdownConversionSvc from './markdownConversionSvc'; +import markdownGrammarSvc from './markdownGrammarSvc'; +import sectionUtils from './editor/sectionUtils'; +import extensionSvc from './extensionSvc'; +import editorSvcDiscussions from './editor/editorSvcDiscussions'; +import editorSvcUtils from './editor/editorSvcUtils'; +import utils from './utils'; +import store from '../store'; +import syncSvc from './syncSvc'; +import constants from '../data/constants'; +import localDbSvc from './localDbSvc'; + +const allowDebounce = (action, wait) => { + let timeoutId; + return (doDebounce = false, ...params) => { + clearTimeout(timeoutId); + if (doDebounce) { + timeoutId = setTimeout(() => action(...params), wait); + } else { + action(...params); + } + }; +}; + +const diffMatchPatch = new DiffMatchPatch(); +let instantPreview = true; +let tokens; + +class SectionDesc { + constructor(section, previewElt, tocElt, html) { + this.section = section; + this.editorElt = section.elt; + this.previewElt = previewElt; + this.tocElt = tocElt; + this.html = html; + } +} + +const pathUrlMap = Object.create(null); + +const getImgUrl = async (uri) => { + if (uri.indexOf('http://') !== 0 && uri.indexOf('https://') !== 0) { + const currDirNode = store.getters['explorer/selectedNodeFolder']; + const absoluteImgPath = utils.getAbsoluteFilePath(currDirNode, uri); + if (pathUrlMap[absoluteImgPath]) { + return pathUrlMap[absoluteImgPath]; + } + const md5Id = md5(absoluteImgPath); + let imgItem = await localDbSvc.getImgItem(md5Id); + if (!imgItem) { + await syncSvc.syncImg(absoluteImgPath); + imgItem = await localDbSvc.getImgItem(md5Id); + } + if (imgItem) { + // imgItem 如果不存在 则加载 TODO + const imgFile = utils.base64ToBlob(imgItem.content, uri); + const url = URL.createObjectURL(imgFile); + pathUrlMap[absoluteImgPath] = url; + return url; + } + return ''; + } + return uri; +}; + +// Use a vue instance as an event bus +const editorSvc = Object.assign(new Vue(), editorSvcDiscussions, editorSvcUtils, { + // Elements + editorElt: null, + previewElt: null, + tocElt: null, + // Other objects + clEditor: null, + pagedownEditor: null, + options: null, + prismGrammars: null, + converter: null, + parsingCtx: null, + conversionCtx: null, + previewCtx: { + sectionDescList: [], + }, + previewCtxMeasured: null, + previewCtxWithDiffs: null, + sectionList: null, + selectionRange: null, + previewSelectionRange: null, + previewSelectionStartOffset: null, + + /** + * Initialize the Prism grammar with the options + */ + initPrism() { + const options = { + ...this.options, + insideFences: markdownConversionSvc.defaultOptions.insideFences, + }; + this.prismGrammars = markdownGrammarSvc.makeGrammars(options); + }, + + /** + * Initialize the markdown-it converter with the options + */ + initConverter() { + this.converter = markdownConversionSvc.createConverter(this.options, true); + }, + + /** + * Initialize the cledit editor with markdown-it section parser and Prism highlighter + */ + initClEditor() { + this.previewCtxMeasured = null; + editorSvc.$emit('previewCtxMeasured', null); + this.previewCtxWithDiffs = null; + editorSvc.$emit('previewCtxWithDiffs', null); + const options = { + sectionHighlighter: section => Prism + .highlight(section.text, this.prismGrammars[section.data]), + sectionParser: (text) => { + this.parsingCtx = markdownConversionSvc.parseSections(this.converter, text); + return this.parsingCtx.sections; + }, + getCursorFocusRatio: () => { + if (store.getters['data/layoutSettings'].focusMode) { + return 1; + } + return 0.15; + }, + }; + this.initClEditorInternal(options); + this.restoreScrollPosition(); + }, + + /** + * Finish the conversion initiated by the section parser + */ + convert() { + this.conversionCtx = markdownConversionSvc.convert(this.parsingCtx, this.conversionCtx); + this.$emit('conversionCtx', this.conversionCtx); + ({ tokens } = this.parsingCtx.markdownState); + }, + + /** + * Refresh the preview with the result of `convert()` + */ + async refreshPreview() { + const sectionDescList = []; + let sectionPreviewElt; + let sectionTocElt; + let sectionIdx = 0; + let sectionDescIdx = 0; + let insertBeforePreviewElt = this.previewElt.firstChild; + let insertBeforeTocElt = this.tocElt.firstChild; + let previewHtml = ''; + let loadingImages = []; + this.conversionCtx.htmlSectionDiff.forEach((item) => { + for (let i = 0; i < item[1].length; i += 1) { + const section = this.conversionCtx.sectionList[sectionIdx]; + if (item[0] === 0) { + let sectionDesc = this.previewCtx.sectionDescList[sectionDescIdx]; + sectionDescIdx += 1; + if (sectionDesc.editorElt !== section.elt) { + // Force textToPreviewDiffs computation + sectionDesc = new SectionDesc( + section, + sectionDesc.previewElt, + sectionDesc.tocElt, + sectionDesc.html, + ); + } + sectionDescList.push(sectionDesc); + previewHtml += sectionDesc.html; + sectionIdx += 1; + insertBeforePreviewElt = insertBeforePreviewElt.nextSibling; + insertBeforeTocElt = insertBeforeTocElt.nextSibling; + } else if (item[0] === -1) { + sectionDescIdx += 1; + sectionPreviewElt = insertBeforePreviewElt; + insertBeforePreviewElt = insertBeforePreviewElt.nextSibling; + this.previewElt.removeChild(sectionPreviewElt); + sectionTocElt = insertBeforeTocElt; + insertBeforeTocElt = insertBeforeTocElt.nextSibling; + this.tocElt.removeChild(sectionTocElt); + } else if (item[0] === 1) { + const html = htmlSanitizer.sanitizeHtml(this.conversionCtx.htmlSectionList[sectionIdx]); + sectionIdx += 1; + + // Create preview section element + sectionPreviewElt = document.createElement('div'); + sectionPreviewElt.className = 'cl-preview-section'; + sectionPreviewElt.innerHTML = html; + if (insertBeforePreviewElt) { + this.previewElt.insertBefore(sectionPreviewElt, insertBeforePreviewElt); + } else { + this.previewElt.appendChild(sectionPreviewElt); + } + extensionSvc.sectionPreview(sectionPreviewElt, this.options, true); + const imgs = Array.prototype.slice.call(sectionPreviewElt.getElementsByTagName('img')).map((imgElt) => { + if (imgElt.src.indexOf(constants.origin) >= 0) { + const uri = decodeURIComponent(imgElt.attributes.src.nodeValue); + imgElt.removeAttribute('src'); + return { imgElt, uri }; + } + return { imgElt }; + }); + loadingImages = [ + ...loadingImages, + ...imgs, + ]; + + Array.prototype.slice.call(sectionPreviewElt.getElementsByTagName('a')).forEach((aElt) => { + const url = aElt.attributes && aElt.attributes.href && aElt.attributes.href.nodeValue; + if (!url || url.indexOf('http://') >= 0 || url.indexOf('https://') >= 0 || url.indexOf('#') >= 0) { + return; + } + aElt.href = 'javascript:void(0);'; // eslint-disable-line no-script-url + aElt.setAttribute('onclick', `window.viewFileByPath('${utils.decodeUrlPath(url)}')`); + }); + + // Create TOC section element + sectionTocElt = document.createElement('div'); + sectionTocElt.className = 'cl-toc-section'; + const headingElt = sectionPreviewElt.querySelector('h1, h2, h3, h4, h5, h6'); + if (headingElt) { + const clonedElt = headingElt.cloneNode(true); + clonedElt.removeAttribute('id'); + sectionTocElt.appendChild(clonedElt); + // 创建一个新的 元素 + const contentElt = document.createElement('span'); + contentElt.className = 'content'; + // 将原始内容移动到新的 元素中 + while (headingElt.firstChild) { + contentElt.appendChild(headingElt.firstChild); + } + const prefixElt = document.createElement('span'); + prefixElt.className = 'prefix'; + headingElt.insertBefore(prefixElt, headingElt.firstChild); + // 将新的 元素替换原始元素 + headingElt.appendChild(contentElt); + const suffixElt = document.createElement('span'); + suffixElt.className = 'suffix'; + headingElt.appendChild(suffixElt); + } + if (insertBeforeTocElt) { + this.tocElt.insertBefore(sectionTocElt, insertBeforeTocElt); + } else { + this.tocElt.appendChild(sectionTocElt); + } + + previewHtml += html; + sectionDescList.push(new SectionDesc(section, sectionPreviewElt, sectionTocElt, html)); + } + } + }); + + this.tocElt.classList[ + this.tocElt.querySelector('.cl-toc-section *') ? 'remove' : 'add' + ]('toc-tab--empty'); + + this.previewCtx = { + markdown: this.conversionCtx.text, + html: previewHtml.replace(/^\s+|\s+$/g, ''), + text: this.previewElt.textContent, + sectionDescList, + }; + this.$emit('previewCtx', this.previewCtx); + this.makeTextToPreviewDiffs(); + + // Wait for images to load + const loadedPromises = loadingImages.map(it => new Promise((resolve, reject) => { + if (!it.imgElt.src && it.uri) { + getImgUrl(it.uri).then((newUrl) => { + it.imgElt.src = newUrl; + resolve(); + }, () => reject(new Error('加载当前空间图片出错'))); + return; + } + if (!it.imgElt.src) { + resolve(); + return; + } + const img = new window.Image(); + img.onload = resolve; + img.onerror = resolve; + img.src = it.imgElt.src; + })); + await Promise.all(loadedPromises); + + // Debounce if sections have already been measured + this.measureSectionDimensions(!!this.previewCtxMeasured); + }, + + /** + * Measure the height of each section in editor, preview and toc. + */ + measureSectionDimensions: allowDebounce((restoreScrollPosition = false, force = false) => { + if (force || editorSvc.previewCtx !== editorSvc.previewCtxMeasured) { + sectionUtils.measureSectionDimensions(editorSvc); + editorSvc.previewCtxMeasured = editorSvc.previewCtx; + if (restoreScrollPosition) { + editorSvc.restoreScrollPosition(); + } + editorSvc.$emit('previewCtxMeasured', editorSvc.previewCtxMeasured); + } + }, 500), + + /** + * Compute the diffs between editor's markdown and preview's html + * asynchronously unless there is only one section to compute. + */ + makeTextToPreviewDiffs() { + if (editorSvc.previewCtx !== editorSvc.previewCtxWithDiffs) { + const makeOne = () => { + let hasOne = false; + const hasMore = editorSvc.previewCtx.sectionDescList + .some((sectionDesc) => { + if (!sectionDesc.textToPreviewDiffs) { + if (hasOne) { + return true; + } + if (!sectionDesc.previewText) { + sectionDesc.previewText = sectionDesc.previewElt.textContent; + } + sectionDesc.textToPreviewDiffs = diffMatchPatch.diff_main( + sectionDesc.section.text, + sectionDesc.previewText, + ); + hasOne = true; + } + return false; + }); + if (hasMore) { + setTimeout(() => makeOne(), 10); + } else { + editorSvc.previewCtxWithDiffs = editorSvc.previewCtx; + editorSvc.$emit('previewCtxWithDiffs', editorSvc.previewCtxWithDiffs); + } + }; + makeOne(); + } + }, + + /** + * Save editor selection/scroll state into the store. + */ + saveContentState: allowDebounce(() => { + const scrollPosition = editorSvc.getScrollPosition() || + store.getters['contentState/current'].scrollPosition; + store.dispatch('contentState/patchCurrent', { + selectionStart: editorSvc.clEditor.selectionMgr.selectionStart, + selectionEnd: editorSvc.clEditor.selectionMgr.selectionEnd, + scrollPosition, + }); + }, 100), + + /** + * Report selection from the preview to the editor. + */ + saveSelection: allowDebounce(() => { + const selection = window.getSelection(); + let range = selection.rangeCount && selection.getRangeAt(0); + if (range) { + if ( + /* eslint-disable no-bitwise */ + !(editorSvc.previewElt.compareDocumentPosition(range.startContainer) & + window.Node.DOCUMENT_POSITION_CONTAINED_BY) || + !(editorSvc.previewElt.compareDocumentPosition(range.endContainer) & + window.Node.DOCUMENT_POSITION_CONTAINED_BY) + /* eslint-enable no-bitwise */ + ) { + range = null; + } + } + if (editorSvc.previewSelectionRange !== range) { + let previewSelectionStartOffset; + let previewSelectionEndOffset; + if (range) { + const startRange = document.createRange(); + startRange.setStart(editorSvc.previewElt, 0); + startRange.setEnd(range.startContainer, range.startOffset); + previewSelectionStartOffset = `${startRange}`.length; + previewSelectionEndOffset = previewSelectionStartOffset + `${range}`.length; + const editorStartOffset = editorSvc.getEditorOffset(previewSelectionStartOffset); + const editorEndOffset = editorSvc.getEditorOffset(previewSelectionEndOffset); + if (editorStartOffset != null && editorEndOffset != null) { + editorSvc.clEditor.selectionMgr.setSelectionStartEnd( + editorStartOffset, + editorEndOffset, + ); + } + } + editorSvc.previewSelectionRange = range; + editorSvc.$emit('previewSelectionRange', editorSvc.previewSelectionRange); + } + }, 50), + + /** + * Returns the pandoc AST generated from the file tokens and the converter options + */ + getPandocAst() { + return tokens && markdownItPandocRenderer(tokens, this.converter.options); + }, + + /** + * Pass the elements to the store and initialize the editor. + */ + init(editorElt, previewElt, tocElt) { + this.editorElt = editorElt; + this.previewElt = previewElt; + this.tocElt = tocElt; + + this.createClEditor(editorElt); + + this.clEditor.on('contentChanged', (content, diffs, sectionList) => { + this.parsingCtx = { + ...this.parsingCtx, + sectionList, + }; + }); + this.clEditor.undoMgr.on('undoStateChange', () => { + const canUndo = this.clEditor.undoMgr.canUndo(); + if (canUndo !== store.state.layout.canUndo) { + store.commit('layout/setCanUndo', canUndo); + } + const canRedo = this.clEditor.undoMgr.canRedo(); + if (canRedo !== store.state.layout.canRedo) { + store.commit('layout/setCanRedo', canRedo); + } + }); + this.pagedownEditor = pagedown({ + input: Object.create(this.clEditor), + }); + this.pagedownEditor.run(); + this.pagedownEditor.hooks.set('insertLinkDialog', (callback) => { + store.dispatch('modal/open', { + type: 'link', + callback, + }); + return true; + }); + this.pagedownEditor.hooks.set('insertImageDialog', (callback) => { + store.dispatch('modal/open', { + type: 'image', + callback, + }); + return true; + }); + this.pagedownEditor.hooks.set('insertChatGptDialog', (callback) => { + store.dispatch('modal/open', { + type: 'chatGpt', + callback, + }); + return true; + }); + this.pagedownEditor.hooks.set('insertImageUploading', (callback) => { + callback(store.getters['img/currImgId']); + return true; + }); + this.editorElt.parentNode.addEventListener('scroll', () => this.saveContentState(true)); + this.previewElt.parentNode.addEventListener('scroll', () => this.saveContentState(true)); + + const refreshPreview = allowDebounce(() => { + this.convert(); + if (instantPreview) { + this.refreshPreview(); + this.measureSectionDimensions(false, true); + } else { + setTimeout(() => this.refreshPreview(), 10); + } + instantPreview = false; + }, 25); + + let newSectionList; + let newSelectionRange; + const onEditorChanged = allowDebounce(() => { + if (this.sectionList !== newSectionList) { + this.sectionList = newSectionList; + this.$emit('sectionList', this.sectionList); + refreshPreview(!instantPreview); + } + if (this.selectionRange !== newSelectionRange) { + this.selectionRange = newSelectionRange; + this.$emit('selectionRange', this.selectionRange); + } + this.saveContentState(); + }, 10); + + this.clEditor.selectionMgr.on('selectionChanged', (start, end, selectionRange) => { + newSelectionRange = selectionRange; + onEditorChanged(!instantPreview); + }); + + /* ----------------------------- + * Inline images + */ + + const imgCache = Object.create(null); + + const hashImgElt = imgElt => `${imgElt.src}:${imgElt.width || -1}:${imgElt.height || -1}`; + + const addToImgCache = (imgElt) => { + const hash = hashImgElt(imgElt); + let entries = imgCache[hash]; + if (!entries) { + entries = []; + imgCache[hash] = entries; + } + entries.push(imgElt); + }; + + const getFromImgCache = (imgEltsToCache) => { + const hash = hashImgElt(imgEltsToCache); + const entries = imgCache[hash]; + if (!entries) { + return null; + } + let imgElt; + return entries + .some((entry) => { + if (this.editorElt.contains(entry)) { + return false; + } + imgElt = entry; + return true; + }) && imgElt; + }; + + const triggerImgCacheGc = cledit.Utils.debounce(() => { + Object.entries(imgCache).forEach(([src, entries]) => { + // Filter entries that are not attached to the DOM + const filteredEntries = entries.filter(imgElt => this.editorElt.contains(imgElt)); + if (filteredEntries.length) { + imgCache[src] = filteredEntries; + } else { + delete imgCache[src]; + } + }); + }, 100); + + let imgEltsToCache = []; + if (store.getters['data/computedSettings'].editor.inlineImages) { + this.clEditor.highlighter.on('sectionHighlighted', (section) => { + const loadImgs = []; + section.elt.getElementsByClassName('token img').cl_each((imgTokenElt) => { + const srcElt = imgTokenElt.querySelector('.token.cl-src'); + if (srcElt) { + // Create an img element before the .img.token and wrap both elements + // into a .token.img-wrapper + const imgElt = document.createElement('img'); + imgElt.style.display = 'none'; + const uri = srcElt.textContent; + if (!/^unsafe/.test(htmlSanitizer.sanitizeUri(uri, true))) { + imgElt.onload = () => { + imgElt.style.display = ''; + }; + imgElt.src = uri; + // Take img size into account + const sizeElt = imgTokenElt.querySelector('.token.cl-size'); + if (sizeElt) { + const match = sizeElt.textContent.match(/=(\d*)x(\d*)/); + if (match[1]) { + imgElt.width = parseInt(match[1], 10); + } + if (match[2]) { + imgElt.height = parseInt(match[2], 10); + } + } + imgEltsToCache.push(imgElt); + if (imgElt.src.indexOf(origin) >= 0) { + imgElt.removeAttribute('src'); + loadImgs.push({ imgElt, uri: decodeURIComponent(uri) }); + } + } + const imgTokenWrapper = document.createElement('span'); + imgTokenWrapper.className = 'token img-wrapper'; + imgTokenElt.parentNode.insertBefore(imgTokenWrapper, imgTokenElt); + imgTokenWrapper.appendChild(imgElt); + imgTokenWrapper.appendChild(imgTokenElt); + } + }); + if (loadImgs.length) { + // Wait for images to load + const loadWorkspaceImg = loadImgs.map(it => new Promise((resolve, reject) => { + getImgUrl(it.uri).then((newUrl) => { + it.imgElt.src = newUrl; + resolve(); + }, () => reject(new Error(`加载当前空间图片出错,uri:${it.uri}`))); + })); + Promise.all(loadWorkspaceImg).then(); + } + }); + } + this.clEditor.highlighter.on('highlighted', () => { + imgEltsToCache.forEach((imgElt) => { + const cachedImgElt = getFromImgCache(imgElt); + if (cachedImgElt) { + // Found a previously loaded image that has just been released + imgElt.parentNode.replaceChild(cachedImgElt, imgElt); + } else { + addToImgCache(imgElt); + } + }); + imgEltsToCache = []; + // Eject released images from cache + triggerImgCacheGc(); + }); + + this.clEditor.on('contentChanged', (content, diffs, sectionList) => { + newSectionList = sectionList; + onEditorChanged(!instantPreview); + }); + + // clEditorSvc.setPreviewElt(element[0].querySelector('.preview__inner-2')) + // var previewElt = element[0].querySelector('.preview') + // clEditorSvc.isPreviewTop = previewElt.scrollTop < 10 + // previewElt.addEventListener('scroll', function () { + // var isPreviewTop = previewElt.scrollTop < 10 + // if (isPreviewTop !== clEditorSvc.isPreviewTop) { + // clEditorSvc.isPreviewTop = isPreviewTop + // scope.$apply() + // } + // }) + + // Watch file content changes + let lastContentId = null; + let lastProperties; + store.watch( + () => store.getters['content/currentChangeTrigger'], + () => { + const content = store.getters['content/current']; + // Track ID changes + let initClEditor = false; + if (content.id !== lastContentId) { + instantPreview = true; + lastContentId = content.id; + initClEditor = true; + } + // Track properties changes + if (content.properties !== lastProperties) { + lastProperties = content.properties; + const options = extensionSvc.getOptions(store.getters['content/currentProperties']); + if (utils.serializeObject(options) !== utils.serializeObject(this.options)) { + this.options = options; + this.initPrism(); + this.initConverter(); + initClEditor = true; + } + } + if (initClEditor) { + this.initClEditor(); + } + // Apply potential text and discussion changes + this.applyContent(); + }, { + immediate: true, + }, + ); + + // Disable editor if hidden or if no content is loaded + store.watch( + () => store.getters['content/isCurrentEditable'], + editable => this.clEditor.toggleEditable(!!editable), { + immediate: true, + }, + ); + + store.watch( + () => utils.serializeObject(store.getters['layout/styles']), + () => this.measureSectionDimensions(false, true, true), + ); + + this.initHighlighters(); + this.$emit('inited'); + }, +}); + +export default editorSvc; diff --git a/src/services/explorerSvc.js b/src/services/explorerSvc.js new file mode 100644 index 0000000..0735f73 --- /dev/null +++ b/src/services/explorerSvc.js @@ -0,0 +1,98 @@ +import store from '../store'; +import workspaceSvc from './workspaceSvc'; +import badgeSvc from './badgeSvc'; + +export default { + newItem(isFolder = false) { + let parentId = store.getters['explorer/selectedNodeFolder'].item.id; + if (parentId === 'trash' // Not allowed to create new items in the trash + || (isFolder && parentId === 'temp') // Not allowed to create new folders in the temp folder + ) { + parentId = null; + } + store.dispatch('explorer/openNode', parentId); + store.commit('explorer/setNewItem', { + type: isFolder ? 'folder' : 'file', + parentId, + }); + }, + async deleteItem() { + const selectedNode = store.getters['explorer/selectedNode']; + if (selectedNode.isNil) { + return; + } + + if (selectedNode.isTrash || selectedNode.item.parentId === 'trash') { + try { + await store.dispatch('modal/open', 'trashDeletion'); + } catch (e) { + // Cancel + } + return; + } + + // See if we have a confirmation dialog to show + let moveToTrash = true; + try { + if (selectedNode.isTemp) { + await store.dispatch('modal/open', 'tempFolderDeletion'); + moveToTrash = false; + } else if (selectedNode.item.parentId === 'temp') { + await store.dispatch('modal/open', { + type: 'tempFileDeletion', + item: selectedNode.item, + }); + moveToTrash = false; + } else if (selectedNode.isFolder) { + await store.dispatch('modal/open', { + type: 'folderDeletion', + item: selectedNode.item, + }); + } + } catch (e) { + return; // cancel + } + + const deleteFile = (id) => { + if (moveToTrash) { + workspaceSvc.setOrPatchItem({ + id, + parentId: 'trash', + }); + } else { + workspaceSvc.deleteFile(id); + } + }; + + if (selectedNode === store.getters['explorer/selectedNode']) { + const currentFileId = store.getters['file/current'].id; + let doClose = selectedNode.item.id === currentFileId; + if (selectedNode.isFolder) { + const recursiveDelete = (folderNode) => { + folderNode.folders.forEach(recursiveDelete); + folderNode.files.forEach((fileNode) => { + doClose = doClose || fileNode.item.id === currentFileId; + deleteFile(fileNode.item.id); + }); + store.commit('folder/deleteItem', folderNode.item.id); + }; + recursiveDelete(selectedNode); + badgeSvc.addBadge('removeFolder'); + } else { + deleteFile(selectedNode.item.id); + badgeSvc.addBadge('removeFile'); + } + if (doClose) { + // Close the current file by opening the last opened, not deleted one + store.getters['data/lastOpenedIds'].some((id) => { + const file = store.state.file.itemsById[id]; + if (file.parentId === 'trash') { + return false; + } + store.commit('file/setCurrentId', id); + return true; + }); + } + } + }, +}; diff --git a/src/services/exportSvc.js b/src/services/exportSvc.js new file mode 100644 index 0000000..4106474 --- /dev/null +++ b/src/services/exportSvc.js @@ -0,0 +1,193 @@ +import md5 from 'js-md5'; +import FileSaver from 'file-saver'; +import TemplateWorker from 'worker-loader!./templateWorker.js'; // eslint-disable-line +import localDbSvc from './localDbSvc'; +import markdownConversionSvc from './markdownConversionSvc'; +import extensionSvc from './extensionSvc'; +import utils from './utils'; +import store from '../store'; +import htmlSanitizer from '../libs/htmlSanitizer'; + +function groupHeadings(headings, level = 1) { + const result = []; + let currentItem; + + function pushCurrentItem() { + if (currentItem) { + if (currentItem.children.length > 0) { + currentItem.children = groupHeadings(currentItem.children, level + 1); + } + result.push(currentItem); + } + } + headings.forEach((heading) => { + if (heading.level !== level) { + currentItem = currentItem || { + children: [], + }; + currentItem.children.push(heading); + } else { + pushCurrentItem(); + currentItem = heading; + } + }); + pushCurrentItem(); + return result; +} + +const getImgBase64 = async (uri) => { + if (uri.indexOf('http://') !== 0 && uri.indexOf('https://') !== 0) { + const currDirNode = store.getters['explorer/selectedNodeFolder']; + const absoluteImgPath = utils.getAbsoluteFilePath(currDirNode, uri); + const md5Id = md5(absoluteImgPath); + const imgItem = await localDbSvc.getImgItem(md5Id); + if (imgItem) { + const potIdx = uri.lastIndexOf('.'); + const suffix = potIdx > -1 ? uri.substring(potIdx + 1) : 'png'; + const mime = `image/${suffix}`; + return `data:${mime};base64,${imgItem.content}`; + } + return ''; + } + return uri; +}; + + +const containerElt = document.createElement('div'); +containerElt.className = 'hidden-rendering-container'; +document.body.appendChild(containerElt); + +export default { + /** + * Apply the template to the file content + */ + async applyTemplate(fileId, template = { + value: '{{{files.0.content.text}}}', + helpers: '', + }, pdf = false) { + const file = store.state.file.itemsById[fileId]; + const content = await localDbSvc.loadItem(`${fileId}/content`); + const properties = utils.computeProperties(content.properties); + const options = extensionSvc.getOptions(properties); + const converter = markdownConversionSvc.createConverter(options, true); + const parsingCtx = markdownConversionSvc.parseSections(converter, content.text); + const conversionCtx = markdownConversionSvc.convert(parsingCtx); + const html = conversionCtx.htmlSectionList.map(htmlSanitizer.sanitizeHtml).join(''); + const colorThemeClass = `app--${store.getters['data/computedSettings'].colorTheme}`; + const themeClass = `preview-theme--${store.state.theme.currPreviewTheme}`; + let themeStyleContent = ''; + const themeStyleEle = document.getElementById(`preview-theme-${store.state.theme.currPreviewTheme}`); + if (themeStyleEle) { + themeStyleContent = themeStyleEle.innerText; + } + containerElt.innerHTML = html; + extensionSvc.sectionPreview(containerElt, options); + + // Unwrap tables + containerElt.querySelectorAll('.table-wrapper').cl_each((wrapperElt) => { + while (wrapperElt.firstChild) { + wrapperElt.parentNode.insertBefore(wrapperElt.firstChild, wrapperElt.nextSibling); + } + wrapperElt.parentNode.removeChild(wrapperElt); + }); + + // 替换相对路径图片为blob图片 + const imgs = Array.prototype.slice.call(containerElt.getElementsByTagName('img')).map((imgElt) => { + let uri = imgElt.attributes && imgElt.attributes.src && imgElt.attributes.src.nodeValue; + if (uri && uri.indexOf('http://') !== 0 && uri.indexOf('https://') !== 0) { + uri = decodeURIComponent(uri); + imgElt.removeAttribute('src'); + return { imgElt, uri }; + } + return { imgElt }; + }); + const loadedPromises = imgs.map(it => new Promise((resolve, reject) => { + if (!it.imgElt.src && it.uri) { + getImgBase64(it.uri).then((newUrl) => { + it.imgElt.src = newUrl; + resolve(); + }, () => reject(new Error('加载当前空间图片出错'))); + return; + } + resolve(); + })); + await Promise.all(loadedPromises); + + // Make TOC + const allHeaders = containerElt.querySelectorAll('h1,h2,h3,h4,h5,h6'); + Array.prototype.slice.call(allHeaders).forEach((headingElt) => { + // 创建一个新的 元素 + const contentElt = document.createElement('span'); + contentElt.className = 'content'; + // 将原始内容移动到新的 元素中 + while (headingElt.firstChild) { + contentElt.appendChild(headingElt.firstChild); + } + const prefixElt = document.createElement('span'); + prefixElt.className = 'prefix'; + headingElt.insertBefore(prefixElt, headingElt.firstChild); + // 将新的 元素替换原始元素 + headingElt.appendChild(contentElt); + const suffixElt = document.createElement('span'); + suffixElt.className = 'suffix'; + headingElt.appendChild(suffixElt); + }); + const headings = allHeaders.cl_map(headingElt => ({ + title: headingElt.textContent, + anchor: headingElt.id, + level: parseInt(headingElt.tagName.slice(1), 10), + children: [], + })); + const toc = groupHeadings(headings); + const view = { + pdf, + files: [{ + name: file.name, + content: { + text: content.text, + properties, + yamlProperties: content.properties, + html: containerElt.innerHTML, + toc, + colorThemeClass, + themeClass, + themeStyleContent, + }, + }], + }; + containerElt.innerHTML = ''; + + // Run template conversion in a Worker to prevent attacks from helpers + const worker = new TemplateWorker(); + return new Promise((resolve, reject) => { + const timeoutId = setTimeout(() => { + worker.terminate(); + reject(new Error('Template generation timeout.')); + }, 10000); + worker.addEventListener('message', (e) => { + clearTimeout(timeoutId); + worker.terminate(); + // e.data can contain unsafe data if helpers attempts to call postMessage + const [err, result] = e.data; + if (err) { + reject(new Error(`${err}`)); + } else { + resolve(`${result}`); + } + }); + worker.postMessage([template.value, view, template.helpers]); + }); + }, + + /** + * Export a file to disk. + */ + async exportToDisk(fileId, type, template) { + const file = store.state.file.itemsById[fileId]; + const html = await this.applyTemplate(fileId, template); + const blob = new Blob([html], { + type: 'text/plain;charset=utf-8', + }); + FileSaver.saveAs(blob, `${file.name}.${type}`); + }, +}; diff --git a/src/services/extensionSvc.js b/src/services/extensionSvc.js new file mode 100644 index 0000000..b288259 --- /dev/null +++ b/src/services/extensionSvc.js @@ -0,0 +1,37 @@ +const getOptionsListeners = []; +const initConverterListeners = []; +const sectionPreviewListeners = []; + +export default { + onGetOptions(listener) { + getOptionsListeners.push(listener); + }, + + onInitConverter(priority, listener) { + initConverterListeners[priority] = listener; + }, + + onSectionPreview(listener) { + sectionPreviewListeners.push(listener); + }, + + getOptions(properties, isCurrentFile) { + return getOptionsListeners.reduce((options, listener) => { + listener(options, properties, isCurrentFile); + return options; + }, {}); + }, + + initConverter(markdown, options) { + // Use forEach as it's a sparsed array + initConverterListeners.forEach((listener) => { + listener(markdown, options); + }); + }, + + sectionPreview(elt, options, isEditor) { + sectionPreviewListeners.forEach((listener) => { + listener(elt, options, isEditor); + }); + }, +}; diff --git a/src/services/gitWorkspaceSvc.js b/src/services/gitWorkspaceSvc.js new file mode 100644 index 0000000..67a8b59 --- /dev/null +++ b/src/services/gitWorkspaceSvc.js @@ -0,0 +1,236 @@ +import store from '../store'; +import utils from '../services/utils'; + +const endsWith = (str, suffix) => str.slice(-suffix.length) === suffix; + +export default { + shaByPath: Object.create(null), + makeChanges(tree) { + const workspacePath = store.getters['workspace/currentWorkspace'].path || ''; + + // Store all blobs sha + this.shaByPath = Object.create(null); + // Store interesting paths + const treeFolderMap = Object.create(null); + const treeFileMap = Object.create(null); + const treeDataMap = Object.create(null); + const treeSyncLocationMap = Object.create(null); + const treePublishLocationMap = Object.create(null); + + tree.filter(({ type, path }) => type === 'blob' && path.indexOf(workspacePath) === 0) + .forEach((blobEntry) => { + // Make path relative + const path = blobEntry.path.slice(workspacePath.length); + // Collect blob sha + this.shaByPath[path] = blobEntry.sha; + if (path.indexOf('.stackedit-data/') === 0) { + treeDataMap[path] = true; + } else { + // Collect parents path + let parentPath = ''; + path.split('/').slice(0, -1).forEach((folderName) => { + const folderPath = `${parentPath}${folderName}/`; + treeFolderMap[folderPath] = parentPath; + parentPath = folderPath; + }); + // Collect file path + if (endsWith(path, '.md')) { + treeFileMap[path] = parentPath; + } else if (endsWith(path, '.sync')) { + treeSyncLocationMap[path] = true; + } else if (endsWith(path, '.publish')) { + treePublishLocationMap[path] = true; + } + } + }); + + // Collect changes + const changes = []; + const idsByPath = {}; + const syncDataByPath = store.getters['data/syncDataById']; + const { itemIdsByGitPath } = store.getters; + const getIdFromPath = (path, isFile) => { + let itemId = idsByPath[path]; + if (!itemId) { + const existingItemId = itemIdsByGitPath[path]; + if (existingItemId + // Reuse a file ID only if it has already been synced + && (!isFile || syncDataByPath[path] + // Content may have already been synced + || syncDataByPath[`/${path}`]) + ) { + itemId = existingItemId; + } else { + // Otherwise, make a new ID for a new item + itemId = utils.uid(); + } + // If it's a file path, add the content path as well + if (isFile) { + idsByPath[`/${path}`] = `${itemId}/content`; + } + idsByPath[path] = itemId; + } + return itemId; + }; + + // Folder creations/updates + // Assume map entries are sorted from top to bottom + Object.entries(treeFolderMap).forEach(([path, parentPath]) => { + if (path === '.stackedit-trash/') { + idsByPath[path] = 'trash'; + } else { + const item = utils.addItemHash({ + id: getIdFromPath(path), + type: 'folder', + name: path.slice(parentPath.length, -1), + parentId: idsByPath[parentPath] || null, + }); + + const folderSyncData = syncDataByPath[path]; + if (!folderSyncData || folderSyncData.hash !== item.hash) { + changes.push({ + syncDataId: path, + item, + syncData: { + id: path, + type: item.type, + hash: item.hash, + }, + }); + } + } + }); + + // File/content creations/updates + Object.entries(treeFileMap).forEach(([path, parentPath]) => { + const fileId = getIdFromPath(path, true); + const contentPath = `/${path}`; + const contentId = idsByPath[contentPath]; + + // File creations/updates + const item = utils.addItemHash({ + id: fileId, + type: 'file', + name: path.slice(parentPath.length, -'.md'.length), + parentId: idsByPath[parentPath] || null, + }); + + const fileSyncData = syncDataByPath[path]; + if (!fileSyncData || fileSyncData.hash !== item.hash) { + changes.push({ + syncDataId: path, + item, + syncData: { + id: path, + type: item.type, + hash: item.hash, + }, + }); + } + + // Content creations/updates + const contentSyncData = syncDataByPath[contentPath]; + if (!contentSyncData || contentSyncData.sha !== this.shaByPath[path]) { + const type = 'content'; + // Use `/` as a prefix to get a unique syncData id + changes.push({ + syncDataId: contentPath, + item: { + id: contentId, + type, + // Need a truthy value to force downloading the content + hash: 1, + }, + syncData: { + id: contentPath, + type, + // Need a truthy value to force downloading the content + hash: 1, + }, + }); + } + }); + + // Data creations/updates + const syncDataById = store.getters['data/syncDataById']; + Object.keys(treeDataMap).forEach((path) => { + // Only settings、workspaces、template data are stored + const [, id] = path.match(/^\.stackedit-data\/(settings|workspaces|badgeCreations|templates)\.json$/) || []; + if (id) { + idsByPath[path] = id; + idsByPath[id] = id; + const syncData = syncDataById[id]; + if (!syncData || syncData.sha !== this.shaByPath[path]) { + const type = 'data'; + changes.push({ + syncDataId: id, + item: { + id, + type, + // Need a truthy value to force saving sync data + hash: 1, + }, + syncData: { + id, + type, + // Need a truthy value to force downloading the content + hash: 1, + }, + }); + } + } + }); + + // Location creations/updates + [{ + type: 'syncLocation', + map: treeSyncLocationMap, + pathMatcher: /^([\s\S]+)\.([\w-]+)\.sync$/, + }, { + type: 'publishLocation', + map: treePublishLocationMap, + pathMatcher: /^([\s\S]+)\.([\w-]+)\.publish$/, + }] + .forEach(({ type, map, pathMatcher }) => Object.keys(map).forEach((path) => { + const [, filePath, data] = path.match(pathMatcher) || []; + if (filePath) { + // If there is a corresponding md file in the tree + const fileId = idsByPath[`${filePath}.md`]; + if (fileId) { + // Reuse existing ID or create a new one + const id = itemIdsByGitPath[path] || utils.uid(); + idsByPath[path] = id; + + const item = utils.addItemHash({ + ...JSON.parse(utils.decodeBase64(data)), + id, + type, + fileId, + }); + + const locationSyncData = syncDataByPath[path]; + if (!locationSyncData || locationSyncData.hash !== item.hash) { + changes.push({ + syncDataId: path, + item, + syncData: { + id: path, + type: item.type, + hash: item.hash, + }, + }); + } + } + } + })); + + // Deletions + Object.keys(syncDataByPath).forEach((path) => { + if (!idsByPath[path]) { + changes.push({ syncDataId: path }); + } + }); + + return changes; + }, +}; diff --git a/src/services/imageSvc.js b/src/services/imageSvc.js new file mode 100644 index 0000000..99228c8 --- /dev/null +++ b/src/services/imageSvc.js @@ -0,0 +1,94 @@ +import md5 from 'js-md5'; +import store from '../store'; +import utils from './utils'; +import localDbSvc from './localDbSvc'; +import smmsHelper from '../services/providers/helpers/smmsHelper'; +import giteaHelper from '../services/providers/helpers/giteaHelper'; +import githubHelper from '../services/providers/helpers/githubHelper'; +import customHelper from '../services/providers/helpers/customHelper'; + +const getImagePath = (confPath, imgType) => { + const time = new Date(); + const date = time.getDate(); + const month = time.getMonth() + 1; + const year = time.getFullYear(); + const path = confPath.replace('{YYYY}', year).replace('{MM}', `0${month}`.slice(-2)) + .replace('{DD}', `0${date}`.slice(-2)).replace('{MDNAME}', store.getters['file/current'].name); + return `${path}${path.endsWith('/') ? '' : '/'}${utils.uid()}.${imgType.split('/')[1]}`; +}; + +export default { + // 上传图片 返回图片链接 + // { url: 'http://xxxx', error: 'xxxxxx'} + async updateImg(imgFile) { + // 操作图片上传 + const currStorage = store.getters['img/getCheckedStorage']; + if (!currStorage) { + return { error: '暂无已选择的图床!' }; + } + // 判断是否文档空间路径 + if (currStorage.type === 'workspace') { + // 如果不是git仓库 则提示不支持 + if (!store.getters['workspace/currentWorkspaceIsGit']) { + return { error: '暂无已选择的图床!' }; + } + const path = getImagePath(currStorage.sub, imgFile.type); + // 保存到indexeddb + const base64 = await utils.encodeFiletoBase64(imgFile); + const currDirNode = store.getters['explorer/selectedNodeFolder']; + const absolutePath = utils.getAbsoluteFilePath(currDirNode, path); + await localDbSvc.saveImg({ + id: md5(absolutePath), + path: absolutePath, + content: base64, + }); + return { url: path.replaceAll(' ', '%20') }; + } + if (!currStorage.provider) { + return { error: '暂无已选择的图床!' }; + } + const token = store.getters[`data/${currStorage.provider}TokensBySub`][currStorage.sub]; + if (!token) { + return { error: '暂无已选择的图床!' }; + } + let url = ''; + // token图床类型 + if (currStorage.type === 'token') { + const helper = currStorage.provider === 'smms' ? smmsHelper : customHelper; + url = await helper.uploadFile({ + token, + file: imgFile, + }); + } else if (currStorage.type === 'tokenRepo') { // git repo图床类型 + const checkStorages = token.imgStorages.filter(it => it.sid === currStorage.sid); + if (!checkStorages || checkStorages.length === 0) { + return { error: '暂无已选择的图床!' }; + } + const checkStorage = checkStorages[0]; + const path = getImagePath(checkStorage.path, imgFile.type); + if (currStorage.provider === 'gitea') { + const result = await giteaHelper.uploadFile({ + token, + projectId: checkStorage.repoUri, + branch: checkStorage.branch, + path, + content: imgFile, + isImg: true, + }); + url = result.content.download_url; + } else if (currStorage.provider === 'github') { + const result = await githubHelper.uploadFile({ + token, + owner: checkStorage.owner, + repo: checkStorage.repo, + branch: checkStorage.branch, + path, + content: imgFile, + isImg: true, + }); + url = result.content.download_url; + } + } + return { url }; + }, +}; diff --git a/src/services/localDbSvc.js b/src/services/localDbSvc.js new file mode 100644 index 0000000..11b4fc0 --- /dev/null +++ b/src/services/localDbSvc.js @@ -0,0 +1,510 @@ +import utils from './utils'; +import store from '../store'; +import welcomeFile from '../data/welcomeFile.md'; +import workspaceSvc from './workspaceSvc'; +import constants from '../data/constants'; + +const deleteMarkerMaxAge = 1000; +const dbVersion = 3; +const dbStoreName = 'objects'; +const imgDbStoreName = 'imgs'; +const imgWaitUploadIdsKey = 'waitUploadImgIds'; +const { silent } = utils.queryParams; +const resetApp = localStorage.getItem('resetStackEdit'); +if (resetApp) { + localStorage.removeItem('resetStackEdit'); +} + +class Connection { + constructor(workspaceId = store.getters['workspace/currentWorkspace'].id) { + this.getTxCbs = []; + + // Make the DB name + this.dbName = utils.getDbName(workspaceId); + + // Init connection + const request = indexedDB.open(this.dbName, dbVersion); + + request.onerror = () => { + throw new Error('无法连接到IndexedDB.'); + }; + + request.onsuccess = (event) => { + this.db = event.target.result; + this.db.onversionchange = () => window.location.reload(); + + this.getTxCbs.forEach(({ onTx, onError }) => this.createTx(onTx, onError)); + this.getTxCbs = null; + }; + + request.onupgradeneeded = (event) => { + const eventDb = event.target.result; + // const oldVersion = event.oldVersion || 0; + if (!eventDb.objectStoreNames.contains(dbStoreName)) { + // Create store + const dbStore = eventDb.createObjectStore(dbStoreName, { + keyPath: 'id', + }); + dbStore.createIndex('tx', 'tx', { + unique: false, + }); + } + if (!eventDb.objectStoreNames.contains(imgDbStoreName)) { + eventDb.createObjectStore(imgDbStoreName, { + keyPath: 'id', + }); + } + }; + } + + /** + * Create a transaction asynchronously. + */ + createTx(onTx, onError) { + // If DB is not ready, keep callbacks for later + if (!this.db) { + return this.getTxCbs.push({ onTx, onError }); + } + + // Open transaction in read/write will prevent conflict with other tabs + const tx = this.db.transaction(this.db.objectStoreNames, 'readwrite'); + tx.onerror = onError; + + return onTx(tx); + } +} + +const contentTypes = { + content: true, + contentState: true, + syncedContent: true, +}; + +const hashMap = {}; +constants.types.forEach((type) => { + hashMap[type] = Object.create(null); +}); +const lsHashMap = Object.create(null); + +const localDbSvc = { + lastTx: 0, + hashMap, + connection: null, + + /** + * Sync data items stored in the localStorage. + */ + syncLocalStorage() { + constants.localStorageDataIds.forEach((id) => { + const key = `data/${id}`; + + // Skip reloading the layoutSettings + if (id !== 'layoutSettings' || !lsHashMap[id]) { + try { + // Try to parse the item from the localStorage + const storedItem = JSON.parse(localStorage.getItem(key)); + if (storedItem.hash && lsHashMap[id] !== storedItem.hash) { + // Item has changed, replace it in the store + store.commit('data/setItem', storedItem); + lsHashMap[id] = storedItem.hash; + } + } catch (e) { + // Ignore parsing issue + } + } + + // Write item if different from stored one + const item = store.state.data.lsItemsById[id]; + if (item && item.hash !== lsHashMap[id]) { + localStorage.setItem(key, JSON.stringify(item)); + lsHashMap[id] = item.hash; + } + }); + }, + + /** + * Return a promise that will be resolved once the synchronization between the store and the + * localDb will be finished. Effectively, open a transaction, then read and apply all changes + * from the DB since the previous transaction, then write all the changes from the store. + */ + async sync() { + return new Promise((resolve, reject) => { + // Create the DB transaction + this.connection.createTx((tx) => { + const { lastTx } = this; + + // Look for DB changes and apply them to the store + this.readAll(tx, (storeItemMap) => { + // Sanitize the workspace if changes have been applied + if (lastTx !== this.lastTx) { + workspaceSvc.sanitizeWorkspace(); + } + + // Persist all the store changes into the DB + this.writeAll(storeItemMap, tx); + // Sync the localStorage + this.syncLocalStorage(); + // Done + resolve(); + }); + }, () => reject(new Error('Local DB access error.'))); + }); + }, + + /** + * Read and apply all changes from the DB since previous transaction. + */ + readAll(tx, cb) { + let { lastTx } = this; + const dbStore = tx.objectStore(dbStoreName); + const index = dbStore.index('tx'); + const range = IDBKeyRange.lowerBound(this.lastTx, true); + const changes = []; + index.openCursor(range).onsuccess = (event) => { + const cursor = event.target.result; + if (cursor) { + const item = cursor.value; + if (item.tx > lastTx) { + lastTx = item.tx; + if (this.lastTx && item.tx - this.lastTx > deleteMarkerMaxAge) { + // We may have missed some delete markers + window.location.reload(); + return; + } + } + // Collect change + changes.push(item); + cursor.continue(); + return; + } + + // Read the collected changes + const storeItemMap = { ...store.getters.allItemsById }; + changes.forEach((item) => { + this.readDbItem(item, storeItemMap); + // If item is an old delete marker, remove it from the DB + if (!item.hash && lastTx - item.tx > deleteMarkerMaxAge) { + dbStore.delete(item.id); + } + }); + + this.lastTx = lastTx; + cb(storeItemMap); + }; + }, + async saveImg(imgItem) { + await this.writeImgItem(imgItem); + const waitUploadIdsItem = (await this.getImgItem(imgWaitUploadIdsKey)) + || { id: imgWaitUploadIdsKey, ids: [] }; + const waitUplodIds = waitUploadIdsItem.ids || []; + // 如果已上传 + if (imgItem.uploaded) { + waitUplodIds.splice(waitUplodIds.indexOf(imgItem.id), 1); + } else { + waitUplodIds.push(imgItem.id); + } + waitUploadIdsItem.ids = waitUplodIds; + await this.writeImgItem(waitUploadIdsItem); + }, + // 获取待上传的图片id + async getWaitUploadImgIds() { + const waitUploadIdsItem = (await this.getImgItem(imgWaitUploadIdsKey)) + || { id: imgWaitUploadIdsKey, ids: [] }; + return waitUploadIdsItem.ids || []; + }, + /** + * 写入图片 + */ + async writeImgItem(imgItem) { + return new Promise((resolve, reject) => { + // Create the DB transaction + this.connection.createTx((tx) => { + const dbStore = tx.objectStore(imgDbStoreName); + dbStore.put(imgItem); + resolve(); + }, () => reject(new Error('保存图片异常'))); + }); + }, + /** + * 读取图片 + */ + async getImgItem(id) { + return new Promise((resolve, reject) => { + // Get the item from DB + this.connection.createTx((tx) => { + const dbStore = tx.objectStore(imgDbStoreName); + const request = dbStore.get(id); + request.onsuccess = () => { + const dbItem = request.result; + resolve(dbItem); + }; + }, () => reject(new Error('indexeddb获取图片异常'))); + }); + }, + + /** + * Write all changes from the store since previous transaction. + */ + writeAll(storeItemMap, tx) { + if (silent) { + // Skip writing to DB in silent mode + return; + } + const dbStore = tx.objectStore(dbStoreName); + const incrementedTx = this.lastTx + 1; + + // Remove deleted store items + Object.keys(this.hashMap).forEach((type) => { + // Remove this type only if file is deleted + let checker = cb => id => !storeItemMap[id] && cb(id); + if (contentTypes[type]) { + // For content types, remove item only if file is deleted + checker = cb => (id) => { + if (!storeItemMap[id]) { + const [fileId] = id.split('/'); + if (!store.state.file.itemsById[fileId]) { + cb(id); + } + } + }; + } + Object.keys(this.hashMap[type]).forEach(checker((id) => { + // Put a delete marker to notify other tabs + dbStore.put({ + id, + type, + tx: incrementedTx, + }); + delete this.hashMap[type][id]; + this.lastTx = incrementedTx; + })); + }); + + // Put changes + Object.entries(storeItemMap).forEach(([, storeItem]) => { + // Store object has changed + if (this.hashMap[storeItem.type][storeItem.id] !== storeItem.hash) { + const item = { + ...storeItem, + tx: incrementedTx, + }; + dbStore.put(item); + this.hashMap[item.type][item.id] = item.hash; + this.lastTx = incrementedTx; + } + }); + }, + + /** + * Read and apply one DB change. + */ + readDbItem(dbItem, storeItemMap) { + const storeItem = storeItemMap[dbItem.id]; + if (!dbItem.hash) { + // DB item is a delete marker + delete this.hashMap[dbItem.type][dbItem.id]; + if (storeItem) { + // Remove item from the store + store.commit(`${storeItem.type}/deleteItem`, storeItem.id); + delete storeItemMap[storeItem.id]; + } + } else if (this.hashMap[dbItem.type][dbItem.id] !== dbItem.hash) { + // DB item is different from the corresponding store item + this.hashMap[dbItem.type][dbItem.id] = dbItem.hash; + // Update content only if it exists in the store + if (storeItem || !contentTypes[dbItem.type]) { + // Put item in the store + dbItem.tx = undefined; + store.commit(`${dbItem.type}/setItem`, dbItem); + storeItemMap[dbItem.id] = dbItem; + } + } + }, + + /** + * Retrieve an item from the DB and put it in the store. + */ + async loadItem(id) { + // Check if item is in the store + const itemInStore = store.getters.allItemsById[id]; + if (itemInStore) { + // Use deepCopy to freeze item + return Promise.resolve(itemInStore); + } + return new Promise((resolve, reject) => { + // Get the item from DB + const onError = () => reject(new Error('Data not available.')); + this.connection.createTx((tx) => { + const dbStore = tx.objectStore(dbStoreName); + const request = dbStore.get(id); + request.onsuccess = () => { + const dbItem = request.result; + if (!dbItem || !dbItem.hash) { + onError(); + } else { + this.hashMap[dbItem.type][dbItem.id] = dbItem.hash; + // Put item in the store + dbItem.tx = undefined; + store.commit(`${dbItem.type}/setItem`, dbItem); + resolve(dbItem); + } + }; + }, () => onError()); + }); + }, + + /** + * Unload from the store contents that haven't been opened recently + */ + async unloadContents() { + await this.sync(); + // Keep only last opened files in memory + const lastOpenedFileIdSet = new Set(store.getters['data/lastOpenedIds']); + Object.keys(contentTypes).forEach((type) => { + store.getters[`${type}/items`].forEach((item) => { + const [fileId] = item.id.split('/'); + if (!lastOpenedFileIdSet.has(fileId)) { + // Remove item from the store + store.commit(`${type}/deleteItem`, item.id); + } + }); + }); + }, + + /** + * Create the connection and start syncing. + */ + async init() { + // Reset the app if the reset flag was passed + if (resetApp) { + await Promise.all(Object.keys(store.getters['workspace/workspacesById']) + .map(workspaceId => workspaceSvc.removeWorkspace(workspaceId))); + constants.localStorageDataIds.forEach((id) => { + // Clean data stored in localStorage + localStorage.removeItem(`data/${id}`); + }); + throw new Error('RELOAD'); + } + + // Create the connection + this.connection = new Connection(); + + // Load the DB + await localDbSvc.sync(); + + // Watch workspace deletions and persist them as soon as possible + // to make the changes available to reloading workspace tabs. + store.watch( + () => store.getters['data/workspaces'], + () => this.syncLocalStorage(), + ); + + // Save welcome file content hash if not done already + const hash = utils.hash(welcomeFile); + const { welcomeFileHashes } = store.getters['data/localSettings']; + if (!welcomeFileHashes[hash]) { + store.dispatch('data/patchLocalSettings', { + welcomeFileHashes: { + ...welcomeFileHashes, + [hash]: 1, + }, + }); + } + + // If app was last opened 7 days ago and synchronization is off + if (!store.getters['workspace/syncToken'] && + (store.state.workspace.lastFocus + constants.cleanTrashAfter < Date.now()) + ) { + // Clean files + store.getters['file/items'] + .filter(file => file.parentId === 'trash') // If file is in the trash + .forEach(file => workspaceSvc.deleteFile(file.id)); + } + + // Sync local DB periodically + utils.setInterval(() => localDbSvc.sync(), 1000); + + // watch current file changing + store.watch( + () => store.getters['file/current'].id, + async () => { + // See if currentFile is real, ie it has an ID + const currentFile = store.getters['file/current']; + // If current file has no ID, get the most recent file + if (!currentFile.id) { + const recentFile = store.getters['file/lastOpened']; + // Set it as the current file + if (recentFile.id) { + store.commit('file/setCurrentId', recentFile.id); + } else { + // If still no ID, create a new file + const newFile = await workspaceSvc.createFile({ + name: 'Welcome file', + text: welcomeFile, + }, true); + // Set it as the current file + store.commit('file/setCurrentId', newFile.id); + } + } else { + try { + // Load contentState from DB + await localDbSvc.loadContentState(currentFile.id); + // Load syncedContent from DB + await localDbSvc.loadSyncedContent(currentFile.id); + // Load content from DB + try { + await localDbSvc.loadItem(`${currentFile.id}/content`); + } catch (err) { + // Failure (content is not available), go back to previous file + const lastOpenedFile = store.getters['file/lastOpened']; + store.commit('file/setCurrentId', lastOpenedFile.id); + throw err; + } + // Set last opened file + store.dispatch('data/setLastOpenedId', currentFile.id); + // Cancel new discussion and open the gutter if file contains discussions + store.commit( + 'discussion/setCurrentDiscussionId', + store.getters['discussion/nextDiscussionId'], + ); + } catch (err) { + console.error(err); // eslint-disable-line no-console + store.dispatch('notification/error', err); + } + } + }, + { immediate: true }, + ); + }, + + getWorkspaceItems(workspaceId, onItem, onFinish = () => {}) { + const connection = new Connection(workspaceId); + connection.createTx((tx) => { + const dbStore = tx.objectStore(dbStoreName); + const index = dbStore.index('tx'); + index.openCursor().onsuccess = (event) => { + const cursor = event.target.result; + if (cursor) { + onItem(cursor.value); + cursor.continue(); + } else { + connection.db.close(); + onFinish(); + } + }; + }); + + // Return a cancel function + return () => connection.db.close(); + }, +}; + +const loader = type => fileId => localDbSvc.loadItem(`${fileId}/${type}`) + // Item does not exist, create it + .catch(() => store.commit(`${type}/setItem`, { + id: `${fileId}/${type}`, + })); +localDbSvc.loadSyncedContent = loader('syncedContent'); +localDbSvc.loadContentState = loader('contentState'); + +export default localDbSvc; diff --git a/src/services/markdownConversionSvc.js b/src/services/markdownConversionSvc.js new file mode 100644 index 0000000..77fb8a7 --- /dev/null +++ b/src/services/markdownConversionSvc.js @@ -0,0 +1,273 @@ +import DiffMatchPatch from 'diff-match-patch'; +import Prism from 'prismjs'; +import MarkdownIt from 'markdown-it'; +import markdownGrammarSvc from './markdownGrammarSvc'; +import extensionSvc from './extensionSvc'; +import utils from './utils'; + +const htmlSectionMarker = '\uF111\uF222\uF333\uF444'; +const diffMatchPatch = new DiffMatchPatch(); + +// Create aliases for syntax highlighting +const languageAliases = ({ + js: 'javascript', + json: 'javascript', + html: 'markup', + svg: 'markup', + xml: 'markup', + py: 'python', + rb: 'ruby', + yml: 'yaml', + ps1: 'powershell', + psm1: 'powershell', +}); +Object.entries(languageAliases).forEach(([alias, language]) => { + Prism.languages[alias] = Prism.languages[language]; +}); + +// Add programming language parsing capability to markdown fences +const insideFences = {}; +Object.entries(Prism.languages).forEach(([name, language]) => { + if (Prism.util.type(language) === 'Object') { + insideFences[`language-${name}`] = { + pattern: new RegExp(`(\`\`\`|~~~)${name}\\W[\\s\\S]*`), + inside: { + 'cl cl-pre': /(```|~~~).*/, + rest: language, + }, + }; + } +}); + +// Disable spell checking in specific tokens +const noSpellcheckTokens = Object.create(null); +[ + 'code', + 'pre', + 'pre gfm cn-code', + 'math block', + 'math inline', + 'math expr block', + 'math expr inline', + 'latex block', +] + .forEach((key) => { + noSpellcheckTokens[key] = true; + }); +Prism.hooks.add('wrap', (env) => { + if (noSpellcheckTokens[env.type]) { + env.attributes.spellcheck = 'false'; + } +}); + +function createFlagMap(arr) { + return arr.reduce((map, type) => ({ ...map, [type]: true }), {}); +} +const startSectionBlockTypeMap = createFlagMap([ + 'paragraph_open', + 'blockquote_open', + 'heading_open', + 'code', + 'fence', + 'table_open', + 'html_block', + 'bullet_list_open', + 'ordered_list_open', + 'hr', + 'dl_open', +]); +const listBlockTypeMap = createFlagMap([ + 'bullet_list_open', + 'ordered_list_open', +]); +const blockquoteBlockTypeMap = createFlagMap([ + 'blockquote_open', +]); +const tableBlockTypeMap = createFlagMap([ + 'table_open', +]); +const deflistBlockTypeMap = createFlagMap([ + 'dl_open', +]); + +function hashArray(arr, valueHash, valueArray) { + const hash = []; + arr.forEach((str) => { + let strHash = valueHash[str]; + if (strHash === undefined) { + strHash = valueArray.length; + valueArray.push(str); + valueHash[str] = strHash; + } + hash.push(strHash); + }); + return String.fromCharCode.apply(null, hash); +} + +export default { + defaultOptions: null, + defaultConverter: null, + defaultPrismGrammars: null, + + init() { + const defaultProperties = { extensions: utils.computedPresets.default }; + + // Default options for the markdown converter and the grammar + this.defaultOptions = { + ...extensionSvc.getOptions(defaultProperties), + insideFences, + }; + + this.defaultConverter = this.createConverter(this.defaultOptions); + this.defaultPrismGrammars = markdownGrammarSvc.makeGrammars(this.defaultOptions); + }, + + /** + * Creates a converter and init it with extensions. + * @returns {Object} A converter. + */ + createConverter(options) { + // Let the listeners add the rules + const converter = new MarkdownIt('zero'); + converter.core.ruler.enable([], true); + converter.block.ruler.enable([], true); + converter.inline.ruler.enable([], true); + extensionSvc.initConverter(converter, options); + Object.keys(startSectionBlockTypeMap).forEach((type) => { + const rule = converter.renderer.rules[type] || converter.renderer.renderToken; + converter.renderer.rules[type] = (tokens, idx, opts, env, self) => { + if (tokens[idx].sectionDelimiter) { + // Add section delimiter + return htmlSectionMarker + rule.call(converter.renderer, tokens, idx, opts, env, self); + } + return rule.call(converter.renderer, tokens, idx, opts, env, self); + }; + }); + return converter; + }, + + /** + * Parse markdown sections by passing the 2 first block rules of the markdown-it converter. + * @param {Object} converter The markdown-it converter. + * @param {String} text The text to be parsed. + * @returns {Object} A parsing context to be passed to `convert`. + */ + parseSections(converter, text) { + const markdownState = new converter.core.State(text, converter, {}); + const markdownCoreRules = converter.core.ruler.getRules(''); + markdownCoreRules[0](markdownState); // Pass the normalize rule + markdownCoreRules[1](markdownState); // Pass the block rule + const lines = text.split('\n'); + if (!lines[lines.length - 1]) { + // In cledit, last char is always '\n'. + // Remove it as one will be added by addSection + lines.pop(); + } + const parsingCtx = { + text, + sections: [], + converter, + markdownState, + markdownCoreRules, + }; + let data = 'main'; + let i = 0; + + function addSection(maxLine) { + const section = { + text: '', + data, + }; + for (; i < maxLine; i += 1) { + section.text += `${lines[i]}\n`; + } + if (section) { + parsingCtx.sections.push(section); + } + } + markdownState.tokens.forEach((token, index) => { + // index === 0 means there are empty lines at the begining of the file + if (token.level === 0 && startSectionBlockTypeMap[token.type] === true) { + if (index > 0) { + token.sectionDelimiter = true; + addSection(token.map[0]); + } + if (listBlockTypeMap[token.type] === true) { + data = 'list'; + } else if (blockquoteBlockTypeMap[token.type] === true) { + data = 'blockquote'; + } else if (tableBlockTypeMap[token.type] === true) { + data = 'table'; + } else if (deflistBlockTypeMap[token.type] === true) { + data = 'deflist'; + } else { + data = 'main'; + } + } + }); + addSection(lines.length); + return parsingCtx; + }, + + /** + * Convert markdown sections previously parsed with `parseSections`. + * @param {Object} parsingCtx The parsing context returned by `parseSections`. + * @param {Object} previousConversionCtx The conversion context returned by a previous call + * to `convert`, in order to calculate the `htmlSectionDiff` of the returned conversion context. + * @returns {Object} A conversion context. + */ + convert(parsingCtx, previousConversionCtx) { + // This function can be called twice without editor modification + // so prevent from converting it again. + if (!parsingCtx.markdownState.isConverted) { + // Skip 2 first rules previously passed in parseSections + parsingCtx.markdownCoreRules.slice(2).forEach(rule => rule(parsingCtx.markdownState)); + parsingCtx.markdownState.isConverted = true; + } + const { tokens } = parsingCtx.markdownState; + const html = parsingCtx.converter.renderer.render( + tokens, + parsingCtx.converter.options, + parsingCtx.markdownState.env, + ); + const htmlSectionList = html.split(htmlSectionMarker); + if (htmlSectionList[0] === '') { + htmlSectionList.shift(); + } + const valueHash = Object.create(null); + const valueArray = []; + const newSectionHash = hashArray(htmlSectionList, valueHash, valueArray); + let htmlSectionDiff; + if (previousConversionCtx) { + const oldSectionHash = hashArray( + previousConversionCtx.htmlSectionList, + valueHash, + valueArray, + ); + htmlSectionDiff = diffMatchPatch.diff_main(oldSectionHash, newSectionHash, false); + } else { + htmlSectionDiff = [ + [1, newSectionHash], + ]; + } + return { + text: parsingCtx.text, + sectionList: parsingCtx.sectionList, + htmlSectionList, + htmlSectionDiff, + }; + }, + + /** + * Helper to highlight arbitrary markdown + * @param {Object} markdown The markdown content to highlight. + * @param {Object} converter An optional converter. + * @param {Object} grammars Optional grammars. + * @returns {Object} The highlighted markdown in HTML format. + */ + highlight(markdown, converter = this.defaultConverter, grammars = this.defaultPrismGrammars) { + const parsingCtx = this.parseSections(converter, markdown); + return parsingCtx.sections + .map(section => Prism.highlight(section.text, grammars[section.data])).join(''); + }, +}; diff --git a/src/services/markdownGrammarSvc.js b/src/services/markdownGrammarSvc.js new file mode 100644 index 0000000..54677f8 --- /dev/null +++ b/src/services/markdownGrammarSvc.js @@ -0,0 +1,435 @@ +const charInsideUrl = '(&|[-A-Z0-9+@#/%?=~_|[\\]()!:,.;])'; +const charEndingUrl = '(&|[-A-Z0-9+@#/%=~_|[\\])])'; +const urlPattern = new RegExp(`(https?|ftp)(://${charInsideUrl}*${charEndingUrl})(?=$|\\W)`, 'gi'); +const emailPattern = /(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)/gi; + +const markup = { + comment: //g, + tag: { + pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi, + inside: { + tag: { + pattern: /^<\/?[\w:-]+/i, + inside: { + punctuation: /^<\/?/, + namespace: /^[\w-]+?:/, + }, + }, + 'attr-value': { + pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi, + inside: { + punctuation: /=|>|"/g, + }, + }, + punctuation: /\/?>/g, + 'attr-name': { + pattern: /[\w:-]+/g, + inside: { + namespace: /^[\w-]+?:/, + }, + }, + }, + }, + entity: /&#?[\da-z]{1,8};/gi, +}; + +const latex = { + // A tex command e.g. \foo + keyword: /\\(?:[^a-zA-Z]|[a-zA-Z]+)/g, + // Curly and square braces + lparen: /[[({]/g, + // Curly and square braces + rparen: /[\])}]/g, + // A comment. Tex comments start with % and go to + // the end of the line + comment: /%.*/g, +}; + +export default { + makeGrammars(options) { + const grammars = { + main: {}, + list: {}, + blockquote: {}, + table: {}, + deflist: {}, + }; + + grammars.deflist.deflist = { + pattern: new RegExp( + [ + '^ {0,3}\\S.*\\n', // Description line + '(?:[ \\t]*\\n)?', // Optional empty line + '(?:', + '[ \\t]*:[ \\t].*\\n', // Colon line + '(?:', + '(?:', + '.*\\S.*\\n', // Non-empty line + '|', + '[ \\t]*\\n(?! ?\\S)', // Or empty line not followed by unindented line + ')', + ')*', + '(?:[ \\t]*\\n)*', // Empty lines + ')+', + ].join(''), + 'm', + ), + inside: { + term: /^.+/, + cl: /^[ \t]*:[ \t]/gm, + }, + }; + + const insideFences = options.insideFences || {}; + insideFences['cl cl-pre'] = /```|~~~/; + if (options.fence) { + grammars.main['pre gfm cn-code'] = { + pattern: /^(```|~~~)[\s\S]*?\n\1 *$/gm, + inside: insideFences, + }; + grammars.list['pre gfm cn-code'] = { + pattern: /^(?: {4}|\t)(```|~~~)[\s\S]*?\n(?: {4}|\t)\1\s*$/gm, + inside: insideFences, + }; + grammars.deflist.deflist.inside['pre gfm cn-code'] = grammars.list['pre gfm cn-code']; + } + + grammars.main['h1 alt cn-head'] = { + pattern: /^.+\n[=]{2,}[ \t]*$/gm, + inside: { + 'cl cl-hash': /=+[ \t]*$/, + }, + }; + grammars.main['h2 alt cn-head'] = { + pattern: /^.+\n[-]{2,}[ \t]*$/gm, + inside: { + 'cl cl-hash': /-+[ \t]*$/, + }, + }; + grammars.main['cn-toc'] = { + pattern: /^\[(TOC|toc)\]$/gm, + }; + for (let i = 6; i >= 1; i -= 1) { + grammars.main[`h${i} cn-head`] = { + pattern: new RegExp(`^#{${i}}[ \t].+$`, 'gm'), + inside: { + 'cl cl-hash': new RegExp(`^#{${i}}`), + }, + }; + } + + const list = /^[ \t]*([*+-]|\d+\.)[ \t]/gm; + const blockquote = { + pattern: /^\s*>.*(?:\n[ \t]*\S.*)*/gm, + inside: { + 'cl cl-gt': /^\s*>/gm, + 'cl cl-li': list, + }, + }; + grammars.list.blockquote = blockquote; + grammars.blockquote.blockquote = blockquote; + grammars.deflist.deflist.inside.blockquote = blockquote; + grammars.list['cl cl-li'] = list; + grammars.blockquote['cl cl-li'] = list; + grammars.deflist.deflist.inside['cl cl-li'] = list; + + grammars.table.table = { + pattern: new RegExp( + [ + '^\\s*\\S.*[|].*\\n', // Header Row + '[-| :]+\\n', // Separator + '(?:.*[|].*\\n?)*', // Table rows + '$', + ].join(''), + 'gm', + ), + inside: { + 'cl cl-title-separator': /^[-| :]+$/gm, + 'cl cl-pipe': /[|]/gm, + }, + }; + + grammars.main.hr = { + pattern: /^ {0,3}([*\-_] *){3,}$/gm, + }; + + if (options.tasklist) { + grammars.list.task = { + pattern: /^\[[ xX]\] /, + inside: { + cl: /[[\]]/, + strong: /[xX]/, + }, + }; + } + + const defs = {}; + if (options.footnote) { + defs.fndef = { + pattern: /^ {0,3}\[\^.*?\]:.*$/gm, + inside: { + 'ref-id': { + pattern: /^ {0,3}\[\^.*?\]/, + inside: { + cl: /(\[\^|\])/, + }, + }, + }, + }; + } + if (options.abbr) { + defs.abbrdef = { + pattern: /^ {0,3}\*\[.*?\]:.*$/gm, + inside: { + 'abbr-id': { + pattern: /^ {0,3}\*\[.*?\]/, + inside: { + cl: /(\*\[|\])/, + }, + }, + }, + }; + } + defs.linkdef = { + pattern: /^ {0,3}\[.*?\]:.*$/gm, + inside: { + 'link-id': { + pattern: /^ {0,3}\[.*?\]/, + inside: { + cl: /[[\]]/, + }, + }, + url: urlPattern, + }, + }; + + Object.entries(defs).forEach(([name, def]) => { + grammars.main[name] = def; + grammars.list[name] = def; + grammars.blockquote[name] = def; + grammars.table[name] = def; + grammars.deflist[name] = def; + }); + + grammars.main.pre = { + pattern: /^\s*\n(?: {4}|\t).*\S.*\n((?: {4}|\t).*\n)*/gm, + }; + + const rest = {}; + rest['code cn-code'] = { + pattern: /(`+)[\s\S]*?\1/g, + inside: { + 'cl cl-code': /`/, + }, + }; + if (options.math) { + rest['math block'] = { + pattern: /\\\\\[[\s\S]*?\\\\\]/g, + inside: { + 'cl cl-bracket-start': /^\\\\\[/, + 'cl cl-bracket-end': /\\\\\]$/, + rest: latex, + }, + }; + rest['math inline'] = { + pattern: /\\\\\([\s\S]*?\\\\\)/g, + inside: { + 'cl cl-bracket-start': /^\\\\\(/, + 'cl cl-bracket-end': /\\\\\)$/, + rest: latex, + }, + }; + rest['math expr block'] = { + pattern: /(\$\$)[\s\S]*?\1/g, + inside: { + 'cl cl-bracket-start': /^\$\$/, + 'cl cl-bracket-end': /\$\$$/, + rest: latex, + }, + }; + rest['math expr inline'] = { + pattern: /\$(?!\s)[\s\S]*?\S\$(?!\d)/g, + inside: { + 'cl cl-bracket-start': /^\$/, + 'cl cl-bracket-end': /\$$/, + rest: latex, + }, + }; + } + if (options.footnote) { + rest.inlinefn = { + pattern: /\^\[.+?\]/g, + inside: { + cl: /(\^\[|\])/, + }, + }; + rest.fn = { + pattern: /\[\^.+?\]/g, + inside: { + cl: /(\[\^|\])/, + }, + }; + } + rest.img = { + pattern: /!\[.*?\]\(.+?\)/g, + inside: { + 'cl cl-title': /['‘][^'’]*['’]|["“][^"”]*["”](?=\)$)/, + 'cl cl-src': { + pattern: /(\]\()[^('" \t]+(?=[)'" \t])/, + lookbehind: true, + }, + }, + }; + if (options.imgsize) { + rest.img.inside['cl cl-size'] = /=\d*x\d*/; + } + rest.link = { + pattern: /\[.*?\]\(.+?\)/gm, + inside: { + 'cl cl-underlined-text': { + pattern: /(\[)[^\]]*/, + lookbehind: true, + }, + 'cl cl-title': /['‘][^'’]*['’]|["“][^"”]*["”](?=\)$)/, + }, + }; + rest.imgref = { + pattern: /!\[.*?\][ \t]*\[.*?\]/g, + }; + rest.linkref = { + pattern: /\[.*?\][ \t]*\[.*?\]/g, + inside: { + 'cl cl-underlined-text': { + pattern: /^(\[)[^\]]*(?=\][ \t]*\[)/, + lookbehind: true, + }, + }, + }; + rest.comment = markup.comment; + rest.tag = markup.tag; + rest.url = urlPattern; + rest.email = emailPattern; + rest['strong cn-strong'] = { + pattern: /(^|[^.*])(__|\*\*)(?![_*])[\s\S]*?\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + 'cl cl-strong cl-start': /^(__|\*\*)/, + 'cl cl-strong cl-close': /(__|\*\*)$/, + }, + }; + rest.em = { + pattern: /(^|[^.*])(_|\*)(?![_*])[\s\S]*?\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + 'cl cl-em cl-start': /^(_|\*)/, + 'cl cl-em cl-close': /(_|\*)$/, + }, + }; + rest['strong em'] = { + pattern: /(^|[^.*])(__|\*\*)(_|\*)(?![_*])[\s\S]*?\3\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + 'cl cl-strong cl-start': /^(__|\*\*)(_|\*)/, + 'cl cl-strong cl-close': /(_|\*)(__|\*\*)$/, + }, + }; + rest['strong em inv'] = { + pattern: /(^|[^.*])(_|\*)(__|\*\*)(?![_*])[\s\S]*?\3\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + 'cl cl-strong cl-start': /^(_|\*)(__|\*\*)/, + 'cl cl-strong cl-close': /(__|\*\*)(_|\*)$/, + }, + }; + if (options.del) { + rest.del = { + pattern: /(^|[^.*])(~~)[\s\S]*?\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + cl: /~~/, + 'cl-del-text': /[^~]+/, + }, + }; + } + if (options.mark) { + rest.mark = { + pattern: /(^|[^.*])(==)[\s\S]*?\2(?=([^.*]|$))/gm, + lookbehind: true, + inside: { + cl: /==/, + 'cl-mark-text': /[^=]+/, + }, + }; + } + if (options.sub) { + rest.sub = { + pattern: /(~)(?=\S)(.*?\S)\1/gm, + inside: { + cl: /~/, + }, + }; + } + if (options.sup) { + rest.sup = { + pattern: /(\^)(?=\S)(.*?\S)\1/gm, + inside: { + cl: /\^/, + }, + }; + } + rest.entity = markup.entity; + + for (let c = 6; c >= 1; c -= 1) { + grammars.main[`h${c} cn-head`].inside.rest = rest; + } + grammars.main['h1 alt cn-head'].inside.rest = rest; + grammars.main['h2 alt cn-head'].inside.rest = rest; + grammars.table.table.inside.rest = rest; + grammars.main.rest = rest; + grammars.list.rest = rest; + grammars.blockquote.blockquote.inside.rest = rest; + grammars.deflist.deflist.inside.rest = rest; + if (options.footnote) { + grammars.main.fndef.inside.rest = rest; + } + + const restLight = { + code: rest['code cn-code'], + inlinefn: rest.inlinefn, + fn: rest.fn, + link: rest.link, + linkref: rest.linkref, + }; + rest['strong cn-strong'].inside.rest = restLight; + rest.em.inside.rest = restLight; + if (options.del) { + rest.del.inside.rest = restLight; + } + if (options.mark) { + rest.mark.inside.rest = restLight; + } + + const inside = { + code: rest['code cn-code'], + comment: rest.comment, + tag: rest.tag, + // strong: rest.strong, + strong: rest['strong cn-strong'], + em: rest.em, + del: rest.del, + sub: rest.sub, + sup: rest.sup, + entity: markup.entity, + }; + rest.link.inside['cl cl-underlined-text'].inside = inside; + rest.linkref.inside['cl cl-underlined-text'].inside = inside; + + // Wrap any other characters to allow paragraph folding + Object.entries(grammars).forEach(([, grammar]) => { + grammar.rest = grammar.rest || {}; + grammar.rest.p = /.+/; + }); + + return grammars; + }, +}; diff --git a/src/services/networkSvc.js b/src/services/networkSvc.js new file mode 100644 index 0000000..5fd52f6 --- /dev/null +++ b/src/services/networkSvc.js @@ -0,0 +1,342 @@ +import utils from './utils'; +import store from '../store'; +import constants from '../data/constants'; + +const scriptLoadingPromises = Object.create(null); +const authorizeTimeout = 6 * 60 * 1000; // 2 minutes +const silentAuthorizeTimeout = 15 * 1000; // 15 secondes (which will be reattempted) +const networkTimeout = 30 * 1000; // 30 sec +let isConnectionDown = false; +const userInactiveAfter = 3 * 60 * 1000; // 3 minutes (twice the default sync period) +let lastActivity = 0; +let lastFocus = 0; +let isConfLoading = false; +let isConfLoaded = false; + +function parseHeaders(xhr) { + const pairs = xhr.getAllResponseHeaders().trim().split('\n'); + const headers = {}; + pairs.forEach((header) => { + const split = header.trim().split(':'); + const key = split.shift().trim().toLowerCase(); + const value = split.join(':').trim(); + headers[key] = value; + }); + return headers; +} + +function isRetriable(err) { + if (err.status === 403) { + const googleReason = ((((err.body || {}).error || {}).errors || [])[0] || {}).reason; + return googleReason === 'rateLimitExceeded' || googleReason === 'userRateLimitExceeded'; + } + return err.status === 429 || (err.status >= 500 && err.status < 600); +} + +export default { + async init() { + // Keep track of the last user activity + const setLastActivity = () => { + lastActivity = Date.now(); + }; + window.document.addEventListener('mousedown', setLastActivity); + window.document.addEventListener('keydown', setLastActivity); + window.document.addEventListener('touchstart', setLastActivity); + + // Keep track of the last window focus + lastFocus = 0; + const setLastFocus = () => { + lastFocus = Date.now(); + localStorage.setItem(store.getters['workspace/lastFocusKey'], lastFocus); + setLastActivity(); + }; + if (document.hasFocus()) { + setLastFocus(); + } + window.addEventListener('focus', setLastFocus); + + // Check that browser is online periodically + const checkOffline = async () => { + const isBrowserOffline = window.navigator.onLine === false; + if (!isBrowserOffline + && store.state.lastOfflineCheck + networkTimeout + 5000 < Date.now() + && this.isUserActive() + ) { + store.commit('updateLastOfflineCheck'); + const script = document.createElement('script'); + let timeout; + try { + await new Promise((resolve, reject) => { + script.onload = resolve; + script.onerror = reject; + script.src = `https://res.wx.qq.com/open/js/jweixin-1.2.0.js?${Date.now()}`; + try { + document.head.appendChild(script); // This can fail with bad network + timeout = setTimeout(reject, networkTimeout); + } catch (e) { + reject(e); + } + }); + isConnectionDown = false; + } catch (e) { + isConnectionDown = true; + } finally { + clearTimeout(timeout); + document.head.removeChild(script); + } + } + const offline = isBrowserOffline || isConnectionDown; + if (store.state.offline !== offline) { + store.commit('setOffline', offline); + if (offline) { + store.dispatch('notification/error', '已离线!'); + } else { + store.dispatch('notification/info', '恢复上线了!'); + this.getServerConf(); + } + } + }; + + utils.setInterval(checkOffline, 1000); + window.addEventListener('online', () => { + isConnectionDown = false; + checkOffline(); + }); + window.addEventListener('offline', checkOffline); + await checkOffline(); + this.getServerConf(); + }, + async getServerConf() { + if (!store.state.offline && !isConfLoading && !isConfLoaded) { + try { + isConfLoading = true; + const res = await this.request({ url: 'conf' }); + await store.dispatch('data/setServerConf', res.body); + isConfLoaded = true; + } finally { + isConfLoading = false; + } + } + }, + isWindowFocused() { + // We don't use state.workspace.lastFocus as it's not reactive + const storedLastFocus = localStorage.getItem(store.getters['workspace/lastFocusKey']); + return parseInt(storedLastFocus, 10) === lastFocus; + }, + isUserActive() { + return lastActivity > Date.now() - userInactiveAfter && this.isWindowFocused(); + }, + isConfLoaded() { + return !!Object.keys(store.getters['data/serverConf']).length; + }, + async loadScript(url) { + if (!scriptLoadingPromises[url]) { + scriptLoadingPromises[url] = new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.onload = resolve; + script.onerror = () => { + scriptLoadingPromises[url] = null; + reject(); + }; + script.src = url; + document.head.appendChild(script); + }); + } + return scriptLoadingPromises[url]; + }, + async startOauth2(url, params = {}, silent = false, reattempt = false) { + try { + // Build the authorize URL + const state = utils.uid(); + const authorizeUrl = utils.addQueryParams(url, { + ...params, + state, + redirect_uri: constants.oauth2RedirectUri, + }); + + let iframeElt; + let wnd; + if (silent) { + // Use an iframe as wnd for silent mode + iframeElt = utils.createHiddenIframe(authorizeUrl); + document.body.appendChild(iframeElt); + wnd = iframeElt.contentWindow; + } else { + // Open a tab otherwise + wnd = window.open(authorizeUrl); + if (!wnd) { + throw new Error('The authorize window was blocked.'); + } + } + + let checkClosedInterval; + let closeTimeout; + let msgHandler; + try { + return await new Promise((resolve, reject) => { + if (silent) { + iframeElt.onerror = () => { + reject(new Error('Unknown error.')); + }; + closeTimeout = setTimeout(() => { + if (!reattempt) { + reject(new Error('REATTEMPT')); + } else { + isConnectionDown = true; + store.commit('setOffline', true); + store.commit('updateLastOfflineCheck'); + reject(new Error('You are offline.')); + } + }, silentAuthorizeTimeout); + } else { + closeTimeout = setTimeout(() => { + reject(new Error('Timeout.')); + }, authorizeTimeout); + } + + msgHandler = (event) => { + if (event.source === wnd && event.origin === constants.origin) { + const data = utils.parseQueryParams(`${event.data}`.slice(1)); + if (data.error || data.state !== state) { + console.error(data); // eslint-disable-line no-console + reject(new Error('Could not get required authorization.')); + } else { + resolve({ + accessToken: data.access_token, + code: data.code, + idToken: data.id_token, + expiresIn: data.expires_in, + }); + } + } + }; + + window.addEventListener('message', msgHandler); + if (!silent) { + checkClosedInterval = setInterval(() => { + if (wnd.closed) { + reject(new Error('Authorize window was closed.')); + } + }, 250); + } + }); + } finally { + clearInterval(checkClosedInterval); + if (!silent && !wnd.closed) { + wnd.close(); + } + if (iframeElt) { + document.body.removeChild(iframeElt); + } + clearTimeout(closeTimeout); + window.removeEventListener('message', msgHandler); + } + } catch (e) { + if (e.message === 'REATTEMPT') { + return this.startOauth2(url, params, silent, true); + } + throw e; + } + }, + async request(config, offlineCheck = false) { + let retryAfter = 500; // 500 ms + const maxRetryAfter = 10 * 1000; // 10 sec + const sanitizedConfig = Object.assign({}, config); + sanitizedConfig.timeout = sanitizedConfig.timeout || networkTimeout; + sanitizedConfig.headers = Object.assign({}, sanitizedConfig.headers); + if (sanitizedConfig.body && typeof sanitizedConfig.body === 'object') { + sanitizedConfig.body = JSON.stringify(sanitizedConfig.body); + sanitizedConfig.headers['Content-Type'] = 'application/json'; + } else if (sanitizedConfig.formData) { + const data = new FormData(); + Object.keys(sanitizedConfig.formData).forEach((key) => { + const formVal = sanitizedConfig.formData[key]; + data.append(key, formVal); + }); + sanitizedConfig.formData = data; + } + const attempt = async () => { + try { + return await new Promise((resolve, reject) => { + if (offlineCheck) { + store.commit('updateLastOfflineCheck'); + } + + const xhr = new window.XMLHttpRequest(); + xhr.withCredentials = sanitizedConfig.withCredentials || false; + + const timeoutId = setTimeout(() => { + xhr.abort(); + if (offlineCheck) { + isConnectionDown = true; + store.commit('setOffline', true); + reject(new Error('You are offline.')); + } else { + reject(new Error('Network request timeout.')); + } + }, sanitizedConfig.timeout); + + xhr.onload = () => { + if (offlineCheck) { + isConnectionDown = false; + } + clearTimeout(timeoutId); + const result = { + status: xhr.status, + headers: parseHeaders(xhr), + body: sanitizedConfig.blob ? xhr.response : xhr.responseText, + }; + if (!sanitizedConfig.raw && !sanitizedConfig.blob) { + try { + result.body = JSON.parse(result.body); + } catch (e) { + // ignore + } + } + if (result.status >= 200 && result.status < 300) { + resolve(result); + } else { + reject(result); + } + }; + + xhr.onerror = () => { + clearTimeout(timeoutId); + if (offlineCheck) { + isConnectionDown = true; + store.commit('setOffline', true); + reject(new Error('You are offline.')); + } else { + reject(new Error('Network request failed.')); + } + }; + + const url = utils.addQueryParams(sanitizedConfig.url, sanitizedConfig.params); + xhr.open(sanitizedConfig.method || 'GET', url); + Object.entries(sanitizedConfig.headers).forEach(([key, value]) => { + if (value) { + xhr.setRequestHeader(key, `${value}`); + } + }); + if (sanitizedConfig.blob) { + xhr.responseType = 'blob'; + } + xhr.send(sanitizedConfig.body || sanitizedConfig.formData || null); + }); + } catch (err) { + // Try again later in case of retriable error + if (isRetriable(err) && retryAfter < maxRetryAfter) { + await new Promise((resolve) => { + setTimeout(resolve, retryAfter); + // Exponential backoff + retryAfter *= 2; + }); + return attempt(); + } + throw err; + } + }; + + return attempt(); + }, +}; diff --git a/src/services/optional/index.js b/src/services/optional/index.js new file mode 100644 index 0000000..e6efbb9 --- /dev/null +++ b/src/services/optional/index.js @@ -0,0 +1,4 @@ +import './shortcuts'; +import './keystrokes'; +import './scrollSync'; +import './taskChange'; diff --git a/src/services/optional/keystrokes.js b/src/services/optional/keystrokes.js new file mode 100644 index 0000000..0d347a4 --- /dev/null +++ b/src/services/optional/keystrokes.js @@ -0,0 +1,188 @@ +import cledit from '../editor/cledit'; +import editorSvc from '../editorSvc'; +import store from '../../store'; + +const { Keystroke } = cledit; +const indentRegexp = /^ {0,3}>[ ]*|^[ \t]*[*+-][ \t](?:\[[ xX]\][ \t])?|^([ \t]*)\d+\.[ \t](?:\[[ xX]\][ \t])?|^\s+/; +let clearNewline; +let lastSelection; + +function fixNumberedList(state, indent) { + if (state.selection + || indent === undefined + || !store.getters['data/computedSettings'].editor.listAutoNumber + ) { + return; + } + const spaceIndent = indent.replace(/\t/g, ' '); + const indentRegex = new RegExp(`^[ \\s]*$|^${spaceIndent}(\\d+\\.[ \\t])?(( )?.*)$`); + + function getHits(lines) { + let hits = []; + let pendingHits = []; + + function flush() { + if (!pendingHits.hasHit && pendingHits.hasNoIndent) { + return false; + } + hits = hits.concat(pendingHits); + pendingHits = []; + return true; + } + + lines.some((line) => { + const match = line.replace( + /^[ \t]*/, + wholeMatch => wholeMatch.replace(/\t/g, ' '), + ).match(indentRegex); + if (!match || line.match(/^#+ /)) { // Line not empty, not indented, or title + flush(); + return true; + } + pendingHits.push({ + line, + match, + }); + if (match[2] !== undefined) { + if (match[1]) { + pendingHits.hasHit = true; + } else if (!match[3]) { + pendingHits.hasNoIndent = true; + } + } else if (!flush()) { + return true; + } + return false; + }); + return hits; + } + + function formatHits(hits) { + let num; + return hits.map((hit) => { + if (hit.match[1]) { + if (!num) { + num = parseInt(hit.match[1], 10); + } + const result = indent + num + hit.match[1].slice(-2) + hit.match[2]; + num += 1; + return result; + } + return hit.line; + }); + } + + const before = state.before.split('\n'); + before.unshift(''); // Add an extra line (fixes #184) + const after = state.after.split('\n'); + let currentLine = before.pop() || ''; + const currentPos = currentLine.length; + currentLine += after.shift() || ''; + let lines = before.concat(currentLine).concat(after); + let idx = before.length - getHits(before.slice().reverse()).length; // Prevents starting from 0 + while (idx <= before.length + 1) { + const hits = formatHits(getHits(lines.slice(idx))); + if (!hits.length) { + idx += 1; + } else { + lines = lines.slice(0, idx).concat(hits).concat(lines.slice(idx + hits.length)); + idx += hits.length; + } + } + currentLine = lines[before.length]; + state.before = lines.slice(1, before.length); // As we've added an extra line + state.before.push(currentLine.slice(0, currentPos)); + state.before = state.before.join('\n'); + state.after = [currentLine.slice(currentPos)].concat(lines.slice(before.length + 1)); + state.after = state.after.join('\n'); +} + +function enterKeyHandler(evt, state) { + if (evt.which !== 13) { + // Not enter + clearNewline = false; + return false; + } + + evt.preventDefault(); + + // Get the last line before the selection + const lastLf = state.before.lastIndexOf('\n') + 1; + const lastLine = state.before.slice(lastLf); + // See if the line is indented + const indentMatch = lastLine.match(indentRegexp) || ['']; + if (clearNewline && !state.selection && state.before.length === lastSelection) { + state.before = state.before.substring(0, lastLf); + state.selection = ''; + clearNewline = false; + fixNumberedList(state, indentMatch[1]); + return true; + } + clearNewline = false; + const indent = indentMatch[0]; + if (indent.length) { + clearNewline = true; + } + + editorSvc.clEditor.undoMgr.setCurrentMode('single'); + + state.before += `\n${indent}`; + state.selection = ''; + lastSelection = state.before.length; + fixNumberedList(state, indentMatch[1]); + return true; +} + +function tabKeyHandler(evt, state) { + if (evt.which !== 9 || evt.metaKey || evt.ctrlKey) { + // Not tab + return false; + } + + const strSplice = (str, i, remove, add) => + str.slice(0, i) + (add || '') + str.slice(i + (+remove || 0)); + + evt.preventDefault(); + const isInverse = evt.shiftKey; + const lastLf = state.before.lastIndexOf('\n') + 1; + const lastLine = state.before.slice(lastLf); + const currentLine = lastLine + state.selection + state.after; + const indentMatch = currentLine.match(indentRegexp); + if (isInverse) { + const previousChar = state.before.slice(-1); + if (/\s/.test(state.before.charAt(lastLf))) { + state.before = strSplice(state.before, lastLf, 1); + if (indentMatch) { + fixNumberedList(state, indentMatch[1]); + if (indentMatch[1]) { + fixNumberedList(state, indentMatch[1].slice(1)); + } + } + } + const selection = previousChar + state.selection; + state.selection = selection.replace(/\n[ \t]/gm, '\n'); + if (previousChar) { + state.selection = state.selection.slice(1); + } + } else if ( + // If selection is not empty + state.selection + // Or we are in an indented paragraph and the cursor is over the indentation characters + || (indentMatch && indentMatch[0].length >= lastLine.length) + ) { + state.before = strSplice(state.before, lastLf, 0, '\t'); + state.selection = state.selection.replace(/\n(?=.)/g, '\n\t'); + if (indentMatch) { + fixNumberedList(state, indentMatch[1]); + fixNumberedList(state, `\t${indentMatch[1]}`); + } + } else { + state.before += '\t'; + } + return true; +} + +editorSvc.$on('inited', () => { + editorSvc.clEditor.addKeystroke(new Keystroke(enterKeyHandler, 50)); + editorSvc.clEditor.addKeystroke(new Keystroke(tabKeyHandler, 50)); +}); diff --git a/src/services/optional/scrollSync.js b/src/services/optional/scrollSync.js new file mode 100644 index 0000000..d997538 --- /dev/null +++ b/src/services/optional/scrollSync.js @@ -0,0 +1,180 @@ +import store from '../../store'; +import animationSvc from '../animationSvc'; +import editorSvc from '../editorSvc'; + +let editorScrollerElt; +let previewScrollerElt; +let editorFinishTimeoutId; +let previewFinishTimeoutId; +let skipAnimation; +let isScrollEditor; +let isScrollPreview; +let isEditorMoving; +let isPreviewMoving; +let sectionDescList = []; + +let throttleTimeoutId; +let throttleLastTime = 0; + +function throttle(func, wait) { + clearTimeout(throttleTimeoutId); + const currentTime = Date.now(); + const localWait = (wait + throttleLastTime) - currentTime; + if (localWait < 1) { + throttleLastTime = currentTime; + func(); + } else { + throttleTimeoutId = setTimeout(() => { + throttleLastTime = Date.now(); + func(); + }, localWait); + } +} + +const doScrollSync = () => { + const localSkipAnimation = skipAnimation || !store.getters['layout/styles'].showSidePreview; + skipAnimation = false; + if (!store.getters['data/layoutSettings'].scrollSync || sectionDescList.length === 0) { + return; + } + let editorScrollTop = editorScrollerElt.scrollTop; + if (editorScrollTop < 0) { + editorScrollTop = 0; + } + const previewScrollTop = previewScrollerElt.scrollTop; + let scrollTo; + if (isScrollEditor) { + // Scroll the preview + isScrollEditor = false; + sectionDescList.some((sectionDesc) => { + if (editorScrollTop > sectionDesc.editorDimension.endOffset) { + return false; + } + const posInSection = (editorScrollTop - sectionDesc.editorDimension.startOffset) + / (sectionDesc.editorDimension.height || 1); + scrollTo = (sectionDesc.previewDimension.startOffset + + (sectionDesc.previewDimension.height * posInSection)); + return true; + }); + scrollTo = Math.min( + scrollTo, + previewScrollerElt.scrollHeight - previewScrollerElt.offsetHeight, + ); + + throttle(() => { + clearTimeout(previewFinishTimeoutId); + animationSvc.animate(previewScrollerElt) + .scrollTop(scrollTo) + .duration(!localSkipAnimation && 100) + .start(() => { + previewFinishTimeoutId = setTimeout(() => { + isPreviewMoving = false; + }, 100); + }, () => { + isPreviewMoving = true; + }); + }, localSkipAnimation ? 500 : 50); + } else if (!store.getters['layout/styles'].showEditor || isScrollPreview) { + // Scroll the editor + isScrollPreview = false; + sectionDescList.some((sectionDesc) => { + if (previewScrollTop > sectionDesc.previewDimension.endOffset) { + return false; + } + const posInSection = (previewScrollTop - sectionDesc.previewDimension.startOffset) + / (sectionDesc.previewDimension.height || 1); + scrollTo = (sectionDesc.editorDimension.startOffset + + (sectionDesc.editorDimension.height * posInSection)); + return true; + }); + scrollTo = Math.min( + scrollTo, + editorScrollerElt.scrollHeight - editorScrollerElt.offsetHeight, + ); + + throttle(() => { + clearTimeout(editorFinishTimeoutId); + animationSvc.animate(editorScrollerElt) + .scrollTop(scrollTo) + .duration(!localSkipAnimation && 100) + .start(() => { + editorFinishTimeoutId = setTimeout(() => { + isEditorMoving = false; + }, 100); + }, () => { + isEditorMoving = true; + }); + }, localSkipAnimation ? 500 : 50); + } +}; + +let isPreviewRefreshing; +let timeoutId; + +const forceScrollSync = () => { + if (!isPreviewRefreshing) { + doScrollSync(); + } +}; +store.watch(() => store.getters['data/layoutSettings'].scrollSync, forceScrollSync); + +editorSvc.$on('inited', () => { + editorScrollerElt = editorSvc.editorElt.parentNode; + previewScrollerElt = editorSvc.previewElt.parentNode; + + editorScrollerElt.addEventListener('scroll', () => { + if (isEditorMoving) { + return; + } + isScrollEditor = true; + isScrollPreview = false; + doScrollSync(); + }); + + previewScrollerElt.addEventListener('scroll', () => { + if (isPreviewMoving || isPreviewRefreshing) { + return; + } + isScrollPreview = true; + isScrollEditor = false; + doScrollSync(); + }); +}); + +editorSvc.$on('sectionList', () => { + clearTimeout(timeoutId); + isPreviewRefreshing = true; + sectionDescList = []; +}); + +editorSvc.$on('previewCtx', () => { + // Assume the user is writing in the editor + isScrollEditor = store.getters['layout/styles'].showEditor; + // A preview scrolling event can occur if height is smaller + timeoutId = setTimeout(() => { + isPreviewRefreshing = false; + }, 100); +}); + +store.watch( + () => store.getters['layout/styles'].showEditor, + (showEditor) => { + isScrollEditor = showEditor; + isScrollPreview = !showEditor; + skipAnimation = true; + }, +); + +store.watch( + () => store.getters['file/current'].id, + () => { + skipAnimation = true; + }, +); + +editorSvc.$on('previewCtxMeasured', (previewCtxMeasured) => { + if (previewCtxMeasured) { + ({ sectionDescList } = previewCtxMeasured); + forceScrollSync(); + } +}); diff --git a/src/services/optional/shortcuts.js b/src/services/optional/shortcuts.js new file mode 100644 index 0000000..5a5c695 --- /dev/null +++ b/src/services/optional/shortcuts.js @@ -0,0 +1,109 @@ +import Mousetrap from 'mousetrap'; +import store from '../../store'; +import editorSvc from '../../services/editorSvc'; +import syncSvc from '../../services/syncSvc'; + +// Skip shortcuts if modal is open +Mousetrap.prototype.stopCallback = () => store.getters['modal/config']; + +const pagedownHandler = name => () => { + editorSvc.pagedownEditor.uiManager.doClick(name); + return true; +}; + +const findReplaceOpener = type => () => { + store.dispatch('findReplace/open', { + type, + findText: editorSvc.clEditor.selectionMgr.hasFocus() && + editorSvc.clEditor.selectionMgr.getSelectedText(), + }); + return true; +}; + +const toggleEditor = () => () => { + store.dispatch('data/toggleEditor', !store.getters['data/layoutSettings'].showEditor); + return true; +}; + +// 非编辑模式下支持的快捷键 +const noEditableShortcutMethods = ['toggleeditor']; + +const methods = { + bold: pagedownHandler('bold'), + italic: pagedownHandler('italic'), + strikethrough: pagedownHandler('strikethrough'), + link: pagedownHandler('link'), + quote: pagedownHandler('quote'), + code: pagedownHandler('code'), + image: pagedownHandler('image'), + chatgpt: pagedownHandler('chatgpt'), + olist: pagedownHandler('olist'), + ulist: pagedownHandler('ulist'), + clist: pagedownHandler('clist'), + heading: pagedownHandler('heading'), + inline: pagedownHandler('heading'), + hr: pagedownHandler('hr'), + inlineformula: pagedownHandler('inlineformula'), + toggleeditor: toggleEditor(), + sync() { + if (syncSvc.isSyncPossible()) { + syncSvc.requestSync(); + } + return true; + }, + find: findReplaceOpener('find'), + replace: findReplaceOpener('replace'), + expand(param1, param2) { + const text = `${param1 || ''}`; + const replacement = `${param2 || ''}`; + if (text && replacement) { + setTimeout(() => { + const { selectionMgr } = editorSvc.clEditor; + let offset = selectionMgr.selectionStart; + if (offset === selectionMgr.selectionEnd) { + const range = selectionMgr.createRange(offset - text.length, offset); + if (`${range}` === text) { + range.deleteContents(); + range.insertNode(document.createTextNode(replacement)); + offset = (offset - text.length) + replacement.length; + selectionMgr.setSelectionStartEnd(offset, offset); + selectionMgr.updateCursorCoordinates(true); + } + } + }, 1); + } + }, +}; + +store.watch( + () => ({ + computedSettings: store.getters['data/computedSettings'], + isCurrentEditable: store.getters['content/isCurrentEditable'], + }), + ({ computedSettings, isCurrentEditable }) => { + Mousetrap.reset(); + + Object.entries(computedSettings.shortcuts).forEach(([key, shortcut]) => { + if (shortcut) { + const method = `${shortcut.method || shortcut}`; + let params = shortcut.params || []; + if (!Array.isArray(params)) { + params = [params]; + } + if (Object.prototype.hasOwnProperty.call(methods, method)) { + try { + // editor is editable or 一些非编辑模式下支持的快捷键 + if (isCurrentEditable || noEditableShortcutMethods.indexOf(method) !== -1) { + Mousetrap.bind(`${key}`, () => !methods[method].apply(null, params)); + } + } catch (e) { + // Ignore + } + } + } + }); + }, + { + immediate: true, + }, +); diff --git a/src/services/optional/taskChange.js b/src/services/optional/taskChange.js new file mode 100644 index 0000000..a575d3b --- /dev/null +++ b/src/services/optional/taskChange.js @@ -0,0 +1,47 @@ +import editorSvc from '../editorSvc'; +import store from '../../store'; + +editorSvc.$on('inited', () => { + const getPreviewOffset = (elt) => { + let offset = 0; + if (!elt || elt === editorSvc.previewElt) { + return offset; + } + let { previousSibling } = elt; + while (previousSibling) { + offset += previousSibling.textContent.length; + ({ previousSibling } = previousSibling); + } + return offset + getPreviewOffset(elt.parentNode); + }; + + editorSvc.previewElt.addEventListener('click', (evt) => { + if (evt.target.classList.contains('task-list-item-checkbox')) { + evt.preventDefault(); + if (store.getters['content/isCurrentEditable']) { + const editorContent = editorSvc.clEditor.getContent(); + // Use setTimeout to ensure evt.target.checked has the old value + setTimeout(() => { + // Make sure content has not changed + if (editorContent === editorSvc.clEditor.getContent()) { + const previewOffset = getPreviewOffset(evt.target); + const endOffset = editorSvc.getEditorOffset(previewOffset + 1); + if (endOffset != null) { + const startOffset = editorContent.lastIndexOf('\n', endOffset) + 1; + const line = editorContent.slice(startOffset, endOffset); + const match = line.match(/^([ \t]*(?:[*+-]|\d+\.)[ \t]+\[)[ xX](\] .*)/); + if (match) { + let newContent = editorContent.slice(0, startOffset); + newContent += match[1]; + newContent += evt.target.checked ? ' ' : 'x'; + newContent += match[2]; + newContent += editorContent.slice(endOffset); + editorSvc.clEditor.setContent(newContent, true); + } + } + } + }, 10); + } + } + }); +}); diff --git a/src/services/providers/bloggerPageProvider.js b/src/services/providers/bloggerPageProvider.js new file mode 100644 index 0000000..8a655be --- /dev/null +++ b/src/services/providers/bloggerPageProvider.js @@ -0,0 +1,45 @@ +import store from '../../store'; +import googleHelper from './helpers/googleHelper'; +import Provider from './common/Provider'; + +export default new Provider({ + id: 'bloggerPage', + name: 'Blogger Page', + getToken({ sub }) { + const token = store.getters['data/googleTokensBySub'][sub]; + return token && token.isBlogger ? token : null; + }, + getLocationUrl({ blogId, pageId }) { + return `https://www.blogger.com/blogger.g?blogID=${blogId}#editor/target=page;pageID=${pageId}`; + }, + getLocationDescription({ pageId }) { + return pageId; + }, + async publish(token, html, metadata, publishLocation) { + const page = await googleHelper.uploadBlogger({ + token, + blogUrl: publishLocation.blogUrl, + blogId: publishLocation.blogId, + postId: publishLocation.pageId, + title: metadata.title, + content: html, + isPage: true, + }); + return { + ...publishLocation, + blogId: page.blog.id, + pageId: page.id, + }; + }, + makeLocation(token, blogUrl, pageId) { + const location = { + providerId: this.id, + sub: token.sub, + blogUrl, + }; + if (pageId) { + location.pageId = pageId; + } + return location; + }, +}); diff --git a/src/services/providers/bloggerProvider.js b/src/services/providers/bloggerProvider.js new file mode 100644 index 0000000..f84d604 --- /dev/null +++ b/src/services/providers/bloggerProvider.js @@ -0,0 +1,45 @@ +import store from '../../store'; +import googleHelper from './helpers/googleHelper'; +import Provider from './common/Provider'; + +export default new Provider({ + id: 'blogger', + name: 'Blogger', + getToken({ sub }) { + const token = store.getters['data/googleTokensBySub'][sub]; + return token && token.isBlogger ? token : null; + }, + getLocationUrl({ blogId, postId }) { + return `https://www.blogger.com/blogger.g?blogID=${blogId}#editor/target=post;postID=${postId}`; + }, + getLocationDescription({ postId }) { + return postId; + }, + async publish(token, html, metadata, publishLocation) { + const post = await googleHelper.uploadBlogger({ + ...publishLocation, + token, + title: metadata.title, + content: html, + labels: metadata.tags, + isDraft: metadata.status === 'draft', + published: metadata.date, + }); + return { + ...publishLocation, + blogId: post.blog.id, + postId: post.id, + }; + }, + makeLocation(token, blogUrl, postId) { + const location = { + providerId: this.id, + sub: token.sub, + blogUrl, + }; + if (postId) { + location.postId = postId; + } + return location; + }, +}); diff --git a/src/services/providers/common/Provider.js b/src/services/providers/common/Provider.js new file mode 100644 index 0000000..1a74aae --- /dev/null +++ b/src/services/providers/common/Provider.js @@ -0,0 +1,102 @@ +import providerRegistry from './providerRegistry'; +import emptyContent from '../../../data/empties/emptyContent'; +import utils from '../../utils'; +import store from '../../../store'; +import workspaceSvc from '../../workspaceSvc'; + +const dataExtractor = /\s*$/; + +export default class Provider { + prepareChanges = changes => changes + onChangesApplied = () => {} + + constructor(props) { + Object.assign(this, props); + providerRegistry.register(this); + } + + /** + * Serialize content in a self contain Markdown compatible format + */ + static serializeContent(content) { + let result = content.text; + const data = {}; + if (content.properties.length > 1) { + data.properties = content.properties; + } + if (Object.keys(content.discussions).length) { + data.discussions = content.discussions; + } + if (Object.keys(content.comments).length) { + data.comments = content.comments; + } + if (content.history && content.history.length) { + data.history = content.history; + } + if (Object.keys(data).length) { + const serializedData = utils.encodeBase64(JSON.stringify(data)).replace(/(.{50})/g, '$1\n'); + result += ``; + } + return result; + } + + /** + * Parse content serialized with serializeContent() + */ + static parseContent(serializedContent, id) { + let text = serializedContent; + const extractedData = dataExtractor.exec(serializedContent); + let result; + if (!extractedData) { + // In case stackedit's data has been manually removed, try to restore them + result = utils.deepCopy(store.state.content.itemsById[id]) || emptyContent(id); + } else { + result = emptyContent(id); + try { + const serializedData = extractedData[1].replace(/\s/g, ''); + const parsedData = JSON.parse(utils.decodeBase64(serializedData)); + text = text.slice(0, extractedData.index); + if (parsedData.properties) { + result.properties = utils.sanitizeText(parsedData.properties); + } + if (parsedData.discussions) { + result.discussions = parsedData.discussions; + } + if (parsedData.comments) { + result.comments = parsedData.comments; + } + result.history = parsedData.history; + } catch (e) { + // Ignore + } + } + result.text = utils.sanitizeText(text); + if (!result.history) { + result.history = []; + } + return utils.addItemHash(result); + } + + /** + * Find and open a file with location that meets the criteria + */ + static openFileWithLocation(criteria) { + const location = utils.search(store.getters['syncLocation/items'], criteria); + if (location) { + // Found one, open it if it exists + const item = store.state.file.itemsById[location.fileId]; + if (item) { + store.commit('file/setCurrentId', item.id); + // If file is in the trash, restore it + if (item.parentId === 'trash') { + workspaceSvc.setOrPatchItem({ + ...item, + parentId: null, + }); + } + return true; + } + } + return false; + } +} diff --git a/src/services/providers/common/providerRegistry.js b/src/services/providers/common/providerRegistry.js new file mode 100644 index 0000000..d3b9021 --- /dev/null +++ b/src/services/providers/common/providerRegistry.js @@ -0,0 +1,7 @@ +export default { + providersById: {}, + register(provider) { + this.providersById[provider.id] = provider; + return provider; + }, +}; diff --git a/src/services/providers/couchdbWorkspaceProvider.js b/src/services/providers/couchdbWorkspaceProvider.js new file mode 100644 index 0000000..e8af418 --- /dev/null +++ b/src/services/providers/couchdbWorkspaceProvider.js @@ -0,0 +1,229 @@ +import store from '../../store'; +import couchdbHelper from './helpers/couchdbHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import badgeSvc from '../badgeSvc'; + +let syncLastSeq; + +export default new Provider({ + id: 'couchdbWorkspace', + name: 'CouchDB', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ dbUrl }) { + return { + providerId: this.id, + dbUrl, + }; + }, + getWorkspaceLocationUrl({ dbUrl }) { + return dbUrl; + }, + getSyncDataUrl(fileSyncData, { id }) { + const { dbUrl } = this.getToken(); + return `${dbUrl}/${id}/data`; + }, + getSyncDataDescription(fileSyncData, { id }) { + return id; + }, + async initWorkspace() { + const dbUrl = (utils.queryParams.dbUrl || '').replace(/\/?$/, ''); // Remove trailing / + const workspaceParams = this.getWorkspaceParams({ dbUrl }); + const workspaceId = utils.makeWorkspaceId(workspaceParams); + + // Create the token if it doesn't exist + if (!store.getters['data/couchdbTokensBySub'][workspaceId]) { + store.dispatch('data/addCouchdbToken', { + sub: workspaceId, + dbUrl, + }); + } + + // Create the workspace if it doesn't exist + if (!store.getters['workspace/workspacesById'][workspaceId]) { + try { + // Make sure the database exists and retrieve its name + const db = await couchdbHelper.getDb(store.getters['data/couchdbTokensBySub'][workspaceId]); + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + id: workspaceId, + name: db.db_name, + providerId: this.id, + dbUrl, + }, + }); + } catch (e) { + throw new Error(`${dbUrl} is not accessible. Make sure you have the proper permissions.`); + } + } + + badgeSvc.addBadge('addCouchdbWorkspace'); + return store.getters['workspace/workspacesById'][workspaceId]; + }, + async getChanges() { + const syncToken = store.getters['workspace/syncToken']; + const lastSeq = store.getters['data/localSettings'].syncLastSeq; + const result = await couchdbHelper.getChanges(syncToken, lastSeq); + const changes = result.changes.filter((change) => { + if (!change.deleted && change.doc) { + change.item = change.doc.item; + if (!change.item || !change.item.id || !change.item.type) { + return false; + } + // Build sync data + change.syncData = { + id: change.id, + itemId: change.item.id, + type: change.item.type, + hash: change.item.hash, + rev: change.doc._rev, // eslint-disable-line no-underscore-dangle + }; + } + change.syncDataId = change.id; + return true; + }); + syncLastSeq = result.lastSeq; + return changes; + }, + onChangesApplied() { + store.dispatch('data/patchLocalSettings', { + syncLastSeq, + }); + }, + async saveWorkspaceItem({ item, syncData }) { + const syncToken = store.getters['workspace/syncToken']; + const { id, rev } = await couchdbHelper.uploadDocument({ + token: syncToken, + item, + documentId: syncData && syncData.id, + rev: syncData && syncData.rev, + }); + + // Build sync data to save + return { + syncData: { + id, + itemId: item.id, + type: item.type, + hash: item.hash, + rev, + }, + }; + }, + removeWorkspaceItem({ syncData }) { + const syncToken = store.getters['workspace/syncToken']; + return couchdbHelper.removeDocument(syncToken, syncData.id, syncData.rev); + }, + async downloadWorkspaceContent({ token, contentSyncData }) { + const body = await couchdbHelper.retrieveDocumentWithAttachments(token, contentSyncData.id); + const rev = body._rev; // eslint-disable-line no-underscore-dangle + const content = Provider.parseContent(body.attachments.data, body.item.id); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + rev, + }, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const body = await couchdbHelper.retrieveDocumentWithAttachments(token, syncData.id); + const item = utils.addItemHash(JSON.parse(body.attachments.data)); + const rev = body._rev; // eslint-disable-line no-underscore-dangle + return { + item, + syncData: { + ...syncData, + hash: item.hash, + rev, + }, + }; + }, + async uploadWorkspaceContent({ token, content, contentSyncData }) { + const res = await couchdbHelper.uploadDocument({ + token, + item: { + id: content.id, + type: content.type, + hash: content.hash, + }, + data: Provider.serializeContent(content), + dataType: 'text/plain', + documentId: contentSyncData && contentSyncData.id, + rev: contentSyncData && contentSyncData.rev, + }); + + // Return new sync data + return { + contentSyncData: { + id: res.id, + itemId: content.id, + type: content.type, + hash: content.hash, + rev: res.rev, + }, + }; + }, + async uploadWorkspaceData({ token, item, syncData }) { + const res = await couchdbHelper.uploadDocument({ + token, + item: { + id: item.id, + type: item.type, + hash: item.hash, + }, + data: JSON.stringify(item), + dataType: 'application/json', + documentId: syncData && syncData.id, + rev: syncData && syncData.rev, + }); + + // Return new sync data + return { + syncData: { + id: res.id, + itemId: item.id, + type: item.type, + hash: item.hash, + rev: res.rev, + }, + }; + }, + async listFileRevisions({ token, contentSyncDataId }) { + const body = await couchdbHelper.retrieveDocumentWithRevisions(token, contentSyncDataId); + const revisions = []; + body._revs_info.forEach((revInfo, idx) => { // eslint-disable-line no-underscore-dangle + if (revInfo.status === 'available') { + revisions.push({ + id: revInfo.rev, + sub: null, + created: idx, + loaded: false, + }); + } + }); + return revisions; + }, + async loadFileRevision({ token, contentSyncDataId, revision }) { + if (revision.loaded) { + return false; + } + const body = await couchdbHelper.retrieveDocument(token, contentSyncDataId, revision.id); + revision.sub = body.sub; + revision.created = body.time; + revision.loaded = true; + return true; + }, + async getFileRevisionContent({ token, contentSyncDataId, revisionId }) { + const body = await couchdbHelper + .retrieveDocumentWithAttachments(token, contentSyncDataId, revisionId); + return Provider.parseContent(body.attachments.data, body.item.id); + }, +}); diff --git a/src/services/providers/dropboxProvider.js b/src/services/providers/dropboxProvider.js new file mode 100644 index 0000000..9d3ac2b --- /dev/null +++ b/src/services/providers/dropboxProvider.js @@ -0,0 +1,153 @@ +import store from '../../store'; +import dropboxHelper from './helpers/dropboxHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; + +const makePathAbsolute = (token, path) => { + if (!token.fullAccess) { + return `/Applications/StackEdit (restricted)${path}`; + } + return path; +}; +const makePathRelative = (token, path) => { + if (!token.fullAccess) { + return path.replace(/^\/Applications\/StackEdit \(restricted\)/, ''); + } + return path; +}; + +export default new Provider({ + id: 'dropbox', + name: 'Dropbox', + getToken({ sub }) { + return store.getters['data/dropboxTokensBySub'][sub]; + }, + getLocationUrl({ path }) { + const pathComponents = path.split('/').map(encodeURIComponent); + const filename = pathComponents.pop(); + return `https://www.dropbox.com/home${pathComponents.join('/')}?preview=${filename}`; + }, + getLocationDescription({ path, dropboxFileId }) { + return dropboxFileId || path; + }, + checkPath(path) { + return path && path.match(/^\/[^\\<>:"|?*]+$/); + }, + async downloadContent(token, syncLocation) { + const { content } = await dropboxHelper.downloadFile({ + token, + path: makePathRelative(token, syncLocation.path), + fileId: syncLocation.dropboxFileId, + }); + return Provider.parseContent(content, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + const dropboxFile = await dropboxHelper.uploadFile({ + token, + path: makePathRelative(token, syncLocation.path), + content: Provider.serializeContent(content), + fileId: syncLocation.dropboxFileId, + }); + return { + ...syncLocation, + path: makePathAbsolute(token, dropboxFile.path_display), + dropboxFileId: dropboxFile.id, + }; + }, + async publish(token, html, metadata, publishLocation) { + const dropboxFile = await dropboxHelper.uploadFile({ + token, + path: publishLocation.path, + content: html, + fileId: publishLocation.dropboxFileId, + }); + return { + ...publishLocation, + path: makePathAbsolute(token, dropboxFile.path_display), + dropboxFileId: dropboxFile.id, + }; + }, + async openFiles(token, paths) { + await utils.awaitSequence(paths, async (path) => { + // Check if the file exists and open it + if (!Provider.openFileWithLocation({ + providerId: this.id, + path, + })) { + // Download content from Dropbox + const syncLocation = { + path, + providerId: this.id, + sub: token.sub, + }; + let content; + try { + content = await this.downloadContent(token, syncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${path}.`); + return; + } + + // Create the file + let name = path; + const slashPos = name.lastIndexOf('/'); + if (slashPos > -1 && slashPos < name.length - 1) { + name = name.slice(slashPos + 1); + } + const dotPos = name.lastIndexOf('.'); + if (dotPos > 0 && slashPos < name.length) { + name = name.slice(0, dotPos); + } + const item = await workspaceSvc.createFile({ + name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...syncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从Dropbox导入。`); + } + }); + }, + makeLocation(token, path) { + return { + providerId: this.id, + sub: token.sub, + path, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await dropboxHelper.listRevisions({ + token, + path: makePathRelative(token, syncLocation.path), + fileId: syncLocation.dropboxFileId, + }); + return entries.map(entry => ({ + id: entry.rev, + sub: `${dropboxHelper.subPrefix}:${(entry.sharing_info || {}).modified_by || token.sub}`, + created: new Date(entry.server_modified).getTime(), + })); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + revisionId, + }) { + const { content } = await dropboxHelper.downloadFile({ + token, + path: `rev:${revisionId}`, + }); + return Provider.parseContent(content, contentId); + }, +}); diff --git a/src/services/providers/gistProvider.js b/src/services/providers/gistProvider.js new file mode 100644 index 0000000..b4ac7f7 --- /dev/null +++ b/src/services/providers/gistProvider.js @@ -0,0 +1,95 @@ +import store from '../../store'; +import githubHelper from './helpers/githubHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; + +export default new Provider({ + id: 'gist', + name: 'Gist', + getToken({ sub }) { + return store.getters['data/githubTokensBySub'][sub]; + }, + getLocationUrl({ gistId }) { + return `https://gist.github.com/${gistId}`; + }, + getLocationDescription({ filename }) { + return filename; + }, + async downloadContent(token, syncLocation) { + const content = await githubHelper.downloadGist({ + ...syncLocation, + token, + }); + return Provider.parseContent(content, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + const file = store.state.file.itemsById[syncLocation.fileId]; + const description = utils.sanitizeName(file && file.name); + const gist = await githubHelper.uploadGist({ + ...syncLocation, + token, + description, + content: Provider.serializeContent(content), + }); + return { + ...syncLocation, + gistId: gist.id, + }; + }, + async publish(token, html, metadata, publishLocation) { + const gist = await githubHelper.uploadGist({ + ...publishLocation, + token, + description: metadata.title, + content: html, + }); + return { + ...publishLocation, + gistId: gist.id, + }; + }, + makeLocation(token, filename, isPublic, gistId) { + return { + providerId: this.id, + sub: token.sub, + filename, + isPublic, + gistId, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await githubHelper.getGistCommits({ + ...syncLocation, + token, + }); + + return entries.map((entry) => { + const sub = `${githubHelper.subPrefix}:${entry.user.id}`; + userSvc.addUserInfo({ id: sub, name: entry.user.login, imageUrl: entry.user.avatar_url }); + return { + sub, + id: entry.version, + message: entry.commit && entry.commit.message, + created: new Date(entry.committed_at).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const data = await githubHelper.downloadGistRevision({ + ...syncLocation, + token, + sha: revisionId, + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/giteaProvider.js b/src/services/providers/giteaProvider.js new file mode 100644 index 0000000..063eb90 --- /dev/null +++ b/src/services/providers/giteaProvider.js @@ -0,0 +1,180 @@ +import store from '../../store'; +import giteaHelper from './helpers/giteaHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; +import userSvc from '../userSvc'; + +const savedSha = {}; + +export default new Provider({ + id: 'gitea', + name: 'Gitea', + getToken({ sub }) { + return store.getters['data/giteaTokensBySub'][sub]; + }, + getLocationUrl({ + sub, + projectPath, + branch, + path, + }) { + const token = this.getToken({ sub }); + return `${token.serverUrl}/${projectPath}/src/branch/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getLocationDescription({ path }) { + return path; + }, + async downloadContent(token, syncLocation) { + const { sha, data } = await giteaHelper.downloadFile({ + ...syncLocation, + token, + }); + savedSha[syncLocation.id] = sha; + return Provider.parseContent(data, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + const updatedSyncLocation = { + ...syncLocation, + projectId: await giteaHelper.getProjectId(token, syncLocation), + }; + if (!savedSha[updatedSyncLocation.id]) { + try { + // Get the last sha + await this.downloadContent(token, updatedSyncLocation); + } catch (e) { + // Ignore error + } + } + const sha = savedSha[updatedSyncLocation.id]; + delete savedSha[updatedSyncLocation.id]; + await giteaHelper.uploadFile({ + ...updatedSyncLocation, + token, + content: Provider.serializeContent(content), + sha, + }); + return updatedSyncLocation; + }, + async publish(token, html, metadata, publishLocation, commitMessage) { + const updatedPublishLocation = { + ...publishLocation, + projectId: await giteaHelper.getProjectId(token, publishLocation), + }; + try { + // Get the last sha + await this.downloadContent(token, updatedPublishLocation); + } catch (e) { + // Ignore error + } + const sha = savedSha[updatedPublishLocation.id]; + delete savedSha[updatedPublishLocation.id]; + await giteaHelper.uploadFile({ + ...updatedPublishLocation, + token, + content: html, + sha, + commitMessage, + }); + return updatedPublishLocation; + }, + async openFile(token, syncLocation) { + const updatedSyncLocation = { + ...syncLocation, + projectId: await giteaHelper.getProjectId(token, syncLocation), + }; + + // Check if the file exists and open it + if (!Provider.openFileWithLocation(updatedSyncLocation)) { + // Download content from Gitea + let content; + try { + content = await this.downloadContent(token, updatedSyncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${updatedSyncLocation.path}.`); + return; + } + + // Create the file + let name = updatedSyncLocation.path; + const slashPos = name.lastIndexOf('/'); + if (slashPos > -1 && slashPos < name.length - 1) { + name = name.slice(slashPos + 1); + } + const dotPos = name.lastIndexOf('.'); + if (dotPos > 0 && slashPos < name.length) { + name = name.slice(0, dotPos); + } + const item = await workspaceSvc.createFile({ + name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...updatedSyncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从Gitea导入。`); + } + }, + makeLocation(token, projectPath, branch, path) { + return { + providerId: this.id, + sub: token.sub, + projectPath, + branch, + path, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await giteaHelper.getCommits({ + ...syncLocation, + token, + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${giteaHelper.subPrefix}:${user.login}`; + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date); + return { + id: sha, + sub, + message: commit.message, + created: date ? new Date(date).getTime() : 1, + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const { data } = await giteaHelper.downloadFile({ + ...syncLocation, + token, + branch: revisionId, + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/giteaWorkspaceProvider.js b/src/services/providers/giteaWorkspaceProvider.js new file mode 100644 index 0000000..e859067 --- /dev/null +++ b/src/services/providers/giteaWorkspaceProvider.js @@ -0,0 +1,331 @@ +import store from '../../store'; +import giteaHelper from './helpers/giteaHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import badgeSvc from '../badgeSvc'; + +const getAbsolutePath = ({ id }) => + `${store.getters['workspace/currentWorkspace'].path || ''}${id}`; + +export default new Provider({ + id: 'giteaWorkspace', + name: 'Gitea', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ + serverUrl, + projectPath, + branch, + path, + }) { + return { + providerId: this.id, + serverUrl, + projectPath, + branch, + path, + }; + }, + getWorkspaceLocationUrl({ + serverUrl, + projectPath, + branch, + path, + }) { + return `${serverUrl}/${projectPath}/src/branch/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getSyncDataUrl({ id }) { + const { projectPath, branch } = store.getters['workspace/currentWorkspace']; + const { serverUrl } = this.getToken(); + return `${serverUrl}/${projectPath}/src/branch/${encodeURIComponent(branch)}/${utils.encodeUrlPath(getAbsolutePath({ id }))}`; + }, + getSyncDataDescription({ id }) { + return getAbsolutePath({ id }); + }, + async initWorkspace() { + const { serverUrl, branch } = utils.queryParams; + const workspaceParams = this.getWorkspaceParams({ serverUrl, branch }); + if (!branch) { + workspaceParams.branch = 'master'; + } + + // Extract project path param + const projectPath = (utils.queryParams.projectPath || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, ''); // Remove trailing `/` + workspaceParams.projectPath = projectPath; + + // Extract path param + const path = (utils.queryParams.path || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, '/'); // Add trailing `/` + if (path !== '/') { + workspaceParams.path = path; + } + + const workspaceId = utils.makeWorkspaceId(workspaceParams); + const workspace = store.getters['workspace/workspacesById'][workspaceId]; + + // See if we already have a token + const sub = workspace ? workspace.sub : utils.queryParams.sub; + let token = store.getters['data/giteaTokensBySub'][sub]; + if (!token) { + const applicationInfo = await store.dispatch('modal/open', { + type: 'giteaAccount', + forceServerUrl: serverUrl, + }); + token = await giteaHelper.addAccount(applicationInfo, sub); + } + + if (!workspace) { + const projectId = await giteaHelper.getProjectId(token, workspaceParams); + const pathEntries = (path || '').split('/'); + const projectPathEntries = (projectPath || '').split('/'); + const name = pathEntries[pathEntries.length - 2] // path ends with `/` + || projectPathEntries[projectPathEntries.length - 1]; + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + ...workspaceParams, + projectId, + id: workspaceId, + sub: token.sub, + name, + }, + }); + } + + badgeSvc.addBadge('addGiteaWorkspace'); + return store.getters['workspace/workspacesById'][workspaceId]; + }, + getChanges() { + return giteaHelper.getTree({ + ...store.getters['workspace/currentWorkspace'], + token: this.getToken(), + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree.tree.map(entry => ({ + ...entry, + id: entry.sha, + }))); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await giteaHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await giteaHelper.removeFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await giteaHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(fileSyncData), + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await giteaHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const { sha, data } = await giteaHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + }); + gitWorkspaceSvc.shaByPath[syncData.id] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = store.getters.gitPathsByItemId[file.id] || ''; + const absolutePath = !isImg ? `${store.getters['workspace/currentWorkspace'].path || ''}${store.getters.gitPathsByItemId[file.id]}` : file.path; + const sha = gitWorkspaceSvc.shaByPath[!isImg ? path : file.path]; + const res = await giteaHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: absolutePath, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha, + isImg, + commitMessage, + }); + + if (isImg) { + return { + sha: res.content.sha, + }; + } + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha: res.content.sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ token, item }) { + const path = store.getters.gitPathsByItemId[item.id]; + const syncData = { + id: path, + type: item.type, + hash: item.hash, + }; + const res = await giteaHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { projectId, branch } = store.getters['workspace/currentWorkspace']; + const entries = await giteaHelper.getCommits({ + token, + projectId, + sha: branch, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${giteaHelper.subPrefix}:${user.login}`; + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date) + || 1; + return { + id: sha, + sub, + message: commit.message, + created: new Date(date).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await giteaHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + branch: revisionId, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + return Provider.parseContent(data, contentId); + }, + getFilePathUrl(path) { + const token = this.getToken(); + if (!token) { + return null; + } + const workspace = store.getters['workspace/currentWorkspace']; + return `${token.serverUrl}/${workspace.owner}/${workspace.repo}/src/branch/${workspace.branch}${path}`; + }, +}); diff --git a/src/services/providers/giteeAppDataProvider.js b/src/services/providers/giteeAppDataProvider.js new file mode 100644 index 0000000..0e9c815 --- /dev/null +++ b/src/services/providers/giteeAppDataProvider.js @@ -0,0 +1,292 @@ +import store from '../../store'; +import giteeHelper from './helpers/giteeHelper'; +import Provider from './common/Provider'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import userSvc from '../userSvc'; + +const appDataRepo = 'stackedit-app-data'; +const appDataBranch = 'master'; + +export default new Provider({ + id: 'giteeAppData', + name: 'Gitee应用数据', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams() { + // No param as it's the main workspace + return {}; + }, + getWorkspaceLocationUrl() { + // No direct link to app data + return null; + }, + getSyncDataUrl() { + // No direct link to app data + return null; + }, + getSyncDataDescription({ id }) { + return id; + }, + async initWorkspace() { + // Nothing much to do since the main workspace isn't necessarily synchronized + // Return the main workspace + return store.getters['workspace/workspacesById'].main; + }, + getChanges() { + const token = this.getToken(); + return giteeHelper.getTree({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await giteeHelper.uploadFile({ + owner: syncToken.name, + repo: appDataRepo, + branch: appDataBranch, + token: syncToken, + path: syncData.id, + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await giteeHelper.removeFile({ + owner: syncToken.name, + repo: appDataRepo, + branch: appDataBranch, + token: syncToken, + path: syncData.id, + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await giteeHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path: fileSyncData.id, + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await giteeHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + const path = `.stackedit-data/${syncData.id}.json`; + // const path = store.getters.gitPathsByItemId[syncData.id]; + // const path = syncData.id; + const { sha, data } = await giteeHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + }); + if (!sha) { + return {}; + } + gitWorkspaceSvc.shaByPath[path] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + type: 'data', + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = !isImg ? store.getters.gitPathsByItemId[file.id] : file.path; + const res = await giteeHelper.uploadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha: gitWorkspaceSvc.shaByPath[!isImg ? path : file.path], + isImg, + commitMessage, + }); + + if (isImg) { + return { + sha: res.content.sha, + }; + } + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha: res.content.sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ + token, + item, + syncData, + }) { + const path = `.stackedit-data/${item.id}.json`; + // const path = store.getters.gitPathsByItemId[item.id]; + // const path = syncData.id; + const res = await giteeHelper.uploadFile({ + token, + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + path, + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + type: item.type, + hash: item.hash, + data: item.data, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { owner, repo, branch } = { + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + }; + const entries = await giteeHelper.getCommits({ + token, + owner, + repo, + sha: branch, + path: fileSyncDataId, + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${giteeHelper.subPrefix}:${user.login}`; + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date) + || 1; + return { + id: sha, + sub, + message: commit.message, + created: new Date(date).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await giteeHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: revisionId, + token, + path: fileSyncDataId, + }); + return Provider.parseContent(data, contentId); + }, + getFilePathUrl(path) { + const token = this.getToken(); + if (!token) { + return null; + } + return `https://gitee.com/${token.name}/${appDataRepo}/blob/${appDataBranch}${path}`; + }, +}); diff --git a/src/services/providers/giteeGistProvider.js b/src/services/providers/giteeGistProvider.js new file mode 100644 index 0000000..eb05b96 --- /dev/null +++ b/src/services/providers/giteeGistProvider.js @@ -0,0 +1,95 @@ +import store from '../../store'; +import giteeHelper from './helpers/giteeHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; + +export default new Provider({ + id: 'giteegist', + name: 'GiteeGist', + getToken({ sub }) { + return store.getters['data/giteeTokensBySub'][sub]; + }, + getLocationUrl({ gistId }) { + return `https://gitee.com/mafgwo/codes/${gistId}`; + }, + getLocationDescription({ filename }) { + return filename; + }, + async downloadContent(token, syncLocation) { + const content = await giteeHelper.downloadGist({ + ...syncLocation, + token, + }); + return Provider.parseContent(content, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + const file = store.state.file.itemsById[syncLocation.fileId]; + const description = utils.sanitizeName(file && file.name); + const gist = await giteeHelper.uploadGist({ + ...syncLocation, + token, + description, + content: Provider.serializeContent(content), + }); + return { + ...syncLocation, + gistId: gist.id, + }; + }, + async publish(token, html, metadata, publishLocation) { + const gist = await giteeHelper.uploadGist({ + ...publishLocation, + token, + description: metadata.title, + content: html, + }); + return { + ...publishLocation, + gistId: gist.id, + }; + }, + makeLocation(token, filename, isPublic, gistId) { + return { + providerId: this.id, + sub: token.sub, + filename, + isPublic, + gistId, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await giteeHelper.getGistCommits({ + ...syncLocation, + token, + }); + + return entries.map((entry) => { + const sub = `${giteeHelper.subPrefix}:${entry.user.id}`; + userSvc.addUserInfo({ id: sub, name: entry.user.login, imageUrl: entry.user.avatar_url }); + return { + sub, + id: entry.version, + message: entry.commit && entry.commit.message, + created: new Date(entry.committed_at).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + // async getFileRevisionContent({ + // token, + // contentId, + // syncLocation, + // revisionId, + // }) { + // const data = await giteeHelper.downloadGistRevision({ + // ...syncLocation, + // token, + // sha: revisionId, + // }); + // return Provider.parseContent(data, contentId); + // }, +}); diff --git a/src/services/providers/giteeProvider.js b/src/services/providers/giteeProvider.js new file mode 100644 index 0000000..abcaa09 --- /dev/null +++ b/src/services/providers/giteeProvider.js @@ -0,0 +1,170 @@ +import store from '../../store'; +import giteeHelper from './helpers/giteeHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; +import userSvc from '../userSvc'; + +const savedSha = {}; + +export default new Provider({ + id: 'gitee', + name: 'Gitee', + getToken({ sub }) { + return store.getters['data/giteeTokensBySub'][sub]; + }, + getLocationUrl({ + owner, + repo, + branch, + path, + }) { + return `https://gitee.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getLocationDescription({ path }) { + return path; + }, + async downloadContent(token, syncLocation) { + const { sha, data } = await giteeHelper.downloadFile({ + ...syncLocation, + token, + }); + savedSha[syncLocation.id] = sha; + return Provider.parseContent(data, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + if (!savedSha[syncLocation.id]) { + try { + // Get the last sha + await this.downloadContent(token, syncLocation); + } catch (e) { + // Ignore error + } + } + const sha = savedSha[syncLocation.id]; + delete savedSha[syncLocation.id]; + await giteeHelper.uploadFile({ + ...syncLocation, + token, + content: Provider.serializeContent(content), + sha, + }); + return syncLocation; + }, + async publish(token, html, metadata, publishLocation, commitMessage) { + try { + // Get the last sha + await this.downloadContent(token, publishLocation); + } catch (e) { + // Ignore error + } + const sha = savedSha[publishLocation.id]; + delete savedSha[publishLocation.id]; + await giteeHelper.uploadFile({ + ...publishLocation, + token, + content: html, + sha, + commitMessage, + }); + return publishLocation; + }, + async openFile(token, syncLocation) { + // Check if the file exists and open it + if (!Provider.openFileWithLocation(syncLocation)) { + // Download content from Gitee + let content; + try { + content = await this.downloadContent(token, syncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${syncLocation.path}.`); + return; + } + + // Create the file + let name = syncLocation.path; + const slashPos = name.lastIndexOf('/'); + if (slashPos > -1 && slashPos < name.length - 1) { + name = name.slice(slashPos + 1); + } + const dotPos = name.lastIndexOf('.'); + if (dotPos > 0 && slashPos < name.length) { + name = name.slice(0, dotPos); + } + const item = await workspaceSvc.createFile({ + name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...syncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从Gitee导入。`); + } + }, + makeLocation(token, owner, repo, branch, path) { + return { + providerId: this.id, + sub: token.sub, + owner, + repo, + branch, + path, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await giteeHelper.getCommits({ + ...syncLocation, + token, + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${giteeHelper.subPrefix}:${user.login}`; + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date); + return { + id: sha, + sub, + message: commit.message, + created: date ? new Date(date).getTime() : 1, + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const { data } = await giteeHelper.downloadFile({ + ...syncLocation, + token, + branch: revisionId, + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/giteeWorkspaceProvider.js b/src/services/providers/giteeWorkspaceProvider.js new file mode 100644 index 0000000..86dc680 --- /dev/null +++ b/src/services/providers/giteeWorkspaceProvider.js @@ -0,0 +1,315 @@ +import store from '../../store'; +import giteeHelper from './helpers/giteeHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import badgeSvc from '../badgeSvc'; + +const getAbsolutePath = ({ id }) => + `${store.getters['workspace/currentWorkspace'].path || ''}${id}`; + +export default new Provider({ + id: 'giteeWorkspace', + name: 'Gitee', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ + owner, + repo, + branch, + path, + }) { + return { + providerId: this.id, + owner, + repo, + branch, + path, + }; + }, + getWorkspaceLocationUrl({ + owner, + repo, + branch, + path, + }) { + return `https://gitee.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getSyncDataUrl({ id }) { + const { owner, repo, branch } = store.getters['workspace/currentWorkspace']; + return `https://gitee.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(getAbsolutePath({ id }))}`; + }, + getSyncDataDescription({ id }) { + return getAbsolutePath({ id }); + }, + async initWorkspace() { + const { owner, repo, branch } = utils.queryParams; + const workspaceParams = this.getWorkspaceParams({ owner, repo, branch }); + if (!branch) { + workspaceParams.branch = 'master'; + } + + // Extract path param + const path = (utils.queryParams.path || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, '/'); // Add trailing `/` + if (path !== '/') { + workspaceParams.path = path; + } + + const workspaceId = utils.makeWorkspaceId(workspaceParams); + const workspace = store.getters['workspace/workspacesById'][workspaceId]; + + // See if we already have a token + let token; + if (workspace) { + // Token sub is in the workspace + token = store.getters['data/giteeTokensBySub'][workspace.sub]; + } + if (!token) { + await store.dispatch('modal/open', { type: 'giteeAccount' }); + token = await giteeHelper.addAccount(); + } + + if (!workspace) { + const pathEntries = (path || '').split('/'); + const name = pathEntries[pathEntries.length - 2] || repo; // path ends with `/` + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + ...workspaceParams, + id: workspaceId, + sub: token.sub, + name, + }, + }); + } + + badgeSvc.addBadge('addGiteeWorkspace'); + return store.getters['workspace/workspacesById'][workspaceId]; + }, + getChanges() { + return giteeHelper.getTree({ + ...store.getters['workspace/currentWorkspace'], + token: this.getToken(), + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await giteeHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await giteeHelper.removeFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await giteeHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(fileSyncData), + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await giteeHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const { sha, data } = await giteeHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + }); + gitWorkspaceSvc.shaByPath[syncData.id] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = store.getters.gitPathsByItemId[file.id] || ''; + const absolutePath = !isImg ? `${store.getters['workspace/currentWorkspace'].path || ''}${path}` : file.path; + const res = await giteeHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: absolutePath, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha: gitWorkspaceSvc.shaByPath[!isImg ? path : file.path], + isImg, + commitMessage, + }); + + if (isImg) { + return { + sha: res.content.sha, + }; + } + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha: res.content.sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ token, item }) { + const path = store.getters.gitPathsByItemId[item.id]; + const syncData = { + id: path, + type: item.type, + hash: item.hash, + }; + const res = await giteeHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { owner, repo, branch } = store.getters['workspace/currentWorkspace']; + const entries = await giteeHelper.getCommits({ + token, + owner, + repo, + sha: branch, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${giteeHelper.subPrefix}:${user.login}`; + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date) + || 1; + return { + id: sha, + sub, + message: commit.message, + created: new Date(date).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await giteeHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + branch: revisionId, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + return Provider.parseContent(data, contentId); + }, + getFilePathUrl(path) { + const workspace = store.getters['workspace/currentWorkspace']; + return `https://gitee.com/${workspace.owner}/${workspace.repo}/blob/${workspace.branch}${path}`; + }, +}); diff --git a/src/services/providers/githubAppDataProvider.js b/src/services/providers/githubAppDataProvider.js new file mode 100644 index 0000000..f774b20 --- /dev/null +++ b/src/services/providers/githubAppDataProvider.js @@ -0,0 +1,292 @@ +import store from '../../store'; +import githubHelper from './helpers/githubHelper'; +import Provider from './common/Provider'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import userSvc from '../userSvc'; + +const appDataRepo = 'stackedit-app-data'; +const appDataBranch = 'master'; + +export default new Provider({ + id: 'githubAppData', + name: 'Gitee应用数据', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams() { + // No param as it's the main workspace + return {}; + }, + getWorkspaceLocationUrl() { + // No direct link to app data + return null; + }, + getSyncDataUrl() { + // No direct link to app data + return null; + }, + getSyncDataDescription({ id }) { + return id; + }, + async initWorkspace() { + // Nothing much to do since the main workspace isn't necessarily synchronized + // Return the main workspace + return store.getters['workspace/workspacesById'].main; + }, + getChanges() { + const token = this.getToken(); + return githubHelper.getTree({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await githubHelper.uploadFile({ + owner: syncToken.name, + repo: appDataRepo, + branch: appDataBranch, + token: syncToken, + path: syncData.id, + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await githubHelper.removeFile({ + owner: syncToken.name, + repo: appDataRepo, + branch: appDataBranch, + token: syncToken, + path: syncData.id, + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await githubHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path: fileSyncData.id, + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await githubHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + const path = `.stackedit-data/${syncData.id}.json`; + // const path = store.getters.gitPathsByItemId[syncData.id]; + // const path = syncData.id; + const { sha, data } = await githubHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + }); + if (!sha) { + return {}; + } + gitWorkspaceSvc.shaByPath[path] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + type: 'data', + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = !isImg ? store.getters.gitPathsByItemId[file.id] : file.path; + const res = await githubHelper.uploadFile({ + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + token, + path, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha: gitWorkspaceSvc.shaByPath[!isImg ? path : file.path], + isImg, + commitMessage, + }); + + if (isImg) { + return { + sha: res.content.sha, + }; + } + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha: res.content.sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ + token, + item, + syncData, + }) { + const path = `.stackedit-data/${item.id}.json`; + // const path = store.getters.gitPathsByItemId[item.id]; + // const path = syncData.id; + const res = await githubHelper.uploadFile({ + token, + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + path, + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + type: item.type, + hash: item.hash, + data: item.data, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { owner, repo, branch } = { + owner: token.name, + repo: appDataRepo, + branch: appDataBranch, + }; + const entries = await githubHelper.getCommits({ + token, + owner, + repo, + sha: branch, + path: fileSyncDataId, + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } + const sub = `${githubHelper.subPrefix}:${user.login}`; + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + userSvc.addUserInfo({ id: sub, name: user.login, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date) + || 1; + return { + id: sha, + sub, + message: commit.message, + created: new Date(date).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await githubHelper.downloadFile({ + owner: token.name, + repo: appDataRepo, + branch: revisionId, + token, + path: fileSyncDataId, + }); + return Provider.parseContent(data, contentId); + }, + getFilePathUrl(path) { + const token = this.getToken(); + if (!token) { + return null; + } + return `https://github.com/${token.name}/${appDataRepo}/blob/${appDataBranch}${path}`; + }, +}); diff --git a/src/services/providers/githubProvider.js b/src/services/providers/githubProvider.js new file mode 100644 index 0000000..d0f32bc --- /dev/null +++ b/src/services/providers/githubProvider.js @@ -0,0 +1,169 @@ +import store from '../../store'; +import githubHelper from './helpers/githubHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; +import userSvc from '../userSvc'; + +const savedSha = {}; + +export default new Provider({ + id: 'github', + name: 'GitHub', + getToken({ sub }) { + return store.getters['data/githubTokensBySub'][sub]; + }, + getLocationUrl({ + owner, + repo, + branch, + path, + }) { + return `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getLocationDescription({ path }) { + return path; + }, + async downloadContent(token, syncLocation) { + const { sha, data } = await githubHelper.downloadFile({ + ...syncLocation, + token, + }); + savedSha[syncLocation.id] = sha; + return Provider.parseContent(data, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + if (!savedSha[syncLocation.id]) { + try { + // Get the last sha + await this.downloadContent(token, syncLocation); + } catch (e) { + // Ignore error + } + } + const sha = savedSha[syncLocation.id]; + delete savedSha[syncLocation.id]; + await githubHelper.uploadFile({ + ...syncLocation, + token, + content: Provider.serializeContent(content), + sha, + }); + return syncLocation; + }, + async publish(token, html, metadata, publishLocation, commitMessage) { + try { + // Get the last sha + await this.downloadContent(token, publishLocation); + } catch (e) { + // Ignore error + } + const sha = savedSha[publishLocation.id]; + delete savedSha[publishLocation.id]; + await githubHelper.uploadFile({ + ...publishLocation, + token, + content: html, + sha, + commitMessage, + }); + return publishLocation; + }, + async openFile(token, syncLocation) { + // Check if the file exists and open it + if (!Provider.openFileWithLocation(syncLocation)) { + // Download content from GitHub + let content; + try { + content = await this.downloadContent(token, syncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${syncLocation.path}.`); + return; + } + + // Create the file + let name = syncLocation.path; + const slashPos = name.lastIndexOf('/'); + if (slashPos > -1 && slashPos < name.length - 1) { + name = name.slice(slashPos + 1); + } + const dotPos = name.lastIndexOf('.'); + if (dotPos > 0 && slashPos < name.length) { + name = name.slice(0, dotPos); + } + const item = await workspaceSvc.createFile({ + name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...syncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从GitHub导入。`); + } + }, + makeLocation(token, owner, repo, branch, path) { + return { + providerId: this.id, + sub: token.sub, + owner, + repo, + branch, + path, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await githubHelper.getCommits({ + ...syncLocation, + token, + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } else if (commit && commit.author) { + user = commit.author; + } + const sub = `${githubHelper.subPrefix}:${user.id || user.name}`; + userSvc.addUserInfo({ id: sub, name: user.login || user.name, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date); + return { + id: sha, + sub, + message: commit.message, + created: date ? new Date(date).getTime() : 1, + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const { data } = await githubHelper.downloadFile({ + ...syncLocation, + token, + branch: revisionId, + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/githubWorkspaceProvider.js b/src/services/providers/githubWorkspaceProvider.js new file mode 100644 index 0000000..84e465f --- /dev/null +++ b/src/services/providers/githubWorkspaceProvider.js @@ -0,0 +1,313 @@ +import store from '../../store'; +import githubHelper from './helpers/githubHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import badgeSvc from '../badgeSvc'; + +const getAbsolutePath = ({ id }) => + `${store.getters['workspace/currentWorkspace'].path || ''}${id}`; + +export default new Provider({ + id: 'githubWorkspace', + name: 'GitHub', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ + owner, + repo, + branch, + path, + }) { + return { + providerId: this.id, + owner, + repo, + branch, + path, + }; + }, + getWorkspaceLocationUrl({ + owner, + repo, + branch, + path, + }) { + return `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getSyncDataUrl({ id }) { + const { owner, repo, branch } = store.getters['workspace/currentWorkspace']; + return `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/tree/${encodeURIComponent(branch)}/${utils.encodeUrlPath(getAbsolutePath({ id }))}`; + }, + getSyncDataDescription({ id }) { + return getAbsolutePath({ id }); + }, + async initWorkspace() { + const { owner, repo, branch } = utils.queryParams; + const workspaceParams = this.getWorkspaceParams({ owner, repo, branch }); + if (!branch) { + workspaceParams.branch = 'master'; + } + + // Extract path param + const path = (utils.queryParams.path || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, '/'); // Add trailing `/` + if (path !== '/') { + workspaceParams.path = path; + } + + const workspaceId = utils.makeWorkspaceId(workspaceParams); + const workspace = store.getters['workspace/workspacesById'][workspaceId]; + + // See if we already have a token + let token; + if (workspace) { + // Token sub is in the workspace + token = store.getters['data/githubTokensBySub'][workspace.sub]; + } + if (!token) { + await store.dispatch('modal/open', { type: 'githubAccount' }); + token = await githubHelper.addAccount(store.getters['data/localSettings'].githubRepoFullAccess); + } + + if (!workspace) { + const pathEntries = (path || '').split('/'); + const name = pathEntries[pathEntries.length - 2] || repo; // path ends with `/` + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + ...workspaceParams, + id: workspaceId, + sub: token.sub, + name, + }, + }); + } + + badgeSvc.addBadge('addGithubWorkspace'); + return store.getters['workspace/workspacesById'][workspaceId]; + }, + getChanges() { + return githubHelper.getTree({ + ...store.getters['workspace/currentWorkspace'], + token: this.getToken(), + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await githubHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await githubHelper.removeFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await githubHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(fileSyncData), + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await githubHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const { sha, data } = await githubHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + }); + gitWorkspaceSvc.shaByPath[syncData.id] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = store.getters.gitPathsByItemId[file.id] || ''; + const absolutePath = !isImg ? `${store.getters['workspace/currentWorkspace'].path || ''}${path}` : file.path; + const res = await githubHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: absolutePath, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha: gitWorkspaceSvc.shaByPath[!isImg ? path : file.path], + isImg, + commitMessage, + }); + if (isImg) { + return { + sha: res.content.sha, + }; + } + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha: res.content.sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ token, item }) { + const path = store.getters.gitPathsByItemId[item.id]; + const syncData = { + id: path, + type: item.type, + hash: item.hash, + }; + const res = await githubHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { owner, repo, branch } = store.getters['workspace/currentWorkspace']; + const entries = await githubHelper.getCommits({ + token, + owner, + repo, + sha: branch, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + + return entries.map(({ + author, + committer, + commit, + sha, + }) => { + let user; + if (author && author.login) { + user = author; + } else if (committer && committer.login) { + user = committer; + } else if (commit && commit.author) { + user = commit.author; + } + const sub = `${githubHelper.subPrefix}:${user.id || user.name}`; + userSvc.addUserInfo({ id: sub, name: user.login || user.name, imageUrl: user.avatar_url }); + const date = (commit.author && commit.author.date) + || (commit.committer && commit.committer.date) + || 1; + return { + id: sha, + sub, + message: commit.message, + created: new Date(date).getTime(), + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await githubHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + branch: revisionId, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + return Provider.parseContent(data, contentId); + }, + getFilePathUrl(path) { + const workspace = store.getters['workspace/currentWorkspace']; + return `https://github.com/${workspace.owner}/${workspace.repo}/blob/${workspace.branch}${path}`; + }, +}); diff --git a/src/services/providers/gitlabProvider.js b/src/services/providers/gitlabProvider.js new file mode 100644 index 0000000..f19e723 --- /dev/null +++ b/src/services/providers/gitlabProvider.js @@ -0,0 +1,173 @@ +import store from '../../store'; +import gitlabHelper from './helpers/gitlabHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; +import userSvc from '../userSvc'; + +const savedSha = {}; + +export default new Provider({ + id: 'gitlab', + name: 'GitLab', + getToken({ sub }) { + return store.getters['data/gitlabTokensBySub'][sub]; + }, + getLocationUrl({ + sub, + projectPath, + branch, + path, + }) { + const token = this.getToken({ sub }); + return `${token.serverUrl}/${projectPath}/blob/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getLocationDescription({ path }) { + return path; + }, + async downloadContent(token, syncLocation) { + const { sha, data } = await gitlabHelper.downloadFile({ + ...syncLocation, + token, + }); + savedSha[syncLocation.id] = sha; + return Provider.parseContent(data, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation) { + const updatedSyncLocation = { + ...syncLocation, + projectId: await gitlabHelper.getProjectId(token, syncLocation), + }; + if (!savedSha[updatedSyncLocation.id]) { + try { + // Get the last sha + await this.downloadContent(token, updatedSyncLocation); + } catch (e) { + // Ignore error + } + } + const sha = savedSha[updatedSyncLocation.id]; + delete savedSha[updatedSyncLocation.id]; + await gitlabHelper.uploadFile({ + ...updatedSyncLocation, + token, + content: Provider.serializeContent(content), + sha, + }); + return updatedSyncLocation; + }, + async publish(token, html, metadata, publishLocation, commitMessage) { + const updatedPublishLocation = { + ...publishLocation, + projectId: await gitlabHelper.getProjectId(token, publishLocation), + }; + try { + // Get the last sha + await this.downloadContent(token, updatedPublishLocation); + } catch (e) { + // Ignore error + } + const sha = savedSha[updatedPublishLocation.id]; + delete savedSha[updatedPublishLocation.id]; + await gitlabHelper.uploadFile({ + ...updatedPublishLocation, + token, + content: html, + sha, + commitMessage, + }); + return updatedPublishLocation; + }, + async openFile(token, syncLocation) { + const updatedSyncLocation = { + ...syncLocation, + projectId: await gitlabHelper.getProjectId(token, syncLocation), + }; + + // Check if the file exists and open it + if (!Provider.openFileWithLocation(updatedSyncLocation)) { + // Download content from GitLab + let content; + try { + content = await this.downloadContent(token, updatedSyncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${updatedSyncLocation.path}.`); + return; + } + + // Create the file + let name = updatedSyncLocation.path; + const slashPos = name.lastIndexOf('/'); + if (slashPos > -1 && slashPos < name.length - 1) { + name = name.slice(slashPos + 1); + } + const dotPos = name.lastIndexOf('.'); + if (dotPos > 0 && slashPos < name.length) { + name = name.slice(0, dotPos); + } + const item = await workspaceSvc.createFile({ + name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...updatedSyncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从GitLab导入。`); + } + }, + makeLocation(token, projectPath, branch, path) { + return { + providerId: this.id, + sub: token.sub, + projectPath, + branch, + path, + }; + }, + async listFileRevisions({ token, syncLocation }) { + const entries = await gitlabHelper.getCommits({ + ...syncLocation, + token, + }); + + return entries.map((entry) => { + const email = entry.author_email || entry.committer_email; + const sub = `${gitlabHelper.subPrefix}:${token.serverUrl}/${email}`; + userSvc.addUserInfo({ + id: sub, + name: entry.author_name || entry.committer_name, + imageUrl: '', + }); + const date = entry.authored_date || entry.committed_date || 1; + return { + id: entry.id, + sub, + message: entry.commit && entry.commit.message, + created: date ? new Date(date).getTime() : 1, + }; + }); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const { data } = await gitlabHelper.downloadFile({ + ...syncLocation, + token, + branch: revisionId, + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/gitlabWorkspaceProvider.js b/src/services/providers/gitlabWorkspaceProvider.js new file mode 100644 index 0000000..afb138a --- /dev/null +++ b/src/services/providers/gitlabWorkspaceProvider.js @@ -0,0 +1,317 @@ +import store from '../../store'; +import gitlabHelper from './helpers/gitlabHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import userSvc from '../userSvc'; +import gitWorkspaceSvc from '../gitWorkspaceSvc'; +import badgeSvc from '../badgeSvc'; + +const getAbsolutePath = ({ id }) => + `${store.getters['workspace/currentWorkspace'].path || ''}${id}`; + +export default new Provider({ + id: 'gitlabWorkspace', + name: 'GitLab', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ + serverUrl, + projectPath, + branch, + path, + }) { + return { + providerId: this.id, + serverUrl, + projectPath, + branch, + path, + }; + }, + getWorkspaceLocationUrl({ + serverUrl, + projectPath, + branch, + path, + }) { + return `${serverUrl}/${projectPath}/blob/${encodeURIComponent(branch)}/${utils.encodeUrlPath(path)}`; + }, + getSyncDataUrl({ id }) { + const { projectPath, branch } = store.getters['workspace/currentWorkspace']; + const { serverUrl } = this.getToken(); + return `${serverUrl}/${projectPath}/blob/${encodeURIComponent(branch)}/${utils.encodeUrlPath(getAbsolutePath({ id }))}`; + }, + getSyncDataDescription({ id }) { + return getAbsolutePath({ id }); + }, + async initWorkspace() { + const { serverUrl, branch } = utils.queryParams; + const workspaceParams = this.getWorkspaceParams({ serverUrl, branch }); + if (!branch) { + workspaceParams.branch = 'master'; + } + + // Extract project path param + const projectPath = (utils.queryParams.projectPath || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, ''); // Remove trailing `/` + workspaceParams.projectPath = projectPath; + + // Extract path param + const path = (utils.queryParams.path || '') + .trim() + .replace(/^\/*/, '') // Remove leading `/` + .replace(/\/*$/, '/'); // Add trailing `/` + if (path !== '/') { + workspaceParams.path = path; + } + + const workspaceId = utils.makeWorkspaceId(workspaceParams); + const workspace = store.getters['workspace/workspacesById'][workspaceId]; + + // See if we already have a token + const sub = workspace ? workspace.sub : utils.queryParams.sub; + let token = store.getters['data/gitlabTokensBySub'][sub]; + if (!token) { + const { applicationId, applicationSecret } = await store.dispatch('modal/open', { + type: 'gitlabAccount', + forceServerUrl: serverUrl, + }); + token = await gitlabHelper.addAccount(serverUrl, applicationId, applicationSecret, sub); + } + + if (!workspace) { + const projectId = await gitlabHelper.getProjectId(token, workspaceParams); + const pathEntries = (path || '').split('/'); + const projectPathEntries = (projectPath || '').split('/'); + const name = pathEntries[pathEntries.length - 2] // path ends with `/` + || projectPathEntries[projectPathEntries.length - 1]; + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + ...workspaceParams, + projectId, + id: workspaceId, + sub: token.sub, + name, + }, + }); + } + + badgeSvc.addBadge('addGitlabWorkspace'); + return store.getters['workspace/workspacesById'][workspaceId]; + }, + getChanges() { + return gitlabHelper.getTree({ + ...store.getters['workspace/currentWorkspace'], + token: this.getToken(), + }); + }, + prepareChanges(tree) { + return gitWorkspaceSvc.makeChanges(tree.map(entry => ({ + ...entry, + sha: entry.id, + }))); + }, + async saveWorkspaceItem({ item }) { + const syncData = { + id: store.getters.gitPathsByItemId[item.id], + type: item.type, + hash: item.hash, + }; + + // Files and folders are not in git, only contents + if (item.type === 'file' || item.type === 'folder') { + return { syncData }; + } + + // locations are stored as paths, so we upload an empty file + const syncToken = store.getters['workspace/syncToken']; + await gitlabHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + content: '', + sha: gitWorkspaceSvc.shaByPath[syncData.id], + commitMessage: item.commitMessage, + }); + + // Return sync data to save + return { syncData }; + }, + async removeWorkspaceItem({ syncData }) { + if (gitWorkspaceSvc.shaByPath[syncData.id]) { + const syncToken = store.getters['workspace/syncToken']; + await gitlabHelper.removeFile({ + ...store.getters['workspace/currentWorkspace'], + token: syncToken, + path: getAbsolutePath(syncData), + sha: gitWorkspaceSvc.shaByPath[syncData.id], + }); + } + }, + async downloadWorkspaceContent({ + token, + contentId, + contentSyncData, + fileSyncData, + }) { + const { sha, data } = await gitlabHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(fileSyncData), + }); + gitWorkspaceSvc.shaByPath[fileSyncData.id] = sha; + const content = Provider.parseContent(data, contentId); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + sha, + }, + }; + }, + async downloadFile({ token, path }) { + const { sha, data } = await gitlabHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path, + isImg: true, + }); + return { + content: data, + sha, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const { sha, data } = await gitlabHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + }); + gitWorkspaceSvc.shaByPath[syncData.id] = sha; + const item = JSON.parse(data); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + sha, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + commitMessage, + }) { + const isImg = file.type === 'img'; + const path = store.getters.gitPathsByItemId[file.id]; + const absolutePath = !isImg ? `${store.getters['workspace/currentWorkspace'].path || ''}${path}` : file.path; + const sha = gitWorkspaceSvc.shaByPath[!isImg ? path : file.path]; + await gitlabHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: absolutePath, + content: !isImg ? Provider.serializeContent(content) : file.content, + sha, + isImg, + commitMessage, + }); + + if (isImg) { + const res2 = await this.downloadFile({ token, path: absolutePath }); + return { + sha: res2.sha, + }; + } + + // Return new sync data + return { + contentSyncData: { + id: store.getters.gitPathsByItemId[content.id], + type: content.type, + hash: content.hash, + sha, + }, + fileSyncData: { + id: path, + type: 'file', + hash: file.hash, + }, + }; + }, + async uploadWorkspaceData({ token, item }) { + const path = store.getters.gitPathsByItemId[item.id]; + const syncData = { + id: path, + type: item.type, + hash: item.hash, + }; + const res = await gitlabHelper.uploadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + path: getAbsolutePath(syncData), + content: JSON.stringify(item), + sha: gitWorkspaceSvc.shaByPath[path], + }); + + return { + syncData: { + ...syncData, + sha: res.content.sha, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const { projectId, branch } = store.getters['workspace/currentWorkspace']; + const entries = await gitlabHelper.getCommits({ + token, + projectId, + sha: branch, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + + return entries.map((entry) => { + const email = entry.author_email || entry.committer_email; + const sub = `${gitlabHelper.subPrefix}:${token.serverUrl}/${email}`; + userSvc.addUserInfo({ + id: sub, + name: entry.author_name || entry.committer_name, + imageUrl: '', // No way to get user's avatar url... + }); + const date = entry.authored_date || entry.committed_date || 1; + return { + id: entry.id, + sub, + message: entry.commit && entry.commit.message, + created: date ? new Date(date).getTime() : 1, + }; + }); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const { data } = await gitlabHelper.downloadFile({ + ...store.getters['workspace/currentWorkspace'], + token, + branch: revisionId, + path: getAbsolutePath({ id: fileSyncDataId }), + }); + return Provider.parseContent(data, contentId); + }, +}); diff --git a/src/services/providers/googleDriveAppDataProvider.js b/src/services/providers/googleDriveAppDataProvider.js new file mode 100644 index 0000000..196f635 --- /dev/null +++ b/src/services/providers/googleDriveAppDataProvider.js @@ -0,0 +1,187 @@ +import store from '../../store'; +import googleHelper from './helpers/googleHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; + +let syncStartPageToken; + +export default new Provider({ + id: 'googleDriveAppData', + name: 'Google Drive app data', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams() { + // No param as it's the main workspace + return {}; + }, + getWorkspaceLocationUrl() { + // No direct link to app data + return null; + }, + getSyncDataUrl() { + // No direct link to app data + return null; + }, + getSyncDataDescription({ id }) { + return id; + }, + async initWorkspace() { + // Nothing much to do since the main workspace isn't necessarily synchronized + // Return the main workspace + return store.getters['workspace/workspacesById'].main; + }, + async getChanges() { + const syncToken = store.getters['workspace/syncToken']; + const startPageToken = store.getters['data/localSettings'].syncStartPageToken; + const result = await googleHelper.getChanges(syncToken, startPageToken, true); + const changes = result.changes.filter((change) => { + if (change.file) { + // Parse item from file name + try { + change.item = JSON.parse(change.file.name); + } catch (e) { + return false; + } + // Build sync data + change.syncData = { + id: change.fileId, + itemId: change.item.id, + type: change.item.type, + hash: change.item.hash, + }; + } + change.syncDataId = change.fileId; + return true; + }); + syncStartPageToken = result.startPageToken; + return changes; + }, + onChangesApplied() { + store.dispatch('data/patchLocalSettings', { + syncStartPageToken, + }); + }, + async saveWorkspaceItem({ item, syncData, ifNotTooLate }) { + const syncToken = store.getters['workspace/syncToken']; + const file = await googleHelper.uploadAppDataFile({ + token: syncToken, + name: JSON.stringify(item), + fileId: syncData && syncData.id, + ifNotTooLate, + }); + + // Build sync data to save + return { + syncData: { + id: file.id, + itemId: item.id, + type: item.type, + hash: item.hash, + }, + }; + }, + removeWorkspaceItem({ syncData, ifNotTooLate }) { + const syncToken = store.getters['workspace/syncToken']; + return googleHelper.removeAppDataFile(syncToken, syncData.id, ifNotTooLate); + }, + async downloadWorkspaceContent({ token, contentSyncData }) { + const data = await googleHelper.downloadAppDataFile(token, contentSyncData.id); + const content = utils.addItemHash(JSON.parse(data)); + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + }, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const data = await googleHelper.downloadAppDataFile(token, syncData.id); + const item = utils.addItemHash(JSON.parse(data)); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + contentSyncData, + ifNotTooLate, + }) { + const gdriveFile = await googleHelper.uploadAppDataFile({ + token, + name: JSON.stringify({ + id: content.id, + type: content.type, + hash: content.hash, + }), + media: JSON.stringify(content), + fileId: contentSyncData && contentSyncData.id, + ifNotTooLate, + }); + + // Return new sync data + return { + contentSyncData: { + id: gdriveFile.id, + itemId: content.id, + type: content.type, + hash: content.hash, + }, + }; + }, + async uploadWorkspaceData({ + token, + item, + syncData, + ifNotTooLate, + }) { + const file = await googleHelper.uploadAppDataFile({ + token, + name: JSON.stringify({ + id: item.id, + type: item.type, + hash: item.hash, + }), + media: JSON.stringify(item), + fileId: syncData && syncData.id, + ifNotTooLate, + }); + + // Return new sync data + return { + syncData: { + id: file.id, + itemId: item.id, + type: item.type, + hash: item.hash, + }, + }; + }, + async listFileRevisions({ token, contentSyncDataId }) { + const revisions = await googleHelper.getAppDataFileRevisions(token, contentSyncDataId); + return revisions.map(revision => ({ + id: revision.id, + sub: `${googleHelper.subPrefix}:${revision.lastModifyingUser.permissionId}`, + created: new Date(revision.modifiedTime).getTime(), + })); + }, + async loadFileRevision() { + // Revisions are already loaded + return false; + }, + async getFileRevisionContent({ token, contentSyncDataId, revisionId }) { + const content = await googleHelper + .downloadAppDataFileRevision(token, contentSyncDataId, revisionId); + return JSON.parse(content); + }, +}); diff --git a/src/services/providers/googleDriveProvider.js b/src/services/providers/googleDriveProvider.js new file mode 100644 index 0000000..0dcb774 --- /dev/null +++ b/src/services/providers/googleDriveProvider.js @@ -0,0 +1,216 @@ +import store from '../../store'; +import googleHelper from './helpers/googleHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; + +export default new Provider({ + id: 'googleDrive', + name: 'Google Drive', + getToken({ sub }) { + const token = store.getters['data/googleTokensBySub'][sub]; + return token && token.isDrive ? token : null; + }, + getLocationUrl({ driveFileId }) { + return `https://docs.google.com/file/d/${driveFileId}/edit`; + }, + getLocationDescription({ driveFileId }) { + return driveFileId; + }, + async initAction() { + const state = googleHelper.driveState || {}; + if (state.userId) { + // Try to find the token corresponding to the user ID + let token = store.getters['data/googleTokensBySub'][state.userId]; + // If not found or not enough permission, popup an OAuth2 window + if (!token || !token.isDrive) { + await store.dispatch('modal/open', { type: 'googleDriveAccount' }); + token = await googleHelper.addDriveAccount( + !store.getters['data/localSettings'].googleDriveRestrictedAccess, + state.userId, + ); + } + + const openWorkspaceIfExists = (file) => { + const folderId = file + && file.appProperties + && file.appProperties.folderId; + if (folderId) { + // See if we have the corresponding workspace + const workspaceParams = { + providerId: 'googleDriveWorkspace', + folderId, + }; + const workspaceId = utils.makeWorkspaceId(workspaceParams); + const workspace = store.getters['workspace/workspacesById'][workspaceId]; + // If we have the workspace, open it by changing the current URL + if (workspace) { + utils.setQueryParams(workspaceParams); + } + } + }; + + switch (state.action) { + case 'create': + default: + // See if folder is part of a workspace we can open + try { + const folder = await googleHelper.getFile(token, state.folderId); + folder.appProperties = folder.appProperties || {}; + googleHelper.driveActionFolder = folder; + openWorkspaceIfExists(folder); + } catch (err) { + if (!err || err.status !== 404) { + throw err; + } + // We received an HTTP 404 meaning we have no permission to read the folder + googleHelper.driveActionFolder = { id: state.folderId }; + } + break; + + case 'open': { + await utils.awaitSequence(state.ids || [], async (id) => { + const file = await googleHelper.getFile(token, id); + file.appProperties = file.appProperties || {}; + googleHelper.driveActionFiles.push(file); + }); + + // Check if first file is part of a workspace + openWorkspaceIfExists(googleHelper.driveActionFiles[0]); + } + } + } + }, + async performAction() { + const state = googleHelper.driveState || {}; + const token = store.getters['data/googleTokensBySub'][state.userId]; + switch (token && state.action) { + case 'create': { + const file = await workspaceSvc.createFile({}, true); + store.commit('file/setCurrentId', file.id); + // Return a new syncLocation + return this.makeLocation(token, null, googleHelper.driveActionFolder.id); + } + case 'open': + store.dispatch( + 'queue/enqueue', + () => this.openFiles(token, googleHelper.driveActionFiles), + ); + return null; + default: + return null; + } + }, + async downloadContent(token, syncLocation) { + const content = await googleHelper.downloadFile(token, syncLocation.driveFileId); + return Provider.parseContent(content, `${syncLocation.fileId}/content`); + }, + async uploadContent(token, content, syncLocation, ifNotTooLate) { + const file = store.state.file.itemsById[syncLocation.fileId]; + const name = utils.sanitizeName(file && file.name); + const parents = []; + if (syncLocation.driveParentId) { + parents.push(syncLocation.driveParentId); + } + const driveFile = await googleHelper.uploadFile({ + token, + name, + parents, + media: Provider.serializeContent(content), + fileId: syncLocation.driveFileId, + ifNotTooLate, + }); + return { + ...syncLocation, + driveFileId: driveFile.id, + }; + }, + async publish(token, html, metadata, publishLocation) { + const driveFile = await googleHelper.uploadFile({ + token, + name: metadata.title, + parents: [], + media: html, + mediaType: publishLocation.templateId ? 'text/html' : undefined, + fileId: publishLocation.driveFileId, + }); + return { + ...publishLocation, + driveFileId: driveFile.id, + }; + }, + async openFiles(token, driveFiles) { + return utils.awaitSequence(driveFiles, async (driveFile) => { + // Check if the file exists and open it + if (!Provider.openFileWithLocation({ + providerId: this.id, + driveFileId: driveFile.id, + })) { + // Download content from Google Drive + const syncLocation = { + driveFileId: driveFile.id, + providerId: this.id, + sub: token.sub, + }; + let content; + try { + content = await this.downloadContent(token, syncLocation); + } catch (e) { + store.dispatch('notification/error', `Could not open file ${driveFile.id}.`); + return; + } + + // Create the file + const item = await workspaceSvc.createFile({ + name: driveFile.name, + parentId: store.getters['file/current'].parentId, + text: content.text, + properties: content.properties, + discussions: content.discussions, + comments: content.comments, + }, true); + store.commit('file/setCurrentId', item.id); + workspaceSvc.addSyncLocation({ + ...syncLocation, + fileId: item.id, + }); + store.dispatch('notification/info', `${store.getters['file/current'].name}已从Google Drive导入。`); + } + }); + }, + makeLocation(token, fileId, folderId) { + const location = { + providerId: this.id, + sub: token.sub, + }; + if (fileId) { + location.driveFileId = fileId; + } + if (folderId) { + location.driveParentId = folderId; + } + return location; + }, + async listFileRevisions({ token, syncLocation }) { + const revisions = await googleHelper.getFileRevisions(token, syncLocation.driveFileId); + return revisions.map(revision => ({ + id: revision.id, + sub: `${googleHelper.subPrefix}:${revision.lastModifyingUser.permissionId}`, + created: new Date(revision.modifiedTime).getTime(), + })); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + syncLocation, + revisionId, + }) { + const content = await googleHelper + .downloadFileRevision(token, syncLocation.driveFileId, revisionId); + return Provider.parseContent(content, contentId); + }, +}); diff --git a/src/services/providers/googleDriveWorkspaceProvider.js b/src/services/providers/googleDriveWorkspaceProvider.js new file mode 100644 index 0000000..0f9429b --- /dev/null +++ b/src/services/providers/googleDriveWorkspaceProvider.js @@ -0,0 +1,534 @@ +import store from '../../store'; +import googleHelper from './helpers/googleHelper'; +import Provider from './common/Provider'; +import utils from '../utils'; +import workspaceSvc from '../workspaceSvc'; +import badgeSvc from '../badgeSvc'; + +let fileIdToOpen; +let syncStartPageToken; + +export default new Provider({ + id: 'googleDriveWorkspace', + name: 'Google Drive', + getToken() { + return store.getters['workspace/syncToken']; + }, + getWorkspaceParams({ folderId }) { + return { + providerId: this.id, + folderId, + }; + }, + getWorkspaceLocationUrl({ folderId }) { + return `https://docs.google.com/folder/d/${folderId}`; + }, + getSyncDataUrl({ id }) { + return `https://docs.google.com/file/d/${id}/edit`; + }, + getSyncDataDescription({ id }) { + return id; + }, + async initWorkspace() { + const makeWorkspaceId = folderId => folderId + && utils.makeWorkspaceId(this.getWorkspaceParams({ folderId })); + + const getWorkspace = folderId => + store.getters['workspace/workspacesById'][makeWorkspaceId(folderId)]; + + const initFolder = async (token, folder) => { + const appProperties = { + folderId: folder.id, + dataFolderId: folder.appProperties.dataFolderId, + trashFolderId: folder.appProperties.trashFolderId, + }; + + // Make sure data folder exists + if (!appProperties.dataFolderId) { + const dataFolder = await googleHelper.uploadFile({ + token, + name: '.stackedit-data', + parents: [folder.id], + appProperties: { folderId: folder.id }, + mediaType: googleHelper.folderMimeType, + }); + appProperties.dataFolderId = dataFolder.id; + } + + // Make sure trash folder exists + if (!appProperties.trashFolderId) { + const trashFolder = await googleHelper.uploadFile({ + token, + name: '.stackedit-trash', + parents: [folder.id], + appProperties: { folderId: folder.id }, + mediaType: googleHelper.folderMimeType, + }); + appProperties.trashFolderId = trashFolder.id; + } + + // Update workspace if some properties are missing + if (appProperties.folderId !== folder.appProperties.folderId + || appProperties.dataFolderId !== folder.appProperties.dataFolderId + || appProperties.trashFolderId !== folder.appProperties.trashFolderId + ) { + await googleHelper.uploadFile({ + token, + appProperties, + mediaType: googleHelper.folderMimeType, + fileId: folder.id, + }); + } + + // Update workspace in the store + const workspaceId = makeWorkspaceId(folder.id); + store.dispatch('workspace/patchWorkspacesById', { + [workspaceId]: { + id: workspaceId, + sub: token.sub, + name: folder.name, + providerId: this.id, + folderId: folder.id, + teamDriveId: folder.teamDriveId, + dataFolderId: appProperties.dataFolderId, + trashFolderId: appProperties.trashFolderId, + }, + }); + }; + + // Token sub is in the workspace or in the url if workspace is about to be created + const { sub } = getWorkspace(utils.queryParams.folderId) || utils.queryParams; + // See if we already have a token + let token = store.getters['data/googleTokensBySub'][sub]; + // If no token has been found, popup an authorize window and get one + if (!token || !token.isDrive || !token.driveFullAccess) { + await store.dispatch('modal/open', 'workspaceGoogleRedirection'); + token = await googleHelper.addDriveAccount(true, utils.queryParams.sub); + } + + let { folderId } = utils.queryParams; + // If no folderId is provided, create one + if (!folderId) { + const folder = await googleHelper.uploadFile({ + token, + name: 'StackEdit workspace', + parents: [], + mediaType: googleHelper.folderMimeType, + }); + await initFolder(token, { + ...folder, + appProperties: {}, + }); + folderId = folder.id; + } + + // Init workspace + if (!getWorkspace(folderId)) { + let folder; + try { + folder = await googleHelper.getFile(token, folderId); + } catch (err) { + throw new Error(`Folder ${folderId} is not accessible. Make sure you have the right permissions.`); + } + folder.appProperties = folder.appProperties || {}; + const folderIdProperty = folder.appProperties.folderId; + if (folderIdProperty && folderIdProperty !== folderId) { + throw new Error(`Folder ${folderId} is part of another workspace.`); + } + await initFolder(token, folder); + } + + badgeSvc.addBadge('addGoogleDriveWorkspace'); + return getWorkspace(folderId); + }, + async performAction() { + const state = googleHelper.driveState || {}; + const token = this.getToken(); + switch (token && state.action) { + case 'create': { + const driveFolder = googleHelper.driveActionFolder; + let syncData = store.getters['data/syncDataById'][driveFolder.id]; + if (!syncData && driveFolder.appProperties.id) { + // Create folder if not already synced + store.commit('folder/setItem', { + id: driveFolder.appProperties.id, + name: driveFolder.name, + }); + const item = store.state.folder.itemsById[driveFolder.appProperties.id]; + syncData = { + id: driveFolder.id, + itemId: item.id, + type: item.type, + hash: item.hash, + }; + store.dispatch('data/patchSyncDataById', { + [syncData.id]: syncData, + }); + } + const file = await workspaceSvc.createFile({ + parentId: syncData && syncData.itemId, + }, true); + store.commit('file/setCurrentId', file.id); + // File will be created on next workspace sync + break; + } + case 'open': { + // open first file only + const firstFile = googleHelper.driveActionFiles[0]; + const syncData = store.getters['data/syncDataById'][firstFile.id]; + if (!syncData) { + fileIdToOpen = firstFile.id; + } else { + store.commit('file/setCurrentId', syncData.itemId); + } + break; + } + default: + } + }, + async getChanges() { + const workspace = store.getters['workspace/currentWorkspace']; + const syncToken = store.getters['workspace/syncToken']; + const lastStartPageToken = store.getters['data/localSettings'].syncStartPageToken; + const { changes, startPageToken } = await googleHelper + .getChanges(syncToken, lastStartPageToken, false, workspace.teamDriveId); + + syncStartPageToken = startPageToken; + return changes; + }, + prepareChanges(changes) { + // Collect possible parent IDs + const parentIds = {}; + Object.entries(store.getters['data/syncDataByItemId']).forEach(([id, syncData]) => { + parentIds[syncData.id] = id; + }); + changes.forEach((change) => { + const { id } = (change.file || {}).appProperties || {}; + if (id) { + parentIds[change.fileId] = id; + } + }); + + // Collect changes + const workspace = store.getters['workspace/currentWorkspace']; + const result = []; + changes.forEach((change) => { + // Ignore changes on StackEdit own folders + if (change.fileId === workspace.folderId + || change.fileId === workspace.dataFolderId + || change.fileId === workspace.trashFolderId + ) { + return; + } + + let contentChange; + if (change.file) { + // Ignore changes in files that are not in the workspace + const { appProperties } = change.file; + if (!appProperties || appProperties.folderId !== workspace.folderId + ) { + return; + } + + // If change is on a data item + if (change.file.parents[0] === workspace.dataFolderId) { + // Data item has a JSON filename + try { + change.item = JSON.parse(change.file.name); + } catch (e) { + return; + } + } else { + // Change on a file or folder + const type = change.file.mimeType === googleHelper.folderMimeType + ? 'folder' + : 'file'; + const item = { + id: appProperties.id, + type, + name: change.file.name, + parentId: null, + }; + + // Fill parentId + if (change.file.parents.some(parentId => parentId === workspace.trashFolderId)) { + item.parentId = 'trash'; + } else { + change.file.parents.some((parentId) => { + if (!parentIds[parentId]) { + return false; + } + item.parentId = parentIds[parentId]; + return true; + }); + } + change.item = utils.addItemHash(item); + + if (type === 'file') { + // create a fake change as a file content change + const id = `${appProperties.id}/content`; + const syncDataId = `${change.fileId}/content`; + contentChange = { + item: { + id, + type: 'content', + // Need a truthy value to force saving sync data + hash: 1, + }, + syncData: { + id: syncDataId, + itemId: id, + type: 'content', + // Need a truthy value to force downloading the content + hash: 1, + }, + syncDataId, + }; + } + } + + // Build sync data + change.syncData = { + id: change.fileId, + parentIds: change.file.parents, + itemId: change.item.id, + type: change.item.type, + hash: change.item.hash, + }; + } else { + // Item was removed + const syncData = store.getters['data/syncDataById'][change.fileId]; + if (syncData && syncData.type === 'file') { + // create a fake change as a file content change + contentChange = { + syncDataId: `${change.fileId}/content`, + }; + } + } + + // Push change + change.syncDataId = change.fileId; + result.push(change); + if (contentChange) { + result.push(contentChange); + } + }); + + return result; + }, + onChangesApplied() { + store.dispatch('data/patchLocalSettings', { + syncStartPageToken, + }); + }, + async saveWorkspaceItem({ item, syncData, ifNotTooLate }) { + const workspace = store.getters['workspace/currentWorkspace']; + const syncToken = store.getters['workspace/syncToken']; + let file; + if (item.type !== 'file' && item.type !== 'folder') { + // For sync/publish locations, store item as filename + file = await googleHelper.uploadFile({ + token: syncToken, + name: JSON.stringify(item), + parents: [workspace.dataFolderId], + appProperties: { + folderId: workspace.folderId, + }, + fileId: syncData && syncData.id, + oldParents: syncData && syncData.parentIds, + ifNotTooLate, + }); + } else { + // For type `file` or `folder` + const parentSyncData = store.getters['data/syncDataByItemId'][item.parentId]; + let parentId; + if (item.parentId === 'trash') { + parentId = workspace.trashFolderId; + } else if (parentSyncData) { + parentId = parentSyncData.id; + } else { + parentId = workspace.folderId; + } + + file = await googleHelper.uploadFile({ + token: syncToken, + name: item.name, + parents: [parentId], + appProperties: { + id: item.id, + folderId: workspace.folderId, + }, + mediaType: item.type === 'folder' ? googleHelper.folderMimeType : undefined, + fileId: syncData && syncData.id, + oldParents: syncData && syncData.parentIds, + ifNotTooLate, + }); + } + + // Build sync data to save + return { + syncData: { + id: file.id, + parentIds: file.parents, + itemId: item.id, + type: item.type, + hash: item.hash, + }, + }; + }, + async removeWorkspaceItem({ syncData, ifNotTooLate }) { + // Ignore content deletion + if (syncData.type !== 'content') { + const syncToken = store.getters['workspace/syncToken']; + await googleHelper.removeFile(syncToken, syncData.id, ifNotTooLate); + } + }, + async downloadWorkspaceContent({ token, contentSyncData, fileSyncData }) { + const data = await googleHelper.downloadFile(token, fileSyncData.id); + const content = Provider.parseContent(data, contentSyncData.itemId); + + // Open the file requested by action if it wasn't synced yet + if (fileIdToOpen && fileIdToOpen === fileSyncData.id) { + fileIdToOpen = null; + // Open the file once downloaded content has been stored + setTimeout(() => { + store.commit('file/setCurrentId', fileSyncData.itemId); + }, 10); + } + + return { + content, + contentSyncData: { + ...contentSyncData, + hash: content.hash, + }, + }; + }, + async downloadWorkspaceData({ token, syncData }) { + if (!syncData) { + return {}; + } + + const content = await googleHelper.downloadFile(token, syncData.id); + const item = JSON.parse(content); + return { + item, + syncData: { + ...syncData, + hash: item.hash, + }, + }; + }, + async uploadWorkspaceContent({ + token, + content, + file, + fileSyncData, + ifNotTooLate, + }) { + let gdriveFile; + let newFileSyncData; + + if (fileSyncData) { + // Only update file media + gdriveFile = await googleHelper.uploadFile({ + token, + media: Provider.serializeContent(content), + fileId: fileSyncData.id, + ifNotTooLate, + }); + } else { + // Create file with media + const workspace = store.getters['workspace/currentWorkspace']; + const parentSyncData = store.getters['data/syncDataByItemId'][file.parentId]; + gdriveFile = await googleHelper.uploadFile({ + token, + name: file.name, + parents: [parentSyncData ? parentSyncData.id : workspace.folderId], + appProperties: { + id: file.id, + folderId: workspace.folderId, + }, + media: Provider.serializeContent(content), + ifNotTooLate, + }); + + // Create file sync data + newFileSyncData = { + id: gdriveFile.id, + parentIds: gdriveFile.parents, + itemId: file.id, + type: file.type, + hash: file.hash, + }; + } + + // Return new sync data + return { + contentSyncData: { + id: `${gdriveFile.id}/content`, + itemId: content.id, + type: content.type, + hash: content.hash, + }, + fileSyncData: newFileSyncData, + }; + }, + async uploadWorkspaceData({ + token, + item, + syncData, + ifNotTooLate, + }) { + const workspace = store.getters['workspace/currentWorkspace']; + const file = await googleHelper.uploadFile({ + token, + name: JSON.stringify({ + id: item.id, + type: item.type, + hash: item.hash, + }), + parents: [workspace.dataFolderId], + appProperties: { + folderId: workspace.folderId, + }, + media: JSON.stringify(item), + mediaType: 'application/json', + fileId: syncData && syncData.id, + oldParents: syncData && syncData.parentIds, + ifNotTooLate, + }); + + // Return new sync data + return { + syncData: { + id: file.id, + parentIds: file.parents, + itemId: item.id, + type: item.type, + hash: item.hash, + }, + }; + }, + async listFileRevisions({ token, fileSyncDataId }) { + const revisions = await googleHelper.getFileRevisions(token, fileSyncDataId); + return revisions.map(revision => ({ + id: revision.id, + sub: `${googleHelper.subPrefix}:${revision.lastModifyingUser.permissionId}`, + created: new Date(revision.modifiedTime).getTime(), + })); + }, + async loadFileRevision() { + // Revision are already loaded + return false; + }, + async getFileRevisionContent({ + token, + contentId, + fileSyncDataId, + revisionId, + }) { + const content = await googleHelper.downloadFileRevision(token, fileSyncDataId, revisionId); + return Provider.parseContent(content, contentId); + }, +}); diff --git a/src/services/providers/helpers/couchdbHelper.js b/src/services/providers/helpers/couchdbHelper.js new file mode 100644 index 0000000..84eca0e --- /dev/null +++ b/src/services/providers/helpers/couchdbHelper.js @@ -0,0 +1,194 @@ +import networkSvc from '../../networkSvc'; +import utils from '../../utils'; +import store from '../../../store'; +import userSvc from '../../userSvc'; + +const request = async (token, options = {}) => { + const baseUrl = `${token.dbUrl}/`; + const getLastToken = () => store.getters['data/couchdbTokensBySub'][token.sub]; + + const assertUnauthorized = (err) => { + if (err.status !== 401) { + throw err; + } + }; + + const onUnauthorized = async () => { + try { + const { name, password } = getLastToken(); + await networkSvc.request({ + method: 'POST', + url: utils.resolveUrl(baseUrl, '../_session'), + withCredentials: true, + body: { + name, + password, + }, + }); + } catch (err) { + assertUnauthorized(err); + await store.dispatch('modal/open', { + type: 'couchdbCredentials', + token: getLastToken(), + }); + await onUnauthorized(); + } + }; + + const config = { + ...options, + headers: { + Accept: 'application/json', + ...options.headers || {}, + }, + url: utils.resolveUrl(baseUrl, options.path || '.'), + withCredentials: true, + }; + + try { + let res; + try { + res = await networkSvc.request(config); + } catch (err) { + assertUnauthorized(err); + await onUnauthorized(); + res = await networkSvc.request(config); + } + return res.body; + } catch (err) { + if (err.status === 409) { + throw new Error('TOO_LATE'); + } + throw err; + } +}; + +export default { + + /** + * http://docs.couchdb.org/en/2.1.1/api/database/common.html#db + */ + getDb(token) { + return request(token); + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/database/changes.html#db-changes + */ + async getChanges(token, lastSeq) { + const result = { + changes: [], + lastSeq, + }; + + const getPage = async () => { + const body = await request(token, { + method: 'GET', + path: '_changes', + params: { + since: result.lastSeq || 0, + include_docs: true, + limit: 1000, + }, + }); + result.changes = [...result.changes, ...body.results]; + result.lastSeq = body.last_seq; + if (body.pending) { + return getPage(); + } + return result; + }; + + return getPage(); + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/database/common.html#post--db + * http://docs.couchdb.org/en/2.1.1/api/document/common.html#put--db-docid + */ + async uploadDocument({ + token, + item, + data = null, + dataType = null, + documentId = null, + rev = null, + }) { + const options = { + method: 'POST', + body: { item, time: Date.now() }, + }; + const userId = userSvc.getCurrentUserId(); + if (userId) { + options.body.sub = userId; + } + if (documentId) { + options.method = 'PUT'; + options.path = documentId; + options.body._rev = rev; // eslint-disable-line no-underscore-dangle + } + if (data) { + options.body._attachments = { // eslint-disable-line no-underscore-dangle + data: { + content_type: dataType, + data: utils.encodeBase64(data), + }, + }; + } + return request(token, options); + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/document/common.html#delete--db-docid + */ + async removeDocument(token, documentId, rev) { + if (!documentId) { + // Prevent from deleting the whole database + throw new Error('Missing document ID'); + } + + return request(token, { + method: 'DELETE', + path: documentId, + params: { rev }, + }); + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/document/common.html#get--db-docid + */ + async retrieveDocument(token, documentId, rev) { + return request(token, { + path: documentId, + params: { rev }, + }); + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/document/common.html#get--db-docid + */ + async retrieveDocumentWithAttachments(token, documentId, rev) { + const body = await request(token, { + path: documentId, + params: { attachments: true, rev }, + }); + body.attachments = {}; + // eslint-disable-next-line no-underscore-dangle + Object.entries(body._attachments).forEach(([name, attachment]) => { + body.attachments[name] = utils.decodeBase64(attachment.data); + }); + return body; + }, + + /** + * http://docs.couchdb.org/en/2.1.1/api/document/common.html#get--db-docid + */ + async retrieveDocumentWithRevisions(token, documentId) { + return request(token, { + path: documentId, + params: { + revs_info: true, + }, + }); + }, +}; diff --git a/src/services/providers/helpers/customHelper.js b/src/services/providers/helpers/customHelper.js new file mode 100644 index 0000000..272b4fc --- /dev/null +++ b/src/services/providers/helpers/customHelper.js @@ -0,0 +1,69 @@ +import md5 from 'js-md5'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; +import utils from '../../utils'; + +/** + * 自定义账号前缀 + */ +const subPrefix = 'cs'; +export default { + subPrefix, + async addAccount({ + name, + uploadUrl, + fileParamName, + customHeaders, + customParams, + resultUrlParam, + }) { + userSvc.addUserInfo({ + id: `${subPrefix}:${utils.encodeBase64(name)}`, + name, + imageUrl: '', + }); + // Build token object including sub + const token = { + uploadUrl, + fileParamName, + customHeaders, + customParams, + resultUrlParam, + name, + sub: utils.encodeBase64(name), + }; + // Add token to smms tokens + store.dispatch('data/addCustomToken', token); + badgeSvc.addBadge('addCustomAccount'); + return token; + }, + async uploadFile({ + token, + file, + }) { + const newFileName = `${md5(await utils.encodeFiletoBase64(file))}.${file.type.split('/')[1]}`; + const newfile = new File([file], newFileName, { type: file.type }); + const headers = token.customHeaders || {}; + const formData = token.customParams || {}; + formData[token.fileParamName] = newfile; + const { body } = await networkSvc.request({ + method: 'POST', + url: token.uploadUrl, + headers, + formData, + }); + const paramArray = token.resultUrlParam.split('.'); + let result = body; + paramArray.forEach((paramName) => { + result = result[paramName]; + if (!result) { + store.dispatch('notification/error', `自定义图床上传图片失败,响应Body为:${JSON.stringify(body)}`); + throw new Error(`自定义图床上传图片失败,响应Body为:${JSON.stringify(body)}`); + } + }); + return result; + }, + +}; diff --git a/src/services/providers/helpers/dropboxHelper.js b/src/services/providers/helpers/dropboxHelper.js new file mode 100644 index 0000000..f9082c2 --- /dev/null +++ b/src/services/providers/helpers/dropboxHelper.js @@ -0,0 +1,190 @@ +import networkSvc from '../../networkSvc'; +import userSvc from '../../userSvc'; +import store from '../../../store'; +import badgeSvc from '../../badgeSvc'; + +const getAppKey = (fullAccess) => { + if (fullAccess) { + return store.getters['data/serverConf'].dropboxAppKeyFull; + } + return store.getters['data/serverConf'].dropboxAppKey; +}; + +const httpHeaderSafeJson = args => args && JSON.stringify(args) + .replace(/[\u007f-\uffff]/g, c => `\\u${`000${c.charCodeAt(0).toString(16)}`.slice(-4)}`); + +const request = ({ accessToken }, options, args) => networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + 'Content-Type': options.body && (typeof options.body === 'string' + ? 'application/octet-stream' : 'application/json; charset=utf-8'), + 'Dropbox-API-Arg': httpHeaderSafeJson(args), + Authorization: `Bearer ${accessToken}`, + }, +}); + +/** + * https://www.dropbox.com/developers/documentation/http/documentation#users-get_account + */ +const subPrefix = 'db'; +userSvc.setInfoResolver('dropbox', subPrefix, async (sub) => { + const dropboxToken = Object.values(store.getters['data/dropboxTokensBySub'])[0]; + try { + const { body } = await request(dropboxToken, { + method: 'POST', + url: 'https://api.dropboxapi.com/2/users/get_account', + body: { + account_id: sub, + }, + }); + + return { + id: `${subPrefix}:${body.account_id}`, + name: body.name.display_name, + imageUrl: body.profile_photo_url || '', + }; + } catch (err) { + if (!dropboxToken || err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + + /** + * https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize + * https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account + */ + async startOauth2(fullAccess, sub = null, silent = false) { + // Get an OAuth2 code + const { accessToken } = await networkSvc.startOauth2( + 'https://www.dropbox.com/oauth2/authorize', + { + client_id: getAppKey(fullAccess), + response_type: 'token', + }, + silent, + ); + + // Call the user info endpoint + const { body } = await request({ accessToken }, { + method: 'POST', + url: 'https://api.dropboxapi.com/2/users/get_current_account', + }); + userSvc.addUserInfo({ + id: `${subPrefix}:${body.account_id}`, + name: body.name.display_name, + imageUrl: body.profile_photo_url || '', + }); + + // Check the returned sub consistency + if (sub && `${body.account_id}` !== sub) { + throw new Error('Dropbox account ID not expected.'); + } + + // Build token object including scopes and sub + const token = { + accessToken, + name: body.name.display_name, + sub: `${body.account_id}`, + fullAccess, + }; + + // Add token to dropbox tokens + store.dispatch('data/addDropboxToken', token); + return token; + }, + async addAccount(fullAccess = false) { + const token = await this.startOauth2(fullAccess); + badgeSvc.addBadge('addDropboxAccount'); + return token; + }, + + /** + * https://www.dropbox.com/developers/documentation/http/documentation#files-upload + */ + async uploadFile({ + token, + path, + content, + fileId, + }) { + return (await request(token, { + method: 'POST', + url: 'https://content.dropboxapi.com/2/files/upload', + body: content, + }, { + path: fileId || path, + mode: 'overwrite', + })).body; + }, + + /** + * https://www.dropbox.com/developers/documentation/http/documentation#files-download + */ + async downloadFile({ + token, + path, + fileId, + }) { + const res = await request(token, { + method: 'POST', + url: 'https://content.dropboxapi.com/2/files/download', + raw: true, + }, { + path: fileId || path, + }); + return { + id: JSON.parse(res.headers['dropbox-api-result']).id, + content: res.body, + }; + }, + + /** + * https://www.dropbox.com/developers/documentation/http/documentation#list-revisions + */ + async listRevisions({ + token, + path, + fileId, + }) { + const res = await request(token, { + method: 'POST', + url: 'https://api.dropboxapi.com/2/files/list_revisions', + body: fileId ? { + path: fileId, + mode: 'id', + limit: 100, + } : { + path, + limit: 100, + }, + }); + return res.body.entries; + }, + + /** + * https://www.dropbox.com/developers/chooser + */ + async openChooser(token) { + if (!window.Dropbox) { + await networkSvc.loadScript('https://www.dropbox.com/static/api/2/dropins.js'); + } + return new Promise((resolve) => { + window.Dropbox.appKey = getAppKey(token.fullAccess); + window.Dropbox.choose({ + multiselect: true, + linkType: 'direct', + success: files => resolve(files.map((file) => { + const path = file.link.replace(/.*\/view\/[^/]*/, ''); + return decodeURI(path); + })), + cancel: () => resolve([]), + }); + }); + }, +}; diff --git a/src/services/providers/helpers/giteaHelper.js b/src/services/providers/helpers/giteaHelper.js new file mode 100644 index 0000000..c6188b2 --- /dev/null +++ b/src/services/providers/helpers/giteaHelper.js @@ -0,0 +1,385 @@ +import utils from '../../utils'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; +import constants from '../../../data/constants'; + +const tokenExpirationMargin = 5 * 60 * 1000; + +const request = ({ accessToken, serverUrl }, options) => networkSvc.request({ + ...options, + url: `${serverUrl}/api/v1/${options.url}`, + headers: { + ...options.headers || {}, + Authorization: `Bearer ${accessToken}`, + }, +}) + .then(res => res.body); + +const getCommitMessage = (name, path) => { + const message = store.getters['data/computedSettings'].git[name]; + return message.replace(/{{path}}/g, path); +}; + +/** + * https://try.gitea.io/api/swagger#/user/userGet + */ +const subPrefix = 'gt'; +userSvc.setInfoResolver('gitea', subPrefix, async (sub) => { + try { + const [, serverUrl, username] = sub.match(/^(.+)\/([^/]+)$/); + const user = (await networkSvc.request({ + url: `${serverUrl}/api/v1/users/${username}`, + })).body; + const uniqueSub = `${serverUrl}/${user.username}`; + + return { + id: `${subPrefix}:${uniqueSub}`, + name: user.username, + imageUrl: user.avatar_url || '', + }; + } catch (err) { + if (err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + + /** + * https://docs.gitea.io/en-us/oauth2-provider/ + */ + async startOauth2( + serverUrl, applicationId, applicationSecret, + sub = null, silent = false, refreshToken, + ) { + let apiUrl = serverUrl; + let clientId = applicationId; + let useServerConf = false; + // 获取gitea配置的参数 + await networkSvc.getServerConf(); + const confClientId = store.getters['data/serverConf'].giteaClientId; + const confServerUrl = store.getters['data/serverConf'].giteaUrl; + // 存在gitea配置则使用后端配置 + if (confClientId && confServerUrl) { + apiUrl = confServerUrl; + clientId = confClientId; + useServerConf = true; + } + let tokenBody; + if (!silent) { + // Get an OAuth2 code + const { code } = await networkSvc.startOauth2( + `${apiUrl}/login/oauth/authorize`, + { + client_id: clientId, + response_type: 'code', + redirect_uri: constants.oauth2RedirectUri, + }, + silent, + ); + if (useServerConf) { + tokenBody = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/giteaToken', + params: { + code, + grant_type: 'authorization_code', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } else { + // Exchange code with token + tokenBody = (await networkSvc.request({ + method: 'POST', + url: `${apiUrl}/login/oauth/access_token`, + body: { + client_id: clientId, + client_secret: applicationSecret, + code, + grant_type: 'authorization_code', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } + } else if (useServerConf) { + tokenBody = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/giteaToken', + params: { + refresh_token: refreshToken, + grant_type: 'refresh_token', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } else { + // Exchange refreshToken with token + tokenBody = (await networkSvc.request({ + method: 'POST', + url: `${apiUrl}/login/oauth/access_token`, + body: { + client_id: clientId, + client_secret: applicationSecret, + refresh_token: refreshToken, + grant_type: 'refresh_token', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } + + const accessToken = tokenBody.access_token; + + // Call the user info endpoint + const user = await request({ accessToken, serverUrl: apiUrl }, { + url: 'user', + }); + const uniqueSub = `${apiUrl}/${user.username}`; + userSvc.addUserInfo({ + id: `${subPrefix}:${uniqueSub}`, + name: user.username, + imageUrl: user.avatar_url || '', + }); + + // Check the returned sub consistency + if (sub && uniqueSub !== sub) { + throw new Error('Gitea account ID not expected.'); + } + + const oldToken = store.getters['data/giteaTokensBySub'][uniqueSub]; + // Build token object including scopes and sub + const token = { + accessToken, + name: user.username, + applicationId: clientId, + applicationSecret, + imgStorages: oldToken && oldToken.imgStorages, + refreshToken: tokenBody.refresh_token, + expiresOn: Date.now() + (tokenBody.expires_in * 1000), + serverUrl: apiUrl, + sub: uniqueSub, + }; + + // Add token to gitea tokens + store.dispatch('data/addGiteaToken', token); + return token; + }, + // 刷新token + async refreshToken(token) { + const { + serverUrl, + applicationId, + applicationSecret, + sub, + } = token; + const lastToken = store.getters['data/giteaTokensBySub'][sub]; + // 兼容旧的没有过期时间 + if (!lastToken.expiresOn) { + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitea', + }); + return this.startOauth2(serverUrl, applicationId, applicationSecret, sub); + } + // lastToken is not expired + if (lastToken.expiresOn > Date.now() + tokenExpirationMargin) { + return lastToken; + } + + // existing token is about to expire. + // Try to get a new token in background + try { + return await this.startOauth2( + serverUrl, applicationId, applicationSecret, + sub, true, lastToken.refreshToken, + ); + } catch (err) { + // If it fails try to popup a window + if (store.state.offline) { + throw err; + } + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitea', + }); + return this.startOauth2(serverUrl, applicationId, applicationSecret, sub); + } + }, + async addAccount({ + serverUrl, + applicationId, + applicationSecret, + }, sub = null) { + const token = await this.startOauth2( + serverUrl, + applicationId, + applicationSecret, + sub, + ); + badgeSvc.addBadge('addGiteaAccount'); + return token; + }, + async updateToken(token, imgStorageInfo) { + const imgStorages = token.imgStorages || []; + // 存储仓库唯一标识 + const sid = utils.hash(`${imgStorageInfo.repoUri}${imgStorageInfo.path}${imgStorageInfo.branch}`); + // 查询是否存在 存在则更新 + const filterStorages = imgStorages.filter(it => it.sid === sid); + if (filterStorages && filterStorages.length > 0) { + filterStorages.repoUri = imgStorageInfo.repoUri; + filterStorages.path = imgStorageInfo.path; + filterStorages.branch = imgStorageInfo.branch; + } else { + imgStorages.push({ + sid, + repoUri: imgStorageInfo.repoUri, + path: imgStorageInfo.path, + branch: imgStorageInfo.branch, + }); + token.imgStorages = imgStorages; + } + store.dispatch('data/addGiteaToken', token); + }, + async removeTokenImgStorage(token, sid) { + if (!token.imgStorages || token.imgStorages.length === 0) { + return; + } + token.imgStorages = token.imgStorages.filter(it => it.sid !== sid); + store.dispatch('data/addGiteaToken', token); + }, + async getProjectId(token, { projectPath, projectId }) { + if (projectId) { + return projectId; + } + const repoInfo = await this.getRepoInfo(token, projectPath); + return repoInfo.full_name; + }, + /** + * https://try.gitea.io/api/swagger#/repository/repoGet + */ + async getRepoInfo(token, projectPath) { + const [, repoFullName] = projectPath.match(/([^/]+\/[^/]+)$/); + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { url: `repos/${repoFullName}` }); + }, + + /** + * https://try.gitea.io/api/swagger#/repository/GetTree + */ + async getTree({ + token, + projectId, + branch, + }) { + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { + url: `repos/${projectId}/git/trees/${branch}`, + params: { + recursive: true, + per_page: 9999, + }, + }); + }, + + /** + * https://try.gitea.io/api/swagger#/repository/repoGetAllCommits + */ + async getCommits({ + token, + projectId, + branch, + path, + }) { + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { + url: `repos/${projectId}/commits`, + params: { + sha: branch, + path, + }, + }); + }, + + /** + * https://try.gitea.io/api/swagger#/repository/repoCreateFile + * https://try.gitea.io/api/swagger#/repository/repoUpdateFile + */ + async uploadFile({ + token, + projectId, + branch, + path, + content, + sha, + isImg, + commitMessage, + }) { + // 非法的文件名 不让提交 + if (!path || path.endsWith('undefined')) { + return new Promise((resolve) => { + resolve({ res: { content: { sha: null } } }); + }); + } + let uploadContent = content; + if (isImg && typeof content !== 'string') { + uploadContent = await utils.encodeFiletoBase64(content); + } + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { + method: sha ? 'PUT' : 'POST', + url: `repos/${projectId}/contents/${encodeURIComponent(path)}`, + body: { + message: commitMessage || getCommitMessage(sha ? 'updateFileMessage' : 'createFileMessage', path), + content: isImg ? uploadContent : utils.encodeBase64(content), + sha, + branch, + }, + }); + }, + + /** + * https://try.gitea.io/api/swagger#/repository/repoDeleteFile + */ + async removeFile({ + token, + projectId, + branch, + path, + sha, + }) { + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { + method: 'DELETE', + url: `repos/${projectId}/contents/${encodeURIComponent(path)}`, + body: { + message: getCommitMessage('deleteFileMessage', path), + sha, + branch, + }, + }); + }, + + /** + * https://try.gitea.io/api/swagger#/repository/repoGetContents + */ + async downloadFile({ + token, + projectId, + branch, + path, + isImg, + }) { + const refreshedToken = await this.refreshToken(token); + const { sha, content } = await request(refreshedToken, { + url: `repos/${projectId}/contents/${encodeURIComponent(path)}`, + params: { ref: branch }, + }); + return { + sha, + data: !isImg ? utils.decodeBase64(content) : content, + }; + }, +}; diff --git a/src/services/providers/helpers/giteeHelper.js b/src/services/providers/helpers/giteeHelper.js new file mode 100644 index 0000000..101050c --- /dev/null +++ b/src/services/providers/helpers/giteeHelper.js @@ -0,0 +1,423 @@ +import utils from '../../utils'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; +import constants from '../../../data/constants'; + +const tokenExpirationMargin = 5 * 60 * 1000; + +const appDataRepo = 'stackedit-app-data'; + +const request = (token, options) => networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + }, + params: { + ...options.params || {}, + t: Date.now(), // Prevent from caching + access_token: token.accessToken, + }, +}); + +const repoRequest = (token, owner, repo, options) => request(token, { + ...options, + url: `https://gitee.com/api/v5/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${options.url}`, +}) + .then(res => res.body); + +const getCommitMessage = (name, path) => { + const message = store.getters['data/computedSettings'].git[name]; + return message.replace(/{{path}}/g, path); +}; + +/** + * Getting a user from its userId is not feasible with API v3. + * Using an undocumented endpoint... + */ +const subPrefix = 'ge'; +userSvc.setInfoResolver('gitee', subPrefix, async (sub) => { + try { + const user = (await networkSvc.request({ + url: `https://gitee.com/api/v5/users/${sub}`, + params: { + t: Date.now(), // Prevent from caching + }, + })).body; + + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + return { + id: `${subPrefix}:${user.login}`, + name: user.login, + imageUrl: user.avatar_url || '', + }; + } catch (err) { + if (err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + + /** + * https://developer.gitee.com/apps/building-oauth-apps/authorization-options-for-oauth-apps/ + */ + async startOauth2(lastToken, silent = false, isMain, randomClientId) { + let tokenBody; + if (!silent) { + const clientId = (await networkSvc.request({ + method: 'GET', + url: 'giteeClientId', + params: { random: randomClientId }, + })).body; + // Get an OAuth2 code + const { code } = await networkSvc.startOauth2( + 'https://gitee.com/oauth/authorize', + { + client_id: clientId, + scope: 'projects pull_requests', + response_type: 'code', + }, + silent, + ); + // Exchange code with token + tokenBody = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/giteeToken', + params: { + clientId, + code, + oauth2RedirectUri: constants.oauth2RedirectUri, + }, + })).body; + } else { + // grant_type=refresh_token&refresh_token={refresh_token} + tokenBody = (await networkSvc.request({ + method: 'POST', + url: 'https://gitee.com/oauth/token', + params: { + grant_type: 'refresh_token', + refresh_token: lastToken.refreshToken, + }, + })).body; + } + const accessToken = tokenBody.access_token; + // Call the user info endpoint + let user = null; + try { + user = (await networkSvc.request({ + method: 'GET', + url: 'https://gitee.com/api/v5/user', + params: { + access_token: accessToken, + }, + })).body; + } catch (err) { + if (err.status === 401) { + this.startOauth2(null, false, isMain, 1); + } + throw err; + } + if (user.avatar_url && user.avatar_url.endsWith('.png') && !user.avatar_url.endsWith('no_portrait.png')) { + user.avatar_url = `${user.avatar_url}!avatar60`; + } + userSvc.addUserInfo({ + id: `${subPrefix}:${user.login}`, + name: user.login, + imageUrl: user.avatar_url || '', + }); + + // 获取同一个用户的登录token + const existingToken = store.getters['data/giteeTokensBySub'][user.login]; + + // Build token object including sub 在token失效后刷新token 如果刷新失败则触发重新授权 + const token = { + accessToken, + // 主文档空间的登录 标识登录 + isLogin: !!isMain || (existingToken && !!existingToken.isLogin), + refreshToken: tokenBody.refresh_token, + expiresOn: Date.now() + (tokenBody.expires_in * 1000), + name: user.login, + sub: `${user.login}`, + }; + if (isMain) { + token.providerId = 'giteeAppData'; + // 检查 stackedit-app-data 仓库是否已经存在 如果不存在则创建该仓库 + await this.checkAndCreateRepo(token); + } + // Add token to gitee tokens + store.dispatch('data/addGiteeToken', token); + return token; + }, + // 刷新token + async refreshToken(token) { + const { sub } = token; + const lastToken = store.getters['data/giteeTokensBySub'][sub]; + // 兼容旧的没有过期时间 + if (!lastToken.expiresOn) { + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitee', + }); + return this.startOauth2(); + } + // lastToken is not expired + if (lastToken.expiresOn > Date.now() + tokenExpirationMargin) { + return lastToken; + } + + // existing token is about to expire. + // Try to get a new token in background + try { + return await this.startOauth2(lastToken, true); + } catch (err) { + // If it fails try to popup a window + if (store.state.offline) { + throw err; + } + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitee', + }); + return this.startOauth2(); + } + }, + signin() { + return this.startOauth2(null, false, true); + }, + async addAccount() { + const token = await this.startOauth2(); + badgeSvc.addBadge('addGiteeAccount'); + return token; + }, + + /** + * https://developer.gitee.com/v3/repos/commits/#get-a-single-commit + * https://developer.gitee.com/v3/git/trees/#get-a-tree + */ + async getTree({ + token, + owner, + repo, + branch, + }) { + try { + const refreshedToken = await this.refreshToken(token); + const { commit } = await repoRequest(refreshedToken, owner, repo, { + url: `commits/${encodeURIComponent(branch)}`, + }); + const { tree, truncated } = await repoRequest(refreshedToken, owner, repo, { + url: `git/trees/${encodeURIComponent(commit.tree.sha)}?recursive=1`, + }); + if (truncated) { + throw new Error('Git tree too big. Please remove some files in the repository.'); + } + return tree; + } catch (err) { + if (err.status === 401) { + this.startOauth2(null, false, null, 1); + } + throw err; + } + }, + + async checkAndCreateRepo(token) { + const url = `https://gitee.com/api/v5/repos/${encodeURIComponent(token.name)}/${encodeURIComponent(appDataRepo)}`; + try { + await request(token, { url }); + } catch (err) { + // 不存在则创建 + if (err.status === 404) { + await request(token, { + method: 'POST', + url: 'https://gitee.com/api/v5/user/repos', + params: { + name: appDataRepo, + auto_init: true, + }, + }); + } else { + throw err; + } + } + }, + + /** + * https://developer.gitee.com/v3/repos/commits/#list-commits-on-a-repository + */ + async getCommits({ + token, + owner, + repo, + sha, + path, + }) { + const refreshedToken = await this.refreshToken(token); + return repoRequest(refreshedToken, owner, repo, { + url: 'commits', + params: { sha, path }, + }); + }, + + /** + * https://developer.gitee.com/v3/repos/contents/#create-a-file + * https://developer.gitee.com/v3/repos/contents/#update-a-file + */ + async uploadFile({ + token, + owner, + repo, + branch, + path, + content, + sha, + isImg, + commitMessage, + }) { + // 非法的文件名 不让提交 + if (!path || path.endsWith('undefined')) { + return new Promise((resolve) => { + resolve({ res: { content: { sha: null } } }); + }); + } + let uploadContent = content; + if (isImg && typeof content !== 'string') { + uploadContent = await utils.encodeFiletoBase64(content); + } + const refreshedToken = await this.refreshToken(token); + return repoRequest(refreshedToken, owner, repo, { + method: sha ? 'PUT' : 'POST', + url: `contents/${encodeURIComponent(path)}`, + body: { + message: commitMessage || getCommitMessage(sha ? 'updateFileMessage' : 'createFileMessage', path), + content: isImg ? uploadContent : utils.encodeBase64(content || ' '), + sha, + branch, + }, + }); + }, + + /** + * https://developer.gitee.com/v3/repos/contents/#delete-a-file + */ + async removeFile({ + token, + owner, + repo, + branch, + path, + sha, + }) { + const refreshedToken = await this.refreshToken(token); + return repoRequest(refreshedToken, owner, repo, { + method: 'DELETE', + url: `contents/${encodeURIComponent(path)}`, + body: { + message: getCommitMessage('deleteFileMessage', path), + sha, + branch, + }, + }); + }, + + /** + * https://developer.gitee.com/v3/repos/contents/#get-contents + */ + async downloadFile({ + token, + owner, + repo, + branch, + path, + isImg, + }) { + const refreshedToken = await this.refreshToken(token); + const { sha, content } = await repoRequest(refreshedToken, owner, repo, { + url: `contents/${encodeURIComponent(path)}`, + params: { ref: branch }, + }); + if (sha) { + const data = !isImg ? utils.decodeBase64(content) : content; + return { + sha, + data: data === ' ' ? '' : data, + }; + } + return {}; + }, + + /** + * https://gitee.com/api/v5/swagger#/postV5Gists + * https://gitee.com/api/v5/swagger#/patchV5GistsId + */ + async uploadGist({ + token, + description, + filename, + content, + isPublic, + gistId, + }) { + const { body } = await request(token, gistId ? { + method: 'PATCH', + url: `https://gitee.com/api/v5/gists/${gistId}`, + body: { + description, + files: { + [filename]: { + content, + }, + }, + }, + } : { + method: 'POST', + url: 'https://gitee.com/api/v5/gists', + body: { + description, + files: { + [filename]: { + content, + }, + }, + public: isPublic, + }, + }); + return body; + }, + + /** + * https://gitee.com/api/v5/swagger#/getV5Gists + */ + async downloadGist({ + token, + gistId, + filename, + }) { + const result = (await request(token, { + url: `https://api.github.com/gists/${gistId}`, + })).body.files[filename]; + if (!result) { + throw new Error('Gist file not found.'); + } + return result.content; + }, + + /** + * https://gitee.com/api/v5/swagger#/getV5GistsIdCommits + */ + async getGistCommits({ + token, + gistId, + }) { + const { body } = await request(token, { + url: `https://gitee.com/api/v5/gists/${gistId}/commits`, + }); + return body; + }, +}; diff --git a/src/services/providers/helpers/githubHelper.js b/src/services/providers/helpers/githubHelper.js new file mode 100644 index 0000000..f186870 --- /dev/null +++ b/src/services/providers/helpers/githubHelper.js @@ -0,0 +1,441 @@ +import utils from '../../utils'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; + +const getScopes = token => [token.repoFullAccess ? 'repo' : 'public_repo', 'gist']; + +const appDataRepo = 'stackedit-app-data'; + +const request = (token, options) => networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + Authorization: `token ${token.accessToken}`, + }, + params: { + ...options.params || {}, + t: Date.now(), // Prevent from caching + }, +}); + +const repoRequest = (token, owner, repo, options) => request(token, { + ...options, + url: `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${options.url}`, +}) + .then(res => res.body); + +const getCommitMessage = (name, path) => { + const message = store.getters['data/computedSettings'].git[name]; + return message.replace(/{{path}}/g, path); +}; + +/** + * Getting a user from its userId is not feasible with API v3. + * Using an undocumented endpoint... + */ +const subPrefix = 'gh'; +userSvc.setInfoResolver('github', subPrefix, async (sub) => { + try { + const user = (await networkSvc.request({ + url: `https://api.github.com/user/${sub}`, + params: { + t: Date.now(), // Prevent from caching + }, + })).body; + + return { + id: `${subPrefix}:${user.id}`, + name: user.login, + imageUrl: user.avatar_url || '', + }; + } catch (err) { + if (err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + + /** + * https://developer.github.com/apps/building-oauth-apps/authorization-options-for-oauth-apps/ + */ + async startOauth2(scopes, sub = null, silent = false, isMain) { + await networkSvc.getServerConf(); + const clientId = store.getters['data/serverConf'].githubClientId; + + // Get an OAuth2 code + const { code } = await networkSvc.startOauth2( + 'https://github.com/login/oauth/authorize', + { + client_id: clientId, + scope: scopes.join(' '), + }, + silent, + ); + + // Exchange code with token + const accessToken = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/githubToken', + params: { + clientId, + code, + }, + })).body; + + // Call the user info endpoint + const user = (await networkSvc.request({ + method: 'GET', + url: 'https://api.github.com/user', + headers: { + Authorization: `Bearer ${accessToken}`, + }, + })).body; + userSvc.addUserInfo({ + id: `${subPrefix}:${user.id}`, + name: user.login, + imageUrl: user.avatar_url || '', + }); + + // Check the returned sub consistency + if (sub && `${user.id}` !== sub) { + throw new Error('GitHub account ID not expected.'); + } + + const oldToken = store.getters['data/githubTokensBySub'][user.id]; + // Build token object including scopes and sub + const token = { + scopes, + accessToken, + // 主文档空间的登录 标识登录 + isLogin: !!isMain || (oldToken && !!oldToken.isLogin), + name: user.login, + sub: `${user.id}`, + imgStorages: oldToken && oldToken.imgStorages, + repoFullAccess: scopes.includes('repo'), + }; + + if (isMain) { + token.providerId = 'githubAppData'; + // check stackedit-app-data repo exist? + await this.checkAndCreateRepo(token); + } + // Add token to github tokens + store.dispatch('data/addGithubToken', token); + return token; + }, + signin() { + return this.startOauth2(['repo', 'gist'], null, false, true); + }, + async addAccount(repoFullAccess = false) { + const token = await this.startOauth2(getScopes({ repoFullAccess })); + badgeSvc.addBadge('addGitHubAccount'); + return token; + }, + + /** + * https://developer.github.com/v3/repos/commits/#get-a-single-commit + * https://developer.github.com/v3/git/trees/#get-a-tree + */ + async getTree({ + token, + owner, + repo, + branch, + }) { + const { commit } = await repoRequest(token, owner, repo, { + url: `commits/${encodeURIComponent(branch)}`, + }); + const { tree, truncated } = await repoRequest(token, owner, repo, { + url: `git/trees/${encodeURIComponent(commit.tree.sha)}?recursive=1`, + }); + if (truncated) { + throw new Error('Git tree too big. Please remove some files in the repository.'); + } + return tree; + }, + + async checkAndCreateRepo(token) { + const url = `https://api.github.com/repos/${encodeURIComponent(token.name)}/${encodeURIComponent(appDataRepo)}`; + try { + await request(token, { url }); + } catch (err) { + // create + if (err.status === 404) { + await request(token, { + method: 'POST', + url: 'https://api.github.com/repos/mafgwo/stackedit-appdata-template/generate', + body: { + owner: token.name, + name: appDataRepo, + description: 'StackEdit中文版默认空间.', + include_all_branches: false, + private: true, + }, + }); + } else { + throw err; + } + } + }, + + /** + * https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + */ + async getCommits({ + token, + owner, + repo, + sha, + path, + tryTimes, + }) { + let tryCount = tryTimes || 1; + try { + return repoRequest(token, owner, repo, { + url: 'commits', + params: { sha, path }, + }); + } catch (err) { + // 主文档 并且 409 则重试3次 + if (tryCount <= 3 && err.status === 409 && repo === appDataRepo) { + tryCount += 1; + return this.getCommits({ + token, + owner, + repo, + sha, + path, + tryTimes: tryCount, + }); + } + throw err; + } + }, + + /** + * https://developer.github.com/v3/repos/contents/#create-a-file + * https://developer.github.com/v3/repos/contents/#update-a-file + */ + async uploadFile({ + token, + owner, + repo, + branch, + path, + content, + sha, + isImg, + commitMessage, + }) { + // 非法的文件名 不让提交 + if (!path || path.endsWith('undefined')) { + return new Promise((resolve) => { + resolve({ res: { content: { sha: null } } }); + }); + } + let uploadContent = content; + if (isImg && typeof content !== 'string') { + uploadContent = await utils.encodeFiletoBase64(content); + } + return repoRequest(token, owner, repo, { + method: 'PUT', + url: `contents/${encodeURIComponent(path)}`, + body: { + message: commitMessage || getCommitMessage(sha ? 'updateFileMessage' : 'createFileMessage', path), + content: isImg ? uploadContent : utils.encodeBase64(content), + sha, + branch, + }, + }); + }, + + /** + * https://developer.github.com/v3/repos/contents/#delete-a-file + */ + async removeFile({ + token, + owner, + repo, + branch, + path, + sha, + }) { + return repoRequest(token, owner, repo, { + method: 'DELETE', + url: `contents/${encodeURIComponent(path)}`, + body: { + message: getCommitMessage('deleteFileMessage', path), + sha, + branch, + }, + }); + }, + + /** + * https://developer.github.com/v3/repos/contents/#get-contents + */ + async downloadFile({ + token, + owner, + repo, + branch, + path, + isImg, + }) { + try { + const { sha, content, encoding } = await repoRequest(token, owner, repo, { + url: `contents/${encodeURIComponent(path)}`, + params: { ref: branch }, + }); + let tempContent = content; + // 如果是图片且 encoding 为 none 则 需要获取 blob + if (isImg && encoding === 'none') { + const blobInfo = await repoRequest(token, owner, repo, { + url: `git/blobs/${sha}`, + }); + tempContent = blobInfo.content; + } + return { + sha, + data: !isImg ? utils.decodeBase64(tempContent) : tempContent, + }; + } catch (err) { + // not .stackedit-data throw err + if (err.status === 404 && path.indexOf('.stackedit-data') >= 0) { + return {}; + } + throw err; + } + }, + /** + * 获取仓库信息 + */ + async getRepoInfo(token, owner, repo) { + return request(token, { + url: `https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, + }).then(res => res.body); + }, + async updateToken(token, imgStorageInfo) { + const imgStorages = token.imgStorages || []; + // 存储仓库唯一标识 + const sid = utils.hash(`${imgStorageInfo.owner}${imgStorageInfo.repo}${imgStorageInfo.path}${imgStorageInfo.branch}`); + // 查询是否存在 存在则更新 + const filterStorages = imgStorages.filter(it => it.sid === sid); + if (filterStorages && filterStorages.length > 0) { + filterStorages.owner = imgStorageInfo.owner; + filterStorages.repo = imgStorageInfo.repo; + filterStorages.path = imgStorageInfo.path; + filterStorages.branch = imgStorageInfo.branch; + } else { + imgStorages.push({ + sid, + owner: imgStorageInfo.owner, + repo: imgStorageInfo.repo, + path: imgStorageInfo.path, + branch: imgStorageInfo.branch, + }); + token.imgStorages = imgStorages; + } + store.dispatch('data/addGithubToken', token); + }, + async removeTokenImgStorage(token, sid) { + if (!token.imgStorages || token.imgStorages.length === 0) { + return; + } + token.imgStorages = token.imgStorages.filter(it => it.sid !== sid); + store.dispatch('data/addGithubToken', token); + }, + + /** + * https://developer.github.com/v3/gists/#create-a-gist + * https://developer.github.com/v3/gists/#edit-a-gist + */ + async uploadGist({ + token, + description, + filename, + content, + isPublic, + gistId, + }) { + const { body } = await request(token, gistId ? { + method: 'PATCH', + url: `https://api.github.com/gists/${gistId}`, + body: { + description, + files: { + [filename]: { + content, + }, + }, + }, + } : { + method: 'POST', + url: 'https://api.github.com/gists', + body: { + description, + files: { + [filename]: { + content, + }, + }, + public: isPublic, + }, + }); + return body; + }, + + /** + * https://developer.github.com/v3/gists/#get-a-single-gist + */ + async downloadGist({ + token, + gistId, + filename, + }) { + const result = (await request(token, { + url: `https://api.github.com/gists/${gistId}`, + })).body.files[filename]; + if (!result) { + throw new Error('Gist file not found.'); + } + return result.content; + }, + + /** + * https://developer.github.com/v3/gists/#list-gist-commits + */ + async getGistCommits({ + token, + gistId, + }) { + const { body } = await request(token, { + url: `https://api.github.com/gists/${gistId}/commits`, + }); + return body; + }, + + /** + * https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist + */ + async downloadGistRevision({ + token, + gistId, + filename, + sha, + }) { + const result = (await request(token, { + url: `https://api.github.com/gists/${gistId}/${sha}`, + })).body.files[filename]; + if (!result) { + throw new Error('Gist file not found.'); + } + return result.content; + }, +}; diff --git a/src/services/providers/helpers/gitlabHelper.js b/src/services/providers/helpers/gitlabHelper.js new file mode 100644 index 0000000..c8725d3 --- /dev/null +++ b/src/services/providers/helpers/gitlabHelper.js @@ -0,0 +1,347 @@ +import utils from '../../utils'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; +import constants from '../../../data/constants'; + +const tokenExpirationMargin = 5 * 60 * 1000; + +const request = ({ accessToken, serverUrl }, options) => networkSvc.request({ + ...options, + url: `${serverUrl}/api/v4/${options.url}`, + headers: { + ...options.headers || {}, + Authorization: `Bearer ${accessToken}`, + }, +}) + .then(res => res.body); + +const getCommitMessage = (name, path) => { + const message = store.getters['data/computedSettings'].git[name]; + return message.replace(/{{path}}/g, path); +}; + +/** + * https://docs.gitlab.com/ee/api/users.html#for-user + */ +const subPrefix = 'gl'; +userSvc.setInfoResolver('gitlab', subPrefix, async (sub) => { + try { + const [, serverUrl, id] = sub.match(/^(.+)\/([^/]+)$/); + const user = (await networkSvc.request({ + url: `${serverUrl}/api/v4/users/${id}`, + })).body; + const uniqueSub = `${serverUrl}/${user.id}`; + + return { + id: `${subPrefix}:${uniqueSub}`, + name: user.username, + imageUrl: user.avatar_url || '', + }; + } catch (err) { + if (err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + + /** + * https://docs.gitlab.com/ee/api/oauth2.html + */ + async startOauth2( + serverUrl, applicationId, applicationSecret, + sub = null, silent = false, refreshToken, + ) { + let apiUrl = serverUrl; + let clientId = applicationId; + let useServerConf = false; + // 获取gitlab配置的参数 + await networkSvc.getServerConf(); + const confClientId = store.getters['data/serverConf'].gitlabClientId; + const confServerUrl = store.getters['data/serverConf'].gitlabUrl; + // 存在gitlab配置则使用后端配置 + if (confClientId && confServerUrl) { + apiUrl = confServerUrl; + clientId = confClientId; + useServerConf = true; + } + let tokenBody; + if (!silent) { + // Get an OAuth2 code + const { code } = await networkSvc.startOauth2( + `${apiUrl}/oauth/authorize`, + { + client_id: clientId, + response_type: 'code', + redirect_uri: constants.oauth2RedirectUri, + }, + silent, + ); + if (useServerConf) { + tokenBody = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/gitlabToken', + params: { + code, + grant_type: 'authorization_code', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } else { + // Exchange code with token + tokenBody = (await networkSvc.request({ + method: 'POST', + url: `${apiUrl}/oauth/token`, + params: { + client_id: clientId, + client_secret: applicationSecret, + code, + grant_type: 'authorization_code', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } + } else if (useServerConf) { + tokenBody = (await networkSvc.request({ + method: 'GET', + url: 'oauth2/gitlabToken', + params: { + refresh_token: refreshToken, + grant_type: 'refresh_token', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } else { + // Exchange refreshToken with token + tokenBody = (await networkSvc.request({ + method: 'POST', + url: `${apiUrl}/oauth/token`, + body: { + client_id: clientId, + client_secret: applicationSecret, + refresh_token: refreshToken, + grant_type: 'refresh_token', + redirect_uri: constants.oauth2RedirectUri, + }, + })).body; + } + + const accessToken = tokenBody.access_token; + // Call the user info endpoint + const user = await request({ accessToken, serverUrl: apiUrl }, { + url: 'user', + }); + const uniqueSub = `${apiUrl}/${user.id}`; + userSvc.addUserInfo({ + id: `${subPrefix}:${uniqueSub}`, + name: user.username, + imageUrl: user.avatar_url || '', + }); + + // Check the returned sub consistency + if (sub && uniqueSub !== sub) { + throw new Error('GitLab account ID not expected.'); + } + + const oldToken = store.getters['data/gitlabTokensBySub'][uniqueSub]; + // Build token object including scopes and sub + const token = { + accessToken, + name: user.username, + applicationId: clientId, + applicationSecret, + imgStorages: oldToken && oldToken.imgStorages, + refreshToken: tokenBody.refresh_token, + expiresOn: Date.now() + ((tokenBody.expires_in || 7200) * 1000), + serverUrl: apiUrl, + sub: uniqueSub, + }; + + // Add token to gitlab tokens + store.dispatch('data/addGitlabToken', token); + return token; + }, + async addAccount(serverUrl, applicationId, applicationSecret, sub = null) { + const token = await this.startOauth2(serverUrl, applicationId, applicationSecret, sub); + badgeSvc.addBadge('addGitLabAccount'); + return token; + }, + // 刷新token + async refreshToken(token) { + const { + serverUrl, + applicationId, + applicationSecret, + sub, + } = token; + const lastToken = store.getters['data/gitlabTokensBySub'][sub]; + // 兼容旧的没有过期时间 + if (!lastToken.expiresOn || !lastToken.refreshToken) { + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitlab', + }); + return this.startOauth2(serverUrl, applicationId, applicationSecret, sub); + } + // lastToken is not expired + if (lastToken.expiresOn > Date.now() + tokenExpirationMargin) { + return lastToken; + } + + // existing token is about to expire. + // Try to get a new token in background + try { + return await this.startOauth2( + serverUrl, applicationId, applicationSecret, + sub, true, lastToken.refreshToken, + ); + } catch (err) { + // If it fails try to popup a window + if (store.state.offline) { + throw err; + } + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Gitlab', + }); + return this.startOauth2(serverUrl, applicationId, applicationSecret, sub); + } + }, + // 带刷新token + async requestWithRefreshToken(token, options) { + const refreshedToken = await this.refreshToken(token); + const result = await request(refreshedToken, options); + return result; + }, + /** + * https://docs.gitlab.com/ee/api/projects.html#get-single-project + */ + async getProjectId(token, { projectPath, projectId }) { + if (projectId) { + return projectId; + } + const project = await this.requestWithRefreshToken(token, { + url: `projects/${encodeURIComponent(projectPath)}`, + }); + return project.id; + }, + + /** + * https://docs.gitlab.com/ee/api/repositories.html#list-repository-tree + */ + async getTree({ + token, + projectId, + branch, + }) { + return this.requestWithRefreshToken(token, { + url: `projects/${encodeURIComponent(projectId)}/repository/tree`, + params: { + ref: branch, + recursive: true, + per_page: 9999, + }, + }); + }, + + /** + * https://docs.gitlab.com/ee/api/commits.html#list-repository-commits + */ + async getCommits({ + token, + projectId, + branch, + path, + }) { + return this.requestWithRefreshToken(token, { + url: `projects/${encodeURIComponent(projectId)}/repository/commits`, + params: { + ref_name: branch, + path, + }, + }); + }, + + /** + * https://docs.gitlab.com/ee/api/repository_files.html#create-new-file-in-repository + * https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository + */ + async uploadFile({ + token, + projectId, + branch, + path, + content, + sha, + isImg, + commitMessage, + }) { + // 非法的文件名 不让提交 + if (!path || path.endsWith('undefined')) { + return new Promise((resolve) => { + resolve({ res: { content: { sha: null } } }); + }); + } + let uploadContent = content; + if (isImg && typeof content !== 'string') { + uploadContent = await utils.encodeFiletoBase64(content); + } + return this.requestWithRefreshToken(token, { + method: sha ? 'PUT' : 'POST', + url: `projects/${encodeURIComponent(projectId)}/repository/files/${encodeURIComponent(path)}`, + body: { + commit_message: commitMessage || getCommitMessage(sha ? 'updateFileMessage' : 'createFileMessage', path), + encoding: 'base64', + content: isImg ? uploadContent : utils.encodeBase64(content), + last_commit_id: sha, + branch, + }, + }); + }, + + /** + * https://docs.gitlab.com/ee/api/repository_files.html#delete-existing-file-in-repository + */ + async removeFile({ + token, + projectId, + branch, + path, + sha, + }) { + return this.requestWithRefreshToken(token, { + method: 'DELETE', + url: `projects/${encodeURIComponent(projectId)}/repository/files/${encodeURIComponent(path)}`, + body: { + commit_message: getCommitMessage('deleteFileMessage', path), + last_commit_id: sha, + branch, + }, + }); + }, + + /** + * https://docs.gitlab.com/ee/api/repository_files.html#get-file-from-repository + */ + async downloadFile({ + token, + projectId, + branch, + path, + isImg, + }) { + const res = await this.requestWithRefreshToken(token, { + url: `projects/${encodeURIComponent(projectId)}/repository/files/${encodeURIComponent(path)}`, + params: { ref: branch }, + }); + return { + sha: res.last_commit_id, + data: !isImg ? utils.decodeBase64(res.content) : res.content, + }; + }, +}; diff --git a/src/services/providers/helpers/googleHelper.js b/src/services/providers/helpers/googleHelper.js new file mode 100644 index 0000000..f9a8037 --- /dev/null +++ b/src/services/providers/helpers/googleHelper.js @@ -0,0 +1,701 @@ +import utils from '../../utils'; +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; + +const appsDomain = null; +const tokenExpirationMargin = 5 * 60 * 1000; // 5 min (tokens expire after 1h) + +const driveAppDataScopes = ['https://www.googleapis.com/auth/drive.appdata']; +const getDriveScopes = token => [token.driveFullAccess + ? 'https://www.googleapis.com/auth/drive' + : 'https://www.googleapis.com/auth/drive.file']; +const bloggerScopes = ['https://www.googleapis.com/auth/blogger']; +const photosScopes = ['https://www.googleapis.com/auth/photos']; + +const checkIdToken = (idToken) => { + try { + const token = idToken.split('.'); + const payload = JSON.parse(utils.decodeBase64(token[1])); + const clientId = store.getters['data/serverConf'].googleClientId; + return payload.aud === clientId && Date.now() + tokenExpirationMargin < payload.exp * 1000; + } catch (e) { + return false; + } +}; + +let driveState; +if (utils.queryParams.providerId === 'googleDrive') { + try { + driveState = JSON.parse(utils.queryParams.state); + } catch (e) { + // Ignore + } +} + +/** + * https://developers.google.com/people/api/rest/v1/people/get + */ +const getUser = async (sub, token) => { + const apiKey = store.getters['data/serverConf'].googleApiKey; + const url = `https://people.googleapis.com/v1/people/${sub}?personFields=names,photos&key=${apiKey}`; + const { body } = await networkSvc.request(sub === 'me' && token + ? { + method: 'GET', + url, + headers: { + Authorization: `Bearer ${token.accessToken}`, + }, + } + : { + method: 'GET', + url, + }, true); + return body; +}; + +const subPrefix = 'go'; +userSvc.setInfoResolver('google', subPrefix, async (sub) => { + try { + const googleToken = Object.values(store.getters['data/googleTokensBySub'])[0]; + const body = await getUser(sub, googleToken); + const name = (body.names && body.names[0]) || {}; + const photo = (body.photos && body.photos[0]) || {}; + return { + id: `${subPrefix}:${sub}`, + name: name.displayName, + imageUrl: (photo.url || '').replace(/\bsz?=\d+$/, 'sz=40'), + }; + } catch (err) { + if (err.status !== 404) { + throw new Error('RETRY'); + } + throw err; + } +}); + +export default { + subPrefix, + folderMimeType: 'application/vnd.google-apps.folder', + driveState, + driveActionFolder: null, + driveActionFiles: [], + async $request(token, options) { + try { + return (await networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + Authorization: `Bearer ${token.accessToken}`, + }, + }, true)).body; + } catch (err) { + const { reason } = (((err.body || {}).error || {}).errors || [])[0] || {}; + if (reason === 'authError') { + // Mark the token as revoked and get a new one + store.dispatch('data/addGoogleToken', { + ...token, + expiresOn: 0, + }); + // Refresh token and retry + const refreshedToken = await this.refreshToken(token, token.scopes); + return this.$request(refreshedToken, options); + } + throw err; + } + }, + + /** + * https://developers.google.com/identity/protocols/OpenIDConnect + */ + async startOauth2(scopes, sub = null, silent = false) { + await networkSvc.getServerConf(); + const clientId = store.getters['data/serverConf'].googleClientId; + + // Get an OAuth2 code + const { accessToken, expiresIn, idToken } = await networkSvc.startOauth2( + 'https://accounts.google.com/o/oauth2/v2/auth', + { + client_id: clientId, + response_type: 'token id_token', + scope: ['openid', 'profile', ...scopes].join(' '), + hd: appsDomain, + login_hint: sub, + prompt: silent ? 'none' : null, + nonce: utils.uid(), + }, + silent, + ); + + // Call the token info endpoint + const { body } = await networkSvc.request({ + method: 'POST', + url: 'https://www.googleapis.com/oauth2/v3/tokeninfo', + params: { + access_token: accessToken, + }, + }, true); + + // Check the returned client ID consistency + if (body.aud !== clientId) { + throw new Error('Client ID inconsistent.'); + } + // Check the returned sub consistency + if (sub && `${body.sub}` !== sub) { + throw new Error('Google account ID not expected.'); + } + + // Build token object including scopes and sub + const existingToken = store.getters['data/googleTokensBySub'][body.sub]; + const token = { + scopes, + accessToken, + expiresOn: Date.now() + (expiresIn * 1000), + idToken, + sub: body.sub, + name: (existingToken || {}).name || 'Someone', + isLogin: !store.getters['workspace/mainWorkspaceToken'] && + scopes.includes('https://www.googleapis.com/auth/drive.appdata'), + isSponsor: false, + isDrive: scopes.includes('https://www.googleapis.com/auth/drive') || + scopes.includes('https://www.googleapis.com/auth/drive.file'), + isBlogger: scopes.includes('https://www.googleapis.com/auth/blogger'), + isPhotos: scopes.includes('https://www.googleapis.com/auth/photos'), + driveFullAccess: scopes.includes('https://www.googleapis.com/auth/drive'), + }; + + // Call the user info endpoint + const user = await getUser('me', token); + const userId = user.resourceName.split('/')[1]; + const name = user.names[0] || {}; + const photo = user.photos[0] || {}; + if (name.displayName) { + token.name = name.displayName; + } + userSvc.addUserInfo({ + id: `${subPrefix}:${userId}`, + name: name.displayName, + imageUrl: (photo.url || '').replace(/\bsz?=\d+$/, 'sz=40'), + }); + + if (existingToken) { + // We probably retrieved a new token with restricted scopes. + // That's no problem, token will be refreshed later with merged scopes. + // Restore flags + Object.assign(token, { + isLogin: existingToken.isLogin || token.isLogin, + isSponsor: existingToken.isSponsor, + isDrive: existingToken.isDrive || token.isDrive, + isBlogger: existingToken.isBlogger || token.isBlogger, + isPhotos: existingToken.isPhotos || token.isPhotos, + driveFullAccess: existingToken.driveFullAccess || token.driveFullAccess, + }); + } + + if (token.isLogin) { + try { + const res = await networkSvc.request({ + method: 'GET', + url: 'userInfo', + params: { + idToken: token.idToken, + }, + }); + token.isSponsor = res.body.sponsorUntil > Date.now(); + if (token.isSponsor) { + badgeSvc.addBadge('sponsor'); + } + } catch (err) { + // Ignore + } + } + + // Add token to google tokens + await store.dispatch('data/addGoogleToken', token); + return token; + }, + async refreshToken(token, scopes = []) { + const { sub } = token; + const lastToken = store.getters['data/googleTokensBySub'][sub]; + const mergedScopes = [...new Set([ + ...scopes, + ...lastToken.scopes, + ])]; + + if ( + // If we already have permissions for the requested scopes + mergedScopes.length === lastToken.scopes.length && + // And lastToken is not expired + lastToken.expiresOn > Date.now() + tokenExpirationMargin && + // And in case of a login token, ID token is still valid + (!lastToken.isLogin || checkIdToken(lastToken.idToken)) + ) { + return lastToken; + } + + // New scopes are requested or existing token is about to expire. + // Try to get a new token in background + try { + return await this.startOauth2(mergedScopes, sub, true); + } catch (err) { + // If it fails try to popup a window + if (store.state.offline) { + throw err; + } + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'Google', + }); + return this.startOauth2(mergedScopes, sub); + } + }, + signin() { + return this.startOauth2(driveAppDataScopes); + }, + async addDriveAccount(fullAccess = false, sub = null) { + const token = await this.startOauth2(getDriveScopes({ driveFullAccess: fullAccess }), sub); + badgeSvc.addBadge('addGoogleDriveAccount'); + return token; + }, + async addBloggerAccount() { + const token = await this.startOauth2(bloggerScopes); + badgeSvc.addBadge('addBloggerAccount'); + return token; + }, + async addPhotosAccount() { + const token = await this.startOauth2(photosScopes); + badgeSvc.addBadge('addGooglePhotosAccount'); + return token; + }, + + /** + * https://developers.google.com/drive/v3/reference/files/create + * https://developers.google.com/drive/v3/reference/files/update + * https://developers.google.com/drive/v3/web/simple-upload + */ + async $uploadFile({ + refreshedToken, + name, + parents, + appProperties, + media = null, + mediaType = null, + fileId = null, + oldParents = null, + ifNotTooLate = cb => cb(), + }) { + // Refreshing a token can take a while if an oauth window pops up, make sure it's not too late + return ifNotTooLate(() => { + const options = { + method: 'POST', + url: 'https://www.googleapis.com/drive/v3/files', + }; + const params = { + supportsTeamDrives: true, + }; + const metadata = { name, appProperties }; + if (fileId) { + options.method = 'PATCH'; + options.url = `https://www.googleapis.com/drive/v3/files/${fileId}`; + if (parents && oldParents) { + params.addParents = parents + .filter(parent => !oldParents.includes(parent)) + .join(','); + params.removeParents = oldParents + .filter(parent => !parents.includes(parent)) + .join(','); + } + } else if (parents) { + metadata.parents = parents; + } + if (media) { + const boundary = `-------${utils.uid()}`; + const delimiter = `\r\n--${boundary}\r\n`; + const closeDelimiter = `\r\n--${boundary}--`; + let multipartRequestBody = ''; + multipartRequestBody += delimiter; + multipartRequestBody += 'Content-Type: application/json; charset=UTF-8\r\n\r\n'; + multipartRequestBody += JSON.stringify(metadata); + multipartRequestBody += delimiter; + multipartRequestBody += `Content-Type: ${mediaType || 'text/plain'}; charset=UTF-8\r\n\r\n`; + multipartRequestBody += media; + multipartRequestBody += closeDelimiter; + options.url = options.url.replace( + 'https://www.googleapis.com/', + 'https://www.googleapis.com/upload/', + ); + return this.$request(refreshedToken, { + ...options, + params: { + ...params, + uploadType: 'multipart', + }, + headers: { + 'Content-Type': `multipart/mixed; boundary="${boundary}"`, + }, + body: multipartRequestBody, + }); + } + if (mediaType) { + metadata.mimeType = mediaType; + } + return this.$request(refreshedToken, { + ...options, + body: metadata, + params, + }); + }); + }, + async uploadFile({ + token, + name, + parents, + appProperties, + media, + mediaType, + fileId, + oldParents, + ifNotTooLate, + }) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$uploadFile({ + refreshedToken, + name, + parents, + appProperties, + media, + mediaType, + fileId, + oldParents, + ifNotTooLate, + }); + }, + async uploadAppDataFile({ + token, + name, + media, + fileId, + ifNotTooLate, + }) { + const refreshedToken = await this.refreshToken(token, driveAppDataScopes); + return this.$uploadFile({ + refreshedToken, + name, + parents: ['appDataFolder'], + media, + fileId, + ifNotTooLate, + }); + }, + + /** + * https://developers.google.com/drive/v3/reference/files/get + */ + async getFile(token, id) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$request(refreshedToken, { + method: 'GET', + url: `https://www.googleapis.com/drive/v3/files/${id}`, + params: { + fields: 'id,name,mimeType,appProperties,teamDriveId', + supportsTeamDrives: true, + }, + }); + }, + + /** + * https://developers.google.com/drive/v3/web/manage-downloads + */ + async $downloadFile(refreshedToken, id) { + return this.$request(refreshedToken, { + method: 'GET', + url: `https://www.googleapis.com/drive/v3/files/${id}?alt=media`, + raw: true, + }); + }, + async downloadFile(token, id) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$downloadFile(refreshedToken, id); + }, + async downloadAppDataFile(token, id) { + const refreshedToken = await this.refreshToken(token, driveAppDataScopes); + return this.$downloadFile(refreshedToken, id); + }, + + /** + * https://developers.google.com/drive/v3/reference/files/delete + */ + async $removeFile(refreshedToken, id, ifNotTooLate = cb => cb()) { + // Refreshing a token can take a while if an oauth window pops up, so check if it's too late + return ifNotTooLate(() => this.$request(refreshedToken, { + method: 'DELETE', + url: `https://www.googleapis.com/drive/v3/files/${id}`, + params: { + supportsTeamDrives: true, + }, + })); + }, + async removeFile(token, id, ifNotTooLate) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$removeFile(refreshedToken, id, ifNotTooLate); + }, + async removeAppDataFile(token, id, ifNotTooLate = cb => cb()) { + const refreshedToken = await this.refreshToken(token, driveAppDataScopes); + return this.$removeFile(refreshedToken, id, ifNotTooLate); + }, + + /** + * https://developers.google.com/drive/v3/reference/revisions/list + */ + async $getFileRevisions(refreshedToken, id) { + const allRevisions = []; + const getPage = async (pageToken) => { + const { revisions, nextPageToken } = await this.$request(refreshedToken, { + method: 'GET', + url: `https://www.googleapis.com/drive/v3/files/${id}/revisions`, + params: { + pageToken, + pageSize: 1000, + fields: 'nextPageToken,revisions(id,modifiedTime,lastModifyingUser/permissionId,lastModifyingUser/displayName,lastModifyingUser/photoLink)', + }, + }); + revisions.forEach((revision) => { + userSvc.addUserInfo({ + id: `${subPrefix}:${revision.lastModifyingUser.permissionId}`, + name: revision.lastModifyingUser.displayName, + imageUrl: revision.lastModifyingUser.photoLink || '', + }); + allRevisions.push(revision); + }); + if (nextPageToken) { + return getPage(nextPageToken); + } + return allRevisions; + }; + return getPage(); + }, + async getFileRevisions(token, id) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$getFileRevisions(refreshedToken, id); + }, + async getAppDataFileRevisions(token, id) { + const refreshedToken = await this.refreshToken(token, driveAppDataScopes); + return this.$getFileRevisions(refreshedToken, id); + }, + + /** + * https://developers.google.com/drive/v3/reference/revisions/get + */ + async $downloadFileRevision(refreshedToken, id, revisionId) { + return this.$request(refreshedToken, { + method: 'GET', + url: `https://www.googleapis.com/drive/v3/files/${id}/revisions/${revisionId}?alt=media`, + raw: true, + }); + }, + async downloadFileRevision(token, fileId, revisionId) { + const refreshedToken = await this.refreshToken(token, getDriveScopes(token)); + return this.$downloadFileRevision(refreshedToken, fileId, revisionId); + }, + async downloadAppDataFileRevision(token, fileId, revisionId) { + const refreshedToken = await this.refreshToken(token, driveAppDataScopes); + return this.$downloadFileRevision(refreshedToken, fileId, revisionId); + }, + + /** + * https://developers.google.com/drive/v3/reference/changes/list + */ + async getChanges(token, startPageToken, isAppData, teamDriveId = null) { + const result = { + changes: [], + }; + let fileFields = 'file/name'; + if (!isAppData) { + fileFields += ',file/parents,file/mimeType,file/appProperties'; + } + const refreshedToken = await this.refreshToken( + token, + isAppData ? driveAppDataScopes : getDriveScopes(token), + ); + + const getPage = async (pageToken = '1') => { + const { changes, nextPageToken, newStartPageToken } = await this.$request(refreshedToken, { + method: 'GET', + url: 'https://www.googleapis.com/drive/v3/changes', + params: { + pageToken, + spaces: isAppData ? 'appDataFolder' : 'drive', + pageSize: 1000, + fields: `nextPageToken,newStartPageToken,changes(fileId,${fileFields})`, + supportsTeamDrives: true, + includeTeamDriveItems: !!teamDriveId, + teamDriveId, + }, + }); + result.changes = [...result.changes, ...changes.filter(item => item.fileId)]; + if (nextPageToken) { + return getPage(nextPageToken); + } + result.startPageToken = newStartPageToken; + return result; + }; + return getPage(startPageToken); + }, + + /** + * https://developers.google.com/blogger/docs/3.0/reference/blogs/getByUrl + * https://developers.google.com/blogger/docs/3.0/reference/posts/insert + * https://developers.google.com/blogger/docs/3.0/reference/posts/update + */ + async uploadBlogger({ + token, + blogUrl, + blogId, + postId, + title, + content, + labels, + isDraft, + published, + isPage, + }) { + const refreshedToken = await this.refreshToken(token, bloggerScopes); + + // Get the blog ID + const blog = { id: blogId }; + if (!blog.id) { + blog.id = (await this.$request(refreshedToken, { + url: 'https://www.googleapis.com/blogger/v3/blogs/byurl', + params: { + url: blogUrl, + }, + })).id; + } + + // Create/update the post/page + const path = isPage ? 'pages' : 'posts'; + let options = { + method: 'POST', + url: `https://www.googleapis.com/blogger/v3/blogs/${blog.id}/${path}/`, + body: { + kind: isPage ? 'blogger#page' : 'blogger#post', + blog, + title, + content, + }, + }; + if (labels) { + options.body.labels = labels; + } + if (published) { + options.body.published = published.toISOString(); + } + // If it's an update + if (postId) { + options.method = 'PUT'; + options.url += postId; + options.body.id = postId; + } + const post = await this.$request(refreshedToken, options); + if (isPage) { + return post; + } + + // Revert/publish post + options = { + method: 'POST', + url: `https://www.googleapis.com/blogger/v3/blogs/${post.blog.id}/posts/${post.id}/`, + params: {}, + }; + if (isDraft) { + options.url += 'revert'; + } else { + options.url += 'publish'; + if (published) { + options.params.publishDate = published.toISOString(); + } + } + return this.$request(refreshedToken, options); + }, + + /** + * https://developers.google.com/picker/docs/ + */ + async openPicker(token, type = 'doc') { + const scopes = type === 'img' ? photosScopes : getDriveScopes(token); + if (!window.google) { + await networkSvc.loadScript('https://apis.google.com/js/api.js'); + await new Promise((resolve, reject) => window.gapi.load('picker', { + callback: resolve, + onerror: reject, + timeout: 30000, + ontimeout: reject, + })); + } + const refreshedToken = await this.refreshToken(token, scopes); + const { google } = window; + return new Promise((resolve) => { + let picker; + const pickerBuilder = new google.picker.PickerBuilder() + .setOAuthToken(refreshedToken.accessToken) + .enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES) + .hideTitleBar() + .setCallback((data) => { + switch (data[google.picker.Response.ACTION]) { + case google.picker.Action.PICKED: + case google.picker.Action.CANCEL: + resolve(data.docs || []); + picker.dispose(); + break; + default: + } + }); + switch (type) { + default: + case 'doc': { + const mimeTypes = [ + 'text/plain', + 'text/x-markdown', + 'application/octet-stream', + ].join(','); + + const view = new google.picker.DocsView(google.picker.ViewId.DOCS); + view.setMimeTypes(mimeTypes); + pickerBuilder.addView(view); + + const teamDriveView = new google.picker.DocsView(google.picker.ViewId.DOCS); + teamDriveView.setMimeTypes(mimeTypes); + teamDriveView.setEnableTeamDrives(true); + pickerBuilder.addView(teamDriveView); + + pickerBuilder.enableFeature(google.picker.Feature.MULTISELECT_ENABLED); + pickerBuilder.enableFeature(google.picker.Feature.SUPPORT_TEAM_DRIVES); + break; + } + case 'folder': { + const folderView = new google.picker.DocsView(google.picker.ViewId.FOLDERS); + folderView.setSelectFolderEnabled(true); + folderView.setMimeTypes(this.folderMimeType); + pickerBuilder.addView(folderView); + + const teamDriveView = new google.picker.DocsView(google.picker.ViewId.FOLDERS); + teamDriveView.setSelectFolderEnabled(true); + teamDriveView.setEnableTeamDrives(true); + teamDriveView.setMimeTypes(this.folderMimeType); + pickerBuilder.addView(teamDriveView); + break; + } + case 'img': { + const view = new google.picker.PhotosView(); + view.setType('highlights'); + pickerBuilder.addView(view); + pickerBuilder.addView(google.picker.ViewId.PHOTO_UPLOAD); + break; + } + } + picker = pickerBuilder.build(); + picker.setVisible(true); + }); + }, +}; diff --git a/src/services/providers/helpers/smmsHelper.js b/src/services/providers/helpers/smmsHelper.js new file mode 100644 index 0000000..7de6bc8 --- /dev/null +++ b/src/services/providers/helpers/smmsHelper.js @@ -0,0 +1,76 @@ +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import userSvc from '../../userSvc'; +import badgeSvc from '../../badgeSvc'; + +/** + * https://doc.sm.ms/#api-User-Get_Profile + */ +const subPrefix = 'sm'; +export default { + subPrefix, + async getTokenObj(proxyUrl, apiSecretToken) { + // Call the user info endpoint + try { + const { body } = await networkSvc.request({ + method: 'POST', + url: `${proxyUrl}https://sm.ms/api/v2/profile`, + headers: { + Authorization: apiSecretToken, + }, + }); + // Check user result + if (!body.success) { + throw new Error(`SM.MS个人信息获取失败,失败信息:${body.message}`); + } + userSvc.addUserInfo({ + id: `${subPrefix}:${body.data.username}`, + name: body.data.username, + imageUrl: 'https://gravatar.loli.net/avatar/ccc459536d65637c192c00f639569864', + }); + // Build token object including sub + const token = { + proxyUrl, + accessToken: apiSecretToken, + name: body.data.username, + sub: body.data.username, + }; + // Add token to smms tokens + store.dispatch('data/addSmmsToken', token); + return token; + } catch (err) { + console.error(err); // eslint-disable-line no-console + store.dispatch('notification/error', err); + throw new Error(`SM.MS个人信息获取异常,异常信息:${err.message}`); + } + }, + async addAccount(proxyUrl, apiSecretToken) { + const token = await this.getTokenObj(proxyUrl, apiSecretToken); + badgeSvc.addBadge('addSmmsAccount'); + return token; + }, + async uploadFile({ + token, + file, + }) { + const { body } = await networkSvc.request({ + method: 'POST', + url: `${token.proxyUrl}https://sm.ms/api/v2/upload`, + headers: { + Authorization: token.accessToken, + }, + formData: { + smfile: file, + }, + }); + if (!body.success) { + if (body.code === 'image_repeated') { + return body.images; + } + store.dispatch('notification/error', `SM.MS上传图片失败,失败信息:${body.message}`); + throw new Error(`SM.MS上传图片失败,失败信息:${body.message}`); + } + return body.data.url; + }, + +}; diff --git a/src/services/providers/helpers/wordpressHelper.js b/src/services/providers/helpers/wordpressHelper.js new file mode 100644 index 0000000..c109bfd --- /dev/null +++ b/src/services/providers/helpers/wordpressHelper.js @@ -0,0 +1,112 @@ +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import badgeSvc from '../../badgeSvc'; + +const tokenExpirationMargin = 5 * 60 * 1000; // 5 min (WordPress tokens expire after 2 weeks) + +const request = (token, options) => networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + Authorization: `Bearer ${token.accessToken}`, + }, +}) + .then(res => res.body); + +export default { + /** + * https://developer.wordpress.com/docs/oauth2/ + */ + async startOauth2(sub = null, silent = false) { + await networkSvc.getServerConf(); + const clientId = store.getters['data/serverConf'].wordpressClientId; + + // Get an OAuth2 code + const { accessToken, expiresIn } = await networkSvc.startOauth2( + 'https://public-api.wordpress.com/oauth2/authorize', + { + client_id: clientId, + response_type: 'token', + scope: 'global', + }, + silent, + ); + + // Call the user info endpoint + const body = await request({ accessToken }, { + url: 'https://public-api.wordpress.com/rest/v1.1/me', + }); + + // Check the returned sub consistency + if (sub && `${body.ID}` !== sub) { + throw new Error('WordPress account ID not expected.'); + } + // Build token object including scopes and sub + const token = { + accessToken, + expiresOn: Date.now() + (expiresIn * 1000), + name: body.display_name, + sub: `${body.ID}`, + }; + // Add token to wordpress tokens + store.dispatch('data/addWordpressToken', token); + return token; + }, + async refreshToken(token) { + const { sub } = token; + const lastToken = store.getters['data/wordpressTokensBySub'][sub]; + + if (lastToken.expiresOn > Date.now() + tokenExpirationMargin) { + return lastToken; + } + // Existing token is going to expire. + // Try to get a new token in background + await store.dispatch('modal/open', { + type: 'providerRedirection', + name: 'WordPress', + }); + return this.startOauth2(sub); + }, + async addAccount(fullAccess = false) { + const token = await this.startOauth2(fullAccess); + badgeSvc.addBadge('addWordpressAccount'); + return token; + }, + + /** + * https://developer.wordpress.com/docs/api/1.2/post/sites/%24site/posts/new/ + * https://developer.wordpress.com/docs/api/1.2/post/sites/%24site/posts/%24post_ID/ + */ + async uploadPost({ + token, + domain, + siteId, + postId, + title, + content, + tags, + categories, + excerpt, + author, + featuredImage, + status, + date, + }) { + const refreshedToken = await this.refreshToken(token); + return request(refreshedToken, { + method: 'POST', + url: `https://public-api.wordpress.com/rest/v1.2/sites/${siteId || domain}/posts/${postId || 'new'}`, + body: { + content, + title, + tags, + categories, + excerpt, + author, + featured_image: featuredImage || '', + status, + date: date && date.toISOString(), + }, + }); + }, +}; diff --git a/src/services/providers/helpers/zendeskHelper.js b/src/services/providers/helpers/zendeskHelper.js new file mode 100644 index 0000000..2d50d08 --- /dev/null +++ b/src/services/providers/helpers/zendeskHelper.js @@ -0,0 +1,114 @@ +import networkSvc from '../../networkSvc'; +import store from '../../../store'; +import badgeSvc from '../../badgeSvc'; + +const request = (token, options) => networkSvc.request({ + ...options, + headers: { + ...options.headers || {}, + Authorization: `Bearer ${token.accessToken}`, + }, +}) + .then(res => res.body); + + +export default { + /** + * https://support.zendesk.com/hc/en-us/articles/203663836-Using-OAuth-authentication-with-your-application + */ + async startOauth2(subdomain, clientId, sub = null, silent = false) { + // Get an OAuth2 code + const { accessToken } = await networkSvc.startOauth2( + `https://${subdomain}.zendesk.com/oauth/authorizations/new`, + { + client_id: clientId, + response_type: 'token', + scope: 'read hc:write', + }, + silent, + ); + + // Call the user info endpoint + const { user } = await request({ accessToken }, { + url: `https://${subdomain}.zendesk.com/api/v2/users/me.json`, + }); + const uniqueSub = `${subdomain}/${user.id}`; + + // Check the returned sub consistency + if (sub && uniqueSub !== sub) { + throw new Error('Zendesk account ID not expected.'); + } + + // Build token object including scopes and sub + const token = { + accessToken, + name: user.name, + subdomain, + sub: uniqueSub, + }; + + // Add token to zendesk tokens + store.dispatch('data/addZendeskToken', token); + return token; + }, + async addAccount(subdomain, clientId) { + const token = await this.startOauth2(subdomain, clientId); + badgeSvc.addBadge('addZendeskAccount'); + return token; + }, + + /** + * https://developer.zendesk.com/rest_api/docs/help_center/articles + */ + async uploadArticle({ + token, + sectionId, + articleId, + title, + content, + labels, + locale, + isDraft, + }) { + const article = { + title, + body: content, + locale, + draft: isDraft, + }; + + if (articleId) { + // Update article + await request(token, { + method: 'PUT', + url: `https://${token.subdomain}.zendesk.com/api/v2/help_center/articles/${articleId}/translations/${locale}.json`, + body: { translation: article }, + }); + + // Add labels + if (labels) { + await request(token, { + method: 'PUT', + url: `https://${token.subdomain}.zendesk.com/api/v2/help_center/articles/${articleId}.json`, + body: { + article: { + label_names: labels, + }, + }, + }); + } + return articleId; + } + + // Create new article + if (labels) { + article.label_names = labels; + } + const body = await request(token, { + method: 'POST', + url: `https://${token.subdomain}.zendesk.com/api/v2/help_center/sections/${sectionId}/articles.json`, + body: { article }, + }); + return `${body.article.id}`; + }, +}; diff --git a/src/services/providers/wordpressProvider.js b/src/services/providers/wordpressProvider.js new file mode 100644 index 0000000..a244e85 --- /dev/null +++ b/src/services/providers/wordpressProvider.js @@ -0,0 +1,41 @@ +import store from '../../store'; +import wordpressHelper from './helpers/wordpressHelper'; +import Provider from './common/Provider'; + +export default new Provider({ + id: 'wordpress', + name: 'WordPress', + getToken({ sub }) { + return store.getters['data/wordpressTokensBySub'][sub]; + }, + getLocationUrl({ siteId, postId }) { + return `https://wordpress.com/post/${siteId}/${postId}`; + }, + getLocationDescription({ postId }) { + return postId; + }, + async publish(token, html, metadata, publishLocation) { + const post = await wordpressHelper.uploadPost({ + ...publishLocation, + ...metadata, + token, + content: html, + }); + return { + ...publishLocation, + siteId: `${post.site_ID}`, + postId: `${post.ID}`, + }; + }, + makeLocation(token, domain, postId) { + const location = { + providerId: this.id, + sub: token.sub, + domain, + }; + if (postId) { + location.postId = postId; + } + return location; + }, +}); diff --git a/src/services/providers/zendeskProvider.js b/src/services/providers/zendeskProvider.js new file mode 100644 index 0000000..27b6066 --- /dev/null +++ b/src/services/providers/zendeskProvider.js @@ -0,0 +1,44 @@ +import store from '../../store'; +import zendeskHelper from './helpers/zendeskHelper'; +import Provider from './common/Provider'; + +export default new Provider({ + id: 'zendesk', + name: 'Zendesk', + getToken({ sub }) { + return store.getters['data/zendeskTokensBySub'][sub]; + }, + getLocationUrl({ sub, locale, articleId }) { + const token = this.getToken({ sub }); + return `https://${token.subdomain}.zendesk.com/hc/${locale}/articles/${articleId}`; + }, + getLocationDescription({ articleId }) { + return articleId; + }, + async publish(token, html, metadata, publishLocation) { + const articleId = await zendeskHelper.uploadArticle({ + ...publishLocation, + token, + title: metadata.title, + content: html, + labels: metadata.tags, + isDraft: metadata.status === 'draft', + }); + return { + ...publishLocation, + articleId, + }; + }, + makeLocation(token, sectionId, locale, articleId) { + const location = { + providerId: this.id, + sub: token.sub, + sectionId, + locale, + }; + if (articleId) { + location.articleId = articleId; + } + return location; + }, +}); diff --git a/src/services/publishSvc.js b/src/services/publishSvc.js new file mode 100644 index 0000000..ab6a542 --- /dev/null +++ b/src/services/publishSvc.js @@ -0,0 +1,179 @@ +import localDbSvc from './localDbSvc'; +import store from '../store'; +import utils from './utils'; +import networkSvc from './networkSvc'; +import exportSvc from './exportSvc'; +import providerRegistry from './providers/common/providerRegistry'; +import workspaceSvc from './workspaceSvc'; +import badgeSvc from './badgeSvc'; + +const hasCurrentFilePublishLocations = () => !!store.getters['publishLocation/current'].length; + +const loader = type => fileId => localDbSvc.loadItem(`${fileId}/${type}`) + // Item does not exist, create it + .catch(() => store.commit(`${type}/setItem`, { + id: `${fileId}/${type}`, + })); +const loadContent = loader('content'); + +const ensureArray = (value) => { + if (!value) { + return []; + } + if (!Array.isArray(value)) { + return `${value}`.trim().split(/\s*,\s*/); + } + return value; +}; + +const ensureString = (value, defaultValue) => { + if (!value) { + return defaultValue; + } + return `${value}`; +}; + +const ensureDate = (value, defaultValue) => { + if (!value) { + return defaultValue; + } + return new Date(`${value}`); +}; + +// git 相关的 providerId +const gitProviderIds = ['gitea', 'gitee', 'github', 'gitlab']; + +const publish = async (publishLocation, commitMessage) => { + const { fileId } = publishLocation; + const template = store.getters['data/allTemplatesById'][publishLocation.templateId]; + const html = await exportSvc.applyTemplate(fileId, template); + const content = await localDbSvc.loadItem(`${fileId}/content`); + const file = store.state.file.itemsById[fileId]; + const properties = utils.computeProperties(content.properties); + const provider = providerRegistry.providersById[publishLocation.providerId]; + const token = provider.getToken(publishLocation); + const metadata = { + title: ensureString(properties.title, file.name), + author: ensureString(properties.author), + tags: ensureArray(properties.tags), + categories: ensureArray(properties.categories), + excerpt: ensureString(properties.excerpt), + featuredImage: ensureString(properties.featuredImage), + status: ensureString(properties.status), + date: ensureDate(properties.date, new Date()), + }; + return provider.publish(token, html, metadata, publishLocation, commitMessage); +}; + +const publishFile = async (fileId) => { + let counter = 0; + await loadContent(fileId); + const publishLocations = [ + ...store.getters['publishLocation/filteredGroupedByFileId'][fileId] || [], + ]; + try { + // 查询是否包含git provider 包含则需要填入提交信息 + const gitLocations = publishLocations.filter(it => gitProviderIds.indexOf(it.providerId) > -1); + let commitMsg = ''; + if (gitLocations.length) { + try { + const { commitMessage } = await store.dispatch('modal/open', { type: 'commitMessage' }); + commitMsg = commitMessage; + } catch (e) { + return; + } + } + await utils.awaitSequence(publishLocations, async (publishLocation) => { + await store.dispatch('queue/doWithLocation', { + location: publishLocation, + action: async () => { + const publishLocationToStore = await publish(publishLocation, commitMsg); + try { + // Replace publish location if modified + if (utils.serializeObject(publishLocation) !== + utils.serializeObject(publishLocationToStore) + ) { + store.commit('publishLocation/patchItem', publishLocationToStore); + workspaceSvc.ensureUniqueLocations(); + } + counter += 1; + } catch (err) { + if (store.state.offline) { + throw err; + } + console.error(err); // eslint-disable-line no-console + store.dispatch('notification/error', err); + } + }, + }); + }); + const file = store.state.file.itemsById[fileId]; + store.dispatch('notification/info', `"${file.name}"已发布到${counter}个位置。`); + } finally { + await localDbSvc.unloadContents(); + } +}; + +const requestPublish = () => { + // No publish in light mode + if (store.state.light) { + return; + } + + store.dispatch('queue/enqueuePublishRequest', async () => { + let intervalId; + const attempt = async () => { + // Only start publishing when these conditions are met + if (networkSvc.isUserActive()) { + clearInterval(intervalId); + if (!hasCurrentFilePublishLocations()) { + // Cancel publish + throw new Error('Publish not possible.'); + } + await publishFile(store.getters['file/current'].id); + badgeSvc.addBadge('triggerPublish'); + } + }; + intervalId = utils.setInterval(() => attempt(), 1000); + return attempt(); + }); +}; + +const publishLocationAndStore = async (publishLocation, commitMsg) => { + const publishLocationToStore = await publish(publishLocation, commitMsg); + workspaceSvc.addPublishLocation(publishLocationToStore); + return publishLocationToStore; +}; + +const createPublishLocation = (publishLocation, featureId) => { + const currentFile = store.getters['file/current']; + publishLocation.fileId = currentFile.id; + store.dispatch( + 'queue/enqueue', + async () => { + let commitMsg = ''; + if (gitProviderIds.indexOf(publishLocation.providerId) > -1) { + try { + const { commitMessage } = await store.dispatch('modal/open', { + type: 'commitMessage', + name: currentFile.name, + }); + commitMsg = commitMessage; + } catch (e) { + return; + } + } + await publishLocationAndStore(publishLocation, commitMsg); + store.dispatch('notification/info', `添加了一个新的发布位置 "${currentFile.name}".`); + if (featureId) { + badgeSvc.addBadge(featureId); + } + }, + ); +}; + +export default { + requestPublish, + publishLocationAndStore, + createPublishLocation, +}; diff --git a/src/services/syncSvc.js b/src/services/syncSvc.js new file mode 100644 index 0000000..8f69df7 --- /dev/null +++ b/src/services/syncSvc.js @@ -0,0 +1,1060 @@ +import md5 from 'js-md5'; +import localDbSvc from './localDbSvc'; +import store from '../store'; +import utils from './utils'; +import diffUtils from './diffUtils'; +import networkSvc from './networkSvc'; +import providerRegistry from './providers/common/providerRegistry'; +import giteeAppDataProvider from './providers/giteeAppDataProvider'; +import githubAppDataProvider from './providers/githubAppDataProvider'; +import './providers/couchdbWorkspaceProvider'; +import './providers/githubWorkspaceProvider'; +import './providers/giteeWorkspaceProvider'; +import './providers/gitlabWorkspaceProvider'; +import './providers/giteaWorkspaceProvider'; +import './providers/googleDriveWorkspaceProvider'; +import tempFileSvc from './tempFileSvc'; +import workspaceSvc from './workspaceSvc'; +import constants from '../data/constants'; +import badgeSvc from './badgeSvc'; + +const minAutoSyncEvery = 60 * 1000; // 60 sec +const inactivityThreshold = 3 * 1000; // 3 sec +const restartSyncAfter = 30 * 1000; // 30 sec +const restartContentSyncAfter = 1000; // Enough to detect an authorize pop up +const checkSponsorshipAfter = (5 * 60 * 1000) + (30 * 1000); // tokenExpirationMargin + 30 sec +const maxContentHistory = 20; + +const LAST_SEEN = 0; +const LAST_MERGED = 1; +const LAST_SENT = 2; + +let actionProvider; +let workspaceProvider; + +/** + * Use a lock in the local storage to prevent multiple windows concurrency. + */ +let lastSyncActivity; +const getLastStoredSyncActivity = () => + parseInt(localStorage.getItem(store.getters['workspace/lastSyncActivityKey']), 10) || 0; + +/** + * Return true if workspace sync is possible. + */ +const isWorkspaceSyncPossible = () => !!store.getters['workspace/syncToken']; + +/** + * Return true if file has at least one explicit sync location. + */ +const hasCurrentFileSyncLocations = () => !!store.getters['syncLocation/current'].length; + +/** + * Return true if we are online and we have something to sync. + */ +const isSyncPossible = () => !store.state.offline && + (isWorkspaceSyncPossible() || hasCurrentFileSyncLocations()); + +/** + * Return true if we are the many window, ie we have the lastSyncActivity lock. + */ +const isSyncWindow = () => { + const storedLastSyncActivity = getLastStoredSyncActivity(); + return lastSyncActivity === storedLastSyncActivity || + Date.now() > inactivityThreshold + storedLastSyncActivity; +}; + +/** + * Return true if auto sync can start, ie if lastSyncActivity is old enough. + */ +const isAutoSyncReady = () => { + let { autoSyncEvery } = store.getters['data/computedSettings']; + if (autoSyncEvery < minAutoSyncEvery) { + autoSyncEvery = minAutoSyncEvery; + } + return Date.now() > autoSyncEvery + getLastStoredSyncActivity(); +}; + +/** + * 是否已启用工作空间的自动同步 没有配置 默认是启用了的 + */ +const isEnableAutoSyncWorkspace = () => { + const workspace = store.getters['workspace/currentWorkspace']; + return workspace.autoSync === undefined || workspace.autoSync; +}; + +/** + * Update the lastSyncActivity, assuming we have the lock. + */ +const setLastSyncActivity = () => { + const currentDate = Date.now(); + lastSyncActivity = currentDate; + localStorage.setItem(store.getters['workspace/lastSyncActivityKey'], currentDate); +}; + +/** + * Upgrade hashes if syncedContent is from an old version + */ +const upgradeSyncedContent = (syncedContent) => { + if (syncedContent.v) { + return syncedContent; + } + const hashUpgrades = {}; + const historyData = {}; + const syncHistory = {}; + Object.entries(syncedContent.historyData).forEach(([hash, content]) => { + const newContent = utils.addItemHash(content); + historyData[newContent.hash] = newContent; + hashUpgrades[hash] = newContent.hash; + }); + Object.entries(syncedContent.syncHistory).forEach(([id, hashEntries]) => { + syncHistory[id] = hashEntries.map(hash => hashUpgrades[hash]); + }); + return { + ...syncedContent, + historyData, + syncHistory, + v: 1, + }; +}; + +/** + * Clean a syncedContent. + */ +const cleanSyncedContent = (syncedContent) => { + // Clean syncHistory from removed syncLocations + Object.keys(syncedContent.syncHistory).forEach((syncLocationId) => { + if (syncLocationId !== 'main' && !store.state.syncLocation.itemsById[syncLocationId]) { + delete syncedContent.syncHistory[syncLocationId]; + } + }); + + const allSyncLocationHashSet = new Set([] + .concat(...Object.keys(syncedContent.syncHistory) + .map(id => syncedContent.syncHistory[id]))); + + // Clean historyData from unused contents + Object.keys(syncedContent.historyData) + .map(hash => parseInt(hash, 10)) + .forEach((hash) => { + if (!allSyncLocationHashSet.has(hash)) { + delete syncedContent.historyData[hash]; + } + }); +}; + +/** + * Apply changes retrieved from the workspace provider. Update sync data accordingly. + */ +const applyChanges = (changes) => { + const allItemsById = { ...store.getters.allItemsById }; + const syncDataById = { ...store.getters['data/syncDataById'] }; + const idsToKeep = {}; + let saveSyncData = false; + let getExistingItem; + if (store.getters['workspace/currentWorkspaceIsGit']) { + const itemsByGitPath = { ...store.getters.itemsByGitPath }; + getExistingItem = existingSyncData => existingSyncData && itemsByGitPath[existingSyncData.id]; + } else { + getExistingItem = existingSyncData => existingSyncData && allItemsById[existingSyncData.itemId]; + } + + // Process each change + changes.forEach((change) => { + const existingSyncData = syncDataById[change.syncDataId]; + const existingItem = getExistingItem(existingSyncData); + // If item was removed + if (!change.item && existingSyncData) { + if (syncDataById[change.syncDataId]) { + delete syncDataById[change.syncDataId]; + saveSyncData = true; + } + if (existingItem) { + // Remove object from the store + store.commit(`${existingItem.type}/deleteItem`, existingItem.id); + delete allItemsById[existingItem.id]; + } + // If item was modified + } else if (change.item && change.item.hash) { + idsToKeep[change.item.id] = true; + + if ((existingSyncData || {}).hash !== change.syncData.hash) { + syncDataById[change.syncDataId] = change.syncData; + saveSyncData = true; + } + if ( + // If no sync data or existing one is different + (existingSyncData || {}).hash !== change.item.hash + // And no existing item or existing item is different + && (existingItem || {}).hash !== change.item.hash + // And item is not content nor data, which will be merged later + && change.item.type !== 'content' && change.item.type !== 'data' + ) { + store.commit(`${change.item.type}/setItem`, change.item); + allItemsById[change.item.id] = change.item; + } + } + }); + + if (saveSyncData) { + store.dispatch('data/setSyncDataById', syncDataById); + + // Sanitize the workspace + workspaceSvc.sanitizeWorkspace(idsToKeep); + } +}; + +/** + * Create a sync location by uploading the current file content. + */ +const createSyncLocation = (syncLocation) => { + const currentFile = store.getters['file/current']; + const fileId = currentFile.id; + syncLocation.fileId = fileId; + // Use deepCopy to freeze the item + const content = utils.deepCopy(store.getters['content/current']); + store.dispatch( + 'queue/enqueue', + async () => { + const provider = providerRegistry.providersById[syncLocation.providerId]; + const token = provider.getToken(syncLocation); + const updatedSyncLocation = await provider.uploadContent(token, { + ...content, + history: [content.hash], + }, syncLocation); + await localDbSvc.loadSyncedContent(fileId); + const newSyncedContent = utils.deepCopy(upgradeSyncedContent(store.state.syncedContent.itemsById[`${fileId}/syncedContent`])); + const newSyncHistoryItem = []; + newSyncedContent.syncHistory[syncLocation.id] = newSyncHistoryItem; + newSyncHistoryItem[LAST_SEEN] = content.hash; + newSyncHistoryItem[LAST_SENT] = content.hash; + newSyncedContent.historyData[content.hash] = content; + + store.commit('syncedContent/patchItem', newSyncedContent); + workspaceSvc.addSyncLocation(updatedSyncLocation); + store.dispatch('notification/info', `将新的同步位置添加到"${currentFile.name}"中。`); + }, + ); +}; + +/** + * Prevent from sending new data too long after old data has been fetched. + */ +const tooLateChecker = (timeout) => { + const tooLateAfter = Date.now() + timeout; + return (cb) => { + if (tooLateAfter < Date.now()) { + throw new Error('TOO_LATE'); + } + return cb(); + }; +}; + +/** + * Return true if file is in the temp folder or is a welcome file. + */ +const isTempFile = (fileId) => { + const contentId = `${fileId}/content`; + if (store.getters['data/syncDataByItemId'][contentId]) { + // If file has already been synced, let's not consider it a temp file + return false; + } + const file = store.state.file.itemsById[fileId]; + const content = store.state.content.itemsById[contentId]; + if (!file || !content) { + return false; + } + if (file.parentId === 'temp') { + return true; + } + const locations = [ + ...store.getters['syncLocation/filteredGroupedByFileId'][fileId] || [], + ...store.getters['publishLocation/filteredGroupedByFileId'][fileId] || [], + ]; + if (locations.length) { + // If file has sync/publish locations, it's not a temp file + return false; + } + // Return true if it's a welcome file that has no discussion + const { welcomeFileHashes } = store.getters['data/localSettings']; + const hash = utils.hash(content.text); + const hasDiscussions = Object.keys(content.discussions).length; + return file.name === 'Welcome file' && welcomeFileHashes[hash] && !hasDiscussions; +}; + +/** + * Patch sync data if some have changed in the result. + */ +const updateSyncData = (result) => { + [ + result.syncData, + result.contentSyncData, + result.fileSyncData, + ].forEach((syncData) => { + if (syncData) { + const oldSyncData = store.getters['data/syncDataById'][syncData.id]; + if (utils.serializeObject(oldSyncData) !== utils.serializeObject(syncData)) { + store.dispatch('data/patchSyncDataById', { + [syncData.id]: syncData, + }); + } + } + }); + return result; +}; + +class SyncContext { + restartSkipContents = false; + attempted = {}; +} + +/** + * Sync one file with all its locations. + */ +const syncFile = async (fileId, syncContext = new SyncContext()) => { + const contentId = `${fileId}/content`; + syncContext.attempted[contentId] = true; + + await localDbSvc.loadSyncedContent(fileId); + try { + await localDbSvc.loadItem(contentId); + } catch (e) { + // Item may not exist if content has not been downloaded yet + } + + const getSyncedContent = () => upgradeSyncedContent(store.state.syncedContent.itemsById[`${fileId}/syncedContent`]); + const getSyncHistoryItem = syncLocationId => getSyncedContent().syncHistory[syncLocationId]; + + try { + if (isTempFile(fileId)) { + return; + } + + const syncLocations = [ + ...store.getters['syncLocation/filteredGroupedByFileId'][fileId] || [], + ]; + if (isWorkspaceSyncPossible()) { + syncLocations.unshift({ id: 'main', providerId: workspaceProvider.id, fileId }); + } + + await utils.awaitSequence(syncLocations, async (syncLocation) => { + const provider = providerRegistry.providersById[syncLocation.providerId]; + if (!provider) { + return; + } + const token = provider.getToken(syncLocation); + if (!token) { + return; + } + + const downloadContent = async () => { + // On simple provider, call simply downloadContent + if (syncLocation.id !== 'main') { + return provider.downloadContent(token, syncLocation); + } + + // On workspace provider, call downloadWorkspaceContent + const oldContentSyncData = store.getters['data/syncDataByItemId'][contentId]; + const oldFileSyncData = store.getters['data/syncDataByItemId'][fileId]; + if (!oldContentSyncData || !oldFileSyncData) { + return null; + } + + const { content } = updateSyncData(await provider.downloadWorkspaceContent({ + token, + contentId, + contentSyncData: oldContentSyncData, + fileSyncData: oldFileSyncData, + })); + + // Return the downloaded content + return content; + }; + + const uploadContent = async (content, ifNotTooLate, commitMessage) => { + // On simple provider, call simply uploadContent + if (syncLocation.id !== 'main') { + return provider.uploadContent(token, content, syncLocation, ifNotTooLate); + } + + // On workspace provider, call uploadWorkspaceContent + const oldContentSyncData = store.getters['data/syncDataByItemId'][contentId]; + if (oldContentSyncData && oldContentSyncData.hash === content.hash) { + return syncLocation; + } + const oldFileSyncData = store.getters['data/syncDataByItemId'][fileId]; + + updateSyncData(await provider.uploadWorkspaceContent({ + token, + content, + commitMessage, + // Use deepCopy to freeze item + file: utils.deepCopy(store.state.file.itemsById[fileId]), + contentSyncData: oldContentSyncData, + fileSyncData: oldFileSyncData, + ifNotTooLate, + })); + + // Return syncLocation + return syncLocation; + }; + + const doSyncLocation = async () => { + const serverContent = await downloadContent(token, syncLocation); + const syncedContent = getSyncedContent(); + const syncHistoryItem = getSyncHistoryItem(syncLocation.id); + + // Merge content + let mergedContent; + const clientContent = utils.deepCopy(store.state.content.itemsById[contentId]); + if (!clientContent) { + mergedContent = utils.deepCopy(serverContent || null); + } else if (!serverContent // If sync location has not been created yet + // Or server and client contents are synced + || serverContent.hash === clientContent.hash + // Or server content has not changed or has already been merged + || syncedContent.historyData[serverContent.hash] + ) { + mergedContent = clientContent; + } else { + // Perform a merge with last merged content if any, or perform a simple fusion otherwise + let lastMergedContent = utils.someResult( + serverContent.history, + hash => syncedContent.historyData[hash], + ); + if (!lastMergedContent && syncHistoryItem) { + lastMergedContent = syncedContent.historyData[syncHistoryItem[LAST_MERGED]]; + } + mergedContent = diffUtils.mergeContent(serverContent, clientContent, lastMergedContent); + if (mergedContent.mergeFlag) { + const file = store.state.file.itemsById[syncLocation.fileId]; + store.dispatch('notification/info', `${file.name} 存在冲突已自动合并,请注意合并结果!`); + } + } + if (!mergedContent) { + return; + } + + // Update or set content in store + store.commit('content/setItem', { + id: contentId, + text: utils.sanitizeText(mergedContent.text), + properties: utils.sanitizeText(mergedContent.properties), + discussions: mergedContent.discussions, + comments: mergedContent.comments, + }); + + // Retrieve content with its new hash value and freeze it + mergedContent = utils.deepCopy(store.state.content.itemsById[contentId]); + + // Make merged content history + const mergedContentHistory = serverContent ? serverContent.history.slice() : []; + let skipUpload = true; + if (mergedContentHistory[0] !== mergedContent.hash) { + // Put merged content hash at the beginning of history + mergedContentHistory.unshift(mergedContent.hash); + // Server content is either out of sync or its history is incomplete, do upload + skipUpload = false; + } + if (syncHistoryItem + && syncHistoryItem[LAST_SENT] != null + && syncHistoryItem[LAST_SENT] !== mergedContent.hash + ) { + // Clean up by removing the hash we've previously added + const idx = mergedContentHistory.lastIndexOf(syncHistoryItem[LAST_SENT]); + if (idx !== -1) { + mergedContentHistory.splice(idx, 1); + } + } + + // Update synced content + const newSyncedContent = utils.deepCopy(syncedContent); + const newSyncHistoryItem = newSyncedContent.syncHistory[syncLocation.id] || []; + newSyncedContent.syncHistory[syncLocation.id] = newSyncHistoryItem; + if (serverContent && + (serverContent.hash === newSyncHistoryItem[LAST_SEEN] || + serverContent.history.includes(newSyncHistoryItem[LAST_SEEN])) + ) { + // That's the 2nd time we've seen this content, trust it for future merges + newSyncHistoryItem[LAST_MERGED] = newSyncHistoryItem[LAST_SEEN]; + } + newSyncHistoryItem[LAST_MERGED] = newSyncHistoryItem[LAST_MERGED] || null; + newSyncHistoryItem[LAST_SEEN] = mergedContent.hash; + newSyncHistoryItem[LAST_SENT] = skipUpload ? null : mergedContent.hash; + newSyncedContent.historyData[mergedContent.hash] = mergedContent; + + // Clean synced content from unused revisions + cleanSyncedContent(newSyncedContent); + // Store synced content + store.commit('syncedContent/patchItem', newSyncedContent); + + if (skipUpload) { + // Server content and merged content are equal, skip content upload + return; + } + + // If content is to be created, schedule a restart to create the file as well + if (provider === workspaceProvider && + !store.getters['data/syncDataByItemId'][fileId] + ) { + syncContext.restartSkipContents = true; + } + + const currentWorkspace = store.getters['workspace/currentWorkspace']; + const isGit = !!store.getters['workspace/currentWorkspaceIsGit']; + let commitMsg = ''; + // 是git 并且未配置自动同步或启用了自动同步 并且文档类型是content + if (isGit && (currentWorkspace.autoSync !== undefined && !currentWorkspace.autoSync)) { + const file = store.state.file.itemsById[fileId]; + try { + const { commitMessage } = await store.dispatch('modal/open', { + type: 'commitMessage', + name: file.name, + }); + commitMsg = commitMessage; + } catch (e) { + return; + } + } + // Upload merged content + const item = { + ...mergedContent, + history: mergedContentHistory.slice(0, maxContentHistory), + }; + const syncLocationToStore = await uploadContent( + item, + tooLateChecker(restartContentSyncAfter), + commitMsg, + ); + + // Replace sync location if modified + if (utils.serializeObject(syncLocation) !== + utils.serializeObject(syncLocationToStore) + ) { + store.commit('syncLocation/patchItem', syncLocationToStore); + workspaceSvc.ensureUniqueLocations(); + } + }; + + await store.dispatch('queue/doWithLocation', { + location: syncLocation, + action: async () => { + try { + await doSyncLocation(); + } catch (err) { + if (store.state.offline || (err && err.message === 'TOO_LATE')) { + throw err; + } + console.error(err); // eslint-disable-line no-console + store.dispatch('notification/error', err); + } + }, + }); + }); + } catch (err) { + if (err && err.message === 'TOO_LATE') { + // Restart sync + await syncFile(fileId, syncContext); + } else { + throw err; + } + } finally { + await localDbSvc.unloadContents(); + } +}; + +/** + * Sync a data item, typically settings, templates or workspaces. + */ +const syncDataItem = async (dataId) => { + const getItem = () => store.state.data.itemsById[dataId] + || store.state.data.lsItemsById[dataId]; + + const oldItem = getItem(); + const oldSyncData = store.getters['data/syncDataById'][dataId]; + // Sync if item hash and syncData hash are out of sync + if (oldSyncData && oldItem && oldItem.hash === oldSyncData.hash) { + return; + } + + const token = workspaceProvider.getToken(); + const { item } = updateSyncData(await workspaceProvider.downloadWorkspaceData({ + token, + syncData: oldSyncData || { id: dataId }, + })); + + const serverItem = item; + const dataSyncData = store.getters['data/dataSyncDataById'][dataId]; + const clientItem = utils.deepCopy(getItem()); + let mergedItem = (() => { + if (!clientItem) { + return serverItem; + } + if (!serverItem) { + return clientItem; + } + if (!dataSyncData) { + return serverItem; + } + if (dataSyncData.hash !== serverItem.hash) { + // Server version has changed + if (dataSyncData.hash !== clientItem.hash && typeof clientItem.data === 'object') { + // Client version has changed as well, merge data objects + return { + ...clientItem, + data: diffUtils.mergeObjects(serverItem.data, clientItem.data), + }; + } + return serverItem; + } + return clientItem; + })(); + + if (!mergedItem) { + return; + } + + if (clientItem && dataId === 'workspaces') { + // Clean deleted workspaces + await Promise.all(Object.keys(clientItem.data) + .filter(id => !mergedItem.data[id]) + .map(id => workspaceSvc.removeWorkspace(id))); + } + + // Update item in store + store.commit('data/setItem', { + id: dataId, + ...mergedItem, + }); + + // Retrieve item with new `hash` and freeze it + mergedItem = utils.deepCopy(getItem()); + + // Upload merged data item if out of sync + if (!serverItem || serverItem.hash !== mergedItem.hash) { + updateSyncData(await workspaceProvider.uploadWorkspaceData({ + token, + item: mergedItem, + syncData: store.getters['data/syncDataById'][dataId], + ifNotTooLate: tooLateChecker(restartContentSyncAfter), + })); + } + + // Copy sync data into data sync data + store.dispatch('data/patchDataSyncDataById', { + [dataId]: utils.deepCopy(store.getters['data/syncDataById'][dataId]), + }); +}; + +/** + * Sync the whole workspace with the main provider and the current file explicit locations. + */ +const syncWorkspace = async (skipContents = false) => { + try { + const workspace = store.getters['workspace/currentWorkspace']; + const syncContext = new SyncContext(); + + // Store the sub in the DB since it's not safely stored in the token + const syncToken = store.getters['workspace/syncToken']; + const localSettings = store.getters['data/localSettings']; + if (!localSettings.syncSub) { + store.dispatch('data/patchLocalSettings', { + syncSub: syncToken.sub, + }); + } else if (localSettings.syncSub !== syncToken.sub) { + throw new Error('Synchronization failed due to token inconsistency.'); + } + + const changes = await workspaceProvider.getChanges(); + + // Apply changes + applyChanges(workspaceProvider.prepareChanges(changes)); + workspaceProvider.onChangesApplied(); + + // Prevent from sending items too long after changes have been retrieved + const ifNotTooLate = tooLateChecker(restartSyncAfter); + + // Find and save one item to save + await utils.awaitSome(() => ifNotTooLate(async () => { + const storeItemMap = { + ...store.state.file.itemsById, + ...store.state.folder.itemsById, + ...store.state.syncLocation.itemsById, + ...store.state.publishLocation.itemsById, + // Deal with contents and data later + }; + + const syncDataByItemId = store.getters['data/syncDataByItemId']; + const isGit = !!store.getters['workspace/currentWorkspaceIsGit']; + const [changedItem, syncDataToUpdate] = utils.someResult( + Object.entries(storeItemMap), + ([id, item]) => { + const syncData = syncDataByItemId[id]; + if ((syncData && syncData.hash === item.hash) + // Add file/folder only if parent folder has been added + || (!isGit && storeItemMap[item.parentId] && !syncDataByItemId[item.parentId]) + // Don't create folder if it's a git workspace + || (isGit && item.type === 'folder') + // Add file only if content has been added + || (item.type === 'file' && !syncDataByItemId[`${id}/content`]) + // 如果是发布位置 文件不存在了 则不需要更新 等待后续删除 + || (item.type === 'publishLocation' && (!item.fileId || !syncDataByItemId[`${item.fileId}/content`])) + ) { + return null; + } + return [item, syncData]; + }, + ) || []; + + if (!changedItem) return false; + + updateSyncData(await workspaceProvider.saveWorkspaceItem({ + // Use deepCopy to freeze objects + item: utils.deepCopy(changedItem), + syncData: utils.deepCopy(syncDataToUpdate), + ifNotTooLate, + })); + + return true; + })); + + // Find and remove one item to remove + await utils.awaitSome(() => ifNotTooLate(async () => { + let getItem; + let getFileItem; + let getOriginFileItem; + if (store.getters['workspace/currentWorkspaceIsGit']) { + const { itemsByGitPath } = store.getters; + getItem = syncData => itemsByGitPath[syncData.id]; + getOriginFileItem = syncData => itemsByGitPath[syncData.fileId]; + getFileItem = syncData => itemsByGitPath[syncData.id.slice(1)]; // Remove leading / + } else { + const { allItemsById } = store.getters; + getItem = syncData => allItemsById[syncData.itemId]; + getOriginFileItem = syncData => allItemsById[syncData.fileId]; + getFileItem = syncData => allItemsById[syncData.itemId.split('/')[0]]; + } + + const syncDataById = store.getters['data/syncDataById']; + const syncDataToRemove = utils.deepCopy(utils.someResult( + Object.values(syncDataById), + (syncData) => { + if (getItem(syncData) + // We don't want to delete data items, especially on first sync + || syncData.type === 'data' + // Remove content only if file has been removed + || (syncData.type === 'content' && getFileItem(syncData)) + // 发布位置 如果对应的文件不存在了 也需要删除 + || (syncData.type === 'publishLocation' && syncData.fileId && getOriginFileItem(syncData)) + ) { + return null; + } + return syncData; + }, + )); + + if (!syncDataToRemove) return false; + + await workspaceProvider.removeWorkspaceItem({ + syncData: syncDataToRemove, + ifNotTooLate, + }); + const syncDataByIdCopy = { ...store.getters['data/syncDataById'] }; + delete syncDataByIdCopy[syncDataToRemove.id]; + store.dispatch('data/setSyncDataById', syncDataByIdCopy); + return true; + })); + + // Sync settings, workspaces and badges only in the main workspace + if (workspace.id === 'main') { + // await syncDataItem('settings'); + await syncDataItem('workspaces'); + await syncDataItem('badgeCreations'); + // await syncDataItem('templates'); + } + + if (!skipContents) { + const currentFileId = store.getters['file/current'].id; + if (currentFileId) { + // Sync current file first + await syncFile(currentFileId, syncContext); + } + + // Find and sync one file out of sync + await utils.awaitSome(async () => { + let getSyncData; + if (store.getters['workspace/currentWorkspaceIsGit']) { + const { gitPathsByItemId } = store.getters; + const syncDataById = store.getters['data/syncDataById']; + getSyncData = contentId => syncDataById[gitPathsByItemId[contentId]]; + } else { + const syncDataByItemId = store.getters['data/syncDataByItemId']; + getSyncData = contentId => syncDataByItemId[contentId]; + } + + // Collect all [fileId, contentId] + const ids = [ + ...Object.keys(localDbSvc.hashMap.content) + .map(contentId => [contentId.split('/')[0], contentId]), + ...store.getters['file/items'] + .map(file => [file.id, `${file.id}/content`]), + ]; + + // Find the first content out of sync + const contentMap = store.state.content.itemsById; + const fileIdToSync = utils.someResult(ids, ([fileId, contentId]) => { + // Get the content hash from itemsById or from localDbSvc if not loaded + const loadedContent = contentMap[contentId]; + const hash = loadedContent ? loadedContent.hash : localDbSvc.hashMap.content[contentId]; + const syncData = getSyncData(contentId); + if ( + // Sync if content syncing was not attempted yet + !syncContext.attempted[contentId] && + // And if syncData does not exist or if content hash and syncData hash are inconsistent + (!syncData || syncData.hash !== hash) + ) { + return fileId; + } + return null; + }); + + if (!fileIdToSync) return false; + + await syncFile(fileIdToSync, syncContext); + return true; + }); + } + + // Restart sync if requested + if (syncContext.restartSkipContents) { + await syncWorkspace(true); + } + + if (workspace.id === 'main') { + badgeSvc.addBadge(workspace.providerId === 'giteeAppData' ? 'syncMainWorkspace' : 'githubSyncMainWorkspace'); + } + } catch (err) { + if (err && err.message === 'TOO_LATE') { + // Restart sync + await syncWorkspace(); + } else { + throw err; + } + } +}; + +const syncImg = async (absolutePath) => { + const token = workspaceProvider.getToken(); + const path = absolutePath.substring(1, absolutePath.length).replaceAll('%20', ' '); + const { sha, content } = await workspaceProvider.downloadFile({ + token, + path, + }); + if (!sha || !content) { + return; + } + await localDbSvc.saveImg({ + id: md5(absolutePath), + path: absolutePath, + content, + uploaded: 1, + sha, + }); +}; + +const uploadImg = async (imgIds, index = 0) => { + if (imgIds.length - 1 < index) { + return; + } + const item = await localDbSvc.getImgItem(imgIds[index]); + // 不存在item 或已上传 则跳过 + if (!item || item.uploaded) { + setTimeout(await uploadImg(imgIds, index + 1), 10); + return; + } + const token = workspaceProvider.getToken(); + const { sha } = await workspaceProvider.uploadWorkspaceContent({ + token, + file: { + ...utils.deepCopy(item), + type: 'img', + path: item.path.substring(1, item.path.length).replaceAll('%20', ' '), + }, + isImg: true, + }); + await localDbSvc.saveImg({ + ...item, + uploaded: 1, + sha, + }); + setTimeout(await uploadImg(imgIds, index + 1), 500); +}; + +const uploadImgs = async () => { + // 新增的图片 + const imgIds = await localDbSvc.getWaitUploadImgIds(); + if (imgIds.length > 0) { + await uploadImg(imgIds); + } +}; + +/** + * Enqueue a sync task, if possible. + */ +const requestSync = (addTriggerSyncBadge = false) => { + // No sync in light mode + if (store.state.light) { + return; + } + + store.dispatch('queue/enqueueSyncRequest', async () => { + let intervalId; + const attempt = async () => { + // Only start syncing when these conditions are met + if (networkSvc.isUserActive() && isSyncWindow()) { + clearInterval(intervalId); + if (!isSyncPossible()) { + // Cancel sync + throw new Error('无法同步。'); + } + + // Determine if we have to clean files + const fileHashesToClean = {}; + if (getLastStoredSyncActivity() + constants.cleanTrashAfter < Date.now()) { + // Last synchronization happened 7 days ago + const syncDataByItemId = store.getters['data/syncDataByItemId']; + store.getters['file/items'].forEach((file) => { + // If file is in the trash and has not been modified since it was last synced + const syncData = syncDataByItemId[file.id]; + if (syncData && file.parentId === 'trash' && file.hash === syncData.hash) { + fileHashesToClean[file.id] = file.hash; + } + }); + } + + // Call setLastSyncActivity periodically + intervalId = utils.setInterval(() => setLastSyncActivity(), 1000); + setLastSyncActivity(); + + try { + if (isWorkspaceSyncPossible()) { + await syncWorkspace(); + } else if (hasCurrentFileSyncLocations()) { + // Only sync the current file if workspace sync is unavailable + // as we don't want to look for out-of-sync files by loading + // all the syncedContent objects. + await syncFile(store.getters['file/current'].id); + } + // 同步图片 + await uploadImgs(); + + // Clean files + Object.entries(fileHashesToClean).forEach(([fileId, fileHash]) => { + const file = store.state.file.itemsById[fileId]; + if (file && file.hash === fileHash) { + workspaceSvc.deleteFile(fileId); + } + }); + + if (addTriggerSyncBadge) { + badgeSvc.addBadge('triggerSync'); + } + } finally { + clearInterval(intervalId); + } + } + }; + + intervalId = utils.setInterval(() => attempt(), 1000); + return attempt(); + }); +}; + +const afterSignIn = async () => { + if (store.getters['workspace/currentWorkspace'].id === 'main' && workspaceProvider) { + const mainToken = store.getters['workspace/mainWorkspaceToken']; + // Try to find a suitable workspace sync provider + workspaceProvider = mainToken.providerId === 'githubAppData' ? githubAppDataProvider : giteeAppDataProvider; + await workspaceProvider.initWorkspace(); + } +}; + +export default { + async init() { + // Load workspaces and tokens from localStorage + localDbSvc.syncLocalStorage(); + + // Try to find a suitable action provider + actionProvider = providerRegistry.providersById[utils.queryParams.providerId]; + if (actionProvider && actionProvider.initAction) { + await actionProvider.initAction(); + } + + const mainToken = store.getters['workspace/mainWorkspaceToken']; + // Try to find a suitable workspace sync provider + workspaceProvider = providerRegistry.providersById[utils.queryParams.providerId]; + if (!workspaceProvider || !workspaceProvider.initWorkspace) { + workspaceProvider = mainToken && mainToken.providerId === 'githubAppData' ? githubAppDataProvider : giteeAppDataProvider; + } + const workspace = await workspaceProvider.initWorkspace(); + // Fix the URL hash + const { paymentSuccess } = utils.queryParams; + utils.setQueryParams(workspaceProvider.getWorkspaceParams(workspace)); + + store.dispatch('workspace/setCurrentWorkspaceId', workspace.id); + await localDbSvc.init(); + + // Enable sponsorship + if (paymentSuccess) { + store.dispatch('modal/open', 'paymentSuccess') + .catch(() => { /* Cancel */ }); + const sponsorToken = store.getters['workspace/sponsorToken']; + // Force check sponsorship after a few seconds + const currentDate = Date.now(); + if (sponsorToken && sponsorToken.expiresOn > currentDate - checkSponsorshipAfter) { + store.dispatch('data/addGoogleToken', { + ...sponsorToken, + expiresOn: currentDate - checkSponsorshipAfter, + }); + } + } + + // Try to find a suitable action provider + actionProvider = providerRegistry.providersById[utils.queryParams.providerId] || actionProvider; + if (actionProvider && actionProvider.performAction) { + const newSyncLocation = await actionProvider.performAction(); + if (newSyncLocation) { + this.createSyncLocation(newSyncLocation); + } + } + + await tempFileSvc.init(); + + if (!store.state.light) { + // Sync periodically + utils.setInterval(() => { + if (isSyncPossible() + && networkSvc.isUserActive() + && isSyncWindow() + && isAutoSyncReady() + && isEnableAutoSyncWorkspace() + ) { + requestSync(); + } + }, 1000); + + // Unload contents from memory periodically + utils.setInterval(() => { + // Wait for sync and 发布到finish + if (store.state.queue.isEmpty) { + localDbSvc.unloadContents(); + } + }, 5000); + } + }, + afterSignIn, + syncImg, + isSyncPossible, + requestSync, + createSyncLocation, +}; diff --git a/src/services/tempFileSvc.js b/src/services/tempFileSvc.js new file mode 100644 index 0000000..76563c4 --- /dev/null +++ b/src/services/tempFileSvc.js @@ -0,0 +1,99 @@ +import cledit from './editor/cledit'; +import store from '../store'; +import utils from './utils'; +import editorSvc from './editorSvc'; +import workspaceSvc from './workspaceSvc'; + +const { + origin, + fileName, + contentText, + contentProperties, +} = utils.queryParams; +const isLight = origin && window.parent; + +export default { + setReady() { + if (isLight) { + // Wait for the editor to init + setTimeout(() => window.parent.postMessage({ type: 'ready' }, origin), 1); + } + }, + closed: false, + close() { + if (isLight) { + if (!this.closed) { + window.parent.postMessage({ type: 'close' }, origin); + } + this.closed = true; + } + }, + async init() { + if (!isLight) { + return; + } + store.commit('setLight', true); + + const file = await workspaceSvc.createFile({ + name: fileName || utils.getHostname(origin), + text: contentText || '\n', + properties: contentProperties, + parentId: 'temp', + }, true); + + // Sanitize file creations + const lastCreated = {}; + const fileItemsById = store.state.file.itemsById; + Object.entries(store.getters['data/lastCreated']).forEach(([id, value]) => { + if (fileItemsById[id] && fileItemsById[id].parentId === 'temp') { + lastCreated[id] = value; + } + }); + + // Track file creation from other site + lastCreated[file.id] = { + created: Date.now(), + }; + + // Keep only the last 10 temp files created by other sites + Object.entries(lastCreated) + .sort(([, value1], [, value2]) => value2.created - value1.created) + .splice(10) + .forEach(([id]) => { + delete lastCreated[id]; + workspaceSvc.deleteFile(id); + }); + + // Store file creations and open the file + store.dispatch('data/setLastCreated', lastCreated); + store.commit('file/setCurrentId', file.id); + + const onChange = cledit.Utils.debounce(() => { + const currentFile = store.getters['file/current']; + if (currentFile.id !== file.id) { + // Close editor if file has changed for some reason + this.close(); + } else if (!this.closed && editorSvc.previewCtx.html != null) { + const content = store.getters['content/current']; + const properties = utils.computeProperties(content.properties); + window.parent.postMessage({ + type: 'fileChange', + payload: { + id: file.id, + name: currentFile.name, + content: { + text: content.text.slice(0, -1), // Remove trailing LF + properties, + yamlProperties: content.properties, + html: editorSvc.previewCtx.html, + }, + }, + }, origin); + } + }, 25); + + // Watch preview refresh and file name changes + editorSvc.$on('previewCtx', onChange); + store.watch(() => store.getters['file/current'].name, onChange); + }, +}; diff --git a/src/services/templateWorker.js b/src/services/templateWorker.js new file mode 100644 index 0000000..8cc69e6 --- /dev/null +++ b/src/services/templateWorker.js @@ -0,0 +1,99 @@ +// This WebWorker provides a safe environment to run user scripts +// See http://stackoverflow.com/questions/10653809/making-webworkers-a-safe-environment/10796616 + +import Handlebars from 'handlebars'; + +// Classeur own helpers +Handlebars.registerHelper('tocToHtml', (toc, depth = 6) => { + function arrayToHtml(arr) { + if (!arr || !arr.length || arr[0].level > depth) { + return ''; + } + const ulHtml = arr.map((item) => { + let result = '
      • '; + if (item.anchor && item.title) { + result += `${item.title}`; + } + result += arrayToHtml(item.children); + return `${result}
      • `; + }).join('\n'); + return `\n
          \n${ulHtml}\n
        \n`; + } + return new Handlebars.SafeString(arrayToHtml(toc)); +}); + +const whiteList = { + self: 1, + onmessage: 1, + postMessage: 1, + global: 1, + whiteList: 1, + eval: 1, + Array: 1, + Boolean: 1, + Date: 1, + Function: 1, + Number: 1, + Object: 1, + RegExp: 1, + String: 1, + Error: 1, + EvalError: 1, + RangeError: 1, + ReferenceError: 1, + SyntaxError: 1, + TypeError: 1, + URIError: 1, + decodeURI: 1, + decodeURIComponent: 1, + encodeURI: 1, + encodeURIComponent: 1, + isFinite: 1, + isNaN: 1, + parseFloat: 1, + parseInt: 1, + Infinity: 1, + JSON: 1, + Math: 1, + NaN: 1, + undefined: 1, + safeEval: 1, + close: 1, +}; + +/* eslint-disable no-restricted-globals */ +let global = self; +while (global !== Object.prototype) { + Object.getOwnPropertyNames(global).forEach((prop) => { // eslint-disable-line no-loop-func + if (!Object.prototype.hasOwnProperty.call(whiteList, prop)) { + try { + Object.defineProperty(global, prop, { + get() { + throw new Error(`Security Exception: cannot access ${prop}`); + }, + configurable: false, + }); + } catch (e) { + // Ignore + } + } + }); + global = Object.getPrototypeOf(global); +} +self.Handlebars = Handlebars; + +function safeEval(code) { + eval(`"use strict";\n${code}`); // eslint-disable-line no-eval +} + +self.onmessage = (evt) => { + try { + const template = Handlebars.compile(evt.data[0]); + const context = evt.data[1]; + safeEval(evt.data[2]); + self.postMessage([null, template(context)]); + } catch (err) { + self.postMessage([`${err}`]); + } + close(); +}; diff --git a/src/services/timeSvc.js b/src/services/timeSvc.js new file mode 100644 index 0000000..65552fe --- /dev/null +++ b/src/services/timeSvc.js @@ -0,0 +1,113 @@ +// Credit: https://github.com/github/time-elements/ +const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; +const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; + +const pad = num => `0${num}`.slice(-2); + +function strftime(time, formatString) { + const day = time.getDay(); + const date = time.getDate(); + const month = time.getMonth(); + const year = time.getFullYear(); + const hour = time.getHours(); + const minute = time.getMinutes(); + const second = time.getSeconds(); + return formatString.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g, (_arg) => { + let match; + const modifier = _arg[1]; + switch (modifier) { + case '%': + default: + return '%'; + case 'a': + return weekdays[day].slice(0, 3); + case 'A': + return weekdays[day]; + case 'b': + return months[month].slice(0, 3); + case 'B': + return months[month]; + case 'c': + return time.toString(); + case 'd': + return pad(date); + case 'e': + return date; + case 'H': + return pad(hour); + case 'I': + return pad(strftime(time, '%l')); + case 'l': + return hour === 0 || hour === 12 ? 12 : (hour + 12) % 12; + case 'm': + return pad(month + 1); + case 'M': + return pad(minute); + case 'p': + return hour > 11 ? 'PM' : 'AM'; + case 'P': + return hour > 11 ? 'pm' : 'am'; + case 'S': + return pad(second); + case 'w': + return day; + case 'y': + return pad(year % 100); + case 'Y': + return year; + case 'Z': + match = time.toString().match(/\((\w+)\)$/); + return match ? match[1] : ''; + case 'z': + match = time.toString().match(/\w([+-]\d\d\d\d) /); + return match ? match[1] : ''; + } + }); +} + +class RelativeTime { + constructor(date) { + this.date = date; + } + + toString() { + const ago = this.timeElapsed(); + return ago || `${this.formatDate()}`; + } + + timeElapsed() { + const ms = new Date().getTime() - this.date.getTime(); + const sec = Math.round(ms / 1000); + const min = Math.round(sec / 60); + const hr = Math.round(min / 60); + const day = Math.round(hr / 24); + if (ms < 0) { + return '刚刚'; + } else if (sec < 45) { + return '刚刚'; + } else if (sec < 90) { + return '1分钟前'; + } else if (min < 45) { + return `${min}分钟前`; + } else if (min < 90) { + return '1小时前'; + } else if (hr < 24) { + return `${hr}小时前`; + } else if (hr < 36) { + return '1天前'; + } else if (day < 30) { + return `${day}天前`; + } + return null; + } + + formatDate() { + return strftime(this.date, '%Y-%m-%d'); + } +} + +export default { + format(time) { + return time && new RelativeTime(new Date(time)).toString(); + }, +}; diff --git a/src/services/userSvc.js b/src/services/userSvc.js new file mode 100644 index 0000000..b8aae11 --- /dev/null +++ b/src/services/userSvc.js @@ -0,0 +1,91 @@ +import store from '../store'; +import utils from './utils'; + +const refreshUserInfoAfter = 60 * 60 * 1000; // 60 minutes + +const infoResolversByType = {}; +const subPrefixesByType = {}; +const typesBySubPrefix = {}; + +const lastInfosByUserId = {}; +const infoPromisedByUserId = {}; + +const sanitizeUserId = (userId) => { + const prefix = userId[2] === ':' && userId.slice(0, 2); + if (typesBySubPrefix[prefix]) { + return userId; + } + return `go:${userId}`; +}; + +const parseUserId = userId => [typesBySubPrefix[userId.slice(0, 2)], userId.slice(3)]; + +const refreshUserInfos = () => { + if (store.state.offline) { + return; + } + + Object.entries(lastInfosByUserId) + .filter(([userId, lastInfo]) => lastInfo === 0 && !infoPromisedByUserId[userId]) + .forEach(async ([userId]) => { + const [type, sub] = parseUserId(userId); + const infoResolver = infoResolversByType[type]; + if (infoResolver) { + try { + infoPromisedByUserId[userId] = true; + const userInfo = await infoResolver(sub); + store.commit('userInfo/setItem', userInfo); + } finally { + infoPromisedByUserId[userId] = false; + lastInfosByUserId[userId] = Date.now(); + } + } + }); +}; + +export default { + setInfoResolver(type, subPrefix, resolver) { + infoResolversByType[type] = resolver; + subPrefixesByType[type] = subPrefix; + typesBySubPrefix[subPrefix] = type; + }, + getCurrentUserId() { + const loginToken = store.getters['workspace/loginToken']; + if (!loginToken) { + return null; + } + const loginType = store.getters['workspace/loginType']; + const prefix = subPrefixesByType[loginType]; + return prefix ? `${prefix}:${loginToken.sub}` : loginToken.sub; + }, + sanitizeUserId, + addUserInfo(userInfo) { + store.commit('userInfo/setItem', userInfo); + lastInfosByUserId[userInfo.id] = Date.now(); + }, + addUserId(userId) { + if (userId) { + const sanitizedUserId = sanitizeUserId(userId); + const lastInfo = lastInfosByUserId[sanitizedUserId]; + if (lastInfo === undefined) { + // Try to find a token with this sub to resolve name as soon as possible + const [type, sub] = parseUserId(sanitizedUserId); + const token = store.getters['data/tokensByType'][type][sub]; + if (token) { + store.commit('userInfo/setItem', { + id: sanitizedUserId, + name: token.name, + }); + } + } + + if (lastInfo === undefined || lastInfo + refreshUserInfoAfter < Date.now()) { + lastInfosByUserId[sanitizedUserId] = 0; + refreshUserInfos(); + } + } + }, +}; + +// Get user info periodically +utils.setInterval(() => refreshUserInfos(), 60 * 1000); diff --git a/src/services/utils.js b/src/services/utils.js new file mode 100644 index 0000000..d171432 --- /dev/null +++ b/src/services/utils.js @@ -0,0 +1,439 @@ +import yaml from 'js-yaml'; +import '../libs/clunderscore'; +import presets from '../data/presets'; +import constants from '../data/constants'; + +// For utils.uid() +const uidLength = 16; +const crypto = window.crypto || window.msCrypto; +const alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); +const radix = alphabet.length; +const array = new Uint32Array(uidLength); + +// For utils.parseQueryParams() +const parseQueryParams = (params) => { + const result = {}; + params.split('&').forEach((param) => { + const [key, value] = param.split('=').map(decodeURIComponent); + if (key && value != null) { + result[key] = value; + } + }); + return result; +}; + +// For utils.setQueryParams() +const filterParams = (params = {}) => { + const result = {}; + Object.entries(params).forEach(([key, value]) => { + if (key && value != null) { + result[key] = value; + } + }); + return result; +}; + +// For utils.computeProperties() +const deepOverride = (obj, opt) => { + if (obj === undefined) { + return opt; + } + const objType = Object.prototype.toString.call(obj); + const optType = Object.prototype.toString.call(opt); + if (objType !== optType) { + return obj; + } + if (objType !== '[object Object]') { + return opt === undefined ? obj : opt; + } + Object.keys({ + ...obj, + ...opt, + }).forEach((key) => { + obj[key] = deepOverride(obj[key], opt[key]); + }); + return obj; +}; + +// For utils.addQueryParams() +const urlParser = document.createElement('a'); + +const deepCopy = (obj) => { + if (obj == null) { + return obj; + } + return JSON.parse(JSON.stringify(obj)); +}; + +// Compute presets +const computedPresets = {}; +Object.keys(presets).forEach((key) => { + let preset = deepCopy(presets[key][0]); + if (presets[key][1]) { + preset = deepOverride(preset, presets[key][1]); + } + computedPresets[key] = preset; +}); + +export default { + computedPresets, + queryParams: parseQueryParams(window.location.hash.slice(1)), + setQueryParams(params = {}) { + this.queryParams = filterParams(params); + const serializedParams = Object.entries(this.queryParams).map(([key, value]) => + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join('&'); + const hash = `#${serializedParams}`; + if (window.location.hash !== hash) { + window.location.replace(hash); + } + }, + sanitizeText(text) { + const result = `${text || ''}`.slice(0, constants.textMaxLength); + // last char must be a `\n`. + return `${result}\n`.replace(/\n\n$/, '\n'); + }, + sanitizeName(name) { + return `${name || ''}` + // Keep only 250 characters + .slice(0, 250) || constants.defaultName; + }, + sanitizeFilename(name) { + return this.sanitizeName(`${name || ''}` + // Replace `/`, control characters and other kind of spaces with a space + .replace(/[/\x00-\x1F\x7f-\xa0\s]+/g, ' ') // eslint-disable-line no-control-regex + .trim()) || constants.defaultName; + }, + deepCopy, + serializeObject(obj) { + return obj === undefined ? obj : JSON.stringify(obj, (key, value) => { + if (Object.prototype.toString.call(value) !== '[object Object]') { + return value; + } + // Sort keys to have a predictable result + return Object.keys(value).sort().reduce((sorted, valueKey) => { + sorted[valueKey] = value[valueKey]; + return sorted; + }, {}); + }); + }, + search(items, criteria) { + let result; + items.some((item) => { + // If every field fits the criteria + if (Object.entries(criteria).every(([key, value]) => value === item[key])) { + result = item; + } + return result; + }); + return result; + }, + uid() { + crypto.getRandomValues(array); + return array.cl_map(value => alphabet[value % radix]).join(''); + }, + hash(str) { + // https://stackoverflow.com/a/7616484/1333165 + let hash = 0; + if (!str) return hash; + for (let i = 0; i < str.length; i += 1) { + const char = str.charCodeAt(i); + hash = ((hash << 5) - hash) + char; // eslint-disable-line no-bitwise + hash |= 0; // eslint-disable-line no-bitwise + } + return hash; + }, + getItemHash(item) { + return this.hash(this.serializeObject({ + ...item, + // These properties must not be part of the hash + id: undefined, + hash: undefined, + history: undefined, + })); + }, + addItemHash(item) { + return { + ...item, + hash: this.getItemHash(item), + }; + }, + makeWorkspaceId(params) { + return Math.abs(this.hash(this.serializeObject(params))).toString(36); + }, + getDbName(workspaceId) { + let dbName = 'stackedit-db'; + if (workspaceId !== 'main') { + dbName += `-${workspaceId}`; + } + return dbName; + }, + encodeBase64(str, urlSafe = false) { + const uriEncodedStr = encodeURIComponent(str); + const utf8Str = uriEncodedStr.replace( + /%([0-9A-F]{2})/g, + (match, p1) => String.fromCharCode(`0x${p1}`), + ); + const result = btoa(utf8Str); + if (!urlSafe) { + return result; + } + return result + .replace(/\//g, '_') // Replace `/` with `_` + .replace(/\+/g, '-') // Replace `+` with `-` + .replace(/=+$/, ''); // Remove trailing `=` + }, + encodeFiletoBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result.split(',').pop()); + reader.onerror = error => reject(error); + }); + }, + base64ToBlob(dataurl, fileName) { + const potIdx = fileName.lastIndexOf('.'); + const suffix = potIdx > -1 ? fileName.substring(potIdx + 1) : 'png'; + const mime = `image/${suffix}`; + const bstr = atob(dataurl); + let n = bstr.length; + const u8arr = new Uint8Array(n); + while (n >= 0) { + n -= 1; + u8arr[n] = bstr.charCodeAt(n); + } + return new Blob([u8arr], { type: mime }); + }, + decodeBase64(str) { + // In case of URL safe base64 + const sanitizedStr = str.replace(/_/g, '/').replace(/-/g, '+'); + const utf8Str = atob(sanitizedStr); + const uriEncodedStr = utf8Str + .split('') + .map(c => `%${`00${c.charCodeAt(0).toString(16)}`.slice(-2)}`) + .join(''); + return decodeURIComponent(uriEncodedStr); + }, + computeProperties(yamlProperties) { + let properties = {}; + try { + properties = yaml.safeLoad(yamlProperties) || {}; + } catch (e) { + // Ignore + } + const extensions = properties.extensions || {}; + const computedPreset = deepCopy(computedPresets[extensions.preset] || computedPresets.default); + const computedExtensions = deepOverride(computedPreset, properties.extensions); + computedExtensions.preset = extensions.preset; + properties.extensions = computedExtensions; + return properties; + }, + randomize(value) { + return Math.floor((1 + (Math.random() * 0.2)) * value); + }, + setInterval(func, interval) { + return setInterval(() => func(), this.randomize(interval)); + }, + async awaitSequence(values, asyncFunc) { + const results = []; + const valuesLeft = values.slice().reverse(); + const runWithNextValue = async () => { + if (!valuesLeft.length) { + return results; + } + results.push(await asyncFunc(valuesLeft.pop())); + return runWithNextValue(); + }; + return runWithNextValue(); + }, + async awaitSome(asyncFunc) { + if (await asyncFunc()) { + return this.awaitSome(asyncFunc); + } + return null; + }, + someResult(values, func) { + let result; + values.some((value) => { + result = func(value); + return result; + }); + return result; + }, + parseQueryParams, + addQueryParams(url = '', params = {}, hash = false) { + const keys = Object.keys(params).filter(key => params[key] != null); + urlParser.href = url; + if (!keys.length) { + return urlParser.href; + } + const serializedParams = keys.map(key => + `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`).join('&'); + if (hash) { + if (urlParser.hash) { + urlParser.hash += '&'; + } else { + urlParser.hash = '#'; + } + urlParser.hash += serializedParams; + } else { + if (urlParser.search) { + urlParser.search += '&'; + } else { + urlParser.search = '?'; + } + urlParser.search += serializedParams; + } + return urlParser.href; + }, + resolveUrl(baseUrl, path) { + const oldBaseElt = document.getElementsByTagName('base')[0]; + const oldHref = oldBaseElt && oldBaseElt.href; + const newBaseElt = oldBaseElt || document.head.appendChild(document.createElement('base')); + newBaseElt.href = baseUrl; + urlParser.href = path; + const result = urlParser.href; + if (oldBaseElt) { + oldBaseElt.href = oldHref; + } else { + document.head.removeChild(newBaseElt); + } + return result; + }, + getHostname(url) { + urlParser.href = url; + return urlParser.hostname; + }, + encodeUrlPath(path) { + return path ? path.split('/').map(encodeURIComponent).join('/') : ''; + }, + decodeUrlPath(path) { + return path ? path.split('/').map(decodeURIComponent).join('/') : ''; + }, + parseGithubRepoUrl(url) { + const parsedRepo = url && url.match(/([^/:]+)\/([^/]+?)(?:\.git|\/)?$/); + return parsedRepo && { + owner: parsedRepo[1], + repo: parsedRepo[2], + }; + }, + parseGitlabProjectPath(url) { + const parsedProject = url && url.match(/^http[s]?:\/\/[^/]+\/(.+?)(?:\.git|\/)?$/); + return parsedProject && parsedProject[1]; + }, + parseGiteaProjectPath(url) { + const parsedProject = url && url.match(/^http[s]?:\/\/[^/]+\/(.+?)(?:\.git|\/)?$/); + return parsedProject && parsedProject[1]; + }, + createHiddenIframe(url) { + const iframeElt = document.createElement('iframe'); + iframeElt.style.position = 'absolute'; + iframeElt.style.left = '-99px'; + iframeElt.style.width = '1px'; + iframeElt.style.height = '1px'; + iframeElt.src = url; + return iframeElt; + }, + wrapRange(range, eltProperties) { + const rangeLength = `${range}`.length; + let wrappedLength = 0; + const treeWalker = document + .createTreeWalker(range.commonAncestorContainer, NodeFilter.SHOW_TEXT); + let { startOffset } = range; + treeWalker.currentNode = range.startContainer; + if (treeWalker.currentNode.nodeType === Node.TEXT_NODE || treeWalker.nextNode()) { + do { + if (treeWalker.currentNode.nodeValue !== '\n') { + if (treeWalker.currentNode === range.endContainer && + range.endOffset < treeWalker.currentNode.nodeValue.length + ) { + treeWalker.currentNode.splitText(range.endOffset); + } + if (startOffset) { + treeWalker.currentNode = treeWalker.currentNode.splitText(startOffset); + startOffset = 0; + } + const elt = document.createElement('span'); + Object.entries(eltProperties).forEach(([key, value]) => { + elt[key] = value; + }); + treeWalker.currentNode.parentNode.insertBefore(elt, treeWalker.currentNode); + elt.appendChild(treeWalker.currentNode); + } + wrappedLength += treeWalker.currentNode.nodeValue.length; + if (wrappedLength >= rangeLength) { + break; + } + } + while (treeWalker.nextNode()); + } + }, + unwrapRange(eltCollection) { + Array.prototype.slice.call(eltCollection).forEach((elt) => { + // Loop in case another wrapper has been added inside + for (let child = elt.firstChild; child; child = elt.firstChild) { + if (child.nodeType === 3) { + if (elt.previousSibling && elt.previousSibling.nodeType === 3) { + child.nodeValue = elt.previousSibling.nodeValue + child.nodeValue; + elt.parentNode.removeChild(elt.previousSibling); + } + if (!child.nextSibling && elt.nextSibling && elt.nextSibling.nodeType === 3) { + child.nodeValue += elt.nextSibling.nodeValue; + elt.parentNode.removeChild(elt.nextSibling); + } + } + elt.parentNode.insertBefore(child, elt); + } + elt.parentNode.removeChild(elt); + }); + }, + getAbsoluteDir(currDirNode) { + if (!currDirNode) { + return ''; + } + let path = currDirNode.item.name; + if (currDirNode.parentNode) { + const parentPath = this.getAbsoluteDir(currDirNode.parentNode); + if (parentPath) { + path = `${parentPath}/${path}`; + } + } + return path || ''; + }, + // 根据当前绝对路径 与 文件路径计算出文件绝对路径 + getAbsoluteFilePath(currDirNode, originFilePath) { + const filePath = originFilePath && originFilePath.replaceAll('\\', '/'); + const currAbsolutePath = this.getAbsoluteDir(currDirNode); + // "/"开头说明已经是绝对路径 + if (filePath.indexOf('/') === 0) { + return filePath.replaceAll(' ', '%20'); + } + let path = filePath; + // 相对上级路径 + if (path.indexOf('../') === 0) { + return this.getAbsoluteFilePath(currDirNode && currDirNode.parentNode, path.replace('../', '')); + } else if (path.indexOf('./') === 0) { + path = `${currAbsolutePath}/${path.replace('./', '')}`; + } else { + path = `${currAbsolutePath}/${path}`; + } + return (path.indexOf('/') === 0 ? path : `/${path}`).replaceAll(' ', '%20'); + }, + findNodeByPath(rootNode, currDirNode, filePath) { + // 先获取绝对路径 + const path = this.getAbsoluteFilePath(currDirNode, filePath).replaceAll('%20', ' '); + const pathArr = path.split('/'); + let node = rootNode; + for (let i = 0; i < pathArr.length; i += 1) { + if (i > 0) { + if (i === pathArr.length - 1) { + return node.files.find(it => `${it.item.name}.md` === pathArr[i]); + } + node = node.folders.find(it => it.item.name === pathArr[i]); + if (!node) { + return null; + } + } + } + return null; + }, +}; diff --git a/src/services/workspaceSvc.js b/src/services/workspaceSvc.js new file mode 100644 index 0000000..c950554 --- /dev/null +++ b/src/services/workspaceSvc.js @@ -0,0 +1,312 @@ +import store from '../store'; +import utils from './utils'; +import constants from '../data/constants'; +import badgeSvc from './badgeSvc'; + +const forbiddenFolderNameMatcher = /^\.stackedit-data$|^\.stackedit-trash$|\.md$|\.sync$|\.publish$/; + +export default { + + /** + * Create a file in the store with the specified fields. + */ + async createFile({ + name, + parentId, + text, + properties, + discussions, + comments, + } = {}, background = false) { + const id = utils.uid(); + const item = { + id, + name: utils.sanitizeFilename(name), + parentId: parentId || null, + }; + const content = { + id: `${id}/content`, + text: utils.sanitizeText(text || store.getters['data/computedSettings'].newFileContent), + properties: utils + .sanitizeText(properties || store.getters['data/computedSettings'].newFileProperties), + discussions: discussions || {}, + comments: comments || {}, + }; + const workspaceUniquePaths = store.getters['workspace/currentWorkspaceHasUniquePaths']; + + // Show warning dialogs + if (!background) { + // If name is being stripped + if (item.name !== constants.defaultName && item.name !== name) { + await store.dispatch('modal/open', { + type: 'stripName', + item, + }); + } + + // Check if there is already a file with that path + if (workspaceUniquePaths) { + const parentPath = store.getters.pathsByItemId[item.parentId] || ''; + const path = parentPath + item.name; + if (store.getters.itemsByPath[path]) { + await store.dispatch('modal/open', { + type: 'pathConflict', + item, + }); + } + } + } + + // Save file and content in the store + store.commit('content/setItem', content); + store.commit('file/setItem', item); + if (workspaceUniquePaths) { + this.makePathUnique(id); + } + + // Return the new file item + return store.state.file.itemsById[id]; + }, + + /** + * Make sanity checks and then create/update the folder/file in the store. + */ + async storeItem(item) { + const id = item.id || utils.uid(); + const sanitizedName = utils.sanitizeFilename(item.name); + + if (item.type === 'folder' && forbiddenFolderNameMatcher.exec(sanitizedName)) { + await store.dispatch('modal/open', { + type: 'unauthorizedName', + item, + }); + throw new Error('未经授权的名称。'); + } + + // Show warning dialogs + // If name has been stripped + if (sanitizedName !== constants.defaultName && sanitizedName !== item.name) { + await store.dispatch('modal/open', { + type: 'stripName', + item, + }); + } + + // Check if there is a path conflict + if (store.getters['workspace/currentWorkspaceHasUniquePaths']) { + const parentPath = store.getters.pathsByItemId[item.parentId] || ''; + const path = parentPath + sanitizedName; + const items = store.getters.itemsByPath[path] || []; + if (items.some(itemWithSamePath => itemWithSamePath.id !== id)) { + await store.dispatch('modal/open', { + type: 'pathConflict', + item, + }); + } + } + + return this.setOrPatchItem({ + ...item, + id, + }); + }, + + /** + * Create/update the folder/file in the store and make sure its path is unique. + */ + setOrPatchItem(patch) { + const item = { + ...store.getters.allItemsById[patch.id] || patch, + }; + if (!item.id) { + return null; + } + + if (patch.parentId !== undefined) { + item.parentId = patch.parentId || null; + } + if (patch.name) { + const sanitizedName = utils.sanitizeFilename(patch.name); + if (item.type !== 'folder' || !forbiddenFolderNameMatcher.exec(sanitizedName)) { + item.name = sanitizedName; + } + } + + // Save item in the store + store.commit(`${item.type}/setItem`, item); + + // Remove circular reference + this.removeCircularReference(item); + + // Ensure path uniqueness + if (store.getters['workspace/currentWorkspaceHasUniquePaths']) { + this.makePathUnique(item.id); + } + + return store.getters.allItemsById[item.id]; + }, + + /** + * Delete a file in the store and all its related items. + */ + deleteFile(fileId) { + // Delete the file + store.commit('file/deleteItem', fileId); + // Delete the content + store.commit('content/deleteItem', `${fileId}/content`); + // Delete the syncedContent + store.commit('syncedContent/deleteItem', `${fileId}/syncedContent`); + // Delete the contentState + store.commit('contentState/deleteItem', `${fileId}/contentState`); + // Delete sync locations + (store.getters['syncLocation/groupedByFileId'][fileId] || []) + .forEach(item => store.commit('syncLocation/deleteItem', item.id)); + // Delete publish locations + (store.getters['publishLocation/groupedByFileId'][fileId] || []) + .forEach(item => store.commit('publishLocation/deleteItem', item.id)); + }, + + /** + * Sanitize the whole workspace. + */ + sanitizeWorkspace(idsToKeep) { + // Detect and remove circular references for all folders. + store.getters['folder/items'].forEach(folder => this.removeCircularReference(folder)); + + this.ensureUniquePaths(idsToKeep); + this.ensureUniqueLocations(idsToKeep); + }, + + /** + * Detect and remove circular reference for an item. + */ + removeCircularReference(item) { + const foldersById = store.state.folder.itemsById; + for ( + let parentFolder = foldersById[item.parentId]; + parentFolder; + parentFolder = foldersById[parentFolder.parentId] + ) { + if (parentFolder.id === item.id) { + store.commit('folder/patchItem', { + id: item.id, + parentId: null, + }); + break; + } + } + }, + + /** + * Ensure two files/folders don't have the same path if the workspace doesn't allow it. + */ + ensureUniquePaths(idsToKeep = {}) { + if (store.getters['workspace/currentWorkspaceHasUniquePaths']) { + if (Object.keys(store.getters.pathsByItemId) + .some(id => !idsToKeep[id] && this.makePathUnique(id)) + ) { + // Just changed one item path, restart + this.ensureUniquePaths(idsToKeep); + } + } + }, + + /** + * Return false if the file/folder path is unique. + * Add a prefix to its name and return true otherwise. + */ + makePathUnique(id) { + const { itemsByPath, allItemsById, pathsByItemId } = store.getters; + const item = allItemsById[id]; + if (!item) { + return false; + } + let path = pathsByItemId[id]; + if (itemsByPath[path].length === 1) { + return false; + } + const isFolder = item.type === 'folder'; + if (isFolder) { + // Remove trailing slash + path = path.slice(0, -1); + } + for (let suffix = 1; ; suffix += 1) { + let pathWithSuffix = `${path}.${suffix}`; + if (isFolder) { + pathWithSuffix += '/'; + } + if (!itemsByPath[pathWithSuffix]) { + store.commit(`${item.type}/patchItem`, { + id: item.id, + name: `${item.name}.${suffix}`, + }); + return true; + } + } + }, + + addSyncLocation(location) { + store.commit('syncLocation/setItem', { + ...location, + id: utils.uid(), + }); + + // Sanitize the workspace + this.ensureUniqueLocations(); + + if (Object.keys(store.getters['syncLocation/currentWithWorkspaceSyncLocation']).length > 1) { + badgeSvc.addBadge('syncMultipleLocations'); + } + }, + + addPublishLocation(location) { + store.commit('publishLocation/setItem', { + ...location, + id: utils.uid(), + }); + + // Sanitize the workspace + this.ensureUniqueLocations(); + + if (Object.keys(store.getters['publishLocation/current']).length > 1) { + badgeSvc.addBadge('publishMultipleLocations'); + } + }, + + /** + * Ensure two sync/publish locations of the same file don't have the same hash. + */ + ensureUniqueLocations(idsToKeep = {}) { + ['syncLocation', 'publishLocation'].forEach((type) => { + store.getters[`${type}/items`].forEach((item) => { + if (!idsToKeep[item.id] + && store.getters[`${type}/groupedByFileIdAndHash`][item.fileId][item.hash].length > 1 + ) { + store.commit(`${item.type}/deleteItem`, item.id); + } + }); + }); + }, + + /** + * Drop the database and clean the localStorage for the specified workspaceId. + */ + async removeWorkspace(id) { + // Remove from the store first as workspace tabs will reload. + // Workspace deletion will be persisted as soon as possible + // by the store.getters['data/workspaces'] watcher in localDbSvc. + store.dispatch('workspace/removeWorkspace', id); + + // Drop the database + await new Promise((resolve) => { + const dbName = utils.getDbName(id); + const request = indexedDB.deleteDatabase(dbName); + request.onerror = resolve; // Ignore errors + request.onsuccess = resolve; + }); + + // Clean the local storage + localStorage.removeItem(`${id}/lastSyncActivity`); + localStorage.removeItem(`${id}/lastWindowFocus`); + }, +}; diff --git a/src/store/content.js b/src/store/content.js new file mode 100644 index 0000000..2e82d1f --- /dev/null +++ b/src/store/content.js @@ -0,0 +1,114 @@ +import DiffMatchPatch from 'diff-match-patch'; +import moduleTemplate from './moduleTemplate'; +import empty from '../data/empties/emptyContent'; +import utils from '../services/utils'; +import cledit from '../services/editor/cledit'; +import badgeSvc from '../services/badgeSvc'; + +const diffMatchPatch = new DiffMatchPatch(); + +const module = moduleTemplate(empty); + +module.state = { + ...module.state, + revisionContent: null, +}; + +module.mutations = { + ...module.mutations, + setRevisionContent: (state, value) => { + if (value) { + state.revisionContent = { + ...empty(), + ...value, + id: utils.uid(), + hash: Date.now(), + }; + } else { + state.revisionContent = null; + } + }, +}; + +module.getters = { + ...module.getters, + current: ({ itemsById, revisionContent }, getters, rootState, rootGetters) => { + if (revisionContent) { + return revisionContent; + } + return itemsById[`${rootGetters['file/current'].id}/content`] || empty(); + }, + currentChangeTrigger: (state, getters) => { + const { current } = getters; + return utils.serializeObject([ + current.id, + current.text, + current.hash, + ]); + }, + currentProperties: (state, { current }) => utils.computeProperties(current.properties), + isCurrentEditable: ({ revisionContent }, { current }, rootState, rootGetters) => + !revisionContent && current.id && rootGetters['layout/styles'].showEditor, +}; + +module.actions = { + ...module.actions, + patchCurrent({ state, getters, commit }, value) { + const { id } = getters.current; + if (id && !state.revisionContent) { + commit('patchItem', { + ...value, + id, + }); + } + }, + setRevisionContent({ state, rootGetters, commit }, value) { + const currentFile = rootGetters['file/current']; + const currentContent = state.itemsById[`${currentFile.id}/content`]; + if (currentContent) { + const diffs = diffMatchPatch.diff_main(currentContent.text, value.text); + diffMatchPatch.diff_cleanupSemantic(diffs); + commit('setRevisionContent', { + text: diffs.map(([, text]) => text).join(''), + diffs, + originalText: value.text, + }); + } + }, + async restoreRevision({ + state, + getters, + commit, + dispatch, + }) { + const { revisionContent } = state; + if (revisionContent) { + await dispatch('modal/open', 'fileRestoration', { root: true }); + // Close revision + commit('setRevisionContent'); + const currentContent = utils.deepCopy(getters.current); + if (currentContent) { + // Restore text and move discussions + const diffs = diffMatchPatch + .diff_main(currentContent.text, revisionContent.originalText); + diffMatchPatch.diff_cleanupSemantic(diffs); + Object.entries(currentContent.discussions).forEach(([, discussion]) => { + const adjustOffset = (offsetName) => { + const marker = new cledit.Marker(discussion[offsetName], offsetName === 'end'); + marker.adjustOffset(diffs); + discussion[offsetName] = marker.offset; + }; + adjustOffset('start'); + adjustOffset('end'); + }); + dispatch('patchCurrent', { + ...currentContent, + text: revisionContent.originalText, + }); + badgeSvc.addBadge('restoreVersion'); + } + } + }, +}; + +export default module; diff --git a/src/store/contentState.js b/src/store/contentState.js new file mode 100644 index 0000000..3cbcb1b --- /dev/null +++ b/src/store/contentState.js @@ -0,0 +1,22 @@ +import moduleTemplate from './moduleTemplate'; +import empty from '../data/empties/emptyContentState'; + +const module = moduleTemplate(empty, true); + +module.getters = { + ...module.getters, + current: ({ itemsById }, getters, rootState, rootGetters) => + itemsById[`${rootGetters['file/current'].id}/contentState`] || empty(), +}; + +module.actions = { + ...module.actions, + patchCurrent({ getters, commit }, value) { + commit('patchItem', { + ...value, + id: getters.current.id, + }); + }, +}; + +export default module; diff --git a/src/store/contextMenu.js b/src/store/contextMenu.js new file mode 100644 index 0000000..6b4180e --- /dev/null +++ b/src/store/contextMenu.js @@ -0,0 +1,55 @@ +const setter = propertyName => (state, value) => { + state[propertyName] = value; +}; + +export default { + namespaced: true, + state: { + coordinates: { + left: 0, + top: 0, + }, + items: [], + resolve: () => {}, + }, + mutations: { + setCoordinates: setter('coordinates'), + setItems: setter('items'), + setResolve: setter('resolve'), + }, + actions: { + open({ commit, rootState }, { coordinates, items }) { + commit('setItems', items); + // Place the context menu outside the screen + commit('setCoordinates', { top: 0, left: -9999 }); + // Let the UI refresh itself + setTimeout(() => { + // Take the size of the context menu and place it + const elt = document.querySelector('.context-menu__inner'); + if (elt) { + const height = elt.offsetHeight; + if (coordinates.top + height > rootState.layout.bodyHeight) { + coordinates.top -= height; + } + if (coordinates.top < 0) { + coordinates.top = 0; + } + const width = elt.offsetWidth; + if (coordinates.left + width > rootState.layout.bodyWidth) { + coordinates.left -= width; + } + if (coordinates.left < 0) { + coordinates.left = 0; + } + commit('setCoordinates', coordinates); + } + }, 1); + + return new Promise(resolve => commit('setResolve', resolve)); + }, + close({ commit }) { + commit('setItems', []); + commit('setResolve', () => {}); + }, + }, +}; diff --git a/src/store/data.js b/src/store/data.js new file mode 100644 index 0000000..374e987 --- /dev/null +++ b/src/store/data.js @@ -0,0 +1,338 @@ +import Vue from 'vue'; +import yaml from 'js-yaml'; +import utils from '../services/utils'; +import defaultWorkspaces from '../data/defaults/defaultWorkspaces'; +import defaultSettings from '../data/defaults/defaultSettings.yml'; +import defaultLocalSettings from '../data/defaults/defaultLocalSettings'; +import defaultLayoutSettings from '../data/defaults/defaultLayoutSettings'; +import plainHtmlTemplate from '../data/templates/plainHtmlTemplate.html'; +import styledHtmlTemplate from '../data/templates/styledHtmlTemplate.html'; +import styledHtmlWithTocTemplate from '../data/templates/styledHtmlWithTocTemplate.html'; +import styledHtmlWithThemeTemplate from '../data/templates/styledHtmlWithThemeTemplate.html'; +import styledHtmlWithThemeAndTocTemplate from '../data/templates/styledHtmlWithThemeAndTocTemplate.html'; +import jekyllSiteTemplate from '../data/templates/jekyllSiteTemplate.html'; +import constants from '../data/constants'; +import features from '../data/features'; +import badgeSvc from '../services/badgeSvc'; + +const itemTemplate = (id, data = {}) => ({ + id, + type: 'data', + data, + hash: 0, +}); + +const empty = (id) => { + switch (id) { + case 'workspaces': + return itemTemplate(id, defaultWorkspaces()); + case 'settings': + return itemTemplate(id, '\n'); + case 'localSettings': + return itemTemplate(id, defaultLocalSettings()); + case 'layoutSettings': + return itemTemplate(id, defaultLayoutSettings()); + default: + return itemTemplate(id); + } +}; + +// Item IDs that will be stored in the localStorage +const localStorageIdSet = new Set(constants.localStorageDataIds); + +// Getter/setter/patcher factories +const getter = id => (state) => { + const itemsById = localStorageIdSet.has(id) + ? state.lsItemsById + : state.itemsById; + if (itemsById[id]) { + return itemsById[id].data; + } + return empty(id).data; +}; +const setter = id => ({ commit }, data) => commit('setItem', itemTemplate(id, data)); +const patcher = id => ({ state, commit }, data) => { + const itemsById = localStorageIdSet.has(id) + ? state.lsItemsById + : state.itemsById; + const item = Object.assign(empty(id), itemsById[id]); + commit('setItem', { + ...empty(id), + data: typeof data === 'object' ? { + ...item.data, + ...data, + } : data, + }); +}; + +// For layoutSettings +const toggleLayoutSetting = (name, value, featureId, getters, dispatch) => { + const currentValue = getters.layoutSettings[name]; + const patch = { + [name]: value === undefined ? !currentValue : !!value, + }; + if (patch[name] !== currentValue) { + dispatch('patchLayoutSettings', patch); + badgeSvc.addBadge(featureId); + } +}; + +const layoutSettingsToggler = (propertyName, featureId) => ({ getters, dispatch }, value) => + toggleLayoutSetting(propertyName, value, featureId, getters, dispatch); + +const notEnoughSpace = (layoutConstants, showGutter) => + document.body.clientWidth < layoutConstants.editorMinWidth + + layoutConstants.explorerWidth + + layoutConstants.sideBarWidth + + layoutConstants.buttonBarWidth + + (showGutter ? layoutConstants.gutterWidth : 0); + +// For templates +const makeAdditionalTemplate = (name, value, helpers = '\n') => ({ + name, + value, + helpers, + isAdditional: true, +}); +const defaultTemplates = { + plainText: makeAdditionalTemplate('Markdown文本', '{{{files.0.content.text}}}'), + plainHtml: makeAdditionalTemplate('无样式HTML', plainHtmlTemplate), + styledHtml: makeAdditionalTemplate('标准样式HTML', styledHtmlTemplate), + styledHtmlWithToc: makeAdditionalTemplate('带目录标准样式HTML', styledHtmlWithTocTemplate), + styledHtmlWithTheme: makeAdditionalTemplate('带预览主题HTML', styledHtmlWithThemeTemplate), + styledHtmlWithThemeAndToc: makeAdditionalTemplate('带目录预览主题HTML', styledHtmlWithThemeAndTocTemplate), + jekyllSite: makeAdditionalTemplate('Jekyll site', jekyllSiteTemplate), +}; + +// For tokens +const tokenAdder = providerId => ({ getters, dispatch }, token) => { + dispatch('patchTokensByType', { + [providerId]: { + ...getters[`${providerId}TokensBySub`], + [token.sub]: token, + }, + }); +}; + +export default { + namespaced: true, + state: { + // Data items stored in the DB + itemsById: {}, + // Data items stored in the localStorage + lsItemsById: {}, + }, + mutations: { + setItem: ({ itemsById, lsItemsById }, value) => { + // Create an empty item and override its data field + const emptyItem = empty(value.id); + const data = typeof value.data === 'object' + ? Object.assign(emptyItem.data, value.data) + : value.data; + + // Make item with hash + const item = utils.addItemHash({ + ...emptyItem, + data, + }); + + // Store item in itemsById or lsItemsById if its stored in the localStorage + Vue.set(localStorageIdSet.has(item.id) ? lsItemsById : itemsById, item.id, item); + }, + deleteItem({ itemsById }, id) { + // Only used by localDbSvc to clean itemsById from object moved to localStorage + Vue.delete(itemsById, id); + }, + }, + getters: { + serverConf: getter('serverConf'), + workspaces: getter('workspaces'), // Not to be used, prefer workspace/workspacesById + settings: getter('settings'), + computedSettings: (state, { settings }) => { + const customSettings = yaml.safeLoad(settings); + const parsedSettings = yaml.safeLoad(defaultSettings); + const override = (obj, opt) => { + const objType = Object.prototype.toString.call(obj); + const optType = Object.prototype.toString.call(opt); + if (objType !== optType) { + return obj; + } else if (objType !== '[object Object]') { + return opt; + } + Object.keys(obj).forEach((key) => { + if (key === 'shortcuts') { + obj[key] = Object.assign(obj[key], opt[key]); + } else { + obj[key] = override(obj[key], opt[key]); + } + }); + return obj; + }; + return override(parsedSettings, customSettings); + }, + localSettings: getter('localSettings'), + layoutSettings: getter('layoutSettings'), + templatesById: getter('templates'), + allTemplatesById: (state, { templatesById }) => ({ + ...templatesById, + ...defaultTemplates, + }), + lastCreated: getter('lastCreated'), + lastOpened: getter('lastOpened'), + lastOpenedIds: (state, { lastOpened }, rootState) => { + const result = { + ...lastOpened, + }; + const currentFileId = rootState.file.currentId; + if (currentFileId && !result[currentFileId]) { + result[currentFileId] = Date.now(); + } + return Object.keys(result) + .filter(id => rootState.file.itemsById[id]) + .sort((id1, id2) => result[id2] - result[id1]) + .slice(0, 20); + }, + syncDataById: getter('syncData'), + syncDataByItemId: (state, { syncDataById }, rootState, rootGetters) => { + const result = {}; + if (rootGetters['workspace/currentWorkspaceIsGit']) { + Object.entries(rootGetters.gitPathsByItemId).forEach(([id, path]) => { + const syncDataEntry = syncDataById[path]; + if (syncDataEntry) { + result[id] = syncDataEntry; + } + }); + } else { + Object.entries(syncDataById).forEach(([, syncDataEntry]) => { + result[syncDataEntry.itemId] = syncDataEntry; + }); + } + return result; + }, + dataSyncDataById: getter('dataSyncData'), + tokensByType: getter('tokens'), + googleTokensBySub: (state, { tokensByType }) => tokensByType.google || {}, + couchdbTokensBySub: (state, { tokensByType }) => tokensByType.couchdb || {}, + dropboxTokensBySub: (state, { tokensByType }) => tokensByType.dropbox || {}, + githubTokensBySub: (state, { tokensByType }) => tokensByType.github || {}, + giteeTokensBySub: (state, { tokensByType }) => tokensByType.gitee || {}, + gitlabTokensBySub: (state, { tokensByType }) => tokensByType.gitlab || {}, + giteaTokensBySub: (state, { tokensByType }) => tokensByType.gitea || {}, + wordpressTokensBySub: (state, { tokensByType }) => tokensByType.wordpress || {}, + zendeskTokensBySub: (state, { tokensByType }) => tokensByType.zendesk || {}, + smmsTokensBySub: (state, { tokensByType }) => tokensByType.smms || {}, + customTokensBySub: (state, { tokensByType }) => tokensByType.custom || {}, + badgeCreations: getter('badgeCreations'), + badgeTree: (state, { badgeCreations }) => features + .map(feature => feature.toBadge(badgeCreations)), + allBadges: (state, { badgeTree }) => { + const result = []; + const processBadgeNodes = nodes => nodes.forEach((node) => { + result.push(node); + if (node.children) { + processBadgeNodes(node.children); + } + }); + processBadgeNodes(badgeTree); + return result; + }, + }, + actions: { + setServerConf: setter('serverConf'), + setSettings: setter('settings'), + switchThemeSetting: ({ commit, getters }) => { + const customSettingStr = getters.settings; + let { colorTheme } = getters.computedSettings; + if (!colorTheme || colorTheme === 'light') { + colorTheme = 'dark'; + } else { + colorTheme = 'light'; + } + const themeStr = `colorTheme: ${colorTheme}`; + let settingsStr = (customSettingStr && customSettingStr.trim()) || '# 增加您的自定义配置覆盖默认配置'; + settingsStr = settingsStr.indexOf('colorTheme:') > -1 ? + settingsStr.replace(/.*colorTheme:.*/, themeStr) : `${settingsStr}\n${themeStr}`; + commit('setItem', itemTemplate('settings', settingsStr)); + badgeSvc.addBadge('switchTheme'); + }, + patchLocalSettings: patcher('localSettings'), + patchLayoutSettings: patcher('layoutSettings'), + toggleNavigationBar: layoutSettingsToggler('showNavigationBar', 'toggleNavigationBar'), + toggleEditor: layoutSettingsToggler('showEditor', 'toggleEditor'), + toggleSidePreview: layoutSettingsToggler('showSidePreview', 'toggleSidePreview'), + toggleStatusBar: layoutSettingsToggler('showStatusBar', 'toggleStatusBar'), + toggleScrollSync: layoutSettingsToggler('scrollSync', 'toggleScrollSync'), + toggleFocusMode: layoutSettingsToggler('focusMode', 'toggleFocusMode'), + toggleSideBar: ({ getters, dispatch, rootGetters }, value) => { + // Reset side bar + dispatch('setSideBarPanel'); + + // Toggle it + toggleLayoutSetting('showSideBar', value, 'toggleSideBar', getters, dispatch); + + // Close explorer if not enough space + if (getters.layoutSettings.showSideBar && + notEnoughSpace(rootGetters['layout/constants'], rootGetters['discussion/currentDiscussion']) + ) { + dispatch('patchLayoutSettings', { + showExplorer: false, + }); + } + }, + toggleExplorer: ({ getters, dispatch, rootGetters }, value) => { + // Toggle explorer + toggleLayoutSetting('showExplorer', value, 'toggleExplorer', getters, dispatch); + + // Close side bar if not enough space + if (getters.layoutSettings.showExplorer && + notEnoughSpace(rootGetters['layout/constants'], rootGetters['discussion/currentDiscussion']) + ) { + dispatch('patchLayoutSettings', { + showSideBar: false, + }); + } + }, + setSideBarPanel: ({ dispatch }, value) => dispatch('patchLayoutSettings', { + sideBarPanel: value === undefined ? 'menu' : value, + }), + setTemplatesById: ({ commit }, templatesById) => { + const templatesToCommit = { + ...templatesById, + }; + // We don't store additional templates + Object.keys(defaultTemplates).forEach((id) => { + delete templatesToCommit[id]; + }); + commit('setItem', itemTemplate('templates', templatesToCommit)); + }, + setLastCreated: setter('lastCreated'), + setLastOpenedId: ({ getters, commit, rootState }, fileId) => { + const lastOpened = { ...getters.lastOpened }; + lastOpened[fileId] = Date.now(); + // Remove entries that don't exist anymore + const cleanedLastOpened = {}; + Object.entries(lastOpened).forEach(([id, value]) => { + if (rootState.file.itemsById[id]) { + cleanedLastOpened[id] = value; + } + }); + commit('setItem', itemTemplate('lastOpened', cleanedLastOpened)); + }, + setSyncDataById: setter('syncData'), + patchSyncDataById: patcher('syncData'), + patchDataSyncDataById: patcher('dataSyncData'), + patchTokensByType: patcher('tokens'), + addGoogleToken: tokenAdder('google'), + addCouchdbToken: tokenAdder('couchdb'), + addDropboxToken: tokenAdder('dropbox'), + addGithubToken: tokenAdder('github'), + addGiteeToken: tokenAdder('gitee'), + addGitlabToken: tokenAdder('gitlab'), + addGiteaToken: tokenAdder('gitea'), + addWordpressToken: tokenAdder('wordpress'), + addZendeskToken: tokenAdder('zendesk'), + patchBadgeCreations: patcher('badgeCreations'), + addSmmsToken: tokenAdder('smms'), + addCustomToken: tokenAdder('custom'), + }, +}; diff --git a/src/store/discussion.js b/src/store/discussion.js new file mode 100644 index 0000000..ebd33ab --- /dev/null +++ b/src/store/discussion.js @@ -0,0 +1,187 @@ +import utils from '../services/utils'; +import giteeHelper from '../services/providers/helpers/giteeHelper'; +import githubHelper from '../services/providers/helpers/githubHelper'; +import syncSvc from '../services/syncSvc'; + +const idShifter = offset => (state, getters) => { + const ids = Object.keys(getters.currentFileDiscussions) + .filter(id => id !== state.newDiscussionId); + const idx = ids.indexOf(state.currentDiscussionId) + offset + ids.length; + return ids[idx % ids.length]; +}; + +export default { + namespaced: true, + state: { + currentDiscussionId: null, + newDiscussion: null, + newDiscussionId: null, + isCommenting: false, + newCommentText: '', + newCommentSelection: { start: 0, end: 0 }, + newCommentFocus: false, + stickyComment: null, + }, + mutations: { + setCurrentDiscussionId: (state, value) => { + if (state.currentDiscussionId !== value) { + state.currentDiscussionId = value; + state.isCommenting = false; + } + }, + setNewDiscussion: (state, value) => { + state.newDiscussion = value; + state.newDiscussionId = utils.uid(); + state.currentDiscussionId = state.newDiscussionId; + state.isCommenting = true; + state.newCommentFocus = true; + }, + patchNewDiscussion: (state, value) => { + Object.assign(state.newDiscussion, value); + }, + setIsCommenting: (state, value) => { + state.isCommenting = value; + if (!value) { + state.newDiscussionId = null; + } else { + state.newCommentFocus = true; + } + }, + setNewCommentText: (state, value) => { + state.newCommentText = value || ''; + }, + setNewCommentSelection: (state, value) => { + state.newCommentSelection = value; + }, + setNewCommentFocus: (state, value) => { + state.newCommentFocus = value; + }, + setStickyComment: (state, value) => { + state.stickyComment = value; + }, + }, + getters: { + newDiscussion: ({ currentDiscussionId, newDiscussionId, newDiscussion }) => + currentDiscussionId === newDiscussionId && newDiscussion, + currentFileDiscussionLastComments: (state, getters, rootState, rootGetters) => { + const { discussions, comments } = rootGetters['content/current']; + const discussionLastComments = {}; + Object.entries(comments).forEach(([, comment]) => { + if (discussions[comment.discussionId]) { + const lastComment = discussionLastComments[comment.discussionId]; + if (!lastComment || lastComment.created < comment.created) { + discussionLastComments[comment.discussionId] = comment; + } + } + }); + return discussionLastComments; + }, + currentFileDiscussions: ( + { newDiscussionId }, + { newDiscussion, currentFileDiscussionLastComments }, + rootState, + rootGetters, + ) => { + const currentFileDiscussions = {}; + if (newDiscussion) { + currentFileDiscussions[newDiscussionId] = newDiscussion; + } + const { discussions } = rootGetters['content/current']; + Object.entries(currentFileDiscussionLastComments) + .sort(([, lastComment1], [, lastComment2]) => + lastComment1.created - lastComment2.created) + .forEach(([discussionId]) => { + currentFileDiscussions[discussionId] = discussions[discussionId]; + }); + return currentFileDiscussions; + }, + currentDiscussion: ({ currentDiscussionId }, { currentFileDiscussions }) => + currentFileDiscussions[currentDiscussionId], + previousDiscussionId: idShifter(-1), + nextDiscussionId: idShifter(1), + currentDiscussionComments: ( + { currentDiscussionId }, + { currentDiscussion }, + rootState, + rootGetters, + ) => { + const comments = {}; + if (currentDiscussion) { + const contentComments = rootGetters['content/current'].comments; + Object.entries(contentComments) + .filter(([, comment]) => + comment.discussionId === currentDiscussionId) + .sort(([, comment1], [, comment2]) => + comment1.created - comment2.created) + .forEach(([commentId, comment]) => { + comments[commentId] = comment; + }); + } + return comments; + }, + currentDiscussionLastCommentId: (state, { currentDiscussionComments }) => + Object.keys(currentDiscussionComments).pop(), + currentDiscussionLastComment: ( + state, + { currentDiscussionComments, currentDiscussionLastCommentId }, + ) => currentDiscussionComments[currentDiscussionLastCommentId], + }, + actions: { + cancelNewComment({ commit, getters }) { + commit('setIsCommenting', false); + if (!getters.currentDiscussion) { + commit('setCurrentDiscussionId', getters.nextDiscussionId); + } + }, + async createNewDiscussion({ commit, dispatch, rootGetters }, selection) { + const loginToken = rootGetters['workspace/loginToken']; + if (!loginToken) { + try { + const signInWhere = await dispatch('modal/open', 'signInForComment', { root: true }); + if (signInWhere === 'github') { + await githubHelper.signin(); + } else { + await giteeHelper.signin(); + } + await syncSvc.afterSignIn(); + syncSvc.requestSync(); + await dispatch('createNewDiscussion', selection); + } catch (e) { /* cancel */ } + } else if (selection) { + let text = rootGetters['content/current'].text.slice(selection.start, selection.end).trim(); + const maxLength = 80; + if (text.length > maxLength) { + text = `${text.slice(0, maxLength - 1).trim()}…`; + } + commit('setNewDiscussion', { ...selection, text }); + } + }, + cleanCurrentFile({ + getters, + rootGetters, + commit, + dispatch, + }, { filterComment, filterDiscussion } = {}) { + const { discussions } = rootGetters['content/current']; + const { comments } = rootGetters['content/current']; + const patch = { + discussions: {}, + comments: {}, + }; + Object.entries(comments).forEach(([commentId, comment]) => { + const discussion = discussions[comment.discussionId]; + if (discussion && comment !== filterComment && discussion !== filterDiscussion) { + patch.discussions[comment.discussionId] = discussion; + patch.comments[commentId] = comment; + } + }); + + const { nextDiscussionId } = getters; + dispatch('content/patchCurrent', patch, { root: true }); + if (!getters.currentDiscussion) { + // Keep the gutter open + commit('setCurrentDiscussionId', nextDiscussionId); + } + }, + }, +}; diff --git a/src/store/explorer.js b/src/store/explorer.js new file mode 100644 index 0000000..9846981 --- /dev/null +++ b/src/store/explorer.js @@ -0,0 +1,217 @@ +import Vue from 'vue'; +import emptyFile from '../data/empties/emptyFile'; +import emptyFolder from '../data/empties/emptyFolder'; + +const setter = propertyName => (state, value) => { + state[propertyName] = value; +}; + +function debounceAction(action, wait) { + let timeoutId; + return (context) => { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => action(context), wait); + }; +} + +const collator = new Intl.Collator(undefined, { sensitivity: 'base', numeric: true }); +const compare = (node1, node2) => collator.compare(node1.item.name, node2.item.name); + +class Node { + constructor(item, locations = [], isFolder = false) { + this.item = item; + this.locations = locations; + this.isFolder = isFolder; + if (isFolder) { + this.folders = []; + this.files = []; + } + } + + sortChildren() { + if (this.isFolder) { + this.folders.sort(compare); + this.files.sort(compare); + this.folders.forEach(child => child.sortChildren()); + } + } +} + +const nilFileNode = new Node(emptyFile()); +nilFileNode.isNil = true; +const fakeFileNode = new Node(emptyFile()); +fakeFileNode.item.id = 'fake'; +fakeFileNode.noDrag = true; + +function getParent({ item, isNil }, { nodeMap, rootNode }) { + if (isNil) { + return nilFileNode; + } + return nodeMap[item.parentId] || rootNode; +} + +function getFolder(node, getters) { + return node.item.type === 'folder' ? + node : + getParent(node, getters); +} + +export default { + namespaced: true, + state: { + selectedId: null, + editingId: null, + dragSourceId: null, + dragTargetId: null, + newChildNode: nilFileNode, + openNodes: {}, + }, + mutations: { + setSelectedId: setter('selectedId'), + setEditingId: setter('editingId'), + setDragSourceId: setter('dragSourceId'), + setDragTargetId: setter('dragTargetId'), + setNewItem(state, item) { + state.newChildNode = item ? new Node(item, [], item.type === 'folder') : nilFileNode; + }, + setNewItemName(state, name) { + state.newChildNode.item.name = name; + }, + toggleOpenNode(state, id) { + Vue.set(state.openNodes, id, !state.openNodes[id]); + }, + }, + getters: { + nodeStructure: (state, getters, rootState, rootGetters) => { + const rootNode = new Node(emptyFolder(), [], true); + rootNode.isRoot = true; + + // Create Trash node + const trashFolderNode = new Node(emptyFolder(), [], true); + trashFolderNode.item.id = 'trash'; + trashFolderNode.item.name = '回收站'; + trashFolderNode.noDrag = true; + trashFolderNode.isTrash = true; + trashFolderNode.parentNode = rootNode; + + // Create Temp node + const tempFolderNode = new Node(emptyFolder(), [], true); + tempFolderNode.item.id = 'temp'; + tempFolderNode.item.name = '临时目录'; + tempFolderNode.noDrag = true; + tempFolderNode.noDrop = true; + tempFolderNode.isTemp = true; + tempFolderNode.parentNode = rootNode; + + // Fill nodeMap with all file and folder nodes + const nodeMap = { + trash: trashFolderNode, + temp: tempFolderNode, + }; + rootGetters['folder/items'].forEach((item) => { + nodeMap[item.id] = new Node(item, [], true); + }); + const syncLocationsByFileId = rootGetters['syncLocation/filteredGroupedByFileId']; + const publishLocationsByFileId = rootGetters['publishLocation/filteredGroupedByFileId']; + rootGetters['file/items'].forEach((item) => { + const locations = [ + ...syncLocationsByFileId[item.id] || [], + ...publishLocationsByFileId[item.id] || [], + ]; + nodeMap[item.id] = new Node(item, locations); + }); + + // Build the tree + Object.entries(nodeMap).forEach(([, node]) => { + let parentNode = nodeMap[node.item.parentId]; + if (!parentNode || !parentNode.isFolder) { + if (node.isTrash || node.isTemp) { + return; + } + parentNode = rootNode; + } + if (node.isFolder) { + parentNode.folders.push(node); + } else { + parentNode.files.push(node); + } + node.parentNode = parentNode; + }); + rootNode.sortChildren(); + + // Add Trash and Temp nodes + rootNode.folders.unshift(tempFolderNode); + tempFolderNode.files.forEach((node) => { + node.noDrop = true; + }); + rootNode.folders.unshift(trashFolderNode); + + // Add a fake file at the end of the root folder to allow drag and drop into it + rootNode.files.push(fakeFileNode); + return { + nodeMap, + rootNode, + }; + }, + nodeMap: (state, { nodeStructure }) => nodeStructure.nodeMap, + rootNode: (state, { nodeStructure }) => nodeStructure.rootNode, + newChildNodeParent: (state, getters) => getParent(state.newChildNode, getters), + selectedNode: ({ selectedId }, { nodeMap }) => nodeMap[selectedId] || nilFileNode, + selectedNodeFolder: (state, getters) => getFolder(getters.selectedNode, getters), + editingNode: ({ editingId }, { nodeMap }) => nodeMap[editingId] || nilFileNode, + dragSourceNode: ({ dragSourceId }, { nodeMap }) => nodeMap[dragSourceId] || nilFileNode, + dragTargetNode: ({ dragTargetId }, { nodeMap }) => { + if (dragTargetId === 'fake') { + return fakeFileNode; + } + return nodeMap[dragTargetId] || nilFileNode; + }, + dragTargetNodeFolder: ({ dragTargetId }, getters) => { + if (dragTargetId === 'fake') { + return getters.rootNode; + } + return getFolder(getters.dragTargetNode, getters); + }, + }, + actions: { + openNode({ + state, + getters, + commit, + dispatch, + }, id) { + const node = getters.nodeMap[id]; + if (node) { + if (node.isFolder && !state.openNodes[id]) { + commit('toggleOpenNode', id); + } + dispatch('openNode', node.item.parentId); + } + }, + openDragTarget: debounceAction(({ state, dispatch }) => { + dispatch('openNode', state.dragTargetId); + }, 1000), + setDragTarget({ commit, getters, dispatch }, node) { + if (!node) { + commit('setDragTargetId'); + } else { + // Make sure target node is not a child of source node + const folderNode = getFolder(node, getters); + const sourceId = getters.dragSourceNode.item.id; + const { nodeMap } = getters; + for (let parentNode = folderNode; + parentNode; + parentNode = nodeMap[parentNode.item.parentId] + ) { + if (parentNode.item.id === sourceId) { + commit('setDragTargetId'); + return; + } + } + + commit('setDragTargetId', node.item.id); + dispatch('openDragTarget'); + } + }, + }, +}; diff --git a/src/store/file.js b/src/store/file.js new file mode 100644 index 0000000..3c06a20 --- /dev/null +++ b/src/store/file.js @@ -0,0 +1,36 @@ +import moduleTemplate from './moduleTemplate'; +import empty from '../data/empties/emptyFile'; + +const module = moduleTemplate(empty); + +module.state = { + ...module.state, + currentId: null, +}; + +module.getters = { + ...module.getters, + current: ({ itemsById, currentId }) => itemsById[currentId] || empty(), + isCurrentTemp: (state, { current }) => current.parentId === 'temp', + lastOpened: ({ itemsById }, { items }, rootState, rootGetters) => + itemsById[rootGetters['data/lastOpenedIds'][0]] || items[0] || empty(), +}; + +module.mutations = { + ...module.mutations, + setCurrentId(state, value) { + state.currentId = value; + }, +}; + +module.actions = { + ...module.actions, + patchCurrent({ getters, commit }, value) { + commit('patchItem', { + ...value, + id: getters.current.id, + }); + }, +}; + +export default module; diff --git a/src/store/findReplace.js b/src/store/findReplace.js new file mode 100644 index 0000000..1c37049 --- /dev/null +++ b/src/store/findReplace.js @@ -0,0 +1,32 @@ +export default { + namespaced: true, + state: { + type: null, + lastOpen: 0, + findText: '', + replaceText: '', + }, + mutations: { + setType: (state, value) => { + state.type = value; + }, + setLastOpen: (state) => { + state.lastOpen = Date.now(); + }, + setFindText: (state, value) => { + state.findText = value; + }, + setReplaceText: (state, value) => { + state.replaceText = value; + }, + }, + actions: { + open({ commit }, { type, findText }) { + commit('setType', type); + if (findText) { + commit('setFindText', findText); + } + commit('setLastOpen'); + }, + }, +}; diff --git a/src/store/folder.js b/src/store/folder.js new file mode 100644 index 0000000..715dc46 --- /dev/null +++ b/src/store/folder.js @@ -0,0 +1,6 @@ +import moduleTemplate from './moduleTemplate'; +import empty from '../data/empties/emptyFolder'; + +const module = moduleTemplate(empty); + +export default module; diff --git a/src/store/img.js b/src/store/img.js new file mode 100644 index 0000000..fe40455 --- /dev/null +++ b/src/store/img.js @@ -0,0 +1,89 @@ +import utils from '../services/utils'; + +const checkStorageLocalKey = 'img/checkedStorage'; +const workspacePathLocalKey = 'img/workspaceImgPath'; + +export default { + namespaced: true, + state: { + // 当前图片上传中的临时ID + currImgId: null, + // 选择的存储图床信息 + checkedStorage: { + type: 'workspace', // 目前存储类型分三种 token 与 tokenRepo 、workspace + provider: null, // 对应是何种账号 + sub: '/imgs/{YYYY}-{MM}-{DD}', // 对应 token 中的sub + sid: null, + }, + // 当前仓库图片存储位置 key 为path value 为true + workspaceImagePath: { + '/imgs/{YYYY}-{MM}-{DD}': true, + }, + }, + mutations: { + setCurrImgId: (state, value) => { + state.currImgId = value; + }, + clearCurrImg: (state) => { + state.currImg = null; + }, + changeCheckedStorage: (state, value) => { + if (value) { + state.checkedStorage = { + type: value.type, // 目前存储类型分两种 token 与 tokenRepo + provider: value.provider, // 对应是何种账号 + sub: value.sub, // 对应 token 中的sub + sid: value.sid, + }; + } else { + state.checkedStorage = { + type: null, // 目前存储类型分两种 token 与 tokenRepo + provider: null, // 对应是何种账号 + sub: null, // 对应 token 中的sub + sid: null, + }; + } + }, + setWorkspaceImgPath: (state, value) => { + state.workspaceImagePath = value; + localStorage.setItem(workspacePathLocalKey, JSON.stringify(state.workspaceImagePath)); + }, + addWorkspaceImgPath: (state, value) => { + state.workspaceImagePath[value] = true; + state.workspaceImagePath = utils.deepCopy(state.workspaceImagePath); + localStorage.setItem(workspacePathLocalKey, JSON.stringify(state.workspaceImagePath)); + }, + removeWorkspaceImgPath: (state, value) => { + delete state.workspaceImagePath[value]; + state.workspaceImagePath = utils.deepCopy(state.workspaceImagePath); + localStorage.setItem(workspacePathLocalKey, JSON.stringify(state.workspaceImagePath)); + }, + }, + getters: { + currImgId: state => state.currImgId, + getCheckedStorage: state => state.checkedStorage, + getCheckedStorageSub: state => state.checkedStorage.sub, + getWorkspaceImgPath: state => state.workspaceImagePath, + }, + actions: { + setCurrImgId({ commit }, imgId) { + commit('setCurrImgId', imgId); + }, + clearImg({ commit }) { + commit('clearCurrImg'); + }, + changeCheckedStorage({ commit }, checkedStorage) { + commit('changeCheckedStorage', checkedStorage); + localStorage.setItem(checkStorageLocalKey, JSON.stringify(checkedStorage)); + }, + setWorkspaceImgPath({ commit }, workspaceImgPath) { + commit('setWorkspaceImgPath', workspaceImgPath); + }, + addWorkspaceImgPath({ commit }, workspaceImgPathValue) { + commit('addWorkspaceImgPath', workspaceImgPathValue); + }, + removeWorkspaceImgPath({ commit }, workspaceImgPathValue) { + commit('removeWorkspaceImgPath', workspaceImgPathValue); + }, + }, +}; diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..f81e6ac --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,195 @@ +import createLogger from 'vuex/dist/logger'; +import Vue from 'vue'; +import Vuex from 'vuex'; +import utils from '../services/utils'; +import content from './content'; +import contentState from './contentState'; +import contextMenu from './contextMenu'; +import data from './data'; +import discussion from './discussion'; +import explorer from './explorer'; +import file from './file'; +import findReplace from './findReplace'; +import folder from './folder'; +import layout from './layout'; +import modal from './modal'; +import notification from './notification'; +import queue from './queue'; +import syncedContent from './syncedContent'; +import userInfo from './userInfo'; +import workspace from './workspace'; +import img from './img'; +import theme from './theme'; +import locationTemplate from './locationTemplate'; +import emptyPublishLocation from '../data/empties/emptyPublishLocation'; +import emptySyncLocation from '../data/empties/emptySyncLocation'; +import constants from '../data/constants'; + +Vue.use(Vuex); + +const debug = NODE_ENV !== 'production'; + +const store = new Vuex.Store({ + modules: { + content, + contentState, + contextMenu, + data, + discussion, + explorer, + file, + findReplace, + folder, + layout, + modal, + notification, + publishLocation: locationTemplate(emptyPublishLocation), + queue, + syncedContent, + syncLocation: locationTemplate(emptySyncLocation), + userInfo, + workspace, + img, + theme, + }, + state: { + light: false, + offline: false, + lastOfflineCheck: 0, + timeCounter: 0, + }, + mutations: { + setLight: (state, value) => { + state.light = value; + }, + setOffline: (state, value) => { + state.offline = value; + }, + updateLastOfflineCheck: (state) => { + state.lastOfflineCheck = Date.now(); + }, + updateTimeCounter: (state) => { + state.timeCounter += 1; + }, + }, + getters: { + allItemsById: (state) => { + const result = {}; + constants.types.forEach(type => Object.assign(result, state[type].itemsById)); + return result; + }, + pathsByItemId: (state, getters) => { + const result = {}; + const processNode = (node, parentPath = '') => { + let path = parentPath; + if (node.item.id) { + path += node.item.name; + if (node.isTrash) { + path = '.stackedit-trash/'; + } else if (node.isFolder) { + path += '/'; + } + result[node.item.id] = path; + } + + if (node.isFolder) { + node.folders.forEach(child => processNode(child, path)); + node.files.forEach(child => processNode(child, path)); + } + }; + + processNode(getters['explorer/rootNode']); + return result; + }, + itemsByPath: (state, { allItemsById, pathsByItemId }) => { + const result = {}; + Object.entries(pathsByItemId).forEach(([id, path]) => { + const items = result[path] || []; + items.push(allItemsById[id]); + result[path] = items; + }); + return result; + }, + gitPathsByItemId: (state, { allItemsById, pathsByItemId }) => { + const result = {}; + Object.entries(allItemsById).forEach(([id, item]) => { + if (item.type === 'data') { + result[id] = `.stackedit-data/${id}.json`; + } else if (item.type === 'file') { + const filePath = pathsByItemId[id]; + result[id] = `${filePath}.md`; + result[`${id}/content`] = `/${filePath}.md`; + } else if (item.type === 'content') { + const [fileId] = id.split('/'); + const filePath = pathsByItemId[fileId]; + result[fileId] = `${filePath}.md`; + result[id] = `/${filePath}.md`; + } else if (item.type === 'folder') { + result[id] = pathsByItemId[id]; + } else if (item.type === 'syncLocation' || item.type === 'publishLocation') { + // locations are stored as paths + const encodedItem = utils.encodeBase64(utils.serializeObject({ + ...item, + id: undefined, + type: undefined, + fileId: undefined, + hash: undefined, + }), true); + const extension = item.type === 'syncLocation' ? 'sync' : 'publish'; + const path = pathsByItemId[item.fileId]; + if (path) { + result[id] = `${path}.${encodedItem}.${extension}`; + } + } + }); + return result; + }, + itemIdsByGitPath: (state, { gitPathsByItemId }) => { + const result = {}; + Object.entries(gitPathsByItemId).forEach(([id, path]) => { + result[path] = id; + }); + return result; + }, + itemsByGitPath: (state, { allItemsById, gitPathsByItemId }) => { + const result = {}; + Object.entries(gitPathsByItemId).forEach(([id, path]) => { + const item = allItemsById[id]; + if (item) { + result[path] = item; + } + }); + return result; + }, + isSponsor: ({ light }, getters) => { + if (light) { + return true; + } + if (!getters['data/serverConf'].allowSponsorship) { + return true; + } + const sponsorToken = getters['workspace/sponsorToken']; + return sponsorToken ? sponsorToken.isSponsor : false; + }, + }, + actions: { + setOffline: ({ state, commit, dispatch }, value) => { + if (state.offline !== value) { + commit('setOffline', value); + if (state.offline) { + return Promise.reject(new Error('You are offline.')); + } + dispatch('notification/info', 'You are back online!'); + } + return Promise.resolve(); + }, + }, + strict: debug, + plugins: debug ? [createLogger()] : [], +}); + +setInterval(() => { + store.commit('updateTimeCounter'); +}, 30 * 1000); + +export default store; diff --git a/src/store/layout.js b/src/store/layout.js new file mode 100644 index 0000000..5910434 --- /dev/null +++ b/src/store/layout.js @@ -0,0 +1,187 @@ +import pagedownButtons from '../data/pagedownButtons'; + +let buttonCount = 2; // 2 for undo/redo +let spacerCount = 0; +pagedownButtons.forEach((button) => { + if (button.method) { + buttonCount += 1; + } else { + spacerCount += 1; + } +}); + +const minPadding = 25; +const editorTopPadding = 10; +const navigationBarEditButtonsWidth = (34 * buttonCount) + (8 * spacerCount); // buttons + spacers +const navigationBarLeftButtonWidth = 38 + 4 + 12; +const navigationBarRightButtonWidth = 38 + 8; +const navigationBarSpinnerWidth = 24 + 8 + 5; // 5 for left margin +const navigationBarLocationWidth = 20; +const navigationBarSyncPublishButtonsWidth = 34 + 10; +const navigationBarTitleMargin = 8; +const maxTitleMaxWidth = 800; +const minTitleMaxWidth = 200; + +const constants = { + editorMinWidth: 320, + explorerWidth: 260, + gutterWidth: 250, + sideBarWidth: 280, + navigationBarHeight: 44, + buttonBarWidth: 26, + statusBarHeight: 20, +}; + +function computeStyles(state, getters, layoutSettings = getters['data/layoutSettings'], styles = { + showNavigationBar: layoutSettings.showNavigationBar + || !layoutSettings.showEditor + || state.content.revisionContent + || state.light, + showStatusBar: layoutSettings.showStatusBar, + showEditor: layoutSettings.showEditor, + showSidePreview: layoutSettings.showSidePreview && layoutSettings.showEditor, + showPreview: layoutSettings.showSidePreview || !layoutSettings.showEditor, + showSideBar: layoutSettings.showSideBar && !state.light, + showExplorer: layoutSettings.showExplorer && !state.light, + layoutOverflow: false, + hideLocations: state.light, +}) { + styles.innerHeight = state.layout.bodyHeight; + if (styles.showNavigationBar) { + styles.innerHeight -= constants.navigationBarHeight; + } + if (styles.showStatusBar) { + styles.innerHeight -= constants.statusBarHeight; + } + + styles.innerWidth = state.layout.bodyWidth; + if (styles.innerWidth < constants.editorMinWidth + + constants.gutterWidth + constants.buttonBarWidth + ) { + styles.layoutOverflow = true; + } + if (styles.showSideBar) { + styles.innerWidth -= constants.sideBarWidth; + } + if (styles.showExplorer) { + styles.innerWidth -= constants.explorerWidth; + } + + let doublePanelWidth = styles.innerWidth - constants.buttonBarWidth; + // No commenting for temp files + const showGutter = !getters['file/isCurrentTemp'] && !!getters['discussion/currentDiscussion']; + if (showGutter) { + doublePanelWidth -= constants.gutterWidth; + } + if (doublePanelWidth < constants.editorMinWidth) { + doublePanelWidth = constants.editorMinWidth; + } + + if (styles.showSidePreview && doublePanelWidth / 2 < constants.editorMinWidth) { + styles.showSidePreview = false; + styles.showPreview = false; + styles.layoutOverflow = false; + return computeStyles(state, getters, layoutSettings, styles); + } + + const computedSettings = getters['data/computedSettings']; + styles.fontSize = 18; + styles.textWidth = 990; + if (doublePanelWidth < 1120) { + styles.fontSize -= 1; + styles.textWidth = 910; + } + if (doublePanelWidth < 1040) { + styles.textWidth = 830; + } + styles.textWidth *= computedSettings.maxWidthFactor; + if (doublePanelWidth < styles.textWidth) { + styles.textWidth = doublePanelWidth; + } + if (styles.textWidth < 640) { + styles.fontSize -= 1; + } + styles.fontSize *= computedSettings.fontSizeFactor; + + const bottomPadding = Math.floor(styles.innerHeight / 2); + const panelWidth = Math.floor(doublePanelWidth / 2); + styles.previewWidth = styles.showSidePreview ? + panelWidth : + doublePanelWidth; + const previewRightPadding = Math + .max(Math.floor((styles.previewWidth - styles.textWidth) / 2), minPadding); + if (!styles.showSidePreview) { + styles.previewWidth += constants.buttonBarWidth; + } + styles.previewGutterWidth = showGutter && !layoutSettings.showEditor + ? constants.gutterWidth + : 0; + const previewLeftPadding = previewRightPadding + styles.previewGutterWidth; + styles.previewGutterLeft = previewLeftPadding - minPadding; + styles.previewPadding = `${editorTopPadding}px ${previewRightPadding}px ${bottomPadding}px ${previewLeftPadding}px`; + styles.editorWidth = styles.showSidePreview ? + panelWidth : + doublePanelWidth; + const editorRightPadding = Math + .max(Math.floor((styles.editorWidth - styles.textWidth) / 2), minPadding); + styles.editorGutterWidth = showGutter && layoutSettings.showEditor + ? constants.gutterWidth + : 0; + const editorLeftPadding = editorRightPadding + styles.editorGutterWidth; + styles.editorGutterLeft = editorLeftPadding - minPadding; + styles.editorPadding = `${editorTopPadding}px ${editorRightPadding}px ${bottomPadding}px ${editorLeftPadding}px`; + + styles.titleMaxWidth = styles.innerWidth - + navigationBarLeftButtonWidth - + navigationBarRightButtonWidth - + navigationBarSpinnerWidth; + if (styles.showEditor) { + const syncLocations = getters['syncLocation/current']; + const publishLocations = getters['publishLocation/current']; + styles.titleMaxWidth -= navigationBarEditButtonsWidth + + (navigationBarLocationWidth * (syncLocations.length + publishLocations.length)) + + (navigationBarSyncPublishButtonsWidth * 2) + + navigationBarTitleMargin; + if (styles.titleMaxWidth + navigationBarEditButtonsWidth < minTitleMaxWidth) { + styles.hideLocations = true; + } + } + styles.titleMaxWidth = Math + .max(minTitleMaxWidth, Math + .min(maxTitleMaxWidth, styles.titleMaxWidth)); + return styles; +} + +export default { + namespaced: true, + state: { + canUndo: false, + canRedo: false, + bodyWidth: 0, + bodyHeight: 0, + }, + mutations: { + setCanUndo: (state, value) => { + state.canUndo = value; + }, + setCanRedo: (state, value) => { + state.canRedo = value; + }, + updateBodySize: (state) => { + state.bodyWidth = document.body.clientWidth; + state.bodyHeight = document.body.clientHeight; + }, + }, + getters: { + constants: () => constants, + styles: (state, getters, rootState, rootGetters) => computeStyles(rootState, rootGetters), + }, + actions: { + updateBodySize({ commit, dispatch, rootGetters }) { + commit('updateBodySize'); + // Make sure both explorer and side bar are not open if body width is small + const layoutSettings = rootGetters['data/layoutSettings']; + dispatch('data/toggleExplorer', layoutSettings.showExplorer, { root: true }); + }, + }, +}; diff --git a/src/store/locationTemplate.js b/src/store/locationTemplate.js new file mode 100644 index 0000000..9911383 --- /dev/null +++ b/src/store/locationTemplate.js @@ -0,0 +1,86 @@ +import moduleTemplate from './moduleTemplate'; +import providerRegistry from '../services/providers/common/providerRegistry'; +import utils from '../services/utils'; + +const addToGroup = (groups, item) => { + const list = groups[item.fileId]; + if (!list) { + groups[item.fileId] = [item]; + } else { + list.push(item); + } +}; + +export default (empty) => { + const module = moduleTemplate(empty); + + module.getters = { + ...module.getters, + groupedByFileId: (state, { items }) => { + const groups = {}; + items.forEach(item => addToGroup(groups, item)); + return groups; + }, + groupedByFileIdAndHash: (state, { items }) => { + const fileIdGroups = {}; + items.forEach((item) => { + let hashGroups = fileIdGroups[item.fileId]; + if (!hashGroups) { + hashGroups = {}; + fileIdGroups[item.fileId] = hashGroups; + } + const list = hashGroups[item.hash]; + if (!list) { + hashGroups[item.hash] = [item]; + } else { + list.push(item); + } + }); + return fileIdGroups; + }, + filteredGroupedByFileId: (state, { items }) => { + const groups = {}; + items + .filter((item) => { + // Filter items that we can't use + const provider = providerRegistry.providersById[item.providerId]; + return provider && provider.getToken(item); + }) + .forEach(item => addToGroup(groups, item)); + return groups; + }, + current: (state, { filteredGroupedByFileId }, rootState, rootGetters) => { + const locations = filteredGroupedByFileId[rootGetters['file/current'].id] || []; + return locations.map((location) => { + const provider = providerRegistry.providersById[location.providerId]; + return { + ...location, + description: utils.sanitizeName(provider.getLocationDescription(location)), + url: provider.getLocationUrl(location), + }; + }); + }, + currentWithWorkspaceSyncLocation: (state, { current }, rootState, rootGetters) => { + const fileId = rootGetters['file/current'].id; + const fileSyncData = rootGetters['data/syncDataByItemId'][fileId]; + const contentSyncData = rootGetters['data/syncDataByItemId'][`${fileId}/content`]; + if (!fileSyncData || !contentSyncData) { + return current; + } + + // Add the workspace sync location + const workspaceProvider = providerRegistry.providersById[ + rootGetters['workspace/currentWorkspace'].providerId]; + return [{ + id: 'main', + providerId: workspaceProvider.id, + fileId, + description: utils.sanitizeName(workspaceProvider + .getSyncDataDescription(fileSyncData, contentSyncData)), + url: workspaceProvider.getSyncDataUrl(fileSyncData, contentSyncData), + }, ...current]; + }, + }; + + return module; +}; diff --git a/src/store/modal.js b/src/store/modal.js new file mode 100644 index 0000000..632717d --- /dev/null +++ b/src/store/modal.js @@ -0,0 +1,40 @@ +export default { + namespaced: true, + state: { + stack: [], + hidden: false, + }, + mutations: { + setStack: (state, value) => { + state.stack = value; + }, + setHidden: (state, value) => { + state.hidden = value; + }, + }, + getters: { + config: ({ hidden, stack }) => !hidden && stack[0], + }, + actions: { + async open({ commit, state }, param) { + const config = typeof param === 'object' ? { ...param } : { type: param }; + try { + return await new Promise((resolve, reject) => { + config.resolve = resolve; + config.reject = reject; + commit('setStack', [config, ...state.stack]); + }); + } finally { + commit('setStack', state.stack.filter((otherConfig => otherConfig !== config))); + } + }, + async hideUntil({ commit }, promise) { + try { + commit('setHidden', true); + return await promise; + } finally { + commit('setHidden', false); + } + }, + }, +}; diff --git a/src/store/moduleTemplate.js b/src/store/moduleTemplate.js new file mode 100644 index 0000000..90fcfa6 --- /dev/null +++ b/src/store/moduleTemplate.js @@ -0,0 +1,40 @@ +import Vue from 'vue'; +import utils from '../services/utils'; + +export default (empty, simpleHash = false) => { + // Use Date.now() as a simple hash function, which is ok for not-synced types + const hashFunc = simpleHash ? Date.now : item => utils.getItemHash(item); + + return { + namespaced: true, + state: { + itemsById: {}, + }, + getters: { + items: ({ itemsById }) => Object.values(itemsById), + }, + mutations: { + setItem(state, value) { + const item = Object.assign(empty(value.id), value); + if (!item.hash || !simpleHash) { + item.hash = hashFunc(item); + } + Vue.set(state.itemsById, item.id, item); + }, + patchItem(state, patch) { + const item = state.itemsById[patch.id]; + if (item) { + Object.assign(item, patch); + item.hash = hashFunc(item); + Vue.set(state.itemsById, item.id, item); + return true; + } + return false; + }, + deleteItem(state, id) { + Vue.delete(state.itemsById, id); + }, + }, + actions: {}, + }; +}; diff --git a/src/store/notification.js b/src/store/notification.js new file mode 100644 index 0000000..9f33783 --- /dev/null +++ b/src/store/notification.js @@ -0,0 +1,90 @@ +import providerRegistry from '../services/providers/common/providerRegistry'; +import utils from '../services/utils'; + +const defaultTimeout = 5000; // 5 sec + +export default { + namespaced: true, + state: { + items: [], + }, + mutations: { + setItems: (state, value) => { + state.items = value; + }, + }, + actions: { + showItem({ state, commit }, item) { + const existingItem = utils.someResult( + state.items, + other => other.type === item.type && other.content === item.content && item, + ); + if (existingItem) { + return existingItem.promise; + } + + item.promise = new Promise((resolve, reject) => { + commit('setItems', [...state.items, item]); + const removeItem = () => commit( + 'setItems', + state.items.filter(otherItem => otherItem !== item), + ); + setTimeout( + () => removeItem(), + item.timeout || defaultTimeout, + ); + item.resolve = (res) => { + removeItem(); + resolve(res); + }; + item.reject = (err) => { + removeItem(); + reject(err); + }; + }); + + return item.promise; + }, + info({ dispatch }, content) { + return dispatch('showItem', { + type: 'info', + content, + }); + }, + badge({ dispatch }, content) { + return dispatch('showItem', { + type: 'badge', + content, + }); + }, + confirm({ dispatch }, content) { + return dispatch('showItem', { + type: 'confirm', + content, + timeout: 10000, // 10 sec + }); + }, + error({ dispatch, rootState }, error) { + const item = { type: 'error' }; + if (error) { + if (error.message) { + item.content = error.message; + } else if (error.status) { + const location = rootState.queue.currentLocation; + if (location.providerId) { + const provider = providerRegistry.providersById[location.providerId]; + item.content = `HTTP error ${error.status} on ${provider.name} location.`; + } else { + item.content = `HTTP error ${error.status}.`; + } + } else { + item.content = `${error}`; + } + } + if (!item.content || item.content === '[object Object]') { + item.content = 'Unknown error.'; + } + return dispatch('showItem', item); + }, + }, +}; diff --git a/src/store/queue.js b/src/store/queue.js new file mode 100644 index 0000000..084a86a --- /dev/null +++ b/src/store/queue.js @@ -0,0 +1,83 @@ +const setter = propertyName => (state, value) => { + state[propertyName] = value; +}; + +let queue = Promise.resolve(); + +export default { + namespaced: true, + state: { + isEmpty: true, + isSyncRequested: false, + isPublishRequested: false, + currentLocation: {}, + }, + mutations: { + setIsEmpty: setter('isEmpty'), + setIsSyncRequested: setter('isSyncRequested'), + setIsPublishRequested: setter('isPublishRequested'), + setCurrentLocation: setter('currentLocation'), + }, + actions: { + enqueue({ state, commit, dispatch }, cb) { + if (state.offline) { + // No need to enqueue + return; + } + const checkOffline = () => { + if (state.offline) { + // Empty queue + queue = Promise.resolve(); + commit('setIsEmpty', true); + throw new Error('offline'); + } + }; + if (state.isEmpty) { + commit('setIsEmpty', false); + } + const newQueue = queue + .then(() => checkOffline()) + .then(() => Promise.resolve() + .then(() => cb()) + .catch((err) => { + console.error(err); // eslint-disable-line no-console + checkOffline(); + dispatch('notification/error', err, { root: true }); + }) + .then(() => { + if (newQueue === queue) { + commit('setIsEmpty', true); + } + })); + queue = newQueue; + }, + enqueueSyncRequest({ state, commit, dispatch }, cb) { + if (!state.isSyncRequested) { + commit('setIsSyncRequested', true); + const unset = () => commit('setIsSyncRequested', false); + dispatch('enqueue', () => cb().then(unset, (err) => { + unset(); + throw err; + })); + } + }, + enqueuePublishRequest({ state, commit, dispatch }, cb) { + if (!state.isSyncRequested) { + commit('setIsPublishRequested', true); + const unset = () => commit('setIsPublishRequested', false); + dispatch('enqueue', () => cb().then(unset, (err) => { + unset(); + throw err; + })); + } + }, + async doWithLocation({ commit }, { location, action }) { + try { + commit('setCurrentLocation', location); + return await action(); + } finally { + commit('setCurrentLocation', {}); + } + }, + }, +}; diff --git a/src/store/syncedContent.js b/src/store/syncedContent.js new file mode 100644 index 0000000..471c89f --- /dev/null +++ b/src/store/syncedContent.js @@ -0,0 +1,12 @@ +import moduleTemplate from './moduleTemplate'; +import empty from '../data/empties/emptySyncedContent'; + +const module = moduleTemplate(empty, true); + +module.getters = { + ...module.getters, + current: ({ itemsById }, getters, rootState, rootGetters) => + itemsById[`${rootGetters['file/current'].id}/syncedContent`] || empty(), +}; + +export default module; diff --git a/src/store/theme.js b/src/store/theme.js new file mode 100644 index 0000000..6509aaa --- /dev/null +++ b/src/store/theme.js @@ -0,0 +1,138 @@ +const localKey = 'theme/currEditTheme'; +const customEditThemeKey = 'theme/customEditThemeStyle'; +const previewLocalKey = 'theme/currPreviewTheme'; +const customPreviewThemeKey = 'theme/customPreviewThemeStyle'; + +export default { + namespaced: true, + state: { + // 当前编辑主题 + currEditTheme: '', + customEditThemeStyle: null, + // 当前预览主题 + currPreviewTheme: '', + customPreviewThemeStyle: null, + }, + mutations: { + setEditTheme: (state, value) => { + state.currEditTheme = value; + }, + setCustomEditThemeStyle: (state, value) => { + state.customEditThemeStyle = value; + }, + setPreviewTheme: (state, value) => { + state.currPreviewTheme = value; + }, + setCustomPreviewThemeStyle: (state, value) => { + state.customPreviewThemeStyle = value; + }, + }, + getters: { + currEditTheme: state => state.currEditTheme, + customEditThemeStyle: state => state.customEditThemeStyle, + currPreviewTheme: state => state.currPreviewTheme, + customPreviewThemeStyle: state => state.customPreviewThemeStyle, + }, + actions: { + async setEditTheme({ commit }, theme) { + // 如果不是default 则加载样式 + if (!theme || theme === 'default') { + commit('setEditTheme', theme); + localStorage.setItem(localKey, theme); + return; + } + const themeStyle = document.getElementById(`edit-theme-${theme}`); + if (themeStyle) { + commit('setEditTheme', theme); + localStorage.setItem(localKey, theme); + return; + } + // 如果是自定义则直接追加 + if (theme === 'custom') { + const styleEle = document.createElement('style'); + styleEle.id = `edit-theme-${theme}`; + styleEle.type = 'text/css'; + styleEle.innerHTML = localStorage.getItem(customEditThemeKey) || ''; + commit('setCustomEditThemeStyle', styleEle.innerHTML); + document.head.appendChild(styleEle); + commit('setEditTheme', theme); + localStorage.setItem(localKey, theme); + return; + } + const script = document.createElement('script'); + let timeout; + try { + await new Promise((resolve, reject) => { + script.onload = resolve; + script.onerror = reject; + script.src = `/themes/edit-theme-${theme}.js`; + try { + document.head.appendChild(script); + timeout = setTimeout(reject, 30); + commit('setEditTheme', theme); + localStorage.setItem(localKey, theme); + } catch (e) { + reject(e); + } + }); + } finally { + clearTimeout(timeout); + document.head.removeChild(script); + } + }, + setCustomEditThemeStyle({ commit }, value) { + commit('setCustomEditThemeStyle', value); + localStorage.setItem(customEditThemeKey, value); + }, + async setPreviewTheme({ commit }, theme) { + // 如果不是default 则加载样式 + if (!theme || theme === 'default') { + commit('setPreviewTheme', theme); + localStorage.setItem(previewLocalKey, theme); + return; + } + const themeStyle = document.getElementById(`preview-theme-${theme}`); + if (themeStyle) { + commit('setPreviewTheme', theme); + localStorage.setItem(previewLocalKey, theme); + return; + } + // 如果是自定义则直接追加 + if (theme === 'custom') { + const styleEle = document.createElement('style'); + styleEle.id = `preview-theme-${theme}`; + styleEle.type = 'text/css'; + styleEle.innerHTML = localStorage.getItem(customPreviewThemeKey) || ''; + commit('setCustomPreviewThemeStyle', styleEle.innerHTML); + document.head.appendChild(styleEle); + commit('setPreviewTheme', theme); + localStorage.setItem(previewLocalKey, theme); + return; + } + const script = document.createElement('script'); + let timeout; + try { + await new Promise((resolve, reject) => { + script.onload = resolve; + script.onerror = reject; + script.src = `/themes/preview-theme-${theme}.js`; + try { + document.head.appendChild(script); + timeout = setTimeout(reject, 30); + commit('setPreviewTheme', theme); + localStorage.setItem(previewLocalKey, theme); + } catch (e) { + reject(e); + } + }); + } finally { + clearTimeout(timeout); + document.head.removeChild(script); + } + }, + setCustomPreviewThemeStyle({ commit }, value) { + commit('setCustomPreviewThemeStyle', value); + localStorage.setItem(customPreviewThemeKey, value); + }, + }, +}; diff --git a/src/store/userInfo.js b/src/store/userInfo.js new file mode 100644 index 0000000..dabfa9a --- /dev/null +++ b/src/store/userInfo.js @@ -0,0 +1,25 @@ +import Vue from 'vue'; + +export default { + namespaced: true, + state: { + itemsById: {}, + }, + mutations: { + setItem: ({ itemsById }, item) => { + const itemToSet = { + ...item, + }; + const existingItem = itemsById[item.id]; + if (existingItem) { + if (!itemToSet.name) { + itemToSet.name = existingItem.name; + } + if (!itemToSet.imageUrl) { + itemToSet.imageUrl = existingItem.imageUrl; + } + } + Vue.set(itemsById, item.id, itemToSet); + }, + }, +}; diff --git a/src/store/workspace.js b/src/store/workspace.js new file mode 100644 index 0000000..c71e6cb --- /dev/null +++ b/src/store/workspace.js @@ -0,0 +1,150 @@ +import utils from '../services/utils'; +import providerRegistry from '../services/providers/common/providerRegistry'; + +export default { + namespaced: true, + state: { + currentWorkspaceId: null, + lastFocus: 0, + }, + mutations: { + setCurrentWorkspaceId: (state, value) => { + state.currentWorkspaceId = value; + }, + setLastFocus: (state, value) => { + state.lastFocus = value; + }, + }, + getters: { + workspacesById: (state, getters, rootState, rootGetters) => { + const workspacesById = {}; + const mainWorkspaceToken = rootGetters['workspace/mainWorkspaceToken']; + Object.entries(rootGetters['data/workspaces']).forEach(([id, workspace]) => { + const sanitizedWorkspace = { + id, + providerId: (mainWorkspaceToken && mainWorkspaceToken.providerId) || 'giteeAppData', + sub: mainWorkspaceToken && mainWorkspaceToken.sub, + ...workspace, + }; + // Filter workspaces that don't have a provider + const workspaceProvider = providerRegistry.providersById[sanitizedWorkspace.providerId]; + if (workspaceProvider) { + // Build the url with the current hostname + const params = workspaceProvider.getWorkspaceParams(sanitizedWorkspace); + sanitizedWorkspace.url = utils.addQueryParams('app', params, true); + sanitizedWorkspace.locationUrl = workspaceProvider + .getWorkspaceLocationUrl(sanitizedWorkspace); + workspacesById[id] = sanitizedWorkspace; + } + }); + return workspacesById; + }, + mainWorkspace: (state, { workspacesById }) => workspacesById.main, + currentWorkspace: ({ currentWorkspaceId }, { workspacesById, mainWorkspace }) => + workspacesById[currentWorkspaceId] || mainWorkspace, + currentWorkspaceIsGit: (state, { currentWorkspace }) => + currentWorkspace.providerId === 'githubWorkspace' + || currentWorkspace.providerId === 'giteeWorkspace' + || currentWorkspace.providerId === 'gitlabWorkspace' + || currentWorkspace.providerId === 'giteaWorkspace' + || currentWorkspace.providerId === 'giteeAppData' + || currentWorkspace.providerId === 'githubAppData', + currentWorkspaceHasUniquePaths: (state, { currentWorkspace }) => + currentWorkspace.providerId === 'githubWorkspace' + || currentWorkspace.providerId === 'giteeWorkspace' + || currentWorkspace.providerId === 'gitlabWorkspace' + || currentWorkspace.providerId === 'giteaWorkspace' + || currentWorkspace.providerId === 'giteeAppData' + || currentWorkspace.providerId === 'githubAppData', + lastSyncActivityKey: (state, { currentWorkspace }) => `${currentWorkspace.id}/lastSyncActivity`, + lastFocusKey: (state, { currentWorkspace }) => `${currentWorkspace.id}/lastWindowFocus`, + mainWorkspaceToken: (state, getters, rootState, rootGetters) => + utils.someResult([...Object.values(rootGetters['data/giteeTokensBySub']), ...Object.values(rootGetters['data/githubTokensBySub'])], (token) => { + if (token.isLogin) { + return token; + } + return null; + }), + syncToken: (state, { currentWorkspace, mainWorkspaceToken }, rootState, rootGetters) => { + switch (currentWorkspace.providerId) { + case 'googleDriveWorkspace': + return rootGetters['data/googleTokensBySub'][currentWorkspace.sub]; + case 'githubWorkspace': + return rootGetters['data/githubTokensBySub'][currentWorkspace.sub]; + case 'giteeWorkspace': + return rootGetters['data/giteeTokensBySub'][currentWorkspace.sub]; + case 'gitlabWorkspace': + return rootGetters['data/gitlabTokensBySub'][currentWorkspace.sub]; + case 'giteaWorkspace': + return rootGetters['data/giteaTokensBySub'][currentWorkspace.sub]; + case 'couchdbWorkspace': + return rootGetters['data/couchdbTokensBySub'][currentWorkspace.id]; + default: + return mainWorkspaceToken; + } + }, + loginType: (state, { currentWorkspace }) => { + switch (currentWorkspace.providerId) { + case 'googleDriveWorkspace': + return 'google'; + case 'githubAppData': + case 'githubWorkspace': + return 'github'; + case 'giteeAppData': + case 'giteeWorkspace': + default: + return 'gitee'; + case 'gitlabWorkspace': + return 'gitlab'; + case 'giteaWorkspace': + return 'gitea'; + } + }, + loginToken: (state, { loginType, currentWorkspace }, rootState, rootGetters) => { + const tokensBySub = rootGetters['data/tokensByType'][loginType]; + return tokensBySub && tokensBySub[currentWorkspace.sub]; + }, + sponsorToken: (state, { mainWorkspaceToken }) => mainWorkspaceToken, + }, + actions: { + removeWorkspace: ({ commit, rootGetters }, id) => { + const workspaces = { + ...rootGetters['data/workspaces'], + }; + delete workspaces[id]; + commit( + 'data/setItem', + { id: 'workspaces', data: workspaces }, + { root: true }, + ); + }, + patchWorkspacesById: ({ commit, rootGetters }, workspaces) => { + const sanitizedWorkspaces = {}; + Object + .entries({ + ...rootGetters['data/workspaces'], + ...workspaces, + }) + .forEach(([id, workspace]) => { + sanitizedWorkspaces[id] = { + ...workspace, + id, + // Do not store urls + url: undefined, + locationUrl: undefined, + }; + }); + + commit( + 'data/setItem', + { id: 'workspaces', data: sanitizedWorkspaces }, + { root: true }, + ); + }, + setCurrentWorkspaceId: ({ commit, getters }, value) => { + commit('setCurrentWorkspaceId', value); + const lastFocus = parseInt(localStorage.getItem(getters.lastFocusKey), 10) || 0; + commit('setLastFocus', lastFocus); + }, + }, +}; diff --git a/src/styles/app.scss b/src/styles/app.scss new file mode 100644 index 0000000..b3356fe --- /dev/null +++ b/src/styles/app.scss @@ -0,0 +1,435 @@ +@import './variables.scss'; + +body { + background-color: #fff; + top: 0; + right: 0; + bottom: 0; + left: 0; + position: fixed; + tab-size: 4; + text-rendering: auto; + + /* Prevent body overscroll on Chrome */ + overflow: hidden; + -webkit-overflow-scrolling: touch; +} + +* { + box-sizing: border-box; +} + +::-webkit-scrollbar-track { + background-color: transparent; +} + +::-webkit-scrollbar { + background-color: transparent; + + /* stylelint-disable-next-line selector-pseudo-class-no-unknown */ + &:horizontal { + height: 8px; + } + + /* stylelint-disable-next-line selector-pseudo-class-no-unknown */ + &:vertical { + width: 8px; + } +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: #bbb; + + .app--dark & { + background-color: #666; + } +} + +:focus { + outline: none; +} + +input[type=checkbox] { + outline: #349be8 auto 5px; +} + +.icon { + width: 100%; + height: 100%; + display: block; + + * { + fill: currentColor; + } +} + +.table-wrapper { + max-width: 100%; + overflow: auto; +} + +button, +input, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +.text-input { + display: block; + font-variant-ligatures: no-common-ligatures; + width: 100%; + height: 36px; + padding: 3px 12px; + font-size: inherit; + line-height: 1.5; + color: inherit; + background-color: rgba(255, 255, 255, 0.8); + background-image: none; + border: 0; + border-radius: $border-radius-base; + + .app--dark & { + background-color: rgba(0, 0, 0, 0.2); + } +} + +.button { + color: #333; + background-color: transparent; + display: inline-block; + height: auto; + padding: 8px 16px; + font-size: 17px; + font-weight: 400; + line-height: 1.4; + text-transform: uppercase; + overflow: hidden; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 0; + border-radius: $border-radius-base; + text-decoration: none; + + &:active, + &:focus, + &:hover, + .hidden-file:focus + & { + color: #333; + background-color: rgba(0, 0, 0, 0.05); + outline: 0; + text-decoration: none; + } + + .app--dark & { + color: rgba(255, 255, 255, 0.75); + + &:active, + &:focus, + &:hover, + .hidden-file:focus + & { + color: rgba(255, 255, 255, 0.75); + background-color: rgba(255, 255, 255, 0.05); + outline: 0; + text-decoration: none; + } + } + + .app--dark .layout__panel--editor &, + .app--dark .layout__panel--preview & { + color: #ccc; + + &:active, + &:focus, + &:hover { + color: #ccc; + background-color: rgba(255, 255, 255, 0.067); + } + } + + &[disabled] { + &, + &:active, + &:focus, + &:hover { + opacity: 0.33; + background-color: transparent; + cursor: not-allowed; + } + } +} + +.button--resolve { + background-color: #349be8; + color: #fff; + margin: -2px 0 -2px 4px; + padding: 10px 20px; + font-size: 18px; + + &:active, + &:focus, + &:hover { + color: #fff; + background-color: darken(#349be8, 8%); + } + + .app--dark & { + background-color: #567c98; + color: rgb(222, 222, 222); + + &:active, + &:focus, + &:hover { + color: #fff; + background-color: darken(#567c98, 8%); + } + } +} + +.textfield { + background-color: #fff; + border: 0; + font-family: inherit; + font-weight: 400; + font-size: 1.05em; + padding: 0 0.6rem; + box-sizing: border-box; + width: 100%; + max-width: 100%; + color: inherit; + height: 2.4rem; + + &:focus { + outline: none; + } + + &[disabled] { + cursor: not-allowed; + background-color: #f0f0f0; + color: #999; + } + + .app--dark & { + background-color: rgba(0, 0, 0, 0.2); + + &[disabled] { + cursor: not-allowed; + background-color: #373737; + color: #999; + } + } +} + +.flex { + display: flex; +} + +.flex--row { + flex-direction: row; +} + +.flex--column { + flex-direction: column; +} + +.flex--center { + justify-content: center; +} + +.flex--end { + justify-content: flex-end; +} + +.flex--space-between { + justify-content: space-between; +} + +.flex--align-center { + align-items: center; +} + +.flex--align-end { + align-items: flex-end; +} + +.user-name { + font-weight: 600; +} + +.side-title { + height: 44px; + line-height: 36px; + padding: 4px 4px 0; + background-color: rgba(0, 0, 0, 0.1); + flex: none; +} + +.side-title__button { + width: 38px; + height: 36px; + padding: 6px; + display: inline-block; + background-color: transparent; + opacity: 0.75; + flex: none; + + /* prevent from seeing wrapped buttons */ + margin-bottom: 20px; + + &:active, + &:focus, + &:hover { + opacity: 1; + background-color: rgba(0, 0, 0, 0.1); + } +} + +.side-title__title { + text-transform: uppercase; + padding: 0 5px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + width: 100%; +} + +.logo-background { + background: no-repeat center url('../assets/logo.svg'); + background-size: contain; +} + +.gutter { + position: absolute; + top: 0; + height: 100%; +} + +.gutter__background { + position: absolute; + height: 100%; + right: 0; +} + +.new-discussion-button { + color: rgba(0, 0, 0, 0.33); + position: absolute; + left: 0; + padding: 3px 3px 3px 0; + width: 22px; + height: 21px; + line-height: 1; + + .app--dark & { + color: rgba(255, 255, 255, 0.33); + } + + &:active, + &:focus, + &:hover { + color: rgba(0, 0, 0, 0.4); + + .app--dark & { + color: rgba(255, 255, 255, 0.4); + } + } +} + +.discussion-editor-highlighting, +.discussion-preview-highlighting { + background-color: mix($editor-background-light, $selection-highlighting-color, 70%); + padding: 0.25em 0; + + .app--dark & { + background-color: mix($editor-background-dark, $selection-highlighting-color, 70%); + } +} + +.discussion-editor-highlighting--hover, +.discussion-preview-highlighting--hover { + background-color: mix($editor-background-light, $selection-highlighting-color, 50%); + + .app--dark & { + background-color: mix($editor-background-dark, $selection-highlighting-color, 50%); + } + + * { + background-color: transparent; + } +} + +.discussion-editor-highlighting--selected, +.discussion-preview-highlighting--selected { + background-color: mix($editor-background-light, $selection-highlighting-color, 20%); + + .app--dark & { + background-color: mix($editor-background-dark, $selection-highlighting-color, 20%); + } + + * { + background-color: transparent; + } +} + +.discussion-preview-highlighting { + cursor: pointer; + + &.discussion-preview-highlighting--selected { + cursor: auto; + } +} + +.hidden-rendering-container { + position: absolute; + width: 500px; + left: -1000px; +} + +@media print { + body { + background-color: transparent !important; + color: #000 !important; // Black prints faster + overflow: visible !important; + position: absolute !important; + + div { + display: none !important; + } + + a { + text-decoration: underline; + } + } + + body > .app, + body > .app > .layout, + body > .app > .layout > .layout__panel, + body > .app > .layout > .layout__panel > .layout__panel, + body > .app > .layout > .layout__panel > .layout__panel > .layout__panel, + body > .app > .layout > .layout__panel > .layout__panel > .layout__panel > .layout__panel--preview, + body > .app > .layout > .layout__panel > .layout__panel > .layout__panel > .layout__panel--preview div { + background-color: transparent !important; + display: block !important; + height: auto !important; + overflow: visible !important; + position: static !important; + width: auto !important; + font-size: 16px; + } + + .preview__inner-2 { + padding: 0 50px !important; + } + // scss-lint:enable ImportantRule +} diff --git a/src/styles/base.scss b/src/styles/base.scss new file mode 100644 index 0000000..f8e5269 --- /dev/null +++ b/src/styles/base.scss @@ -0,0 +1,310 @@ +@import '../../node_modules/normalize-scss/sass/normalize'; +@import './variables'; + +@include normalize(); + +html, +body { + color: $body-color-light; + font-size: 16px; + font-family: $font-family-main; + font-variant-ligatures: common-ligatures; + line-height: $line-height-base; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + .app--dark { + color: $body-color-dark; + } +} + +.app--dark .layout__panel--editor, +.app--dark .layout__panel--preview { + color: $body-color-dark; +} + +.preview-toc ul { + list-style-type: none; + margin-bottom: 15px; +} + +p, +blockquote, +pre, +ul, +ol, +dl { + margin: 0 0 1.1em; +} + +ul, +ol { + padding-left: 30px; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + margin: 1.2em 0 0.9em; + line-height: $line-height-title; +} + +h1, +h2 { + &::after { + content: ''; + display: block; + position: relative; + top: 0.33em; + border-bottom: 1px solid $hr-color; + } +} + +ol ul, +ul ol, +ul ul, +ol ol { + margin: 0 0 1.1em; +} + +dt { + font-weight: bold; +} + +a { + color: $link-color; + text-decoration: none; + text-decoration-skip: ink; + + &:hover, + &:focus { + text-decoration: underline; + } +} + +code, +pre, +samp { + font-family: $font-family-monospace; + font-size: $font-size-monospace; + + * { + font-size: inherit; + } +} + +blockquote { + color: rgba(0, 0, 0, 0.5); + padding: 0.5em 1em; + border-left: 8px solid #cfd1d6; + background: #e2e4e9; + word-break: break-word !important; + + :last-child { + margin-bottom: 0; + } + + .app--dark .layout__panel--editor &, + .app--dark .layout__panel--preview & { + color: rgba(255, 255, 255, 0.4); + border-left-color: #333; + background: rgba(51, 51, 51, 0.5); + } +} + +code { + background-color: $code-bg; + border-radius: $border-radius-base; + padding: 2px 4px; + + .app--dark & { + background-color: $code-dark-bg; + } +} + +hr { + border: 0; + border-top: 1px solid $hr-color; + margin: 2em 0; +} + +pre > code { + background-color: $code-bg; + display: block; + padding: 0.5em; + -webkit-text-size-adjust: none; + overflow-x: auto; + white-space: pre; + + .app--dark & { + background-color: $code-dark-bg; + } +} + +.toc ul { + list-style-type: none; + padding-left: 20px; +} + +table { + background-color: transparent; + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 1em; +} + +td, +th { + border: 1px solid #c9c9c9; + padding: 8px 12px; + + .app--dark & { + border: 1px solid #5f5f5f; + } +} + +td { + border: 1px solid #c9c9c9; + + .app--dark & { + border: 1px solid #5f5f5f; + } +} + +mark { + background-color: #f8f840; +} + +kbd { + font-family: $font-family-main; + background-color: #fff; + border: 1px solid rgba(63, 63, 63, 0.25); + border-radius: 3px; + box-shadow: 0 1px 0 rgba(63, 63, 63, 0.25); + color: #333; + display: inline-block; + font-size: 0.8em; + margin: 0 0.1em; + padding: 0.1em 0.6em; + white-space: nowrap; +} + +abbr { + &[title] { + border-bottom: 1px dotted #777; + cursor: help; + } +} + +img { + max-width: 100%; +} + +.task-list-item { + list-style-type: none; +} + +.task-list-item-checkbox { + margin: 0 0.2em 0 -1.3em; +} + +.footnote { + font-size: 0.8em; + position: relative; + top: -0.25em; + vertical-align: top; +} + +.page-break-after { + page-break-after: always; +} + +.abc-notation-block { + overflow-x: auto !important; +} + +.stackedit__html { + margin-bottom: 180px; + margin-left: auto; + margin-right: auto; + padding-left: 30px; + padding-right: 30px; + max-width: 750px; +} + +.stackedit__toc { + ul { + padding: 0; + + a { + margin: 0.5rem 0; + padding: 0.5rem 1rem; + } + + ul { + color: #888; + font-size: 0.9em; + + a { + margin: 0; + padding: 0.1rem 1rem; + } + } + } + + li { + display: block; + } + + a { + display: block; + color: inherit; + text-decoration: none; + + &:active, + &:focus, + &:hover { + background-color: rgba(0, 0, 0, 0.075); + border-radius: $border-radius-base; + } + } +} + +.stackedit__left { + position: fixed; + display: none; + width: 250px; + height: 100%; + top: 0; + left: 0; + overflow-x: hidden; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: none; + + @media (min-width: 1060px) { + display: block; + } +} + +.stackedit__right { + position: absolute; + right: 0; + top: 0; + left: 0; + + @media (min-width: 1060px) { + left: 250px; + } +} + +.stackedit--pdf { + .stackedit__html { + padding-left: 0; + padding-right: 0; + max-width: none; + } +} diff --git a/src/styles/fonts.scss b/src/styles/fonts.scss new file mode 100644 index 0000000..9769705 --- /dev/null +++ b/src/styles/fonts.scss @@ -0,0 +1,41 @@ +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 400; + src: url('../assets/fonts/lato-normal.woff') format('woff'); +} + +@font-face { + font-family: 'Lato'; + font-style: italic; + font-weight: 400; + src: url('../assets/fonts/lato-normal-italic.woff') format('woff'); +} + +@font-face { + font-family: 'Lato'; + font-style: normal; + font-weight: 600; + src: url('../assets/fonts/lato-black.woff') format('woff'); +} + +@font-face { + font-family: 'Lato'; + font-style: italic; + font-weight: 600; + src: url('../assets/fonts/lato-black-italic.woff') format('woff'); +} + +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + src: url('../assets/fonts/RobotoMono-Regular.woff') format('woff'); +} + +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 600; + src: url('../assets/fonts/RobotoMono-Bold.woff') format('woff'); +} diff --git a/src/styles/index.js b/src/styles/index.js new file mode 100644 index 0000000..f9da46e --- /dev/null +++ b/src/styles/index.js @@ -0,0 +1,4 @@ +import 'katex/dist/katex.css'; +import './fonts.scss'; +import './prism.scss'; +import './base.scss'; diff --git a/src/styles/markdownHighlighting.scss b/src/styles/markdownHighlighting.scss new file mode 100644 index 0000000..c992f2b --- /dev/null +++ b/src/styles/markdownHighlighting.scss @@ -0,0 +1,355 @@ +@import './variables'; + +.markdown-highlighting { + color: $editor-color-light; + caret-color: $editor-color-light-low; + + .app--dark & { + color: $editor-color-dark; + caret-color: $editor-color-dark-low; + } + + font-family: inherit; + font-size: inherit; + -webkit-font-smoothing: auto; + -moz-osx-font-smoothing: auto; + font-weight: $editor-font-weight-base; + + .code { + font-family: $font-family-monospace; + font-size: $font-size-monospace; + + * { + font-size: inherit !important; + } + } + + .pre { + color: $editor-color-light; + + .app--dark & { + color: $editor-color-dark; + } + + font-family: $font-family-monospace; + font-size: $font-size-monospace; + + [class*='language-'] { + color: $editor-color-light-low; + + .app--dark & { + color: $editor-color-dark-low; + } + } + + * { + font-size: inherit !important; + } + + &, + * { + line-height: $line-height-title; + } + } + + .tag { + color: $editor-color-light; + + .app--dark & { + color: $editor-color-dark; + } + + font-family: $font-family-monospace; + font-size: $font-size-monospace; + font-weight: $editor-font-weight-bold; + + .punctuation, + .attr-value, + .attr-name { + font-weight: $editor-font-weight-base; + } + + * { + font-size: inherit !important; + } + } + + .latex, + .math { + font-family: $font-family-monospace; + color: $editor-color-light; + + .app--dark & { + color: $editor-color-dark; + } + } + + .entity { + color: $editor-color-light; + + .app--dark & { + color: $editor-color-dark; + } + + font-family: $font-family-monospace; + font-size: $font-size-monospace; + font-style: italic; + + * { + font-size: inherit !important; + } + } + + .table { + font-family: $font-family-monospace; + font-size: $font-size-monospace; + + * { + font-size: inherit !important; + } + } + + .comment { + color: $editor-color-light-high; + + .app--dark & { + color: $editor-color-dark-high; + } + } + + .keyword { + color: $editor-color-light-low; + + .app--dark & { + color: $editor-color-dark-low; + } + + font-weight: $editor-font-weight-bold; + } + + .code, + .img, + .img-wrapper, + .imgref, + .cl-toc { + background-color: $code-bg; + border-radius: $code-border-radius; + padding: 0.15em 0; + + .app--dark & { + background-color: $code-dark-bg; + } + } + + .img-wrapper { + display: inline-block; + + .img { + display: inline-block; + padding: 0; + background-color: transparent; + } + + img { + max-width: 100%; + padding: 0 0.15em; + box-sizing: content-box; + } + } + + .cl-toc { + font-size: 2.8em; + padding: 0.15em; + } + + .blockquote { + color: $editor-color-light-blockquote; + + .app--dark & { + color: $editor-color-dark-blockquote; + } + } + + .h1, + .h11, + .h2, + .h22, + .h3, + .h4, + .h5, + .h6 { + font-weight: $editor-font-weight-bold; + + &, + * { + line-height: $line-height-title; + } + } + + .h1, + .h11 { + font-size: 1.7em; + } + + .h2, + .h22 { + font-size: 1.4em; + } + + .h3 { + font-size: 1.2em; + } + + .h4 { + font-size: 1.1em; + } + + .h5 { + font-size: 1em; + } + + .h6 { + font-size: 0.9em; + } + + .cl-hash { + color: $editor-color-light-high; + + .app--dark & { + color: $editor-color-dark-high; + } + } + + .cl, + .hr { + color: $editor-color-light-high; + + .app--dark & { + color: $editor-color-dark-high; + } + + font-style: normal; + font-weight: $editor-font-weight-base; + } + + .em, + .em .cl { + font-style: italic; + } + + .strong, + .strong .cl, + .term { + font-weight: $editor-font-weight-bold; + } + + .cl-del-text { + text-decoration: line-through; + } + + .cl-mark-text { + background-color: #f8f840; + color: $editor-color-light-low; + } + + .url, + .email, + .cl-underlined-text { + text-decoration: underline; + color: #d7a55b; + } + + .linkdef .url { + color: $editor-color-light-high; + + .app--dark & { + color: $editor-color-dark-high; + } + } + + .fn, + .inlinefn, + .sup { + font-size: smaller; + position: relative; + top: -0.5em; + } + + .sub { + bottom: -0.25em; + font-size: smaller; + position: relative; + } + + .img, + .imgref, + .link, + .linkref { + color: $editor-color-light-high; + + .app--dark & { + color: $editor-color-dark-high; + } + + .cl-underlined-text { + color: #d7a55b; + } + } + + .cl-title { + color: $editor-color-light; + + .app--dark & { + color: $editor-color-dark; + } + } + + .cn-head { + color: #dea731; + + .app--dark & { + color: #f8bb39; + } + } + + .cn-strong { + color: #db784d; + + .app--dark & { + color: #db784d; + } + } + + .cn-code { + color: #59b003; + + .app--dark & { + color: #95cc5e; + } + } + + .cn-toc { + color: #d7a55b; + font-size: 2.5em; + padding: 0.2em; + background-color: rgba(0, 0, 0, 0.1); + + .app--dark & { + background-color: rgba(0, 0, 0, 0.3); + } + } +} + +.markdown-highlighting--inline { + .h1, + .h11, + .h2, + .h22, + .h3, + .h4, + .h5, + .h6, + .cl-toc { + font-size: inherit; + } +} diff --git a/src/styles/prism.scss b/src/styles/prism.scss new file mode 100644 index 0000000..e9332d1 --- /dev/null +++ b/src/styles/prism.scss @@ -0,0 +1,73 @@ +.token.pre.gfm, +.prism { + * { + font-weight: inherit !important; + } + + .token.comment, + .token.prolog, + .token.doctype, + .token.cdata { + color: #708090; + } + + .token.punctuation { + color: #999; + } + + .namespace { + opacity: 0.7; + } + + .token.property, + .token.tag, + .token.boolean, + .token.number, + .token.constant, + .token.symbol, + .token.deleted { + color: #905; + } + + .token.selector, + .token.attr-name, + .token.string, + .token.char, + .token.builtin, + .token.inserted { + color: #690; + } + + .token.operator, + .token.entity, + .token.url, + .language-css .token.string, + .style .token.string { + color: #a67f59; + } + + .token.atrule, + .token.attr-value, + .token.keyword { + color: #07a; + } + + .token.function { + color: #dd4a68; + } + + .token.regex, + .token.important, + .token.variable { + color: #e90; + } + + .token.important, + .token.bold { + font-weight: 500; + } + + .token.italic { + font-style: italic; + } +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000..ed90996 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,38 @@ +$font-family-main: Lato, 'Helvetica Neue', Helvetica, sans-serif; +$font-family-monospace: 'Roboto Mono', 'Lucida Sans Typewriter', 'Lucida Console', monaco, Courrier, monospace; +$body-color-light: rgba(0, 0, 0, 0.75); +$body-color-dark: rgba(255, 255, 255, 0.75); +$code-bg: rgba(0, 0, 0, 0.05); +$code-dark-bg: #333; +$line-height-base: 1.67; +$line-height-title: 1.33; +$font-size-monospace: 0.85em; +$highlighting-color: #ff0; +$dark-highlighting-color: rgba(255, 255, 0, 0.6); +$selection-highlighting-color: #ffb067; +$info-bg: #ffad3326; +$code-border-radius: 3px; +$link-color: #0c93e4; +$error-color: #f31; +$border-radius-base: 3px; +$hr-color: rgba(128, 128, 128, 0.33); +$navbar-bg: #2c2c2c; +$navbar-color: mix($navbar-bg, #fff, 33%); +$navbar-hover-color: #fff; +$navbar-hover-background: rgba(255, 255, 255, 0.1); + +$editor-background-light: #fff; +$editor-background-dark: #36312c; + +$editor-color-light: rgba(0, 0, 0, 0.8); +$editor-color-light-low: rgba(0, 0, 0, 0.75); +$editor-color-light-high: rgba(0, 0, 0, 0.28); +$editor-color-light-blockquote: rgba(0, 0, 0, 0.48); + +$editor-color-dark: rgba(255, 255, 255, 0.8); +$editor-color-dark-low: rgba(255, 255, 255, 0.75); +$editor-color-dark-high: rgba(255, 255, 255, 0.28); +$editor-color-dark-blockquote: rgba(255, 255, 255, 0.48); + +$editor-font-weight-base: 400; +$editor-font-weight-bold: 600; diff --git a/static/landing/abc.png b/static/landing/abc.png new file mode 100644 index 0000000..da05fc7 Binary files /dev/null and b/static/landing/abc.png differ diff --git a/static/landing/discussion.png b/static/landing/discussion.png new file mode 100644 index 0000000..b8a0189 Binary files /dev/null and b/static/landing/discussion.png differ diff --git a/static/landing/favicon.ico b/static/landing/favicon.ico new file mode 100644 index 0000000..1704ee8 Binary files /dev/null and b/static/landing/favicon.ico differ diff --git a/static/landing/gfm.png b/static/landing/gfm.png new file mode 100644 index 0000000..1ddf4a8 Binary files /dev/null and b/static/landing/gfm.png differ diff --git a/static/landing/gistshare.html b/static/landing/gistshare.html new file mode 100644 index 0000000..b1e6d1b --- /dev/null +++ b/static/landing/gistshare.html @@ -0,0 +1,165 @@ + + + + 文章分享 - StackEdit中文版 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/landing/index.html b/static/landing/index.html new file mode 100644 index 0000000..2277978 --- /dev/null +++ b/static/landing/index.html @@ -0,0 +1,539 @@ + + + + + StackEdit中文版 – 浏览器内 Markdown 编辑器 & 笔记利器 + + + + + + + + + + + + + + + +
        + +
        + + +
        +
        +
        +

        无与伦比的写作体验

        +
        +
        +
        +

        丰富的 Markdown 编辑器

        +

        StackEdit中文版 的 Markdown 语法高亮是独一无二的。 编辑器的精致文本格式可帮助您可视化文件的最终呈现。

        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +

        所见即所得控件

        +

        StackEdit中文版 提供了非常方便的格式化按钮和快捷方式,这要归功于 Stack Overflow 使用的所见即所得式 Markdown 编辑器 PageDown。

        +
        +
        +
        +
        +
        +

        智能布局

        +

        无论你是写作、阅读还是评论……StackEdit中文版的布局都为你提供了所需的灵活性。

        +
        +
        +
        + +
        +
        +
        +
        +

        滚动同步实时预览

        +

        StackEdit中文版的滚动同步功能精确地绑定了编辑器面板和预览面板的滚动条,以确保您在编写时始终关注输出。

        +
        + +
        +

        专为网络写手设计

        +
        +
        +
        +

        保持同步

        +

        StackEdit中文版 可以将您的文件与 Gitee、GitHub、Google Drive 和 Dropbox 同步。 它还可以将它们作为博客文章发布到 Blogger、WordPress 和 Zendesk。 您可以选择是以 Markdown 格式、HTML 上传,还是使用 Handlebars 模板引擎格式化输出。

        +
        +
        +
        + +
        +
        +
        +
        +
        +

        协作

        +

        借助 StackEdit中文版,您可以共享协作文档空间,这要归功于同步机制。 如果两个协作者同时处理同一个文件,StackEdit中文版 会负责合并更改。

        +
        + +
        +
        +
        +

        评论

        +

        StackEdit中文版 允许您在文件中插入内联评论和嵌入协作者讨论,就像 Microsoft Word 和 Google Docs 一样。

        +
        + +
        +
        +
        +
        +

        离线写作!

        +

        即使在旅行时,StackEdit中文版 仍然可以访问,让您可以像任何桌面应用程序一样离线编写。 你没有借口再偷懒!

        +
        +
        +

        扩展的 Markdown 支持

        +
        +
        +
        +
        + +
        +
        +
        +
        +

        GitHub 风格的 Markdown

        +

        StackEdit中文版 支持不同的 Markdown 风格,例如 Markdown Extra、GFM 和 CommonMark。 每个 Markdown 功能都可以在您方便的时候启用或禁用。

        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +

        LaTeX 数学表达式

        +

        StackEdit中文版 从您的 Markdown 文件中的 LaTeX 表达式呈现数学公式。

        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +

        UML 图

        +

        StackEdit中文版 使您能够使用简单的语法编写序列图和流程图。

        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +

        乐谱

        +

        StackEdit中文版 可以使用 ABC 表示法渲染乐谱。

        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        +

        Emojis表情

        +

        StackEdit中文版 支持使用 Markdown 表情符号标记在文件中插入表情符号。

        +
        +
        +
        +
        + +
        + + + + + + + diff --git a/static/landing/katex.gif b/static/landing/katex.gif new file mode 100644 index 0000000..216677d Binary files /dev/null and b/static/landing/katex.gif differ diff --git a/static/landing/logo.svg b/static/landing/logo.svg new file mode 100644 index 0000000..5611016 --- /dev/null +++ b/static/landing/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/landing/mermaid.gif b/static/landing/mermaid.gif new file mode 100644 index 0000000..8dcab22 Binary files /dev/null and b/static/landing/mermaid.gif differ diff --git a/static/landing/navigation-bar.png b/static/landing/navigation-bar.png new file mode 100644 index 0000000..6e81e8d Binary files /dev/null and b/static/landing/navigation-bar.png differ diff --git a/static/landing/privacy_policy.html b/static/landing/privacy_policy.html new file mode 100644 index 0000000..0525366 --- /dev/null +++ b/static/landing/privacy_policy.html @@ -0,0 +1,96 @@ + + + + + + + + + + + 隐私权政策 + + + +

        隐私权政策

        +
        + 【StackEdit中文版】(以下简称“此站”)深知个人信息对您的重要性, 故不会特意收集个人信息。 +
        +
        + 请在使用我们的产品(或服务)前,仔细阅读并了解本《隐私权政策》。 +
        +
        + 一、关于您的文件信息 +
        +
        + 个人文档都是存储在第三方,此站对所有第三方的文件都是在您授权之后,通过您的浏览器直接访问,并不会在此站后端获取和保存您的任何个人文件信息。 +
        +
        + 二、关于您的用户信息 +
        +
        + 本站不存在注册行为,待您授权后,您在第三方平台上个人信息的获取仅仅是在您的浏览器中直接获取,并不会在此站后端获取和保存您的个人信息。 +
        +
        + 三、其他 +
        +
        + 我们可能会更新本隐私政策,以反映我们的业务需求和适用法律的变化。在更新隐私政策时,我们会通过我们的网站或其他合适的方式通知您。如果您继续使用我们的服务,则意味着您同意更新后的隐私政策。 +
        +
        + 四、如何联系我们 +
        +
        + 如果您对本隐私政策有任何疑问、意见或建议,通过以下方式与我们联系: +
        +
        + 邮箱:【mafgwo@163.com】 +
        +
        + 微信:【qicoding】 +
        +
        + 一般情况下,我们将在一周内回复。 +
        + + \ No newline at end of file diff --git a/static/landing/providers.png b/static/landing/providers.png new file mode 100644 index 0000000..309ef18 Binary files /dev/null and b/static/landing/providers.png differ diff --git a/static/landing/scroll-sync.gif b/static/landing/scroll-sync.gif new file mode 100644 index 0000000..93f8191 Binary files /dev/null and b/static/landing/scroll-sync.gif differ diff --git a/static/landing/share.html b/static/landing/share.html new file mode 100644 index 0000000..9c4deb1 --- /dev/null +++ b/static/landing/share.html @@ -0,0 +1,177 @@ + + + + 文章分享 - StackEdit中文版 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/landing/smart-layout.png b/static/landing/smart-layout.png new file mode 100644 index 0000000..9475214 Binary files /dev/null and b/static/landing/smart-layout.png differ diff --git a/static/landing/syntax-highlighting.gif b/static/landing/syntax-highlighting.gif new file mode 100644 index 0000000..bf967b5 Binary files /dev/null and b/static/landing/syntax-highlighting.gif differ diff --git a/static/landing/twemoji.png b/static/landing/twemoji.png new file mode 100644 index 0000000..a3919a8 Binary files /dev/null and b/static/landing/twemoji.png differ diff --git a/static/landing/workspace.png b/static/landing/workspace.png new file mode 100644 index 0000000..3a863b2 Binary files /dev/null and b/static/landing/workspace.png differ diff --git a/static/oauth2/callback.html b/static/oauth2/callback.html new file mode 100644 index 0000000..0778358 --- /dev/null +++ b/static/oauth2/callback.html @@ -0,0 +1,9 @@ + + + + + + diff --git a/static/sitemap.xml b/static/sitemap.xml new file mode 100644 index 0000000..4526336 --- /dev/null +++ b/static/sitemap.xml @@ -0,0 +1,23 @@ + + + + https://stackedit.cn/ + weekly + 1.0 + + + https://stackedit.cn/app + weekly + 1.0 + + + https://gitee.com/mafgwo/stackedit/issues + weekly + 0.8 + + + https://stackedit.cn/privacy_policy.html + monthly + 0.6 + + diff --git a/static/themes/edit-theme-azure.js b/static/themes/edit-theme-azure.js new file mode 100644 index 0000000..0d9c6c0 --- /dev/null +++ b/static/themes/edit-theme-azure.js @@ -0,0 +1,72 @@ +function init_edit_theme_azure() { + const style = document.createElement('style'); + style.id = 'edit-theme-azure'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--azure .editor__inner {\n\ + color: #fff;\n\ + caret-color: #fff;\n\ +}\n\ +.edit-theme--azure .editor {\n\ + background-color: #181D26;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--azure .editor__inner .cn-head,\n\ +.edit-theme--azure .editor-in-page-buttons .icon {\n\ + color: #64aeb3;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--azure .editor__inner .cn-strong {\n\ + color: #508aaa;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--azure .editor__inner .blockquote {\n\ + color: #52708b;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--azure .editor__inner .cl,\n\ +.edit-theme--azure .editor__inner .hr,\n\ +.edit-theme--azure .editor__inner .link,\n\ +.edit-theme--azure .editor__inner .linkref, \n\ +.edit-theme--azure .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--azure .editor__inner .cn-toc, \n\ +.edit-theme--azure .editor__inner .code,\n\ +.edit-theme--azure .editor__inner .img,\n\ +.edit-theme--azure .editor__inner .img-wrapper,\n\ +.edit-theme--azure .editor__inner .imgref,\n\ +.edit-theme--azure .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--azure .editor__inner .cn-code {\n\ + color: #6AB0A3;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--azure .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--azure .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--azure .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--azure .editor__inner .linkref .cl-underlined-text {\n\ + color: #64aeb3;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--azure .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--azure .editor__inner .keyword {\n\ + color: #508aaa;\n\ +}\n\ +.edit-theme--azure .editor__inner .email,\n\ +.edit-theme--azure .editor__inner .cl-title,\n\ +.edit-theme--azure .editor__inner .tag,\n\ +.edit-theme--azure .editor__inner .latex,\n\ +.edit-theme--azure .editor__inner .math,\n\ +.edit-theme--azure .editor__inner .entity,\n\ +.edit-theme--azure .editor__inner .pre [class*='language-'] {\n\ + color: #fff;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_azure(); \ No newline at end of file diff --git a/static/themes/edit-theme-carbonight.js b/static/themes/edit-theme-carbonight.js new file mode 100644 index 0000000..e670a1c --- /dev/null +++ b/static/themes/edit-theme-carbonight.js @@ -0,0 +1,72 @@ +function init_edit_theme_carbonight() { + const style = document.createElement('style'); + style.id = 'edit-theme-carbonight'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--carbonight .editor__inner {\n\ + color: #B0B0B0;\n\ + caret-color: #B0B0B0;\n\ +}\n\ +.edit-theme--carbonight .editor {\n\ + background-color: #2E2C2B;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--carbonight .editor__inner .cn-head,\n\ +.edit-theme--carbonight .editor-in-page-buttons .icon {\n\ + color: #B0B0B0;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--carbonight .editor__inner .cn-strong {\n\ + color: #eeeeee;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--carbonight .editor__inner .blockquote {\n\ + color: #8C8C8C;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--carbonight .editor__inner .cl,\n\ +.edit-theme--carbonight .editor__inner .hr,\n\ +.edit-theme--carbonight .editor__inner .link,\n\ +.edit-theme--carbonight .editor__inner .linkref, \n\ +.edit-theme--carbonight .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--carbonight .editor__inner .cn-toc, \n\ +.edit-theme--carbonight .editor__inner .code,\n\ +.edit-theme--carbonight .editor__inner .img,\n\ +.edit-theme--carbonight .editor__inner .img-wrapper,\n\ +.edit-theme--carbonight .editor__inner .imgref,\n\ +.edit-theme--carbonight .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--carbonight .editor__inner .cn-code {\n\ + color: #fff;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--carbonight .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--carbonight .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--carbonight .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--carbonight .editor__inner .linkref .cl-underlined-text {\n\ + color: #fff;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--carbonight .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--carbonight .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--carbonight .editor__inner .email,\n\ +.edit-theme--carbonight .editor__inner .cl-title,\n\ +.edit-theme--carbonight .editor__inner .tag,\n\ +.edit-theme--carbonight .editor__inner .latex,\n\ +.edit-theme--carbonight .editor__inner .math,\n\ +.edit-theme--carbonight .editor__inner .entity,\n\ +.edit-theme--carbonight .editor__inner .pre [class*='language-'] {\n\ + color: #B0B0B0;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_carbonight(); \ No newline at end of file diff --git a/static/themes/edit-theme-clouds.js b/static/themes/edit-theme-clouds.js new file mode 100644 index 0000000..12ccb8d --- /dev/null +++ b/static/themes/edit-theme-clouds.js @@ -0,0 +1,72 @@ +function init_edit_theme_clouds() { + const style = document.createElement('style'); + style.id = 'edit-theme-clouds'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--clouds .editor__inner {\n\ + color: #000;\n\ + caret-color: #000;\n\ +}\n\ +.edit-theme--clouds .editor {\n\ + background-color: #fff;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--clouds .editor__inner .cn-head,\n\ +.edit-theme--clouds .editor-in-page-buttons .icon {\n\ + color: #46A609;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--clouds .editor__inner .cn-strong {\n\ + color: #AF956F;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--clouds .editor__inner .blockquote {\n\ + color: #5D90CD;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--clouds .editor__inner .cl,\n\ +.edit-theme--clouds .editor__inner .hr,\n\ +.edit-theme--clouds .editor__inner .link,\n\ +.edit-theme--clouds .editor__inner .linkref, \n\ +.edit-theme--clouds .editor__inner .linkdef .url {\n\ + color: rgba(102,128,153,0.6);\n\ +}\n\ +.edit-theme--clouds .editor__inner .cn-toc, \n\ +.edit-theme--clouds .editor__inner .code,\n\ +.edit-theme--clouds .editor__inner .img,\n\ +.edit-theme--clouds .editor__inner .img-wrapper,\n\ +.edit-theme--clouds .editor__inner .imgref,\n\ +.edit-theme--clouds .editor__inner .cl-toc {\n\ + color: rgba(102,128,153,0.6);\n\ + background-color: rgba(102,128,153,0.075);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--clouds .editor__inner .cn-code {\n\ + color: #C52727;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--clouds .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--clouds .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--clouds .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--clouds .editor__inner .linkref .cl-underlined-text {\n\ + color: #5D90CD;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--clouds .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--clouds .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--clouds .editor__inner .email,\n\ +.edit-theme--clouds .editor__inner .cl-title,\n\ +.edit-theme--clouds .editor__inner .tag,\n\ +.edit-theme--clouds .editor__inner .latex,\n\ +.edit-theme--clouds .editor__inner .math,\n\ +.edit-theme--clouds .editor__inner .entity,\n\ +.edit-theme--clouds .editor__inner .pre [class*='language-'] {\n\ + color: #000;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_clouds(); \ No newline at end of file diff --git a/static/themes/edit-theme-clouds_midnight.js b/static/themes/edit-theme-clouds_midnight.js new file mode 100644 index 0000000..3cade63 --- /dev/null +++ b/static/themes/edit-theme-clouds_midnight.js @@ -0,0 +1,72 @@ +function init_edit_theme_clouds_midnight() { + const style = document.createElement('style'); + style.id = 'edit-theme-clouds_midnight'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--clouds_midnight .editor__inner {\n\ + color: #929292;\n\ + caret-color: #929292;\n\ +}\n\ +.edit-theme--clouds_midnight .editor {\n\ + background-color: #191919;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .cn-head,\n\ +.edit-theme--clouds_midnight .editor-in-page-buttons .icon {\n\ + color: #46A609;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .cn-strong {\n\ + color: #927C5D;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .blockquote {\n\ + color: #5D90CD;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .cl,\n\ +.edit-theme--clouds_midnight .editor__inner .hr,\n\ +.edit-theme--clouds_midnight .editor__inner .link,\n\ +.edit-theme--clouds_midnight .editor__inner .linkref, \n\ +.edit-theme--clouds_midnight .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--clouds_midnight .editor__inner .cn-toc, \n\ +.edit-theme--clouds_midnight .editor__inner .code,\n\ +.edit-theme--clouds_midnight .editor__inner .img,\n\ +.edit-theme--clouds_midnight .editor__inner .img-wrapper,\n\ +.edit-theme--clouds_midnight .editor__inner .imgref,\n\ +.edit-theme--clouds_midnight .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .cn-code {\n\ + color: #E92E2E;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--clouds_midnight .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--clouds_midnight .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--clouds_midnight .editor__inner .linkref .cl-underlined-text {\n\ + color: #5D90CD;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--clouds_midnight .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--clouds_midnight .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--clouds_midnight .editor__inner .email,\n\ +.edit-theme--clouds_midnight .editor__inner .cl-title,\n\ +.edit-theme--clouds_midnight .editor__inner .tag,\n\ +.edit-theme--clouds_midnight .editor__inner .latex,\n\ +.edit-theme--clouds_midnight .editor__inner .math,\n\ +.edit-theme--clouds_midnight .editor__inner .entity,\n\ +.edit-theme--clouds_midnight .editor__inner .pre [class*='language-'] {\n\ + color: #929292;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_clouds_midnight(); \ No newline at end of file diff --git a/static/themes/edit-theme-dawn.js b/static/themes/edit-theme-dawn.js new file mode 100644 index 0000000..02e3d0d --- /dev/null +++ b/static/themes/edit-theme-dawn.js @@ -0,0 +1,72 @@ +function init_edit_theme_dawn() { + const style = document.createElement('style'); + style.id = 'edit-theme-dawn'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--dawn .editor__inner {\n\ + color: #080808;\n\ + caret-color: #080808;\n\ +}\n\ +.edit-theme--dawn .editor {\n\ + background-color: #F9F9F9;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--dawn .editor__inner .cn-head,\n\ +.edit-theme--dawn .editor-in-page-buttons .icon {\n\ + color: #19356D;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--dawn .editor__inner .cn-strong {\n\ + color: #794938;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--dawn .editor__inner .blockquote {\n\ + color: #811F24;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--dawn .editor__inner .cl,\n\ +.edit-theme--dawn .editor__inner .hr,\n\ +.edit-theme--dawn .editor__inner .link,\n\ +.edit-theme--dawn .editor__inner .linkref, \n\ +.edit-theme--dawn .editor__inner .linkdef .url {\n\ + color: rgba(102,128,153,0.6);\n\ +}\n\ +.edit-theme--dawn .editor__inner .cn-toc, \n\ +.edit-theme--dawn .editor__inner .code,\n\ +.edit-theme--dawn .editor__inner .img,\n\ +.edit-theme--dawn .editor__inner .img-wrapper,\n\ +.edit-theme--dawn .editor__inner .imgref,\n\ +.edit-theme--dawn .editor__inner .cl-toc {\n\ + color: rgba(102,128,153,0.6);\n\ + background-color: rgba(102,128,153,0.075);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--dawn .editor__inner .cn-code {\n\ + color: #693A17;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--dawn .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--dawn .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--dawn .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--dawn .editor__inner .linkref .cl-underlined-text {\n\ + color: #0B6125;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--dawn .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--dawn .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--dawn .editor__inner .email,\n\ +.edit-theme--dawn .editor__inner .cl-title,\n\ +.edit-theme--dawn .editor__inner .tag,\n\ +.edit-theme--dawn .editor__inner .latex,\n\ +.edit-theme--dawn .editor__inner .math,\n\ +.edit-theme--dawn .editor__inner .entity,\n\ +.edit-theme--dawn .editor__inner .pre [class*='language-'] {\n\ + color: #080808;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_dawn(); \ No newline at end of file diff --git a/static/themes/edit-theme-espresso_libre.js b/static/themes/edit-theme-espresso_libre.js new file mode 100644 index 0000000..8b556c1 --- /dev/null +++ b/static/themes/edit-theme-espresso_libre.js @@ -0,0 +1,72 @@ +function init_edit_theme_espresso_libre() { + const style = document.createElement('style'); + style.id = 'edit-theme-espresso_libre'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--espresso_libre .editor__inner {\n\ + color: #BDAE9D;\n\ + caret-color: #BDAE9D;\n\ +}\n\ +.edit-theme--espresso_libre .editor {\n\ + background-color: #2A211C;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .cn-head,\n\ +.edit-theme--espresso_libre .editor-in-page-buttons .icon {\n\ + color: #44AA43;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .cn-strong {\n\ + color: #43A8ED;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .blockquote {\n\ + color: #52708b;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .cl,\n\ +.edit-theme--espresso_libre .editor__inner .hr,\n\ +.edit-theme--espresso_libre .editor__inner .link,\n\ +.edit-theme--espresso_libre .editor__inner .linkref, \n\ +.edit-theme--espresso_libre .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--espresso_libre .editor__inner .cn-toc, \n\ +.edit-theme--espresso_libre .editor__inner .code,\n\ +.edit-theme--espresso_libre .editor__inner .img,\n\ +.edit-theme--espresso_libre .editor__inner .img-wrapper,\n\ +.edit-theme--espresso_libre .editor__inner .imgref,\n\ +.edit-theme--espresso_libre .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .cn-code {\n\ + color: #7290D9;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--espresso_libre .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--espresso_libre .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--espresso_libre .editor__inner .linkref .cl-underlined-text {\n\ + color: #049B0A;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--espresso_libre .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--espresso_libre .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--espresso_libre .editor__inner .email,\n\ +.edit-theme--espresso_libre .editor__inner .cl-title,\n\ +.edit-theme--espresso_libre .editor__inner .tag,\n\ +.edit-theme--espresso_libre .editor__inner .latex,\n\ +.edit-theme--espresso_libre .editor__inner .math,\n\ +.edit-theme--espresso_libre .editor__inner .entity,\n\ +.edit-theme--espresso_libre .editor__inner .pre [class*='language-'] {\n\ + color: #BDAE9D;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_espresso_libre(); \ No newline at end of file diff --git a/static/themes/edit-theme-github.js b/static/themes/edit-theme-github.js new file mode 100644 index 0000000..a78e025 --- /dev/null +++ b/static/themes/edit-theme-github.js @@ -0,0 +1,73 @@ +function init_edit_theme_github() { + const style = document.createElement('style'); + style.id = 'edit-theme-github'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--github .editor__inner {\n\ + color: #000;\n\ + caret-color: #000;\n\ + background-color: #fff;\n\ +}\n\ +.edit-theme--github .editor {\n\ + background-color: #fff;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--github .editor__inner .cn-head,\n\ +.edit-theme--github .editor-in-page-buttons .icon {\n\ + color: #AAAAAA;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--github .editor__inner .cn-strong {\n\ + color: #000;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--github .editor__inner .blockquote {\n\ + color: rgba(0,0,0,0.48);\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--github .editor__inner .cl,\n\ +.edit-theme--github .editor__inner .hr,\n\ +.edit-theme--github .editor__inner .link,\n\ +.edit-theme--github .editor__inner .linkref, \n\ +.edit-theme--github .editor__inner .linkdef .url {\n\ + color: rgba(0,0,0,0.28);\n\ +}\n\ +.edit-theme--github .editor__inner .cn-toc, \n\ +.edit-theme--github .editor__inner .code,\n\ +.edit-theme--github .editor__inner .img,\n\ +.edit-theme--github .editor__inner .img-wrapper,\n\ +.edit-theme--github .editor__inner .imgref,\n\ +.edit-theme--github .editor__inner .cl-toc {\n\ + color: rgba(0,0,0,0.28);\n\ + background-color: rgba(102,128,153,0.075);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--github .editor__inner .cn-code {\n\ + color: #0086B3;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--github .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--github .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--github .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--github .editor__inner .linkref .cl-underlined-text {\n\ + color: #D14;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--github .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--github .editor__inner .keyword {\n\ + color: rgba(0,0,0,0.75);\n\ +}\n\ +.edit-theme--github .editor__inner .email,\n\ +.edit-theme--github .editor__inner .cl-title,\n\ +.edit-theme--github .editor__inner .tag,\n\ +.edit-theme--github .editor__inner .latex,\n\ +.edit-theme--github .editor__inner .math,\n\ +.edit-theme--github .editor__inner .entity,\n\ +.edit-theme--github .editor__inner .pre [class*='language-'] {\n\ + color: #29333d;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_github(); \ No newline at end of file diff --git a/static/themes/edit-theme-iceberg_contrast.js b/static/themes/edit-theme-iceberg_contrast.js new file mode 100644 index 0000000..12e44ba --- /dev/null +++ b/static/themes/edit-theme-iceberg_contrast.js @@ -0,0 +1,72 @@ +function init_edit_theme_iceberg_contrast() { + const style = document.createElement('style'); + style.id = 'edit-theme-iceberg_contrast'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--iceberg_contrast .editor__inner {\n\ + color: #BDD6DB;\n\ + caret-color: #fff;\n\ +}\n\ +.edit-theme--iceberg_contrast .editor {\n\ + background-color: #0b0e0e;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .cn-head,\n\ +.edit-theme--iceberg_contrast .editor-in-page-buttons .icon {\n\ + color: #fff;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .cn-strong {\n\ + color: #B1E2F2;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .blockquote {\n\ + color: #ffffff;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .cl,\n\ +.edit-theme--iceberg_contrast .editor__inner .hr,\n\ +.edit-theme--iceberg_contrast .editor__inner .link,\n\ +.edit-theme--iceberg_contrast .editor__inner .linkref, \n\ +.edit-theme--iceberg_contrast .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--iceberg_contrast .editor__inner .cn-toc, \n\ +.edit-theme--iceberg_contrast .editor__inner .code,\n\ +.edit-theme--iceberg_contrast .editor__inner .img,\n\ +.edit-theme--iceberg_contrast .editor__inner .img-wrapper,\n\ +.edit-theme--iceberg_contrast .editor__inner .imgref,\n\ +.edit-theme--iceberg_contrast .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .cn-code {\n\ + color: #fff;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--iceberg_contrast .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--iceberg_contrast .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--iceberg_contrast .editor__inner .linkref .cl-underlined-text {\n\ + color: #fff;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--iceberg_contrast .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--iceberg_contrast .editor__inner .keyword {\n\ + color: #fff;\n\ +}\n\ +.edit-theme--iceberg_contrast .editor__inner .email,\n\ +.edit-theme--iceberg_contrast .editor__inner .cl-title,\n\ +.edit-theme--iceberg_contrast .editor__inner .tag,\n\ +.edit-theme--iceberg_contrast .editor__inner .latex,\n\ +.edit-theme--iceberg_contrast .editor__inner .math,\n\ +.edit-theme--iceberg_contrast .editor__inner .entity,\n\ +.edit-theme--iceberg_contrast .editor__inner .pre [class*='language-'] {\n\ + color: #BDD6DB;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_iceberg_contrast(); \ No newline at end of file diff --git a/static/themes/edit-theme-lavender.js b/static/themes/edit-theme-lavender.js new file mode 100644 index 0000000..0ea85fd --- /dev/null +++ b/static/themes/edit-theme-lavender.js @@ -0,0 +1,72 @@ +function init_edit_theme_lavender() { + const style = document.createElement('style'); + style.id = 'edit-theme-lavender'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--lavender .editor__inner {\n\ + color: #E0CEED;\n\ + caret-color: #E0CEED;\n\ +}\n\ +.edit-theme--lavender .editor {\n\ + background-color: #29222E;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--lavender .editor__inner .cn-head,\n\ +.edit-theme--lavender .editor-in-page-buttons .icon {\n\ + color: #F25AE6;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--lavender .editor__inner .cn-strong {\n\ + color: #8E6DA6;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--lavender .editor__inner .blockquote {\n\ + color: #B657FF;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--lavender .editor__inner .cl,\n\ +.edit-theme--lavender .editor__inner .hr,\n\ +.edit-theme--lavender .editor__inner .link,\n\ +.edit-theme--lavender .editor__inner .linkref, \n\ +.edit-theme--lavender .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--lavender .editor__inner .cn-toc, \n\ +.edit-theme--lavender .editor__inner .code,\n\ +.edit-theme--lavender .editor__inner .img,\n\ +.edit-theme--lavender .editor__inner .img-wrapper,\n\ +.edit-theme--lavender .editor__inner .imgref,\n\ +.edit-theme--lavender .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--lavender .editor__inner .cn-code {\n\ + color: #8E69C9;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--lavender .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--lavender .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--lavender .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--lavender .editor__inner .linkref .cl-underlined-text {\n\ + color: #F5B0EF;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--lavender .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--lavender .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--lavender .editor__inner .email,\n\ +.edit-theme--lavender .editor__inner .cl-title,\n\ +.edit-theme--lavender .editor__inner .tag,\n\ +.edit-theme--lavender .editor__inner .latex,\n\ +.edit-theme--lavender .editor__inner .math,\n\ +.edit-theme--lavender .editor__inner .entity,\n\ +.edit-theme--lavender .editor__inner .pre [class*='language-'] {\n\ + color: #E0CEED;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_lavender(); \ No newline at end of file diff --git a/static/themes/edit-theme-mintchoc.js b/static/themes/edit-theme-mintchoc.js new file mode 100644 index 0000000..05795dc --- /dev/null +++ b/static/themes/edit-theme-mintchoc.js @@ -0,0 +1,72 @@ +function init_edit_theme_mintchoc() { + const style = document.createElement('style'); + style.id = 'edit-theme-mintchoc'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--mintchoc .editor__inner {\n\ + color: #BABABA;\n\ + caret-color: #BABABA;\n\ +}\n\ +.edit-theme--mintchoc .editor {\n\ + background-color: #2b221c;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--mintchoc .editor__inner .cn-head,\n\ +.edit-theme--mintchoc .editor-in-page-buttons .icon {\n\ + color: #00E08C;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--mintchoc .editor__inner .cn-strong {\n\ + color: #9D8262;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--mintchoc .editor__inner .blockquote {\n\ + color: #008D62;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--mintchoc .editor__inner .cl,\n\ +.edit-theme--mintchoc .editor__inner .hr,\n\ +.edit-theme--mintchoc .editor__inner .link,\n\ +.edit-theme--mintchoc .editor__inner .linkref, \n\ +.edit-theme--mintchoc .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--mintchoc .editor__inner .cn-toc, \n\ +.edit-theme--mintchoc .editor__inner .code,\n\ +.edit-theme--mintchoc .editor__inner .img,\n\ +.edit-theme--mintchoc .editor__inner .img-wrapper,\n\ +.edit-theme--mintchoc .editor__inner .imgref,\n\ +.edit-theme--mintchoc .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--mintchoc .editor__inner .cn-code {\n\ + color: #008D62;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--mintchoc .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--mintchoc .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--mintchoc .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--mintchoc .editor__inner .linkref .cl-underlined-text {\n\ + color: #00E08C;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--mintchoc .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--mintchoc .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--mintchoc .editor__inner .email,\n\ +.edit-theme--mintchoc .editor__inner .cl-title,\n\ +.edit-theme--mintchoc .editor__inner .tag,\n\ +.edit-theme--mintchoc .editor__inner .latex,\n\ +.edit-theme--mintchoc .editor__inner .math,\n\ +.edit-theme--mintchoc .editor__inner .entity,\n\ +.edit-theme--mintchoc .editor__inner .pre [class*='language-'] {\n\ + color: #BABABA;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_mintchoc(); \ No newline at end of file diff --git a/static/themes/edit-theme-peacock.js b/static/themes/edit-theme-peacock.js new file mode 100644 index 0000000..02054ec --- /dev/null +++ b/static/themes/edit-theme-peacock.js @@ -0,0 +1,72 @@ +function init_edit_theme_peacock() { + const style = document.createElement('style'); + style.id = 'edit-theme-peacock'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--peacock .editor__inner {\n\ + color: #ede0ce;\n\ + caret-color: #ede0ce;\n\ +}\n\ +.edit-theme--peacock .editor {\n\ + background-color: #2b2a27;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--peacock .editor__inner .cn-head,\n\ +.edit-theme--peacock .editor-in-page-buttons .icon {\n\ + color: #bcd42a;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--peacock .editor__inner .cn-strong {\n\ + color: #26A6A6;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--peacock .editor__inner .blockquote {\n\ + color: #ff5d38;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--peacock .editor__inner .cl,\n\ +.edit-theme--peacock .editor__inner .hr,\n\ +.edit-theme--peacock .editor__inner .link,\n\ +.edit-theme--peacock .editor__inner .linkref, \n\ +.edit-theme--peacock .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--peacock .editor__inner .cn-toc, \n\ +.edit-theme--peacock .editor__inner .code,\n\ +.edit-theme--peacock .editor__inner .img,\n\ +.edit-theme--peacock .editor__inner .img-wrapper,\n\ +.edit-theme--peacock .editor__inner .imgref,\n\ +.edit-theme--peacock .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--peacock .editor__inner .cn-code {\n\ + color: #FF5D38;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--peacock .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--peacock .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--peacock .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--peacock .editor__inner .linkref .cl-underlined-text {\n\ + color: #bcd42a;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--peacock .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--peacock .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--peacock .editor__inner .email,\n\ +.edit-theme--peacock .editor__inner .cl-title,\n\ +.edit-theme--peacock .editor__inner .tag,\n\ +.edit-theme--peacock .editor__inner .latex,\n\ +.edit-theme--peacock .editor__inner .math,\n\ +.edit-theme--peacock .editor__inner .entity,\n\ +.edit-theme--peacock .editor__inner .pre [class*='language-'] {\n\ + color: #ede0ce;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_peacock(); \ No newline at end of file diff --git a/static/themes/edit-theme-slate.js b/static/themes/edit-theme-slate.js new file mode 100644 index 0000000..cde34d4 --- /dev/null +++ b/static/themes/edit-theme-slate.js @@ -0,0 +1,72 @@ +function init_edit_theme_slate() { + const style = document.createElement('style'); + style.id = 'edit-theme-slate'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--slate .editor__inner {\n\ + color: #ebebf4;\n\ + caret-color: #ebebf4;\n\ +}\n\ +.edit-theme--slate .editor {\n\ + background-color: #19191f;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--slate .editor__inner .cn-head,\n\ +.edit-theme--slate .editor-in-page-buttons .icon {\n\ + color: #9eb2d9;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--slate .editor__inner .cn-strong {\n\ + color: #566981;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--slate .editor__inner .blockquote {\n\ + color: #89A7B1;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--slate .editor__inner .cl,\n\ +.edit-theme--slate .editor__inner .hr,\n\ +.edit-theme--slate .editor__inner .link,\n\ +.edit-theme--slate .editor__inner .linkref, \n\ +.edit-theme--slate .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--slate .editor__inner .cn-toc, \n\ +.edit-theme--slate .editor__inner .code,\n\ +.edit-theme--slate .editor__inner .img,\n\ +.edit-theme--slate .editor__inner .img-wrapper,\n\ +.edit-theme--slate .editor__inner .imgref,\n\ +.edit-theme--slate .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--slate .editor__inner .cn-code {\n\ + color: #89A7B1;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--slate .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--slate .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--slate .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--slate .editor__inner .linkref .cl-underlined-text {\n\ + color: #9eb2d9;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--slate .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--slate .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--slate .editor__inner .email,\n\ +.edit-theme--slate .editor__inner .cl-title,\n\ +.edit-theme--slate .editor__inner .tag,\n\ +.edit-theme--slate .editor__inner .latex,\n\ +.edit-theme--slate .editor__inner .math,\n\ +.edit-theme--slate .editor__inner .entity,\n\ +.edit-theme--slate .editor__inner .pre [class*='language-'] {\n\ + color: #ebebf4;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_slate(); \ No newline at end of file diff --git a/static/themes/edit-theme-solarflare.js b/static/themes/edit-theme-solarflare.js new file mode 100644 index 0000000..e9a6d44 --- /dev/null +++ b/static/themes/edit-theme-solarflare.js @@ -0,0 +1,72 @@ +function init_edit_theme_solarflare() { + const style = document.createElement('style'); + style.id = 'edit-theme-solarflare'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--solarflare .editor__inner {\n\ + color: #e3e2e0;\n\ + caret-color: #e3e2e0;\n\ +}\n\ +.edit-theme--solarflare .editor {\n\ + background-color: #292D30;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--solarflare .editor__inner .cn-head,\n\ +.edit-theme--solarflare .editor-in-page-buttons .icon {\n\ + color: #FF4E50;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--solarflare .editor__inner .cn-strong {\n\ + color: #FF4E50;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--solarflare .editor__inner .blockquote {\n\ + color: #FF4E50;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--solarflare .editor__inner .cl,\n\ +.edit-theme--solarflare .editor__inner .hr,\n\ +.edit-theme--solarflare .editor__inner .link,\n\ +.edit-theme--solarflare .editor__inner .linkref, \n\ +.edit-theme--solarflare .editor__inner .linkdef .url {\n\ + color: rgba(139,158,177,0.8);\n\ +}\n\ +.edit-theme--solarflare .editor__inner .cn-toc, \n\ +.edit-theme--solarflare .editor__inner .code,\n\ +.edit-theme--solarflare .editor__inner .img,\n\ +.edit-theme--solarflare .editor__inner .img-wrapper,\n\ +.edit-theme--solarflare .editor__inner .imgref,\n\ +.edit-theme--solarflare .editor__inner .cl-toc {\n\ + color: rgba(139,158,177,0.8);\n\ + background-color: rgba(0,0,0,0.33);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--solarflare .editor__inner .cn-code {\n\ + color: #FC913A;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--solarflare .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--solarflare .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--solarflare .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--solarflare .editor__inner .linkref .cl-underlined-text {\n\ + color: #EDE574;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--solarflare .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--solarflare .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--solarflare .editor__inner .email,\n\ +.edit-theme--solarflare .editor__inner .cl-title,\n\ +.edit-theme--solarflare .editor__inner .tag,\n\ +.edit-theme--solarflare .editor__inner .latex,\n\ +.edit-theme--solarflare .editor__inner .math,\n\ +.edit-theme--solarflare .editor__inner .entity,\n\ +.edit-theme--solarflare .editor__inner .pre [class*='language-'] {\n\ + color: #e3e2e0;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_solarflare(); \ No newline at end of file diff --git a/static/themes/edit-theme-solarized_light.js b/static/themes/edit-theme-solarized_light.js new file mode 100644 index 0000000..e83fae3 --- /dev/null +++ b/static/themes/edit-theme-solarized_light.js @@ -0,0 +1,72 @@ +function init_edit_theme_solarized_light() { + const style = document.createElement('style'); + style.id = 'edit-theme-solarized_light'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--solarized_light .editor__inner {\n\ + color: #586E75;\n\ + caret-color: #586E75;\n\ +}\n\ +.edit-theme--solarized_light .editor {\n\ + background-color: #FDF6E3;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--solarized_light .editor__inner .cn-head,\n\ +.edit-theme--solarized_light .editor-in-page-buttons .icon {\n\ + color: #D33682;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--solarized_light .editor__inner .cn-strong {\n\ + color: #859900;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--solarized_light .editor__inner .blockquote {\n\ + color: #CB4B16;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--solarized_light .editor__inner .cl,\n\ +.edit-theme--solarized_light .editor__inner .hr,\n\ +.edit-theme--solarized_light .editor__inner .link,\n\ +.edit-theme--solarized_light .editor__inner .linkref, \n\ +.edit-theme--solarized_light .editor__inner .linkdef .url {\n\ + color: rgba(102,128,153,0.6);\n\ +}\n\ +.edit-theme--solarized_light .editor__inner .cn-toc, \n\ +.edit-theme--solarized_light .editor__inner .code,\n\ +.edit-theme--solarized_light .editor__inner .img,\n\ +.edit-theme--solarized_light .editor__inner .img-wrapper,\n\ +.edit-theme--solarized_light .editor__inner .imgref,\n\ +.edit-theme--solarized_light .editor__inner .cl-toc {\n\ + color: rgba(102,128,153,0.6);\n\ + background-color: rgba(102,128,153,0.075);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--solarized_light .editor__inner .cn-code {\n\ + color: #268BD2;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--solarized_light .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--solarized_light .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--solarized_light .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--solarized_light .editor__inner .linkref .cl-underlined-text {\n\ + color: #2AA198;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--solarized_light .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--solarized_light .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--solarized_light .editor__inner .email,\n\ +.edit-theme--solarized_light .editor__inner .cl-title,\n\ +.edit-theme--solarized_light .editor__inner .tag,\n\ +.edit-theme--solarized_light .editor__inner .latex,\n\ +.edit-theme--solarized_light .editor__inner .math,\n\ +.edit-theme--solarized_light .editor__inner .entity,\n\ +.edit-theme--solarized_light .editor__inner .pre [class*='language-'] {\n\ + color: #586E75;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_solarized_light(); \ No newline at end of file diff --git a/static/themes/edit-theme-spearmint.js b/static/themes/edit-theme-spearmint.js new file mode 100644 index 0000000..8c312ac --- /dev/null +++ b/static/themes/edit-theme-spearmint.js @@ -0,0 +1,72 @@ +function init_edit_theme_spearmint() { + const style = document.createElement('style'); + style.id = 'edit-theme-spearmint'; + style.type = 'text/css'; + style.innerHTML = "/* 默认字体颜色、光标颜色、背景颜色*/\n\ +.edit-theme--spearmint .editor__inner {\n\ + color: #719692;\n\ + caret-color: #719692;\n\ +}\n\ +.edit-theme--spearmint .editor {\n\ + background-color: #E1F0EE;\n\ +}\n\ +/* 标题颜色 */\n\ +.edit-theme--spearmint .editor__inner .cn-head,\n\ +.edit-theme--spearmint .editor-in-page-buttons .icon {\n\ + color: #199FA8;\n\ +}\n\ +/* 加粗颜色 */\n\ +.edit-theme--spearmint .editor__inner .cn-strong {\n\ + color: #69ADB5;\n\ +}\n\ +/* 信息块颜色 */\n\ +.edit-theme--spearmint .editor__inner .blockquote {\n\ + color: #25808A;\n\ +}\n\ +/* 源信息、md标记符号等非关键信息的颜色 */\n\ +.edit-theme--spearmint .editor__inner .cl,\n\ +.edit-theme--spearmint .editor__inner .hr,\n\ +.edit-theme--spearmint .editor__inner .link,\n\ +.edit-theme--spearmint .editor__inner .linkref, \n\ +.edit-theme--spearmint .editor__inner .linkdef .url {\n\ + color: rgba(102,128,153,0.6);\n\ +}\n\ +.edit-theme--spearmint .editor__inner .cn-toc, \n\ +.edit-theme--spearmint .editor__inner .code,\n\ +.edit-theme--spearmint .editor__inner .img,\n\ +.edit-theme--spearmint .editor__inner .img-wrapper,\n\ +.edit-theme--spearmint .editor__inner .imgref,\n\ +.edit-theme--spearmint .editor__inner .cl-toc {\n\ + color: rgba(102,128,153,0.6);\n\ + background-color: rgba(102,128,153,0.075);\n\ +}\n\ +/* 代码块颜色 */\n\ +.edit-theme--spearmint .editor__inner .cn-code {\n\ + color: #199FA8;\n\ +}\n\ +/* 链接颜色 */\n\ +.edit-theme--spearmint .editor__inner .img .cl-underlined-text,\n\ +.edit-theme--spearmint .editor__inner .imgref .cl-underlined-text,\n\ +.edit-theme--spearmint .editor__inner .link .cl-underlined-text,\n\ +.edit-theme--spearmint .editor__inner .linkref .cl-underlined-text {\n\ + color: #4CD7E0;\n\ +}\n\ +/* 图片原始链接背景颜色 */\n\ +.edit-theme--spearmint .editor__inner .img-wrapper .img {\n\ + background-color: transparent;\n\ +}\n\ +.edit-theme--spearmint .editor__inner .keyword {\n\ + color: #47596b;\n\ +}\n\ +.edit-theme--spearmint .editor__inner .email,\n\ +.edit-theme--spearmint .editor__inner .cl-title,\n\ +.edit-theme--spearmint .editor__inner .tag,\n\ +.edit-theme--spearmint .editor__inner .latex,\n\ +.edit-theme--spearmint .editor__inner .math,\n\ +.edit-theme--spearmint .editor__inner .entity,\n\ +.edit-theme--spearmint .editor__inner .pre [class*='language-'] {\n\ + color: #719692;\n\ +}"; + document.head.appendChild(style); +} +init_edit_theme_spearmint(); \ No newline at end of file diff --git a/static/themes/preview-theme-activeblue.js b/static/themes/preview-theme-activeblue.js new file mode 100644 index 0000000..6b79f2c --- /dev/null +++ b/static/themes/preview-theme-activeblue.js @@ -0,0 +1,216 @@ +function init_preview_theme_activeblue() { +const style = document.createElement('style'); +style.id = 'preview-theme-activeblue'; +style.type = 'text/css'; +style.innerHTML = "/** activeblue 灵动蓝\n \ +*/\n \ +.preview-theme--activeblue {\n \ + color: #333;\n \ + background-color: #fff;\n \ + font-family: -apple-system,system-ui,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;\n \ +}\n \ +\n \ +/* 标题的通用设置 */\n \ +.preview-theme--activeblue h1,\n \ +.preview-theme--activeblue h2,\n \ +.preview-theme--activeblue h3,\n \ +.preview-theme--activeblue h4,\n \ +.preview-theme--activeblue h5,\n \ +.preview-theme--activeblue h6 {\n \ + padding: 30px 0;\n \ + margin: 0;\n \ + color: #135ce0;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--activeblue h1 {\n \ + position: relative;\n \ + margin-top: 30px;\n \ + margin-bottom: 10px;\n \ + text-align: center;\n \ +}\n \ +\n \ +/* 一级标题前缀,用来放背景图,支持透明度控制 */\n \ +.preview-theme--activeblue h1 .prefix {\n \ + display: inline-block;\n \ + top: 0;\n \ + width: 60px;\n \ + height: 60px;\n \ + background: url(https://imgs.qicoder.com/stackedit/ape_blue.svg);\n \ + background-size: 100% 100%;\n \ + opacity: .12;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--activeblue h1 .content {\n \ + font-size: 22px;\n \ + display: block;\n \ + margin-top: -36px;\n \ +}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--activeblue h2 {\n \ + position: relative;\n \ + font-size: 20px;\n \ +}\n \ +\n \ +/* 二级标题前缀,有兴趣加内容的可以魔改 */\n \ +.preview-theme--activeblue h2 .prefix {\n \ +\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--activeblue h2 .content {\n \ + border-left: 4px solid;\n \ + padding-left: 10px;\n \ +}\n \ +\n \ +/* 一二级标题之间间距控制一下 */\n \ +.preview-theme--activeblue h1 + h2 {\n \ + padding-top: 0;\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--activeblue h3 {\n \ + font-size: 16px;\n \ +}\n \ +\n \ +/* 段落 */\n \ +.preview-theme--activeblue p {\n \ + font-size: 16px;\n \ + line-height: 2;\n \ + font-weight: 400;\n \ +}\n \ +\n \ +/* 段落间距控制 */\n \ +.preview-theme--activeblue p+p {\n \ + margin-top: 16px;\n \ +}\n \ +\n \ +/* 无序列表 */\n \ +.preview-theme--activeblue ul>li ul>li {\n \ + list-style: circle;\n \ +}\n \ +\n \ +/* 无序列表内容行高 */\n \ +.preview-theme--activeblue li section {\n \ + line-height: 2;\n \ +}\n \ +\n \ +/* 引用 */\n \ +.preview-theme--activeblue blockquote {\n \ + border-left-color: #b2aec5 !important;\n \ + background: #fff9f9 !important;\n \ +}\n \ +\n \ +/* 引用文字 */\n \ +.preview-theme--activeblue blockquote p {\n \ + color: #666;\n \ + line-height: 2;\n \ +}\n \ +\n \ +/* 链接 */\n \ +.preview-theme--activeblue a {\n \ + color: #036aca;\n \ + border-bottom: 0;\n \ + font-weight: 400;\n \ + text-decoration: none;\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--activeblue strong {\n \ + background: linear-gradient(to right ,#3299d2,#efbdb5);\n \ + color: #fff;\n \ + font-weight: 400;\n \ + padding: 0 4px;\n \ + display: inline-block;\n \ + border-radius: 4px;\n \ + margin: 0 2px;\n \ + letter-spacing: 1px;\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--activeblue em strong {\n \ + color: #fff;\n \ +}\n \ +\n \ +/* 分隔线 */\n \ +.preview-theme--activeblue hr {\n \ + border-top: 1px solid #135ce0;\n \ +}\n \ +\n \ +/* 图片描述文字,隐藏了,如果需要,请删除display */\n \ +.preview-theme--activeblue figcaption {\n \ + display: none;\n \ + opacity: .6;\n \ + margin-top: 12px;\n \ + font-size: 12px;\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--activeblue p code,\n \ +.preview-theme--activeblue li code,\n \ +.preview-theme--activeblue table code {\n \ + background-color: rgba(0,0,0,.05);\n \ + color: #1394d8;\n \ + padding: 2px 6px;\n \ + word-break: normal;\n \ +}\n \ +\n \ +/* 表格 */\n \ +.preview-theme--activeblue table {\n \ + border-spacing: 0;\n \ +}\n \ +\n \ +/*\n \ +* 表格内的单元格\n \ +*/\n \ +.preview-theme--activeblue table tr th {\n \ + background-color: #d4f1ff;\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--activeblue .footnote-word {\n \ + color: #135ce0;\n \ + font-weight: 400;\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--activeblue .footnote-ref {\n \ + color: #5ba1e2;\n \ + font-weight: 400;\n \ +}\n \ +\n \ +/* 参考资料 */\n \ +.preview-theme--activeblue .footnotes-sep:before {\n \ + text-align: center;\n \ + color: #135ce0;\n \ + content: \"参考\";\n \ +}\n \ +\n \ +/* 参考编号 */\n \ +.preview-theme--activeblue .footnote-num {\n \ + color: #666;\n \ +}\n \ +\n \ +/* 参考文字 */\n \ +.preview-theme--activeblue .footnote-item p { \n \ + color: #999;\n \ + font-weight: 700;\n \ + font-style: italic;\n \ + font-size: 13px;\n \ +}\n \ +\n \ +/* 参考解释 */\n \ +.preview-theme--activeblue .footnote-item p em {\n \ + color: #3375e2;\n \ + font-style: normal;\n \ + margin-left: 4px;\n \ +}\n \ +.preview-theme--activeblue pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_activeblue(); diff --git a/static/themes/preview-theme-allblue.js b/static/themes/preview-theme-allblue.js new file mode 100644 index 0000000..2ddac13 --- /dev/null +++ b/static/themes/preview-theme-allblue.js @@ -0,0 +1,426 @@ +function init_preview_theme_allblue() { +const style = document.createElement('style'); +style.id = 'preview-theme-allblue'; +style.type = 'text/css'; +style.innerHTML = "/* 全栈蓝 */\n \ +\n \ +/* 全局属性\n \ +*/\n \ +.preview-theme--allblue {\n \ +line-height: 1.25;\n \ +color: #2b2b2b;\n \ +background-color: #fff;\n \ +font-family: Optima-Regular, Optima, PingFangTC-Light, PingFangSC-light, PingFangTC-light;\n \ +letter-spacing: 2px;\n \ +background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.04) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.04) 3%, rgba(0, 0, 0, 0) 3%);\n \ +background-size: 20px 20px;\n \ +background-position: center;\n \ +}\n \ +\n \ +/* 段落\n \ +*/\n \ +.preview-theme--allblue p {\n \ +color: #2b2b2b;\n \ +margin: 10px 0px;\n \ +letter-spacing: 2px;\n \ +font-size: 14px;\n \ +word-spacing: 2px;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--allblue h1 {\n \ +font-size: 25px;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--allblue h1 span {\n \ +display: inline-block;\n \ +font-weight: bold;\n \ +color: #40B8FA;\n \ +}\n \ +\n \ +/* 一级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--allblue h1:after {\n \ +position: unset;\n \ +display: unset;\n \ +border-bottom: unset;\n \ +}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--allblue h2 {\n \ +display:block;\n \ +border-bottom: 4px solid #40B8FA;\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--allblue h2 .content {\n \ +display: flex;\n \ +color: #40B8FA;\n \ +font-size: 20px;\n \ +margin-left: 25px;\n \ +}\n \ +\n \ +/* 二级标题前缀 */\n \ +.preview-theme--allblue h2 .prefix {\n \ +display: flex;\n \ +width: 20px;\n \ +height: 20px;\n \ +background-size: 20px 20px;\n \ +background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB00lEQVRYCe1Xy23DMAz1BB2jA+TSU2EBmSMzeIUM4WuHyKXWoWeP02sdS4CLJ4YW5ciKDUdICySAAMn68PHxiVSK4vn7Swy8fQ4vpbYH1ZyPORrOho2oz6r5UaU230r3Q84GG/uv4fUKhNKmJQC2BpgsTXcVbJTanAIAQASvS91/BBMZBjAOWwELzltQ35yPsElawEJbc8zQlwBpbE7Yuwan05azJfZNAYzjy8JwTCC9Tkx7dwDwGppAYwbg/XQ8K6gEokUMJPZvnooD0F1FlMJrW+dtsIGr3lWjNxj4mObNA96OAOCyn0Nl63fd73I2YhdX3h48A0g8TvGk8HEiQyeugf8MAJlNJqhbpN2VAdbOVW5PoFgNwNUJlGdt2iB/F0VBySkUFATMekJ/imUxAHjHhYOuTgwAlW/OljBGhY3vOsAhRF7xiwDI3A8vY57coh97mCFihIrPIgDwhAxIT8JSzexI75juwLB7Z6xkgA9iIGxMagBeoRhJ+rEe7NHDxrToy7NoHnpC6RdzI+WX98B0Ex8sv5OXIp3KyUR/cQgSZ2yaigIg5YLSMM6bLM1sjoXTLcU9p9g94FEKBF48ectx8hUFRbvr94g/JjMhe37OzsAvpzCHV7lWaToAAAAASUVORK5CYII=);\n \ +margin-bottom: -22px;\n \ +}\n \ +\n \ +/* 二级标题后缀 */\n \ +.preview-theme--allblue h2 .suffix {\n \ +display: flex;\n \ +box-sizing: border-box;\n \ +width: 200px;\n \ +height: 10px;\n \ +border-top-left-radius: 20px;\n \ +background: RGBA(64, 184, 250, .5);\n \ +color: rgb(255, 255, 255);\n \ +font-size: 16px;\n \ +letter-spacing: 0.544px;\n \ +justify-content: flex-end;\n \ +box-sizing: border-box !important;\n \ +overflow-wrap: break-word !important;\n \ +float: right;\n \ +margin-top: -10px;\n \ +}\n \ +\n \ +.preview-theme--allblue h2:after {\n \ +position: unset;\n \ +display: unset;\n \ +border-bottom: unset;\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--allblue h3 {\n \ +font-size: 17px;\n \ +font-weight: bold;\n \ +text-align: center;\n \ +position:relative;\n \ +margin-top: 20px;\n \ +margin-bottom: 20px;\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--allblue h3 .content {\n \ +border-bottom: 2px solid RGBA(79, 177, 249, .65);\n \ +color: #2b2b2b;\n \ +padding-bottom:2px\n \ +}\n \ +\n \ +.preview-theme--allblue h3 .content:before{\n \ +content:'';\n \ +width:30px;\n \ +height:30px;\n \ +display:block;\n \ +background-position:center;\n \ +background-size:30px;\n \ +margin:auto;\n \ +opacity:1;\n \ +background-repeat:no-repeat;\n \ +margin-bottom:-8px;\n \ +}\n \ +\n \ +/* 三级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--allblue h3:after {}\n \ +\n \ +.preview-theme--allblue h4 .content {\n \ +height:16px;\n \ +line-height:16px;\n \ +font-size: 16px;\n \ +}\n \ +\n \ +.preview-theme--allblue h4 .content:before{\n \ +content:'';\n \ +background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABXElEQVRYCe1WsRHCMAzMVHRcvAcz0KekZQ92iNMwCzPQ2SngxJ2MbMm2RCjDHRdb+X/L8kfJMOy/vQIbK3D08eB8fOF/o5yd7pZwwsWdX+92hY2M0YdrSmBZp41ydjrsGhOA47ArNBhuDhcU/1zncCnhzocHYuCehlNqiHONEDXg6OMThTRcxIpXrcC4xDPuvjSgVoMlYCG6Od5SAoIBLVqfRKwEjQHVmmogqRmcO1aAhNmwq90FMMlhoAaEJ0GAZKHqGtUbGZ1PMt4cbxzBIxkH2jc81mKQc1kkM6DQHxih1SN+SYI2IE0H7K7RBRRbQvPRBlRA0lStrQXmBmy/AbWapmzdsk5YAfBCIhcD8+LI7xFpA4J2jDx67WlQrDhuCdAGJBmwxRUXqwVrQqn8QgOqcWprmOMWA5rFNQRqQPgc03D+iqEGhA/Sv4prxL7nH1+SATUaO2avAK3AG91vsolsvFjsAAAAAElFTkSuQmCC);\n \ +display:inline-block;\n \ +width:16px;\n \ +height:16px;\n \ +background-size:100% ;\n \ +background-position:left bottom;\n \ +background-repeat:no-repeat;\n \ +width: 16px;\n \ +height: 15px;\n \ +line-height:15px;\n \ +margin-right:6px;\n \ +margin-bottom:-2px;\n \ +}\n \ +\n \ +/* 无序列表整体样式\n \ +* list-style-type: square|circle|disc;\n \ +*/\n \ +.preview-theme--allblue ul {\n \ +font-size: 15px; /*神奇逻辑,必须比li section的字体大才会在二级中生效*/\n \ +color: #595959;\n \ +list-style-type: circle;\n \ +}\n \ +\n \ +\n \ +/* 有序列表整体样式\n \ +* list-style-type: upper-roman|lower-greek|lower-alpha;\n \ +*/\n \ +.preview-theme--allblue ol {\n \ +font-size: 15px;\n \ +color: #595959;\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ +*/\n \ +.preview-theme--allblue li section {\n \ +font-size: 14px;\n \ +font-weight: normal;\n \ +color: #595959;\n \ +}\n \ +\n \ +/* 引用\n \ +* 左边缘颜色 border-left-color:black;\n \ +* 背景色 background:gray;\n \ +*/\n \ +.preview-theme--allblue blockquote::before {\n \ +content: \"❝\";\n \ +color: RGBA(64, 184, 250, .5);\n \ +font-size: 34px;\n \ +line-height: 1;\n \ +font-weight: 700;\n \ +}\n \ +\n \ +.preview-theme--allblue blockquote {\n \ +text-size-adjust: 100%;\n \ +line-height: 1.55em;\n \ +font-weight: 400;\n \ +border-radius: 6px;\n \ +color: #595959 !important;\n \ +font-style: normal;\n \ +text-align: left;\n \ +box-sizing: inherit;\n \ +border-left: none;\n \ +padding-bottom: 25px;\n \ +border: 1px solid RGBA(64, 184, 250, .4) !important;\n \ +background: RGBA(64, 184, 250, .1) !important;\n \ +}\n \ +\n \ +.preview-theme--allblue blockquote p {\n \ +color: #595959;\n \ +margin: 0px;\n \ +}\n \ +\n \ +.preview-theme--allblue blockquote::after {\n \ +content: \"❞\";\n \ +float: right;\n \ +line-height: 1;\n \ +color: RGBA(64, 184, 250, .5);\n \ +}\n \ +\n \ +/* 链接\n \ +* border-bottom: 1px solid #009688;\n \ +*/\n \ +.preview-theme--allblue a {\n \ +color: #40B8FA;\n \ +font-weight: normal;\n \ +border-bottom: 1px solid #3BAAFA;\n \ +}\n \ +\n \ +.preview-theme--allblue strong::before {\n \ +content: '「';\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--allblue strong {\n \ +color: #3594F7;\n \ +font-weight: bold;\n \ +}\n \ +\n \ +.preview-theme--allblue strong::after {\n \ +content: '」';\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--allblue em {\n \ +font-style: normal;\n \ +color: #3594F7;\n \ +font-weight:bold;\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--allblue em strong {\n \ +color: #3594F7;\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--allblue s {\n \ +color: #3594F7;\n \ +}\n \ +\n \ +/* 分隔线\n \ +* 粗细、样式和颜色\n \ +* border-top:1px solid #3e3e3e;\n \ +*/\n \ +.preview-theme--allblue hr {\n \ +height: 1px;\n \ +padding: 0;\n \ +border: none;\n \ +border-top: 2px solid #3BAAFA;\n \ +}\n \ +\n \ +/* 图片\n \ +* 宽度 width:80%;\n \ +* 居中 margin:0 auto;\n \ +* 居左 margin:0 0;\n \ +*/\n \ +.preview-theme--allblue img {\n \ +border-radius: 6px;\n \ +display: block;\n \ +margin: 20px auto;\n \ +object-fit: contain;\n \ +box-shadow:2px 4px 7px #999;\n \ +}\n \ +\n \ +/* 图片描述文字 */\n \ +.preview-theme--allblue figcaption {\n \ +text-align: center;\n \ +display: block;\n \ +font-size: 13px;\n \ +color: #2b2b2b;\n \ +}\n \ +\n \ +.preview-theme--allblue figcaption:before{\n \ +content:'';\n \ +background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAGFBMVEVHcExAuPtAuPpAuPtAuPpAuPtAvPxAuPokzOX5AAAAB3RSTlMAkDLqNegkoiUM7wAAAGBJREFUKM9jYBhcgMkBTUDVBE1BeDGqEtXychNUBeXlKEqACsrLQxB8lnCQQClCiWt5OYoSiAIkJVAF5eVBqAqAShTAAs7l5ShKWMwRAmAlSArASpAVgJUkCqIAscESHwCVVjMBK9JnbQAAAABJRU5ErkJggg==);\n \ +display:inline-block;\n \ +width:18px;\n \ +height:18px;\n \ +background-size:18px;\n \ +background-repeat:no-repeat;\n \ +background-position:center;\n \ +margin-right:5px;\n \ +margin-bottom:-5px;\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--allblue p code,\n \ +.preview-theme--allblue li code {\n \ +color: #3594F7;\n \ +background: RGBA(59, 170, 250, .1);\n \ +padding:0 2px;\n \ +border-radius:2px;\n \ +height:21px;\n \ +line-height:22px;\n \ +}\n \ +\n \ +/* 非微信代码块\n \ +* 代码块不换行 display:-webkit-box !important;\n \ +* 代码块换行 display:block;\n \ +*/\n \ +.preview-theme--allblue .code-snippet__fix {\n \ +background: #f7f7f7;\n \ +border-radius: 2px;\n \ +}\n \ +\n \ +.preview-theme--allblue pre code {\n \ +letter-spacing: 0px;\n \ +}\n \ +\n \ +/*\n \ +* 表格内的单元格\n \ +* 字体大小 font-size: 16px;\n \ +* 边框 border: 1px solid #ccc;\n \ +* 内边距 padding: 5px 10px;\n \ +*/\n \ +.preview-theme--allblue table tr th,\n \ +.preview-theme--allblue table tr td {\n \ +font-size: 14px;\n \ +color: #595959;\n \ +}\n \ +\n \ +.preview-theme--allblue .footnotes {\n \ +background: #F6EEFF;\n \ +padding: 20px 20px 20px 20px;\n \ +font-size: 14px;\n \ +border: 0.8px solid #DEC6FB;\n \ +border-radius: 6px;\n \ +border: 1px solid #DEC6FB;\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--allblue .footnote-word {\n \ +font-weight: normal;\n \ +color: #595959;\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--allblue .footnote-ref {\n \ +font-weight: normal;\n \ +color: #595959;\n \ +}\n \ +\n \ +/*脚注链接样式*/\n \ +.preview-theme--allblue .footnote-item em {\n \ +font-size: 14px;\n \ +color: #595959;\n \ +display: block;\n \ +}\n \ +\n \ +.preview-theme--allblue .footnotes{\n \ +background: RGBA(53, 148, 247, .4);\n \ +padding: 20px 20px 20px 20px;\n \ +font-size: 14px;\n \ +border-radius: 6px;\n \ +border: 1px solid RGBA(53, 148, 247, 1);\n \ +}\n \ +\n \ +.preview-theme--allblue .footnotes-sep {\n \ +border-top: unset;\n \ +}\n \ +\n \ +/* \"参考资料\"四个字\n \ +* 内容 content: \"参考资料\";\n \ +*/\n \ +.preview-theme--allblue .footnotes-sep:before {\n \ +content: 'Reference';\n \ +color: #595959;\n \ +letter-spacing: 1px;\n \ +border-bottom: 2px solid RGBA(64, 184, 250, 1);\n \ +display: inline;\n \ +background: linear-gradient(white 60%, RGBA(64, 184, 250, .4) 40%);\n \ +font-size: 20px;\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--allblue .footnote-num {}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--allblue .footnote-item p {\n \ +color: #595959;\n \ +font-weight: bold;\n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--allblue .footnote-item p em {\n \ +font-weight: normal;\n \ +}\n \ +\n \ +/* 行间公式\n \ +* 最大宽度 max-width: 300% !important;\n \ +*/\n \ +.preview-theme--allblue .katex--display svg {}\n \ +\n \ +/* 行内公式\n \ +*/\n \ +.preview-theme--allblue .katex--inline svg {}\n \ +\n \ +/* \n \ + */\n \ +.preview-theme--allblue pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}\n \ +\n \ +.preview-theme--allblue .language-mermaid {\n \ +letter-spacing: 0;\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_allblue(); diff --git a/static/themes/preview-theme-caoyuangreen.js b/static/themes/preview-theme-caoyuangreen.js new file mode 100644 index 0000000..6b49abd --- /dev/null +++ b/static/themes/preview-theme-caoyuangreen.js @@ -0,0 +1,382 @@ +function init_preview_theme_caoyuangreen() { +const style = document.createElement('style'); +style.id = 'preview-theme-caoyuangreen'; +style.type = 'text/css'; +style.innerHTML = "/* 草原绿 caoyuangreen\n \ +*/\n \ +.preview-theme--caoyuangreen {\n \ + line-height: 1.35;\n \ + color: #333;\n \ + background-color: #fff;\n \ + font-family: Optima-Regular, PingFangTC-light;\n \ + letter-spacing: 1.5px;\n \ +}\n \ +\n \ +/* 段落,下方未标注标签参数均同此处\n \ +*/\n \ +.preview-theme--caoyuangreen p {\n \ + color: #2b2b2b;\n \ + margin: 10px 0px;\n \ + letter-spacing: 2px;\n \ + font-size: 16px;\n \ + word-spacing: 2px;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--caoyuangreen h1 {\n \ + font-size: 25px;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--caoyuangreen h1 span {\n \ + display: inline-block;\n \ + font-weight: bold;\n \ + color: #4CAF50;\n \ +}\n \ +\n \ +/* 一级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--caoyuangreen h1:after {}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--caoyuangreen h2 {\n \ + display:block;\n \ + border-bottom: 4px solid #4CAF50;\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--caoyuangreen h2 .content {\n \ + display: flex;\n \ + color: #4CAF50;\n \ + font-size: 20px;\n \ +\n \ +}\n \ +\n \ +/* 二级标题前缀 */\n \ +.preview-theme--caoyuangreen h2 .prefix {\n \ +\n \ +}\n \ +\n \ +/* 二级标题后缀 */\n \ +.preview-theme--caoyuangreen h2 .suffix {\n \ + display: flex;\n \ + box-sizing: border-box;\n \ + width: 20px;\n \ + height: 10px;\n \ + border-top-left-radius: 20px;\n \ + border-top-right-radius: 20px;\n \ + background: RGBA(76, 175, 80, .5);\n \ + color: rgb(255, 255, 255);\n \ + font-size: 16px;\n \ + letter-spacing: 0.544px;\n \ + justify-content: flex-end;\n \ + box-sizing: border-box !important;\n \ + overflow-wrap: break-word !important;\n \ + float: right;\n \ + margin-top: -10px;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen h1:after, .preview-theme--caoyuangreen h2:after {\n \ + border-bottom: unset;\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--caoyuangreen h3 {\n \ + font-size: 17px;\n \ + font-weight: bold;\n \ + text-align: center;\n \ + position:relative;\n \ + margin-top: 20px;\n \ + margin-bottom: 20px;\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--caoyuangreen h3 .content {\n \ + color: #2b2b2b;\n \ + padding-bottom:2px\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen h3 .content:before{\n \ + content:'';\n \ + width:30px;\n \ + height:30px;\n \ + display:block;\n \ + background-image:url(https://imgs.qicoder.com/stackedit/grass-green.png);\n \ + background-position:center;\n \ + background-size:30px;\n \ + margin:auto;\n \ + opacity:1;\n \ + background-repeat:no-repeat;\n \ + margin-bottom:-8px;\n \ +}\n \ +\n \ +/* 三级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--caoyuangreen h3:after {}\n \ +\n \ +.preview-theme--caoyuangreen h4 .content {\n \ + height:16px;\n \ + line-height:16px;\n \ + font-size: 16px;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen h4 .content:before{\n \ +\n \ +}\n \ +\n \ +/* 无序列表整体样式\n \ +* list-style-type: square|circle|disc;\n \ +*/\n \ +.preview-theme--caoyuangreen ul {\n \ + font-size: 15px; /*神奇逻辑,必须比li section的字体大才会在二级中生效*/\n \ + color: #595959;\n \ + list-style-type: circle;\n \ +}\n \ +\n \ +\n \ +/* 有序列表整体样式\n \ +* list-style-type: upper-roman|lower-greek|lower-alpha;\n \ +*/\n \ +.preview-theme--caoyuangreen ol {\n \ + font-size: 15px;\n \ + color: #595959;\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ +*/\n \ +.preview-theme--caoyuangreen li section {\n \ + font-size: 16px;\n \ + font-weight: normal;\n \ + color: #595959;\n \ +}\n \ +\n \ +/* 引用\n \ +* 左边缘颜色 border-left-color:black;\n \ +* 背景色 background:gray;\n \ +*/\n \ +.preview-theme--caoyuangreen blockquote::before {\n \ + content: \"❝\";\n \ + color: #74b56d;\n \ + font-size: 34px;\n \ + line-height: 1;\n \ + font-weight: 700;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen blockquote {\n \ + text-size-adjust: 100%;\n \ + line-height: 1.55em;\n \ + font-weight: 400;\n \ + border-radius: 6px;\n \ + color: #595959 !important;\n \ + font-style: normal;\n \ + text-align: left;\n \ + box-sizing: inherit;\n \ + padding-bottom: 25px;\n \ + border-left: none !important;\n \ + border: 1px solid #1b900d !important;\n \ + background: #fff !important;\n \ +\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen blockquote p {\n \ + margin: 0px;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen blockquote::after {\n \ + content: \"❞\";\n \ + float: right;\n \ + color: #74b56d;\n \ +}\n \ +\n \ +/* 链接\n \ +* border-bottom: 1px solid #009688;\n \ +*/\n \ +.preview-theme--caoyuangreen a {\n \ + color: #399003;\n \ + font-weight: normal;\n \ + border-bottom: 1px solid #399003;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen strong::before {\n \ + content: '「';\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--caoyuangreen strong {\n \ + color: #399003;\n \ + font-weight: bold;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen strong::after {\n \ + content: '」';\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--caoyuangreen em {\n \ + font-style: normal;\n \ + color: #399003;\n \ + font-weight:bold;\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--caoyuangreen em strong {\n \ + color: #399003;\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--caoyuangreen del {\n \ + color: #399003;\n \ +}\n \ +\n \ +/* 分隔线\n \ +* 粗细、样式和颜色\n \ +* border-top:1px solid #3e3e3e;\n \ +*/\n \ +.preview-theme--caoyuangreen hr {\n \ + height: 1px;\n \ + padding: 0;\n \ + border: none;\n \ + border-top: 2px solid #399003;\n \ +}\n \ +\n \ +/* 图片\n \ +* 宽度 width:80%;\n \ +* 居中 margin:0 auto;\n \ +* 居左 margin:0 0;\n \ +*/\n \ +.preview-theme--caoyuangreen img {\n \ + border-radius: 6px;\n \ + display: block;\n \ + margin: 20px auto;\n \ + object-fit: contain;\n \ + box-shadow:2px 4px 7px #999;\n \ +}\n \ +\n \ +/* 图片描述文字 */\n \ +.preview-theme--caoyuangreen figcaption {\n \ + display: block;\n \ + font-size: 13px;\n \ + color: #2b2b2b;\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--caoyuangreen p code,\n \ +.preview-theme--caoyuangreen li code,\n \ +.preview-theme--caoyuangreen table code {\n \ + color: #0bb712;\n \ + background: rgba(127, 226, 159, 0.48);\n \ + display:inline-block;\n \ + padding:0 2px;\n \ + border-radius:2px;\n \ + height:21px;\n \ + line-height:22px;\n \ +}\n \ +\n \ +/* 非微信代码块\n \ +* 代码块不换行 display:-webkit-box !important;\n \ +* 代码块换行 display:block;\n \ +*/\n \ +.preview-theme--caoyuangreen .code-snippet__fix {\n \ + background: #f7f7f7;\n \ + border-radius: 2px;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen pre code {\n \ + letter-spacing: 0px;\n \ +}\n \ +\n \ +/*\n \ +* 表格内的单元格\n \ +* 字体大小 font-size: 16px;\n \ +* 边框 border: 1px solid #ccc;\n \ +* 内边距 padding: 5px 10px;\n \ +*/\n \ +.preview-theme--caoyuangreen table tr th,\n \ +.preview-theme--caoyuangreen table tr td {\n \ + font-size: 16px;\n \ + color: #595959;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen .footnotes {\n \ + background: #F6EEFF;\n \ + padding: 20px 20px 20px 20px;\n \ + font-size: 16px;\n \ + border: 0.8px solid #399003;\n \ + border-radius: 6px;\n \ + border: 1px solid #399003;\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--caoyuangreen .footnote-word {\n \ + font-weight: normal;\n \ + color: #595959;\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--caoyuangreen .footnote-ref {\n \ + font-weight: normal;\n \ + color: #595959;\n \ +}\n \ +\n \ +/*脚注链接样式*/\n \ +.preview-theme--caoyuangreen .footnote-item em {\n \ + font-size: 16px;\n \ + color: #595959;\n \ + display: block;\n \ +}\n \ +\n \ +.preview-theme--caoyuangreen .footnotes{\n \ + background: #fff;\n \ + padding: 20px 20px 20px 20px;\n \ + font-size: 16px;\n \ + border-radius: 6px;\n \ + border: 1px solid #4CAF50;\n \ +}\n \ +\n \ +/* \"参考资料\"四个字\n \ +* 内容 content: \"参考资料\";\n \ +*/\n \ +.preview-theme--caoyuangreen .footnotes-sep:before {\n \ + content: 'Reference';\n \ + color: #595959;\n \ + letter-spacing: 1px;\n \ + border-bottom: 2px solid #4CAF50;\n \ + display: inline;\n \ + font-size: 20px;\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--caoyuangreen .footnote-num {}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--caoyuangreen .footnote-item p {\n \ + color: #595959;\n \ + font-weight: bold;\n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--caoyuangreen .footnote-item p em {\n \ + font-weight: normal;\n \ +}\n \ +\n \ +/* 行间公式\n \ +* 最大宽度 max-width: 300% !important;\n \ +*/\n \ +.preview-theme--caoyuangreen .block-equation svg {}\n \ +\n \ +/* 行内公式\n \ +*/\n \ +.preview-theme--caoyuangreen .inline-equation svg {}\n \ +\n \ +/* 滑动图片\n \ + */\n \ +.preview-theme--caoyuangreen .imageflow-img {\n \ + display: inline-block;\n \ + width:100%;\n \ + margin-bottom: 0;\n \ +}\n \ +.preview-theme--caoyuangreen pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_caoyuangreen(); diff --git a/static/themes/preview-theme-jikebrack.js b/static/themes/preview-theme-jikebrack.js new file mode 100644 index 0000000..b5f0640 --- /dev/null +++ b/static/themes/preview-theme-jikebrack.js @@ -0,0 +1,273 @@ +function init_preview_theme_jikebrack() { +const style = document.createElement('style'); +style.id = 'preview-theme-jikebrack'; +style.type = 'text/css'; +style.innerHTML = "/*极客黑样式,实时生效*/\n \ +\n \ +/* 全局属性\n \ + */\n \ +.preview-theme--jikebrack {\n \ +color: #2b2b2b;\n \ +background-color: #fff;\n \ +}\n \ +\n \ +/* 段落\n \ + */\n \ +.preview-theme--jikebrack p {\n \ +box-sizing: border-box;\n \ +margin-bottom: 16px;\n \ +font-family: \"Helvetica Neue\", Helvetica, \"Segoe UI\", Arial, freesans, sans-serif;\n \ +font-size: 15px;\n \ +text-align: start;\n \ +white-space: normal;\n \ +text-size-adjust: auto;\n \ +line-height: 1.75em;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--jikebrack h1 {\n \ +margin-top: -0.46em;\n \ +margin-bottom: 0.1em;\n \ +border-bottom: 2px solid rgb(198, 196, 196);\n \ +box-sizing: border-box;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--jikebrack h1 .content {\n \ +padding-top: 5px;\n \ +padding-bottom: 5px;\n \ +color: rgb(160, 160, 160);\n \ +font-size: 13px;\n \ +line-height: 2;\n \ +box-sizing: border-box;\n \ +}\n \ +\n \ +/* 一级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--jikebrack h1:after {\n \ +}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--jikebrack h2 {\n \ +margin: 10px auto;\n \ +height: 40px;\n \ +background-color: rgb(251, 251, 251);\n \ +border-bottom: 1px solid rgb(246, 246, 246);\n \ +overflow: hidden;\n \ +box-sizing: border-box;\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--jikebrack h2 .content {\n \ +margin-left: -10px;\n \ +display: inline-block;\n \ +width: auto;\n \ +height: 40px;\n \ +background-color: rgb(33, 33, 34);\n \ +border-bottom-right-radius:100px;\n \ +color: rgb(255, 255, 255);\n \ +padding-right: 30px;\n \ +padding-left: 30px;\n \ +line-height: 40px;\n \ +font-size: 16px;\n \ +}\n \ +\n \ +/* 二级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--jikebrack h2:after {\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--jikebrack h3 {\n \ +margin: 20px auto 5px;\n \ +border-top: 1px solid rgb(221, 221, 221);\n \ +box-sizing: border-box;\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--jikebrack h3 .content {\n \ +margin-top: -1px;\n \ +padding-top: 6px;\n \ +padding-right: 5px;\n \ +padding-left: 5px;\n \ +font-size: 17px;\n \ +border-top: 2px solid rgb(33, 33, 34);\n \ +display: inline-block;\n \ +line-height: 1.1;\n \ +}\n \ +\n \ +/* 三级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--jikebrack h3:after {\n \ +}\n \ +\n \ +.preview-theme--jikebrack h4 {\n \ +margin: 10px auto -1px;\n \ +border-top: 1px solid rgb(221, 221, 221);\n \ +box-sizing: border-box;\n \ +}\n \ +\n \ +.preview-theme--jikebrack h4 .content {\n \ +margin-top: -1px;\n \ +padding-top: 6px;\n \ +padding-right: 5px;\n \ +padding-left: 5px;\n \ +font-size: 16px;\n \ +border-top: 2px solid rgb(33, 33, 34);\n \ +display: inline-block;\n \ +line-height: 1.1;\n \ +}\n \ +\n \ +/* 无序列表整体样式\n \ + * list-style-type: square|circle|disc;\n \ + */\n \ +.preview-theme--jikebrack ul {\n \ +}\n \ +\n \ +/* 有序列表整体样式\n \ + * list-style-type: upper-roman|lower-greek|lower-alpha;\n \ + */\n \ +.preview-theme--jikebrack ol {\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ + */\n \ +.preview-theme--jikebrack li section {\n \ +font-size: 15px;\n \ +font-family: \"Helvetica Neue\", Helvetica, \"Segoe UI\", Arial, freesans, sans-serif;\n \ +}\n \ +\n \ +/* 引用\n \ + * 左边缘颜色 border-left-color: black;\n \ + * 背景色 background: gray;\n \ + */\n \ +.preview-theme--jikebrack blockquote {\n \ +border-left-color: rgb(221, 221, 221) !important;\n \ +margin-top: 1.2em;\n \ +margin-bottom: 1.2em;\n \ +padding-right: 1em;\n \ +padding-left: 1em;\n \ +border-left-width: 4px;\n \ +color: rgb(119, 119, 119) !important;\n \ +quotes: none;\n \ +background: rgba(0, 0, 0, 0.05) !important;\n \ +}\n \ +\n \ +/* 引用文字 */\n \ +.preview-theme--jikebrack blockquote p {\n \ +margin: 0px;\n \ +font-size: 15px;\n \ +font-family: -apple-system-font, BlinkMacSystemFont, \"Helvetica Neue\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei UI\", \"Microsoft YaHei\", Arial, sans-serif;\n \ +color: rgb(119, 119, 119);\n \ +line-height: 1.75em;\n \ +}\n \ +\n \ +/* 链接 \n \ + * border-bottom: 1px solid #009688;\n \ + */\n \ +.preview-theme--jikebrack a {\n \ +color: rgb(239, 112, 96);\n \ +border-bottom: 1px solid rgb(239, 112, 96);\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--jikebrack strong {\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--jikebrack em {\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--jikebrack em strong {\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--jikebrack s {\n \ +}\n \ +\n \ +/* 分隔线\n \ + * 粗细、样式和颜色\n \ + * border-top: 1px solid #3e3e3e;\n \ + */\n \ +.preview-theme--jikebrack hr {\n \ +}\n \ +\n \ +/* 图片\n \ + * 宽度 width: 80%;\n \ + * 居中 margin: 0 auto;\n \ + * 居左 margin: 0 0;\n \ + */\n \ +.preview-theme--jikebrack img {\n \ +}\n \ +\n \ +/* 图片描述文字 */\n \ +.preview-theme--jikebrack figcaption {\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--jikebrack p code,.preview-theme--jikebrack li code {\n \ +color: rgb(239, 112, 96) !important;\n \ +background-color: rgba(27,31,35,.05) !important;\n \ +}\n \ +\n \ +/* 非微信代码块\n \ + * 代码块不换行 display: -webkit-box !important;\n \ + * 代码块换行 display: block;\n \ + */\n \ +.preview-theme--jikebrack pre code {\n \ +}\n \ +\n \ +/*\n \ + * 表格内的单元格\n \ + * 字体大小 font-size: 16px;\n \ + * 边框 border: 1px solid #ccc;\n \ + * 内边距 padding: 5px 10px;\n \ + */\n \ +.preview-theme--jikebrack table tr th,\n \ +.preview-theme--jikebrack table tr td {\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--jikebrack .footnote-word {\n \ +color: #ff3502;\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--jikebrack .footnote-ref {\n \ +color: rgb(239, 112, 96);\n \ +}\n \ +\n \ +/* \"参考资料\"四个字 \n \ + * 内容 content: \"参考资料\";\n \ + */\n \ +.preview-theme--jikebrack .footnotes-sep:before {\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--jikebrack .footnote-num {\n \ +}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--jikebrack .footnote-item p { \n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--jikebrack .footnote-item p em {\n \ +}\n \ +\n \ +/* 行间公式\n \ + * 最大宽度 max-width: 300% !important;\n \ + */\n \ +.preview-theme--jikebrack .block-equation svg {\n \ +}\n \ +\n \ +/* 行内公式\n \ + */\n \ +.preview-theme--jikebrack .inline-equation svg {\n \ +}\n \ +\n \ +.preview-theme--jikebrack pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_jikebrack(); diff --git a/static/themes/preview-theme-ningyezi.js b/static/themes/preview-theme-ningyezi.js new file mode 100644 index 0000000..6739277 --- /dev/null +++ b/static/themes/preview-theme-ningyezi.js @@ -0,0 +1,269 @@ +function init_preview_theme_ningyezi() { +const style = document.createElement('style'); +style.id = 'preview-theme-ningyezi'; +style.type = 'text/css'; +style.innerHTML = "/*凝夜紫 ningyezi\n \ +*/\n \ +.preview-theme--ningyezi {\n \ + line-height: 1.5;\n \ + font-family: Optima-Regular, Optima, PingFangTC-Light, PingFangSC-light, PingFangTC-light;\n \ + letter-spacing: 2px;\n \ + color: #2b2b2b;\n \ + background-color: #fff;\n \ + background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%);\n \ + background-size: 20px 20px;\n \ + background-position: center center;\n \ +}\n \ +\n \ +/* 段落,下方未标注标签参数均同此处\n \ + */\n \ +.preview-theme--ningyezi p {\n \ + margin: 10px 0px;\n \ + letter-spacing: 2px;\n \ + font-size: 14px;\n \ + word-spacing: 2px;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--ningyezi h1 {\n \ + font-size: 25px;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--ningyezi h1 .content {\n \ + display: inline-block;\n \ + font-weight: bold;\n \ + color: #773098;\n \ +}\n \ +\n \ +/* 一级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--ningyezi h1:after {}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--ningyezi h2 {\n \ + text-align: left;\n \ + margin: 20px 10px 0px 0px;\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--ningyezi h2 .content {\n \ + font-size: 18px;\n \ + font-weight: bold;\n \ + display: inline-block;\n \ + padding-left: 10px;\n \ + border-left: 5px solid #916dd5;\n \ +}\n \ +\n \ +/* 二级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--ningyezi h2:after {}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--ningyezi h3 {\n \ + font-size: 16px;\n \ + font-weight: bold;\n \ + text-align: center;\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--ningyezi h3 .content {\n \ + border-bottom: 2px solid #d89cf6;\n \ +}\n \ +\n \ +/* 三级标题修饰 请参考有实例的主题 */\n \ +.preview-theme--ningyezi h3:after {}\n \ +\n \ +/* 无序列表整体样式\n \ + * list-style-type: square|circle|disc;\n \ + */\n \ +.preview-theme--ningyezi ul {\n \ + font-size: 15px;\n \ + /*神奇逻辑,必须比li section的字体大才会在二级中生效*/\n \ + list-style-type: circle;\n \ +}\n \ +\n \ +\n \ +/* 有序列表整体样式\n \ + * list-style-type: upper-roman|lower-greek|lower-alpha;\n \ + */\n \ +.preview-theme--ningyezi ol {\n \ + font-size: 15px;\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ + */\n \ +.preview-theme--ningyezi li section {\n \ + font-size: 14px;\n \ + font-weight: normal;\n \ +}\n \ +\n \ +/* 引用\n \ + * 左边缘颜色 border-left-color:black;\n \ + * 背景色 background:gray;\n \ + */\n \ +.preview-theme--ningyezi blockquote {\n \ + color: rgba(0,0,0,0.5) !important;\n \ + border-left-color: #d89cf6 !important;\n \ + background: #f4eeff !important;\n \ +}\n \ +\n \ +/* 链接 \n \ + * border-bottom: 1px solid #009688;\n \ + */\n \ +.preview-theme--ningyezi a {\n \ + color: #916dd5;\n \ + font-weight: bolder;\n \ + border-bottom: 1px solid #916dd5;\n \ +}\n \ +\n \ +.preview-theme--ningyezi strong::before {\n \ + content: '「';\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--ningyezi strong {\n \ + color: #916dd5;\n \ + font-weight: bold;\n \ +}\n \ +\n \ +.preview-theme--ningyezi strong::after {\n \ + content: '」';\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--ningyezi em {\n \ + font-style: normal;\n \ + color: #916dd5;\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--ningyezi em strong {\n \ + color: #916dd5;\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--ningyezi del {\n \ + color: #916dd5;\n \ +}\n \ +\n \ +/* 分隔线\n \ + * 粗细、样式和颜色\n \ + */\n \ +.preview-theme--ningyezi hr {\n \ + height: 1px;\n \ + padding: 0;\n \ + border: none;\n \ + border-top: 2px solid #d9b8fa;\n \ +}\n \ +\n \ +/* 图片\n \ + * 宽度 width:80%;\n \ + * 居中 margin:0 auto;\n \ + * 居左 margin:0 0;\n \ + */\n \ +.preview-theme--ningyezi img {\n \ + border-radius: 6px;\n \ + display: block;\n \ + margin: 20px auto;\n \ + object-fit: contain;\n \ + box-shadow: 2px 4px 7px #999;\n \ +}\n \ +\n \ +/* 图片描述文字 */\n \ +.preview-theme--ningyezi figcaption {\n \ + display: block;\n \ + font-size: 13px;\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--ningyezi p code,\n \ +.preview-theme--ningyezi li code,\n \ +.preview-theme--ningyezi table code {\n \ + color: #916dd5;\n \ + font-weight: bolder;\n \ + background: none;\n \ +}\n \ +\n \ +/* 非微信代码块\n \ + * 代码块不换行 display:-webkit-box !important;\n \ + * 代码块换行 display:block;\n \ + */\n \ +.preview-theme--ningyezi .code-snippet__fix {\n \ + background: #f7f7f7;\n \ + border-radius: 2px;\n \ +}\n \ +\n \ +.preview-theme--ningyezi pre code {}\n \ +\n \ +/*\n \ + * 表格内的单元格\n \ + * 字体大小 font-size: 16px;\n \ + * 边框 border: 1px solid #ccc;\n \ + * 内边距 padding: 5px 10px;\n \ + */\n \ +.preview-theme--ningyezi table tr th,\n \ +.preview-theme--ningyezi table tr td {\n \ + font-size: 14px;\n \ +}\n \ +\n \ +.preview-theme--ningyezi .footnotes {\n \ + font-size: 14px;\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--ningyezi .footnote-word {\n \ + font-weight: normal;\n \ + color: #916dd5;\n \ + font-weight: bold;\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--ningyezi .footnote-ref {\n \ + font-weight: normal;\n \ + color: #916dd5;\n \ +}\n \ +\n \ +/*脚注链接样式*/\n \ +.preview-theme--ningyezi .footnote-item em {\n \ + font-size: 14px;\n \ + color: #916dd5;\n \ + display: block;\n \ +}\n \ +\n \ +/* \"参考资料\"四个字 \n \ + * 内容 content: \"参考资料\";\n \ + */\n \ +.preview-theme--ningyezi .footnotes-sep:before {\n \ + font-size: 20px;\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--ningyezi .footnote-num {\n \ + color: #916dd5;\n \ +}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--ningyezi .footnote-item p {\n \ + color: #916dd5;\n \ + font-weight: bold;\n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--ningyezi .footnote-item p em {\n \ + font-weight: normal;\n \ +}\n \ +\n \ +/* 行间公式\n \ + * 最大宽度 max-width: 300% !important;\n \ + */\n \ +.preview-theme--ningyezi .block-equation svg {}\n \ +\n \ +/* 行内公式\n \ + */\n \ +.preview-theme--ningyezi .inline-equation svg {}\n \ +.preview-theme--ningyezi pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_ningyezi(); diff --git a/static/themes/preview-theme-simplebrack.js b/static/themes/preview-theme-simplebrack.js new file mode 100644 index 0000000..69f471b --- /dev/null +++ b/static/themes/preview-theme-simplebrack.js @@ -0,0 +1,340 @@ +function init_preview_theme_simplebrack() { +const style = document.createElement('style'); +style.id = 'preview-theme-simplebrack'; +style.type = 'text/css'; +style.innerHTML = "/* 全局属性\n \ + * 页边距 padding: 30px;\n \ + * 全文字体 font-family: ptima-Regular;\n \ + * 英文换行 word-break: break-all;\n \ + */\n \ + .preview-theme--simplebrack {\n \ +font-size:14px;\n \ +padding:10px;\n \ +color: #2b2b2b;\n \ +background-color: #fff;\n \ +}\n \ +\n \ +/*图片下提示*/\n \ +.preview-theme--simplebrack figcaption{\n \ +font-size:12px;\n \ +}\n \ +.preview-theme--simplebrack .imageflow-caption{\n \ +font-size:12px;\n \ +}\n \ +\n \ +/* 段落,下方未标注标签参数均同此处\n \ + * 上边距 margin-top: 5px;\n \ + * 下边距 margin-bottom: 5px;\n \ + * 行高 line-height: 26px;\n \ + * 词间距 word-spacing: 3px;\n \ + * 字间距 letter-spacing: 3px;\n \ + * 对齐 text-align: left;\n \ + * 颜色 color: #3e3e3e;\n \ + * 字体大小 font-size: 16px;\n \ + * 首行缩进 text-indent: 2em;\n \ + */\n \ +.preview-theme--simplebrack p {\n \ +font-size:14px;\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--simplebrack h1 {\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--simplebrack h1 .content {\n \ +}\n \ +\n \ +/* 一级标题前缀 */\n \ +.preview-theme--simplebrack h1 .prefix {\n \ +}\n \ +\n \ +/* 一级标题后缀 */\n \ +.preview-theme--simplebrack h1 .suffix{\n \ +}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--simplebrack h2 {\n \ +text-align:center;\n \ +position:relative;\n \ +font-weight: bold;\n \ +color: black;\n \ +line-height: 1.1em;\n \ +padding-top: 12px;\n \ +padding-bottom: 12px;\n \ +margin:70px 30px 30px;\n \ +border: 1px solid #000;\n \ +}\n \ +\n \ +.preview-theme--simplebrack h2:before{\n \ +content: ' ';\n \ +float: left;\n \ +display: block;\n \ +width: 90%;\n \ +border-top: 1px solid #000;\n \ +height: 1px;\n \ +line-height: 1px;\n \ +margin-left: -5px;\n \ +margin-top: -17px;\n \ +}\n \ +.preview-theme--simplebrack h2:after{\n \ +content: ' ';\n \ +float: right;\n \ +display: block;\n \ +width: 90%;\n \ +border-bottom: 1px solid #000;\n \ +height: 1px;\n \ +line-height: 1px;\n \ +margin-right: -5px;\n \ +margin-top: 16px;\n \ +position: unset;\n \ +}\n \ +/* 二级标题内容 */\n \ +.preview-theme--simplebrack h2 .content {\n \ +display: block;\n \ +-webkit-box-reflect: below 0em -webkit-gradient(linear,left top,left bottom, from(rgba(0,0,0,0)),to(rgba(255,255,255,0.1)));\n \ +}\n \ +.preview-theme--simplebrack h2 strong {\n \ +}\n \ +/* 二级标题前缀 */\n \ +.preview-theme--simplebrack h2 .prefix {\n \ +display: block;\n \ +width: 3px;\n \ +margin: 0 0 0 5%;\n \ +height: 3px;\n \ +line-height: 3px;\n \ +overflow: hidden;\n \ +background-color: #000;\n \ +box-shadow:3px 0 #000,\n \ +0 3px #000,\n \ +-3px 0 #000,\n \ +0 -3px #000;\n \ +}\n \ +\n \ +/* 二级标题后缀 */\n \ +.preview-theme--simplebrack h2 .suffix {\n \ +display: block;\n \ +width: 3px;\n \ +margin: 0 0 0 95%;\n \ +height: 3px;\n \ +line-height: 3px;\n \ +overflow: hidden;\n \ +background-color: #000;\n \ +box-shadow:3px 0 #000,\n \ +0 3px #000,\n \ +-3px 0 #000,\n \ +0 -3px #000;\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--simplebrack h3 {\n \ +background-color:#000;\n \ +color:#fff;\n \ +padding:2px 10px;\n \ +width:fit-content;\n \ +font-size:17px;\n \ +margin:60px auto 10px;\n \ +}\n \ +.preview-theme--simplebrack h3 strong {\n \ +color:#fff;\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--simplebrack h3 .content {\n \ +}\n \ +\n \ +/* 三级标题前缀 */\n \ +.preview-theme--simplebrack h3 .prefix {\n \ +}\n \ +\n \ +/* 三级标题后缀 */\n \ +.preview-theme--simplebrack h3 .suffix {\n \ +}\n \ +\n \ +/* 无序列表整体样式\n \ + * list-style-type: square|circle|disc;\n \ + */\n \ +.preview-theme--simplebrack ul {\n \ +list-style-type: square;\n \ +}\n \ +/* 无序二级列表\n \ + */\n \ +.preview-theme--simplebrack ul li ul li{\n \ +list-style-type: circle;\n \ +}\n \ +\n \ +/* 有序列表整体样式\n \ + * list-style-type: upper-roman|lower-greek|lower-alpha;\n \ + */\n \ +.preview-theme--simplebrack ol {\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ + */\n \ +.preview-theme--simplebrack li section {\n \ +}\n \ +\n \ +/* 引用\n \ + * 左边缘颜色 border-left-color: black;\n \ + * 背景色 background: gray;\n \ + */\n \ +.preview-theme--simplebrack blockquote {\n \ +border-left: 3px solid rgba(0, 0, 0, 0.65) !important;\n \ +border-right: 1px solid rgba(0, 0, 0, 0.65) !important;\n \ +background: rgb(249, 249, 249) !important;\n \ +color: rgba(0,0,0,0.5) !important;\n \ +}\n \ +\n \ +/* 引用文字 */\n \ +.preview-theme--simplebrack blockquote p {\n \ +}\n \ +\n \ +/* 链接 \n \ + * border-bottom: 1px solid #009688;\n \ + */\n \ +.preview-theme--simplebrack a {\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--simplebrack strong {\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--simplebrack em {\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--simplebrack em strong {\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--simplebrack del {\n \ +}\n \ +\n \ +/* 分隔线\n \ + * 粗细、样式和颜色\n \ + * border-top: 1px solid #3e3e3e;\n \ + */\n \ +.preview-theme--simplebrack hr {\n \ +}\n \ +\n \ +/* 图片\n \ + * 宽度 width: 80%;\n \ + * 居中 margin: 0 auto;\n \ + * 居左 margin: 0 0;\n \ + */\n \ +.preview-theme--simplebrack img {\n \ +box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px;\n \ +border-radius:4px;\n \ +margin-top:10px;\n \ +}\n \ +/* 行内代码 */\n \ +.preview-theme--simplebrack p code, .preview-theme--simplebrack li code {\n \ +color:#ff6441;\n \ +background-color: rgba(27,31,35,.05) !important;\n \ +}\n \ +\n \ +/* 非微信代码块\n \ + * 代码块不换行 display: -webkit-box !important;\n \ + * 代码块换行 display: block;\n \ + */\n \ +.preview-theme--simplebrack pre.custom {\n \ +box-shadow: rgba(170, 170, 170, 0.48) 0px 0px 6px 0px;\n \ +max-width: 100%;\n \ +border-radius:4px;\n \ +margin: 10px auto 0 auto;\n \ +}\n \ +.preview-theme--simplebrack pre code {\n \ +}\n \ +\n \ +/*\n \ + * 表格内的单元格\n \ + * 字体大小 font-size: 16px;\n \ + * 边框 border: 1px solid #ccc;\n \ + * 内边距 padding: 5px 10px;\n \ + */\n \ +.preview-theme--simplebrack table tr th,\n \ +.preview-theme--simplebrack table tr td {\n \ +font-size:14px;\n \ +}\n \ +\n \ +/* 脚注文字 */\n \ +.preview-theme--simplebrack .footnote-word {\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--simplebrack .footnote-ref {\n \ +}\n \ +\n \ +/* \"参考资料\"四个字 \n \ + * 内容 content: \"参考资料\";\n \ + */\n \ +.preview-theme--simplebrack .footnotes-sep {\n \ +font-size: 14px;\n \ +color: #888;\n \ +border-top: 1px solid #eee;\n \ +padding: 30px 0 10px 0px;\n \ +background-color: transparent;\n \ +margin-bottom: 20px;\n \ +width: 100%;\n \ +}\n \ +.preview-theme--simplebrack .footnotes-sep:before {\n \ +content:'参考资料';\n \ +}\n \ +.preview-theme--simplebrack .footnotes{\n \ +border-left:5px solid #eee;\n \ +padding-left:10px;\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--simplebrack .footnote-num {\n \ +font-size:14px;\n \ +color:#999;\n \ +}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--simplebrack .footnote-item p { \n \ +font-size:14px;\n \ +color:#999;\n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--simplebrack .footnote-item p em {\n \ +font-size:14px;\n \ +color:#999;\n \ +}\n \ +\n \ +/* 行间公式\n \ + * 最大宽度 max-width: 300% !important;\n \ + */\n \ +.preview-theme--simplebrack .block-equation svg {\n \ +}\n \ +\n \ +/* 行内公式\n \ + */\n \ +.preview-theme--simplebrack .inline-equation svg {\n \ +}\n \ +/* 文章结尾 */\n \ +.preview-theme--simplebrack:after{\n \ +content:'- END -';\n \ +font-size:15px;\n \ +display:block;\n \ +text-align:center;\n \ +margin-top:50px;\n \ +color:#999;\n \ +border-bottom:1px solid #eee;\n \ +}\n \ +\n \ +/*滑动幻灯片*/\n \ +.preview-theme--simplebrack .imageflow-layer1 img{\n \ +margin:0;\n \ +box-shadow: none;\n \ +border-radius: 0;\n \ +}\n \ +.preview-theme--simplebrack pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_simplebrack(); diff --git a/static/themes/preview-theme-yanqihu.js b/static/themes/preview-theme-yanqihu.js new file mode 100644 index 0000000..d12163a --- /dev/null +++ b/static/themes/preview-theme-yanqihu.js @@ -0,0 +1,305 @@ +function init_preview_theme_yanqihu() { +const style = document.createElement('style'); +style.id = 'preview-theme-yanqihu'; +style.type = 'text/css'; +style.innerHTML = "/* 雁栖湖 yanqihu\n \ +*/\n \ +.preview-theme--yanqihu {\n \ + color: #2b2b2b;\n \ + background-color: #fff;\n \ + counter-reset: counterh1 counterh2 counterh3;\n \ +}\n \ +\n \ +/* 段落,下方未标注标签参数均同此处\n \ +*/\n \ +.preview-theme--yanqihu p {\n \ +}\n \ +\n \ +/* 一级标题 */\n \ +.preview-theme--yanqihu h1 {\n \ + line-height: 28px;\n \ + border-bottom: 1px solid rgb(37,132,181);\n \ +}\n \ +\n \ +.preview-theme--yanqihu h1:before {\n \ + background: rgb(37,132,181);\n \ + color: white;\n \ + counter-increment: counterh1;\n \ + content: 'Part'counter(counterh1); \n \ + padding: 2px 8px;\n \ +}\n \ +\n \ +/* 一级标题内容 */\n \ +.preview-theme--yanqihu h1 .content {\n \ + color: rgb(37,132,181);\n \ + margin-left: 8px;\n \ + font-size: 20px;\n \ +}\n \ +\n \ +/* 一级标题前缀 */\n \ +.preview-theme--yanqihu h1 .prefix {\n \ +}\n \ +\n \ +/* 一级标题后缀 */\n \ +.preview-theme--yanqihu h1 .suffix {\n \ +}\n \ +\n \ +/* 二级标题 */\n \ +.preview-theme--yanqihu h2 {\n \ +}\n \ +\n \ +/* 二级标题内容 */\n \ +.preview-theme--yanqihu h2 .content {\n \ + font-size: 18px;\n \ + border-bottom: 4px solid rgb(37,132,181);\n \ + padding: 2px 4px;\n \ + color: rgb(37,132,181);\n \ +}\n \ +\n \ +/* 二级标题前缀 */\n \ +.preview-theme--yanqihu h2 .prefix {\n \ + display: inline-block;\n \ +}\n \ +\n \ +.preview-theme--yanqihu h2 .prefix:before {\n \ + counter-increment: counterh2;\n \ + content: counter(counterh2); \n \ + color:rgb(159,205,208);\n \ + border-bottom: 4px solid rgb(159,205,208);\n \ + font-size: 18px;\n \ + padding: 2px 4px;\n \ +}\n \ +\n \ +/* 二级标题后缀 */\n \ +.preview-theme--yanqihu h2 .suffix {\n \ +}\n \ +\n \ +.preview-theme--yanqihu h1:after, .preview-theme--yanqihu h2:after {\n \ + border-bottom: unset;\n \ +}\n \ +\n \ +/* 三级标题 */\n \ +.preview-theme--yanqihu h3 {\n \ +}\n \ +\n \ +/* 三级标题内容 */\n \ +.preview-theme--yanqihu h3 .content {\n \ + font-size: 16px;\n \ + border-bottom: 1px solid rgb(37,132,181);\n \ + padding: 2px 10px;\n \ + color: rgb(37,132,181);\n \ +}\n \ +\n \ +/* 三级标题前缀 */\n \ +.preview-theme--yanqihu h3 .prefix {\n \ + display:inline-block;\n \ + background:linear-gradient(45deg, transparent 48%, rgb(37,132,181) 48%, \n \ + rgb(37,132,181) 52%, transparent 52%);\n \ + width:24px;\n \ + height:24px;\n \ + margin-bottom: -7px;\n \ +}\n \ +\n \ +/* 三级标题后缀 */\n \ +.preview-theme--yanqihu h3 .suffix {\n \ +}\n \ +\n \ +/* 无序列表整体样式\n \ +* list-style-type: square|circle|disc;\n \ +*/\n \ +.preview-theme--yanqihu ul {\n \ +}\n \ +\n \ +/* 有序列表整体样式\n \ +* list-style-type: upper-roman|lower-greek|lower-alpha;\n \ +*/\n \ +.preview-theme--yanqihu ol {\n \ +}\n \ +\n \ +/* 列表内容,不要设置li\n \ +*/\n \ +.preview-theme--yanqihu li section {\n \ +}\n \ +\n \ +/* 一级引用\n \ +* 左边缘颜色 border-left-color: black;\n \ +* 背景色 background: gray;\n \ +*/\n \ +.preview-theme--yanqihu blockquote {\n \ + color: rgba(0,0,0,0.5) !important;\n \ + border: 1px dashed rgb(37,132,181) !important;\n \ + background: transparent !important;\n \ +}\n \ +\n \ +/* 一级引用文字 */\n \ +.preview-theme--yanqihu blockquote p {\n \ +}\n \ +\n \ +/* 二级引用\n \ +*/\n \ +.preview-theme--yanqihu .multiquote-2 {\n \ + border: 1px dashed rgb(248,99,77);\n \ + box-shadow: none;\n \ +}\n \ +\n \ +.preview-theme--yanqihu .multiquote-2 blockquote {\n \ + margin: 0;\n \ +}\n \ +\n \ +/* 二级引用文字 */\n \ +.preview-theme--yanqihu .multiquote-2 p {\n \ +}\n \ +\n \ +.preview-theme--yanqihu .multiquote-2 strong {\n \ + color:rgb(248,99,77);\n \ +}\n \ +\n \ +.preview-theme--yanqihu .multiquote-2 a {\n \ + color:rgb(248,99,77);\n \ + border-bottom: 1px solid rgb(248,99,77);\n \ +}\n \ +\n \ +/* 三级引用\n \ +*/\n \ +.preview-theme--yanqihu .multiquote-3 {\n \ +}\n \ +\n \ +/* 三级引用文字 */\n \ +.preview-theme--yanqihu .multiquote-3 p {\n \ +}\n \ +\n \ +/* 链接 \n \ +* border-bottom: 1px solid #009688;\n \ +*/\n \ +.preview-theme--yanqihu a {\n \ + color:rgb(37,132,181);\n \ + border-bottom: 1px solid rgb(37,132,181);\n \ +}\n \ +\n \ +/* 加粗 */\n \ +.preview-theme--yanqihu strong {\n \ + color: rgb(37,132,181);\n \ +}\n \ +\n \ +/* 斜体 */\n \ +.preview-theme--yanqihu em {\n \ + color: rgb(37,132,181);\n \ +}\n \ +\n \ +/* 加粗斜体 */\n \ +.preview-theme--yanqihu em strong {\n \ + color: rgb(37,132,181);\n \ +}\n \ +\n \ +/* 删除线 */\n \ +.preview-theme--yanqihu del {\n \ +}\n \ +\n \ +/* 分隔线\n \ +* 粗细、样式和颜色\n \ +* border-top: 1px solid #3e3e3e;\n \ +*/\n \ +.preview-theme--yanqihu hr {\n \ + border-top: 1px solid rgb(37,132,181);\n \ +}\n \ +\n \ +/* 图片\n \ +* 宽度 width: 80%;\n \ +* 居中 margin: 0 auto;\n \ +* 居左 margin: 0 0;\n \ +*/\n \ +.preview-theme--yanqihu img {\n \ +}\n \ +\n \ +/* 图片描述文字 */\n \ +.preview-theme--yanqihu figcaption {\n \ +}\n \ +\n \ +/* 行内代码 */\n \ +.preview-theme--yanqihu p code,\n \ +.preview-theme--yanqihu li code,\n \ +.preview-theme--yanqihu table code {\n \ + background-color: rgba(0,0,0,.05);\n \ +}\n \ +\n \ +/* \n \ +* 代码块不换行 display: -webkit-box !important;\n \ +* 代码块换行 display: block;\n \ +*/\n \ +.preview-theme--yanqihu pre code {\n \ +}\n \ +\n \ +/*\n \ +* 表格内的单元格\n \ +* 字体大小 font-size: 16px;\n \ +* 边框 border: 1px solid #ccc;\n \ +* 内边距 padding: 5px 10px;\n \ +*/\n \ +.preview-theme--yanqihu table tr th {\n \ + border: 1px solid rgb(248,99,77);\n \ + background-color: rgb(235,114, 80);\n \ + color: #f8f8f8;\n \ + border-bottom: 0;\n \ + border: 1px solid rgb(245,203,174);\n \ +}\n \ +\n \ +.preview-theme--yanqihu table tr td {\n \ + border: 1px solid rgb(245,203,174);\n \ +}\n \ +/* \n \ +* 某一列表格列宽控制\n \ +* n 可以修改为具体数字,不修改时表示所有列\n \ +* 最小列宽 min-width: 85px;\n \ +*/\n \ +.preview-theme--yanqihu table tr th:nth-of-type(n),\n \ +.preview-theme--yanqihu table tr td:nth-of-type(n){\n \ +}\n \ +\n \ +.preview-theme--yanqihu table tr:nth-of-type(2n) {\n \ + background-color: rgb(248,222,203);\n \ +}\n \ +/* 脚注文字 */\n \ +.preview-theme--yanqihu .footnote-word {\n \ + color:rgb(37,132,181);\n \ +}\n \ +\n \ +/* 脚注上标 */\n \ +.preview-theme--yanqihu .footnote-ref {\n \ + color:rgb(37,132,181);\n \ +}\n \ +\n \ +/* \"参考资料\"四个字 \n \ +* 内容 content: \"参考资料\";\n \ +*/\n \ +.preview-theme--yanqihu .footnotes-sep:before {\n \ +}\n \ +\n \ +/* 参考资料编号 */\n \ +.preview-theme--yanqihu .footnote-num {\n \ +}\n \ +\n \ +/* 参考资料文字 */\n \ +.preview-theme--yanqihu .footnote-item p { \n \ +}\n \ +\n \ +/* 参考资料解释 */\n \ +.preview-theme--yanqihu .footnote-item p em {\n \ +}\n \ +\n \ +/* 行间公式\n \ +* 最大宽度 max-width: 300% !important;\n \ +*/\n \ +.preview-theme--yanqihu .block-equation svg {\n \ +}\n \ +\n \ +/* 行内公式\n \ +*/\n \ +.preview-theme--yanqihu .inline-equation svg { \n \ +}\n \ +.preview-theme--yanqihu pre>code {\n \ +background-color: #333;\n \ +color: rgba(255,255,255,0.75);\n \ +}"; +document.head.appendChild(style); +} +init_preview_theme_yanqihu(); diff --git a/test/unit/.eslintrc b/test/unit/.eslintrc new file mode 100644 index 0000000..9213c3f --- /dev/null +++ b/test/unit/.eslintrc @@ -0,0 +1,8 @@ +{ + "env": { + "jest": true + }, + "extends": [ + "../../.eslintrc.js" + ] +} diff --git a/test/unit/jest.conf.js b/test/unit/jest.conf.js new file mode 100644 index 0000000..1420d11 --- /dev/null +++ b/test/unit/jest.conf.js @@ -0,0 +1,33 @@ +const path = require('path'); + +module.exports = { + rootDir: path.resolve(__dirname, '../../'), + moduleFileExtensions: [ + 'js', + 'json', + 'vue', + ], + moduleNameMapper: { + '\\.(css|scss)$': 'identity-obj-proxy', + '^!raw-loader!': 'identity-obj-proxy', + '^worker-loader!\\./templateWorker\\.js$': '/test/unit/mocks/templateWorkerMock', + }, + transform: { + '^.+\\.js$': '/node_modules/babel-jest', + '.*\\.(vue)$': '/node_modules/vue-jest', + '.*\\.(yml|html|md)$': 'jest-raw-loader', + }, + snapshotSerializers: ['/node_modules/jest-serializer-vue'], + setupFiles: [ + '/test/unit/setup', + ], + coverageDirectory: '/test/unit/coverage', + collectCoverageFrom: [ + 'src/**/*.{js,vue}', + '!src/main.js', + '!**/node_modules/**', + ], + globals: { + NODE_ENV: 'production', + }, +}; diff --git a/test/unit/mocks/cryptoMock.js b/test/unit/mocks/cryptoMock.js new file mode 100644 index 0000000..c4d8a92 --- /dev/null +++ b/test/unit/mocks/cryptoMock.js @@ -0,0 +1,7 @@ +window.crypto = { + getRandomValues(array) { + for (let i = 0; i < array.length; i += 1) { + array[i] = Math.floor(Math.random() * 1000000); + } + }, +}; diff --git a/test/unit/mocks/localStorageMock.js b/test/unit/mocks/localStorageMock.js new file mode 100644 index 0000000..4247a6e --- /dev/null +++ b/test/unit/mocks/localStorageMock.js @@ -0,0 +1,9 @@ +const store = {}; +window.localStorage = { + getItem(key) { + return store[key] || null; + }, + setItem(key, value) { + store[key] = value.toString(); + }, +}; diff --git a/test/unit/mocks/mutationObserverMock.js b/test/unit/mocks/mutationObserverMock.js new file mode 100644 index 0000000..6d55983 --- /dev/null +++ b/test/unit/mocks/mutationObserverMock.js @@ -0,0 +1,6 @@ +/* eslint-disable class-methods-use-this */ +class MutationObserver { + observe() { + } +} +window.MutationObserver = MutationObserver; diff --git a/test/unit/mocks/templateWorkerMock.js b/test/unit/mocks/templateWorkerMock.js new file mode 100644 index 0000000..86059f3 --- /dev/null +++ b/test/unit/mocks/templateWorkerMock.js @@ -0,0 +1 @@ +module.exports = 'test-file-stub'; diff --git a/test/unit/setup.js b/test/unit/setup.js new file mode 100644 index 0000000..b25a35e --- /dev/null +++ b/test/unit/setup.js @@ -0,0 +1,5 @@ +import Vue from 'vue'; +import './mocks/cryptoMock'; +import './mocks/mutationObserverMock'; + +Vue.config.productionTip = false; diff --git a/test/unit/specs/components/ButtonBar.spec.js b/test/unit/specs/components/ButtonBar.spec.js new file mode 100644 index 0000000..a8900ee --- /dev/null +++ b/test/unit/specs/components/ButtonBar.spec.js @@ -0,0 +1,47 @@ +import ButtonBar from '../../../../src/components/ButtonBar'; +import store from '../../../../src/store'; +import specUtils from '../specUtils'; + +describe('ButtonBar.vue', () => { + it('should toggle the navigation bar', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--navigation-bar-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].showNavigationBar, + 'toggleNavigationBar', + )); + + it('should toggle the side preview', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--side-preview-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].showSidePreview, + 'toggleSidePreview', + )); + + it('should toggle the editor', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--editor-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].showEditor, + 'toggleEditor', + )); + + it('should toggle the focus mode', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--focus-mode-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].focusMode, + 'toggleFocusMode', + )); + + it('should toggle the scroll sync', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--scroll-sync-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].scrollSync, + 'toggleScrollSync', + )); + + it('should toggle the status bar', async () => specUtils.checkToggler( + ButtonBar, + wrapper => wrapper.find('.button-bar__button--status-bar-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].showStatusBar, + 'toggleStatusBar', + )); +}); diff --git a/test/unit/specs/components/ContextMenu.spec.js b/test/unit/specs/components/ContextMenu.spec.js new file mode 100644 index 0000000..982e19e --- /dev/null +++ b/test/unit/specs/components/ContextMenu.spec.js @@ -0,0 +1,32 @@ +import { shallowMount } from '@vue/test-utils'; +import ContextMenu from '../../../../src/components/ContextMenu'; +import store from '../../../../src/store'; +import '../specUtils'; + +const mount = () => shallowMount(ContextMenu, { store }); + +describe('ContextMenu.vue', () => { + const name = 'Name'; + const makeOptions = () => ({ + coordinates: { + left: 0, + top: 0, + }, + items: [{ name }], + }); + + it('should open/close itself', async () => { + const wrapper = mount(); + expect(wrapper.contains('.context-menu__item')).toEqual(false); + setTimeout(() => wrapper.find('.context-menu__item').trigger('click'), 1); + const item = await store.dispatch('contextMenu/open', makeOptions()); + expect(item.name).toEqual(name); + }); + + it('should cancel itself', async () => { + const wrapper = mount(); + setTimeout(() => wrapper.trigger('click'), 1); + const item = await store.dispatch('contextMenu/open', makeOptions()); + expect(item).toEqual(null); + }); +}); diff --git a/test/unit/specs/components/Explorer.spec.js b/test/unit/specs/components/Explorer.spec.js new file mode 100644 index 0000000..1cd1099 --- /dev/null +++ b/test/unit/specs/components/Explorer.spec.js @@ -0,0 +1,194 @@ +import { shallowMount } from '@vue/test-utils'; +import Explorer from '../../../../src/components/Explorer'; +import store from '../../../../src/store'; +import workspaceSvc from '../../../../src/services/workspaceSvc'; +import specUtils from '../specUtils'; + +const mount = () => shallowMount(Explorer, { store }); +const select = (id) => { + store.commit('explorer/setSelectedId', id); + expect(store.getters['explorer/selectedNode'].item.id).toEqual(id); +}; +const ensureExists = file => expect(store.getters.allItemsById).toHaveProperty(file.id); +const ensureNotExists = file => expect(store.getters.allItemsById).not.toHaveProperty(file.id); +const refreshItem = item => store.getters.allItemsById[item.id]; + +describe('Explorer.vue', () => { + it('should create new file in the root folder', async () => { + expect(store.state.explorer.newChildNode.isNil).toBeTruthy(); + const wrapper = mount(); + wrapper.find('.side-title__button--new-file').trigger('click'); + expect(store.state.explorer.newChildNode.isNil).toBeFalsy(); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'file', + parentId: null, + }); + }); + + it('should create new file in a folder', async () => { + const folder = await workspaceSvc.storeItem({ type: 'folder' }); + const wrapper = mount(); + select(folder.id); + wrapper.find('.side-title__button--new-file').trigger('click'); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'file', + parentId: folder.id, + }); + }); + + it('should not create new files in the trash folder', async () => { + const wrapper = mount(); + select('trash'); + wrapper.find('.side-title__button--new-file').trigger('click'); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'file', + parentId: null, + }); + }); + + it('should create new folders in the root folder', async () => { + expect(store.state.explorer.newChildNode.isNil).toBeTruthy(); + const wrapper = mount(); + wrapper.find('.side-title__button--new-folder').trigger('click'); + expect(store.state.explorer.newChildNode.isNil).toBeFalsy(); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'folder', + parentId: null, + }); + }); + + it('should create new folders in a folder', async () => { + const folder = await workspaceSvc.storeItem({ type: 'folder' }); + const wrapper = mount(); + select(folder.id); + wrapper.find('.side-title__button--new-folder').trigger('click'); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'folder', + parentId: folder.id, + }); + }); + + it('should not create new folders in the trash folder', async () => { + const wrapper = mount(); + select('trash'); + wrapper.find('.side-title__button--new-folder').trigger('click'); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'folder', + parentId: null, + }); + }); + + it('should not create new folders in the temp folder', async () => { + const wrapper = mount(); + select('temp'); + wrapper.find('.side-title__button--new-folder').trigger('click'); + expect(store.state.explorer.newChildNode.item).toMatchObject({ + type: 'folder', + parentId: null, + }); + }); + + it('should move file to the trash folder on delete', async () => { + const file = await workspaceSvc.createFile({}, true); + expect(file.parentId).toEqual(null); + const wrapper = mount(); + select(file.id); + wrapper.find('.side-title__button--delete').trigger('click'); + ensureExists(file); + expect(refreshItem(file).parentId).toEqual('trash'); + await specUtils.expectBadge('removeFile'); + }); + + it('should not delete the trash folder', async () => { + const wrapper = mount(); + select('trash'); + wrapper.find('.side-title__button--delete').trigger('click'); + await specUtils.resolveModal('trashDeletion'); + await specUtils.expectBadge('removeFile', false); + }); + + it('should not delete file in the trash folder', async () => { + const file = await workspaceSvc.createFile({ parentId: 'trash' }, true); + const wrapper = mount(); + select(file.id); + wrapper.find('.side-title__button--delete').trigger('click'); + await specUtils.resolveModal('trashDeletion'); + ensureExists(file); + await specUtils.expectBadge('removeFile', false); + }); + + it('should delete the temp folder after confirmation', async () => { + const file = await workspaceSvc.createFile({ parentId: 'temp' }, true); + const wrapper = mount(); + select('temp'); + wrapper.find('.side-title__button--delete').trigger('click'); + await specUtils.resolveModal('tempFolderDeletion'); + ensureNotExists(file); + await specUtils.expectBadge('removeFolder'); + }); + + it('should delete temp file after confirmation', async () => { + const file = await workspaceSvc.createFile({ parentId: 'temp' }, true); + const wrapper = mount(); + select(file.id); + wrapper.find('.side-title__button--delete').trigger('click'); + ensureExists(file); + await specUtils.resolveModal('tempFileDeletion'); + ensureNotExists(file); + await specUtils.expectBadge('removeFile'); + }); + + it('should delete folder after confirmation', async () => { + const folder = await workspaceSvc.storeItem({ type: 'folder' }); + const file = await workspaceSvc.createFile({ parentId: folder.id }, true); + const wrapper = mount(); + select(folder.id); + wrapper.find('.side-title__button--delete').trigger('click'); + await specUtils.resolveModal('folderDeletion'); + ensureNotExists(folder); + // Make sure file has been moved to Trash + ensureExists(file); + expect(refreshItem(file).parentId).toEqual('trash'); + await specUtils.expectBadge('removeFolder'); + }); + + it('should rename file', async () => { + const file = await workspaceSvc.createFile({}, true); + const wrapper = mount(); + select(file.id); + wrapper.find('.side-title__button--rename').trigger('click'); + expect(store.getters['explorer/editingNode'].item.id).toEqual(file.id); + }); + + it('should rename folder', async () => { + const folder = await workspaceSvc.storeItem({ type: 'folder' }); + const wrapper = mount(); + select(folder.id); + wrapper.find('.side-title__button--rename').trigger('click'); + expect(store.getters['explorer/editingNode'].item.id).toEqual(folder.id); + }); + + it('should not rename the trash folder', async () => { + const wrapper = mount(); + select('trash'); + wrapper.find('.side-title__button--rename').trigger('click'); + expect(store.getters['explorer/editingNode'].isNil).toBeTruthy(); + }); + + it('should not rename the temp folder', async () => { + const wrapper = mount(); + select('temp'); + wrapper.find('.side-title__button--rename').trigger('click'); + expect(store.getters['explorer/editingNode'].isNil).toBeTruthy(); + }); + + it('should close itself', async () => { + store.dispatch('data/toggleExplorer', true); + specUtils.checkToggler( + Explorer, + wrapper => wrapper.find('.side-title__button--close').trigger('click'), + () => store.getters['data/layoutSettings'].showExplorer, + 'toggleExplorer', + ); + }); +}); diff --git a/test/unit/specs/components/ExplorerNode.spec.js b/test/unit/specs/components/ExplorerNode.spec.js new file mode 100644 index 0000000..5793bfc --- /dev/null +++ b/test/unit/specs/components/ExplorerNode.spec.js @@ -0,0 +1,307 @@ +import { shallowMount } from '@vue/test-utils'; +import ExplorerNode from '../../../../src/components/ExplorerNode'; +import store from '../../../../src/store'; +import workspaceSvc from '../../../../src/services/workspaceSvc'; +import explorerSvc from '../../../../src/services/explorerSvc'; +import specUtils from '../specUtils'; + +const makeFileNode = async () => { + const file = await workspaceSvc.createFile({}, true); + const node = store.getters['explorer/nodeMap'][file.id]; + expect(node.item.id).toEqual(file.id); + return node; +}; + +const makeFolderNode = async () => { + const folder = await workspaceSvc.storeItem({ type: 'folder' }); + const node = store.getters['explorer/nodeMap'][folder.id]; + expect(node.item.id).toEqual(folder.id); + return node; +}; + +const mount = node => shallowMount(ExplorerNode, { + store, + propsData: { node, depth: 1 }, +}); +const mountAndSelect = (node) => { + const wrapper = mount(node); + wrapper.find('.explorer-node__item').trigger('click'); + expect(store.getters['explorer/selectedNode'].item.id).toEqual(node.item.id); + expect(wrapper.classes()).toContain('explorer-node--selected'); + return wrapper; +}; + +const dragAndDrop = (sourceItem, targetItem) => { + const sourceNode = store.getters['explorer/nodeMap'][sourceItem.id]; + mountAndSelect(sourceNode).find('.explorer-node__item').trigger('dragstart', { + dataTransfer: { setData: () => {} }, + }); + expect(store.state.explorer.dragSourceId).toEqual(sourceItem.id); + const targetNode = store.getters['explorer/nodeMap'][targetItem.id]; + const wrapper = mount(targetNode); + wrapper.trigger('dragenter'); + expect(store.state.explorer.dragTargetId).toEqual(targetItem.id); + wrapper.trigger('drop'); + const expectedParentId = targetItem.type === 'file' ? targetItem.parentId : targetItem.id; + expect(store.getters['explorer/selectedNode'].item.parentId).toEqual(expectedParentId); +}; + +describe('ExplorerNode.vue', () => { + const modifiedName = 'Name'; + + it('should open file on select after a timeout', async () => { + const node = await makeFileNode(); + mountAndSelect(node); + expect(store.getters['file/current'].id).not.toEqual(node.item.id); + await new Promise(resolve => setTimeout(resolve, 10)); + expect(store.getters['file/current'].id).toEqual(node.item.id); + await specUtils.expectBadge('switchFile'); + }); + + it('should not open already open file', async () => { + const node = await makeFileNode(); + store.commit('file/setCurrentId', node.item.id); + mountAndSelect(node); + await new Promise(resolve => setTimeout(resolve, 10)); + expect(store.getters['file/current'].id).toEqual(node.item.id); + await specUtils.expectBadge('switchFile', false); + }); + + it('should open folder on select after a timeout', async () => { + const node = await makeFolderNode(); + const wrapper = mountAndSelect(node); + expect(wrapper.classes()).not.toContain('explorer-node--open'); + await new Promise(resolve => setTimeout(resolve, 10)); + expect(wrapper.classes()).toContain('explorer-node--open'); + }); + + it('should open folder on new child', async () => { + const node = await makeFolderNode(); + const wrapper = mountAndSelect(node); + // Close the folder + wrapper.find('.explorer-node__item').trigger('click'); + await new Promise(resolve => setTimeout(resolve, 10)); + expect(wrapper.classes()).not.toContain('explorer-node--open'); + explorerSvc.newItem(); + expect(wrapper.classes()).toContain('explorer-node--open'); + }); + + it('should create new file in a folder', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('New file'); + expect(wrapper.contains('.explorer-node__new-child')).toBe(true); + store.commit('explorer/setNewItemName', modifiedName); + wrapper.find('.explorer-node__new-child .text-input').trigger('blur'); + await new Promise(resolve => setTimeout(resolve, 1)); + expect(store.getters['explorer/selectedNode'].item).toMatchObject({ + name: modifiedName, + type: 'file', + parentId: node.item.id, + }); + expect(wrapper.contains('.explorer-node__new-child')).toBe(false); + await specUtils.expectBadge('createFile'); + }); + + it('should cancel file creation on escape', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('New file'); + expect(wrapper.contains('.explorer-node__new-child')).toBe(true); + store.commit('explorer/setNewItemName', modifiedName); + wrapper.find('.explorer-node__new-child .text-input').trigger('keydown', { + keyCode: 27, + }); + await new Promise(resolve => setTimeout(resolve, 1)); + expect(store.getters['explorer/selectedNode'].item).not.toMatchObject({ + name: 'modifiedName', + type: 'file', + parentId: node.item.id, + }); + expect(wrapper.contains('.explorer-node__new-child')).toBe(false); + await specUtils.expectBadge('createFile', false); + }); + + it('should not create new file in a file', async () => { + const node = await makeFileNode(); + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('New file').disabled).toBe(true); + }); + + it('should not create new file in the trash folder', async () => { + const node = store.getters['explorer/nodeMap'].trash; + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('New file').disabled).toBe(true); + }); + + it('should create new folder in folder', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('New folder'); + expect(wrapper.contains('.explorer-node__new-child--folder')).toBe(true); + store.commit('explorer/setNewItemName', modifiedName); + wrapper.find('.explorer-node__new-child--folder .text-input').trigger('blur'); + await new Promise(resolve => setTimeout(resolve, 1)); + expect(store.getters['explorer/selectedNode'].item).toMatchObject({ + name: modifiedName, + type: 'folder', + parentId: node.item.id, + }); + expect(wrapper.contains('.explorer-node__new-child--folder')).toBe(false); + await specUtils.expectBadge('createFolder'); + }); + + it('should cancel folder creation on escape', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('New folder'); + expect(wrapper.contains('.explorer-node__new-child--folder')).toBe(true); + store.commit('explorer/setNewItemName', modifiedName); + wrapper.find('.explorer-node__new-child--folder .text-input').trigger('keydown', { + keyCode: 27, + }); + await new Promise(resolve => setTimeout(resolve, 1)); + expect(store.getters['explorer/selectedNode'].item).not.toMatchObject({ + name: modifiedName, + type: 'folder', + parentId: node.item.id, + }); + expect(wrapper.contains('.explorer-node__new-child--folder')).toBe(false); + await specUtils.expectBadge('createFolder', false); + }); + + it('should not create new folder in a file', async () => { + const node = await makeFileNode(); + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('New folder').disabled).toBe(true); + }); + + it('should not create new folder in the trash folder', async () => { + const node = store.getters['explorer/nodeMap'].trash; + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('New folder').disabled).toBe(true); + }); + + it('should not create new folder in the temp folder', async () => { + const node = store.getters['explorer/nodeMap'].temp; + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('New folder').disabled).toBe(true); + }); + + it('should rename file', async () => { + const node = await makeFileNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('Rename'); + expect(wrapper.contains('.explorer-node__item-editor')).toBe(true); + wrapper.setData({ editingValue: modifiedName }); + wrapper.find('.explorer-node__item-editor .text-input').trigger('blur'); + expect(store.getters['explorer/selectedNode'].item.name).toEqual(modifiedName); + await specUtils.expectBadge('renameFile'); + }); + + it('should cancel rename file on escape', async () => { + const node = await makeFileNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('Rename'); + expect(wrapper.contains('.explorer-node__item-editor')).toBe(true); + wrapper.setData({ editingValue: modifiedName }); + wrapper.find('.explorer-node__item-editor .text-input').trigger('keydown', { + keyCode: 27, + }); + expect(store.getters['explorer/selectedNode'].item.name).not.toEqual(modifiedName); + await specUtils.expectBadge('renameFile', false); + }); + + it('should rename folder', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('Rename'); + expect(wrapper.contains('.explorer-node__item-editor')).toBe(true); + wrapper.setData({ editingValue: modifiedName }); + wrapper.find('.explorer-node__item-editor .text-input').trigger('blur'); + expect(store.getters['explorer/selectedNode'].item.name).toEqual(modifiedName); + await specUtils.expectBadge('renameFolder'); + }); + + it('should cancel rename folder on escape', async () => { + const node = await makeFolderNode(); + const wrapper = mount(node); + wrapper.trigger('contextmenu'); + await specUtils.resolveContextMenu('Rename'); + expect(wrapper.contains('.explorer-node__item-editor')).toBe(true); + wrapper.setData({ editingValue: modifiedName }); + wrapper.find('.explorer-node__item-editor .text-input').trigger('keydown', { + keyCode: 27, + }); + expect(store.getters['explorer/selectedNode'].item.name).not.toEqual(modifiedName); + await specUtils.expectBadge('renameFolder', false); + }); + + it('should not rename the trash folder', async () => { + const node = store.getters['explorer/nodeMap'].trash; + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('Rename').disabled).toBe(true); + }); + + it('should not rename the temp folder', async () => { + const node = store.getters['explorer/nodeMap'].temp; + mount(node).trigger('contextmenu'); + expect(specUtils.getContextMenuItem('Rename').disabled).toBe(true); + }); + + it('should move file into a folder', async () => { + const sourceItem = await workspaceSvc.createFile({}, true); + const targetItem = await workspaceSvc.storeItem({ type: 'folder' }); + dragAndDrop(sourceItem, targetItem); + await specUtils.expectBadge('moveFile'); + }); + + it('should move folder into a folder', async () => { + const sourceItem = await workspaceSvc.storeItem({ type: 'folder' }); + const targetItem = await workspaceSvc.storeItem({ type: 'folder' }); + dragAndDrop(sourceItem, targetItem); + await specUtils.expectBadge('moveFolder'); + }); + + it('should move file into a file parent folder', async () => { + const targetItem = await workspaceSvc.storeItem({ type: 'folder' }); + const file = await workspaceSvc.createFile({ parentId: targetItem.id }, true); + const sourceItem = await workspaceSvc.createFile({}, true); + dragAndDrop(sourceItem, file); + await specUtils.expectBadge('moveFile'); + }); + + it('should not move the trash folder', async () => { + const sourceNode = store.getters['explorer/nodeMap'].trash; + mountAndSelect(sourceNode).find('.explorer-node__item').trigger('dragstart'); + expect(store.state.explorer.dragSourceId).not.toEqual('trash'); + }); + + it('should not move the temp folder', async () => { + const sourceNode = store.getters['explorer/nodeMap'].temp; + mountAndSelect(sourceNode).find('.explorer-node__item').trigger('dragstart'); + expect(store.state.explorer.dragSourceId).not.toEqual('temp'); + }); + + it('should not move file to the temp folder', async () => { + const targetNode = store.getters['explorer/nodeMap'].temp; + const wrapper = mount(targetNode); + wrapper.trigger('dragenter'); + expect(store.state.explorer.dragTargetId).not.toEqual('temp'); + }); + + it('should not move file to a file in the temp folder', async () => { + const file = await workspaceSvc.createFile({ parentId: 'temp' }, true); + const targetNode = store.getters['explorer/nodeMap'][file.id]; + const wrapper = mount(targetNode); + wrapper.trigger('dragenter'); + expect(store.state.explorer.dragTargetId).not.toEqual(file.id); + }); +}); diff --git a/test/unit/specs/components/NavigationBar.spec.js b/test/unit/specs/components/NavigationBar.spec.js new file mode 100644 index 0000000..5573df0 --- /dev/null +++ b/test/unit/specs/components/NavigationBar.spec.js @@ -0,0 +1,19 @@ +import NavigationBar from '../../../../src/components/NavigationBar'; +import store from '../../../../src/store'; +import specUtils from '../specUtils'; + +describe('NavigationBar.vue', () => { + it('should toggle the explorer', async () => specUtils.checkToggler( + NavigationBar, + wrapper => wrapper.find('.navigation-bar__button--explorer-toggler').trigger('click'), + () => store.getters['data/layoutSettings'].showExplorer, + 'toggleExplorer', + )); + + it('should toggle the side bar', async () => specUtils.checkToggler( + NavigationBar, + wrapper => wrapper.find('.navigation-bar__button--stackedit').trigger('click'), + () => store.getters['data/layoutSettings'].showSideBar, + 'toggleSideBar', + )); +}); diff --git a/test/unit/specs/components/Notification.spec.js b/test/unit/specs/components/Notification.spec.js new file mode 100644 index 0000000..4ac3cf3 --- /dev/null +++ b/test/unit/specs/components/Notification.spec.js @@ -0,0 +1,38 @@ +import { shallowMount } from '@vue/test-utils'; +import Notification from '../../../../src/components/Notification'; +import store from '../../../../src/store'; +import '../specUtils'; + +const mount = () => shallowMount(Notification, { store }); + +describe('Notification.vue', () => { + it('should autoclose itself', async () => { + const wrapper = mount(); + expect(wrapper.contains('.notification__item')).toBe(false); + store.dispatch('notification/showItem', { + type: 'info', + content: 'Test', + timeout: 10, + }); + expect(wrapper.contains('.notification__item')).toBe(true); + await new Promise(resolve => setTimeout(resolve, 10)); + expect(wrapper.contains('.notification__item')).toBe(false); + }); + + it('should show messages from top to bottom', async () => { + const wrapper = mount(); + store.dispatch('notification/info', 'Test 1'); + store.dispatch('notification/info', 'Test 2'); + const items = wrapper.findAll('.notification__item'); + expect(items.length).toEqual(2); + expect(items.at(0).text()).toMatch(/Test 1/); + expect(items.at(1).text()).toMatch(/Test 2/); + }); + + it('should not open the same message twice', async () => { + const wrapper = mount(); + store.dispatch('notification/info', 'Test'); + store.dispatch('notification/info', 'Test'); + expect(wrapper.findAll('.notification__item').length).toEqual(1); + }); +}); diff --git a/test/unit/specs/specUtils.js b/test/unit/specs/specUtils.js new file mode 100644 index 0000000..fbf308c --- /dev/null +++ b/test/unit/specs/specUtils.js @@ -0,0 +1,58 @@ +import { shallowMount } from '@vue/test-utils'; +import store from '../../../src/store'; +import utils from '../../../src/services/utils'; +import '../../../src/icons'; +import '../../../src/components/common/vueGlobals'; + +const clone = object => JSON.parse(JSON.stringify(object)); + +const deepAssign = (target, origin) => { + Object.entries(origin).forEach(([key, value]) => { + const type = Object.prototype.toString.call(value); + if (type === '[object Object]' && Object.keys(value).length) { + deepAssign(target[key], value); + } else { + target[key] = value; + } + }); +}; + +const freshState = clone(store.state); + +beforeEach(() => { + // Restore store state before each test + deepAssign(store.state, clone(freshState)); +}); + +export default { + async checkToggler(Component, toggler, checker, featureId) { + const wrapper = shallowMount(Component, { store }); + const valueBefore = checker(); + toggler(wrapper); + const valueAfter = checker(); + expect(valueAfter).toEqual(!valueBefore); + await this.expectBadge(featureId); + }, + async resolveModal(type) { + const config = store.getters['modal/config']; + expect(config).toBeTruthy(); + expect(config.type).toEqual(type); + config.resolve(); + await new Promise(resolve => setTimeout(resolve, 1)); + }, + getContextMenuItem(name) { + return utils.someResult(store.state.contextMenu.items, item => item.name === name && item); + }, + async resolveContextMenu(name) { + const item = this.getContextMenuItem(name); + expect(item).toBeTruthy(); + store.state.contextMenu.resolve(item); + await new Promise(resolve => setTimeout(resolve, 1)); + }, + async expectBadge(featureId, isEarned = true) { + await new Promise(resolve => setTimeout(resolve, 1)); + expect(store.getters['data/allBadges'].filter(badge => badge.featureId === featureId)[0]).toMatchObject({ + isEarned, + }); + }, +};