diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000000..5f957612b5 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,182 @@ +env: + browser: true + es6: true + jest: true +extends: +- eslint:recommended +globals: + React: readonly +parserOptions: + ecmaFeatures: + jsx: true + ecmaVersion: 10 + sourceType: module +root: true +rules: + # Only list rules that are not in *:recommended set + # If rules are set to disable the one in *:recommended, please elaborate the reason + + # Group - Best Practices + no-async-promise-executor: error + no-await-in-loop: error + no-console: + - error + - allow: + - error + - warn + no-extra-parens: error + no-misleading-character-class: error + no-template-curly-in-string: error + require-atomic-updates: error + accessor-pairs: error + block-scoped-var: error + class-methods-use-this: + - error + - exceptMethods: + - render + complexity: error + curly: error + default-case: error + dot-notation: error + eqeqeq: error + max-classes-per-file: + - error + - 2 + no-alert: error + no-caller: error + no-div-regex: error + no-else-return: error + no-empty-function: error + no-eq-null: error + no-eval: error + no-extend-native: error + no-extra-bind: error + no-extra-label: error + no-implicit-globals: error + no-implied-eval: error + no-invalid-this: error + no-iterator: error + no-labels: error + no-lone-blocks: error + no-magic-numbers: + - error + - ignore: + - 0 + - 1 + no-multi-spaces: + - error + - ignoreEOLComments: true + no-multi-str: error + no-new: error + no-new-func: error + no-new-wrappers: error + no-octal-escape: error + no-proto: error + no-return-assign: error + no-return-await: error + no-script-url: error + no-self-compare: error + no-sequences: error + no-throw-literal: error + no-unmodified-loop-condition: error + no-unused-expressions: + - error + - allowShortCircuit: true + allowTernary: true + no-useless-call: error + no-useless-catch: error + no-useless-concat: error + no-useless-return: error + no-void: error + no-with: error + prefer-promise-reject-errors: error + radix: error + require-await: error + require-unicode-regexp: error + wrap-iife: error + yoda: error + + # Group - Variables + no-label-var: error + + # Re-enable later + # no-shadow: + # - error + # - builtinGlobals: true + # hoist: all + + no-shadow-restricted-names: error + no-undef-init: error + + # "undefined" is commonly used for defaults + # no-undefined: off + + no-unused-vars: + - error + - argsIgnorePattern: ^_$ + varsIgnorePattern: ^_ + no-use-before-define: error + + # Group - Node.js and CommonJS + callback-return: error + global-require: error + handle-callback-err: error + no-buffer-constructor: error + no-mixed-requires: error + no-new-require: error + no-path-concat: error + no-sync: error + + # Group - ECMAScript 6 + arrow-body-style: + - error + - as-needed + arrow-parens: + - error + - as-needed + arrow-spacing: + - error + - after: true + before: true + generator-star-spacing: + - error + - after + + # Will produce shorter code if "off" + # no-confusing-arrow: + # - error + # - allowParens: true # This will conflict with no-extra-parens + + no-duplicate-imports: error + no-useless-computed-key: error + no-useless-constructor: error + no-useless-rename: error + no-var: error + object-shorthand: error + prefer-arrow-callback: error + prefer-const: error + prefer-destructuring: error + prefer-rest-params: error + prefer-spread: error + + # This will force, a + '', into, `${ a }`, which increase code length + # prefer-template: error + + rest-spread-spacing: + - error + - never + + # Cannot group global or local imports and sort in differently + # sort-imports: + # - error + # - ignoreCase: true + + template-curly-spacing: + - error + - always + yield-star-spacing: + - error + - after +settings: + react: + version: detect diff --git a/CHANGELOG.md b/CHANGELOG.md index 4439058b02..40116d38fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added something, by [@johndoe](https://github.com/johndoe), in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX) --> +### Added +- `*`: Added [`eslint`](https://npmjs.com/package/eslint/) to static code analysis, by [@compulim](https://github.com/compulim), in PR [#1970](https://github.com/microsoft/BotFramework-WebChat/pull/1970) + ### Changed - `*`: Bump to: - [`lerna@3.13.4`](https://npmjs.com/package/lerna/), diff --git a/package-lock.json b/package-lock.json index 8ec170865e..f7308e9559 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7172,13 +7172,13 @@ "dependencies": { "core-js": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", "dev": true }, "es6-promise": { "version": "3.0.2", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", "dev": true }, @@ -7190,7 +7190,7 @@ }, "readable-stream": { "version": "2.0.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "dev": true, "requires": { @@ -7654,7 +7654,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -7737,7 +7737,7 @@ "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true } @@ -8177,7 +8177,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true } @@ -9280,13 +9280,13 @@ "dependencies": { "mime-db": { "version": "1.33.0", - "resolved": "http://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "dev": true }, "mime-types": { "version": "2.1.18", - "resolved": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { @@ -10496,7 +10496,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", "dev": true }, diff --git a/package.json b/package.json index f8fed7c5a1..2d39e7037e 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "build:sample": "lerna run --scope=sample-* --stream build", "clean": "lerna run --scope=botframework-webchat* --parallel --stream clean", "coveralls": "cat ./coverage/lcov.info | coveralls", + "eslint": "lerna run --scope=botframework-webchat* --parallel --stream eslint", "lerna-publish": "lerna publish", "prepublishOnly": "lerna run --scope=botframework-webchat* --scope=playground --stream prepublishOnly", "test": "jest --no-cache", diff --git a/packages/bundle/.eslintrc.yml b/packages/bundle/.eslintrc.yml new file mode 100644 index 0000000000..63002b7d52 --- /dev/null +++ b/packages/bundle/.eslintrc.yml @@ -0,0 +1,98 @@ +extends: +- plugin:react/recommended +- plugin:@typescript-eslint/recommended +parser: "@typescript-eslint/parser" +plugins: +- "@typescript-eslint" +rules: + # We will rework on these rules + "@typescript-eslint/explicit-member-accessibility": off + "@typescript-eslint/explicit-function-return-type": off + "@typescript-eslint/indent": off + "@typescript-eslint/no-explicit-any": off + "@typescript-eslint/interface-name-prefix": off + + react/button-has-type: error + react/default-props-match-prop-types: error + react/destructuring-assignment: error + react/forbid-component-props: + - error + - forbid: + - style + react/forbid-dom-props: + - error + - forbid: + - id + # react/forbid-prop-types: error // How to deal with Adaptive Card schema? + react/no-access-state-in-setstate: error + react/no-array-index-key: error + react/no-danger: error + react/no-did-mount-set-state: error + react/no-did-update-set-state: error + react/no-redundant-should-component-update: error + react/no-typos: error + react/no-this-in-sfc: error + react/no-unescaped-entities: error + react/no-unsafe: error + react/no-unused-prop-types: error + react/no-unused-state: error + react/no-will-update-set-state: error + react/prefer-es6-class: error + react/prefer-read-only-props: error + react/require-default-props: error + react/self-closing-comp: error + react/sort-prop-types: error + react/state-in-constructor: error + react/static-property-placement: + - error + - property assignment + react/style-prop-object: error + react/void-dom-elements-no-children: error + react/jsx-boolean-value: + - error + - always + react/jsx-closing-bracket-location: + - error + - tag-aligned + react/jsx-closing-tag-location: error + react/jsx-curly-spacing: + - error + - spacing: + objectLiterals: never + when: always + react/jsx-equals-spacing: + - error + - never + react/jsx-first-prop-new-line: + - error + - multiline-multiprop + react/jsx-handler-names: error + react/jsx-indent: + - error + - 2 + react/jsx-indent-props: + - error + - 2 + react/jsx-max-props-per-line: + - error + - maximum: 1 + when: multiline + react/jsx-no-bind: error + react/jsx-no-literals: error + react/jsx-one-expression-per-line: + - error + - allow: literal + react/jsx-fragments: + - error + - syntax + react/jsx-pascal-case: error + react/jsx-props-no-multi-spaces: error + react/jsx-sort-default-props: error + react/jsx-sort-props: error + react/jsx-tag-spacing: + - error + - afterOpening: never + beforeClosing: never + beforeSelfClosing: always + closingSlash: never + # react/jsx-wrap-multilines: error // Conflict with no-extra-parens diff --git a/packages/bundle/package-lock.json b/packages/bundle/package-lock.json index 5cad2b34fd..7666282ea5 100644 --- a/packages/bundle/package-lock.json +++ b/packages/bundle/package-lock.json @@ -34,7 +34,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -699,7 +698,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -1402,6 +1400,49 @@ "csstype": "^2.2.0" } }, + "@typescript-eslint/eslint-plugin": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.7.0.tgz", + "integrity": "sha512-NUSz1aTlIzzTjFFVFyzrbo8oFjHg3K/M9MzYByqbMCxeFdErhLAcGITVfXzSz+Yvp5OOpMu3HkIttB0NyKl54Q==", + "dev": true, + "requires": { + "@typescript-eslint/parser": "1.7.0", + "@typescript-eslint/typescript-estree": "1.7.0", + "eslint-utils": "^1.3.1", + "regexpp": "^2.0.1", + "requireindex": "^1.2.0", + "tsutils": "^3.7.0" + } + }, + "@typescript-eslint/parser": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.7.0.tgz", + "integrity": "sha512-1QFKxs2V940372srm12ovSE683afqc1jB6zF/f8iKhgLz1yoSjYeGHipasao33VXKI+0a/ob9okeogGdKGvvlg==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "1.7.0", + "eslint-scope": "^4.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.7.0.tgz", + "integrity": "sha512-K5uedUxVmlYrVkFbyV3htDipvLqTE3QMOUQEHYJaKtgzxj6r7c5Ca/DG1tGgFxX+fsbi9nDIrf4arq7Ib7H/Yw==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "@webassemblyjs/ast": { "version": "1.8.5", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", @@ -1593,8 +1634,7 @@ "acorn": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==" }, "acorn-dynamic-import": { "version": "4.0.0", @@ -1602,6 +1642,11 @@ "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", "dev": true }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==" + }, "adaptivecards": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/adaptivecards/-/adaptivecards-1.1.3.tgz", @@ -1611,7 +1656,6 @@ "version": "6.9.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", - "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -1637,6 +1681,11 @@ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==" + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -1704,6 +1753,16 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -1776,6 +1835,11 @@ "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=", "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==" + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -2730,8 +2794,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -2847,7 +2910,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3038,6 +3100,11 @@ "unset-value": "^1.0.0" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", @@ -3060,6 +3127,11 @@ "supports-color": "^5.3.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "chokidar": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz", @@ -3128,6 +3200,19 @@ } } }, + "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=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -3238,8 +3323,7 @@ "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 + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -3461,7 +3545,6 @@ "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", @@ -3540,6 +3623,20 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "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=" + }, + "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": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -3641,6 +3738,14 @@ "randombytes": "^2.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -3737,6 +3842,11 @@ "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==" + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", @@ -3796,11 +3906,151 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "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=" }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "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=" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-plugin-react": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz", + "integrity": "sha512-uA5LrHylu8lW/eAH3bEQe9YdzpPaFd9yAJTwTi/i/BKTD7j6aQMKVAdGM/ML72zD6womuSK7EiGtMKuK06lWjQ==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.1.0", + "object.fromentries": "^2.0.0", + "prop-types": "^15.7.2", + "resolve": "^1.10.1" + }, + "dependencies": { + "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" + } + }, + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -3811,17 +4061,49 @@ "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==" + }, + "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==" + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, "esprima-fb": { "version": "15001.1.0-dev-harmony-fb", "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=", "dev": true }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "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" } @@ -3829,14 +4111,12 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "event-as-promise": { "version": "1.0.5", @@ -3994,6 +4274,16 @@ } } }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -4062,14 +4352,17 @@ "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 + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" }, "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=", - "dev": true + "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=" }, "fbjs": { "version": "0.6.1", @@ -4104,6 +4397,22 @@ "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", "dev": true }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "requires": { + "flat-cache": "^2.0.1" + } + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -4177,6 +4486,21 @@ } } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==" + }, "flush-write-stream": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", @@ -4321,8 +4645,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.7", @@ -4872,6 +5195,17 @@ } } }, + "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=" + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -4897,7 +5231,6 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4995,8 +5328,7 @@ "globals": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", - "dev": true + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==" }, "graceful-fs": { "version": "4.1.15", @@ -5004,6 +5336,15 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, + "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" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -5018,6 +5359,12 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -5129,7 +5476,6 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -5146,6 +5492,27 @@ "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "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==" + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + } + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -5159,8 +5526,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indexof": { "version": "0.0.1", @@ -5172,7 +5538,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -5189,6 +5554,49 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "inquirer": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "rxjs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", + "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", + "requires": { + "tslib": "^1.9.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==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "interpret": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", @@ -5251,6 +5659,12 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "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-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -5271,6 +5685,12 @@ } } }, + "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-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -5331,8 +5751,7 @@ "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 + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-glob": { "version": "4.0.0", @@ -5392,12 +5811,35 @@ "dev": true, "optional": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "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-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -5413,8 +5855,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -5454,6 +5895,15 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5469,8 +5919,12 @@ "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 + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "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=" }, "json5": { "version": "2.1.0", @@ -5519,6 +5973,15 @@ } } }, + "jsx-ast-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz", + "integrity": "sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA==", + "dev": true, + "requires": { + "array-includes": "^3.0.3" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -5534,6 +5997,15 @@ "invert-kv": "^2.0.0" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "linkify-it": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", @@ -5601,8 +6073,7 @@ "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "lodash.clonedeep": { "version": "4.5.0", @@ -5629,6 +6100,12 @@ "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==" }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -5816,8 +6293,7 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "minimalistic-assert": { "version": "1.0.1", @@ -5835,7 +6311,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -5843,8 +6318,7 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mississippi": { "version": "3.0.0", @@ -5889,7 +6363,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" } @@ -5914,6 +6387,11 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + }, "nan": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", @@ -5940,6 +6418,11 @@ "to-regex": "^3.0.1" } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, "neo-async": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", @@ -5949,8 +6432,7 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-libs-browser": { "version": "2.2.0", @@ -6094,6 +6576,12 @@ } } }, + "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-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -6103,6 +6591,18 @@ "isobject": "^3.0.0" } }, + "object.fromentries": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", + "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.11.0", + "function-bind": "^1.1.1", + "has": "^1.0.1" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -6127,11 +6627,31 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "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" + } + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -6158,8 +6678,7 @@ "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 + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "output-file-sync": { "version": "2.0.1", @@ -6257,6 +6776,14 @@ } } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } + }, "parse-asn1": { "version": "5.1.4", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", @@ -6346,14 +6873,17 @@ "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 + "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=" }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -6424,6 +6954,11 @@ } } }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", @@ -6449,6 +6984,11 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", @@ -6530,8 +7070,7 @@ "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 + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" }, "q": { "version": "1.5.1", @@ -6767,6 +7306,11 @@ "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==", "dev": true }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" + }, "regexpu-core": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", @@ -6843,6 +7387,12 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -6883,6 +7433,15 @@ "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=", + "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", @@ -6893,7 +7452,6 @@ "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -6908,6 +7466,14 @@ "inherits": "^2.0.1" } }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "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", @@ -6942,8 +7508,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sanitize-html": { "version": "1.20.0", @@ -6985,8 +7550,7 @@ "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" }, "serialize-javascript": { "version": "1.6.1", @@ -7043,7 +7607,6 @@ "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" } @@ -7051,14 +7614,12 @@ "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 + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-update-in": { "version": "1.4.0", @@ -7071,6 +7632,16 @@ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -7417,7 +7988,6 @@ "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" @@ -7426,14 +7996,12 @@ "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "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" } @@ -7469,6 +8037,11 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -7482,6 +8055,42 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" }, + "table": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", + "requires": { + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "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==", + "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==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "tapable": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", @@ -7545,11 +8154,15 @@ "require-main-filename": "^1.0.1" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { "version": "2.0.5", @@ -7596,6 +8209,14 @@ "setimmediate": "^1.0.4" } }, + "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" + } + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -7665,8 +8286,16 @@ "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "tsutils": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.10.0.tgz", + "integrity": "sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } }, "tty-browserify": { "version": "0.0.0", @@ -7674,6 +8303,14 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "~1.1.2" + } + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -7828,7 +8465,6 @@ "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" } @@ -8052,7 +8688,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -8063,6 +8698,11 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, "worker-farm": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", @@ -8107,8 +8747,15 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "requires": { + "mkdirp": "^0.5.1" + } }, "xtend": { "version": "4.0.1", diff --git a/packages/bundle/package.json b/packages/bundle/package.json index 8e424009b1..b2b458818f 100644 --- a/packages/bundle/package.json +++ b/packages/bundle/package.json @@ -18,12 +18,13 @@ "homepage": "https://github.com/Microsoft/BotFramework-WebChat/#readme", "scripts": { "build": "npm run build:typecheck && npm run build:babel-instrumented && webpack-cli --config webpack-instrumented.config.js --run-dev", - "build:babel": "babel --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__test__/**/*.js,__test__/**/*.ts,__test__/**/*.tsx --out-dir lib --source-maps inline --verbose src", + "build:babel": "babel --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__tests__/**/*.js,__tests__/**/*.ts,__tests__/**/*.tsx --out-dir lib --source-maps inline --verbose src", "build:babel-instrumented": "npm run build:babel -- --env-name test", "build:typecheck": "tsc", "clean": "npm run clean:dist && npm run clean:lib", "clean:dist": "rimraf dist", "clean:lib": "rimraf lib", + "eslint": "eslint src/**/*.js src/**/*.ts --ignore-pattern *.spec.[jt]sx? --ignore-pattern *.test.[jt]sx?", "prepublishOnly": "npm run build:typecheck && npm run build:babel && webpack-cli", "watch": "concurrently --names \"babel,typecheck,webpack\" \"npm run watch:babel\" \"npm run watch:typecheck\" \"npm run watch:webpack\"", "watch:babel": "npm run build:babel-instrumented -- --watch", @@ -34,13 +35,15 @@ "@babel/runtime": "^7.4.3", "adaptivecards": "~1.1.3", "botframework-directlinejs": "^0.11.4", - "botframework-webchat-component": "^0.0.0-0", - "botframework-webchat-core": "^0.0.0-0", + "botframework-webchat-component": "0.0.0-0", + "botframework-webchat-core": "0.0.0-0", "core-js": "^2.5.7", + "eslint": "^5.16.0", "markdown-it": "^8.4.2", "markdown-it-for-inline": "^0.1.1", "memoize-one": "^5.0.2", "microsoft-speech-browser-sdk": "^0.0.12", + "prop-types": "^15.7.2", "react": "^16.5.0", "react-dom": "^16.5.0", "sanitize-html": "^1.19.0", @@ -59,9 +62,12 @@ "@babel/preset-typescript": "^7.3.3", "@types/node": "^10.9.4", "@types/react": "^16.4.13", + "@typescript-eslint/eslint-plugin": "^1.7.0", + "@typescript-eslint/parser": "^1.7.0", "babel-plugin-istanbul": "^5.1.0", "babel-plugin-version-transform": "^1.0.0", "concurrently": "^4.0.1", + "eslint-plugin-react": "^7.13.0", "terser-webpack-plugin": "^1.2.3", "typescript": "^3.1.6", "webpack": "^4.30.0", diff --git a/packages/bundle/src/FullReactWebChat.js b/packages/bundle/src/FullReactWebChat.js index 88843315b5..b90344f3bf 100644 --- a/packages/bundle/src/FullReactWebChat.js +++ b/packages/bundle/src/FullReactWebChat.js @@ -1,15 +1,14 @@ import * as adaptiveCards from 'adaptivecards'; +import BasicWebChat, { concatMiddleware } from 'botframework-webchat-component'; import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; -import BasicWebChat, { concatMiddleware } from 'botframework-webchat-component'; - import createAdaptiveCardsAttachmentMiddleware from './adaptiveCards/createAdaptiveCardMiddleware'; - import renderMarkdown from './renderMarkdown'; // Add additional props to , so it support additional features -export default class extends React.Component { +class FullReactWebChat extends React.Component { constructor(props) { super(props); @@ -33,3 +32,13 @@ export default class extends React.Component { ); } } + +FullReactWebChat.defaultProps = { + attachmentMiddleware: undefined +}; + +FullReactWebChat.propTypes = { + attachmentMiddleware: PropTypes.func +}; + +export default FullReactWebChat diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.js index 343cdd7e2a..84468fc510 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.js @@ -1,10 +1,9 @@ import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; -import { AdaptiveCard } from 'adaptivecards'; - function stripSubmitAction(card) { if (!card.actions) { return card; @@ -27,7 +26,7 @@ export default class AdaptiveCardAttachment extends React.Component { constructor(props) { super(props); - this.createAdaptiveCard = memoize((adaptiveCards, content, renderMarkdown) => { + this.createAdaptiveCard = memoize((adaptiveCards, content) => { const card = new adaptiveCards.AdaptiveCard(); const errors = []; @@ -39,7 +38,7 @@ export default class AdaptiveCardAttachment extends React.Component { ...content })); - AdaptiveCard.onParseError = null; + adaptiveCards.AdaptiveCard.onParseError = null; return { card, @@ -49,11 +48,19 @@ export default class AdaptiveCardAttachment extends React.Component { } render() { - const { props: { adaptiveCards, attachment, renderMarkdown } } = this; - const { card } = this.createAdaptiveCard(adaptiveCards, attachment.content, renderMarkdown); + const { props: { adaptiveCards, attachment: { content } } } = this; + const { card } = this.createAdaptiveCard(adaptiveCards, content); return ( ); } } + +AdaptiveCardAttachment.propTypes = { + // TODO: [P2] We should rename adaptiveCards to adaptiveCardsPolyfill + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.any.isRequired + }).isRequired +}; diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts index b4ae2bc418..d95ccd8b64 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts @@ -23,13 +23,15 @@ export interface BotFrameworkCardAction { function addCardAction(cardAction: CardAction, includesOAuthButtons?: boolean) { const { type } = cardAction; + let action; + if ( type === 'imBack' || type === 'messageBack' || type === 'postBack' - || (type === 'signin' && includesOAuthButtons) + || type === 'signin' && includesOAuthButtons ) { - const action = new SubmitAction(); + action = new SubmitAction(); action.data = { __isBotFrameworkCardAction: true, @@ -37,16 +39,14 @@ function addCardAction(cardAction: CardAction, includesOAuthButtons?: boolean) { }; action.title = cardAction.title; - - return action; } else { - const action = new OpenUrlAction(); + action = new OpenUrlAction(); action.title = cardAction.title; - action.url = cardAction.type === 'call' ? 'tel:' + cardAction.value : cardAction.value; - - return action; + action.url = cardAction.type === 'call' ? `tel:${ cardAction.value }` : cardAction.value; } + + return action; } export default class AdaptiveCardBuilder { @@ -86,11 +86,12 @@ export default class AdaptiveCardBuilder { // tslint:disable-next-line:forin for (const prop in template) { - (textblock as any)[prop] = (template as any)[prop]; + textblock[prop] = template[prop]; } textblock.speak = text; textblock.text = text; + container.addItem(textblock); } } diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js index d6f3c2310b..fb0b4ff4e2 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js +++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.js @@ -1,4 +1,7 @@ +/* eslint no-magic-numbers: ["error", { "ignore": [0, 2] }] */ + import { HostConfig } from 'adaptivecards'; +import PropTypes from 'prop-types'; import React from 'react'; import { Components, connectToWebChat, getTabIndex, localize } from 'botframework-webchat-component'; @@ -6,7 +9,7 @@ import { Components, connectToWebChat, getTabIndex, localize } from 'botframewor const { ErrorBox } = Components; function isPlainObject(obj) { - return obj.__proto__ === Object.prototype; + return Object.getPrototypeOf(obj) === Object.prototype; } class AdaptiveCardRenderer extends React.PureComponent { @@ -27,37 +30,37 @@ class AdaptiveCardRenderer extends React.PureComponent { this.renderCard(); } - componentDidUpdate(prevProps) { - if (prevProps.adaptiveCard !== this.props.adaptiveCard) { - this.renderCard(); - } + componentDidUpdate({ adaptiveCard: prevAdaptiveCard }) { + const { adaptiveCard } = this.props; + + prevAdaptiveCard !== adaptiveCard && this.renderCard(); } handleClick({ target }) { - // Some items, e.g. tappable text, cannot be disabled thru DOM attributes - if (this.props.disabled) { return; } + const { disabled, onCardAction, tapAction } = this.props; - const tabIndex = getTabIndex(target); - - // If the user is clicking on something that is already clickable, do not allow them to click the card. - // E.g. a hero card can be tappable, and image and buttons inside the hero card can also be tappable. - if (typeof tabIndex !== 'number' || tabIndex < 0) { - const { props: { onCardAction, tapAction } } = this; + // Some items, e.g. tappable text, cannot be disabled thru DOM attributes + if (!disabled) { + const tabIndex = getTabIndex(target); - tapAction && onCardAction(tapAction); + // If the user is clicking on something that is already clickable, do not allow them to click the card. + // E.g. a hero card can be tappable, and image and buttons inside the hero card can also be tappable. + if (typeof tabIndex !== 'number' || tabIndex < 0) { + tapAction && onCardAction(tapAction); + } } } handleExecuteAction(action) { - const { props } = this; + const { disabled, onCardAction } = this.props; // Some items, e.g. tappable image, cannot be disabled thru DOM attributes - if (props.disabled) { return; } + if (disabled) { return; } const actionTypeName = action.getJsonTypeName(); if (actionTypeName === 'Action.OpenUrl') { - props.onCardAction({ + onCardAction({ type: 'openUrl', value: action.url }); @@ -69,9 +72,9 @@ class AdaptiveCardRenderer extends React.PureComponent { const { cardAction } = actionData; const { displayText, type, value } = cardAction; - props.onCardAction({ displayText, type, value }); + onCardAction({ displayText, type, value }); } else { - props.onCardAction({ + onCardAction({ type: typeof action.data === 'string' ? 'imBack' : 'postBack', value: action.data }); @@ -84,8 +87,20 @@ class AdaptiveCardRenderer extends React.PureComponent { } renderCard() { - const { current } = this.contentRef; - const { props: { adaptiveCard, adaptiveCardHostConfig, renderMarkdown } } = this; + const { + contentRef: { + current + }, + props: { + adaptiveCard, + adaptiveCardHostConfig, + disabled, + renderMarkdown + }, + state: { + error + } + } = this; if (current && adaptiveCard) { // Currently, the only way to set the Markdown engine is to set it thru static member of AdaptiveCard class @@ -110,6 +125,8 @@ class AdaptiveCardRenderer extends React.PureComponent { const errors = adaptiveCard.validate(); if (errors.length) { + // TODO: [P3] Since this can be called from `componentDidUpdate` and potentially error, we should fix a better way to propagate the error. + return this.setState(() => ({ error: errors })); } @@ -117,19 +134,17 @@ class AdaptiveCardRenderer extends React.PureComponent { try { element = adaptiveCard.render(); - } catch (err) { - return this.setState(() => ({ errors: err })); + } catch (error) { + return this.setState(() => ({ error })); } if (!element) { return this.setState(() => ({ error: 'Adaptive Card rendered as empty element' })); } - if (this.state.error) { - this.setState(() => ({ error: null })); - } + error && this.setState(() => ({ error: null })); - if (this.props.disabled) { + if (disabled) { const hyperlinks = element.querySelectorAll('a'); const inputs = element.querySelectorAll('button, input, select, textarea'); @@ -146,7 +161,7 @@ class AdaptiveCardRenderer extends React.PureComponent { }); } - const firstChild = current.children[0]; + const [firstChild] = current.children; if (firstChild) { current.replaceChild(element, firstChild); @@ -165,7 +180,9 @@ class AdaptiveCardRenderer extends React.PureComponent { return ( error ? -
{ JSON.stringify(error, null, 2) }
+
+            { JSON.stringify(error, null, 2) }
+          
:
    { - content.media.map((media, index) => + media.map(({ profile = '', url }, index) =>
  • { - /\.gif$/i.test(media.url) ? + /\.gif$/iu.test(url) ? : }
  • @@ -57,6 +68,23 @@ class AnimationCardAttachment extends React.Component { } } +AnimationCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + media: PropTypes.arrayOf( + PropTypes.shape({ + profile: PropTypes.string, + url: PropTypes.string.isRequired + }) + ).isRequired + }).isRequired + }).isRequired, + styleSet: PropTypes.shape({ + animationCardAttachment: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) )(AnimationCardAttachment) diff --git a/packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.js index 91289fc2bd..fbaa38a616 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/AudioCardAttachment.js @@ -1,37 +1,70 @@ -import React from 'react'; +/* eslint react/no-array-index-key: "off" */ import { Components, connectToWebChat } from 'botframework-webchat-component'; +import PropTypes from 'prop-types'; +import React from 'react'; + import CommonCard from './CommonCard'; const { AudioContent } = Components; +const AudioCardAttachment = ({ + adaptiveCards, + attachment, + attachment: { + content: { + autostart = false, + autoloop = false, + image: { + url: imageURL = '' + }, + media = [] + } = {} + } = {}, + styleSet +}) => +
    +
      + { + media.map(({ url }, index) => +
    • + +
    • + ) + } +
    + +
    ; + +AudioCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + autostart: PropTypes.bool, + autoloop: PropTypes.bool, + image: PropTypes.shape({ + url: PropTypes.string.isRequired + }), + media: PropTypes.arrayOf( + PropTypes.shape({ + url: PropTypes.string.isRequired + }).isRequired + ).isRequired + }) + }).isRequired, + styleSet: PropTypes.shape({ + audioCardAttachment: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ - adaptiveCards, - attachment, - attachment: { content = {} } = {}, - styleSet - }) => -
    -
      - { - content.media.map((media, index) => -
    • - -
    • - ) - } -
    - -
    -) +)(AudioCardAttachment) diff --git a/packages/bundle/src/adaptiveCards/Attachment/CommonCard.js b/packages/bundle/src/adaptiveCards/Attachment/CommonCard.js index ff9bd3d357..758d3736e7 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/CommonCard.js +++ b/packages/bundle/src/adaptiveCards/Attachment/CommonCard.js @@ -1,10 +1,11 @@ import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardBuilder from './AdaptiveCardBuilder'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; -export default class extends React.Component { +export default class CommonCard extends React.Component { constructor(props) { super(props); @@ -21,15 +22,27 @@ export default class extends React.Component { const { props: { adaptiveCards, - attachment: { content } = {} + attachment: { + content, + content: { tap } = {} + } = {} } } = this; return ( ); } } + +CommonCard.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + tap: PropTypes.any + }).isRequired + }).isRequired +}; diff --git a/packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.js index e09b2891c7..4f677abe0c 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/HeroCardAttachment.js @@ -1,10 +1,11 @@ import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardBuilder from './AdaptiveCardBuilder'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; -export default class extends React.Component { +export default class HeroCardAttachment extends React.Component { constructor(props) { super(props); @@ -23,15 +24,27 @@ export default class extends React.Component { const { props: { adaptiveCards, - attachment: { content } = {} + attachment: { + content, + content: { tap } = {} + } = {} } } = this; return ( ); } } + +HeroCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + tap: PropTypes.any + }).isRequired + }).isRequired +}; diff --git a/packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.js index 787a3d35da..71963a1cb3 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/OAuthCardAttachment.js @@ -1,10 +1,11 @@ import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardBuilder from './AdaptiveCardBuilder'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; -export default class extends React.Component { +export default class OAuthCardAttachment extends React.Component { constructor(props) { super(props); @@ -12,7 +13,7 @@ export default class extends React.Component { const builder = new AdaptiveCardBuilder(adaptiveCards); builder.addCommonHeaders(content); - builder.addButtons(content.buttons, true); + builder.addButtons((content || {}).buttons, true); return builder.card; }); @@ -22,7 +23,9 @@ export default class extends React.Component { const { props: { adaptiveCards, - attachment: { content } = {} + attachment: { + content + } = {} } } = this; @@ -31,3 +34,12 @@ export default class extends React.Component { ); } } + +OAuthCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + buttons: PropTypes.array + }).isRequired + }).isRequired +}; diff --git a/packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.js index 673f86e799..334327b8b6 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/ReceiptCardAttachment.js @@ -1,7 +1,10 @@ +/* eslint no-magic-numbers: ["error", { "ignore": [0, 1, 10, 15, 25, 75] }] */ + +import { connectToWebChat, localize } from 'botframework-webchat-component'; import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; -import { connectToWebChat, localize } from 'botframework-webchat-component'; import AdaptiveCardBuilder from './AdaptiveCardBuilder'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; @@ -13,60 +16,84 @@ class ReceiptCardAttachment extends React.Component { constructor(props) { super(props); - this.buildCard = memoize((adaptiveCards, content, language) => { + this.buildCard = memoize(( + adaptiveCards, + { + buttons, + facts, + items, + tax, + title, + total, + vat + }, + language + ) => { const builder = new AdaptiveCardBuilder(adaptiveCards); const { HorizontalAlignment, TextSize, TextWeight } = adaptiveCards; - builder.addTextBlock(content.title, { size: TextSize.Medium, weight: TextWeight.Bolder }); + builder.addTextBlock(title, { size: TextSize.Medium, weight: TextWeight.Bolder }); - const columns = builder.addColumnSet([75, 25]); + if (facts) { + const [firstFactColumn, lastFactColumn] = builder.addColumnSet([75, 25]); - // tslint:disable-next-line:no-unused-expression - content.facts && content.facts.map(fact => { - builder.addTextBlock(fact.key, { size: TextSize.Medium }, columns[0]); - builder.addTextBlock(fact.value, { size: TextSize.Medium, horizontalAlignment: HorizontalAlignment.Right }, columns[1]); - }); + // tslint:disable-next-line:no-unused-expression + facts.map(({ key, value }) => { + builder.addTextBlock(key, { size: TextSize.Medium }, firstFactColumn); + builder.addTextBlock(value, { size: TextSize.Medium, horizontalAlignment: HorizontalAlignment.Right }, lastFactColumn); + }); + } // tslint:disable-next-line:no-unused-expression - content.items && content.items.map(item => { - if (item.image) { - const columns = builder.addColumnSet([15, 75, 10]); - - builder.addImage(item.image.url, columns[0], item.image.tap); - builder.addTextBlock(item.title, { size: TextSize.Medium, weight: TextWeight.Bolder, wrap: true }, columns[1]); - builder.addTextBlock(item.subtitle, { size: TextSize.Medium, wrap: true }, columns[1]); - builder.addTextBlock(item.price, { horizontalAlignment: HorizontalAlignment.Right }, columns[2]); + items && items.map(({ + image: { + tap, + url + } = {}, + price, + subtitle, + title + }) => { + let itemColumns; + + if (url) { + const [itemImageColumn, ...columns] = builder.addColumnSet([15, 75, 10]); + + itemColumns = columns; + builder.addImage(url, itemImageColumn, tap); } else { - const columns = builder.addColumnSet([75, 25]); - - builder.addTextBlock(item.title, { size: TextSize.Medium, weight: TextWeight.Bolder, wrap: true }, columns[0]); - builder.addTextBlock(item.subtitle, { size: TextSize.Medium, wrap: true }, columns[0]); - builder.addTextBlock(item.price, { horizontalAlignment: HorizontalAlignment.Right }, columns[1]); + itemColumns = builder.addColumnSet([75, 25]); } + + const [itemTitleColumn, itemPriceColumn] = itemColumns; + + builder.addTextBlock(title, { size: TextSize.Medium, weight: TextWeight.Bolder, wrap: true }, itemTitleColumn); + builder.addTextBlock(subtitle, { size: TextSize.Medium, wrap: true }, itemTitleColumn); + builder.addTextBlock(price, { horizontalAlignment: HorizontalAlignment.Right }, itemPriceColumn); }); - if (!nullOrUndefined(content.vat)) { + if (!nullOrUndefined(vat)) { const vatCol = builder.addColumnSet([75, 25]); builder.addTextBlock(localize('VAT', language), { size: TextSize.Medium, weight: TextWeight.Bolder }, vatCol[0]); - builder.addTextBlock(content.vat, { horizontalAlignment: HorizontalAlignment.Right }, vatCol[1]); + builder.addTextBlock(vat, { horizontalAlignment: HorizontalAlignment.Right }, vatCol[1]); } - if (!nullOrUndefined(content.tax)) { + if (!nullOrUndefined(tax)) { const taxCol = builder.addColumnSet([75, 25]); builder.addTextBlock(localize('Tax', language), { size: TextSize.Medium, weight: TextWeight.Bolder }, taxCol[0]); - builder.addTextBlock(content.tax, { horizontalAlignment: HorizontalAlignment.Right }, taxCol[1]); + builder.addTextBlock(tax, { horizontalAlignment: HorizontalAlignment.Right }, taxCol[1]); } - if (!nullOrUndefined(content.total)) { + if (!nullOrUndefined(total)) { const totalCol = builder.addColumnSet([75, 25]); builder.addTextBlock(localize('Total', language), { size: TextSize.Medium, weight: TextWeight.Bolder }, totalCol[0]); - builder.addTextBlock(content.total, { horizontalAlignment: HorizontalAlignment.Right, size: TextSize.Medium, weight: TextWeight.Bolder }, totalCol[1]); + builder.addTextBlock(total, { horizontalAlignment: HorizontalAlignment.Right, size: TextSize.Medium, weight: TextWeight.Bolder }, totalCol[1]); } - builder.addButtons(content.buttons); + builder.addButtons(buttons); return builder.card; }); @@ -75,7 +102,9 @@ class ReceiptCardAttachment extends React.Component { render() { const { adaptiveCards, - attachment: { content } = {}, + attachment: { + content + } = {}, language } = this.props; @@ -88,6 +117,37 @@ class ReceiptCardAttachment extends React.Component { } } +ReceiptCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + buttons: PropTypes.array, + fact: PropTypes.arrayOf( + PropTypes.shape({ + key: PropTypes.string, + value: PropTypes.string + }) + ), + items: PropTypes.arrayOf( + PropTypes.shape({ + image: PropTypes.shape({ + tap: PropTypes.any, + url: PropTypes.string.isRequired + }), + price: PropTypes.string.isRequired, + subtitle: PropTypes.string, + title: PropTypes.string.isRequired + }) + ), + tax: PropTypes.string, + title: PropTypes.string, + total: PropTypes.string, + vat: PropTypes.string + }).isRequired + }).isRequired, + language: PropTypes.string.isRequired +}; + export default connectToWebChat( ({ language }) => ({ language }) )(ReceiptCardAttachment) diff --git a/packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.js index 45f1801a64..c5d0b8a2c9 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/SignInCardAttachment.js @@ -1,20 +1,29 @@ +import { connectToWebChat } from 'botframework-webchat-component'; +import PropTypes from 'prop-types'; import React from 'react'; import CommonCard from './CommonCard'; -import { connectToWebChat } from 'botframework-webchat-component'; + +const SignInCardAttachment = ({ + adaptiveCards, + attachment, + styleSet +}) => +
    + +
    ; + +SignInCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.any.isRequired, + styleSet: PropTypes.shape({ + animationCardAttachment: PropTypes.any.isRequired + }).isRequired +}; export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ - adaptiveCards, - attachment, - styleSet - }) => -
    - -
    -) +)(SignInCardAttachment) diff --git a/packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.js index b740db268e..ef63092e57 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/ThumbnailCardAttachment.js @@ -1,25 +1,39 @@ +/* eslint no-magic-numbers: ["error", { "ignore": [25, 75] }] */ + import memoize from 'memoize-one'; +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardBuilder from './AdaptiveCardBuilder'; import AdaptiveCardRenderer from './AdaptiveCardRenderer'; -export default class extends React.Component { +export default class ThumbnailCardAttachment extends React.Component { constructor(props) { super(props); - this.buildCard = memoize((adaptiveCards, content) => { + this.buildCard = memoize(( + adaptiveCards, + content + ) => { const builder = new AdaptiveCardBuilder(adaptiveCards); const { TextSize, TextWeight } = adaptiveCards; + const { + buttons, + images, + subtitle, + text, + title + } = content; - if (content.images && content.images.length) { - const columns = builder.addColumnSet([75, 25]); + if (images && images.length) { + const [firstColumn, lastColumn] = builder.addColumnSet([75, 25]); + const [{ tap, url }] = images; - builder.addTextBlock(content.title, { size: TextSize.Medium, weight: TextWeight.Bolder }, columns[0]); - builder.addTextBlock(content.subtitle, { isSubtle: true, wrap: true }, columns[0]); - builder.addImage(content.images[0].url, columns[1], content.images[0].tap); - builder.addTextBlock(content.text, { wrap: true }); - builder.addButtons(content.buttons); + builder.addTextBlock(title, { size: TextSize.Medium, weight: TextWeight.Bolder }, firstColumn); + builder.addTextBlock(subtitle, { isSubtle: true, wrap: true }, firstColumn); + builder.addImage(url, lastColumn, tap); + builder.addTextBlock(text, { wrap: true }); + builder.addButtons(buttons); } else { builder.addCommon(content); } @@ -30,17 +44,37 @@ export default class extends React.Component { render() { const { - props: { - adaptiveCards, - attachment: { content } = {} - } - } = this; + adaptiveCards, + attachment: { + content, + content: { tap } = {} + } = {} + } = this.props; return ( ); } } + +ThumbnailCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + buttons: PropTypes.array, + images: PropTypes.arrayOf( + PropTypes.shape({ + tap: PropTypes.any, + url: PropTypes.string.isRequired + }) + ), + subtitle: PropTypes.string, + tap: PropTypes.any, + text: PropTypes.string, + title: PropTypes.string, + }).isRequired + }).isRequired +}; diff --git a/packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.js index 3c5e52e4e5..8624a41624 100644 --- a/packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.js +++ b/packages/bundle/src/adaptiveCards/Attachment/VideoCardAttachment.js @@ -1,3 +1,6 @@ +/* eslint react/no-array-index-key: "off" */ + +import PropTypes from 'prop-types'; import React from 'react'; import { Components, connectToWebChat } from 'botframework-webchat-component'; @@ -5,33 +8,63 @@ import CommonCard from './CommonCard'; const { VideoContent } = Components; +const VideoCardAttachment = ({ + adaptiveCards, + attachment, + attachment: { + content: { + media, + autostart, + autoloop, + image: { + url: imageURL + } = {}, + } = {} + } = {}, + styleSet +}) => +
    +
      + { + media.map(({ url }, index) => +
    • + +
    • + ) + } +
    + +
    ; + +VideoCardAttachment.propTypes = { + adaptiveCards: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + content: PropTypes.shape({ + autoloop: PropTypes.bool, + autostart: PropTypes.bool, + image: PropTypes.shape({ + url: PropTypes.string + }), + media: PropTypes.arrayOf( + PropTypes.shape({ + url: PropTypes.string + }) + ) + }) + }).isRequired, + styleSet: PropTypes.shape({ + audioCardAttachment: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ - adaptiveCards, - attachment, - attachment: { content = {} } = {}, - styleSet - }) => -
    -
      - { - content.media.map((media, index) => -
    • - -
    • - ) - } -
    - -
    -) +)(VideoCardAttachment) diff --git a/packages/bundle/src/adaptiveCards/createAdaptiveCardMiddleware.js b/packages/bundle/src/adaptiveCards/createAdaptiveCardMiddleware.js index 8b7d3dbbfc..ddcd483f35 100644 --- a/packages/bundle/src/adaptiveCards/createAdaptiveCardMiddleware.js +++ b/packages/bundle/src/adaptiveCards/createAdaptiveCardMiddleware.js @@ -1,3 +1,4 @@ +import PropTypes from 'prop-types'; import React from 'react'; import AdaptiveCardAttachment from './Attachment/AdaptiveCardAttachment'; @@ -12,25 +13,39 @@ import VideoCardAttachment from './Attachment/VideoCardAttachment'; // TODO: [P4] Rename this file or the whole middleware, it looks either too simple or too comprehensive now export default function (props) { - return () => next => ({ activity, attachment }) => - attachment.contentType === 'application/vnd.microsoft.card.hero' ? - - : attachment.contentType === 'application/vnd.microsoft.card.adaptive' ? - - : attachment.contentType === 'application/vnd.microsoft.card.animation' ? - - : attachment.contentType === 'application/vnd.microsoft.card.audio' ? - - : attachment.contentType === 'application/vnd.microsoft.card.oauth' ? - - : attachment.contentType === 'application/vnd.microsoft.card.receipt' ? - - : attachment.contentType === 'application/vnd.microsoft.card.signin' ? - - : attachment.contentType === 'application/vnd.microsoft.card.thumbnail' ? - - : attachment.contentType === 'application/vnd.microsoft.card.video' ? - - : - next({ activity, attachment }); + return () => next => { + function AdaptiveCardMiddleware({ activity, attachment }) { + return ( + attachment.contentType === 'application/vnd.microsoft.card.hero' ? + + : attachment.contentType === 'application/vnd.microsoft.card.adaptive' ? + + : attachment.contentType === 'application/vnd.microsoft.card.animation' ? + + : attachment.contentType === 'application/vnd.microsoft.card.audio' ? + + : attachment.contentType === 'application/vnd.microsoft.card.oauth' ? + + : attachment.contentType === 'application/vnd.microsoft.card.receipt' ? + + : attachment.contentType === 'application/vnd.microsoft.card.signin' ? + + : attachment.contentType === 'application/vnd.microsoft.card.thumbnail' ? + + : attachment.contentType === 'application/vnd.microsoft.card.video' ? + + : + next({ activity, attachment }) + ); + } + + AdaptiveCardMiddleware.propTypes = { + activity: PropTypes.any.isRequired, + attachment: PropTypes.shape({ + contentType: PropTypes.string.isRequired + }).isRequired + }; + + return AdaptiveCardMiddleware; + }; } diff --git a/packages/bundle/src/addVersion.js b/packages/bundle/src/addVersion.js index 59ba88407e..05f86b7369 100644 --- a/packages/bundle/src/addVersion.js +++ b/packages/bundle/src/addVersion.js @@ -1,3 +1,6 @@ +/* global global:readonly, VERSION:readonly */ +/* eslint no-empty: ["error", { "allowEmptyCatch": true }] */ + import { version as componentVersion } from 'botframework-webchat-component'; import { version as coreVersion } from 'botframework-webchat-core'; diff --git a/packages/bundle/src/createCognitiveServicesBingSpeechPonyfillFactory.js b/packages/bundle/src/createCognitiveServicesBingSpeechPonyfillFactory.js index d082e71107..c7cdc44e9f 100644 --- a/packages/bundle/src/createCognitiveServicesBingSpeechPonyfillFactory.js +++ b/packages/bundle/src/createCognitiveServicesBingSpeechPonyfillFactory.js @@ -1,5 +1,16 @@ import createPonyfill from 'web-speech-cognitive-services/lib/BingSpeech'; +function injectReferenceGrammarID({ SpeechGrammarList, SpeechRecognition }, referenceGrammarID) { + return class extends SpeechRecognition { + start() { + this.grammars = new SpeechGrammarList(); + this.grammars.referenceGrammar = referenceGrammarID || ''; + + return super.start(); + } + }; +} + export default async function ({ authorizationToken, subscriptionKey }) { const ponyfill = await createPonyfill({ authorizationToken, subscriptionKey }); const { @@ -15,14 +26,3 @@ export default async function ({ authorizationToken, subscriptionKey }) { SpeechSynthesisUtterance }); } - -function injectReferenceGrammarID({ SpeechGrammarList, SpeechRecognition }, referenceGrammarID) { - return class extends SpeechRecognition { - start() { - this.grammars = new SpeechGrammarList(); - this.grammars.referenceGrammar = referenceGrammarID || ''; - - return super.start(); - } - }; -} diff --git a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js index 5eaa35b20a..6ffd736faa 100644 --- a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js +++ b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js @@ -1,5 +1,16 @@ import createPonyfill from 'web-speech-cognitive-services/lib/SpeechServices'; +function injectReferenceGrammarID({ SpeechGrammarList, SpeechRecognition }, referenceGrammarID) { + return class extends SpeechRecognition { + start() { + this.grammars = new SpeechGrammarList(); + this.grammars.referenceGrammar = referenceGrammarID || ''; + + return super.start(); + } + }; +} + export default async function ({ authorizationToken, region, @@ -28,14 +39,3 @@ export default async function ({ SpeechSynthesisUtterance }); } - -function injectReferenceGrammarID({ SpeechGrammarList, SpeechRecognition }, referenceGrammarID) { - return class extends SpeechRecognition { - start() { - this.grammars = new SpeechGrammarList(); - this.grammars.referenceGrammar = referenceGrammarID || ''; - - return super.start(); - } - }; -} diff --git a/packages/bundle/src/index-minimal.ts b/packages/bundle/src/index-minimal.ts index 603084f750..89be0a73a3 100644 --- a/packages/bundle/src/index-minimal.ts +++ b/packages/bundle/src/index-minimal.ts @@ -1,3 +1,6 @@ +/* eslint dot-notation: ["error", { "allowPattern": "^WebChat$" }] */ +// window['WebChat'] is required for TypeScript + import { Constants, createStore diff --git a/packages/bundle/src/index.ts b/packages/bundle/src/index.ts index 4813eea1c9..b52ad2c749 100644 --- a/packages/bundle/src/index.ts +++ b/packages/bundle/src/index.ts @@ -1,3 +1,6 @@ +/* eslint dot-notation: ["error", { "allowPattern": "^WebChat$" }] */ +// window['WebChat'] is required for TypeScript + export * from './index-minimal'; import addVersion from './addVersion'; diff --git a/packages/bundle/src/renderWebChat.js b/packages/bundle/src/renderWebChat.js index 08acf3b4f5..61dc2c9f96 100644 --- a/packages/bundle/src/renderWebChat.js +++ b/packages/bundle/src/renderWebChat.js @@ -2,8 +2,5 @@ import React from 'react'; import ReactDOM from 'react-dom'; export default function (ReactWebChat, props, element) { - ReactDOM.render( - , - element - ); + ReactDOM.render(, element); } diff --git a/packages/component/.eslintrc.yml b/packages/component/.eslintrc.yml new file mode 100644 index 0000000000..99ad114d03 --- /dev/null +++ b/packages/component/.eslintrc.yml @@ -0,0 +1,87 @@ +extends: +- plugin:react/recommended +rules: + react/button-has-type: error + react/default-props-match-prop-types: error + react/destructuring-assignment: error + react/forbid-component-props: + - error + - forbid: + - style + react/forbid-dom-props: + - error + - forbid: + - id + # react/forbid-prop-types: error // How to deal with Adaptive Card schema? + react/no-access-state-in-setstate: error + react/no-array-index-key: error + react/no-danger: error + react/no-did-mount-set-state: error + react/no-did-update-set-state: error + react/no-redundant-should-component-update: error + react/no-typos: error + react/no-this-in-sfc: error + react/no-unescaped-entities: error + react/no-unsafe: error + react/no-unused-prop-types: error + react/no-unused-state: error + react/no-will-update-set-state: error + react/prefer-es6-class: error + react/prefer-read-only-props: error + react/require-default-props: error + react/self-closing-comp: error + react/sort-prop-types: error + react/state-in-constructor: error + react/static-property-placement: + - error + - property assignment + react/style-prop-object: error + react/void-dom-elements-no-children: error + react/jsx-boolean-value: + - error + - always + react/jsx-closing-bracket-location: + - error + - tag-aligned + react/jsx-closing-tag-location: error + react/jsx-curly-spacing: + - error + - spacing: + objectLiterals: never + when: always + react/jsx-equals-spacing: + - error + - never + react/jsx-first-prop-new-line: + - error + - multiline-multiprop + react/jsx-handler-names: error + react/jsx-indent: + - error + - 2 + react/jsx-indent-props: + - error + - 2 + react/jsx-max-props-per-line: + - error + - maximum: 1 + when: multiline + react/jsx-no-bind: error + react/jsx-no-literals: error + react/jsx-one-expression-per-line: + - error + - allow: literal + react/jsx-fragments: + - error + - element + react/jsx-pascal-case: error + react/jsx-props-no-multi-spaces: error + react/jsx-sort-default-props: error + react/jsx-sort-props: error + react/jsx-tag-spacing: + - error + - afterOpening: never + beforeClosing: never + beforeSelfClosing: always + closingSlash: never + # react/jsx-wrap-multilines: error // Conflict with no-extra-parens diff --git a/packages/component/package-lock.json b/packages/component/package-lock.json index 2e69f2f19e..d6db200a3f 100644 --- a/packages/component/package-lock.json +++ b/packages/component/package-lock.json @@ -40,7 +40,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, "requires": { "@babel/highlight": "^7.0.0" } @@ -751,7 +750,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -761,8 +759,7 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" } } }, @@ -1509,6 +1506,32 @@ "csstype": "^2.2.0" } }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==" + }, + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==" + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "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" + } + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==" + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -1534,6 +1557,14 @@ "normalize-path": "^2.1.1" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -1555,6 +1586,15 @@ "dev": true, "optional": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -1585,6 +1625,11 @@ "dev": true, "optional": 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==" + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -2644,8 +2689,7 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "base": { "version": "0.11.2", @@ -2733,7 +2777,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2810,6 +2853,11 @@ "unset-value": "^1.0.0" } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -2832,6 +2880,11 @@ "supports-color": "^5.3.0" } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "chokidar": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.5.tgz", @@ -2904,6 +2957,19 @@ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" }, + "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=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -2978,8 +3044,7 @@ "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 + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concurrently": { "version": "4.0.1", @@ -3252,6 +3317,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "css-in-js-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz", @@ -3289,6 +3366,19 @@ "dev": true, "optional": 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=" + }, + "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==", + "requires": { + "object-keys": "^1.0.12" + } + }, "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", @@ -3343,6 +3433,14 @@ "repeating": "^2.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, "dom-serializer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", @@ -3387,6 +3485,11 @@ "integrity": "sha512-XxowpqQxJ4nDwUXHtVtmEhRqBpm2OnjBomZmZtHD0d2Eo0244+Ojezhk3sD/MBSSe2nxCdGQFRXHIsf/LUTL9A==", "dev": true }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", @@ -3409,16 +3512,211 @@ "is-arrayish": "^0.2.1" } }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "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=" }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "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=" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, + "eslint-plugin-react": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz", + "integrity": "sha512-uA5LrHylu8lW/eAH3bEQe9YdzpPaFd9yAJTwTi/i/BKTD7j6aQMKVAdGM/ML72zD6womuSK7EiGtMKuK06lWjQ==", + "requires": { + "array-includes": "^3.0.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.1.0", + "object.fromentries": "^2.0.0", + "prop-types": "^15.7.2", + "resolve": "^1.10.1" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "requires": { + "esutils": "^2.0.2" + } + }, + "resolve": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", + "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==" + }, + "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==" + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "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==", + "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==", + "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=" + }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" }, "event-as-promise": { "version": "1.0.5", @@ -3542,6 +3840,26 @@ } } }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "dependencies": { + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", @@ -3613,6 +3931,21 @@ } } }, + "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=" + }, + "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=" + }, "fbjs": { "version": "0.8.17", "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", @@ -3627,6 +3960,22 @@ "ua-parser-js": "^0.7.18" } }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "requires": { + "flat-cache": "^2.0.1" + } + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -3659,6 +4008,44 @@ } } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "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" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==" + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3695,8 +4082,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.7", @@ -4246,6 +4632,16 @@ } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "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=" + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", @@ -4281,7 +4677,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -4366,6 +4761,14 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -4380,6 +4783,11 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4462,11 +4870,29 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -4486,6 +4912,64 @@ "css-in-js-utils": "^2.0.0" } }, + "inquirer": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "rxjs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", + "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", + "requires": { + "tslib": "^1.9.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==", + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -4548,6 +5032,11 @@ "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==" + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -4570,6 +5059,11 @@ } } }, + "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=" + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -4634,8 +5128,7 @@ "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 + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-glob": { "version": "4.0.1", @@ -4699,11 +5192,32 @@ "dev": true, "optional": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -4719,8 +5233,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -4747,6 +5260,15 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsesc": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", @@ -4759,12 +5281,30 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "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==" + }, + "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=" + }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, + "jsx-ast-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz", + "integrity": "sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA==", + "requires": { + "array-includes": "^3.0.3" + } + }, "kind-of": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", @@ -4772,6 +5312,15 @@ "dev": true, "optional": true }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", @@ -4878,14 +5427,12 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4893,8 +5440,7 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "mixin-deep": { "version": "1.3.1", @@ -4923,7 +5469,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" } @@ -4934,6 +5479,11 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + }, "nan": { "version": "2.12.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", @@ -4961,11 +5511,15 @@ "to-regex": "^3.0.1" } }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-fetch": { "version": "1.7.3", @@ -5060,6 +5614,11 @@ } } }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -5070,6 +5629,17 @@ "isobject": "^3.0.0" } }, + "object.fromentries": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", + "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.11.0", + "function-bind": "^1.1.1", + "has": "^1.0.1" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -5095,11 +5665,31 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "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" + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -5109,8 +5699,7 @@ "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 + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "output-file-sync": { "version": "2.0.1", @@ -5137,10 +5726,18 @@ }, "p-is-promise": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -5196,20 +5793,22 @@ "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 + "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=" }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "posix-character-classes": { "version": "0.1.1", @@ -5235,6 +5834,11 @@ } } }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", @@ -5253,6 +5857,11 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" + }, "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", @@ -5262,15 +5871,30 @@ } }, "prop-types": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", - "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", "requires": { - "fbjs": "^0.8.16", - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + }, + "dependencies": { + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + } } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "randomatic": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", @@ -5331,6 +5955,11 @@ "memoize-one": "^5.0.4" } }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" + }, "react-redux": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-5.0.7.tgz", @@ -5478,6 +6107,11 @@ "integrity": "sha512-nUmxvfJyAODw+0B13hj8CFVAxhe7fDEAgJgaotBu3nnR+IgGgZq59YedJP5VYTlkEfqjuK6TuRpnymKdatLZfQ==", "dev": true }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" + }, "regexpu-core": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", @@ -5566,6 +6200,11 @@ "path-parse": "^1.0.6" } }, + "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==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -5573,6 +6212,15 @@ "dev": true, "optional": 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=", + "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", @@ -5589,6 +6237,14 @@ "glob": "^7.0.5" } }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "requires": { + "is-promise": "^2.1.0" + } + }, "rxjs": { "version": "5.5.12", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", @@ -5646,8 +6302,7 @@ "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, "set-blocking": { "version": "2.0.0", @@ -5696,7 +6351,6 @@ "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" } @@ -5704,14 +6358,12 @@ "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 + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-update-in": { "version": "1.3.0", @@ -5724,6 +6376,16 @@ "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -5916,6 +6578,11 @@ "extend-shallow": "^3.0.0" } }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, "srcset": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", @@ -5952,7 +6619,6 @@ "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" @@ -5961,14 +6627,12 @@ "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "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" } @@ -5998,6 +6662,11 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", @@ -6011,11 +6680,65 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" }, + "table": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", + "requires": { + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "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==", + "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==", + "requires": { + "ansi-regex": "^4.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=" + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, + "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" + } + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -6083,8 +6806,15 @@ "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", - "dev": true + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "requires": { + "prelude-ls": "~1.1.2" + } }, "typescript": { "version": "3.1.6", @@ -6214,6 +6944,14 @@ "dev": true, "optional": true }, + "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==", + "requires": { + "punycode": "^2.1.0" + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", @@ -6267,7 +7005,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -6278,6 +7015,11 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -6313,8 +7055,15 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "requires": { + "mkdirp": "^0.5.1" + } }, "xregexp": { "version": "4.0.0", diff --git a/packages/component/package.json b/packages/component/package.json index 9008a2b3f1..ba793e1c03 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -18,10 +18,11 @@ "homepage": "https://github.com/Microsoft/BotFramework-WebChat/tree/master/packages/component#readme", "scripts": { "build": "npm run build:typecheck && npm run build:babel-instrumented", - "build:babel": "babel --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__test__/**/*.js,__test__/**/*.ts,__test__/**/*.tsx --out-dir lib --source-maps inline --verbose src", + "build:babel": "babel --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__tests__/**/*.js,__tests__/**/*.ts,__tests__/**/*.tsx --out-dir lib --source-maps inline --verbose src", "build:babel-instrumented": "npm run build:babel -- --env-name test", "build:typecheck": "tsc", "clean": "rimraf lib", + "eslint": "eslint src/**/*.js src/**/*.ts --ignore-pattern *.spec.[jt]sx? --ignore-pattern *.test.[jt]sx?", "prepublishOnly": "npm run build:typecheck && npm run build:babel", "watch": "concurrently --names \"babel,typecheck\" \"npm run build:babel-instrumented -- --watch\" \"npm run build:typecheck -- --preserveWatchOutput --watch\"" }, @@ -42,11 +43,14 @@ "typescript": "^3.1.6" }, "dependencies": { - "botframework-webchat-core": "^0.0.0-0", + "botframework-webchat-core": "0.0.0-0", "bytes": "^3.0.0", "classnames": "^2.2.6", + "eslint": "^5.16.0", + "eslint-plugin-react": "^7.13.0", "glamor": "^2.20.40", "memoize-one": "^5.0.2", + "prop-types": "^15.7.2", "react-dictate-button": "^1.1.3", "react-film": "1.2.1-master.db29968", "react-redux": "^5.0.7", diff --git a/packages/component/src/Activity/Avatar.js b/packages/component/src/Activity/Avatar.js index fa0fdac0a2..a1ac6dc532 100644 --- a/packages/component/src/Activity/Avatar.js +++ b/packages/component/src/Activity/Avatar.js @@ -1,4 +1,5 @@ import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../connectToWebChat'; @@ -38,7 +39,7 @@ const Avatar = ({ className={ classNames( styleSet.avatar + '', { 'from-user': fromUser }, - (className || '') + '' + className + '' ) } > { avatarInitials } @@ -53,6 +54,25 @@ const Avatar = ({ }
+Avatar.defaultProps = { + 'aria-hidden': false, + avatarImage: '', + avatarInitials: '', + className: '', + fromUser: false +}; + +Avatar.propTypes = { + 'aria-hidden': PropTypes.bool, + avatarImage: PropTypes.string, + avatarInitials: PropTypes.string, + className: PropTypes.string, + fromUser: PropTypes.bool, + styleSet: PropTypes.shape({ + avatar: PropTypes.any.isRequired + }).isRequired +}; + export default connectAvatar( ({ styleSet }) => ({ styleSet }) )(Avatar) diff --git a/packages/component/src/Activity/Bubble.js b/packages/component/src/Activity/Bubble.js index 01c9c155c6..d57cfeca96 100644 --- a/packages/component/src/Activity/Bubble.js +++ b/packages/component/src/Activity/Bubble.js @@ -1,26 +1,44 @@ import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../connectToWebChat'; +const Bubble = ({ + 'aria-label': ariaLabel, + children, + className, + fromUser, + styleSet +}) => +
+ { children } +
; + +Bubble.defaultProps = { + 'aria-label': '', + children: undefined, + className: '', + fromUser: false +}; + +Bubble.propTypes = { + 'aria-label': PropTypes.string, + children: PropTypes.any, + className: PropTypes.string, + fromUser: PropTypes.bool, + styleSet: PropTypes.shape({ + bubble: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ - 'aria-label': ariaLabel, - children, - className, - fromUser, - styleSet - }) => -
- { children } -
-) +)(Bubble) diff --git a/packages/component/src/Activity/CarouselFilmStrip.js b/packages/component/src/Activity/CarouselFilmStrip.js index 0d8bad2f77..d920a5b605 100644 --- a/packages/component/src/Activity/CarouselFilmStrip.js +++ b/packages/component/src/Activity/CarouselFilmStrip.js @@ -1,6 +1,9 @@ +/* eslint react/no-array-index-key: "off" */ + import { css } from 'glamor'; import { Context as FilmContext } from 'react-film'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import { Constants } from 'botframework-webchat-core'; @@ -70,118 +73,165 @@ const connectCarouselFilmStrip = (...selectors) => connectToWebChat( userAvatarInitials } } - }, { activity }) => ({ - avatarInitials: activity.from && activity.from.role === 'user' ? userAvatarInitials : botAvatarInitials, + }, { + activity: { + from: { + role + } = {} + } = {} + }) => ({ + avatarInitials: role === 'user' ? userAvatarInitials : botAvatarInitials, language }), ...selectors ) -const ConnectedCarouselFilmStrip = connectCarouselFilmStrip( - ({ - avatarInitials, - language, - styleSet - }) => ({ - avatarInitials, - language, - styleSet - }) -)( - ({ - activity, - avatarInitials, - children, - language, - className, - itemContainerRef, - scrollableRef, - styleSet, - timestampClassName - }) => { - const fromUser = activity.from.role === 'user'; - const ariaLabel = localize('Bot said something', language, avatarInitials, activity.text, activity.timestamp) - const activityDisplayText = - ( - activity.channelData - && activity.channelData.messageBack - && activity.channelData.messageBack.displayText - ) || activity.text; - - return ( -
- -
+const WebChatCarouselFilmStrip = ({ + activity, + avatarInitials, + children, + className, + itemContainerRef, + language, + scrollableRef, + styleSet, + timestampClassName +}) => { + const { + attachments = [], + channelData: { + messageBack: { + displayText: messageBackDisplayText + } = {}, + state + } = {}, + from: { + role + } = {}, + text, + textFormat, + timestamp + } = activity; + + const fromUser = role === 'user'; + const ariaLabel = localize('Bot said something', language, avatarInitials, text, timestamp) + const activityDisplayText = messageBackDisplayText || text; + + return ( +
+ +
+ { + !!activityDisplayText && +
+ + { children({ + activity, + attachment: { + content: activityDisplayText, + contentType: textFormatToContentType(textFormat) + } + }) } + +
+
+ } +
    { - !!activityDisplayText && -
    + attachments.map((attachment, index) => +
  • - { children({ - activity, - attachment: { - contentType: textFormatToContentType(activity.textFormat), - content: activityDisplayText - } - }) } + { children({ attachment }) } -
    -
    +
  • + ) } -
      - { - activity.attachments.map((attachment, index) => -
    • - - { children({ attachment }) } - -
    • - ) - } -
    -
    - {( - activity.channelData - && ( - activity.channelData.state === SENDING - || activity.channelData.state === SEND_FAILED - ) - ) ? +
+
+ { + state === SENDING || state === SEND_FAILED ? : - } -
+ }
- ); - } -) +
+ ); +}; + +WebChatCarouselFilmStrip.defaultProps = { + avatarInitials: '', + children: undefined, + className: '', + timestampClassName: '' +}; + +WebChatCarouselFilmStrip.propTypes = { + activity: PropTypes.shape({ + attachments: PropTypes.array, + channelData: PropTypes.shape({ + messageBack: PropTypes.shape({ + displayText: PropTypes.string + }), + state: PropTypes.string + }), + from: PropTypes.shape({ + role: PropTypes.string.isRequired + }).isRequired, + text: PropTypes.string, + textFormat: PropTypes.string, + timestamp: PropTypes.string + }).isRequired, + avatarInitials: PropTypes.string, + children: PropTypes.any, + className: PropTypes.string, + itemContainerRef: PropTypes.any.isRequired, + language: PropTypes.string.isRequired, + scrollableRef: PropTypes.any.isRequired, + styleSet: PropTypes.shape({ + carouselFilmStrip: PropTypes.any.isRequired + }).isRequired, + timestampClassName: PropTypes.string +}; -export default props => +const ConnectedCarouselFilmStrip = connectCarouselFilmStrip( + ({ + avatarInitials, + language, + styleSet + }) => ({ + avatarInitials, + language, + styleSet + }) +)(WebChatCarouselFilmStrip) + +const CarouselFilmStrip = props => { ({ itemContainerRef, scrollableRef }) => } +export default CarouselFilmStrip + export { connectCarouselFilmStrip } diff --git a/packages/component/src/Activity/CarouselLayout.js b/packages/component/src/Activity/CarouselLayout.js index 5954183706..addc25b660 100644 --- a/packages/component/src/Activity/CarouselLayout.js +++ b/packages/component/src/Activity/CarouselLayout.js @@ -1,6 +1,7 @@ import { Composer, Context as FilmContext, createBasicStyleSet, Flipper } from 'react-film'; import { css } from 'glamor'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import { localize } from '../Localization/Localize'; @@ -12,17 +13,29 @@ const ROOT_CSS = css({ position: 'relative' }); -export default connectToWebChat( - ({ language, styleSet }) => ({ language, styleSet }) -)(({ activity, children, language, styleSet, timestampClassName }) => { +const CarouselLayout = ({ + activity, + children, + language, + styleSet, + timestampClassName +}) => { const filmStyleSet = createBasicStyleSet({ cursor: null }); return ( { ({ scrollBarWidth }) => -
- +
+ { children } { scrollBarWidth !== '100%' && @@ -35,7 +48,9 @@ export default connectToWebChat( ) } mode="left" > -
<
+
+ { '<' } +
-
>
+
+ { '>' } +
} @@ -54,4 +71,23 @@ export default connectToWebChat( ); -}) +}; + +CarouselLayout.defaultProps = { + children: undefined, + timestampClassName: '' +}; + +CarouselLayout.propTypes = { + activity: PropTypes.any.isRequired, + children: PropTypes.any, + language: PropTypes.string.isRequired, + styleSet: PropTypes.shape({ + carouselFlipper: PropTypes.any.isRequired + }).isRequired, + timestampClassName: PropTypes.string +}; + +export default connectToWebChat( + ({ language, styleSet }) => ({ language, styleSet }) +)(CarouselLayout) diff --git a/packages/component/src/Activity/SayAlt.js b/packages/component/src/Activity/SayAlt.js index d59b740ac8..5fdb5523d5 100644 --- a/packages/component/src/Activity/SayAlt.js +++ b/packages/component/src/Activity/SayAlt.js @@ -1,4 +1,5 @@ import { css } from 'glamor'; +import PropTypes from 'prop-types'; import React from 'react'; // TODO: [P3] Although this is for development purpose, prettify it @@ -7,5 +8,18 @@ const ROOT_CSS = css({ margin: 0 }); -export default ({ speak }) => - !!speak &&
{ speak }
+const SayAlt = ({ speak }) => + !!speak && +
+      { speak }
+    
+ +SayAlt.defaultProps = { + speak: '' +}; + +SayAlt.propTypes = { + speak: PropTypes.string +}; + +export default SayAlt diff --git a/packages/component/src/Activity/ScrollToEndButton.js b/packages/component/src/Activity/ScrollToEndButton.js index fab00556b7..d3a3e77692 100644 --- a/packages/component/src/Activity/ScrollToEndButton.js +++ b/packages/component/src/Activity/ScrollToEndButton.js @@ -3,27 +3,43 @@ import { } from 'react-scroll-to-bottom'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../connectToWebChat'; import Localize from '../Localization/Localize'; -const ScrollToEndButton = connectToWebChat( - ({ scrollToEnd, styleSet }) => ({ scrollToEnd, styleSet }) -)(({ className, scrollToEnd, styleSet }) => +const ScrollToEndButton = ({ className, scrollToEnd, styleSet }) => -) + ; + +ScrollToEndButton.defaultProps = { + className: '' +}; + +ScrollToEndButton.propTypes = { + className: PropTypes.string, + scrollToEnd: PropTypes.func.isRequired, + styleSet: PropTypes.shape({ + scrollToEndButton: PropTypes.any.isRequired + }).isRequired +}; -export default props => +const WebChatConnectedScrollToEndButton = connectToWebChat( + ({ scrollToEnd, styleSet }) => ({ scrollToEnd, styleSet }) +)(ScrollToEndButton) + +const ConnectedScrollToEndButton = props => - { ({ sticky }) => !sticky && } + { ({ sticky }) => !sticky && } + +export default ConnectedScrollToEndButton diff --git a/packages/component/src/Activity/SendStatus.js b/packages/component/src/Activity/SendStatus.js index 3a10a401fa..328ffc9efa 100644 --- a/packages/component/src/Activity/SendStatus.js +++ b/packages/component/src/Activity/SendStatus.js @@ -1,32 +1,12 @@ -import React from 'react'; - import { Constants } from 'botframework-webchat-core'; +import PropTypes from 'prop-types'; +import React from 'react'; import connectToWebChat from '../connectToWebChat'; import Localize, { localize } from '../Localization/Localize'; const { ActivityClientState: { SEND_FAILED, SENDING } } = Constants; -// TODO: [P4] Currently, this is the only place which use a templated string -// We could refactor this into a general component if there are more templated strings -function sendFailed(language, replace) { - const text = localize('SEND_FAILED_KEY', language); - const retry = localize('Retry', language); - const match = /\{Retry\}/.exec(text); - - if (match) { - return ( - - { text.substr(0, match.index) } - { replace(retry) } - { text.substr(match.index + match[0].length) } - - ); - } else { - return text; - } -} - const connectSendStatus = (...selectors) => connectToWebChat( ({ focusSendBox, @@ -49,34 +29,67 @@ const connectSendStatus = (...selectors) => connectToWebChat( ...selectors ) -export default connectSendStatus( - ({ styleSet }) => ({ styleSet }) -)( - ({ - activity: { channelData: { state } = {} }, - language, - retrySend, - styleSet - }) => +const SendStatus = ({ + activity: { + channelData: { + state + } = {} + }, + language, + retrySend, + styleSet +}) => { + // TODO: [P4] Currently, this is the only place which use a templated string + // We could refactor this into a general component if there are more templated strings + const sendFailedText = localize('SEND_FAILED_KEY', language); + const sendFailedRetryMatch = /\{Retry\}/u.exec(sendFailedText); + + return ( { state === SENDING ? : state === SEND_FAILED ? - sendFailed( - language, - retry => + sendFailedRetryMatch ? + + { sendFailedText.substr(0, sendFailedRetryMatch.index) } - ) + { sendFailedText.substr(sendFailedRetryMatch.index + sendFailedRetryMatch[0].length) } + + : + : false } -) + ); +} + +SendStatus.propTypes = { + activity: PropTypes.shape({ + channelData: PropTypes.shape({ + state: PropTypes.string + }) + }).isRequired, + language: PropTypes.string.isRequired, + retrySend: PropTypes.func.isRequired, + styleSet: PropTypes.shape({ + sendStatus: PropTypes.any.isRequired + }).isRequired +}; + +export default connectSendStatus( + ({ styleSet }) => ({ styleSet }) +)(SendStatus) export { connectSendStatus } diff --git a/packages/component/src/Activity/Speak.js b/packages/component/src/Activity/Speak.js index 2a527eb7e5..e2661c9461 100644 --- a/packages/component/src/Activity/Speak.js +++ b/packages/component/src/Activity/Speak.js @@ -1,8 +1,9 @@ +import PropTypes from 'prop-types'; import React from 'react'; -import SayAlt from './SayAlt'; import Say from 'react-say'; import connectToWebChat from '../connectToWebChat'; +import SayAlt from './SayAlt'; // TODO: [P4] Consider moving this feature into BasicActivity // And it has better DOM position for showing visual spoken text @@ -16,15 +17,15 @@ const connectSpeakActivity = (...selectors) => connectToWebChat( activity }) => ({ language, - markAsSpoken: () => { - markActivity(activity, 'speak', false) - }, + markAsSpoken: () => markActivity(activity, 'speak', false), selectVoice: voices => { + voices = [].slice.call(voices); + return ( - [].find.call(voices, voice => voice.lang === activity.locale) - || [].find.call(voices, voice => voice.lang === language) - || [].find.call(voices, voice => voice.lang === window.navigator.language) - || [].find.call(voices, voice => voice.lang === 'en-US') + voices.find(({ lang }) => lang === activity.locale) + || voices.find(({ lang }) => lang === language) + || voices.find(({ lang }) => lang === window.navigator.language) + || voices.find(({ lang }) => lang === 'en-US') || voices[0] ); } @@ -32,60 +33,100 @@ const connectSpeakActivity = (...selectors) => connectToWebChat( ...selectors ); -export default connectSpeakActivity( - ({ styleSet }) => ({ styleSet }) -)( - ({ - activity, - markAsSpoken, - selectVoice, - styleSet +const Speak = ({ + activity, + markAsSpoken, + selectVoice, + styleSet +}) => { + if (!activity) { + return false; + } + + const { + attachments = [], + speak, + text + } = activity; + + const lines = [speak || text]; + + attachments.forEach(({ + content: { + speak, + subtitle, + text, + title + } = {}, + contentType }) => { - if (!activity) { - return false; + switch (contentType) { + case 'application/vnd.microsoft.card.adaptive': + lines.push(speak); + break; + + case 'application/vnd.microsoft.card.animation': + case 'application/vnd.microsoft.card.audio': + case 'application/vnd.microsoft.card.video': + case 'application/vnd.microsoft.card.hero': + case 'application/vnd.microsoft.card.thumbnail': + lines.push(title); + lines.push(subtitle); + lines.push(text); + break; + + case 'application/vnd.microsoft.card.receipt': + lines.push(title); + break; + + default: break; } + }); - const lines = [activity.speak || activity.text]; - - (activity.attachments || []).forEach(({ content, contentType }) => { - switch (contentType) { - case 'application/vnd.microsoft.card.adaptive': - lines.push(content.speak); - break; - - case 'application/vnd.microsoft.card.animation': - case 'application/vnd.microsoft.card.audio': - case 'application/vnd.microsoft.card.video': - case 'application/vnd.microsoft.card.hero': - case 'application/vnd.microsoft.card.thumbnail': - lines.push(content.title); - lines.push(content.subtitle); - lines.push(content.text); - break; - - case 'application/vnd.microsoft.card.receipt': - lines.push(content.title); - break; + const singleLine = lines.filter(line => line).join('\r\n'); + + return ( + + + { + !!styleSet.options.showSpokenText && + } - }); - - return ( - - line).join('\r\n') } - voice={ selectVoice } - /> - { - !!styleSet.options.showSpokenText && - line).join('\r\n') } - voice={ selectVoice } - /> - } - - ); - } -) + + ); +}; + +Speak.propTypes = { + activity: PropTypes.shape({ + attachments: PropTypes.arrayOf( + PropTypes.shape({ + speak: PropTypes.string, + subtitle: PropTypes.string, + text: PropTypes.string, + title: PropTypes.string + }) + ), + speak: PropTypes.string, + text: PropTypes.string + }).isRequired, + markAsSpoken: PropTypes.func.isRequired, + selectVoice: PropTypes.func.isRequired, + styleSet: PropTypes.shape({ + options: PropTypes.shape({ + showSpokenText: PropTypes.bool.isRequired + }).isRequired + }).isRequired +}; + +export default connectSpeakActivity( + ({ styleSet }) => ({ styleSet }) +)(Speak) export { connectSpeakActivity } diff --git a/packages/component/src/Activity/StackedLayout.js b/packages/component/src/Activity/StackedLayout.js index b5c45e823a..4afd60752e 100644 --- a/packages/component/src/Activity/StackedLayout.js +++ b/packages/component/src/Activity/StackedLayout.js @@ -1,9 +1,11 @@ +/* eslint react/no-array-index-key: "off" */ + +import { Constants } from 'botframework-webchat-core'; import { css } from 'glamor'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; -import { Constants } from 'botframework-webchat-core'; - import { localize } from '../Localization/Localize'; import Avatar from './Avatar'; import Bubble from './Bubble'; @@ -62,8 +64,14 @@ const connectStackedLayout = (...selectors) => connectToWebChat( userAvatarInitials } } - }, { activity }) => ({ - avatarInitials: activity.from && activity.from.role === 'user' ? userAvatarInitials : botAvatarInitials, + }, { + activity: { + from: { + role + } = {} + } = {} + }) => ({ + avatarInitials: role === 'user' ? userAvatarInitials : botAvatarInitials, language, // TODO: [P4] We want to deprecate botAvatarInitials/userAvatarInitials because they are not as helpful as avatarInitials @@ -73,6 +81,142 @@ const connectStackedLayout = (...selectors) => connectToWebChat( ...selectors ); +const StackedLayout = ({ + activity, + avatarInitials, + children, + language, + styleSet, + timestampClassName +}) => { + const { + attachments = [], + channelData: { + messageBack: { + displayText: messageBackDisplayText + } = {}, + state + } = {}, + from: { + role + } = {}, + text, + textFormat, + timestamp, + type + } = activity; + + const fromUser = role === 'user'; + const showSendStatus = state === SENDING || state === SEND_FAILED; + const ariaLabel = localize(fromUser ? 'User said something' : 'Bot said something', language, avatarInitials, text, timestamp); + const activityDisplayText = messageBackDisplayText || text; + + return ( +
+ +
+ { + type === 'typing' ? +
+ { + children({ + activity, + attachment: { contentType: 'typing' } + }) + } +
+
+ : !!activityDisplayText && +
+ + { + children({ + activity, + attachment: { + content: activityDisplayText, + contentType: textFormatToContentType(textFormat) + } + }) + } + +
+
+ } + { + attachments.map((attachment, index) => +
+ + { children({ attachment }) } + +
+ ) + } +
+ { + showSendStatus ? + + : + + } +
+
+
+
+
+ ); +}; + +StackedLayout.defaultProps = { + children: undefined, + timestampClassName: '' +}; + +StackedLayout.propTypes = { + activity: PropTypes.shape({ + attachments: PropTypes.array, + channelData: PropTypes.shape({ + messageBack: PropTypes.shape({ + displayText: PropTypes.string + }) + }), + from: PropTypes.shape({ + role: PropTypes.string.isRequired + }).isRequired, + text: PropTypes.string, + textFormat: PropTypes.string, + timestamp: PropTypes.string, + type: PropTypes.string.isRequired + }).isRequired, + avatarInitials: PropTypes.string.isRequired, + children: PropTypes.any, + language: PropTypes.string.isRequired, + styleSet: PropTypes.shape({ + stackedLayout: PropTypes.any.isRequired + }).isRequired, + timestampClassName: PropTypes.string +}; + export default connectStackedLayout( ({ avatarInitials, @@ -83,100 +227,6 @@ export default connectStackedLayout( language, styleSet }) -)( - ({ - activity, - avatarInitials, - children, - language, - styleSet, - timestampClassName - }) => { - const fromUser = activity.from.role === 'user'; - const { state } = activity.channelData || {}; - const showSendStatus = state === SENDING || state === SEND_FAILED; - const ariaLabel = localize(fromUser ? 'User said something' : 'Bot said something', language, avatarInitials, activity.text, activity.timestamp); - const activityDisplayText = - ( - activity.channelData - && activity.channelData.messageBack - && activity.channelData.messageBack.displayText - ) || activity.text; - - return ( -
- -
- { - activity.type === 'typing' ? -
- { - children({ - activity, - attachment: { contentType: 'typing' } - }) - } -
-
- : !!activityDisplayText && -
- - { - children({ - activity, - attachment: { - contentType: textFormatToContentType(activity.textFormat), - content: activityDisplayText - } - }) - } - -
-
- } - { - (activity.attachments || []).map((attachment, index) => -
- - { children({ attachment }) } - -
- ) - } -
- { showSendStatus ? - - : - - } -
-
-
-
-
- ); - } -) +)(StackedLayout) export { connectStackedLayout } diff --git a/packages/component/src/Activity/Timestamp.js b/packages/component/src/Activity/Timestamp.js index 9aa6d3f6cd..32518edc29 100644 --- a/packages/component/src/Activity/Timestamp.js +++ b/packages/component/src/Activity/Timestamp.js @@ -1,21 +1,38 @@ import classNames from 'classnames'; +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../connectToWebChat'; import TimeAgo from '../Utils/TimeAgo'; +const Timestamp = ({ + activity: { timestamp }, + className, + styleSet +}) => + + + ; + +Timestamp.defaultProps = { + className: '' +}; + +Timestamp.propTypes = { + activity: PropTypes.shape({ + timestamp: PropTypes.string.isRequired + }).isRequired, + className: PropTypes.string, + styleSet: PropTypes.shape({ + timestamp: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ - activity: { timestamp }, - className, - styleSet - }) => - - - -) +)(Timestamp) diff --git a/packages/component/src/Attachment/Assets/DownloadIcon.js b/packages/component/src/Attachment/Assets/DownloadIcon.js index cc0d8bc8b8..f15afb8f11 100644 --- a/packages/component/src/Attachment/Assets/DownloadIcon.js +++ b/packages/component/src/Attachment/Assets/DownloadIcon.js @@ -1,12 +1,29 @@ +import PropTypes from 'prop-types'; import React from 'react'; -export default ({ className, label, size = 1 }) => - - - +const ICON_SIZE_FACTOR = 22; + +const DownloadIcon = ({ className, label, size }) => + + + + +DownloadIcon.defaultProps = { + className: '', + label: '', + size: 1 +}; + +DownloadIcon.propTypes = { + className: PropTypes.string, + label: PropTypes.string, + size: PropTypes.number +}; + +export default DownloadIcon diff --git a/packages/component/src/Attachment/Assets/ErrorIcon.js b/packages/component/src/Attachment/Assets/ErrorIcon.js index 85ff7f90c6..62c731d9ad 100644 --- a/packages/component/src/Attachment/Assets/ErrorIcon.js +++ b/packages/component/src/Attachment/Assets/ErrorIcon.js @@ -1,6 +1,8 @@ import React from 'react'; -export default props => +const ErrorIcon = () => + +export default ErrorIcon diff --git a/packages/component/src/Attachment/Assets/ErrorNotificationIcon.js b/packages/component/src/Attachment/Assets/ErrorNotificationIcon.js index 3924aa9fa4..647b86f9a6 100644 --- a/packages/component/src/Attachment/Assets/ErrorNotificationIcon.js +++ b/packages/component/src/Attachment/Assets/ErrorNotificationIcon.js @@ -1,13 +1,30 @@ +import PropTypes from 'prop-types'; import React from 'react'; -export default ({ className, size = 1 }) => - - - +const ICON_SIZE_FACTOR = 16; + +const ErrorNotificationIcon = ({ className, size }) => + + + + +ErrorNotificationIcon.defaultProps = { + className: '', + size: 1 +}; + +ErrorNotificationIcon.propTypes = { + className: PropTypes.string, + size: PropTypes.number +}; + +export default ErrorNotificationIcon diff --git a/packages/component/src/Attachment/Assets/SpinnerAnimation.js b/packages/component/src/Attachment/Assets/SpinnerAnimation.js index 982587901d..49b6e25c3b 100644 --- a/packages/component/src/Attachment/Assets/SpinnerAnimation.js +++ b/packages/component/src/Attachment/Assets/SpinnerAnimation.js @@ -1,11 +1,18 @@ +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../../connectToWebChat'; -const ConnectSpinnerAnimation = connectToWebChat( +const SpinnerAnimation = ({ styleSet }) =>
; + +SpinnerAnimation.propTypes = { + styleSet: PropTypes.shape({ + spinnerAnimation: PropTypes.any.isRequired + }).isRequired +}; + +const ConnectedSpinnerAnimation = connectToWebChat( ({ styleSet }) => ({ styleSet }) -)(({ styleSet }) => -
-) +)(SpinnerAnimation); -export default () => +export default ConnectedSpinnerAnimation diff --git a/packages/component/src/Attachment/Assets/TypingAnimation.js b/packages/component/src/Attachment/Assets/TypingAnimation.js index 0434574361..2367ca481b 100644 --- a/packages/component/src/Attachment/Assets/TypingAnimation.js +++ b/packages/component/src/Attachment/Assets/TypingAnimation.js @@ -1,11 +1,18 @@ +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../../connectToWebChat'; -const ConnectTypingAnimation = connectToWebChat( +const TypingAnimation = ({ styleSet }) =>
; + +TypingAnimation.propTypes = { + styleSet: PropTypes.shape({ + typingAnimation: PropTypes.any.isRequired + }).isRequired +}; + +const ConnectedTypingAnimation = connectToWebChat( ({ styleSet }) => ({ styleSet }) -)(({ styleSet }) => -
-) +)(TypingAnimation) -export default () => +export default ConnectedTypingAnimation diff --git a/packages/component/src/Attachment/Assets/WarningNotificationIcon.js b/packages/component/src/Attachment/Assets/WarningNotificationIcon.js index 458935e780..7b8dfe45e6 100644 --- a/packages/component/src/Attachment/Assets/WarningNotificationIcon.js +++ b/packages/component/src/Attachment/Assets/WarningNotificationIcon.js @@ -1,12 +1,30 @@ +import PropTypes from 'prop-types'; import React from 'react'; -export default ({ className, size = 1 }) => - - - +const ICON_SIZE_FACTOR = 16; + +const WarningNotificationIcon = ({ className, size }) => + + + + +WarningNotificationIcon.defaultProps = { + className: '', + size: 1 +}; + +WarningNotificationIcon.propTypes = { + className: PropTypes.string, + size: PropTypes.number +}; + +export default WarningNotificationIcon diff --git a/packages/component/src/Attachment/AudioAttachment.js b/packages/component/src/Attachment/AudioAttachment.js index ab30861eeb..62bd64c48d 100644 --- a/packages/component/src/Attachment/AudioAttachment.js +++ b/packages/component/src/Attachment/AudioAttachment.js @@ -1,16 +1,27 @@ +import PropTypes from 'prop-types'; import React from 'react'; import AudioContent from './AudioContent'; import connectToWebChat from '../connectToWebChat'; +const AudioAttachment = ({ attachment, styleSet }) => +
+ +
; + +AudioAttachment.propTypes = { + attachment: PropTypes.shape({ + contentUrl: PropTypes.string.isRequired, + name: PropTypes.string + }).isRequired, + styleSet: PropTypes.shape({ + audioAttachment: PropTypes.any.isRequired + }).isRequired +}; + export default connectToWebChat( ({ styleSet }) => ({ styleSet }) -)( - ({ attachment, styleSet }) => -
- -
-) +)(AudioAttachment) diff --git a/packages/component/src/Attachment/AudioContent.js b/packages/component/src/Attachment/AudioContent.js index 87ba1fbd37..010c70fd02 100644 --- a/packages/component/src/Attachment/AudioContent.js +++ b/packages/component/src/Attachment/AudioContent.js @@ -1,23 +1,40 @@ +import PropTypes from 'prop-types'; import React from 'react'; import connectToWebChat from '../connectToWebChat'; +const AudioContent = ({ + autoPlay, + loop, + poster, + src, + styleSet +}) => +