diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 35a761559..000000000 --- a/.eslintrc +++ /dev/null @@ -1,136 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": [ - "airbnb", - "prettier", - "prettier/react" - ], - "env": { - "es6": true, - "browser": true, - "mocha": true, - "commonjs": true - }, - "globals": { - "after": false, - "afterEach": false, - "before": false, - "beforeEach": false, - "describe": false, - "expect": false, - "it": false, - "sinon": false, - "assert": false, - "fixture": false, - "__": false, - "PDFJS": false, - "Box": false, - "DocumentTouch": false, - "ActiveXObject": false - }, - "rules": { - "quotes": [ - "error", - "single" - ], - "comma-dangle": [ - "error", - "never" - ], - "indent": [ - "error", - 4, - { - "SwitchCase": 1 - } - ], - "import/imports-first": [ - "off" - ], - "jsx-quotes": [ - "error", - "prefer-single" - ], - "max-len": [ - "off" - ], - "react/jsx-indent-props": [ - "error", - 4 - ], - "react/jsx-indent": [ - "error", - 4 - ], - "no-underscore-dangle": [ - "off" - ], - "react/jsx-filename-extension": [ - "off" - ], - "arrow-body-style": [ - "off" - ], - "class-methods-use-this": [ - "off" - ], - "arrow-parens": [ - "error", - "always" - ], - "no-plusplus": [ - "error", - { - "allowForLoopAfterthoughts": true - } - ], - "import/no-extraneous-dependencies": [ - "off" - ], - "import/no-webpack-loader-syntax": [ - "off" - ], - "require-jsdoc": [ - "warn", - { - "require": { - "FunctionDeclaration": true, - "MethodDefinition": false, - "ClassDeclaration": false, - "ArrowFunctionExpression": true - } - } - ], - "valid-jsdoc": [ - "warn", - { - "prefer": { - "returns": "return", - "class": "constructor" - }, - "preferType": { - "array": "Array", - "function": "Function", - "object": "Object", - "Boolean": "boolean", - "Number": "number", - "String": "string" - } - } - ], - "prefer-destructuring": [ - "error", - { - "object": true, - "array": false - } - ] - }, - "settings": { - "import/resolver": { - "webpack": { - "config-index": 0 - } - } - } -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..67689291c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +const eslintrc = require.resolve('@box/frontend/eslint/eslintrc.js'); + +module.exports = { + extends: [eslintrc], + globals: { + __: false, + __I18N__: false, + ActiveXObject: false, + DocumentTouch: false, + Assert: false, + fixture: false, + PDFJS: false, + sinon: false, + }, + rules: { + 'class-methods-use-this': 0, // fixme + 'import/no-cycle': 0, // fixme + 'import/no-extraneous-dependencies': 0, // fixme + 'no-underscore-dangle': 0, // fixme + 'prefer-destructuring': ['error', { object: true, array: false }], // fixme + }, +}; diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 000000000..82dd00e57 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1 @@ +module.exports = require('@box/frontend/prettier/prettierrc.js'); diff --git a/.stylelintrc b/.stylelintrc deleted file mode 100644 index 581ab9d3c..000000000 --- a/.stylelintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "stylelint-config-standard", - "plugins": [ - "stylelint-order", - "stylelint-scss" - ], - "rules": { - "indentation": 4, - "at-rule-no-vendor-prefix": true, - "at-rule-no-unknown": [true, { "ignoreAtRules": ["include", "mixin", "content"] }], - "media-feature-name-no-vendor-prefix": true, - "property-no-vendor-prefix": true, - "selector-no-vendor-prefix": true, - "value-no-vendor-prefix": true, - "number-leading-zero": never, - "declaration-no-important": true, - "no-descending-specificity": null, - "order/properties-alphabetical-order": [true, { "severity": "warning" }] - }, - "ignoreFiles": [ - "**/*.md" - ] -} diff --git a/.travis.yml b/.travis.yml index b83c11baa..cf52a3d95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,17 @@ language: node_js node_js: - '10' -cache: yarn +cache: + yarn: true + directories: + - node_modules + - ~/.cache/Cypress before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 - export PATH=$HOME/.yarn/bin:$PATH jobs: include: - - name: "Code Lint" - script: yarn lint - - name: "Unit Tests" - script: yarn test + - name: "Build & Test" + script: commitlint-travis && yarn lint && npm-run-all clean build:i18n build:ci test - name: "E2E Tests" script: yarn test:e2e - - name: "Build" - script: npm-run-all clean build:i18n build:ci diff --git a/commitlint.config.js b/commitlint.config.js index 3c321af44..61553f37f 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,70 +1 @@ -module.exports = { - rules: { - "body-leading-blank": [ - 2, - "always" - ], - "body-max-length": [ - 0 - ], - "body-min-length": [ - 0 - ], - "body-tense": [ - 0, - "never" - ], - "footer-leading-blank": [ - 0, - "never" - ], - "header-max-length": [ - 2, - "always", - 72 - ], - "header-min-length": [ - 2, - "always", - 3 - ], - "subject-tense": [ - 0 - ], - "subject-max-length": [ - 0 - ], - "subject-min-length": [ - 0 - ], - "type-case": [ - 0, - "never" - ], - "type-empty": [ - 2, - "never" - ], - "type-enum": [ - 2, - "always", - [ - "Fix", - "New", - "Breaking", - "Docs", - "Build", - "Upgrade", - "Chore", - "Update", - "Release" - ] - ], - "type-max-length": [ - 0 - ], - "type-min-length": [ - 0 - ] - } -}; +module.exports = require('@box/frontend/commitlint/commitlint.config.js'); // eslint-disable-line import/no-extraneous-dependencies diff --git a/package.json b/package.json index 9cfcbfc78..d458a58d7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,10 @@ "url": "git@github.com:box/box-content-preview.git" }, "devDependencies": { - "@commitlint/cli": "^5.2.0", + "@box/frontend": "^1.4.0", + "@commitlint/cli": "^7.2.1", + "@commitlint/config-conventional": "7.1.2", + "@commitlint/travis-cli": "^8.1.0", "autoprefixer": "^7.2.1", "axios": "^0.19.0", "babel-core": "^6.26.0", @@ -30,22 +33,27 @@ "box-react-ui": "^22.7.0", "chai": "^4.2.0", "chai-dom": "^1.8.1", - "conventional-changelog-cli": "^1.3.5", + "conventional-changelog-cli": "^2.0.5", "conventional-github-releaser": "^2.0.0", "create-react-class": "^15.6.2", "css-loader": "^0.28.7", "cssnano-cli": "^1.0.5", "cypress": "^3.1.5", - "eslint": "^4.12.1", - "eslint-config-airbnb": "^16.1.0", - "eslint-config-prettier": "^2.9.0", + "eslint": "^4.19.1", + "eslint-config-airbnb": "^17.1.0", + "eslint-config-prettier": "^3.0.1", "eslint-import-resolver-webpack": "^0.8.3", - "eslint-plugin-babel": "^4.1.1", + "eslint-plugin-babel": "^5.2.0", "eslint-plugin-chai-friendly": "^0.4.1", - "eslint-plugin-cypress": "^2.2.0", - "eslint-plugin-import": "^2.8.0", - "eslint-plugin-jsx-a11y": "^6.0.2", - "eslint-plugin-react": "^7.5.1", + "eslint-plugin-cypress": "^2.2.1", + "eslint-plugin-flowtype": "^2.34.1", + "eslint-plugin-import": "^2.18.0", + "eslint-plugin-jest": "^21.21.0", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-lodash": "^5.1.0", + "eslint-plugin-prettier": "^2.6.2", + "eslint-plugin-react": "^7.8.2", + "eslint-plugin-react-hooks": "^1.6.0", "extract-text-webpack-plugin": "3.0.2", "file-loader": "^1.1.5", "fscreen": "^1.0.2", @@ -67,8 +75,8 @@ "karma-sinon-chai": "^2.0.2", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^3.0.5", - "lint-staged": "^5.0.0", - "lodash": "^4.17.5", + "lint-staged": "^8.0.4", + "lodash": "^4.17.11", "mocha": "^4.0.1", "mock-local-storage": "^1.0.2", "mojito-rb-gen": "^0.0.1", @@ -79,7 +87,7 @@ "phantomjs-prebuilt": "^2.1.16", "postcss-loader": "^2.0.9", "postcss-sass": "^0.3.0", - "prettier": "^1.8.2", + "prettier": "^1.14.2", "prettier-eslint-cli": "^4.4.2", "raw-loader": "^0.5.1", "react": "^16.7.0", @@ -90,9 +98,9 @@ "sinon-chai": "3.3.0", "string-replace-loader": "^1.3.0", "style-loader": "^0.19.0", - "stylelint": "^8.3.1", - "stylelint-config-standard": "^18.0.0", - "stylelint-order": "^0.7.0", + "stylelint": "^9.5.0", + "stylelint-config-standard": "^18.2.0", + "stylelint-order": "^1.0.0", "stylelint-scss": "^2.2.0", "wait-on": "^3.2.0", "webpack": "^3.10.0", @@ -131,14 +139,14 @@ "upgrade:pdfjs": "./build/upgrade_pdfjs.sh && ./build/minify_pdfjs.sh" }, "lint-staged": { - "tests/**/*.js": [ - "prettier-eslint --print-width 120 --single-quote --tab-width 4 --write", - "git add" - ], - "src/lib/**/*.js": [ - "prettier-eslint --print-width 120 --single-quote --tab-width 4 --write", - "git add" - ] + "linters": { + "*.js": ["eslint --fix", "git add"], + "*.md": ["prettier --write --parser=markdown", "git add"], + "*.json": ["prettier --write --parser=json", "git add"], + "*.html": ["prettier --write --parser=html", "git add"], + "*.scss": ["prettier --write --parser=scss", "stylelint --syntax scss --fix", "git add"], + "*.css": ["prettier --write --parser=css", "stylelint --syntax css --fix", "git add"] + } }, "husky": { "hooks": { diff --git a/src/lib/Browser.js b/src/lib/Browser.js index a1ade6a32..710a5c6b5 100644 --- a/src/lib/Browser.js +++ b/src/lib/Browser.js @@ -184,7 +184,7 @@ class Browser { if (!gl) { const canvas = document.createElement('canvas'); // Should stop 'Rats! WebGL hit a snag' error when checking WebGL support - canvas.addEventListener(EVENT_WEBGL_CONTEXT_LOST, (e) => { + canvas.addEventListener(EVENT_WEBGL_CONTEXT_LOST, e => { /* istanbul ignore next */ e.preventDefault(); /* istanbul ignore next */ @@ -358,8 +358,8 @@ class Browser { h264: { baseline: Browser.canPlayH264Baseline(), main: Browser.canPlayH264Main(), - high: Browser.canPlayH264High() - } + high: Browser.canPlayH264High(), + }, }; } } diff --git a/src/lib/Controls.js b/src/lib/Controls.js index 2bd09b298..d83082939 100644 --- a/src/lib/Controls.js +++ b/src/lib/Controls.js @@ -69,7 +69,7 @@ class Controls { this.controlsEl.removeEventListener('click', this.clickHandler); } - this.buttonRefs.forEach((ref) => { + this.buttonRefs.forEach(ref => { ref.button.removeEventListener('click', ref.handler); }); } @@ -148,7 +148,7 @@ class Controls { * @param {Event} event - A DOM-normalized event object. * @return {void} */ - focusinHandler = (event) => { + focusinHandler = event => { // When we focus onto a preview control button, show controls if (this.isPreviewControlButton(event.target)) { this.containerEl.classList.add(SHOW_PREVIEW_CONTROLS_CLASS); @@ -163,7 +163,7 @@ class Controls { * @param {Event} event - A DOM-normalized event object. * @return {void} */ - focusoutHandler = (event) => { + focusoutHandler = event => { // When we focus out of a control button and aren't focusing onto another control button, hide the controls if (this.isPreviewControlButton(event.target) && !this.isPreviewControlButton(event.relatedTarget)) { this.shouldHide = true; @@ -213,7 +213,7 @@ class Controls { // Maintain a reference for cleanup this.buttonRefs.push({ button, - handler + handler, }); return button; diff --git a/src/lib/Controls.scss b/src/lib/Controls.scss index fd0da79cc..b01826257 100644 --- a/src/lib/Controls.scss +++ b/src/lib/Controls.scss @@ -43,13 +43,13 @@ } // Removes the spinner for number type inputs in Firefox - input[type=number] { + input[type='number'] { -moz-appearance: textfield; } /* stylelint-enable property-no-vendor-prefix */ - input[type="number"].bp-page-num-input { + input[type='number'].bp-page-num-input { font-size: 14px; margin: 0 auto; position: absolute; @@ -75,7 +75,7 @@ display: none; } - input[type="number"].bp-page-num-input { + input[type='number'].bp-page-num-input { display: inline-block; position: static; visibility: visible; diff --git a/src/lib/DownloadReachability.js b/src/lib/DownloadReachability.js index 03b0b2592..d4a243e31 100644 --- a/src/lib/DownloadReachability.js +++ b/src/lib/DownloadReachability.js @@ -166,7 +166,7 @@ class DownloadReachability { } else { // Try the custom host, then check reachability openUrlInsideIframe(downloadUrl); - DownloadReachability.setDownloadReachability(downloadUrl).then((isBlocked) => { + DownloadReachability.setDownloadReachability(downloadUrl).then(isBlocked => { if (isBlocked) { // If download is unreachable, try again with default openUrlInsideIframe(defaultDownloadUrl); diff --git a/src/lib/Logger.js b/src/lib/Logger.js index 0738399fa..2f0a46f88 100644 --- a/src/lib/Logger.js +++ b/src/lib/Logger.js @@ -19,18 +19,18 @@ class Logger { browser, client: { name: CLIENT_NAME, - version: CLIENT_VERSION + version: CLIENT_VERSION, }, converted: true, cache: { hit: false, - stale: false + stale: false, }, time: { conversion: 0, rendering: 0, - total: 0 - } + total: 0, + }, }; } diff --git a/src/lib/Notification.js b/src/lib/Notification.js index 5886e7e07..adf7d9249 100644 --- a/src/lib/Notification.js +++ b/src/lib/Notification.js @@ -90,7 +90,7 @@ class Notification { * @param {Event} event - DOM event * @return {void} */ - clickHandler = (event) => { + clickHandler = event => { event.stopPropagation(); if (event.target === this.buttonEl) { diff --git a/src/lib/PageControls.js b/src/lib/PageControls.js index 15d6defdc..b572550e4 100644 --- a/src/lib/PageControls.js +++ b/src/lib/PageControls.js @@ -39,6 +39,7 @@ class PageControls extends EventEmitter { /** @property {HTMLElement} - Page number input element */ pageNumInputEl; + /** * [constructor] * @@ -74,7 +75,7 @@ class PageControls extends EventEmitter { __('previous_page'), this.setPreviousPage, `bp-previous-page-icon ${PREV_PAGE}`, - ICON_DROP_UP + ICON_DROP_UP, ); this.controls.add(__('enter_page_num'), this.showPageNumInput, PAGE_NUM, pageNumTemplate); this.controls.add(__('next_page'), this.setNextPage, `bp-next-page-icon ${NEXT_PAGE}`, ICON_DROP_DOWN); diff --git a/src/lib/Popup.js b/src/lib/Popup.js index 0a75b01f1..829086716 100644 --- a/src/lib/Popup.js +++ b/src/lib/Popup.js @@ -173,7 +173,7 @@ class Popup { * @param {Event} event - DOM event * @return {void} */ - popupClickHandler = (event) => { + popupClickHandler = event => { event.preventDefault(); event.stopPropagation(); @@ -195,7 +195,7 @@ class Popup { * @param {Event} event - Keydown event * @return {boolean} Consumed or not */ - keydownHandler = (event) => { + keydownHandler = event => { const key = decodeKeydown(event); switch (key) { case 'Esc': diff --git a/src/lib/Preview.js b/src/lib/Preview.js index a628db179..b8c46ee1c 100644 --- a/src/lib/Preview.js +++ b/src/lib/Preview.js @@ -24,7 +24,7 @@ import { stripAuthFromString, isValidFileId, isBoxWebApp, - convertWatermarkPref + convertWatermarkPref, } from './util'; import { getURL, @@ -38,7 +38,7 @@ import { getCachedFile, normalizeFileVersion, canDownload, - shouldDownloadWM + shouldDownloadWM, } from './file'; import { API_HOST, @@ -51,7 +51,7 @@ import { X_REP_HINT_IMAGE, X_REP_HINT_VIDEO_DASH, X_REP_HINT_VIDEO_MP4, - FILE_OPTION_FILE_VERSION_ID + FILE_OPTION_FILE_VERSION_ID, } from './constants'; import { VIEWER_EVENT, @@ -61,7 +61,7 @@ import { LOAD_METRIC, DURATION_METRIC, PREVIEW_END_EVENT, - PREVIEW_DOWNLOAD_ATTEMPT_EVENT + PREVIEW_DOWNLOAD_ATTEMPT_EVENT, } from './events'; import { getClientLogDetails, getISOTime } from './logUtils'; import './Preview.scss'; @@ -91,7 +91,7 @@ class Preview extends EventEmitter { count = { success: 0, // Counts how many previews have happened overall error: 0, // Counts how many errors have happened overall - navigation: 0 // Counts how many previews have happened by prev next navigation + navigation: 0, // Counts how many previews have happened by prev next navigation }; /** @property {Object} - Current file being previewed */ @@ -154,7 +154,7 @@ class Preview extends EventEmitter { constructor() { super(); - DEFAULT_DISABLED_VIEWERS.forEach((viewerName) => { + DEFAULT_DISABLED_VIEWERS.forEach(viewerName => { this.disabledViewers[viewerName] = 1; }); @@ -203,9 +203,9 @@ class Preview extends EventEmitter { event_name: PREVIEW_END_EVENT, value: { duration: previewDurationTimer ? previewDurationTimer.elapsed : null, - viewer_status: this.viewer.getLoadStatus() + viewer_status: this.viewer.getLoadStatus(), }, - ...this.createLogEvent() + ...this.createLogEvent(), }; Timer.reset(previewDurationTag); @@ -320,14 +320,14 @@ class Preview extends EventEmitter { const files = []; const fileIds = []; - fileOrIds.forEach((fileOrId) => { + fileOrIds.forEach(fileOrId => { if (fileOrId && isValidFileId(fileOrId)) { // String id found in the collection fileIds.push(fileOrId.toString()); } else if (fileOrId && typeof fileOrId === 'object' && isValidFileId(fileOrId.id)) { // Possible well-formed file object found in the collection const wellFormedFileObj = Object.assign({}, fileOrId, { - id: fileOrId.id.toString() + id: fileOrId.id.toString(), }); fileIds.push(wellFormedFileObj.id); files.push(wellFormedFileObj); @@ -366,7 +366,7 @@ class Preview extends EventEmitter { files = [fileMetadata]; } - files.forEach((file) => { + files.forEach(file => { if (file.watermark_info && file.watermark_info.is_watermarked) { return; } @@ -422,7 +422,7 @@ class Preview extends EventEmitter { */ getViewers() { let viewers = []; - this.loaders.forEach((loader) => { + this.loaders.forEach(loader => { viewers = viewers.concat(loader.getViewers()); }); return viewers; @@ -437,7 +437,7 @@ class Preview extends EventEmitter { */ disableViewers(viewers) { if (Array.isArray(viewers)) { - viewers.forEach((viewer) => { + viewers.forEach(viewer => { this.disabledViewers[viewer] = 1; }); } else if (viewers) { @@ -454,7 +454,7 @@ class Preview extends EventEmitter { */ enableViewers(viewers) { if (Array.isArray(viewers)) { - viewers.forEach((viewer) => { + viewers.forEach(viewer => { delete this.disabledViewers[viewer]; }); } else if (viewers) { @@ -535,7 +535,7 @@ class Preview extends EventEmitter { const params = Object.assign({ response_content_disposition_type: 'attachment' }, queryParams); const downloadUrl = appendQueryParams( this.viewer.createContentUrlWithAuthParams(contentUrlTemplate, this.viewer.getAssetPath()), - params + params, ); DownloadReachability.downloadWithReachabilityCheck(downloadUrl); @@ -543,7 +543,7 @@ class Preview extends EventEmitter { // Otherwise, get the content download URL of the original file and download } else { const getDownloadUrl = appendQueryParams(getDownloadURL(this.file.id, apiHost), queryParams); - api.get(getDownloadUrl, { headers: this.getRequestHeaders() }).then((data) => { + api.get(getDownloadUrl, { headers: this.getRequestHeaders() }).then(data => { const downloadUrl = appendQueryParams(data.download_url, queryParams); DownloadReachability.downloadWithReachabilityCheck(downloadUrl); }); @@ -552,7 +552,7 @@ class Preview extends EventEmitter { const downloadAttemptEvent = { event_name: PREVIEW_DOWNLOAD_ATTEMPT_EVENT, value: this.viewer ? this.viewer.getLoadStatus() : null, - ...this.createLogEvent() + ...this.createLogEvent(), }; this.emit(PREVIEW_METRIC, downloadAttemptEvent); @@ -629,7 +629,7 @@ class Preview extends EventEmitter { file, token, // Viewers may ignore this representation when prefetching a preload - representation: loader.determineRepresentation(file, viewer) + representation: loader.determineRepresentation(file, viewer), }; // If we are prefetching for preload, shared link and password are not set on @@ -647,7 +647,7 @@ class Preview extends EventEmitter { // Prefetch preload if explicitly requested or if viewer has 'preload' option set preload: preload || !!viewerInstance.getViewerOption('preload'), // Don't prefetch file's representation content if this is for preload - content: !preload + content: !preload, }); } } @@ -661,19 +661,19 @@ class Preview extends EventEmitter { */ prefetchViewers(viewerNames = []) { this.getViewers() - .filter((viewer) => viewerNames.indexOf(viewer.NAME) !== -1) - .forEach((viewer) => { + .filter(viewer => viewerNames.indexOf(viewer.NAME) !== -1) + .forEach(viewer => { const viewerInstance = new viewer.CONSTRUCTOR( this.createViewerOptions({ - viewer - }) + viewer, + }), ); if (typeof viewerInstance.prefetch === 'function') { viewerInstance.prefetch({ assets: true, preload: false, - content: false + content: false, }); } }); @@ -721,7 +721,7 @@ class Preview extends EventEmitter { const bareFile = { id: fileId }; if (fileVersionId) { bareFile.file_version = { - id: fileVersionId + id: fileVersionId, }; } @@ -739,7 +739,7 @@ class Preview extends EventEmitter { this.file = { id }; if (file_version) { this.file.file_version = { - id: file_version.id + id: file_version.id, }; } /* eslint-enable camelcase */ @@ -748,7 +748,7 @@ class Preview extends EventEmitter { ERROR_CODE.BAD_INPUT, __('error_generic'), {}, - 'File is not a well-formed Box File object. See FILE_FIELDS in file.js for a list of required fields.' + 'File is not a well-formed Box File object. See FILE_FIELDS in file.js for a list of required fields.', ); } @@ -826,7 +826,7 @@ class Preview extends EventEmitter { this.keydownHandler, this.navigateLeft, this.navigateRight, - this.throttledMousemoveHandler + this.throttledMousemoveHandler, ); // Set up the notification @@ -943,7 +943,7 @@ class Preview extends EventEmitter { this.loaders = (options.loaders || []).concat(loaderList); // Disable or enable viewers based on viewer options - Object.keys(this.options.viewers).forEach((viewerName) => { + Object.keys(this.options.viewers).forEach(viewerName => { const isDisabled = this.options.viewers[viewerName].disabled; // Explicitly check for booleans, disabled:false will override any default disabling @@ -964,7 +964,7 @@ class Preview extends EventEmitter { */ createViewerOptions(moreOptions) { return cloneDeep( - Object.assign({}, this.options, moreOptions, { location: this.location, cache: this.cache, ui: this.ui }) + Object.assign({}, this.options, moreOptions, { location: this.location, cache: this.cache, ui: this.ui }), ); } @@ -997,9 +997,9 @@ class Preview extends EventEmitter { const { apiHost, previewWMPref, queryParams } = this.options; const params = Object.assign( { - watermark_preference: convertWatermarkPref(previewWMPref) + watermark_preference: convertWatermarkPref(previewWMPref), }, - queryParams + queryParams, ); const fileVersionId = this.getFileOption(this.file.id, FILE_OPTION_FILE_VERSION_ID) || ''; @@ -1008,8 +1008,7 @@ class Preview extends EventEmitter { Timer.start(tag); const fileInfoUrl = appendQueryParams(getURL(this.file.id, fileVersionId, apiHost), params); - api - .get(fileInfoUrl, { headers: this.getRequestHeaders() }) + api.get(fileInfoUrl, { headers: this.getRequestHeaders() }) .then(this.handleFileInfoResponse) .catch(this.handleFetchError); } @@ -1098,9 +1097,9 @@ class Preview extends EventEmitter { if (this.file.is_download_available === false) { const details = isBoxWebApp() ? { - linkText: __('link_contact_us'), - linkUrl: SUPPORT_URL - } + linkText: __('link_contact_us'), + linkUrl: SUPPORT_URL, + } : {}; throw new PreviewError(ERROR_CODE.NOT_DOWNLOADABLE, __('error_not_downloadable'), details); } @@ -1121,7 +1120,7 @@ class Preview extends EventEmitter { // If no loader, then check to see if any of our viewers support this file type. // If they do, we know the account can't preview this file type. If they can't we know this file type is unsupported. if (!loader) { - const isFileTypeSupported = this.getViewers().find((viewer) => { + const isFileTypeSupported = this.getViewers().find(viewer => { return viewer.EXT.indexOf(this.file.extension) > -1; }); @@ -1153,7 +1152,7 @@ class Preview extends EventEmitter { viewer, representation, container: this.container, - file: this.file + file: this.file, }); viewerOptions.logger = this.logger; // Don't clone the logger since it needs to track metrics this.viewer = new viewer.CONSTRUCTOR(viewerOptions); @@ -1239,7 +1238,7 @@ class Preview extends EventEmitter { const formattedEvent = { event_name: data.event, value: data.data, - ...this.createLogEvent() + ...this.createLogEvent(), }; this.emit(PREVIEW_METRIC, formattedEvent); @@ -1282,12 +1281,12 @@ class Preview extends EventEmitter { this.emit(VIEWER_EVENT.load, { error, metrics: this.logger.done(this.count), - file: this.file + file: this.file, }); // Explicit preview failure this.handleViewerMetrics({ - event: 'failure' + event: 'failure', }); // Hookup for phantom JS health check @@ -1302,12 +1301,12 @@ class Preview extends EventEmitter { this.emit(VIEWER_EVENT.load, { viewer: this.viewer, metrics: this.logger.done(this.count), - file: this.file + file: this.file, }); // Explicit preview success this.handleViewerMetrics({ - event: 'success' + event: 'success', }); // If there wasn't an error and event logging is not disabled, use Events API to log a preview @@ -1356,13 +1355,12 @@ class Preview extends EventEmitter { event_type: 'preview', source: { type: 'file', - id: fileId - } + id: fileId, + }, }; const headers = getHeaders({}, token, sharedLink, sharedLinkPassword); - api - .post(`${apiHost}/2.0/events`, data, { headers }) + api.post(`${apiHost}/2.0/events`, data, { headers }) .then(() => { // Reset retry count after successfully logging this.logRetryCount = 0; @@ -1440,8 +1438,8 @@ class Preview extends EventEmitter { this.createViewerOptions({ viewer: { NAME: 'Error' }, container: this.container, - file: this.file - }) + file: this.file, + }), ); } @@ -1504,7 +1502,7 @@ class Preview extends EventEmitter { extension: file.extension || '', locale: getProp(this.location, 'locale', ''), rep_type: getProp(this.viewer, 'options.representation.representation', '').toLowerCase(), - ...getClientLogDetails() + ...getClientLogDetails(), }; return log; @@ -1530,7 +1528,7 @@ class Preview extends EventEmitter { const errorLog = { error: sanitizedError, - ...this.createLogEvent() + ...this.createLogEvent(), }; this.emit(PREVIEW_ERROR, errorLog); @@ -1572,7 +1570,7 @@ class Preview extends EventEmitter { [LOAD_METRIC.convertTime]: convertTime.elapsed || 0, [LOAD_METRIC.downloadResponseTime]: downloadTime.elapsed || 0, [LOAD_METRIC.contentLoadTime]: contentLoadTime.elapsed || 0, - ...this.createLogEvent() + ...this.createLogEvent(), }; this.emit(PREVIEW_METRIC, event); @@ -1591,14 +1589,14 @@ class Preview extends EventEmitter { const videoHint = Browser.canPlayDash() && !this.disabledViewers.Dash ? X_REP_HINT_VIDEO_DASH : X_REP_HINT_VIDEO_MP4; const headers = { - 'X-Rep-Hints': `${X_REP_HINT_BASE}${X_REP_HINT_DOC_THUMBNAIL}${X_REP_HINT_IMAGE}${videoHint}` + 'X-Rep-Hints': `${X_REP_HINT_BASE}${X_REP_HINT_DOC_THUMBNAIL}${X_REP_HINT_IMAGE}${videoHint}`, }; return getHeaders( headers, token || this.options.token, this.options.sharedLink, - this.options.sharedLinkPassword + this.options.sharedLinkPassword, ); } @@ -1613,9 +1611,9 @@ class Preview extends EventEmitter { const { apiHost, previewWMPref, queryParams, skipServerUpdate } = this.options; const params = Object.assign( { - watermark_preference: convertWatermarkPref(previewWMPref) + watermark_preference: convertWatermarkPref(previewWMPref), }, - queryParams + queryParams, ); // Don't bother prefetching when there aren't more files or we need to skip server update @@ -1630,7 +1628,7 @@ class Preview extends EventEmitter { const currentIndex = this.collection.indexOf(this.file.id); const filesToPrefetch = this.collection .slice(currentIndex + 1, currentIndex + PREFETCH_COUNT + 1) - .filter((fileId) => this.prefetchedCollection.indexOf(fileId) === -1); + .filter(fileId => this.prefetchedCollection.indexOf(fileId) === -1); // Check if we need to prefetch anything if (filesToPrefetch.length === 0) { @@ -1639,8 +1637,8 @@ class Preview extends EventEmitter { // Get access tokens for all files we should be prefetching getTokens(filesToPrefetch, this.previewOptions.token) - .then((tokenMap) => { - filesToPrefetch.forEach((fileId) => { + .then(tokenMap => { + filesToPrefetch.forEach(fileId => { const token = tokenMap[fileId]; // Append optional query params @@ -1648,9 +1646,8 @@ class Preview extends EventEmitter { const fileInfoUrl = appendQueryParams(getURL(fileId, fileVersionId, apiHost), params); // Prefetch and cache file information and content - api - .get(fileInfoUrl, { headers: this.getRequestHeaders(token) }) - .then((file) => { + api.get(fileInfoUrl, { headers: this.getRequestHeaders(token) }) + .then(file => { // Cache file info cacheFile(this.cache, file); this.prefetchedCollection.push(file.id); @@ -1658,10 +1655,10 @@ class Preview extends EventEmitter { // Prefetch assets and content for file this.prefetch({ fileId: file.id, - token + token, }); }) - .catch((err) => { + .catch(err => { const message = `Error prefetching file ID ${fileId} - ${err}`; // eslint-disable-next-line console.error(message); @@ -1671,7 +1668,7 @@ class Preview extends EventEmitter { }); }); }) - .catch((err) => { + .catch(err => { const message = `Error prefetching files - ${err}`; // eslint-disable-next-line console.error(message); @@ -1680,9 +1677,9 @@ class Preview extends EventEmitter { ERROR_CODE.PREFETCH_FILE, message, { - fileIds: filesToPrefetch + fileIds: filesToPrefetch, }, - err.message + err.message, ); this.emitPreviewError(error); }); @@ -1724,7 +1721,7 @@ class Preview extends EventEmitter { }, MOUSEMOVE_THROTTLE_MS); }, MOUSEMOVE_THROTTLE_MS - 500, - true + true, ); } @@ -1782,7 +1779,7 @@ class Preview extends EventEmitter { * @return {Object|null} Matching loader */ getLoader(file) { - return this.loaders.find((loader) => loader.canLoad(file, Object.keys(this.disabledViewers))); + return this.loaders.find(loader => loader.canLoad(file, Object.keys(this.disabledViewers))); } /** diff --git a/src/lib/PreviewUI.js b/src/lib/PreviewUI.js index 79d8cde99..ccd6bc9a8 100644 --- a/src/lib/PreviewUI.js +++ b/src/lib/PreviewUI.js @@ -24,7 +24,7 @@ import { SELECTOR_BOX_PREVIEW, SELECTOR_NAVIGATION_LEFT, SELECTOR_NAVIGATION_RIGHT, - SELECTOR_BOX_PREVIEW_CONTENT + SELECTOR_BOX_PREVIEW_CONTENT, } from './constants'; class PreviewUI { @@ -365,7 +365,7 @@ class PreviewUI { // First hide all possible headers const headers = this.container.querySelectorAll(`.${CLASS_BOX_PREVIEW_HEADER}`); - [].forEach.call(headers, (header) => { + [].forEach.call(headers, header => { header.classList.add(CLASS_HIDDEN); }); diff --git a/src/lib/ProgressBar.js b/src/lib/ProgressBar.js index 20856d585..46ab46e54 100644 --- a/src/lib/ProgressBar.js +++ b/src/lib/ProgressBar.js @@ -1,7 +1,7 @@ import { CLASS_IS_VISIBLE, CLASS_BOX_PREVIEW_PROGRESS_BAR, - CLASS_BOX_PREVIEW_PROGRESS_BAR_CONTAINER + CLASS_BOX_PREVIEW_PROGRESS_BAR_CONTAINER, } from './constants'; const PROGRESS_INTERVAL_MS = 150; @@ -60,7 +60,8 @@ class ProgressBar { if (this.progress >= 95) { clearInterval(this.progressInterval); return; - } else if (this.progress >= 80) { + } + if (this.progress >= 80) { this.progress += Math.random(); } else { this.progress += Math.random() * 5; diff --git a/src/lib/RepStatus.js b/src/lib/RepStatus.js index 213f374ba..577563bd8 100644 --- a/src/lib/RepStatus.js +++ b/src/lib/RepStatus.js @@ -85,7 +85,7 @@ class RepStatus extends EventEmitter { const tag = Timer.createTag(this.fileId, LOAD_METRIC.convertTime); Timer.start(tag); - return api.get(this.infoUrl).then((info) => { + return api.get(this.infoUrl).then(info => { clearTimeout(this.statusTimeout); if (info.metadata) { @@ -155,9 +155,12 @@ class RepStatus extends EventEmitter { // Check status again after delay or // If status is none, request immediately since conversion // won't kick off until representation is requested - this.statusTimeout = setTimeout(() => { - this.updateStatus(); - }, status === STATUS_NONE ? 0 : STATUS_UPDATE_INTERVAL_MS); + this.statusTimeout = setTimeout( + () => { + this.updateStatus(); + }, + status === STATUS_NONE ? 0 : STATUS_UPDATE_INTERVAL_MS, + ); break; default: diff --git a/src/lib/ThumbnailsSidebar.js b/src/lib/ThumbnailsSidebar.js index 46f489f57..d675640cf 100644 --- a/src/lib/ThumbnailsSidebar.js +++ b/src/lib/ThumbnailsSidebar.js @@ -171,7 +171,7 @@ class ThumbnailsSidebar { // Get the first page of the document, and use its dimensions // to set the thumbnails size of the thumbnails sidebar - this.pdfViewer.pdfDocument.getPage(1).then((page) => { + this.pdfViewer.pdfDocument.getPage(1).then(page => { const { width, height } = page.getViewport(1); // If the dimensions of the page are invalid then don't proceed further @@ -196,7 +196,7 @@ class ThumbnailsSidebar { margin: THUMBNAIL_MARGIN, renderItemFn: this.createPlaceholderThumbnail, onScrollEnd: this.generateThumbnailImages, - onInit: this.generateThumbnailImages + onInit: this.generateThumbnailImages, }); }); } @@ -226,7 +226,7 @@ class ThumbnailsSidebar { const visibleThumbnails = this.virtualScroller.getVisibleItems(); const nextThumbnailEl = visibleThumbnails .concat(this.currentThumbnails) - .find((thumbnailEl) => !thumbnailEl.classList.contains(CLASS_BOX_PREVIEW_THUMBNAIL_IMAGE_LOADED)); + .find(thumbnailEl => !thumbnailEl.classList.contains(CLASS_BOX_PREVIEW_THUMBNAIL_IMAGE_LOADED)); if (nextThumbnailEl) { const parsedPageNum = parseInt(nextThumbnailEl.dataset.bpPageNum, 10); @@ -290,7 +290,7 @@ class ThumbnailsSidebar { */ requestThumbnailImage(itemIndex, thumbnailEl) { requestAnimationFrame(() => { - this.createThumbnailImage(itemIndex).then((imageEl) => { + this.createThumbnailImage(itemIndex).then(imageEl => { // Promise will resolve with null if create image request was already in progress if (imageEl) { // Appends to the thumbnail nav element @@ -328,7 +328,7 @@ class ThumbnailsSidebar { return this.getThumbnailDataURL(itemIndex + 1) .then(this.createImageEl) - .then((imageEl) => { + .then(imageEl => { // Cache this image element for future use this.thumbnailImageCache.set(itemIndex, { inProgress: false, image: imageEl }); @@ -346,7 +346,7 @@ class ThumbnailsSidebar { return this.pdfViewer.pdfDocument .getPage(pageNum) - .then((page) => { + .then(page => { const { width, height } = page.getViewport(1); // Get the current page w:h ratio in case it differs from the first page const curPageRatio = width / height; @@ -373,7 +373,7 @@ class ThumbnailsSidebar { const scale = canvasWidth / width; return page.render({ canvasContext: canvas.getContext('2d'), - viewport: page.getViewport(scale) + viewport: page.getViewport(scale), }); }) .then(() => canvas.toDataURL()); @@ -433,7 +433,7 @@ class ThumbnailsSidebar { * @return {void} */ applyCurrentPageSelection() { - this.currentThumbnails.forEach((thumbnailEl) => { + this.currentThumbnails.forEach(thumbnailEl => { const parsedPageNum = parseInt(thumbnailEl.dataset.bpPageNum, 10); if (parsedPageNum === this.currentPage) { thumbnailEl.classList.add(CLASS_BOX_PREVIEW_THUMBNAIL_IS_SELECTED); diff --git a/src/lib/Timer.js b/src/lib/Timer.js index 6341a2995..09d3b0acd 100644 --- a/src/lib/Timer.js +++ b/src/lib/Timer.js @@ -75,7 +75,7 @@ class Timer { } const tagArray = typeof tagOrTags === 'string' ? [tagOrTags] : tagOrTags; - tagArray.forEach((tag) => { + tagArray.forEach(tag => { const time = this.get(tag); // If nothing exists, there's no reason to reset it if (!time) { @@ -111,7 +111,7 @@ class Timer { const time = { start: undefined, end: undefined, - elapsed: undefined + elapsed: undefined, }; this.times[tag] = time; diff --git a/src/lib/VirtualScroller.js b/src/lib/VirtualScroller.js index fc4926e7c..e6bde6ef2 100644 --- a/src/lib/VirtualScroller.js +++ b/src/lib/VirtualScroller.js @@ -239,15 +239,15 @@ class VirtualScroller { if (children) { // Extract an array of the user's created HTMLElements - items = this.getListItems().map( - (listItemEl) => (listItemEl && listItemEl.children ? listItemEl.children[0] : null) + items = this.getListItems().map(listItemEl => + listItemEl && listItemEl.children ? listItemEl.children[0] : null, ); } return { startOffset: curStartOffset, endOffset: curEndOffset, - items + items, }; } @@ -332,7 +332,7 @@ class VirtualScroller { return; } - for (let i = start; i <= end; i++) { + for (let i = start; i <= end; i += 1) { const newEl = this.renderItem(i); newListEl.appendChild(newEl); } @@ -352,7 +352,7 @@ class VirtualScroller { } const listItems = Array.prototype.slice.call(listEl.children, start, end); - listItems.forEach((listItem) => listEl.removeChild(listItem)); + listItems.forEach(listItem => listEl.removeChild(listItem)); } /** @@ -408,7 +408,7 @@ class VirtualScroller { } // See if the list item indexed by `rowIndex` is already present - const foundItem = this.getListItems().find((listItem) => { + const foundItem = this.getListItems().find(listItem => { const { bpVsRowIndex } = listItem.dataset; const parsedRowIndex = parseInt(bpVsRowIndex, 10); return parsedRowIndex === rowIndex; @@ -459,8 +459,8 @@ class VirtualScroller { } return this.getListItems() - .filter((itemEl) => this.isVisible(itemEl)) - .map((itemEl) => itemEl && itemEl.children && itemEl.children[0]); + .filter(itemEl => this.isVisible(itemEl)) + .map(itemEl => itemEl && itemEl.children && itemEl.children[0]); } /** diff --git a/src/lib/__tests__/.eslintrc b/src/lib/__tests__/.eslintrc deleted file mode 100644 index 3e545a4f3..000000000 --- a/src/lib/__tests__/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../../../.eslintrc"], - "globals": { - "Assert": false - } -} diff --git a/src/lib/__tests__/Browser-test.js b/src/lib/__tests__/Browser-test.js index ef8702e15..0c7ca04bb 100644 --- a/src/lib/__tests__/Browser-test.js +++ b/src/lib/__tests__/Browser-test.js @@ -49,10 +49,10 @@ describe('lib/Browser', () => { { Chrome: '... Chrome/57.133 ' }, { Safari: '... Safari/57.36' }, { Explorer: '... Trident/09.90.90' }, - { Firefox: '... Firefox/1.1.1' } + { Firefox: '... Firefox/1.1.1' }, ]; - dp.forEach((browser) => { + dp.forEach(browser => { const expected = Object.keys(browser)[0]; it(`should get ${expected} as name for user agent`, () => { Browser.overrideUserAgent(browser[expected]); @@ -180,7 +180,7 @@ describe('lib/Browser', () => { it('should invoke "isTypeSupported" on the media source if there is a Media Source, and can check type', () => { global.MediaSource = { - isTypeSupported: sandbox.stub() + isTypeSupported: sandbox.stub(), }; Browser.canPlayDash(); expect(global.MediaSource.isTypeSupported).to.be.called; @@ -208,7 +208,7 @@ describe('lib/Browser', () => { describe('hasWebGL()', () => { const gl = { - getExtension: () => {} + getExtension: () => {}, }; afterEach(() => { Browser.clearGLContext(); @@ -217,7 +217,7 @@ describe('lib/Browser', () => { it('should return false if the webgl context cannot be created', () => { sandbox.stub(document, 'createElement').returns({ getContext: () => null, - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }); expect(Browser.hasWebGL()).to.be.false; }); @@ -228,7 +228,7 @@ describe('lib/Browser', () => { getContextStub.withArgs('experimental-webgl').returns(undefined); sandbox.stub(document, 'createElement').returns({ getContext: getContextStub, - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }); expect(Browser.hasWebGL()).to.be.false; }); @@ -236,7 +236,7 @@ describe('lib/Browser', () => { it('should return true if a webgl context can be created', () => { sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }); expect(Browser.hasWebGL()).to.be.true; sandbox.restore(); @@ -245,7 +245,7 @@ describe('lib/Browser', () => { it('should only create DOM content on the first call to hasWebGL()', () => { const create = sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }); Browser.hasWebGL(); Browser.hasWebGL(); @@ -258,12 +258,12 @@ describe('lib/Browser', () => { describe('clearGLContext()', () => { it('should do nothing if a gl context does not exist', () => { const gl = { - getExtension: sandbox.stub() + getExtension: sandbox.stub(), }; sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: () => {} + addEventListener: () => {}, }); // Creation and destruction @@ -277,12 +277,12 @@ describe('lib/Browser', () => { it('should invoke "getExtension()" on the gl context to get the WEBGL_lose_context extension', () => { const gl = { - getExtension: sandbox.stub() + getExtension: sandbox.stub(), }; sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: () => {} + addEventListener: () => {}, }); // Creation and destruction @@ -294,16 +294,16 @@ describe('lib/Browser', () => { it('should invoke "loseContext()" to clean up the webgl context', () => { const loseExt = { - loseContext: sandbox.stub() + loseContext: sandbox.stub(), }; const gl = { - getExtension: () => loseExt + getExtension: () => loseExt, }; sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: () => {} + addEventListener: () => {}, }); // Creation and destruction @@ -327,12 +327,12 @@ describe('lib/Browser', () => { it('should return true if Standard Derivatives is supported', () => { const gl = { - getExtension: sandbox.stub().returns({}) + getExtension: sandbox.stub().returns({}), }; sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: () => {} + addEventListener: () => {}, }); const supports = Browser.supportsModel3D(); @@ -341,12 +341,12 @@ describe('lib/Browser', () => { it('should return false if Standard Derivatives is unsupported', () => { const gl = { - getExtension: sandbox.stub().returns(null) + getExtension: sandbox.stub().returns(null), }; sandbox.stub(document, 'createElement').returns({ getContext: () => gl, - addEventListener: () => {} + addEventListener: () => {}, }); const supports = Browser.supportsModel3D(); @@ -416,10 +416,13 @@ describe('lib/Browser', () => { window.externalHost = undefined; }); - it('should return false if the browser doesn\'t support downloads, and mobile', () => { + it("should return false if the browser doesn't support downloads, and mobile", () => { sandbox.stub(Browser, 'isMobile').returns(true); window.externalHost = undefined; - sandbox.stub(document, 'createElement').withArgs('a').returns({}); + sandbox + .stub(document, 'createElement') + .withArgs('a') + .returns({}); const canDownload = Browser.canDownload(); expect(canDownload).to.be.false; }); @@ -427,7 +430,10 @@ describe('lib/Browser', () => { it('should return true if the browser does support downloads, and mobile', () => { sandbox.stub(Browser, 'isMobile').returns(true); window.externalHost = undefined; - sandbox.stub(document, 'createElement').withArgs('a').returns({ download: true }); + sandbox + .stub(document, 'createElement') + .withArgs('a') + .returns({ download: true }); const canDownload = Browser.canDownload(); expect(canDownload).to.be.true; }); @@ -489,13 +495,17 @@ describe('lib/Browser', () => { }); it('should return true if device is a Mac running Safari', () => { - Browser.overrideUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12'); + Browser.overrideUserAgent( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/600.7.12 (KHTML, like Gecko) Version/8.0.7 Safari/600.7.12', + ); const hasIssue = Browser.hasFontIssue(); expect(hasIssue).to.be.true; }); it('should return false if device is a Mac and not on Safari', () => { - Browser.overrideUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'); + Browser.overrideUserAgent( + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36', + ); const hasIssue = Browser.hasFontIssue(); expect(hasIssue).to.be.false; }); @@ -504,17 +514,9 @@ describe('lib/Browser', () => { describe('getBrowserInfo()', () => { it('should return browser capabilities', () => { const browserInfo = Browser.getBrowserInfo(); - const expectedFields = [ - 'name', - 'swf', - 'svg', - 'mse', - 'mp3', - 'dash', - 'h264' - ]; + const expectedFields = ['name', 'swf', 'svg', 'mse', 'mp3', 'dash', 'h264']; - expect(expectedFields.every((field) => typeof browserInfo[field] !== 'undefined')).to.be.true; + expect(expectedFields.every(field => typeof browserInfo[field] !== 'undefined')).to.be.true; }); }); }); diff --git a/src/lib/__tests__/Controls-test.js b/src/lib/__tests__/Controls-test.js index 8bc25e9fc..f63d18953 100644 --- a/src/lib/__tests__/Controls-test.js +++ b/src/lib/__tests__/Controls-test.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-expressions */ import Controls from '../Controls'; -import { CLASS_HIDDEN } from './../constants'; +import { CLASS_HIDDEN } from '../constants'; let controls; let clock; @@ -63,11 +63,11 @@ describe('lib/Controls', () => { it('should remove click listeners for any button references', () => { const button1 = { button: { removeEventListener: sandbox.stub() }, - handler: 'handler' + handler: 'handler', }; const button2 = { button: { removeEventListener: sandbox.stub() }, - handler: 'handler' + handler: 'handler', }; controls.buttonRefs = [button1, button2]; diff --git a/src/lib/__tests__/DownloadReachability-test.js b/src/lib/__tests__/DownloadReachability-test.js index bbe1e4c39..ba48768be 100644 --- a/src/lib/__tests__/DownloadReachability-test.js +++ b/src/lib/__tests__/DownloadReachability-test.js @@ -30,14 +30,14 @@ describe('lib/DownloadReachability', () => { { title: 'number host prefix for inside-box', url: 'https://dl3.user.inside-box.net', - expectedValue: false + expectedValue: false, }, { title: 'default prefix for inside-box', url: 'https://dl.user.inside-box.net', expectedValue: false }, { title: 'dl-hnl for inside-box', url: 'https://dl-hnl.user.inside-box.net', expectedValue: false }, - { title: 'dl-las', url: 'https://dl-las.boxcloud.com', expectedValue: true } + { title: 'dl-las', url: 'https://dl-las.boxcloud.com', expectedValue: true }, ]; - tests.forEach((testData) => { + tests.forEach(testData => { it(`should be ${testData.expectedValue} if the url is ${testData.title}`, () => { const result = DownloadReachability.isCustomDownloadHost(testData.url); expect(result).to.be[testData.expectedValue]; @@ -190,14 +190,14 @@ describe('lib/DownloadReachability', () => { expect(DownloadReachability.setDownloadReachability).to.be.calledWith(downloadUrl); }); - it('should retry download with default host if custom host is blocked', (done) => { + it('should retry download with default host if custom host is blocked', done => { sandbox.stub(DownloadReachability, 'isDownloadHostBlocked').returns(false); sandbox.stub(DownloadReachability, 'isCustomDownloadHost').returns(true); sandbox.stub(DownloadReachability, 'setDownloadReachability').returns( - new Promise((resolve) => { + new Promise(resolve => { resolve(true); done(); - }) + }), ); sandbox.stub(util, 'openUrlInsideIframe'); @@ -216,28 +216,28 @@ describe('lib/DownloadReachability', () => { { title: 'numbered host', downloadUrl: 'https://dl3.boxcloud.com', - expectedResult: 'https://dl.boxcloud.com' + expectedResult: 'https://dl.boxcloud.com', }, { title: 'two digit numbered host', downloadUrl: 'https://dl34.boxcloud.com', - expectedResult: 'https://dl.boxcloud.com' + expectedResult: 'https://dl.boxcloud.com', }, { title: 'google', downloadUrl: 'https://www.google.com', expectedResult: 'https://dl.google.com' }, { title: 'aws', downloadUrl: 'https://kld3lk.boxcloud.com', expectedResult: 'https://dl.boxcloud.com' }, { title: 'inside-box', downloadUrl: 'https://dl3.user.inside-box.net', - expectedResult: 'https://dl.user.inside-box.net' + expectedResult: 'https://dl.user.inside-box.net', }, - { title: 'dl-las', downloadUrl: 'https://dl-las.boxcloud.com', expectedResult: 'https://dl.boxcloud.com' } + { title: 'dl-las', downloadUrl: 'https://dl-las.boxcloud.com', expectedResult: 'https://dl.boxcloud.com' }, ]; - tests.forEach((testData) => { + tests.forEach(testData => { it(`should replace host with default: ${testData.title}`, () => { expect( DownloadReachability.replaceDownloadHostWithDefault(testData.downloadUrl), - testData.expectedResult + testData.expectedResult, ); }); }); diff --git a/src/lib/__tests__/Notification-test.js b/src/lib/__tests__/Notification-test.js index b6f106f6d..911272efd 100644 --- a/src/lib/__tests__/Notification-test.js +++ b/src/lib/__tests__/Notification-test.js @@ -30,7 +30,7 @@ describe('lib/Notification', () => { assert.equal(notif.notificationEl.className, 'bp-notification bp-is-hidden'); }); - it('shouldn\'t have any message or button text', () => { + it("shouldn't have any message or button text", () => { assert.equal(notif.buttonEl.textContext, undefined); assert.equal(notif.messageEl.textContext, undefined); }); @@ -94,7 +94,7 @@ describe('lib/Notification', () => { describe('clickHandler()', () => { it('should stop propagation of event', () => { const event = { - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; notif.clickHandler(event); @@ -107,7 +107,7 @@ describe('lib/Notification', () => { const event = { stopPropagation: sandbox.stub(), - target: notif.notificationEl.querySelector('button') + target: notif.notificationEl.querySelector('button'), }; notif.clickHandler(event); diff --git a/src/lib/__tests__/PageControls-test.js b/src/lib/__tests__/PageControls-test.js index 194a3df59..6ec36646d 100644 --- a/src/lib/__tests__/PageControls-test.js +++ b/src/lib/__tests__/PageControls-test.js @@ -83,7 +83,7 @@ describe('lib/PageControls', () => { value: 0, focus: sandbox.stub(), select: sandbox.stub(), - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; pageControls.showPageNumInput(); @@ -98,7 +98,7 @@ describe('lib/PageControls', () => { describe('hidePageNumInput()', () => { it('should hide the input class and remove event listeners', () => { pageControls.pageNumInputEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; pageControls.hidePageNumInput(); @@ -161,7 +161,7 @@ describe('lib/PageControls', () => { pageControls.pagesCount = 10; pageControls.pageNumInputEl = { value: 1, - textContent: 1 + textContent: 1, }; const checkPaginationButtonsStub = sandbox.stub(pageControls, 'checkPaginationButtons'); @@ -194,7 +194,7 @@ describe('lib/PageControls', () => { describe('currentPageNumber', () => { beforeEach(() => { pageControls.currentPageEl = { - textContent: '1' + textContent: '1', }; }); @@ -225,8 +225,8 @@ describe('lib/PageControls', () => { beforeEach(() => { stubs.event = { target: { - value: 5 - } + value: 5, + }, }; stubs.emit = sandbox.stub(pageControls, 'emit'); stubs.hidePageNumInputStub = sandbox.stub(pageControls, 'hidePageNumInput'); @@ -254,17 +254,17 @@ describe('lib/PageControls', () => { stopPropagation: sandbox.stub(), preventDefault: sandbox.stub(), target: { - blur: sandbox.stub() - } + blur: sandbox.stub(), + }, }; pageControls.contentEl = { - focus: sandbox.stub() + focus: sandbox.stub(), }; stubs.browser = sandbox.stub(Browser, 'getName').returns('Explorer'); stubs.hidePageNumInput = sandbox.stub(pageControls, 'hidePageNumInput'); }); - it('should focus the doc element and stop default actions on \'enter\'', () => { + it("should focus the doc element and stop default actions on 'enter'", () => { pageControls.pageNumInputKeydownHandler(stubs.event); expect(stubs.browser).to.be.called; expect(pageControls.contentEl.focus).to.be.called; @@ -272,7 +272,7 @@ describe('lib/PageControls', () => { expect(stubs.event.preventDefault).to.be.called; }); - it('should blur if not IE and stop default actions on \'enter\'', () => { + it("should blur if not IE and stop default actions on 'enter'", () => { stubs.browser.returns('Chrome'); pageControls.pageNumInputKeydownHandler(stubs.event); @@ -282,7 +282,7 @@ describe('lib/PageControls', () => { expect(stubs.event.preventDefault).to.be.called; }); - it('should hide the page number input, focus the document, and stop default actions on \'Esc\'', () => { + it("should hide the page number input, focus the document, and stop default actions on 'Esc'", () => { stubs.event.key = 'Esc'; pageControls.pageNumInputKeydownHandler(stubs.event); diff --git a/src/lib/__tests__/Popup-test.js b/src/lib/__tests__/Popup-test.js index 20bb2ad71..891367612 100644 --- a/src/lib/__tests__/Popup-test.js +++ b/src/lib/__tests__/Popup-test.js @@ -37,7 +37,7 @@ describe('lib/Popup', () => { expect(popup.popupEl.getAttribute('aria-labeledby')).to.not.equal(undefined); }); - it('shouldn\'t have any message or button text', () => { + it("shouldn't have any message or button text", () => { expect(popup.buttonEl.textContext).to.equal(undefined); expect(popup.messageEl.textContent).to.equal(''); }); @@ -67,9 +67,9 @@ describe('lib/Popup', () => { removeEventListener: sandbox.stub(), parentNode: { parentNode: { - removeChild: sandbox.stub() - } - } + removeChild: sandbox.stub(), + }, + }, }; const popupStub = popup.popupEl.removeEventListener; @@ -210,7 +210,7 @@ describe('lib/Popup', () => { popup.hide = sandbox.stub(popup, 'hide'); event = { preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; }); @@ -263,7 +263,7 @@ describe('lib/Popup', () => { describe('popupClickHandler()', () => { it('should hide the popup and return true if Esc is pressed', () => { const event = { - key: 'Esc' + key: 'Esc', }; const hideStub = sandbox.stub(popup, 'hide'); @@ -274,7 +274,7 @@ describe('lib/Popup', () => { it('should hide the popup and return true if Escape is pressed', () => { const event = { - key: 'Escape' + key: 'Escape', }; const hideStub = sandbox.stub(popup, 'hide'); @@ -285,7 +285,7 @@ describe('lib/Popup', () => { it('should do nothing and return false if anything other key is pressed', () => { const event = { - key: 'EscapeNot' + key: 'EscapeNot', }; const hideStub = sandbox.stub(popup, 'hide'); diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index 22b77f1ac..21a42f955 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -70,12 +70,12 @@ describe('lib/Preview', () => { describe('destroy()', () => { beforeEach(() => { stubs.repStatus = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; stubs.viewer = { destroy: sandbox.stub(), - getLoadStatus: sandbox.stub() + getLoadStatus: sandbox.stub(), }; }); @@ -88,7 +88,7 @@ describe('lib/Preview', () => { it('should destroy the viewer if it exists', () => { preview.viewer = { destroy: undefined, - getLoadStatus: sandbox.stub() + getLoadStatus: sandbox.stub(), }; preview.destroy(); @@ -102,20 +102,20 @@ describe('lib/Preview', () => { it('should stop the duration timer, reset it, and log a preview end event', () => { preview.file = { - id: 1 + id: 1, }; stubs.viewer.getLoadStatus.returns('loaded'); sandbox.stub(preview, 'createLogEvent'); const durationTimer = { - elapsed: 7 + elapsed: 7, }; const mockEventObject = { event_name: 'preview_end', value: { duration: durationTimer.elapsed, - viewer_status: 'loaded' - } + viewer_status: 'loaded', + }, }; sandbox.stub(Timer, 'createTag').returns('duration_tag'); @@ -149,7 +149,7 @@ describe('lib/Preview', () => { preview.show('123', 'token', { viewer: 'viewer' }); expect(preview.previewOptions).to.deep.equal({ token: 'token', - viewer: 'viewer' + viewer: 'viewer', }); }); @@ -159,21 +159,21 @@ describe('lib/Preview', () => { preview.show('123', foo, { viewer: 'viewer' }); expect(preview.previewOptions).to.deep.equal({ token: foo, - viewer: 'viewer' + viewer: 'viewer', }); }); it('should set the preview options with null token', () => { preview.show('123', null); expect(preview.previewOptions).to.deep.equal({ - token: null + token: null, }); }); it('should set the preview options with no token', () => { preview.show('123'); expect(preview.previewOptions).to.deep.equal({ - token: undefined + token: undefined, }); }); @@ -205,7 +205,7 @@ describe('lib/Preview', () => { representations: {}, watermark_info: {}, authenticated_download_url: 'url', - is_download_available: true + is_download_available: true, }; preview.show(file123, 'foken'); @@ -229,7 +229,7 @@ describe('lib/Preview', () => { const token = 'token'; const options = { - foo: 'bar' + foo: 'bar', }; preview.show(file, token, options); @@ -288,7 +288,7 @@ describe('lib/Preview', () => { representations: {}, watermark_info: {}, authenticated_download_url: 'url', - is_download_available: true + is_download_available: true, }; }); @@ -382,7 +382,7 @@ describe('lib/Preview', () => { expect(stubs.showNavigation).to.not.be.called; preview.file = { - id: 0 + id: 0, }; preview.updateCollection(); @@ -402,8 +402,8 @@ describe('lib/Preview', () => { const files = { id: 0, watermark_info: { - is_watermarked: false - } + is_watermarked: false, + }, }; stubs.checkFileValid.onCall(0).returns(true); @@ -417,15 +417,15 @@ describe('lib/Preview', () => { { id: 0, watermark_info: { - is_watermarked: false - } + is_watermarked: false, + }, }, { id: 1, watermark_info: { - is_watermarked: false - } - } + is_watermarked: false, + }, + }, ]; stubs.checkFileValid @@ -444,8 +444,8 @@ describe('lib/Preview', () => { const files = { id: 0, watermark_info: { - is_watermarked: true - } + is_watermarked: true, + }, }; stubs.checkFileValid.returns(true); @@ -505,10 +505,10 @@ describe('lib/Preview', () => { someFile = {}; loader = { determineViewer: () => {}, - determineRepresentation: () => {} + determineRepresentation: () => {}, }; viewer = { - CONSTRUCTOR: () => {} + CONSTRUCTOR: () => {}, }; sandbox @@ -564,7 +564,7 @@ describe('lib/Preview', () => { token, representation: sinon.match.any, sharedLink, - sharedLinkPassword + sharedLinkPassword, }); }); @@ -575,14 +575,14 @@ describe('lib/Preview', () => { prefetch: sandbox.mock().withArgs({ assets: true, preload: true, - content: true + content: true, }), getViewerOption: sandbox .stub() .withArgs('preload') - .returns(true) + .returns(true), }; - } + }, }; sandbox.stub(loader, 'determineViewer').returns(viewer); @@ -596,14 +596,14 @@ describe('lib/Preview', () => { prefetch: sandbox.mock().withArgs({ assets: true, preload: false, - content: true + content: true, }), getViewerOption: sandbox .stub() .withArgs('preload') - .returns(false) + .returns(false), }; - } + }, }; sandbox.stub(loader, 'determineViewer').returns(viewer); @@ -617,10 +617,10 @@ describe('lib/Preview', () => { prefetch: sandbox.mock().withArgs({ assets: true, preload: true, - content: false - }) + content: false, + }), }; - } + }, }; sandbox.stub(loader, 'determineViewer').returns(viewer); @@ -644,16 +644,16 @@ describe('lib/Preview', () => { const mockViewers = [ { NAME: 'viewer1', - CONSTRUCTOR: stubViewer + CONSTRUCTOR: stubViewer, }, { NAME: 'viewer2', - CONSTRUCTOR: stubViewer + CONSTRUCTOR: stubViewer, }, { NAME: 'viewer3', - CONSTRUCTOR: stubViewer - } + CONSTRUCTOR: stubViewer, + }, ]; stubs.getViewers = sandbox.stub(preview, 'getViewers').returns(mockViewers); @@ -673,14 +673,14 @@ describe('lib/Preview', () => { expect(prefetchStub).to.be.calledWith({ assets: true, preload: false, - content: false + content: false, }); }); }); it('should not throw when prefetching the viewers', () => { // Get the list of all possible viewers and extract the names - const PREVIEW_SDK_VIEWERS_TO_PREFETCH = preview.getViewers().map((viewer) => viewer.NAME); + const PREVIEW_SDK_VIEWERS_TO_PREFETCH = preview.getViewers().map(viewer => viewer.NAME); expect(() => preview.prefetchViewers(PREVIEW_SDK_VIEWERS_TO_PREFETCH)).to.not.throw(); }); @@ -695,7 +695,7 @@ describe('lib/Preview', () => { const viewersToDisable = { text: 'viewer', csv: 'viewer', excel: 'viewer' }; preview.disableViewers(Object.keys(viewersToDisable)); - Object.keys(viewersToDisable).forEach((viewer) => { + Object.keys(viewersToDisable).forEach(viewer => { expect(preview.disabledViewers[viewer]).to.equal(1); }); }); @@ -744,7 +744,7 @@ describe('lib/Preview', () => { describe('resize()', () => { it('should resize if the viewer exists', () => { preview.viewer = { - resize: sandbox.stub() + resize: sandbox.stub(), }; preview.resize(); @@ -757,7 +757,7 @@ describe('lib/Preview', () => { stubs.canDownload = sandbox.stub(file, 'canDownload'); stubs.checkFeature = sandbox.stub(file, 'checkFeature'); preview.viewer = { - print: sandbox.stub() + print: sandbox.stub(), }; }); @@ -790,12 +790,12 @@ describe('lib/Preview', () => { beforeEach(() => { stubs.promise = Promise.resolve({ data: { - download_url: 'dl.boxcloud.com' - } + download_url: 'dl.boxcloud.com', + }, }); preview.ui = { - showNotification: sandbox.stub() + showNotification: sandbox.stub(), }; preview.viewer = { getRepresentation: sandbox.stub(), @@ -804,9 +804,9 @@ describe('lib/Preview', () => { createContentUrlWithAuthParams: sandbox.stub(), options: { viewer: { - ASSET: '' - } - } + ASSET: '', + }, + }, }; sandbox.stub(preview, 'emit'); sandbox.stub(file, 'canDownload'); @@ -845,8 +845,8 @@ describe('lib/Preview', () => { const template = 'someTemplate'; const representation = { content: { - url_template: template - } + url_template: template, + }, }; const url = 'someurl'; @@ -870,7 +870,7 @@ describe('lib/Preview', () => { util.appendQueryParams.returns(url); const promise = Promise.resolve({ - download_url: url + download_url: url, }); api.get.returns(promise); @@ -889,7 +889,7 @@ describe('lib/Preview', () => { util.appendQueryParams.returns(url); const promise = Promise.resolve({ - download_url: url + download_url: url, }); api.get.returns(promise); @@ -927,7 +927,7 @@ describe('lib/Preview', () => { describe('load()', () => { beforeEach(() => { stubs.tokens = { - 0: 'file0' + 0: 'file0', }; stubs.file = { id: '123', @@ -941,11 +941,11 @@ describe('lib/Preview', () => { representations: {}, watermark_info: {}, authenticated_download_url: 'url', - is_download_available: true + is_download_available: true, }; stubs.promise = Promise.resolve({ - token: 'token' + token: 'token', }); stubs.getTokens = sandbox.stub(tokens, 'default').returns(stubs.promise); @@ -1027,7 +1027,7 @@ describe('lib/Preview', () => { // The current file we are attempting to preview has file version '1234' preview.file.file_version = { - id: '1234' + id: '1234', }; // Calling load() with file version ID '1234' @@ -1051,12 +1051,12 @@ describe('lib/Preview', () => { it('should throw an error if incompatible file object is passed in', () => { const invalidFile = { not: 'the', - right: 'fields' + right: 'fields', }; expect(preview.load.bind(preview, invalidFile)).to.throw( PreviewError, - 'File is not a well-formed Box File object. See FILE_FIELDS in file.js for a list of required fields.' + 'File is not a well-formed Box File object. See FILE_FIELDS in file.js for a list of required fields.', ); }); @@ -1109,10 +1109,10 @@ describe('lib/Preview', () => { const TOKEN = 'bar'; const FILE_ID = '123'; preview.file = { - id: FILE_ID + id: FILE_ID, }; preview.handleTokenResponse({ - [FILE_ID]: TOKEN + [FILE_ID]: TOKEN, }); expect(preview.options.token).to.equal(TOKEN); @@ -1197,7 +1197,7 @@ describe('lib/Preview', () => { fixDependencies: true, collection: stubs.collection, loaders: stubs.loaders, - enableThumbnailsSidebar: true + enableThumbnailsSidebar: true, }; stubs.assign = sandbox.spy(Object, 'assign'); @@ -1205,7 +1205,7 @@ describe('lib/Preview', () => { stubs.enableViewers = sandbox.stub(preview, 'enableViewers'); preview.file = { - id: 0 + id: 0, }; }); @@ -1299,11 +1299,11 @@ describe('lib/Preview', () => { it('should disable any specified viewers, otherwise enable', () => { preview.previewOptions.viewers = { Office: { - disabled: true + disabled: true, }, text: { - disabled: false - } + disabled: false, + }, }; preview.parseOptions(preview.previewOptions); @@ -1332,7 +1332,7 @@ describe('lib/Preview', () => { describe('loadFromCache()', () => { beforeEach(() => { preview.logger = { - setCached: sandbox.stub() + setCached: sandbox.stub(), }; stubs.loadViewer = sandbox.stub(preview, 'loadViewer'); @@ -1369,7 +1369,7 @@ describe('lib/Preview', () => { stubs.handleFetchError = sandbox.stub(preview, 'handleFetchError'); stubs.getURL = sandbox.stub(file, 'getURL').returns('/get_url'); preview.file = { - id: 0 + id: 0, }; }); @@ -1395,11 +1395,11 @@ describe('lib/Preview', () => { beforeEach(() => { preview.logger = { setFile: sandbox.stub(), - setCacheStale: sandbox.stub() + setCacheStale: sandbox.stub(), }; preview.open = true; preview.file = { - id: 0 + id: 0, }; stubs.getCachedFile = sandbox.stub(file, 'getCachedFile'); @@ -1416,11 +1416,11 @@ describe('lib/Preview', () => { name: 'file', file_version: { id: '1234', - sha1: 2 + sha1: 2, }, representations: { - entries: [] - } + entries: [], + }, }; preview.fileVersions = {}; }); @@ -1431,11 +1431,11 @@ describe('lib/Preview', () => { id: preview.file.id, shared_link: {}, file_version: { - id: '1234' - } + id: '1234', + }, }); const fileVersion = { - id: '1234' + id: '1234', }; sandbox .stub(preview, 'getFileOption') @@ -1458,8 +1458,8 @@ describe('lib/Preview', () => { preview.file = { id: '123', file_version: { - id: '1234' - } + id: '1234', + }, }; stubs.file.file_version.id = '1233'; @@ -1476,8 +1476,8 @@ describe('lib/Preview', () => { it('should get the latest cache, then update it with the new file', () => { stubs.getCachedFile.returns({ file_version: { - sha1: 0 - } + sha1: 0, + }, }); stubs.file.file_version.sha1 = 0; @@ -1492,8 +1492,8 @@ describe('lib/Preview', () => { stubs.isWatermarked.returns(true); stubs.getCachedFile.returns({ file_version: { - sha1: 0 - } + sha1: 0, + }, }); stubs.file.file_version.sha1 = 0; @@ -1519,8 +1519,8 @@ describe('lib/Preview', () => { it('should set the cache stale and re-load the viewer if the cached sha1 does not match the files sha1', () => { stubs.getCachedFile.returns({ file_version: { - sha1: 0 - } + sha1: 0, + }, }); stubs.file.file_version.sha1 = 2; @@ -1534,8 +1534,8 @@ describe('lib/Preview', () => { stubs.isWatermarked.returns(true); stubs.getCachedFile.returns({ file_version: { - sha1: 0 - } + sha1: 0, + }, }); stubs.file.file_version.sha1 = 2; @@ -1564,7 +1564,7 @@ describe('lib/Preview', () => { it('should stop the Timer for file info time', () => { const stopStub = sandbox.stub(Timer, 'stop'); preview.file = { - id: 12345 + id: 12345, }; Timer.createTag(preview.file.id, LOAD_METRIC.fileInfoTime); preview.handleFileInfoResponse(stubs.file); @@ -1578,7 +1578,7 @@ describe('lib/Preview', () => { load: sandbox.stub(), addListener: sandbox.stub(), getName: sandbox.stub(), - setup: sandbox.stub() + setup: sandbox.stub(), }; /* eslint-disable require-jsdoc */ @@ -1598,22 +1598,22 @@ describe('lib/Preview', () => { determineRepresentation: sandbox.stub().returns({ links: { content: { - url: 'url' - } - } + url: 'url', + }, + }, }), determineRepresentationStatus: sandbox.stub().returns(stubs.determineRepresentationStatusPromise), - load: sandbox.stub().returns(stubs.loadPromiseResolve) + load: sandbox.stub().returns(stubs.loadPromiseResolve), }; stubs.getLoader = sandbox.stub(preview, 'getLoader').returns(stubs.loader); preview.logger = { - setType: sandbox.stub() + setType: sandbox.stub(), }; preview.file = { - is_download_available: true + is_download_available: true, }; stubs.emit = sandbox.stub(preview, 'emit'); @@ -1631,7 +1631,7 @@ describe('lib/Preview', () => { preview.file.is_download_available = false; expect(() => preview.loadViewer()).to.throw( PreviewError, - /Oops! It looks like something is wrong with this file./ + /Oops! It looks like something is wrong with this file./, ); }); @@ -1639,7 +1639,7 @@ describe('lib/Preview', () => { stubs.checkPermission.withArgs(sinon.match.any, PERMISSION_PREVIEW).returns(false); expect(() => preview.loadViewer()).to.throw( PreviewError, - /We're sorry, you don't have permission to preview this file./ + /We're sorry, you don't have permission to preview this file./, ); }); @@ -1649,7 +1649,7 @@ describe('lib/Preview', () => { expect(stubs.showLoadingDownloadButton).to.be.called; }); - it('should not show the loading download button if file can\'t be downloaded', () => { + it("should not show the loading download button if file can't be downloaded", () => { stubs.canDownload.returns(false); preview.loadViewer({}); expect(stubs.showLoadingDownloadButton).to.not.be.called; @@ -1693,7 +1693,7 @@ describe('lib/Preview', () => { CONSTRUCTOR: () => { return stubs.viewer; }, - NAME: 'someViewerName' + NAME: 'someViewerName', }); preview.loadViewer(); @@ -1717,7 +1717,7 @@ describe('lib/Preview', () => { it('should add listeners for error and viewer events', () => { stubs.download = sandbox.stub(preview, 'download'); preview.viewer = { - addListener: sandbox.stub() + addListener: sandbox.stub(), }; preview.attachViewerListeners(); @@ -1770,7 +1770,7 @@ describe('lib/Preview', () => { sandbox.stub(preview, 'emit'); const data = { event: 'no match', - data: 'message' + data: 'message', }; preview.handleViewerEvents(data); expect(preview.emit).to.be.calledWith(data.event, data.data); @@ -1781,7 +1781,7 @@ describe('lib/Preview', () => { sandbox.stub(preview, 'emit'); const data = { event: 'error', - data: ':(' + data: ':(', }; preview.handleViewerEvents(data); expect(preview.emit).to.not.be.called; @@ -1794,12 +1794,12 @@ describe('lib/Preview', () => { sandbox.stub(preview, 'emit'); const fakeEvent = { event: 'test', - data: 7 + data: 7, }; const fakeLog = { event_name: fakeEvent.event, - value: fakeEvent.data + value: fakeEvent.data, }; preview.handleViewerMetrics(fakeEvent); expect(preview.emit).to.be.calledWith(PREVIEW_METRIC, fakeLog); @@ -1821,15 +1821,15 @@ describe('lib/Preview', () => { stubs.setupNotification = sandbox.stub(preview.ui, 'setupNotification'); stubs.logger = { - done: sandbox.stub() + done: sandbox.stub(), }; preview.file = { - id: 0 + id: 0, }; preview.viewer = { - getPointModeClickHandler: sandbox.stub() + getPointModeClickHandler: sandbox.stub(), }; preview.logger = stubs.logger; @@ -1841,7 +1841,7 @@ describe('lib/Preview', () => { expect(stubs.showDownloadButton).to.be.called; }); - it('should not show download button if file can\'t be downloaded', () => { + it("should not show download button if file can't be downloaded", () => { stubs.canDownload.returns(false); preview.finishLoading(); expect(stubs.showDownloadButton).to.not.be.called; @@ -1861,7 +1861,7 @@ describe('lib/Preview', () => { expect(stubs.showPrintButton).to.not.be.called; }); - it('should not show print button if file can\'t be downloaded', () => { + it("should not show print button if file can't be downloaded", () => { stubs.checkFeature.withArgs(sinon.match.any, 'print').returns(true); stubs.canDownload.returns(false); preview.finishLoading(); @@ -1931,7 +1931,7 @@ describe('lib/Preview', () => { it('should skip postload if skipPostload is true', () => { preview.finishLoading({ - endProgress: false + endProgress: false, }); expect(stubs.finishProgressBar).to.not.be.called; }); @@ -1939,7 +1939,7 @@ describe('lib/Preview', () => { it('should focus the viewer container', () => { preview.options.autoFocus = true; preview.viewer.containerEl = { - focus: () => {} + focus: () => {}, }; sandbox.mock(preview.viewer.containerEl).expects('focus'); preview.finishLoading(); @@ -1948,7 +1948,7 @@ describe('lib/Preview', () => { it('should not focus the viewer container with autoFocus is false', () => { preview.options.autoFocus = false; preview.viewer.containerEl = { - focus: () => {} + focus: () => {}, }; sandbox .mock(preview.viewer.containerEl) @@ -2054,8 +2054,8 @@ describe('lib/Preview', () => { stubs.load = sandbox.stub(preview, 'load'); stubs.error = { response: { - status: 400 - } + status: 400, + }, }; }); @@ -2065,7 +2065,7 @@ describe('lib/Preview', () => { it('should do nothing if the preview is closed', () => { preview.file = { - id: '0' + id: '0', }; preview.open = false; @@ -2075,7 +2075,7 @@ describe('lib/Preview', () => { it('should clear the current file from the cache', () => { preview.file = { - id: '0' + id: '0', }; preview.open = true; @@ -2085,7 +2085,7 @@ describe('lib/Preview', () => { it('should trigger an error if we have hit our retry count limit', () => { preview.file = { - id: '0' + id: '0', }; preview.open = true; preview.retryCount = 6; @@ -2096,7 +2096,7 @@ describe('lib/Preview', () => { it('should trigger a rate limit error if the status code is 429', () => { preview.file = { - id: '0' + id: '0', }; preview.open = true; preview.retryCount = 6; @@ -2112,7 +2112,7 @@ describe('lib/Preview', () => { it('should reset a timeout that tries to load the file again', () => { preview.file = { - id: '0' + id: '0', }; preview.open = true; preview.retryCount = 1; @@ -2127,7 +2127,7 @@ describe('lib/Preview', () => { it('should retry using full jitter', () => { preview.file = { - id: '0' + id: '0', }; preview.open = true; preview.retryCount = 3; @@ -2140,13 +2140,13 @@ describe('lib/Preview', () => { it('should retry after length specified in Retry-After header if set', () => { preview.file = { - id: '0' + id: '0', }; stubs.error.headers = { get: sandbox .stub() .withArgs('Retry-After') - .returns(5) + .returns(5), }; preview.open = true; preview.retryCount = 1; @@ -2165,7 +2165,7 @@ describe('lib/Preview', () => { const ErrorViewer = { load: sandbox.stub(), addListener: sandbox.stub(), - setup: sandbox.stub() + setup: sandbox.stub(), }; beforeEach(() => { @@ -2223,7 +2223,7 @@ describe('lib/Preview', () => { it('should create a log object containing correct file info properties', () => { const id = '12345'; preview.file = { - id + id, }; const log = preview.createLogEvent(); @@ -2246,7 +2246,7 @@ describe('lib/Preview', () => { it('should use empty string for file_version_id, if no file version', () => { preview.file = { id: '12345', - file_version: undefined + file_version: undefined, }; const log = preview.createLogEvent(); @@ -2255,7 +2255,7 @@ describe('lib/Preview', () => { it('should use empty string for rep_type, if no representation type available in viewer options', () => { preview.file = { - id: '12345' + id: '12345', }; preview.viewer = {}; @@ -2267,12 +2267,12 @@ describe('lib/Preview', () => { }); describe('emitPreviewError()', () => { - it('should emit a "preview_error" message with an object describing the error', (done) => { + it('should emit a "preview_error" message with an object describing the error', done => { const code = 'an_error'; const displayMessage = 'Oh no!'; const error = new PreviewError(code, displayMessage); - preview.on('preview_error', (data) => { + preview.on('preview_error', data => { expect(data.error.code).to.equal('an_error'); expect(data.error.displayMessage).to.equal('Oh no!'); done(); @@ -2281,18 +2281,18 @@ describe('lib/Preview', () => { preview.emitPreviewError(error); }); - it('should emit a "preview_error" message with info about the preview session', (done) => { + it('should emit a "preview_error" message with info about the preview session', done => { const fileId = '1234'; const fileVersionId = '999'; preview.file = { id: fileId, file_version: { - id: fileVersionId - } + id: fileVersionId, + }, }; - preview.on('preview_error', (data) => { + preview.on('preview_error', data => { expect(data.file_id).to.equal(fileId); expect(data.file_version_id).to.equal(fileVersionId); done(); @@ -2301,8 +2301,8 @@ describe('lib/Preview', () => { preview.emitPreviewError({}); }); - it('should use a default browser error code if none is present', (done) => { - preview.on('preview_error', (data) => { + it('should use a default browser error code if none is present', done => { + preview.on('preview_error', data => { expect(data.error.code).to.equal(ERROR_CODE.BROWSER_GENERIC); done(); }); @@ -2310,12 +2310,12 @@ describe('lib/Preview', () => { preview.emitPreviewError({}); }); - it('should strip any auth from the message and displayMessage if it is present', (done) => { + it('should strip any auth from the message and displayMessage if it is present', done => { const message = 'A message'; const displayMessage = 'A display message'; const auth = 'access_token="1234abcd"'; const filtered = 'access_token=[FILTERED]'; - preview.on('preview_error', (data) => { + preview.on('preview_error', data => { expect(data.error.message).to.equal(`${message}?${filtered}`); expect(data.error.displayMessage).to.equal(`${displayMessage}?${filtered}`); done(); @@ -2331,7 +2331,7 @@ describe('lib/Preview', () => { beforeEach(() => { preview.file = { - id: fileId + id: fileId, }; }); @@ -2348,23 +2348,23 @@ describe('lib/Preview', () => { expect(preview.emit).to.not.be.called; }); - it('should emit a preview_metric event', (done) => { + it('should emit a preview_metric event', done => { preview.once(PREVIEW_METRIC, () => { done(); }); preview.emitLoadMetrics(); }); - it('should emit a preview_metric event with event_name "load"', (done) => { - preview.once(PREVIEW_METRIC, (metric) => { + it('should emit a preview_metric event with event_name "load"', done => { + preview.once(PREVIEW_METRIC, metric => { expect(metric.event_name).to.equal(LOAD_METRIC.previewLoadEvent); done(); }); preview.emitLoadMetrics(); }); - it('should emit a preview_metric event with an object, with all of the proper load properties', (done) => { - preview.once(PREVIEW_METRIC, (metric) => { + it('should emit a preview_metric event with an object, with all of the proper load properties', done => { + preview.once(PREVIEW_METRIC, metric => { expect(metric[LOAD_METRIC.fileInfoTime]).to.exist; expect(metric[LOAD_METRIC.convertTime]).to.exist; expect(metric[LOAD_METRIC.downloadResponseTime]).to.exist; @@ -2383,8 +2383,8 @@ describe('lib/Preview', () => { expect(preview.emit).to.be.called; }); - it('should append encoding field to load metric, when provided', (done) => { - preview.once(PREVIEW_METRIC, (metric) => { + it('should append encoding field to load metric, when provided', done => { + preview.once(PREVIEW_METRIC, metric => { expect(metric.encoding).to.equal(ENCODING_TYPES.GZIP); done(); }); @@ -2398,7 +2398,7 @@ describe('lib/Preview', () => { stubs.getHeaders = sandbox.stub(util, 'getHeaders'); stubs.headers = { 'X-Rep-Hints': - '[3d][pdf][text][mp3][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]' + '[3d][pdf][text][mp3][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]', }; preview.options.sharedLink = 'link'; @@ -2446,13 +2446,13 @@ describe('lib/Preview', () => { 2: 'token2', 3: 'token3', 4: 'token4', - 5: 'token5' + 5: 'token5', }); stubs.getTokens = sandbox.stub(tokens, 'default'); stubs.getPromiseResolve = Promise.resolve({ - id: 0 + id: 0, }); stubs.get = sandbox.stub(api, 'get').returns(stubs.getPromiseResolve); @@ -2479,7 +2479,7 @@ describe('lib/Preview', () => { it('should do nothing if there are no new files to prefetch', () => { preview.file = { - id: 3 + id: 3, }; preview.collection = [1, 2, 3]; @@ -2491,7 +2491,7 @@ describe('lib/Preview', () => { it('should get tokens for the next PREFETCH_COUNT files in the collection', () => { stubs.getTokens.returns(stubs.getTokensPromiseResolve); preview.file = { - id: 0 + id: 0, }; preview.previewOptions.token = 'token'; preview.collection = [0, 1, 2, 3, 4, 5]; @@ -2505,7 +2505,7 @@ describe('lib/Preview', () => { it('should get info for the next PREFETCH_COUNT files', () => { stubs.getTokens.returns(stubs.getTokensPromiseResolve); preview.file = { - id: 0 + id: 0, }; preview.previewOptions.token = 'token'; preview.collection = [0, 1, 2, 3, 4, 5]; @@ -2520,7 +2520,7 @@ describe('lib/Preview', () => { it('should set the cache, add to the prefetched collection, and prefetch the actual content', () => { stubs.getTokens.returns(stubs.getTokensPromiseResolve); preview.file = { - id: 0 + id: 0, }; preview.previewOptions.token = 'token'; preview.collection = [0, 1, 2, 3, 4, 5]; @@ -2537,7 +2537,7 @@ describe('lib/Preview', () => { }); describe('getGlobalMousemoveHandler()', () => { - it('should clear the timeout handler and do nothing if the container doesn\'t exist', () => { + it("should clear the timeout handler and do nothing if the container doesn't exist", () => { preview.container = false; const handler = preview.getGlobalMousemoveHandler(); @@ -2547,7 +2547,7 @@ describe('lib/Preview', () => { it('should remove the navigation arrows', () => { preview.viewer = { - allowNavigationArrows: sandbox.stub().returns(false) + allowNavigationArrows: sandbox.stub().returns(false), }; const handler = preview.getGlobalMousemoveHandler(); @@ -2555,7 +2555,7 @@ describe('lib/Preview', () => { expect(preview.container.classList.contains(CLASS_NAVIGATION_VISIBILITY)).to.be.false; }); - it('should add the navigation arrows back if the viewer allows them or we aren\'t previewing', () => { + it("should add the navigation arrows back if the viewer allows them or we aren't previewing", () => { preview.viewer = false; let handler = preview.getGlobalMousemoveHandler(); @@ -2563,7 +2563,7 @@ describe('lib/Preview', () => { expect(preview.container.classList.contains(CLASS_NAVIGATION_VISIBILITY)).to.be.true; preview.viewer = { - allowNavigationArrows: sandbox.stub().returns(true) + allowNavigationArrows: sandbox.stub().returns(true), }; handler = preview.getGlobalMousemoveHandler(); @@ -2575,7 +2575,7 @@ describe('lib/Preview', () => { const clock = sinon.useFakeTimers(); const handler = preview.getGlobalMousemoveHandler(); preview.viewer = { - allowNavigationArrows: sandbox.stub() + allowNavigationArrows: sandbox.stub(), }; handler(); @@ -2591,7 +2591,7 @@ describe('lib/Preview', () => { stubs.load = sandbox.stub(preview, 'load'); preview.count = { - navigation: 0 + navigation: 0, }; preview.collection = ['file', 'file2', 'file3']; @@ -2627,7 +2627,7 @@ describe('lib/Preview', () => { beforeEach(() => { stubs.navigateToIndex = sandbox.stub(preview, 'navigateToIndex'); preview.file = { - id: 1 + id: 1, }; preview.collection = [3, 2, 1]; }); @@ -2670,16 +2670,16 @@ describe('lib/Preview', () => { preview.loaders = [ { name: 'error', - canLoad: sandbox.stub().returns(false) + canLoad: sandbox.stub().returns(false), }, { name: 'text', - canLoad: sandbox.stub().returns(false) + canLoad: sandbox.stub().returns(false), }, { name: 'csv', - canLoad: sandbox.stub().returns(true) - } + canLoad: sandbox.stub().returns(true), + }, ]; const loader = preview.getLoader('file'); @@ -2695,8 +2695,8 @@ describe('lib/Preview', () => { stubs.navigateRight = sandbox.stub(preview, 'navigateRight'); stubs.event = { target: { - nodeName: KEYDOWN_EXCEPTIONS[0] - } + nodeName: KEYDOWN_EXCEPTIONS[0], + }, }; preview.viewer = {}; @@ -2776,9 +2776,9 @@ describe('lib/Preview', () => { preview.previewOptions = { fileOptions: { 123: { - fileVersionId: '1234' - } - } + fileVersionId: '1234', + }, + }, }; expect(preview.getFileOption('123', 'fileVersionId')).to.equal('1234'); @@ -2788,9 +2788,9 @@ describe('lib/Preview', () => { preview.previewOptions = { fileOptions: { 123: { - fileVersionId: '1234' - } - } + fileVersionId: '1234', + }, + }, }; expect(preview.getFileOption({ id: '123' }, 'fileVersionId')).to.equal('1234'); @@ -2800,9 +2800,9 @@ describe('lib/Preview', () => { preview.previewOptions = { fileOptions: { 123: { - fileVersionId: '1234' - } - } + fileVersionId: '1234', + }, + }, }; expect(preview.getFileOption({ id: '1234' }, 'fileVersionId')).to.equal(undefined); diff --git a/src/lib/__tests__/PreviewError-test.js b/src/lib/__tests__/PreviewError-test.js index 6c52a473f..d945ce98a 100644 --- a/src/lib/__tests__/PreviewError-test.js +++ b/src/lib/__tests__/PreviewError-test.js @@ -26,12 +26,12 @@ describe('lib/PreviewError', () => { it('should default display message to generic error message if not provided', () => { const previewError = new PreviewError('some_code'); - expect(previewError.displayMessage).to.equal('We\'re sorry, the preview didn\'t load.'); + expect(previewError.displayMessage).to.equal("We're sorry, the preview didn't load."); }); it('should default message to display message if message is not provided', () => { const previewError = new PreviewError('some_code'); - expect(previewError.message).to.equal('We\'re sorry, the preview didn\'t load.'); + expect(previewError.message).to.equal("We're sorry, the preview didn't load."); }); }); }); diff --git a/src/lib/__tests__/PreviewUI-test.html b/src/lib/__tests__/PreviewUI-test.html index 8dd7a4a88..538a4c83f 100644 --- a/src/lib/__tests__/PreviewUI-test.html +++ b/src/lib/__tests__/PreviewUI-test.html @@ -2,7 +2,7 @@
- +
diff --git a/src/lib/__tests__/PreviewUI-test.js b/src/lib/__tests__/PreviewUI-test.js index 6671171c6..d14c96c85 100644 --- a/src/lib/__tests__/PreviewUI-test.js +++ b/src/lib/__tests__/PreviewUI-test.js @@ -22,7 +22,7 @@ describe('lib/PreviewUI', () => { fixture.load('__tests__/PreviewUI-test.html'); containerEl = document.querySelector('.ui'); options = { - container: containerEl + container: containerEl, }; }); @@ -168,7 +168,7 @@ describe('lib/PreviewUI', () => { const { previewContainer } = ui; ui.showNavigation('1', ['1']); let isShowingNavigation = previewContainer.classList.contains( - constants.CLASS_BOX_PREVIEW_HAS_NAVIGATION + constants.CLASS_BOX_PREVIEW_HAS_NAVIGATION, ); expect(isShowingNavigation).to.be.false; ui.showNavigation('1', ['1', '2']); @@ -264,7 +264,7 @@ describe('lib/PreviewUI', () => { describe('startProgressBar()', () => { it('should start the progress bar', () => { ui.progressBar = { - start: sandbox.stub() + start: sandbox.stub(), }; ui.startProgressBar(); @@ -275,7 +275,7 @@ describe('lib/PreviewUI', () => { describe('finishProgressBar()', () => { it('should finish the progress bar', () => { ui.progressBar = { - finish: sandbox.stub() + finish: sandbox.stub(), }; ui.finishProgressBar(); @@ -286,7 +286,7 @@ describe('lib/PreviewUI', () => { describe('showNotification()', () => { it('should show a notification message', () => { ui.notification = { - show: sandbox.stub() + show: sandbox.stub(), }; ui.showNotification('message'); @@ -297,7 +297,7 @@ describe('lib/PreviewUI', () => { describe('hideNotification()', () => { it('should hide the notification message', () => { ui.notification = { - hide: sandbox.stub() + hide: sandbox.stub(), }; ui.hideNotification('message'); @@ -365,14 +365,14 @@ describe('lib/PreviewUI', () => { const url = 'http://test/foo'; expect(containerEl.querySelector(constants.SELECTOR_BOX_PREVIEW_LOGO_DEFAULT)).to.not.have.class( - constants.CLASS_HIDDEN + constants.CLASS_HIDDEN, ); ui.setupHeader('', url); const customLogoEl = containerEl.querySelector(constants.SELECTOR_BOX_PREVIEW_LOGO_CUSTOM); expect(containerEl.querySelector(constants.SELECTOR_BOX_PREVIEW_LOGO_DEFAULT)).to.have.class( - constants.CLASS_HIDDEN + constants.CLASS_HIDDEN, ); expect(customLogoEl).to.not.have.class(constants.CLASS_HIDDEN); expect(customLogoEl.src).to.equal(url); diff --git a/src/lib/__tests__/ProgressBar-test.js b/src/lib/__tests__/ProgressBar-test.js index 33bb76a29..a2840b2d3 100644 --- a/src/lib/__tests__/ProgressBar-test.js +++ b/src/lib/__tests__/ProgressBar-test.js @@ -38,7 +38,10 @@ describe('lib/ProgressBar', () => { describe('destroy()', () => { it('should clear progress interval and unmount the progress bar', () => { - sandbox.mock(window).expects('clearInterval').withArgs(progressBar.progressInterval); + sandbox + .mock(window) + .expects('clearInterval') + .withArgs(progressBar.progressInterval); progressBar.destroy(); expect(mountEl.querySelector('.bp-progress-bar-container')).to.equal(null); }); @@ -74,7 +77,10 @@ describe('lib/ProgressBar', () => { it('should clear the interval when progress is >= 95', () => { sandbox.stub(progressBar, 'showProgress'); - sandbox.mock(window).expects('clearInterval').withArgs(sinon.match.number); + sandbox + .mock(window) + .expects('clearInterval') + .withArgs(sinon.match.number); progressBar.start(); progressBar.progress = 95; @@ -89,13 +95,16 @@ describe('lib/ProgressBar', () => { const mock = sandbox.mock(progressBar); mock.expects('hideProgress'); mock.expects('updateProgress').withArgs(100); - sandbox.mock(window).expects('clearInterval').withArgs(progressBar.progressInterval); + sandbox + .mock(window) + .expects('clearInterval') + .withArgs(progressBar.progressInterval); progressBar.finish(); }); }); describe('updateProgress()', () => { - it('should update the progress bar element\'s width', () => { + it("should update the progress bar element's width", () => { const progress = 57; progressBar.updateProgress(progress); expect(progressBar.progressBarEl.style.width).to.equal(`${progress}%`); diff --git a/src/lib/__tests__/RepStatus-test.js b/src/lib/__tests__/RepStatus-test.js index 5cfe1a361..46bf5493a 100644 --- a/src/lib/__tests__/RepStatus-test.js +++ b/src/lib/__tests__/RepStatus-test.js @@ -18,10 +18,10 @@ describe('lib/RepStatus', () => { beforeEach(() => { rep = { info: { - url: 'https://info' + url: 'https://info', }, links: {}, - status: {} + status: {}, }; /* eslint-disable require-jsdoc */ @@ -31,7 +31,7 @@ describe('lib/RepStatus', () => { repStatus = new RepStatus({ representation: rep, logger, - fileId + fileId, }); }); @@ -53,9 +53,9 @@ describe('lib/RepStatus', () => { expect( RepStatus.getStatus({ status: { - state: status - } - }) + state: status, + }, + }), ).to.equal(status); }); }); @@ -65,9 +65,9 @@ describe('lib/RepStatus', () => { expect( RepStatus.getErrorCode({ status: { - code: 'conversion_failed' - } - }) + code: 'conversion_failed', + }, + }), ).to.equal('conversion_failed'); }); }); @@ -82,7 +82,7 @@ describe('lib/RepStatus', () => { it('should set the correct object properties', () => { repStatus = new RepStatus({ representation: rep, - logger: {} + logger: {}, }); expect(repStatus.representation).to.deep.equal(rep); @@ -112,9 +112,9 @@ describe('lib/RepStatus', () => { .returns( Promise.resolve({ status: { - state - } - }) + state, + }, + }), ); return repStatus.updateStatus().then(() => { @@ -130,12 +130,12 @@ describe('lib/RepStatus', () => { .returns( Promise.resolve({ status: { - state + state, }, metadata: { - pages: 10 - } - }) + pages: 10, + }, + }), ); return repStatus.updateStatus().then(() => { @@ -169,11 +169,11 @@ describe('lib/RepStatus', () => { repStatus.updateStatus = () => {}; }); - it('should reject with the refresh message if the rep status is error', (done) => { + it('should reject with the refresh message if the rep status is error', done => { sandbox .mock(repStatus) .expects('reject') - .callsFake((err) => { + .callsFake(err => { expect(err.displayMessage).to.equal(__('error_refresh')); done(); }); @@ -182,11 +182,11 @@ describe('lib/RepStatus', () => { repStatus.handleResponse(); }); - it('should reject with the protected message if the rep status is error due to a password protected PDF', (done) => { + it('should reject with the protected message if the rep status is error due to a password protected PDF', done => { sandbox .mock(repStatus) .expects('reject') - .callsFake((err) => { + .callsFake(err => { expect(err.displayMessage).to.equal(__('error_password_protected')); done(); }); @@ -196,11 +196,11 @@ describe('lib/RepStatus', () => { repStatus.handleResponse(); }); - it('should reject with the try again message if the rep status is error due to unavailability', (done) => { + it('should reject with the try again message if the rep status is error due to unavailability', done => { sandbox .mock(repStatus) .expects('reject') - .callsFake((err) => { + .callsFake(err => { expect(err.displayMessage).to.equal(__('error_try_again_later')); done(); }); @@ -210,11 +210,11 @@ describe('lib/RepStatus', () => { repStatus.handleResponse(); }); - it('should reject with the unsupported format message if the rep status is error due a bad file', (done) => { + it('should reject with the unsupported format message if the rep status is error due a bad file', done => { sandbox .mock(repStatus) .expects('reject') - .callsFake((err) => { + .callsFake(err => { expect(err.displayMessage).to.equal(__('error_bad_file')); done(); }); @@ -240,7 +240,7 @@ describe('lib/RepStatus', () => { it('should log that file needs conversion if status is pending and logger exists', () => { repStatus.logger = { - setUnConverted: () => {} + setUnConverted: () => {}, }; sandbox.mock(repStatus.logger).expects('setUnConverted'); sandbox.stub(repStatus, 'emit'); diff --git a/src/lib/__tests__/ThumbnailsSidebar-test.js b/src/lib/__tests__/ThumbnailsSidebar-test.js index 809fc6f5c..8b471811d 100644 --- a/src/lib/__tests__/ThumbnailsSidebar-test.js +++ b/src/lib/__tests__/ThumbnailsSidebar-test.js @@ -4,7 +4,7 @@ import VirtualScroller from '../VirtualScroller'; import * as utils from '../util'; const sandbox = sinon.sandbox.create(); -const TEST_SCALE = DEFAULT_THUMBNAILS_SIDEBAR_WIDTH * 2 / 10; +const TEST_SCALE = (DEFAULT_THUMBNAILS_SIDEBAR_WIDTH * 2) / 10; describe('ThumbnailsSidebar', () => { let thumbnailsSidebar; @@ -20,14 +20,14 @@ describe('ThumbnailsSidebar', () => { beforeEach(() => { fixture.load('__tests__/ThumbnailsSidebar-test.html'); - stubs.raf = sandbox.stub(window, 'requestAnimationFrame').callsFake((callback) => callback()); + stubs.raf = sandbox.stub(window, 'requestAnimationFrame').callsFake(callback => callback()); stubs.getViewport = sandbox.stub(); stubs.render = sandbox.stub(); page = { getViewport: stubs.getViewport, - render: stubs.render + render: stubs.render, }; pagePromise = Promise.resolve(page); @@ -40,13 +40,13 @@ describe('ThumbnailsSidebar', () => { virtualScroller = { destroy: stubs.vsDestroy, getVisibleItems: stubs.vsGetVisibleItems, - scrollIntoView: stubs.vsScrollIntoView + scrollIntoView: stubs.vsScrollIntoView, }; pdfViewer = { pdfDocument: { - getPage: stubs.getPage - } + getPage: stubs.getPage, + }, }; anchorEl = document.getElementById('test-thumbnails-sidebar'); @@ -161,11 +161,11 @@ describe('ThumbnailsSidebar', () => { const createThumbnailEl = (pageNum, contains) => { return { classList: { - contains: () => contains + contains: () => contains, }, dataset: { - bpPageNum: pageNum - } + bpPageNum: pageNum, + }, }; }; @@ -215,7 +215,7 @@ describe('ThumbnailsSidebar', () => { const thumbnailEl = { lastChild: { appendChild: stubs.appendChild }, - classList: { add: stubs.addClass } + classList: { add: stubs.addClass }, }; thumbnailsSidebar.requestThumbnailImage(0, thumbnailEl); @@ -250,7 +250,7 @@ describe('ThumbnailsSidebar', () => { const cachedImage = {}; stubs.createImageEl.returns(cachedImage); - return thumbnailsSidebar.createThumbnailImage(0).then((imageEl) => { + return thumbnailsSidebar.createThumbnailImage(0).then(imageEl => { expect(stubs.createImageEl).to.be.called; expect(stubs.setCacheEntry).to.be.calledWith(0, { inProgress: false, image: imageEl }); }); @@ -261,7 +261,7 @@ describe('ThumbnailsSidebar', () => { stubs.getCacheEntry.withArgs(0).returns({ inProgress: true }); stubs.createImageEl.returns(cachedImage); - return thumbnailsSidebar.createThumbnailImage(0).then((imageEl) => { + return thumbnailsSidebar.createThumbnailImage(0).then(imageEl => { expect(stubs.createImageEl).not.to.be.called; expect(imageEl).to.be.null; }); @@ -332,7 +332,7 @@ describe('ThumbnailsSidebar', () => { evt = { target: targetEl, preventDefault: stubs.preventDefault, - stopImmediatePropagation: stubs.stopImmediatePropagation + stopImmediatePropagation: stubs.stopImmediatePropagation, }; thumbnailsSidebar.onThumbnailSelect = stubs.onThumbnailSelect; @@ -364,7 +364,7 @@ describe('ThumbnailsSidebar', () => { stubs.onThumbnailSelect = sandbox.stub(); stubs.event = { stopImmediatePropagation: sandbox.stub(), - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; utils.decodeKeydown = sandbox.stub(); @@ -421,7 +421,7 @@ describe('ThumbnailsSidebar', () => { const paramaterizedTests = [ { name: 'pageNumber is undefined', pageNumber: undefined }, { name: 'pageNumber is less than 1', pageNumber: 0 }, - { name: 'pageNumber is greater than last page', pageNumber: 11 } + { name: 'pageNumber is greater than last page', pageNumber: 11 }, ]; paramaterizedTests.forEach(({ name, pageNumber }) => { @@ -450,7 +450,7 @@ describe('ThumbnailsSidebar', () => { stubs.removeClass = sandbox.stub(); // eslint-disable-next-line - const createTestThumbnail = (pageNum) => { + const createTestThumbnail = pageNum => { const thumbnail = document.createElement('div'); thumbnail.dataset.bpPageNum = pageNum; thumbnail.classList.add = stubs.addClass; diff --git a/src/lib/__tests__/Timer-test.js b/src/lib/__tests__/Timer-test.js index 9c74f2edf..ed2f2824f 100644 --- a/src/lib/__tests__/Timer-test.js +++ b/src/lib/__tests__/Timer-test.js @@ -12,7 +12,7 @@ describe('lib/Timer', () => { }); describe('start()', () => { - it('should create a new entry if one doesn\'t exist', () => { + it("should create a new entry if one doesn't exist", () => { expect(Timer.get(tag)).to.not.exist; Timer.start(tag); expect(Timer.get(tag)).to.exist; diff --git a/src/lib/__tests__/VirtualScroller-test.js b/src/lib/__tests__/VirtualScroller-test.js index e124e3ced..3eae87dd1 100644 --- a/src/lib/__tests__/VirtualScroller-test.js +++ b/src/lib/__tests__/VirtualScroller-test.js @@ -63,7 +63,7 @@ describe('VirtualScroller', () => { totalItems: 10, itemHeight: 100, containerHeight: 500, - renderItemFn: stubs.renderItemFn + renderItemFn: stubs.renderItemFn, }); expect(virtualScroller.totalItems).to.be.equal(10); @@ -92,7 +92,7 @@ describe('VirtualScroller', () => { itemHeight: 100, containerHeight: 500, renderItemFn: stubs.renderItemFn, - onInit: stubs.onInitHandler + onInit: stubs.onInitHandler, }); expect(stubs.onInitHandler).to.be.calledWith(mockListInfo); @@ -106,7 +106,7 @@ describe('VirtualScroller', () => { itemHeight: 100, containerHeight: 500, renderItemFn: stubs.renderItemFn, - initialRowIndex: 50 + initialRowIndex: 50, }); expect(stubs.renderItems).to.be.calledWith(50); @@ -120,7 +120,7 @@ describe('VirtualScroller', () => { itemHeight: 100, containerHeight: 500, renderItemFn: stubs.renderItemFn, - initialRowIndex: 2 + initialRowIndex: 2, }); expect(stubs.renderItems).to.be.calledWith(0); @@ -134,8 +134,8 @@ describe('VirtualScroller', () => { totalItems: 10, itemHeight: 100, renderItemFn: () => {}, - containerHeight: 500 - }) + containerHeight: 500, + }), ).to.not.throw(); }); @@ -149,9 +149,9 @@ describe('VirtualScroller', () => { { name: 'containerHeight falsy', config: { totalItems: 10, itemHeight: 100, renderItemFn: () => {} } }, { name: 'containerHeight not finite', - config: { totalItems: 10, itemHeight: 100, renderItemFn: () => {}, containerHeight: '500' } - } - ].forEach((data) => { + config: { totalItems: 10, itemHeight: 100, renderItemFn: () => {}, containerHeight: '500' }, + }, + ].forEach(data => { it(`should throw an error if config is bad: ${data.name}`, () => { expect(() => virtualScroller.validateRequiredConfig(data.config)).to.throw(); }); @@ -211,7 +211,7 @@ describe('VirtualScroller', () => { it('should render the whole range of items (no reuse)', () => { stubs.getCurrentListInfo.returns({ startOffset: -1, - endOffset: -1 + endOffset: -1, }); virtualScroller.renderItems(); @@ -224,7 +224,7 @@ describe('VirtualScroller', () => { it('should render the last window into the list', () => { stubs.getCurrentListInfo.returns({ startOffset: -1, - endOffset: -1 + endOffset: -1, }); virtualScroller.renderItems(95); @@ -237,7 +237,7 @@ describe('VirtualScroller', () => { it('should render items above the current list', () => { stubs.getCurrentListInfo.returns({ startOffset: 20, - endOffset: 30 + endOffset: 30, }); virtualScroller.renderItems(15); @@ -323,7 +323,7 @@ describe('VirtualScroller', () => { it('should return -1 for offsets if elements do not exist', () => { virtualScroller.listEl = { - children: [{ children: [item1] }, { children: [item2] }] + children: [{ children: [item1] }, { children: [item2] }], }; const retObj = virtualScroller.getCurrentListInfo(); @@ -336,7 +336,7 @@ describe('VirtualScroller', () => { virtualScroller.listEl = { firstElementChild: { children: [item1], dataset: {} }, lastElementChild: { children: [item2], dataset: {} }, - children: [{ children: [item1] }, { children: [item2] }] + children: [{ children: [item1] }, { children: [item2] }], }; const retObj = virtualScroller.getCurrentListInfo(); @@ -349,7 +349,7 @@ describe('VirtualScroller', () => { virtualScroller.listEl = { firstElementChild: { children: [item1], dataset: { bpVsRowIndex: '0' } }, lastElementChild: { children: [item2], dataset: { bpVsRowIndex: '10' } }, - children: [{ children: [item1] }, { children: [item2] }] + children: [{ children: [item1] }, { children: [item2] }], }; const retObj = virtualScroller.getCurrentListInfo(); @@ -361,7 +361,7 @@ describe('VirtualScroller', () => { it('should return [] for items if no children', () => { virtualScroller.listEl = { firstElementChild: { children: [item1], dataset: {} }, - lastElementChild: { children: [item2], dataset: {} } + lastElementChild: { children: [item2], dataset: {} }, }; const retObj = virtualScroller.getCurrentListInfo(); @@ -384,10 +384,10 @@ describe('VirtualScroller', () => { { name: 'no start provided', listEl, start: undefined, end: 2 }, { name: 'no end provided', listEl, start: 1, end: undefined }, { name: 'start is < 0 provided', listEl, start: -1, end: 2 }, - { name: 'end is < 0 provided', listEl, start: 1, end: -1 } + { name: 'end is < 0 provided', listEl, start: 1, end: -1 }, ]; - paramaterizedTests.forEach((testData) => { + paramaterizedTests.forEach(testData => { it(`should do nothing if ${testData.name}`, () => { const { listEl: list, start, end } = testData; @@ -400,7 +400,7 @@ describe('VirtualScroller', () => { it('should remove the items specified', () => { const list = { children: [{}, {}, {}, {}], - removeChild: stubs.removeChild + removeChild: stubs.removeChild, }; virtualScroller.deleteItems(list, 0, 1); @@ -411,7 +411,7 @@ describe('VirtualScroller', () => { it('should remove the items specified from start to the end when end is not provided', () => { const list = { children: [{}, {}, {}, {}], - removeChild: stubs.removeChild + removeChild: stubs.removeChild, }; virtualScroller.deleteItems(list, 2); @@ -434,10 +434,10 @@ describe('VirtualScroller', () => { { name: 'no start provided', newListEl, oldListEl: {}, start: undefined, end: 2 }, { name: 'no end provided', newListEl, oldListEl: {}, start: 1, end: undefined }, { name: 'start is < 0 provided', newListEl, oldListEl: {}, start: -1, end: 2 }, - { name: 'end is < 0 provided', newListEl, oldListEl: {}, start: 1, end: -1 } + { name: 'end is < 0 provided', newListEl, oldListEl: {}, start: 1, end: -1 }, ]; - paramaterizedTests.forEach((testData) => { + paramaterizedTests.forEach(testData => { it(`should do nothing if ${testData.name}`, () => { const { newListEl: newList, start, end } = testData; @@ -475,8 +475,8 @@ describe('VirtualScroller', () => { children: [ { dataset: { bpVsRowIndex: 0 }, scrollIntoView: stubs.scrollIntoView }, { dataset: { bpVsRowIndex: 1 }, scrollIntoView: stubs.scrollIntoView }, - { dataset: { bpVsRowIndex: 2 }, scrollIntoView: stubs.scrollIntoView } - ] + { dataset: { bpVsRowIndex: 2 }, scrollIntoView: stubs.scrollIntoView }, + ], }; }); @@ -594,7 +594,7 @@ describe('VirtualScroller', () => { it('should return only visible list items', () => { const listEl = { - children: [{ children: [{ val: 1 }] }, { children: [{ val: 2 }] }, { children: [{ val: 3 }] }] + children: [{ children: [{ val: 1 }] }, { children: [{ val: 2 }] }, { children: [{ val: 3 }] }], }; const expectedItems = [{ val: 1 }, { val: 3 }]; diff --git a/src/lib/__tests__/api-test.js b/src/lib/__tests__/api-test.js index b35f0e4eb..32ce26ef7 100644 --- a/src/lib/__tests__/api-test.js +++ b/src/lib/__tests__/api-test.js @@ -11,7 +11,7 @@ describe('API helper', () => { it('should return the full response when the status is 202 or 204', () => { const response = { status: 202, - data: 'foo' + data: 'foo', }; expect(api.parseResponse(response)).to.equal(response); @@ -24,7 +24,7 @@ describe('API helper', () => { const data = 'foo'; const response = { status: 200, - data + data, }; expect(api.parseResponse(response)).to.equal(data); @@ -45,7 +45,7 @@ describe('API helper', () => { it('should call fetch on URL but fail when status is 404', () => { sandbox.stub(api, 'xhr').resolves({ status: 404 }); - return api.get(url).catch((err) => { + return api.get(url).catch(err => { expect(api.xhr).to.have.been.calledWith(url, { method: 'get', responseType: 'json' }); expect(err.response.status).to.equal(404); expect(err.response.statusText).to.equal('Not Found'); @@ -66,10 +66,10 @@ describe('API helper', () => { const headers = { baz: 'but' }; sandbox.stub(api, 'xhr').resolves({ data: responseText, - status: 200 + status: 200, }); - return api.get(url, { headers, type: 'text' }).then((response) => { + return api.get(url, { headers, type: 'text' }).then(response => { expect(api.xhr).to.have.been.calledWith(url, { headers, method: 'get', responseType: 'text' }); expect(response.data).to.equal(responseText); }); @@ -79,10 +79,10 @@ describe('API helper', () => { const blob = new Blob(['text'], { type: 'text/plain' }); sandbox.stub(api, 'xhr').resolves({ data: blob, - status: 200 + status: 200, }); - return api.get(url, { type: 'blob' }).then((response) => { + return api.get(url, { type: 'blob' }).then(response => { expect(api.xhr).to.have.been.calledWith(url, { method: 'get', responseType: 'blob' }); expect(response.data).to.deep.equal(blob); }); @@ -92,10 +92,10 @@ describe('API helper', () => { const responseText = 'darthsidious'; sandbox.stub(api, 'xhr').resolves({ data: responseText, - status: 200 + status: 200, }); - return api.get(url, { type: 'text' }).then((response) => { + return api.get(url, { type: 'text' }).then(response => { expect(api.xhr).to.have.been.calledWith(url, { method: 'get', responseType: 'text' }); expect(response.data).to.equal(responseText); }); @@ -104,10 +104,10 @@ describe('API helper', () => { it('should call get on URL with type any', () => { sandbox.stub(api, 'xhr').resolves({ data: 'greedo', - status: 200 + status: 200, }); - return api.get(url, { type: 'document' }).then((response) => { + return api.get(url, { type: 'document' }).then(response => { expect(api.xhr).to.have.been.calledWith(url, { method: 'get', responseType: 'document' }); expect(typeof response === 'object').to.be.true; // eslint-disable-line }); @@ -134,9 +134,9 @@ describe('API helper', () => { sandbox.stub(api, 'xhr').resolves({ body: { - foo: 'bar' + foo: 'bar', }, - status: 200 + status: 200, }); return api.post(url, data, { headers }).then(() => { @@ -153,9 +153,9 @@ describe('API helper', () => { sandbox.stub(api, 'xhr').resolves({ body: { - foo: 'bar' + foo: 'bar', }, - status: 200 + status: 200, }); return api.delete(url, data, { headers }).then(() => { @@ -172,9 +172,9 @@ describe('API helper', () => { sandbox.stub(api, 'xhr').resolves({ body: { - foo: 'bar' + foo: 'bar', }, - status: 200 + status: 200, }); return api.put(url, data, { headers }).then(() => { diff --git a/src/lib/__tests__/file-test.js b/src/lib/__tests__/file-test.js index 94f797c0d..eb7008c52 100644 --- a/src/lib/__tests__/file-test.js +++ b/src/lib/__tests__/file-test.js @@ -15,7 +15,7 @@ import { getCachedFile, isVeraProtectedFile, canDownload, - shouldDownloadWM + shouldDownloadWM, } from '../file'; const sandbox = sinon.sandbox.create(); @@ -29,14 +29,14 @@ describe('lib/file', () => { it('should return the correct api url', () => { assert.equal( getURL('id', '', 'api'), - 'api/2.0/files/id?fields=id,permissions,shared_link,sha1,file_version,name,size,extension,representations,watermark_info,authenticated_download_url,is_download_available' + 'api/2.0/files/id?fields=id,permissions,shared_link,sha1,file_version,name,size,extension,representations,watermark_info,authenticated_download_url,is_download_available', ); }); it('should return the correct API url for file version', () => { assert.equal( getURL('id', 'versionId', 'api'), - 'api/2.0/files/id/versions/versionId?fields=id,permissions,shared_link,sha1,file_version,name,size,extension,representations,watermark_info,authenticated_download_url,is_download_available' + 'api/2.0/files/id/versions/versionId?fields=id,permissions,shared_link,sha1,file_version,name,size,extension,representations,watermark_info,authenticated_download_url,is_download_available', ); }); }); @@ -126,7 +126,7 @@ describe('lib/file', () => { representations: {}, watermark_info: {}, authenticated_download_url: 'blah', - is_download_available: true + is_download_available: true, }; assert.ok(checkFileValid(file)); }); @@ -145,7 +145,7 @@ describe('lib/file', () => { representations: {}, watermark_info: {}, authenticated_download_url: 'blah?version=file_version_123', - is_download_available: true + is_download_available: true, }; const file = normalizeFileVersion(fileVersion, fileId); @@ -161,15 +161,15 @@ describe('lib/file', () => { beforeEach(() => { cache = { - set: sandbox.stub() + set: sandbox.stub(), }; }); it('should not cache file if it is watermarked', () => { const file = { watermark_info: { - is_watermarked: true - } + is_watermarked: true, + }, }; cacheFile(cache, file); @@ -179,7 +179,7 @@ describe('lib/file', () => { it('should not add original representation if file object doesnt have any to start with', () => { const file = { - id: '0' + id: '0', }; cacheFile(cache, file); @@ -191,8 +191,8 @@ describe('lib/file', () => { const file = { id: '0', representations: { - entries: [] - } + entries: [], + }, }; cacheFile(cache, file); @@ -207,10 +207,10 @@ describe('lib/file', () => { representations: { entries: [ { - representation: 'ORIGINAL' - } - ] - } + representation: 'ORIGINAL', + }, + ], + }, }; cacheFile(cache, file); @@ -219,17 +219,17 @@ describe('lib/file', () => { it('should append file version to original rep content URL', () => { cache = { - set: sandbox.stub() + set: sandbox.stub(), }; const file = { id: '0', file_version: { - id: '123' + id: '123', }, representations: { - entries: [] - } + entries: [], + }, }; cacheFile(cache, file); @@ -240,8 +240,8 @@ describe('lib/file', () => { const file = { id: '123', file_version: { - id: '1234' - } + id: '1234', + }, }; cacheFile(cache, file); @@ -256,8 +256,8 @@ describe('lib/file', () => { const file = { id: '0', file_version: { - id: '123' - } + id: '123', + }, }; cache.set(file.id, file); @@ -273,8 +273,8 @@ describe('lib/file', () => { const file = { id: '0', representations: { - entries: [] - } + entries: [], + }, }; expect(getRepresentation(file, 'ORIGINAL')).to.be.null; @@ -282,13 +282,13 @@ describe('lib/file', () => { it('should return matching representation if found', () => { const originalRep = { - representation: 'ORIGINAL' + representation: 'ORIGINAL', }; const file = { id: '0', representations: { - entries: [originalRep] - } + entries: [originalRep], + }, }; expect(getRepresentation(file, 'ORIGINAL')).to.be.equal(originalRep); @@ -300,7 +300,7 @@ describe('lib/file', () => { beforeEach(() => { cache = { - get: sandbox.stub() + get: sandbox.stub(), }; }); @@ -331,14 +331,14 @@ describe('lib/file', () => { describe('isVeraProtectedFile()', () => { ['some.vera.pdf.html', '.vera.test.html', 'blah.vera..html', 'another.vera.3.html', 'test.vera.html'].forEach( - (fileName) => { + fileName => { it('should return true if file is named like a Vera-protected file', () => { expect(isVeraProtectedFile({ name: fileName })).to.be.true; }); - } + }, ); - ['vera.pdf.html', 'test.vera1.pdf.html', 'blah.vera..htm', 'another.verahtml'].forEach((fileName) => { + ['vera.pdf.html', 'test.vera1.pdf.html', 'blah.vera..htm', 'another.verahtml'].forEach(fileName => { it('should return false if file is not named like a Vera-protected file', () => { expect(isVeraProtectedFile({ name: fileName })).to.be.false; }); @@ -352,13 +352,13 @@ describe('lib/file', () => { const previewOptions = { downloadWM }; const file = { watermark_info: { - is_watermarked: isFileWatermarked - } + is_watermarked: isFileWatermarked, + }, }; expect(shouldDownloadWM(file, previewOptions)).to.equal(expected); }); - } + }, ); }); @@ -371,14 +371,14 @@ describe('lib/file', () => { is_download_available: false, permissions: { can_download: false, - can_preview: false + can_preview: false, }, watermark_info: { - is_watermarked: false - } + is_watermarked: false, + }, }; options = { - showDownload: false + showDownload: false, }; }); @@ -394,7 +394,7 @@ describe('lib/file', () => { // Can download watermarked (don't need download permission) [true, true, false, true, true, false, false, false], [true, true, false, true, true, true, false, false], - [true, true, false, true, true, true, true, true] + [true, true, false, true, true, true, true, true], ].forEach( ([ isDownloadable, @@ -404,7 +404,7 @@ describe('lib/file', () => { hasPreviewPermission, isFileWatermarked, downloadWM, - expectedResult + expectedResult, ]) => { it('should return true if original or watermarked file can be downloaded', () => { file.permissions.can_download = hasDownloadPermission; @@ -417,7 +417,7 @@ describe('lib/file', () => { expect(canDownload(file, options)).to.equal(expectedResult); }); - } + }, ); }); }); diff --git a/src/lib/__tests__/metadataAPI-test.js b/src/lib/__tests__/metadataAPI-test.js index c87f0c592..1ec3167cb 100644 --- a/src/lib/__tests__/metadataAPI-test.js +++ b/src/lib/__tests__/metadataAPI-test.js @@ -18,14 +18,14 @@ describe('metadataAPI', () => { describe('getXrefsMetadata()', () => { it('Should reject the promise if id is not provided on the file', () => { - return metadataAPI.getXrefsMetadata(null, 'autocad').catch((err) => { + return metadataAPI.getXrefsMetadata(null, 'autocad').catch(err => { expect(stubs.get).not.to.have.been.called; expect(err instanceof Error).to.be.true; }); }); it('Should reject the promise if template is not provided on the file', () => { - return metadataAPI.getXrefsMetadata('123').catch((err) => { + return metadataAPI.getXrefsMetadata('123').catch(err => { expect(stubs.get).not.to.have.been.called; expect(err instanceof Error).to.be.true; }); @@ -35,7 +35,7 @@ describe('metadataAPI', () => { const expResponse = { hasxrefs: 'true' }; stubs.get.resolves(expResponse); - return metadataAPI.getXrefsMetadata('123', 'autocad').then((response) => { + return metadataAPI.getXrefsMetadata('123', 'autocad').then(response => { expect(stubs.get).to.have.been.called; expect(response).to.eql({ hasxrefs: true }); }); @@ -45,7 +45,7 @@ describe('metadataAPI', () => { const expResponse = { response: { status: 400 } }; stubs.get.rejects(expResponse); - return metadataAPI.getXrefsMetadata('123', 'autocad').catch((err) => { + return metadataAPI.getXrefsMetadata('123', 'autocad').catch(err => { expect(stubs.get).to.have.been.called; expect(err).to.eql(expResponse); }); @@ -60,7 +60,7 @@ describe('metadataAPI', () => { apiHost: 'foo.com', token: '456', sharedLink: 'shared-link', - sharedLinkPassword: 'shared-link-password' + sharedLinkPassword: 'shared-link-password', }); expect(stubs.getHeaders).to.have.been.calledWith({}, '456', 'shared-link', 'shared-link-password'); diff --git a/src/lib/__tests__/tokens-test.js b/src/lib/__tests__/tokens-test.js index 741f30eb4..97e8b3b56 100644 --- a/src/lib/__tests__/tokens-test.js +++ b/src/lib/__tests__/tokens-test.js @@ -10,11 +10,11 @@ describe('lib/tokens', () => { if (ids.length > 1) { return Promise.resolve({ [ids[0].replace('file_', '')]: 'token1', - [ids[1].replace('file_', '')]: 'token2' + [ids[1].replace('file_', '')]: 'token2', }); } return Promise.resolve({ - [ids[0].replace('file_', '')]: 'token1' + [ids[0].replace('file_', '')]: 'token1', }); } @@ -22,11 +22,11 @@ describe('lib/tokens', () => { if (ids.length > 1) { return Promise.resolve({ [ids[0]]: 'token1', - [ids[1]]: 'token2' + [ids[1]]: 'token2', }); } return Promise.resolve({ - [ids[0]]: 'token1' + [ids[0]]: 'token1', }); } /* eslint-enable require-jsdoc */ @@ -35,60 +35,60 @@ describe('lib/tokens', () => { it('should throw an error when no id provided', () => { return getTokens(null, 'token') .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); it('should use undefined token when no token provided', () => { - return getTokens('123').then((data) => { + return getTokens('123').then(data => { assert.equal(undefined, data['123']); }); }); it('should use null token when null token provided', () => { - return getTokens('123', null).then((data) => { + return getTokens('123', null).then(data => { assert.equal(null, data['123']); }); }); it('should create id token map with string token and string id', () => { - return getTokens('123', 'token').then((data) => { + return getTokens('123', 'token').then(data => { assert.equal('token', data['123']); }); }); it('should create id token map with string token and array of string ids', () => { - return getTokens(['123', '456'], 'token').then((data) => { + return getTokens(['123', '456'], 'token').then(data => { assert.equal('token', data['123']); assert.equal('token', data['456']); }); }); it('should create id token map with function token that returns string and string id', () => { - return getTokens('123', stringTokenFunction).then((data) => { + return getTokens('123', stringTokenFunction).then(data => { assert.equal('token', data['123']); }); }); it('should create id token map with function token that returns string and array of string ids', () => { - return getTokens(['123', '456'], stringTokenFunction).then((data) => { + return getTokens(['123', '456'], stringTokenFunction).then(data => { assert.equal('token', data['123']); assert.equal('token', data['456']); }); }); it('should create id token map with function token that returns map and string id', () => { - return getTokens('123', mapIdTokenFunction).then((data) => { + return getTokens('123', mapIdTokenFunction).then(data => { assert.equal('token1', data['123']); }); }); it('should create id token map with function token that returns map and array of string ids', () => { - return getTokens(['123', '456'], mapIdTokenFunction).then((data) => { + return getTokens(['123', '456'], mapIdTokenFunction).then(data => { assert.equal('token1', data['123']); assert.equal('token2', data['456']); }); }); it('should create id token map with function token that returns map and string typed id', () => { - return getTokens('123', mapTypedIdTokenFunction).then((data) => { + return getTokens('123', mapTypedIdTokenFunction).then(data => { assert.equal('token1', data['123']); }); }); it('should create id token map with function token that returns map and array of string typed ids', () => { - return getTokens(['123', '456'], mapTypedIdTokenFunction).then((data) => { + return getTokens(['123', '456'], mapTypedIdTokenFunction).then(data => { assert.equal('token1', data['123']); assert.equal('token2', data['456']); }); @@ -96,7 +96,7 @@ describe('lib/tokens', () => { it('should throw an error when not all tokens could be fetched', () => { return getTokens(['123', '456', '789'], mapIdTokenFunction) .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); diff --git a/src/lib/__tests__/util-test.js b/src/lib/__tests__/util-test.js index f26b76b60..ec9e2a546 100644 --- a/src/lib/__tests__/util-test.js +++ b/src/lib/__tests__/util-test.js @@ -123,8 +123,8 @@ describe('lib/util', () => { expect( util.appendQueryParams(url, { foo: 'bar', - baz: 'boo' - }) + baz: 'boo', + }), ).to.equal(`${url}/?foo=bar&baz=boo`); }); @@ -133,8 +133,8 @@ describe('lib/util', () => { expect( util.appendQueryParams(url, { foo: 'bar', - baz: 'boo' - }) + baz: 'boo', + }), ).to.equal('foo/?test=hah&foo=bar&baz=boo'); }); @@ -143,8 +143,8 @@ describe('lib/util', () => { expect( util.appendQueryParams(url, { foo: 'bar', - baz: 'boo' - }) + baz: 'boo', + }), ).to.equal('test.com/?foo=bar&baz=boo'); }); }); @@ -160,7 +160,7 @@ describe('lib/util', () => { const token = 'sometoken'; const sharedLink = 'someSharedLink'; expect(util.appendAuthParams(url, token, sharedLink)).to.equal( - `${url}/?access_token=${token}&shared_link=${sharedLink}&box_client_name=${__NAME__}&box_client_version=${__VERSION__}` + `${url}/?access_token=${token}&shared_link=${sharedLink}&box_client_name=${__NAME__}&box_client_version=${__VERSION__}`, ); }); @@ -170,7 +170,7 @@ describe('lib/util', () => { const sharedLink = 'someSharedLink'; const sharedLinkPassword = 'somePass'; expect(util.appendAuthParams(url, token, sharedLink, sharedLinkPassword)).to.equal( - `${url}/?access_token=${token}&shared_link=${sharedLink}&shared_link_password=${sharedLinkPassword}&box_client_name=${__NAME__}&box_client_version=${__VERSION__}` + `${url}/?access_token=${token}&shared_link=${sharedLink}&shared_link_password=${sharedLinkPassword}&box_client_name=${__NAME__}&box_client_version=${__VERSION__}`, ); }); }); @@ -202,7 +202,7 @@ describe('lib/util', () => { it('should return a function to create asset urls', () => { const location = { baseURI: 'base/', - staticBaseURI: 'static/' + staticBaseURI: 'static/', }; const assetUrlCreator = util.createAssetUrlCreator(location); assert.equal(typeof assetUrlCreator, 'function'); @@ -316,14 +316,14 @@ describe('lib/util', () => { it('should throw an error when foobar.js is not found', () => { expect(() => util.findScriptLocation('fobar.js')).to.throw( Error, - /Missing or malformed fobar.js library/ + /Missing or malformed fobar.js library/, ); }); it('should throw an error when foobar.js is not found via script tag', () => { const script = document.querySelector('script[src*="/file.js"]'); expect(() => util.findScriptLocation('fobar.js', script)).to.throw( Error, - /Missing or malformed fobar.js library/ + /Missing or malformed fobar.js library/, ); }); }); @@ -333,101 +333,101 @@ describe('lib/util', () => { it('should return empty when no key', () => { assert.equal( util.decodeKeydown({ - key: '' + key: '', }), - '' + '', ); }); it('should return empty when modifier and key are same', () => { assert.equal( util.decodeKeydown({ key: 'Control', - ctrlKey: true + ctrlKey: true, }), - '' + '', ); }); it('should return correct with ctrl modifier', () => { assert.equal( util.decodeKeydown({ key: '1', - ctrlKey: true + ctrlKey: true, }), - 'Control+1' + 'Control+1', ); }); it('should return correct with shift modifier', () => { assert.equal( util.decodeKeydown({ key: '1', - shiftKey: true + shiftKey: true, }), - 'Shift+1' + 'Shift+1', ); }); it('should return correct with meta modifier', () => { assert.equal( util.decodeKeydown({ key: '1', - metaKey: true + metaKey: true, }), - 'Meta+1' + 'Meta+1', ); }); it('should return space key', () => { assert.equal( util.decodeKeydown({ - key: ' ' + key: ' ', }), - 'Space' + 'Space', ); }); it('should return right arrow key', () => { assert.equal( util.decodeKeydown({ - key: 'Right' + key: 'Right', }), - 'ArrowRight' + 'ArrowRight', ); }); it('should return left arrow key', () => { assert.equal( util.decodeKeydown({ - key: 'Left' + key: 'Left', }), - 'ArrowLeft' + 'ArrowLeft', ); }); it('should return up arrow key', () => { assert.equal( util.decodeKeydown({ - key: 'Up' + key: 'Up', }), - 'ArrowUp' + 'ArrowUp', ); }); it('should return down arrow key', () => { assert.equal( util.decodeKeydown({ - key: 'Down' + key: 'Down', }), - 'ArrowDown' + 'ArrowDown', ); }); it('should return esc key', () => { assert.equal( util.decodeKeydown({ - key: 'U+001B' + key: 'U+001B', }), - 'Escape' + 'Escape', ); }); it('should decode correct UTF8 key', () => { assert.equal( util.decodeKeydown({ - key: 'U+0041' + key: 'U+0041', }), - 'A' + 'A', ); }); }); @@ -487,11 +487,11 @@ describe('lib/util', () => { const previousScrollTop = 0; const currentPageEl = { offsetTop: 0, - clientHeight: 200 + clientHeight: 200, }; const wrapperEl = { scrollTop: 101, - offsetHeight: 500 + offsetHeight: 500, }; const result = util.pageNumberFromScroll(currentPageNum, previousScrollTop, currentPageEl, wrapperEl); @@ -503,11 +503,11 @@ describe('lib/util', () => { const previousScrollTop = 0; const currentPageEl = { offsetTop: 0, - clientHeight: 200 + clientHeight: 200, }; const wrapperEl = { scrollTop: 99, - offsetHeight: 500 + offsetHeight: 500, }; const result = util.pageNumberFromScroll(currentPageNum, previousScrollTop, currentPageEl, wrapperEl); @@ -519,11 +519,11 @@ describe('lib/util', () => { const previousScrollTop = 500; const currentPageEl = { offsetTop: 100, - clientHeight: 200 + clientHeight: 200, }; const wrapperEl = { scrollTop: 0, - offsetHeight: 100 + offsetHeight: 100, }; const result = util.pageNumberFromScroll(currentPageNum, previousScrollTop, currentPageEl, wrapperEl); @@ -535,11 +535,11 @@ describe('lib/util', () => { const previousScrollTop = 500; const currentPageEl = { offsetTop: 0, - clientHeight: 200 + clientHeight: 200, }; const wrapperEl = { scrollTop: 10, - offsetHeight: 100 + offsetHeight: 100, }; const result = util.pageNumberFromScroll(currentPageNum, previousScrollTop, currentPageEl, wrapperEl); @@ -568,22 +568,22 @@ describe('lib/util', () => { offsetLeft: 0, offsetTop: 0, scrollWidth: 0, - scrollHeight: 0 + scrollHeight: 0, }; const page2 = { id: 2, offsetLeft: 100, offsetTop: 0, scrollWidth: 100, - scrollHeight: 0 + scrollHeight: 0, }; const visiblePages = { first: { - id: 1 + id: 1, }, last: { - id: 2 - } + id: 2, + }, }; const midpointStub = sandbox.stub(document, 'querySelector'); @@ -603,7 +603,7 @@ describe('lib/util', () => { result = util.getClosestPageToPinch(0, 0, { first: null, - last: null + last: null, }); expect(result).to.equal(null); @@ -635,11 +635,11 @@ describe('lib/util', () => { const a = { b: { c: 'value', - b: '' + b: '', }, [someProp]: { - value: 'test' - } + value: 'test', + }, }; expect(util.getProp(a, 'b.c')).to.equal('value'); @@ -651,7 +651,7 @@ describe('lib/util', () => { const a = { b: {}, test: undefined, - foo: null + foo: null, }; expect(util.getProp(a, 'b.c', 'default')).to.equal('default'); @@ -689,7 +689,7 @@ describe('lib/util', () => { ['https://bar.app.boxcn.net', true], ['https://baz.ent.boxenterprise.net', true], ['https://haha.box.net', false], - ['https://some.other.domain', false] + ['https://some.other.domain', false], ].forEach(([hostname, expectedResult]) => { it('should return true when window location is a Box domain', () => { sandbox.stub(Location, 'getHostname').returns(hostname); @@ -704,28 +704,28 @@ describe('lib/util', () => { it('should convert previewWMPref to value expected by the API', () => { expect(util.convertWatermarkPref(previewWMPref)).to.equal(expected); }); - } + }, ); }); describe('handleRepresentationBlobFetch()', () => { it('should reject if the response is a 202', () => { const response = { - status: 202 + status: 202, }; - util.handleRepresentationBlobFetch(response).catch((e) => expect(e.code).to.equal(ERROR_CODE.DELETED_REPS)); + util.handleRepresentationBlobFetch(response).catch(e => expect(e.code).to.equal(ERROR_CODE.DELETED_REPS)); }); it('should pass the response through', () => { const response = { status: 200, - body: 'body' + body: 'body', }; - util - .handleRepresentationBlobFetch(response) - .then((passedResponse) => expect(passedResponse).to.equal(response)); + util.handleRepresentationBlobFetch(response).then(passedResponse => + expect(passedResponse).to.equal(response), + ); }); }); }); diff --git a/src/lib/_boxui.scss b/src/lib/_boxui.scss index 8f7e4ee0e..d74ed293e 100644 --- a/src/lib/_boxui.scss +++ b/src/lib/_boxui.scss @@ -17,7 +17,7 @@ .bp-header, .bp button, .bp-header button { - font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; } .bp li, @@ -55,11 +55,11 @@ &.is-disabled:active, &.is-disabled:hover, &.is-disabled:focus { - color: #666; + background-color: $haze; border: 1px solid $sf-fog; box-shadow: none; + color: #666; opacity: .4; - background-color: $haze; } svg { @@ -89,10 +89,10 @@ outline: none; &.is-disabled { - pointer-events: none; + background-color: $haze; color: #666; opacity: .4; - background-color: $haze; + pointer-events: none; } } @@ -157,13 +157,12 @@ &.is-disabled:active, &.is-disabled:hover, &.is-disabled:focus { - color: $white; - border-color: $primary-color; background-color: $primary-color; + border-color: $primary-color; + color: $white; } } - //------------------------------------------------------------------------------ // Forms //------------------------------------------------------------------------------ @@ -188,30 +187,30 @@ .bp-controls { /* Inputs */ - input[type="text"], - input[type="number"], - div[contentEditable="true"], + input[type='text'], + input[type='number'], + div[contentEditable='true'], textarea { - color: $twos; border: 1px solid #ccc; border-radius: 3px; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .1); + color: $twos; -webkit-font-smoothing: antialiased; padding: 7px; transition: border-color linear .15s, box-shadow linear .1s; width: 262px; } - input[type="text"]:hover, - input[type="number"]:hover, - div[contentEditable="true"]:hover, + input[type='text']:hover, + input[type='number']:hover, + div[contentEditable='true']:hover, textarea:hover { box-shadow: inset 0 1px 1px rgba(0, 0, 0, .15); } - input[type="text"]:focus, - input[type="number"]:focus, - div[contentEditable="true"]:focus, + input[type='text']:focus, + input[type='number']:focus, + div[contentEditable='true']:focus, textarea:focus { border: 1px solid $primary-color; box-shadow: none; @@ -231,7 +230,7 @@ .bp-overlay { background: $white; border: 1px solid $sf-fog; - box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .1); margin: 0; opacity: 0; padding: 8px 0; @@ -243,24 +242,24 @@ transform-origin: left top; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; - -webkit-transition: visibility 0s linear 0.075s, opacity 0.075s, -webkit-transform 0.125s; - transition: visibility 0s linear 0.075s, opacity 0.075s, -webkit-transform 0.125s; - transition: visibility 0s linear 0.075s, opacity 0.075s, transform 0.125s; - transition: visibility 0s linear 0.075s, opacity 0.075s, transform 0.125s, -webkit-transform 0.125s; + -webkit-transition: visibility 0s linear .075s, opacity .075s, -webkit-transform .125s; + transition: visibility 0s linear .075s, opacity .075s, -webkit-transform .125s; + transition: visibility 0s linear .075s, opacity .075s, transform .125s; + transition: visibility 0s linear .075s, opacity .075s, transform .125s, -webkit-transform .125s; visibility: hidden; z-index: 90; } .bp-link { - color: #64686D; + color: #64686d; font-smoothing: antialiased; line-height: 1.5em; overflow: hidden; text-decoration: none; text-overflow: ellipsis; - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004); - -webkit-transition: color 0.05s; - transition: color 0.05s; + text-shadow: 1px 1px 1px rgba(0, 0, 0, .004); + -webkit-transition: color .05s; + transition: color .05s; white-space: nowrap; } @@ -281,13 +280,12 @@ padding: 5px 35px 5px 15px; &:hover { - background: #F6FAFD; - color: #1A5976; - fill: #1A5976; + background: #f6fafd; + color: #1a5976; cursor: pointer; + fill: #1a5976; } } - } } } @@ -308,16 +306,16 @@ align-items: center; background-color: $sunset-grey; border-radius: 4px; - box-shadow: 0 2px 6px fade-out($black, 0.85); + box-shadow: 0 2px 6px fade-out($black, .85); color: $white; display: flex; font-weight: bold; margin: 10px auto; max-width: 572px; min-height: 48px; - padding: 10px 10px 10px 20px; - transition: opacity 0.1s ease-out; overflow: hidden; + padding: 10px 10px 10px 20px; + transition: opacity .1s ease-out; &.info { background-color: $thats-mint; @@ -338,14 +336,14 @@ > span { font-size: 15px; - padding-right: 10px; margin-right: auto; + padding-right: 10px; } &.wrap > span { overflow: hidden; - word-wrap: break-word; /* Include legacy name to support older browsers */ overflow-wrap: break-word; + word-wrap: break-word; /* Include legacy name to support older browsers */ } &.ellipsis > span { @@ -373,7 +371,7 @@ font-size: 14px; font-weight: bold; margin: 0 7px; - opacity: 0.6; + opacity: .6; outline: none; &.default-close-btn { @@ -412,7 +410,7 @@ .bp-modal-dialog { background-clip: padding-box; background-color: $white; - box-shadow: 0 3px 10px fade-out($black, 0.7); + box-shadow: 0 3px 10px fade-out($black, .7); margin: auto; padding: 30px; position: relative; @@ -428,9 +426,9 @@ .bp-modal-title { display: inline-block; flex: 1; - word-wrap: break-word; - overflow-wrap: break-word; overflow: hidden; + overflow-wrap: break-word; + word-wrap: break-word; } .bp-modal-content { @@ -445,7 +443,6 @@ font-size: 11px; font-weight: bold; outline: 0; - } .bp-modal-backdrop { @@ -453,11 +450,11 @@ bottom: 0; filter: alpha(opacity=75); left: 0; - opacity: 0.75; + opacity: .75; position: fixed; right: 0; top: 0; - z-index: -1; // .modal creates a new stacking context. Let's just make sure that backdrop is below dialog. + z-index: -1; // .modal creates a new stacking context. Let's just make sure that backdrop is below dialog. } .bp-modal-actions { diff --git a/src/lib/api.js b/src/lib/api.js index 9c1d44be3..9e66c2748 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -11,7 +11,7 @@ const api = { filterOptions(options = {}) { const result = {}; - Object.keys(options).forEach((key) => { + Object.keys(options).forEach(key => { if (options[key] !== undefined && options[key] !== null && options[key] !== '') { result[key] = options[key]; } @@ -43,7 +43,7 @@ const api = { * @param {Response} response - Response to parse * @return {Promise|Response} Response if 204 or 202, otherwise promise that resolves with JSON */ - parseResponse: (response) => { + parseResponse: response => { if (response.status === 204 || response.status === 202) { return response; } @@ -51,7 +51,7 @@ const api = { return response.data; }, - transformTextResponse: (data) => data, + transformTextResponse: data => data, /** * Wrapper function for XHR post put and delete @@ -134,7 +134,7 @@ const api = { */ put(url, data, options = {}) { return api.xhr(url, { method: 'put', data, ...options }); - } + }, }; export default api; diff --git a/src/lib/constants.js b/src/lib/constants.js index 12a89d7da..3491e6448 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -119,7 +119,7 @@ export const FILE_OPTION_START = 'startAt'; // Query parameter for requesting compressed representations export const QUERY_PARAM_ENCODING = 'encoding'; export const ENCODING_TYPES = { - GZIP: 'gzip' + GZIP: 'gzip', }; export const ANNOTATOR_EVENT = { @@ -127,11 +127,11 @@ export const ANNOTATOR_EVENT = { modeExit: 'annotationmodeexit', fetch: 'annotationsfetched', error: 'annotationerror', - scale: 'scaleannotations' + scale: 'scaleannotations', }; export const METADATA = { FIELD_HASXREFS: 'hasxrefs', SCOPE_GLOBAL: 'global', - TEMPLATE_AUTOCAD: 'autocad' + TEMPLATE_AUTOCAD: 'autocad', }; diff --git a/src/lib/events.js b/src/lib/events.js index 98e46674f..75f4477f0 100644 --- a/src/lib/events.js +++ b/src/lib/events.js @@ -12,7 +12,7 @@ export const VIEWER_EVENT = { default: 'viewerevent', // The default viewer event. metric: 'viewermetric', // A viewer metric. thumbnailsClose: 'thumbnailsClose', // When thumbnails sidebar closes - thumbnailsOpen: 'thumbnailsOpen' // When thumbnails sidebar opens + thumbnailsOpen: 'thumbnailsOpen', // When thumbnails sidebar opens }; // Error codes logged by preview with "preview_error" events @@ -44,7 +44,7 @@ export const ERROR_CODE = { CONVERSION_UNSUPPORTED_FORMAT: 'error_unsupported_format', VIEWER_LOAD_TIMEOUT: 'error_viewer_load_timeout', CONTENT_DOWNLOAD: 'error_content_download', - FLASH_NOT_ENABLED: 'error_flash_not_enabled' + FLASH_NOT_ENABLED: 'error_flash_not_enabled', }; // Event fired from Preview with error details @@ -60,7 +60,7 @@ export const LOAD_METRIC = { downloadResponseTime: 'download_response_time', // Time it took for TTFB when requesting a rep. contentLoadTime: 'full_document_load_time', // How long it took to load the document so it could be previewed. preloadTime: 'preload_time', // How long it takes to preload the document. - previewLoadTime: 'preview_loading' // Total preview load time. Maps to "value" of load event + previewLoadTime: 'preview_loading', // Total preview load time. Maps to "value" of load event }; export const DURATION_METRIC = 'preview_duration_metric'; @@ -71,20 +71,20 @@ export const PREVIEW_DOWNLOAD_ATTEMPT_EVENT = 'preview_download_attempt'; // Events around download reachability export const DOWNLOAD_REACHABILITY_METRICS = { NOTIFICATION_SHOWN: 'dl_reachability_notification_shown', - DOWNLOAD_BLOCKED: 'dl_reachability_host_blocked' + DOWNLOAD_BLOCKED: 'dl_reachability_host_blocked', }; // Events fired when using find in preview export const USER_DOCUMENT_FIND_EVENTS = { NEXT: 'user_document_find_next', // The user navigates to the next find entry OPEN: 'user_document_find_open', // The user opens the find bar - PREVIOUS: 'user_document_find_previous' // The user navigates to the previous find entry + PREVIOUS: 'user_document_find_previous', // The user navigates to the previous find entry }; // Events fired when using thumbnail sidebar export const USER_DOCUMENT_THUMBNAIL_EVENTS = { CLOSE: 'user_document_thumbnails_close', NAVIGATE: 'user_document_thumbnails_navigate', - OPEN: 'user_document_thumbnails_open' + OPEN: 'user_document_thumbnails_open', }; export const MISSING_EXTERNAL_REFS = 'missing_x_refs'; diff --git a/src/lib/extensions.js b/src/lib/extensions.js index 97c00aaac..79004ed39 100644 --- a/src/lib/extensions.js +++ b/src/lib/extensions.js @@ -45,7 +45,7 @@ export const CODE_EXTENSIONS = [ 'vi', 'vim', 'webdoc', - 'yaml' + 'yaml', ]; export const DOCUMENT_EXTENSIONS = CODE_EXTENSIONS.concat(NON_CODE_EXTENSIONS) @@ -72,7 +72,7 @@ export const DOCUMENT_EXTENSIONS = CODE_EXTENSIONS.concat(NON_CODE_EXTENSIONS) 'wpd', 'xls', 'xlsm', - 'xlsx' + 'xlsx', ]); export const TXT_EXTENSIONS = CODE_EXTENSIONS.concat(NON_CODE_EXTENSIONS); diff --git a/src/lib/file.js b/src/lib/file.js index 0e8a0bdd3..ec423b51c 100644 --- a/src/lib/file.js +++ b/src/lib/file.js @@ -17,7 +17,7 @@ const FILE_FIELDS = [ 'representations', 'watermark_info', 'authenticated_download_url', - 'is_download_available' + 'is_download_available', ]; /** @@ -55,7 +55,7 @@ export function getDownloadURL(id, apiHost) { * @return {Object|null} Maching representation object or null */ export function getRepresentation(file, repName) { - return file.representations.entries.find((entry) => entry.representation === repName) || null; + return file.representations.entries.find(entry => entry.representation === repName) || null; } /** @@ -108,7 +108,7 @@ export function checkFileValid(file) { return false; } - return FILE_FIELDS.every((field) => typeof file[field] !== 'undefined'); + return FILE_FIELDS.every(field => typeof file[field] !== 'undefined'); } /** @@ -126,7 +126,7 @@ export function normalizeFileVersion(fileVersion, fileId) { file.file_version = { type: 'file_version', id: fileVersion.id, - sha1: fileVersion.sha1 + sha1: fileVersion.sha1, }; return file; @@ -148,7 +148,7 @@ function addOriginalRepresentation(file) { } const queryParams = { - preview: 'true' + preview: 'true', }; if (file.file_version) { @@ -158,12 +158,12 @@ function addOriginalRepresentation(file) { const template = appendQueryParams(file.authenticated_download_url, queryParams); file.representations.entries.push({ content: { - url_template: template + url_template: template, }, representation: ORIGINAL_REP_NAME, status: { - state: 'success' - } + state: 'success', + }, }); } @@ -178,7 +178,8 @@ function addOriginalRepresentation(file) { export function getFileCacheKey({ fileId, fileVersionId }) { if (fileId) { return `file_${fileId}`; - } else if (fileVersionId) { + } + if (fileVersionId) { return `file_version_${fileVersionId}`; } @@ -244,7 +245,8 @@ export function uncacheFile(cache, file) { export function getCachedFile(cache, { fileId, fileVersionId }) { if (fileId && !fileVersionId) { return cache.get(getFileCacheKey({ fileId })); - } else if (fileVersionId) { + } + if (fileVersionId) { return cache.get(getFileCacheKey({ fileVersionId })); } diff --git a/src/lib/icons/icons.js b/src/lib/icons/icons.js index afae71fe6..7792dba39 100644 --- a/src/lib/icons/icons.js +++ b/src/lib/icons/icons.js @@ -96,18 +96,18 @@ const FILE_LOADING_ICONS = { FILE_PRESENTATION, FILE_SPREADSHEET, FILE_WORD, - FILE_ZIP + FILE_ZIP, }; export const ICON_FILE_MAP = {}; // AUDIO ICON EXTENSIONS -['aac', 'aif', 'aifc', 'aiff', 'amr', 'au', 'flac', 'm4a', 'mp3', 'ra', 'wav', 'wma'].forEach((extension) => { +['aac', 'aif', 'aifc', 'aiff', 'amr', 'au', 'flac', 'm4a', 'mp3', 'ra', 'wav', 'wma'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_AUDIO'; }); // BOXNOTE ICON EXTENSIONS -['boxnote'].forEach((extension) => { +['boxnote'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_BOX_NOTE'; }); @@ -161,33 +161,33 @@ export const ICON_FILE_MAP = {}; 'xml', 'xsd', 'xsl', - 'yaml' -].forEach((extension) => { + 'yaml', +].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_CODE'; }); // EXCEL ICON EXTENSIONS -['xls', 'xlsm', 'xlsx', 'xlsb'].forEach((extension) => { +['xls', 'xlsm', 'xlsx', 'xlsb'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_EXCEL'; }); // DOCUMENT ICON EXTENSIONS -['log', 'msg', 'ods', 'rtf', 'txt', 'wpd'].forEach((extension) => { +['log', 'msg', 'ods', 'rtf', 'txt', 'wpd'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_DOCUMENT'; }); // GOOGLE DOC ICON EXTENSIONS -['gdoc'].forEach((extension) => { +['gdoc'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_GOOGLE_DOC'; }); // GOOGLE SHEET ICON EXTENSIONS -['gsheet'].forEach((extension) => { +['gsheet'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_GOOGLE_SHEET'; }); // GOOGLE SLIDE ICON EXTENSIONS -['gslide'].forEach((extension) => { +['gslide'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_GOOGLE_SLIDE'; }); @@ -209,13 +209,13 @@ export const ICON_FILE_MAP = {}; 'swf', 'tga', 'tif', - 'tiff' -].forEach((extension) => { + 'tiff', +].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_IMAGE'; }); // KEYNOTE ICON EXTENSIONS -['key'].forEach((extension) => { +['key'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_KEYNOTE'; }); @@ -237,58 +237,58 @@ export const ICON_FILE_MAP = {}; 'ogg', 'qt', 'ts', - 'wmv' -].forEach((extension) => { + 'wmv', +].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_MEDIA'; }); // NUMBERS ICON EXTENSIONS -['numbers'].forEach((extension) => { +['numbers'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_NUMBERS'; }); // OBJ ICON EXTENSIONS -['3ds', 'box3d', 'dae', 'fbx', 'obj', 'ply', 'stl'].forEach((extension) => { +['3ds', 'box3d', 'dae', 'fbx', 'obj', 'ply', 'stl'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_OBJ'; }); // PAGES ICON EXTENSIONS -['pages'].forEach((extension) => { +['pages'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_PAGES'; }); // PDF ICON EXTENSIONS -['pdf'].forEach((extension) => { +['pdf'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_PDF'; }); // POWERPOINT ICON EXTENSIONS -['ppt', 'pptx'].forEach((extension) => { +['ppt', 'pptx'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_POWERPOINT'; }); // PRESENTATION ICON EXTENSIONS -['odp'].forEach((extension) => { +['odp'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_PRESENTATION'; }); // SPREADSHEET ICON EXTENSIONS -['csv', 'tsv'].forEach((extension) => { +['csv', 'tsv'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_SPREADSHEET'; }); // WORD ICON EXTENSIONS -['doc', 'docx'].forEach((extension) => { +['doc', 'docx'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_WORD'; }); // ZIP ICON EXTENSIONS -['tgz', 'zip'].forEach((extension) => { +['tgz', 'zip'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_ZIP'; }); // AUTOCAD ICON EXTENSIONS -['dwg'].forEach((extension) => { +['dwg'].forEach(extension => { ICON_FILE_MAP[extension] = 'FILE_AUTOCAD'; }); diff --git a/src/lib/lang.js b/src/lib/lang.js index ee4229a29..1f108bb5b 100644 --- a/src/lib/lang.js +++ b/src/lib/lang.js @@ -149,7 +149,7 @@ const languageMap = { uz: __('uzbek'), uzb: __('uzbek'), vi: __('vietnamese'), - vie: __('vietnamese') + vie: __('vietnamese'), }; /** diff --git a/src/lib/loaders.js b/src/lib/loaders.js index e43e0ee00..6f127dedd 100644 --- a/src/lib/loaders.js +++ b/src/lib/loaders.js @@ -20,5 +20,5 @@ export default [ Image360Loader, ImageLoader, Model3DLoader, - IFrameLoader + IFrameLoader, ]; diff --git a/src/lib/logUtils.js b/src/lib/logUtils.js index 4e0ca6b74..864ca214c 100644 --- a/src/lib/logUtils.js +++ b/src/lib/logUtils.js @@ -39,6 +39,6 @@ export function getClientLogDetails() { return { client_version: CLIENT_VERSION, browser_name: Browser.getName(), - logger_session_id: PREVIEW_SESSION_ID + logger_session_id: PREVIEW_SESSION_ID, }; } diff --git a/src/lib/metadataAPI.js b/src/lib/metadataAPI.js index 59d5e2608..56997619a 100644 --- a/src/lib/metadataAPI.js +++ b/src/lib/metadataAPI.js @@ -39,7 +39,7 @@ const metadataAPI = { */ getMetadata(id, scope, template, { apiHost, token, sharedLink, sharedLinkPassword }) { return api.get(metadataAPI.getMetadataURL(id, scope, template, apiHost), { - headers: getHeaders({}, token, sharedLink, sharedLinkPassword) + headers: getHeaders({}, token, sharedLink, sharedLinkPassword), }); }, @@ -53,7 +53,7 @@ const metadataAPI = { */ getMetadataURL(fileId, scope = SCOPE_GLOBAL, template, apiHost) { return `${apiHost}/2.0/files/${fileId}/metadata/${scope}/${template}`; - } + }, }; export default metadataAPI; diff --git a/src/lib/polyfill.js b/src/lib/polyfill.js index e3f37f04e..b48d88d86 100644 --- a/src/lib/polyfill.js +++ b/src/lib/polyfill.js @@ -24,7 +24,7 @@ if (typeof Object.assign != 'function') { } var output = Object(target); - for (var index = 1; index < arguments.length; index++) { + for (var index = 1; index < arguments.length; index += 1) { var source = arguments[index]; if (source !== undefined && source !== null) { for (var nextKey in source) { @@ -83,7 +83,7 @@ if (!Array.prototype.find) { // 7. Return undefined. return undefined; - } + }, }); } @@ -131,7 +131,7 @@ if (!Array.prototype.findIndex) { // 7. Return -1. return -1; - } + }, }); } @@ -185,7 +185,7 @@ if (!Array.prototype.includes) { // 8. Return false return false; - } + }, }); } @@ -207,7 +207,7 @@ if (!String.prototype.endsWith) { position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; - } + }, }); } @@ -253,7 +253,7 @@ Number.isNaN = /* empty */ }, [], - F + F, ) instanceof F ); }); @@ -297,7 +297,7 @@ Number.isNaN = Reflect.construct = construct; } else { Reflect = { - construct + construct, }; } })(); diff --git a/src/lib/shell.html b/src/lib/shell.html index 16c11fdf5..a1ef972aa 100644 --- a/src/lib/shell.html +++ b/src/lib/shell.html @@ -3,31 +3,56 @@
- +
-
@@ -53,14 +78,24 @@
diff --git a/src/lib/tokens.js b/src/lib/tokens.js index de7699e31..8570813f8 100644 --- a/src/lib/tokens.js +++ b/src/lib/tokens.js @@ -25,7 +25,7 @@ function getTypedId(id) { */ function createIdTokenMap(ids, tokenOrTokens) { const tokenMap = {}; - ids.forEach((id) => { + ids.forEach(id => { const typedId = getTypedId(id); if (!tokenOrTokens || typeof tokenOrTokens === 'string') { // All files use the same string or null or undefined token @@ -85,8 +85,8 @@ export default function getTokens(id, token) { // possible item types. Preview only deals with files // so all ids should be prefixed with file_. return new Promise((resolve, reject) => { - const typedIds = ids.map((fileId) => getTypedId(fileId)); - token(typedIds).then((tokens) => { + const typedIds = ids.map(fileId => getTypedId(fileId)); + token(typedIds).then(tokens => { // Resolved tokens can either be a map of { typedId: token } // or it can just be a single string token that applies // to all the files irrespective of their id. diff --git a/src/lib/util.js b/src/lib/util.js index 54acd6af8..87d41ef66 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -196,7 +196,7 @@ export function appendQueryParams(url, queryParams) { } const uri = new Uri(url); - Object.keys(queryParams).forEach((key) => { + Object.keys(queryParams).forEach(key => { const value = queryParams[key]; if (value) { if (uri.hasQueryParam(key)) { @@ -230,7 +230,7 @@ export function appendAuthParams(url, token = '', sharedLink = '', password = '' shared_link: sharedLink, shared_link_password: password, [CLIENT_NAME_KEY]: CLIENT_NAME, - [CLIENT_VERSION_KEY]: CLIENT_VERSION + [CLIENT_VERSION_KEY]: CLIENT_VERSION, }); } @@ -260,7 +260,7 @@ export function createContentUrl(template, asset) { export function createAssetUrlCreator(location) { const { baseURI, staticBaseURI } = location; - return (name) => { + return name => { let asset; if (name.indexOf('http') === 0) { @@ -290,7 +290,7 @@ export function prefetchAssets(urls, preload = false) { const { head } = document; const rel = preload ? 'preload' : 'prefetch'; - urls.forEach((url) => { + urls.forEach(url => { if (!head.querySelector(`link[rel="${rel}"][href="${url}"]`)) { head.appendChild(createPrefetch(url, preload)); } @@ -307,7 +307,7 @@ export function prefetchAssets(urls, preload = false) { export function loadStylesheets(urls) { const { head } = document; - urls.forEach((url) => { + urls.forEach(url => { if (!head.querySelector(`link[rel="stylesheet"][href="${url}"]`)) { head.appendChild(createStylesheet(url)); } @@ -340,14 +340,14 @@ export function loadScripts(urls, disableAMD = false) { define = undefined; } - urls.forEach((url) => { + urls.forEach(url => { if (!head.querySelector(`script[src="${url}"]`)) { const script = createScript(url); promises.push( new Promise((resolve, reject) => { script.addEventListener('load', resolve); script.addEventListener('error', reject); - }) + }), ); head.appendChild(script); } @@ -419,7 +419,7 @@ export function findScriptLocation(name, script) { locale, version, baseURI, - staticBaseURI + staticBaseURI, }; } @@ -439,7 +439,7 @@ export function replacePlaceholders(string, placeholderValues) { return string; } - return string.replace(regex, (match) => { + return string.replace(regex, match => { // extracting the index that is supposed to replace the matched placeholder const placeholderIndex = parseInt(match.replace(/^\D+/g, ''), 10) - 1; @@ -487,7 +487,7 @@ export function setDimensions(element, width, height) { * @return {void} */ export function activationHandler(handler) { - return (event) => { + return event => { if (event.type === 'click') { handler(event); } else if (event.type === 'keydown') { @@ -602,13 +602,13 @@ export function getClosestPageToPinch(x, y, visiblePages) { } let closestPage = null; - for (let i = visiblePages.first.id, closestDistance = null; i <= visiblePages.last.id; i++) { + for (let i = visiblePages.first.id, closestDistance = null; i <= visiblePages.last.id; i += 1) { const page = document.querySelector(`#bp-page-${i}`); const pageMidpoint = getMidpoint( page.offsetLeft, page.offsetTop, page.offsetLeft + page.scrollWidth, - page.offsetTop + page.scrollHeight + page.offsetTop + page.scrollHeight, ); const distance = getDistance(pageMidpoint[0], pageMidpoint[1], x, y); @@ -649,7 +649,7 @@ export function getProp(object, propPath, defaultValue) { let value = object; const path = propPath.split('.'); - for (let i = 0; i < path.length; i++) { + for (let i = 0; i < path.length; i += 1) { // Checks against null or undefined if (value == null) { return defaultValue; diff --git a/src/lib/viewers/AssetLoader.js b/src/lib/viewers/AssetLoader.js index 07356d705..e5e69fb24 100644 --- a/src/lib/viewers/AssetLoader.js +++ b/src/lib/viewers/AssetLoader.js @@ -27,13 +27,13 @@ class AssetLoader { * @return {Object} The viewer to use */ determineViewer(file, disabledViewers = []) { - return this.viewers.find((viewer) => { + return this.viewers.find(viewer => { if (disabledViewers.indexOf(viewer.NAME) > -1) { return false; } return ( viewer.EXT.indexOf(file.extension) > -1 && - file.representations.entries.some((entry) => viewer.REP === entry.representation) + file.representations.entries.some(entry => viewer.REP === entry.representation) ); }); } @@ -48,7 +48,7 @@ class AssetLoader { * @return {Object} The representation to load */ determineRepresentation(file, viewer) { - return file.representations.entries.find((entry) => viewer.REP === entry.representation); + return file.representations.entries.find(entry => viewer.REP === entry.representation); } } diff --git a/src/lib/viewers/BaseViewer.js b/src/lib/viewers/BaseViewer.js index d5ed4d0b3..f8520f78a 100644 --- a/src/lib/viewers/BaseViewer.js +++ b/src/lib/viewers/BaseViewer.js @@ -15,7 +15,7 @@ import { loadScripts, prefetchAssets, createAssetUrlCreator, - replacePlaceholders + replacePlaceholders, } from '../util'; import { ANNOTATOR_EVENT, @@ -29,7 +29,7 @@ import { SELECTOR_BOX_PREVIEW_ICON, SELECTOR_BOX_PREVIEW, STATUS_SUCCESS, - STATUS_VIEWABLE + STATUS_VIEWABLE, } from '../constants'; import { getIconFromExtension, getIconFromName } from '../icons/icons'; import { VIEWER_EVENT, ERROR_CODE, LOAD_METRIC, DOWNLOAD_REACHABILITY_METRICS } from '../events'; @@ -39,7 +39,7 @@ import Timer from '../Timer'; const VIEWER_STATUSES = { error: 'error', loaded: 'loaded', - loading: 'loading' + loading: 'loading', }; const ANNOTATIONS_JS = 'annotations.js'; @@ -52,12 +52,12 @@ const RESIZE_WAIT_TIME_IN_MILLIS = 300; const ANNOTATION_BUTTONS = { point: { title: __('annotation_point_toggle'), - selector: SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_POINT + selector: SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_POINT, }, draw: { title: __('annotation_draw_toggle'), - selector: SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_DRAW - } + selector: SELECTOR_BOX_PREVIEW_BTN_ANNOTATE_DRAW, + }, }; const DEFAULT_FILE_ICON_NAME = 'FILE_DEFAULT'; @@ -196,7 +196,7 @@ class BaseViewer extends EventEmitter { // Creates a promise that the annotator will be constructed if annotations are // enabled and the expiring embed is not a shared link if (this.areAnnotationsEnabled() && !this.options.sharedLink) { - this.annotatorPromise = new Promise((resolve) => { + this.annotatorPromise = new Promise(resolve => { this.annotatorPromiseResolver = resolve; }); } @@ -230,7 +230,7 @@ class BaseViewer extends EventEmitter { */ destroy() { if (this.repStatuses) { - this.repStatuses.forEach((repStatus) => { + this.repStatuses.forEach(repStatus => { repStatus.removeListener('conversionpending', this.resetLoadTimeout); repStatus.destroy(); }); @@ -344,11 +344,11 @@ class BaseViewer extends EventEmitter { } if (DownloadReachability.isCustomDownloadHost(downloadURL)) { - DownloadReachability.setDownloadReachability(downloadURL).then((isBlocked) => { + DownloadReachability.setDownloadReachability(downloadURL).then(isBlocked => { if (isBlocked) { this.emitMetric( DOWNLOAD_REACHABILITY_METRICS.DOWNLOAD_BLOCKED, - DownloadReachability.getHostnameFromUrl(downloadURL) + DownloadReachability.getHostnameFromUrl(downloadURL), ); } }); @@ -495,12 +495,12 @@ class BaseViewer extends EventEmitter { this.previewUI.notification.show( replacePlaceholders(__('notification_degraded_preview'), [downloadHostToNotify]), null, - true + true, ); DownloadReachability.setDownloadHostNotificationShown(downloadHostToNotify); this.emitMetric(DOWNLOAD_REACHABILITY_METRICS.NOTIFICATION_SHOWN, { - host: downloadHostToNotify + host: downloadHostToNotify, }); } @@ -562,7 +562,7 @@ class BaseViewer extends EventEmitter { resize() { this.emit('resize', { width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight + height: document.documentElement.clientHeight, }); } @@ -594,7 +594,7 @@ class BaseViewer extends EventEmitter { event, data, viewerName: viewer ? viewer.NAME : '', - fileId: file.id + fileId: file.id, }); } @@ -619,7 +619,7 @@ class BaseViewer extends EventEmitter { super.emit(VIEWER_EVENT.metric, { event, - data + data, }); } @@ -649,9 +649,9 @@ class BaseViewer extends EventEmitter { this._pinchScale = { initial: { 0: [event.touches[0].clientX, event.touches[0].clientY], - 1: [event.touches[1].clientX, event.touches[1].clientY] + 1: [event.touches[1].clientX, event.touches[1].clientY], }, - end: {} + end: {}, }; this._scaling = true; event.preventDefault(); @@ -676,7 +676,7 @@ class BaseViewer extends EventEmitter { } this._pinchScale.end = { 0: [event.touches[0].clientX, event.touches[0].clientY], - 1: [event.touches[1].clientX, event.touches[1].clientY] + 1: [event.touches[1].clientX, event.touches[1].clientY], }; } @@ -698,13 +698,13 @@ class BaseViewer extends EventEmitter { (this._pinchScale.initial[0][0] - this._pinchScale.initial[1][0]) * (this._pinchScale.initial[0][0] - this._pinchScale.initial[1][0]) + (this._pinchScale.initial[0][1] - this._pinchScale.initial[1][1]) * - (this._pinchScale.initial[0][1] - this._pinchScale.initial[1][1]) + (this._pinchScale.initial[0][1] - this._pinchScale.initial[1][1]), ); const finalDistance = Math.sqrt( (this._pinchScale.end[0][0] - this._pinchScale.end[1][0]) * (this._pinchScale.end[0][0] - this._pinchScale.end[1][0]) + (this._pinchScale.end[0][1] - this._pinchScale.end[1][1]) * - (this._pinchScale.end[0][1] - this._pinchScale.end[1][1]) + (this._pinchScale.end[0][1] - this._pinchScale.end[1][1]), ); zoomScale = finalDistance - initialDistance; } @@ -794,7 +794,7 @@ class BaseViewer extends EventEmitter { sharedLink, sharedLinkPassword, fileId: file.id, - logger: representation ? null : logger // Do not log to main preview status if rep is passed in + logger: representation ? null : logger, // Do not log to main preview status if rep is passed in }); // Don't time out while conversion is pending @@ -922,7 +922,7 @@ class BaseViewer extends EventEmitter { const annotatorOptions = this.createAnnotatorOptions({ annotator: this.annotatorConf, - modeButtons: ANNOTATION_BUTTONS + modeButtons: ANNOTATION_BUTTONS, }); this.annotator = new this.annotatorConf.CONSTRUCTOR(annotatorOptions); @@ -946,15 +946,15 @@ class BaseViewer extends EventEmitter { // Add a custom listener for entering/exit annotations mode using the app's // custom annotations buttons - this.addListener('toggleannotationmode', (data) => this.annotator.toggleAnnotationMode(data)); + this.addListener('toggleannotationmode', data => this.annotator.toggleAnnotationMode(data)); // Add a custom listener for events related to scaling/orientation changes - this.addListener('scale', (data) => { + this.addListener('scale', data => { this.annotator.emit(ANNOTATOR_EVENT.scale, data); }); // Add a custom listener to scroll to the specified annotation - this.addListener('scrolltoannotation', (data) => this.annotator.scrollToAnnotation(data)); + this.addListener('scrolltoannotation', data => this.annotator.scrollToAnnotation(data)); // Add a custom listener for events emmited by the annotator this.annotator.addListener('annotatorevent', this.handleAnnotatorEvents); @@ -999,7 +999,7 @@ class BaseViewer extends EventEmitter { const { boxAnnotations, viewer } = this.options; const annotatorConfig = boxAnnotations.viewerOptions[viewer.NAME]; this.viewerConfig = { - enabled: annotatorConfig && (annotatorConfig.enabled || annotatorConfig.enabledTypes.length > 0) + enabled: annotatorConfig && (annotatorConfig.enabled || annotatorConfig.enabledTypes.length > 0), }; } else { this.viewerConfig = this.getViewerAnnotationsConfig(); @@ -1027,7 +1027,7 @@ class BaseViewer extends EventEmitter { // Backwards compatability for old boolean flag usage if (typeof config === 'boolean') { return { - enabled: config + enabled: config, }; } return config; @@ -1069,7 +1069,7 @@ class BaseViewer extends EventEmitter { case ANNOTATOR_EVENT.fetch: this.emit('scale', { scale: this.scale, - rotationAngle: this.rotationAngle + rotationAngle: this.rotationAngle, }); break; default: @@ -1114,7 +1114,7 @@ class BaseViewer extends EventEmitter { drawToggle: __('annotation_draw_toggle'), drawSave: __('annotation_draw_save'), drawDelete: __('annotation_draw_delete'), - whoDrew: __('annotation_who_drew') + whoDrew: __('annotation_who_drew'), }; return cloneDeep( @@ -1122,8 +1122,8 @@ class BaseViewer extends EventEmitter { isMobile: this.isMobile, hasTouch: this.hasTouch, locale: this.options.location.locale, - localizedStrings - }) + localizedStrings, + }), ); } diff --git a/src/lib/viewers/__tests__/AssetLoader-test.js b/src/lib/viewers/__tests__/AssetLoader-test.js index ea921e2bc..20b60b87e 100644 --- a/src/lib/viewers/__tests__/AssetLoader-test.js +++ b/src/lib/viewers/__tests__/AssetLoader-test.js @@ -27,7 +27,7 @@ describe('lib/viewers/AssetLoader', () => { expect(loader.determineViewer).to.be.called; }); - it('should return false if loader can\'t find a viewer to match the file', () => { + it("should return false if loader can't find a viewer to match the file", () => { sandbox.stub(loader, 'determineViewer').returns(null); expect(loader.canLoad({})).to.be.false; @@ -36,13 +36,13 @@ describe('lib/viewers/AssetLoader', () => { }); describe('getViewers()', () => { - it('should return the loader\'s viewers', () => { + it("should return the loader's viewers", () => { loader.viewers = [{}, {}]; expect(loader.getViewers()).to.deep.equal(loader.viewers); }); - it('should return an empty array if the loader doesn\'t have viewers', () => { + it("should return an empty array if the loader doesn't have viewers", () => { expect(loader.getViewers()).to.deep.equal([]); }); }); @@ -53,18 +53,18 @@ describe('lib/viewers/AssetLoader', () => { { NAME: 'Adobe', REP: 'pdf', - EXT: ['pdf'] + EXT: ['pdf'], }, { NAME: 'Document', REP: 'ORIGINAL', - EXT: ['pdf'] + EXT: ['pdf'], }, { NAME: 'SomeOtherPDFViewer', REP: 'pdf', - EXT: ['pdf'] - } + EXT: ['pdf'], + }, ]; }); @@ -74,10 +74,10 @@ describe('lib/viewers/AssetLoader', () => { representations: { entries: [ { - representation: 'pdf' - } - ] - } + representation: 'pdf', + }, + ], + }, }; const viewer = loader.determineViewer(file); @@ -90,13 +90,13 @@ describe('lib/viewers/AssetLoader', () => { representations: { entries: [ { - representation: 'ORIGINAL' + representation: 'ORIGINAL', }, { - representation: 'pdf' - } - ] - } + representation: 'pdf', + }, + ], + }, }; const viewer = loader.determineViewer(file, ['Adobe']); @@ -109,13 +109,13 @@ describe('lib/viewers/AssetLoader', () => { representations: { entries: [ { - representation: 'ORIGINAL' + representation: 'ORIGINAL', }, { - representation: 'mp3' - } - ] - } + representation: 'mp3', + }, + ], + }, }; const viewer = loader.determineViewer(file, ['Adobe']); @@ -128,18 +128,18 @@ describe('lib/viewers/AssetLoader', () => { representations: { entries: [ { - representation: 'ORIGINAL' + representation: 'ORIGINAL', }, { - representation: 'pdf' - } - ] - } + representation: 'pdf', + }, + ], + }, }; it('should return a representation based on the file and viewer', () => { const viewer = { - REP: 'pdf' + REP: 'pdf', }; const representation = loader.determineRepresentation(file, viewer); @@ -148,7 +148,7 @@ describe('lib/viewers/AssetLoader', () => { it('should not return a representation if there is no match', () => { const viewer = { - REP: 'xlsx' + REP: 'xlsx', }; const representation = loader.determineRepresentation(file, viewer); diff --git a/src/lib/viewers/__tests__/BaseViewer-test.js b/src/lib/viewers/__tests__/BaseViewer-test.js index 1ad42350b..84f118c71 100644 --- a/src/lib/viewers/__tests__/BaseViewer-test.js +++ b/src/lib/viewers/__tests__/BaseViewer-test.js @@ -21,7 +21,7 @@ const ANNOTATOR_EVENT = { modeExit: 'annotationmodeexit', fetch: 'annotationsfetched', error: 'annotationerror', - scale: 'scaleannotations' + scale: 'scaleannotations', }; describe('lib/viewers/BaseViewer', () => { @@ -39,16 +39,16 @@ describe('lib/viewers/BaseViewer', () => { file: { id: '0', permissions: { - can_annotate: false - } - } + can_annotate: false, + }, + }, }); base.previewUI = { replaceHeader: sandbox.stub(), notification: { show: sandbox.stub(), - hide: sandbox.stub() - } + hide: sandbox.stub(), + }, }; }); @@ -76,10 +76,10 @@ describe('lib/viewers/BaseViewer', () => { file: { id: '0', permissions: { - can_annotate: false - } + can_annotate: false, + }, }, - showAnnotations: true + showAnnotations: true, }); expect(base.containerEl).to.have.class(constants.CLASS_BOX_PREVIEW_CONTENT); @@ -131,10 +131,10 @@ describe('lib/viewers/BaseViewer', () => { it('should hide the crawler and set the file icon into the icon element', () => { const container = { classList: { - add: sandbox.stub() + add: sandbox.stub(), }, innerHTML: '', - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; base.fileLoadingIcon = 'icon'; @@ -180,7 +180,7 @@ describe('lib/viewers/BaseViewer', () => { it('should trigger an error if the viewer times out', () => { const triggerStub = sandbox.stub(base, 'triggerError'); - sandbox.stub(window, 'setTimeout').callsFake((func) => func()); + sandbox.stub(window, 'setTimeout').callsFake(func => func()); base.loaded = false; base.destroyed = false; @@ -253,10 +253,10 @@ describe('lib/viewers/BaseViewer', () => { base.handleDownloadError( { details: { - isRepDeleted: true - } + isRepDeleted: true, + }, }, - 'https://dl.boxcloud.com' + 'https://dl.boxcloud.com', ); expect(base.triggerError).to.be.called; @@ -312,7 +312,7 @@ describe('lib/viewers/BaseViewer', () => { const displayMessage = 'Such a special error!'; const message = 'Bad things have happened'; const details = { - what: 'what?!' + what: 'what?!', }; const err = new PreviewError(code, displayMessage, details, message); const stub = sandbox.stub(base, 'emit'); @@ -354,8 +354,8 @@ describe('lib/viewers/BaseViewer', () => { sharedLinkPassword, container: containerEl, file: { - id: '0' - } + id: '0', + }, }); sandbox.stub(util, 'appendAuthParams').returns(url); @@ -382,8 +382,8 @@ describe('lib/viewers/BaseViewer', () => { viewer: { ASSET: 'foo' }, container: containerEl, file: { - id: '0' - } + id: '0', + }, }); sandbox.spy(util, 'createContentUrl'); @@ -426,8 +426,8 @@ describe('lib/viewers/BaseViewer', () => { sharedLinkPassword, container: containerEl, file: { - id: '0' - } + id: '0', + }, }); sandbox.stub(util, 'getHeaders').returns(headers); @@ -456,12 +456,12 @@ describe('lib/viewers/BaseViewer', () => { it('should prevent the context menu if preview only permissions', () => { base.options.file.permissions = { - can_download: false + can_download: false, }; base.containerEl = { addEventListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; base.addCommonListeners(); @@ -479,8 +479,8 @@ describe('lib/viewers/BaseViewer', () => { beforeEach(() => { base.options.representation = { content: { - url_template: 'dl.boxcloud.com' - } + url_template: 'dl.boxcloud.com', + }, }; stubs.getDownloadNotificationToShow = sandbox .stub(DownloadReachability, 'getDownloadNotificationToShow') @@ -502,8 +502,8 @@ describe('lib/viewers/BaseViewer', () => { expect(base.scale).to.equal(1.5); }); - it('should show annotations if annotatorPromise exists', (done) => { - base.annotatorPromise = new Promise((resolve) => { + it('should show annotations if annotatorPromise exists', done => { + base.annotatorPromise = new Promise(resolve => { resolve(); done(); }); @@ -567,12 +567,12 @@ describe('lib/viewers/BaseViewer', () => { base.repStatuses = [ { removeListener: removeListenerMock, - destroy: destroyMock + destroy: destroyMock, }, { removeListener: removeListenerMock, - destroy: destroyMock - } + destroy: destroyMock, + }, ]; base.destroy(); @@ -599,7 +599,7 @@ describe('lib/viewers/BaseViewer', () => { it('should clean up annotator', () => { base.annotator = { removeAllListeners: sandbox.mock(), - destroy: sandbox.mock() + destroy: sandbox.mock(), }; base.destroy(); expect(base.annotator.removeAllListeners).to.be.called; @@ -610,7 +610,7 @@ describe('lib/viewers/BaseViewer', () => { base.preventDefault = sandbox.stub(); base.containerEl = { addEventListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; base.destroy(); @@ -635,9 +635,9 @@ describe('lib/viewers/BaseViewer', () => { base = new BaseViewer({ viewer: { NAME: viewerName }, file: { - id: fileId + id: fileId, }, - container: containerEl + container: containerEl, }); const emitStub = sandbox.stub(); @@ -650,7 +650,7 @@ describe('lib/viewers/BaseViewer', () => { event, data, viewerName, - fileId + fileId, }); }); }); @@ -662,8 +662,8 @@ describe('lib/viewers/BaseViewer', () => { base = new BaseViewer({ container: containerEl, file: { - id: '123' - } + id: '123', + }, }); sandbox.stub(base, 'loadAssets').returns(Promise.resolve()); sandbox.stub(base, 'areAnnotationsEnabled').returns(false); @@ -673,7 +673,7 @@ describe('lib/viewers/BaseViewer', () => { event = { preventDefault: sandbox.stub(), stopPropagation: sandbox.stub(), - touches: [0, 0] + touches: [0, 0], }; stubs.isIOS = sandbox.stub(Browser, 'isIOS'); stubs.sqrt = sandbox.stub(Math, 'sqrt'); @@ -779,12 +779,12 @@ describe('lib/viewers/BaseViewer', () => { event.touches = [ { clientX: 0, - clientY: 0 + clientY: 0, }, { clientX: 0, - clientY: 0 - } + clientY: 0, + }, ]; base.mobileZoomChangeHandler(event); @@ -806,12 +806,12 @@ describe('lib/viewers/BaseViewer', () => { event.touches = [ { clientX: 0, - clientY: 0 + clientY: 0, }, { clientX: 0, - clientY: 0 - } + clientY: 0, + }, ]; base.mobileZoomChangeHandler(event); @@ -829,8 +829,8 @@ describe('lib/viewers/BaseViewer', () => { const baz = 'captain-america'; base.options.viewers = { Base: { - fooBar: baz - } + fooBar: baz, + }, }; base.options.viewer = { NAME: 'Base' }; @@ -850,7 +850,7 @@ describe('lib/viewers/BaseViewer', () => { sandbox.stub(base, 'emit'); base.options.location = {}; base.options.viewer = { - pauseRequireJS: true + pauseRequireJS: true, }; }); @@ -902,22 +902,22 @@ describe('lib/viewers/BaseViewer', () => { beforeEach(() => { base.options.representation = { info: { - url: 'someurl' - } + url: 'someurl', + }, }; }); it('should create a new rep status, save, and return it', () => { const repStatus = base.getRepStatus(); - expect(base.repStatuses.find((status) => status === repStatus)).to.not.be.undefined; + expect(base.repStatuses.find(status => status === repStatus)).to.not.be.undefined; expect(repStatus).to.be.instanceof(RepStatus); }); it('should use the passed in representation', () => { const representation = { info: { - url: 'someOtherUrl' - } + url: 'someOtherUrl', + }, }; const repStatus = base.getRepStatus(representation); expect(repStatus.representation).to.equal(representation); @@ -931,7 +931,7 @@ describe('lib/viewers/BaseViewer', () => { base.loaded = true; base.options.viewer = { - NAME: 'Error' + NAME: 'Error', }; expect(base.getLoadStatus()).to.equal('error'); @@ -945,8 +945,8 @@ describe('lib/viewers/BaseViewer', () => { it('should return whether the representation has a successful status', () => { const representation = { status: { - state: 'success' - } + state: 'success', + }, }; expect(base.isRepresentationReady(representation)).to.be.true; @@ -961,7 +961,7 @@ describe('lib/viewers/BaseViewer', () => { describe('disableViewerControls()', () => { it('should disable viewer controls', () => { base.controls = { - disable: sandbox.stub() + disable: sandbox.stub(), }; base.disableViewerControls(); expect(base.controls.disable).to.be.called; @@ -971,7 +971,7 @@ describe('lib/viewers/BaseViewer', () => { describe('enableViewerControls()', () => { it('should enable viewer controls', () => { base.controls = { - enable: sandbox.stub() + enable: sandbox.stub(), }; base.enableViewerControls(); expect(base.controls.enable).to.be.called; @@ -988,7 +988,7 @@ describe('lib/viewers/BaseViewer', () => { describe('getAssetPath()', () => { it('should return the asset path the viewer is/will use for preview representation content', () => { base.options.viewer = { - ASSET: '1.jpg' + ASSET: '1.jpg', }; expect(base.getAssetPath()).to.equal(base.options.viewer.ASSET); }); @@ -1004,8 +1004,8 @@ describe('lib/viewers/BaseViewer', () => { annotationsEnabled: true, types: { point: true, - highlight: false - } + highlight: false, + }, }; beforeEach(() => { @@ -1041,9 +1041,9 @@ describe('lib/viewers/BaseViewer', () => { annotationsEnabled: true, types: { point: true, - highlight: false + highlight: false, }, - CONSTRUCTOR: sandbox.stub().returns(annotatorMock) + CONSTRUCTOR: sandbox.stub().returns(annotatorMock), }; beforeEach(() => { @@ -1076,7 +1076,7 @@ describe('lib/viewers/BaseViewer', () => { it('should not instantiate an instance of BoxAnnotations if one is already passed in', () => { sandbox.stub(base, 'areAnnotationsEnabled').returns(true); base.options.boxAnnotations = { - determineAnnotator: sandbox.stub().returns(conf) + determineAnnotator: sandbox.stub().returns(conf), }; base.createAnnotator(); expect(base.options.boxAnnotations.determineAnnotator).to.be.called; @@ -1089,20 +1089,20 @@ describe('lib/viewers/BaseViewer', () => { container: document, file: { file_version: { - id: 123 - } + id: 123, + }, }, location: { - locale: 'en-US' - } + locale: 'en-US', + }, }; base.scale = 1.5; base.annotator = { init: sandbox.stub(), - addListener: sandbox.stub() + addListener: sandbox.stub(), }; base.annotatorConf = { - CONSTRUCTOR: sandbox.stub().returns(base.annotator) + CONSTRUCTOR: sandbox.stub().returns(base.annotator), }; }); @@ -1132,7 +1132,7 @@ describe('lib/viewers/BaseViewer', () => { const permissions = { can_annotate: false, can_view_annotations_all: false, - can_view_annotations_self: false + can_view_annotations_self: false, }; it('does nothing if file permissions are undefined', () => { @@ -1164,8 +1164,8 @@ describe('lib/viewers/BaseViewer', () => { stubs.hasPermissions = sandbox.stub(base, 'hasAnnotationPermissions').returns(true); base.options.file = { permissions: { - can_annotate: true - } + can_annotate: true, + }, }; }); @@ -1207,19 +1207,19 @@ describe('lib/viewers/BaseViewer', () => { // All default types enabled boxAnnotations.viewerOptions = { - viewerName: { enabled: true } + viewerName: { enabled: true }, }; expect(base.areAnnotationsEnabled()).to.be.true; // No specified enabled types boxAnnotations.viewerOptions = { - viewerName: { enabledTypes: [] } + viewerName: { enabledTypes: [] }, }; expect(base.areAnnotationsEnabled()).to.be.false; // Specified types enabled boxAnnotations.viewerOptions = { - viewerName: { enabledTypes: ['point'] } + viewerName: { enabledTypes: ['point'] }, }; expect(base.areAnnotationsEnabled()).to.be.true; @@ -1245,7 +1245,7 @@ describe('lib/viewers/BaseViewer', () => { it('should pass through the annotations object if an object', () => { const annConfig = { enabled: true, - disabledTypes: ['drawing'] + disabledTypes: ['drawing'], }; sandbox.stub(base, 'getViewerOption').returns(annConfig); const config = base.getViewerAnnotationsConfig(); @@ -1260,7 +1260,7 @@ describe('lib/viewers/BaseViewer', () => { beforeEach(() => { sandbox.stub(base, 'emit'); base.annotator = { - isInAnnotationMode: sandbox.stub() + isInAnnotationMode: sandbox.stub(), }; sandbox.stub(base, 'disableViewerControls'); sandbox.stub(base, 'enableViewerControls'); @@ -1269,7 +1269,7 @@ describe('lib/viewers/BaseViewer', () => { it('should disable controls and show point mode notification on annotationmodeenter', () => { const data = { event: ANNOTATOR_EVENT.modeEnter, - data: { mode: ANNOTATION_TYPE_POINT } + data: { mode: ANNOTATION_TYPE_POINT }, }; base.handleAnnotatorEvents(data); expect(base.disableViewerControls).to.be.called; @@ -1283,8 +1283,8 @@ describe('lib/viewers/BaseViewer', () => { event: ANNOTATOR_EVENT.modeEnter, data: { mode: ANNOTATION_TYPE_DRAW, - headerSelector: '.bp-header' - } + headerSelector: '.bp-header', + }, }; base.handleAnnotatorEvents(data); expect(base.disableViewerControls).to.be.called; @@ -1297,8 +1297,8 @@ describe('lib/viewers/BaseViewer', () => { const data = { event: ANNOTATOR_EVENT.modeExit, data: { - mode: ANNOTATION_TYPE_DRAW - } + mode: ANNOTATION_TYPE_DRAW, + }, }; base.handleAnnotatorEvents(data); expect(base.enableViewerControls).to.be.called; @@ -1311,8 +1311,8 @@ describe('lib/viewers/BaseViewer', () => { const data = { event: ANNOTATOR_EVENT.modeExit, data: { - mode: ANNOTATION_TYPE_DRAW - } + mode: ANNOTATION_TYPE_DRAW, + }, }; base.handleAnnotatorEvents(data); expect(base.enableViewerControls).to.be.called; @@ -1324,7 +1324,7 @@ describe('lib/viewers/BaseViewer', () => { it('should show a notification on annotationerror', () => { const data = { event: ANNOTATOR_EVENT.error, - data: 'message' + data: 'message', }; base.handleAnnotatorEvents(data); expect(base.previewUI.notification.show).to.be.called; @@ -1336,12 +1336,12 @@ describe('lib/viewers/BaseViewer', () => { base.scale = 1; base.rotationAngle = 90; const data = { - event: ANNOTATOR_EVENT.fetch + event: ANNOTATOR_EVENT.fetch, }; base.handleAnnotatorEvents(data); expect(base.emit).to.be.calledWith('scale', { scale: base.scale, - rotationAngle: base.rotationAngle + rotationAngle: base.rotationAngle, }); expect(base.emit).to.be.calledWith(data.event, data.data); expect(base.emit).to.be.calledWith('annotatorevent', data); @@ -1350,7 +1350,7 @@ describe('lib/viewers/BaseViewer', () => { it('should only emit annotatorevent when event does not match', () => { const data = { event: 'no match', - data: 'message' + data: 'message', }; base.handleAnnotatorEvents(data); expect(base.disableViewerControls).to.not.be.called; @@ -1358,7 +1358,7 @@ describe('lib/viewers/BaseViewer', () => { expect(base.emit).to.not.be.calledWith(VIEWER_EVENT.notificationShow, data.data); expect(base.emit).to.not.be.calledWith('scale', { scale: base.scale, - rotationAngle: base.rotationAngle + rotationAngle: base.rotationAngle, }); expect(base.emit).to.be.calledWith(data.event, data.data); expect(base.emit).to.be.calledWith('annotatorevent', data); @@ -1369,7 +1369,7 @@ describe('lib/viewers/BaseViewer', () => { it('should return combined options to give to the annotator', () => { base.options = { file: { id: 1 }, - location: { locale: 'en-US' } + location: { locale: 'en-US' }, }; base.isMobile = true; base.hasTouch = false; @@ -1386,13 +1386,13 @@ describe('lib/viewers/BaseViewer', () => { }); describe('handleAssetAndRepLoad()', () => { - it('should load annotations and create the annotator', (done) => { + it('should load annotations and create the annotator', done => { sandbox.stub(base, 'loadBoxAnnotations').returns(Promise.resolve()); sandbox.stub(base, 'createAnnotator').returns( - new Promise((resolve) => { + new Promise(resolve => { resolve(); done(); - }) + }), ); base.handleAssetAndRepLoad(); diff --git a/src/lib/viewers/box3d/Box3DControls.js b/src/lib/viewers/box3d/Box3DControls.js index a8e81f27e..0bc81b21f 100644 --- a/src/lib/viewers/box3d/Box3DControls.js +++ b/src/lib/viewers/box3d/Box3DControls.js @@ -66,13 +66,13 @@ class Box3DControls extends EventEmitter { __('enter_fullscreen'), this.handleToggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add( __('exit_fullscreen'), this.handleToggleFullscreen, 'bp-exit-fullscreen-icon', - ICON_FULLSCREEN_OUT + ICON_FULLSCREEN_OUT, ); } diff --git a/src/lib/viewers/box3d/Box3DRenderer.js b/src/lib/viewers/box3d/Box3DRenderer.js index 3066ab6ce..2a1b02218 100644 --- a/src/lib/viewers/box3d/Box3DRenderer.js +++ b/src/lib/viewers/box3d/Box3DRenderer.js @@ -6,7 +6,7 @@ import { EVENT_SHOW_VR_BUTTON, EVENT_SCENE_LOADED, EVENT_WEBGL_CONTEXT_RESTORED, - EVENT_WEBGL_CONTEXT_LOST + EVENT_WEBGL_CONTEXT_LOST, } from './box3DConstants'; import { MODEL3D_STATIC_ASSETS_VERSION } from '../../constants'; @@ -142,7 +142,7 @@ class Box3DRenderer extends EventEmitter { this.savedCameraQuaternion.x, this.savedCameraQuaternion.y, this.savedCameraQuaternion.z, - this.savedCameraQuaternion.w + this.savedCameraQuaternion.w, ); } } @@ -238,8 +238,8 @@ class Box3DRenderer extends EventEmitter { getApplication = this.getEntitiesFromUrl(json); } - return getApplication.then((applicationEntities) => - this.createBox3d(resourceLoader, options.sceneEntities, applicationEntities.entities, `${options.apiHost}`) + return getApplication.then(applicationEntities => + this.createBox3d(resourceLoader, options.sceneEntities, applicationEntities.entities, `${options.apiHost}`), ); } @@ -257,14 +257,14 @@ class Box3DRenderer extends EventEmitter { container: this.containerEl, engineName: 'Default', resourceLoader, - apiBase + apiBase, }); if (box3d.canvas) { box3d.canvas.addEventListener('webglcontextlost', this.handleContextLost); box3d.canvas.addEventListener('webglcontextrestored', this.handleContextRestored); } - return new Promise((resolve) => { + return new Promise(resolve => { if (applicationEntities) { box3d.addEntities(applicationEntities); } @@ -447,7 +447,7 @@ class Box3DRenderer extends EventEmitter { return; } - vrPresenter.whenDisplaysAvailable((displays) => { + vrPresenter.whenDisplaysAvailable(displays => { if (displays.length) { this.emit(EVENT_SHOW_VR_BUTTON); this.box3d.listenTo(this.box3d, 'vrRenderingDisabled', this.onDisableVr.bind(this)); @@ -468,8 +468,8 @@ class Box3DRenderer extends EventEmitter { return; } - this.vrGamepads = [Box3D.Handedness.Left, Box3D.Handedness.Right].map((handedness) => - this.createVrGamepad(handedness) + this.vrGamepads = [Box3D.Handedness.Left, Box3D.Handedness.Right].map(handedness => + this.createVrGamepad(handedness), ); } @@ -487,8 +487,8 @@ class Box3DRenderer extends EventEmitter { * @param {Object} entities - Loaded entities * @return {void} */ - const onGamepadModelLoad = (entities) => { - const prefab = entities.find((e) => { + const onGamepadModelLoad = entities => { + const prefab = entities.find(e => { return e.type === 'prefab'; }); const prefabAsset = this.box3d.getAssetById(prefab.id); @@ -506,7 +506,7 @@ class Box3DRenderer extends EventEmitter { * @param {Object} gamepad - Gamepad object * @return {void} */ - const onGamepadFound = (gamepad) => { + const onGamepadFound = gamepad => { let controllerName = null; let commonEntities = null; if (gamepad.id.indexOf('Oculus') > -1) { @@ -527,10 +527,8 @@ class Box3DRenderer extends EventEmitter { if (!this.vrCommonLoadPromise) { if (commonEntities) { this.vrCommonLoadPromise = this.box3d.importEntitiesFromUrl( - `${ - this.staticBaseURI - }third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${commonEntities}/entities.json`, - { isExternal: true } + `${this.staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${commonEntities}/entities.json`, + { isExternal: true }, ); } else { this.vrCommonLoadPromise = Promise.resolve(); @@ -539,10 +537,8 @@ class Box3DRenderer extends EventEmitter { if (!this.vrGamepadLoadPromises[controllerName]) { this.vrGamepadLoadPromises[controllerName] = this.vrCommonLoadPromise.then(() => { return this.box3d.importEntitiesFromUrl( - `${ - this.staticBaseURI - }third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${controllerName}/entities.json`, - { isExternal: true } + `${this.staticBaseURI}third-party/model3d/${MODEL3D_STATIC_ASSETS_VERSION}/WebVR/${controllerName}/entities.json`, + { isExternal: true }, ); }); } @@ -562,7 +558,7 @@ class Box3DRenderer extends EventEmitter { * @return {void} */ showVrGamepads() { - this.vrGamepads.forEach((pad) => pad.setProperty('visible', true)); + this.vrGamepads.forEach(pad => pad.setProperty('visible', true)); } /** @@ -570,7 +566,7 @@ class Box3DRenderer extends EventEmitter { * @return {void} */ hideVrGamepads() { - this.vrGamepads.forEach((pad) => pad.setProperty('visible', false)); + this.vrGamepads.forEach(pad => pad.setProperty('visible', false)); } } diff --git a/src/lib/viewers/box3d/Box3DUIUtils.js b/src/lib/viewers/box3d/Box3DUIUtils.js index f7eba3cf0..5613dc71f 100644 --- a/src/lib/viewers/box3d/Box3DUIUtils.js +++ b/src/lib/viewers/box3d/Box3DUIUtils.js @@ -3,7 +3,7 @@ import { CSS_CLASS_PULLUP, CSS_CLASS_SETTINGS_PANEL_LABEL, CSS_CLASS_SETTINGS_PANEL_ROW, - CSS_CLASS_HIDDEN + CSS_CLASS_HIDDEN, } from './model3d/model3DConstants'; import { @@ -13,7 +13,7 @@ import { CLASS_BOX_PREVIEW_OVERLAY, CLASS_BOX_PREVIEW_OVERLAY_WRAPPER, CLASS_BOX_PREVIEW_TOGGLE_OVERLAY, - CLASS_IS_VISIBLE + CLASS_IS_VISIBLE, } from '../../constants'; /** @@ -119,7 +119,7 @@ function createDropdown(labelText = '', listText = '', listContent = []) { const listEl = overlayWrapperEl.querySelector('ul'); // Create list items - listContent.forEach((entry) => { + listContent.forEach(entry => { const li = document.createElement('li'); const labelEl = document.createElement('a'); labelEl.classList.add(CLASS_BOX_PREVIEW_LINK); @@ -172,7 +172,7 @@ class UIRegistry { this.registry[uniqueId] = { el: element, uuid: uniqueId, - events: {} + events: {}, }; } @@ -206,8 +206,8 @@ class UIRegistry { uiItem.el.parentElement.removeChild(uiItem.el); } - Object.keys(uiItem.events).forEach((eventName) => { - uiItem.events[eventName].forEach((callback) => { + Object.keys(uiItem.events).forEach(eventName => { + uiItem.events[eventName].forEach(callback => { uiItem.el.removeEventListener(eventName, callback); }); delete uiItem.events[eventName]; @@ -223,7 +223,7 @@ class UIRegistry { * @return {void} */ unregisterAll() { - Object.keys(this.registry).forEach((uiItem) => { + Object.keys(this.registry).forEach(uiItem => { this.unregisterItem(this.registry[uiItem]); }); } diff --git a/src/lib/viewers/box3d/Box3DViewer.js b/src/lib/viewers/box3d/Box3DViewer.js index 11b367f7a..7e779e335 100644 --- a/src/lib/viewers/box3d/Box3DViewer.js +++ b/src/lib/viewers/box3d/Box3DViewer.js @@ -14,7 +14,7 @@ import { EVENT_TOGGLE_FULLSCREEN, EVENT_TOGGLE_VR, EVENT_WEBGL_CONTEXT_RESTORED, - EVENT_WEBGL_CONTEXT_LOST + EVENT_WEBGL_CONTEXT_LOST, } from './box3DConstants'; import JS from './box3DAssets'; import './Box3D.scss'; @@ -201,7 +201,7 @@ class Box3DViewer extends BaseViewer { this.boxSdk = new BoxSDK({ token, sharedLink, - apiBase: apiHost + apiBase: apiHost, }); this.createSubModules(); this.attachEventHandlers(); @@ -226,7 +226,7 @@ class Box3DViewer extends BaseViewer { const template = representation.content.url_template; api.get(this.createContentUrl(template, 'entities.json'), { headers: this.appendAuthHeader(), - type: 'document' + type: 'document', }); } } diff --git a/src/lib/viewers/box3d/SceneEntities.js b/src/lib/viewers/box3d/SceneEntities.js index 6ac70ce6e..1e44454eb 100644 --- a/src/lib/viewers/box3d/SceneEntities.js +++ b/src/lib/viewers/box3d/SceneEntities.js @@ -12,14 +12,14 @@ function sceneEntities() { parentId: 'SCENE_ID', properties: { near: 0.01, // Camera near-plane distance - far: 100 + far: 100, }, components: [ // The render view controls how the scene is rendered: regular, UV-only, normal-only, etc. { name: 'Render View', enabled: true, - scriptId: 'vr_render_view' + scriptId: 'vr_render_view', }, // An orbit controller for rotating around the 3D model, made for preview { @@ -28,23 +28,23 @@ function sceneEntities() { orbitDistanceMin: 0.02, // Minimum camera distance orbitDistanceMax: 3, // Maximum camera distance useKeyboard: false, - enablePan: true + enablePan: true, }, enabled: true, - scriptId: 'orbit_camera' + scriptId: 'orbit_camera', }, { name: 'VR Camera Controller', enabled: true, - scriptId: 'vr_camera_controller' - } - ] + scriptId: 'vr_camera_controller', + }, + ], }, { id: 'SCENE_ID', type: 'scene', // The scene contains the lights and camera - children: ['CAMERA_ID', 'AMBIENT_LIGHT_ID'] + children: ['CAMERA_ID', 'AMBIENT_LIGHT_ID'], }, { id: 'AMBIENT_LIGHT_ID', @@ -52,14 +52,14 @@ function sceneEntities() { parentId: 'SCENE_ID', properties: { lightType: 'ambient', - color: { r: 0.0, g: 0.0, b: 0.0 } - } + color: { r: 0.0, g: 0.0, b: 0.0 }, + }, }, { id: 'APP_ASSET_ID', type: 'application', properties: { - startupSceneId: 'SCENE_ID' // The scene to load + startupSceneId: 'SCENE_ID', // The scene to load }, components: [ { @@ -71,10 +71,10 @@ function sceneEntities() { preserveDrawingBuffer: false, precision: Browser.isMobile() ? 'highp' : 'mediump', clearAlpha: 1.0, - clearColor: { r: 0.95, g: 0.95, b: 0.95 } + clearColor: { r: 0.95, g: 0.95, b: 0.95 }, }, scriptId: 'box3d_renderer', - enabled: true + enabled: true, }, { name: 'Input', @@ -94,7 +94,7 @@ function sceneEntities() { contextMenu: true, preventContextMenuDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, touchEvents: { enable: true, @@ -107,23 +107,23 @@ function sceneEntities() { move: true, preventMoveDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, keyEvents: { enable: true, down: true, up: true, preventDefault: false, - eventHandler: true - } - } + eventHandler: true, + }, + }, }, { name: 'VR Presenter', - scriptId: 'vr_presenter' - } - ] - } + scriptId: 'vr_presenter', + }, + ], + }, ]; } diff --git a/src/lib/viewers/box3d/__tests__/Base360Loader-test.js b/src/lib/viewers/box3d/__tests__/Base360Loader-test.js index 931545c80..e1f522b83 100644 --- a/src/lib/viewers/box3d/__tests__/Base360Loader-test.js +++ b/src/lib/viewers/box3d/__tests__/Base360Loader-test.js @@ -12,8 +12,8 @@ describe('lib/viewers/box3d/Base360Loader', () => { base360Loader.viewers = [ { REP: 'dash', - EXT: 'mp4' - } + EXT: 'mp4', + }, ]; file = { @@ -21,10 +21,10 @@ describe('lib/viewers/box3d/Base360Loader', () => { representations: { entries: [ { - representation: 'dash' - } - ] - } + representation: 'dash', + }, + ], + }, }; }); diff --git a/src/lib/viewers/box3d/__tests__/Box3DControls-test.js b/src/lib/viewers/box3d/__tests__/Box3DControls-test.js index a337e1164..e25e42ae1 100644 --- a/src/lib/viewers/box3d/__tests__/Box3DControls-test.js +++ b/src/lib/viewers/box3d/__tests__/Box3DControls-test.js @@ -81,7 +81,7 @@ describe('lib/viewers/box3d/Box3DControls', () => { 'Enter fullscreen', controls.handleToggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); }); @@ -90,7 +90,7 @@ describe('lib/viewers/box3d/Box3DControls', () => { 'Exit fullscreen', controls.handleToggleFullscreen, 'bp-exit-fullscreen-icon', - ICON_FULLSCREEN_OUT + ICON_FULLSCREEN_OUT, ); }); }); @@ -145,8 +145,8 @@ describe('lib/viewers/box3d/Box3DControls', () => { const removeStub = sandbox.stub(); controls.vrButtonEl = { classList: { - remove: removeStub - } + remove: removeStub, + }, }; controls.showVrButton(); @@ -160,8 +160,8 @@ describe('lib/viewers/box3d/Box3DControls', () => { const addStub = sandbox.stub(); controls.vrButtonEl = { classList: { - add: addStub - } + add: addStub, + }, }; controls.hideVrButton(); @@ -176,8 +176,8 @@ describe('lib/viewers/box3d/Box3DControls', () => { el = { classList: { add: sandbox.stub(), - remove: sandbox.stub() - } + remove: sandbox.stub(), + }, }; }); @@ -205,8 +205,8 @@ describe('lib/viewers/box3d/Box3DControls', () => { it('should invoke element.classList.toggle() with CLASS_HIDDEN', () => { const el = { classList: { - toggle: sandbox.stub() - } + toggle: sandbox.stub(), + }, }; controls.toggleElementVisibility(el); @@ -223,7 +223,7 @@ describe('lib/viewers/box3d/Box3DControls', () => { expect(destroyStub).to.be.called; }); - it('should not call controls.destroy() if .controls doesn\'t exist', () => { + it("should not call controls.destroy() if .controls doesn't exist", () => { const destroyStub = sandbox.stub(controls.controls, 'destroy'); controls.controls = null; controls.destroy(); @@ -243,7 +243,7 @@ describe('lib/viewers/box3d/Box3DControls', () => { expect(unregisterStub).to.be.called; }); - it('should not call uiRegistry.unregisterAll() if .uiRegistry doesn\'t exist', () => { + it("should not call uiRegistry.unregisterAll() if .uiRegistry doesn't exist", () => { const unregisterStub = sandbox.stub(controls.uiRegistry, 'unregisterAll'); controls.uiRegistry = null; controls.destroy(); diff --git a/src/lib/viewers/box3d/__tests__/Box3DRenderer-test.js b/src/lib/viewers/box3d/__tests__/Box3DRenderer-test.js index 5a50afed7..63a0734fb 100644 --- a/src/lib/viewers/box3d/__tests__/Box3DRenderer-test.js +++ b/src/lib/viewers/box3d/__tests__/Box3DRenderer-test.js @@ -46,7 +46,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { describe('destroy()', () => { beforeEach(() => { renderer.box3d = { - destroy: () => {} + destroy: () => {}, }; }); @@ -91,10 +91,10 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { camera = { setPosition: () => {}, setQuaternion: () => {}, - trigger: () => {} + trigger: () => {}, }; renderer.box3d = { - getObjectByClass: sandbox.stub().returns(camera) + getObjectByClass: sandbox.stub().returns(camera), }; renderer.savedCameraPosition = { x: 0, y: 0, z: 0 }; renderer.savedCameraQuaternion = { x: 0, y: 0, z: 0, w: 1 }; @@ -112,7 +112,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { describe('getCamera()', () => { it('should return a camera object if one exists in the scene', () => { renderer.box3d = { - getObjectByClass: sandbox.stub().returns({}) + getObjectByClass: sandbox.stub().returns({}), }; const camera = renderer.getCamera(); @@ -128,7 +128,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { describe('getScene()', () => { it('should return the scene prefab that exists in the Box3D runtime', () => { renderer.box3d = { - getObjectByClass: sandbox.stub().returns({}) + getObjectByClass: sandbox.stub().returns({}), }; const scene = renderer.getScene(); @@ -159,9 +159,9 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { expect(promise).to.be.a('promise'); }); - it('should return a Promise that resolves in an XMLHttpRequest object', (done) => { + it('should return a Promise that resolves in an XMLHttpRequest object', done => { const promise = renderer.configureXHR({}, 'path/to/stuff.wav', { isExternal: true }); - promise.then((xhr) => { + promise.then(xhr => { expect(xhr).to.be.an('XMLHttpRequest'); done(); }); @@ -186,7 +186,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); it('should append "boxapi" request header to the XHR with the provided shared link', () => { - sandbox.stub(window, 'encodeURI').callsFake((uri) => { + sandbox.stub(window, 'encodeURI').callsFake(uri => { return uri; }); const setReqHeaderSpy = sandbox.spy(XMLHttpRequest.prototype, 'setRequestHeader'); @@ -199,7 +199,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); it('should append "boxapi" request header to the XHR with the shared link AND shared link password', () => { - sandbox.stub(window, 'encodeURI').callsFake((uri) => { + sandbox.stub(window, 'encodeURI').callsFake(uri => { return uri; }); const setReqHeaderSpy = sandbox.spy(XMLHttpRequest.prototype, 'setRequestHeader'); @@ -225,13 +225,13 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { window.Box3D = box3D; }); - it('should fail when no global Box3D present', (done) => { + it('should fail when no global Box3D present', done => { window.Box3D = undefined; const rejected = renderer.initBox3d(); expect(rejected).to.be.a('promise'); - rejected.catch((err) => { + rejected.catch(err => { expect(err).to.be.an('error'); expect(err.message).to.equal('Missing Box3D'); done(); @@ -240,34 +240,34 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); describe('with global Box3D', () => { - it('should fail when missing file property on option', (done) => { + it('should fail when missing file property on option', done => { const rejected = renderer.initBox3d({}); expect(rejected).to.be.a('promise'); - rejected.catch((err) => { + rejected.catch(err => { expect(err).to.be.an('error'); expect(err.message).to.equal('Missing file version'); done(); }); }); - it('should fail when file option is missing version property', (done) => { + it('should fail when file option is missing version property', done => { const rejected = renderer.initBox3d({ file: {} }); expect(rejected).to.be.a('promise'); - rejected.catch((err) => { + rejected.catch(err => { expect(err).to.be.an('error'); expect(err.message).to.equal('Missing file version'); done(); }); }); - it('should create a new box3d instance', (done) => { + it('should create a new box3d instance', done => { const expectedEntities = { one: 'a', - two: 'b' + two: 'b', }; sandbox.stub(renderer, 'createBox3d').callsFake((loader, entities) => { @@ -277,15 +277,15 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { renderer.initBox3d({ file: { file_version: 'abcdef' }, - sceneEntities: expectedEntities + sceneEntities: expectedEntities, }); }); - it('should produce an XhrResourceLoader which supports token, sharedLink and sharedLinkPassword', (done) => { - const createBox3DStub = sandbox.stub(renderer, 'createBox3d').callsFake((loader) => { - sandbox.stub(loader.queue, 'add').callsFake((fn) => fn()); + it('should produce an XhrResourceLoader which supports token, sharedLink and sharedLinkPassword', done => { + const createBox3DStub = sandbox.stub(renderer, 'createBox3d').callsFake(loader => { + sandbox.stub(loader.queue, 'add').callsFake(fn => fn()); const resource = { - once: (event, cb) => cb() + once: (event, cb) => cb(), }; sandbox.stub(loader, 'load').callsFake(() => resource); @@ -300,7 +300,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { sceneEntities: [], token: 'foo', sharedLink: 'bar', - sharedLinkPassword: 'baz' + sharedLinkPassword: 'baz', }); }); }); @@ -317,14 +317,14 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { window.Box3D = box3D; }); - it('should create new Box3D engine instance, initialize it with properties, load an app, and resolve in the new Box3D', (done) => { + it('should create new Box3D engine instance, initialize it with properties, load an app, and resolve in the new Box3D', done => { const loader = { name: 'loader' }; const entities = { name: 'entities' }; const expectedInitProps = { apiBase: 'dummyBase', container: containerEl, engineName: 'Default', - resourceLoader: loader + resourceLoader: loader, }; let initProps; const Box3DFake = { @@ -332,13 +332,13 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { initProps = props; this.addEntities = sandbox.stub(); this.getAssetByClass = sandbox.stub().returns({ - load: function load() {} + load: function load() {}, }); - } + }, }; window.Box3D = Box3DFake; - const callPromise = renderer.createBox3d(loader, entities, [], 'dummyBase').then((b3d) => { + const callPromise = renderer.createBox3d(loader, entities, [], 'dummyBase').then(b3d => { expect(b3d).to.be.an.instanceof(window.Box3D.Engine); expect(initProps).to.deep.equal(expectedInitProps); expect(callPromise).to.be.a('promise'); @@ -351,9 +351,9 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { Engine: function constructor() { this.addEntities = sandbox.stub(); this.getAssetById = sandbox.stub().returns({ - load: function load() {} + load: function load() {}, }); - } + }, }; window.Box3D = Box3DFake; @@ -362,19 +362,19 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { expect(shouldBePromise).to.be.a('promise'); }); - it('should bind to context loss and restore events', (done) => { + it('should bind to context loss and restore events', done => { sandbox.stub(renderer, 'handleContextRestored'); const Box3DFake = { Engine: function constructor() { this.addEntities = sandbox.stub(); this.getAssetByClass = sandbox.stub().returns({ - load: function load() {} + load: function load() {}, }); this.canvas = { addEventListener: () => {} }; sandbox.stub(this.canvas, 'addEventListener').callsFake(() => { renderer.handleContextRestored(); }); - } + }, }; window.Box3D = Box3DFake; renderer.createBox3d({}, {}).then(() => { @@ -384,13 +384,13 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); }); - it('should not set reference if error occurs initializing engine', (done) => { + it('should not set reference if error occurs initializing engine', done => { const Box3DFake = { Engine: function constructor() { this.addEntities = function addEntities() { throw new Error('Error while initializing'); }; - } + }, }; window.Box3D = Box3DFake; @@ -400,7 +400,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); }); - it('should not set reference if error loading app', (done) => { + it('should not set reference if error loading app', done => { const Box3DFake = { Engine: function constructor() { this.initialize = function initialize(props, callback) { @@ -411,10 +411,10 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { return { load: function load() { throw new Error('Error while loading'); - } + }, }; }; - } + }, }; window.Box3D = Box3DFake; @@ -436,7 +436,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { describe('handleContextRestored()', () => { it('should fire event to be picked up by the viewer', () => { - const emitStub = sandbox.stub(renderer, 'emit').callsFake((eventName) => { + const emitStub = sandbox.stub(renderer, 'emit').callsFake(eventName => { expect(eventName).to.equal(EVENT_WEBGL_CONTEXT_RESTORED); }); renderer.handleContextRestored(); @@ -445,7 +445,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); describe('toggleVr()', () => { - it('should enable vr if it\'s currently disabled', () => { + it("should enable vr if it's currently disabled", () => { let called = false; sandbox.stub(renderer, 'enableVr').callsFake(() => { called = true; @@ -454,7 +454,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { expect(called).to.be.true; }); - it('should disable vr if it\'s currently enabled', () => { + it("should disable vr if it's currently enabled", () => { let called = false; sandbox.stub(renderer, 'disableVr').callsFake(() => { called = true; @@ -475,7 +475,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { const box3dRenderer = { setAttribute: setAttribStub }; renderer.box3d = { getRenderer: sandbox.stub().returns(box3dRenderer), - getVrDisplay: sandbox.stub().returns({ isPresenting: true }) + getVrDisplay: sandbox.stub().returns({ isPresenting: true }), }; renderer.onEnableVr(); }); @@ -498,7 +498,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { beforeEach(() => { renderer.box3d = { - trigger: () => {} + trigger: () => {}, }; b3dMock = sandbox.mock(renderer.box3d); @@ -529,7 +529,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { renderer.box3d = { getRenderer: sandbox.stub().returns(box3dRenderer), getVrDisplay: sandbox.stub().returns({ isPresenting: false }), - trigger: sandbox.stub() + trigger: sandbox.stub(), }; renderer.onDisableVr(); }); @@ -560,7 +560,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { beforeEach(() => { renderer.box3d = { - trigger: () => {} + trigger: () => {}, }; b3dMock = sandbox.mock(renderer.box3d); @@ -580,7 +580,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); describe('resize()', () => { - it('should do nothing if Box3D doesn\'t exist', () => { + it("should do nothing if Box3D doesn't exist", () => { /* eslint-disable require-jsdoc */ const shouldNotThrow = () => { renderer.resize(); @@ -592,7 +592,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { it('should trigger resize on Box3D', () => { renderer.box3d = { - trigger: () => {} + trigger: () => {}, }; sandbox .mock(renderer.box3d) @@ -607,7 +607,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { beforeEach(() => { const camera = { - getComponentByScriptId: () => {} + getComponentByScriptId: () => {}, }; cameraMock = sandbox.mock(camera); sandbox.stub(renderer, 'getCamera').returns(camera); @@ -629,7 +629,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { beforeEach(() => { const camera = { - getComponentByScriptId: () => {} + getComponentByScriptId: () => {}, }; cameraMock = sandbox.mock(camera); sandbox.stub(renderer, 'getCamera').returns(camera); @@ -654,11 +654,11 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { beforeEach(() => { vrPresenter = { - whenDisplaysAvailable: () => {} + whenDisplaysAvailable: () => {}, }; renderer.box3d = { getApplication: () => {}, - listenTo: () => {} + listenTo: () => {}, }; emitStub = sandbox.stub(renderer, 'emit'); box3dMock = sandbox.mock(renderer.box3d); @@ -671,8 +671,8 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { globalBox3DMock.expects('isTablet').returns(false); }); - it('should emit a EVENT_SHOW_VR_BUTTON event when vr displays are ready', (done) => { - sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake((callback) => { + it('should emit a EVENT_SHOW_VR_BUTTON event when vr displays are ready', done => { + sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake(callback => { callback([{}, {}]); done(); }); @@ -681,9 +681,9 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { expect(emitStub).to.be.calledWith(EVENT_SHOW_VR_BUTTON); }); - it('should add an event listeners for vr enabled/disabled events via listenTo', (done) => { + it('should add an event listeners for vr enabled/disabled events via listenTo', done => { box3dMock.expects('listenTo').twice(); - sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake((callback) => { + sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake(callback => { callback([{}, {}]); done(); }); @@ -691,8 +691,8 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { renderer.initVr(); }); - it('should do nothing if no displays are available', (done) => { - sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake((callback) => { + it('should do nothing if no displays are available', done => { + sandbox.stub(vrPresenter, 'whenDisplaysAvailable').callsFake(callback => { callback([]); done(); }); @@ -701,7 +701,7 @@ describe('lib/viewers/box3d/Box3DRenderer', () => { }); }); - it('should do nothing if the device we\'re using is a Tablet device', () => { + it("should do nothing if the device we're using is a Tablet device", () => { globalBox3DMock.expects('isTablet').returns(true); box3dMock.expects('getApplication').never(); renderer.initVr(); diff --git a/src/lib/viewers/box3d/__tests__/Box3DUIUtils-test.js b/src/lib/viewers/box3d/__tests__/Box3DUIUtils-test.js index 053f2e7dd..bdf2c0a3c 100644 --- a/src/lib/viewers/box3d/__tests__/Box3DUIUtils-test.js +++ b/src/lib/viewers/box3d/__tests__/Box3DUIUtils-test.js @@ -6,7 +6,7 @@ import { createLabel, createPullup, createRow, - UIRegistry + UIRegistry, } from '../Box3DUIUtils'; import { @@ -14,7 +14,7 @@ import { CSS_CLASS_PULLUP, CSS_CLASS_SETTINGS_PANEL_LABEL, CSS_CLASS_SETTINGS_PANEL_ROW, - CSS_CLASS_HIDDEN + CSS_CLASS_HIDDEN, } from '../model3d/model3DConstants'; import { @@ -23,7 +23,7 @@ import { CLASS_BOX_PREVIEW_MENU, CLASS_BOX_PREVIEW_OVERLAY, CLASS_BOX_PREVIEW_OVERLAY_WRAPPER, - CLASS_BOX_PREVIEW_TOGGLE_OVERLAY + CLASS_BOX_PREVIEW_TOGGLE_OVERLAY, } from '../../../constants'; const sandbox = sinon.sandbox.create(); @@ -184,7 +184,7 @@ describe('lib/viewers/box3d/Box3DUIUtils', () => { expect(dd).to.contain(`div.${CLASS_BOX_PREVIEW_OVERLAY} menu.${CLASS_BOX_PREVIEW_MENU}`); }); - it('should append div with class \'link-group\' to CLASS_BOX_PREVIEW_MENU', () => { + it("should append div with class 'link-group' to CLASS_BOX_PREVIEW_MENU", () => { expect(dd).to.contain(`menu.${CLASS_BOX_PREVIEW_MENU} div.link-group`); }); @@ -198,18 +198,18 @@ describe('lib/viewers/box3d/Box3DUIUtils', () => { expect(dropdown).to.contain(`button.${CLASS_BOX_PREVIEW_BUTTON}`); }); - it('should set the button element\'s text to the provided listText', () => { + it("should set the button element's text to the provided listText", () => { const buttonText = 'Gasp! Button!'; const dropdown = createDropdown('', buttonText); expect(dropdown.querySelector(`button.${CLASS_BOX_PREVIEW_BUTTON}`)).to.have.text(buttonText); }); describe('dropdown list population', () => { - const text = 'I\'m and entry!'; + const text = "I'm and entry!"; const listEntries = [ { - text - } + text, + }, ]; let ddList; // The ul is from the link-group that comes from the overlay wrapper beforeEach(() => { @@ -382,13 +382,13 @@ describe('lib/viewers/box3d/Box3DUIUtils', () => { it('should do nothing if the item provided does not exist in the registry', () => { const parentEl = { - removeChild: sandbox.stub() + removeChild: sandbox.stub(), }; const item = { el: { - parentElement: parentEl - } + parentElement: parentEl, + }, }; registry.unregisterItem(item); diff --git a/src/lib/viewers/box3d/__tests__/Box3DViewer-test.js b/src/lib/viewers/box3d/__tests__/Box3DViewer-test.js index 711a20696..7d4cbe9ed 100644 --- a/src/lib/viewers/box3d/__tests__/Box3DViewer-test.js +++ b/src/lib/viewers/box3d/__tests__/Box3DViewer-test.js @@ -14,7 +14,7 @@ import { EVENT_SHOW_VR_BUTTON, EVENT_TOGGLE_FULLSCREEN, EVENT_TOGGLE_VR, - EVENT_WEBGL_CONTEXT_RESTORED + EVENT_WEBGL_CONTEXT_RESTORED, } from '../box3DConstants'; import { VIEWER_EVENT } from '../../../events'; import { SELECTOR_BOX_PREVIEW_CONTENT } from '../../../constants'; @@ -40,18 +40,18 @@ describe('lib/viewers/box3d/Box3DViewer', () => { file: { id: 0, file_version: { - id: 1 - } + id: 1, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, ui: { - showLoadingIndicator: () => {} - } + showLoadingIndicator: () => {}, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -62,13 +62,13 @@ describe('lib/viewers/box3d/Box3DViewer', () => { box3d.controls = { on: () => {}, removeListener: () => {}, - destroy: () => {} + destroy: () => {}, }; box3d.renderer = { load: () => Promise.resolve(), on: () => {}, removeListener: () => {}, - destroy: () => {} + destroy: () => {}, }; box3d.postLoad(); @@ -94,15 +94,15 @@ describe('lib/viewers/box3d/Box3DViewer', () => { file: { id: 0, file_version: { - id: 1 - } + id: 1, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); box3d.containerEl = document.querySelector(SELECTOR_BOX_PREVIEW_CONTENT); @@ -145,7 +145,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { }); }); - it('should not attach handlers to controls if controls instance doesn\'t exist', () => { + it("should not attach handlers to controls if controls instance doesn't exist", () => { const onSpy = sandbox.spy(box3d.controls, 'on'); // Only checking first method call in block onSpy.withArgs(EVENT_TOGGLE_FULLSCREEN); @@ -194,7 +194,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { }); }); - it('should not attach handlers to renderer if renderer instance doesn\'t exist', () => { + it("should not attach handlers to renderer if renderer instance doesn't exist", () => { const onSpy = sandbox.spy(box3d.renderer, 'on'); // Only checking first method call in block onSpy.withArgs(EVENT_SCENE_LOADED); @@ -434,7 +434,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { describe('toggleFullscreen()', () => { it('should call fullscreen.toggle()', () => { Object.defineProperty(Object.getPrototypeOf(fullscreen), 'toggle', { - value: sandbox.spy() + value: sandbox.spy(), }); box3d.toggleFullscreen(); @@ -446,7 +446,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { const toggleSpy = sandbox.spy(); toggleSpy.withArgs(box3d.containerEl); Object.defineProperty(Object.getPrototypeOf(fullscreen), 'toggle', { - value: toggleSpy + value: toggleSpy, }); box3d.toggleFullscreen(); @@ -466,8 +466,8 @@ describe('lib/viewers/box3d/Box3DViewer', () => { beforeEach(() => { box3d.renderer.box3d = { getVrDisplay: sandbox.stub().returns({ - isPresenting: true - }) + isPresenting: true, + }), }; box3d.controls.vrEnabled = false; }); @@ -492,7 +492,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { it('should not add vr-enabled class to wrapper and not set controls property if on mobile, but VR is not presenting', () => { box3d.renderer.box3d.getVrDisplay = sandbox.stub().returns({ - isPresenting: false + isPresenting: false, }); sandbox.stub(Browser, 'isMobile').returns(true); @@ -506,7 +506,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { describe('handleSceneLoaded()', () => { let eventNameUsed; beforeEach(() => { - sandbox.stub(box3d, 'emit').callsFake((eventName) => { + sandbox.stub(box3d, 'emit').callsFake(eventName => { eventNameUsed = eventName; }); box3d.controls.addUi = sandbox.stub(); @@ -564,7 +564,7 @@ describe('lib/viewers/box3d/Box3DViewer', () => { describe('handleContextRestored()', () => { it('should call emit() with params ["progressstart"]', () => { - const emitStub = sandbox.stub(box3d, 'emit').callsFake((eventName) => { + const emitStub = sandbox.stub(box3d, 'emit').callsFake(eventName => { expect(eventName).to.equal(VIEWER_EVENT.progressStart); }); diff --git a/src/lib/viewers/box3d/box3DAssets.js b/src/lib/viewers/box3d/box3DAssets.js index 185801bd7..4daa9bbd9 100644 --- a/src/lib/viewers/box3d/box3DAssets.js +++ b/src/lib/viewers/box3d/box3DAssets.js @@ -6,6 +6,6 @@ const JS = [ `${STATIC_URI}three.min.js`, `${STATIC_URI}box3d-runtime.min.js`, `${STATIC_URI}webvr-polyfill.js`, - `${STATIC_URI}WebVR/VRConfig.js` + `${STATIC_URI}WebVR/VRConfig.js`, ]; export default JS; diff --git a/src/lib/viewers/box3d/image360/Image360Loader.js b/src/lib/viewers/box3d/image360/Image360Loader.js index 194d0942b..1adc455a6 100644 --- a/src/lib/viewers/box3d/image360/Image360Loader.js +++ b/src/lib/viewers/box3d/image360/Image360Loader.js @@ -26,9 +26,9 @@ const VIEWERS = [ 'svs', 'tga', 'tif', - 'tiff' - ] - } + 'tiff', + ], + }, ]; class Image360Loader extends Base360Loader { diff --git a/src/lib/viewers/box3d/image360/Image360Renderer.js b/src/lib/viewers/box3d/image360/Image360Renderer.js index f5be44a9e..193129bc9 100644 --- a/src/lib/viewers/box3d/image360/Image360Renderer.js +++ b/src/lib/viewers/box3d/image360/Image360Renderer.js @@ -96,9 +96,9 @@ class Image360Renderer extends Box3DRenderer { this.textureAsset.setProperties({ imageId: this.imageAsset.id, wrapModeV: 'clampToEdge', - wrapModeU: 'clampToEdge' + wrapModeU: 'clampToEdge', }); - return new Promise((resolve) => { + return new Promise(resolve => { this.textureAsset.load(() => { this.skybox = this.getSkyboxComponent(); this.skybox.enable(); @@ -107,7 +107,7 @@ class Image360Renderer extends Box3DRenderer { }); }); }, - () => this.onUnsupportedRepresentation() + () => this.onUnsupportedRepresentation(), ); } diff --git a/src/lib/viewers/box3d/image360/SceneEntities.js b/src/lib/viewers/box3d/image360/SceneEntities.js index 498be8da9..990e2c772 100644 --- a/src/lib/viewers/box3d/image360/SceneEntities.js +++ b/src/lib/viewers/box3d/image360/SceneEntities.js @@ -8,14 +8,14 @@ export default [ properties: { near: 0.05, // Camera near-plane distance far: 200, - fov: 70 + fov: 70, }, components: [ // The render view controls how the scene is rendered: regular, UV-only, normal-only, etc. { name: 'Render View', enabled: true, - scriptId: 'vr_render_view' + scriptId: 'vr_render_view', }, { name: 'Orbit Camera', @@ -23,17 +23,17 @@ export default [ panEnabled: false, zoomEnabled: true, inertialDamping: 0.2, - lookSpeed: 0.5 + lookSpeed: 0.5, }, enabled: true, - scriptId: 'orbit_camera' + scriptId: 'orbit_camera', }, { name: 'VR Camera Controller', enabled: true, - scriptId: 'vr_camera_controller' - } - ] + scriptId: 'vr_camera_controller', + }, + ], }, { id: 'SCENE_ID', @@ -44,18 +44,18 @@ export default [ { name: 'Skybox', attributes: { - size: 100 + size: 100, }, scriptId: 'skybox_renderer', - enabled: false - } - ] + enabled: false, + }, + ], }, { id: 'APP_ASSET_ID', type: 'application', properties: { - startupSceneId: 'SCENE_ID' // The scene to load + startupSceneId: 'SCENE_ID', // The scene to load }, components: [ { @@ -63,16 +63,16 @@ export default [ attributes: { antialias: !Browser.isMobile(), maxTextureSize2d: 8192, - renderOnDemand: true + renderOnDemand: true, }, scriptId: 'box3d_renderer', isBuiltIn: true, - enabled: true + enabled: true, }, { name: 'Debug Performance', scriptId: 'debug_performance', - enabled: false + enabled: false, }, { name: 'Input', @@ -93,7 +93,7 @@ export default [ contextMenu: true, preventContextMenuDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, touchEvents: { enable: true, @@ -106,21 +106,21 @@ export default [ move: true, preventMoveDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, keyEvents: { enable: true, down: true, up: true, preventDefault: false, - eventHandler: true - } - } + eventHandler: true, + }, + }, }, { name: 'VR Presenter', - scriptId: 'vr_presenter' - } - ] - } + scriptId: 'vr_presenter', + }, + ], + }, ]; diff --git a/src/lib/viewers/box3d/image360/__tests__/Image360Loader-test.js b/src/lib/viewers/box3d/image360/__tests__/Image360Loader-test.js index 647f3ed55..3de892c1e 100644 --- a/src/lib/viewers/box3d/image360/__tests__/Image360Loader-test.js +++ b/src/lib/viewers/box3d/image360/__tests__/Image360Loader-test.js @@ -17,15 +17,18 @@ describe('lib/viewers/box3d/image360/Image360Loader', () => { representations: { entries: [ { - representation: '3d' - } - ] - } + representation: '3d', + }, + ], + }, }; it('should throw an error if browser does not support WebGL', () => { sandbox.stub(Browser, 'hasWebGL').returns(false); - expect(() => Image360Loader.determineViewer(file)).to.throw(PreviewError, /support preview for 360-degree images/); + expect(() => Image360Loader.determineViewer(file)).to.throw( + PreviewError, + /support preview for 360-degree images/, + ); }); it('should return viewer if 360 is properly supported', () => { diff --git a/src/lib/viewers/box3d/image360/__tests__/Image360Renderer-test.js b/src/lib/viewers/box3d/image360/__tests__/Image360Renderer-test.js index 3d470a016..d552bb1bb 100644 --- a/src/lib/viewers/box3d/image360/__tests__/Image360Renderer-test.js +++ b/src/lib/viewers/box3d/image360/__tests__/Image360Renderer-test.js @@ -39,7 +39,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should invoke imageAsset.destroy(), if it exists', () => { renderer.imageAsset = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; const { imageAsset } = renderer; renderer.destroy(); @@ -67,7 +67,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should invoke textureAsset.destroy()', () => { renderer.textureAsset = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; const { textureAsset } = renderer; @@ -79,7 +79,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should nullify textureAsset if it exists', () => { renderer.textureAsset = { - destroy: sandbox.mock() + destroy: sandbox.mock(), }; sandbox.stub(renderer, 'getSkyboxComponent'); @@ -90,7 +90,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should set "skyboxTexture" attribute to null, if skybox component exists on the scene', () => { const skybox = { - setAttribute: sandbox.stub() + setAttribute: sandbox.stub(), }; renderer.skybox = skybox; sandbox.stub(renderer, 'getSkyboxComponent').returns(skybox); @@ -104,7 +104,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should return the .skybox instance if available', () => { const skybox = { name: 'skybox', - setAttribute: sandbox.stub() + setAttribute: sandbox.stub(), }; renderer.skybox = skybox; @@ -117,12 +117,12 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { it('should should not attempt to get skybox_renderer component if .skybox exists', () => { const skybox = { name: 'skybox', - setAttribute: sandbox.stub() + setAttribute: sandbox.stub(), }; renderer.skybox = skybox; renderer.box3d = { - getObjectByClass: sandbox.stub() + getObjectByClass: sandbox.stub(), }; renderer.getSkyboxComponent(); @@ -132,18 +132,18 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.skybox = null; }); - it('should should get skybox_renderer component from scene if .skybox doesn\'t exists', () => { + it("should should get skybox_renderer component from scene if .skybox doesn't exists", () => { const skybox = { name: 'skybox', - setAttribute: sandbox.stub() + setAttribute: sandbox.stub(), }; const scene = { - getComponentByScriptId: sandbox.stub().returns(skybox) + getComponentByScriptId: sandbox.stub().returns(skybox), }; renderer.box3d = { - getObjectByClass: sandbox.stub().returns(scene) + getObjectByClass: sandbox.stub().returns(scene), }; renderer.getSkyboxComponent(); @@ -155,14 +155,14 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { }); describe('load()', () => { - it('should use sceneEntities value if provided for initialization', (done) => { + it('should use sceneEntities value if provided for initialization', done => { const mySceneEntities = { light: 'light', camera: 'camera', - action: ':D' + action: ':D', }; - sandbox.stub(renderer, 'initBox3d').callsFake((options) => { + sandbox.stub(renderer, 'initBox3d').callsFake(options => { expect(options.sceneEntities).to.deep.equal(mySceneEntities); done(); return new Promise(() => {}); @@ -171,8 +171,8 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.load('', { sceneEntities: mySceneEntities }); }); - it('should use default sceneEntities, if none provided, for initialization', (done) => { - sandbox.stub(renderer, 'initBox3d').callsFake((options) => { + it('should use default sceneEntities, if none provided, for initialization', done => { + sandbox.stub(renderer, 'initBox3d').callsFake(options => { expect(options.sceneEntities).to.deep.equal(sceneEntities); done(); return new Promise(() => {}); @@ -181,15 +181,15 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.load(''); }); - it('should use provided inputSettings for initialization', (done) => { + it('should use provided inputSettings for initialization', done => { const myInputSettings = { mouse_control: true, left_click: 'probably', right_click: true, - middle_click: 'always' + middle_click: 'always', }; - sandbox.stub(renderer, 'initBox3d').callsFake((options) => { + sandbox.stub(renderer, 'initBox3d').callsFake(options => { expect(options.inputSettings).to.deep.equal(myInputSettings); done(); return new Promise(() => {}); @@ -198,14 +198,14 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.load('', { inputSettings: myInputSettings }); }); - it('should call initBox3d() with the passed in options object', (done) => { + it('should call initBox3d() with the passed in options object', done => { const myOptions = { inputSettings: { some: 'stuff' }, sceneSettings: { more: 'stuff' }, - even: { more: 'things' } + even: { more: 'things' }, }; - sandbox.stub(renderer, 'initBox3d').callsFake((options) => { + sandbox.stub(renderer, 'initBox3d').callsFake(options => { expect(options).to.deep.equal(myOptions); done(); return new Promise(() => {}); @@ -214,11 +214,11 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.load('', myOptions); }); - it('should call loadPanoramaFile() with url for box3d representation', (done) => { + it('should call loadPanoramaFile() with url for box3d representation', done => { const fileUrl = 'I/am/a/url'; sandbox.stub(renderer, 'initBox3d').returns(Promise.resolve()); - sandbox.stub(renderer, 'loadPanoramaFile').callsFake((url) => { + sandbox.stub(renderer, 'loadPanoramaFile').callsFake(url => { expect(url).to.equal(fileUrl); done(); return new Promise(() => {}); @@ -227,7 +227,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { renderer.load(fileUrl); }); - it('should call onSceneLoad() when done loading file', (done) => { + it('should call onSceneLoad() when done loading file', done => { sandbox.stub(renderer, 'initBox3d').returns(Promise.resolve()); sandbox.stub(renderer, 'loadPanoramaFile').returns(Promise.resolve()); sandbox.stub(renderer, 'onSceneLoad').callsFake(() => { @@ -242,7 +242,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { beforeEach(() => { // We don't care about super calls :D Object.defineProperty(Object.getPrototypeOf(Image360Renderer.prototype), 'enableVr', { - value: sandbox.stub() + value: sandbox.stub(), }); }); @@ -250,7 +250,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { const spy = sandbox.spy(); const skybox = { - setAttribute: spy + setAttribute: spy, }; renderer.skybox = skybox; @@ -265,7 +265,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { const spy = sandbox.spy(); const skybox = { - setAttribute: spy + setAttribute: spy, }; renderer.skybox = skybox; @@ -281,7 +281,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { beforeEach(() => { // We don't care about super calls :D Object.defineProperty(Object.getPrototypeOf(Image360Renderer.prototype), 'disableVr', { - value: sandbox.stub() + value: sandbox.stub(), }); }); @@ -289,7 +289,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { const spy = sandbox.spy(); const skybox = { - setAttribute: spy + setAttribute: spy, }; renderer.skybox = skybox; @@ -304,7 +304,7 @@ describe('lib/viewers/box3d/image360/Image360Renderer', () => { const spy = sandbox.spy(); const skybox = { - setAttribute: spy + setAttribute: spy, }; renderer.skybox = skybox; diff --git a/src/lib/viewers/box3d/image360/__tests__/Image360Viewer-test.js b/src/lib/viewers/box3d/image360/__tests__/Image360Viewer-test.js index 676fecb8a..384035e0b 100644 --- a/src/lib/viewers/box3d/image360/__tests__/Image360Viewer-test.js +++ b/src/lib/viewers/box3d/image360/__tests__/Image360Viewer-test.js @@ -24,8 +24,8 @@ describe('lib/viewers/box3d/image360/Image360Viewer', () => { container: containerEl, token: '12345', file: { - id: '0' - } + id: '0', + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); viewer.containerEl = document.querySelector(SELECTOR_BOX_PREVIEW_CONTENT); diff --git a/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js b/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js index acbdf0902..888644124 100644 --- a/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js +++ b/src/lib/viewers/box3d/model3d/Model3DAnimationClipsPullup.js @@ -166,7 +166,7 @@ class Model3DAnimationClipsPullup extends EventEmitter { * @return {void} */ selectClip(selectedClipId) { - Object.keys(this.clipEls).forEach((clipId) => { + Object.keys(this.clipEls).forEach(clipId => { const clipEl = this.clipEls[clipId]; const iconEl = clipEl.querySelector('.box3d-animation-clip-icon'); iconEl.innerHTML = clipId === selectedClipId ? ICON_CHECK_MARK : ''; diff --git a/src/lib/viewers/box3d/model3d/Model3DControls.js b/src/lib/viewers/box3d/model3d/Model3DControls.js index 94f1865bd..25b21b6fc 100644 --- a/src/lib/viewers/box3d/model3d/Model3DControls.js +++ b/src/lib/viewers/box3d/model3d/Model3DControls.js @@ -12,7 +12,7 @@ import { EVENT_SET_GRID_VISIBLE, EVENT_TOGGLE_ANIMATION, EVENT_TOGGLE_HELPERS, - RENDER_MODE_LIT + RENDER_MODE_LIT, } from './model3DConstants'; import { CSS_CLASS_HIDDEN } from '../box3DConstants'; @@ -83,13 +83,13 @@ class Model3DControls extends Box3DControls { __('box3d_toggle_animation'), this.handleToggleAnimation, '', - ICON_PLAY + ICON_PLAY, ); this.animationClipButtonEl = this.controls.add( __('box3d_animation_clips'), this.handleToggleAnimationClips, '', - ICON_ANIMATION + ICON_ANIMATION, ); this.animationClipButtonEl.parentNode.appendChild(this.animationClipsPullup.pullupEl); this.hideAnimationControls(); diff --git a/src/lib/viewers/box3d/model3d/Model3DLoader.js b/src/lib/viewers/box3d/model3d/Model3DLoader.js index 784b98b23..000d2f675 100644 --- a/src/lib/viewers/box3d/model3d/Model3DLoader.js +++ b/src/lib/viewers/box3d/model3d/Model3DLoader.js @@ -10,8 +10,8 @@ const VIEWERS = [ NAME: 'Model3d', CONSTRUCTOR: Model3DViewer, REP: '3d', - EXT: ['box3d', 'fbx', 'obj', 'dae', '3ds', 'ply', 'stl'] - } + EXT: ['box3d', 'fbx', 'obj', 'dae', '3ds', 'ply', 'stl'], + }, ]; class Model3DLoader extends AssetLoader { diff --git a/src/lib/viewers/box3d/model3d/Model3DRenderer.js b/src/lib/viewers/box3d/model3d/Model3DRenderer.js index 0df869be2..5896fac30 100644 --- a/src/lib/viewers/box3d/model3d/Model3DRenderer.js +++ b/src/lib/viewers/box3d/model3d/Model3DRenderer.js @@ -18,7 +18,7 @@ import { RENDER_MODE_UNLIT, RENDER_MODE_SHAPE, RENDER_MODE_NORMALS, - RENDER_MODE_UV + RENDER_MODE_UV, } from './model3DConstants'; import { MODEL3D_STATIC_ASSETS_VERSION } from '../../../constants'; import { createAssetUrlCreator } from '../../../util'; @@ -64,7 +64,7 @@ class Model3DRenderer extends Box3DRenderer { [RENDER_MODE_UNLIT]: Box3D.RenderMode.Unlit, [RENDER_MODE_NORMALS]: Box3D.RenderMode.Normals, [RENDER_MODE_SHAPE]: Box3D.RenderMode.Shape, - [RENDER_MODE_UV]: Box3D.RenderMode.UVOverlay + [RENDER_MODE_UV]: Box3D.RenderMode.UVOverlay, }; this.handleCanvasClick = this.handleCanvasClick.bind(this); @@ -86,7 +86,7 @@ class Model3DRenderer extends Box3DRenderer { /** @inheritdoc */ load(assetUrl, options = {}) { const opts = { - ...options + ...options, }; const { location } = opts; if (location) { @@ -201,14 +201,14 @@ class Model3DRenderer extends Box3DRenderer { } // Reset the transforms of the instances under the root (they can be modified in VR). - this.instance.getChildren().forEach((child) => { + this.instance.getChildren().forEach(child => { child.setPosition(ORIGIN_VECTOR.x, ORIGIN_VECTOR.y, ORIGIN_VECTOR.z); child.setScale(1, 1, 1); child.setQuaternion( IDENTITY_QUATERNION.x, IDENTITY_QUATERNION.y, IDENTITY_QUATERNION.z, - IDENTITY_QUATERNION.w + IDENTITY_QUATERNION.w, ); // Clear the bounds of the object so that they need to be recalculated. child.unsetProperty('bounds'); @@ -274,7 +274,7 @@ class Model3DRenderer extends Box3DRenderer { this.initVrGamepadControls(); this.resetSkeletons(); const videos = this.box3d.getEntitiesByType('video'); - videos.forEach((video) => video.play()); + videos.forEach(video => video.play()); } /** diff --git a/src/lib/viewers/box3d/model3d/Model3DSettingsPullup.js b/src/lib/viewers/box3d/model3d/Model3DSettingsPullup.js index 5fa5692ec..bbd355e27 100644 --- a/src/lib/viewers/box3d/model3d/Model3DSettingsPullup.js +++ b/src/lib/viewers/box3d/model3d/Model3DSettingsPullup.js @@ -18,7 +18,7 @@ import { RENDER_MODE_NORMALS, RENDER_MODE_SHAPE, RENDER_MODE_UV, - ROTATION_STEP + ROTATION_STEP, } from './model3DConstants'; import { CLASS_BOX_PREVIEW_OVERLAY_WRAPPER, CLASS_IS_VISIBLE } from '../../../constants'; @@ -28,41 +28,41 @@ const RENDER_MODES = [ { text: RENDER_MODE_LIT, callback: 'onRenderModeSelected', - args: [RENDER_MODE_LIT] + args: [RENDER_MODE_LIT], }, { text: RENDER_MODE_UNLIT, callback: 'onRenderModeSelected', - args: [RENDER_MODE_UNLIT] + args: [RENDER_MODE_UNLIT], }, { text: RENDER_MODE_NORMALS, callback: 'onRenderModeSelected', - args: [RENDER_MODE_NORMALS] + args: [RENDER_MODE_NORMALS], }, { text: RENDER_MODE_SHAPE, callback: 'onRenderModeSelected', - args: [RENDER_MODE_SHAPE] + args: [RENDER_MODE_SHAPE], }, { text: RENDER_MODE_UV, callback: 'onRenderModeSelected', - args: [RENDER_MODE_UV] - } + args: [RENDER_MODE_UV], + }, ]; const PROJECTION_MODES = [ { text: 'Perspective', callback: 'onProjectionSelected', - args: [CAMERA_PROJECTION_PERSPECTIVE] + args: [CAMERA_PROJECTION_PERSPECTIVE], }, { text: 'Orthographic', callback: 'onProjectionSelected', - args: [CAMERA_PROJECTION_ORTHOGRAPHIC] - } + args: [CAMERA_PROJECTION_ORTHOGRAPHIC], + }, ]; /** @@ -133,7 +133,7 @@ class Model3DSettingsPullup extends EventEmitter { this.uiRegistry.registerItem('settings-pullup-el', this.pullupEl); // Render Mode dropdown - const renderPanelData = RENDER_MODES.map((entry) => { + const renderPanelData = RENDER_MODES.map(entry => { const entryCopy = Object.assign({}, entry); this.convertToValidCallback(entryCopy); return entryCopy; @@ -180,7 +180,7 @@ class Model3DSettingsPullup extends EventEmitter { }); // Camera Projection dropdown - const projectionPanelData = PROJECTION_MODES.map((entry) => { + const projectionPanelData = PROJECTION_MODES.map(entry => { const entryCopy = Object.assign({}, entry); this.convertToValidCallback(entryCopy); return entryCopy; @@ -222,24 +222,24 @@ class Model3DSettingsPullup extends EventEmitter { this.createRotationAxis( AXIS_X, () => this.onAxisRotationSelected(AXIS_X, -1), - () => this.onAxisRotationSelected(AXIS_X, 1) - ) + () => this.onAxisRotationSelected(AXIS_X, 1), + ), ); rowEl.appendChild( this.createRotationAxis( AXIS_Y, () => this.onAxisRotationSelected(AXIS_Y, -1), - () => this.onAxisRotationSelected(AXIS_Y, 1) - ) + () => this.onAxisRotationSelected(AXIS_Y, 1), + ), ); rowEl.appendChild( this.createRotationAxis( AXIS_Z, () => this.onAxisRotationSelected(AXIS_Z, 1), - () => this.onAxisRotationSelected(AXIS_Z, -1) - ) + () => this.onAxisRotationSelected(AXIS_Z, -1), + ), ); return rowEl; diff --git a/src/lib/viewers/box3d/model3d/Model3DViewer.js b/src/lib/viewers/box3d/model3d/Model3DViewer.js index e6891de57..4df24d9c8 100644 --- a/src/lib/viewers/box3d/model3d/Model3DViewer.js +++ b/src/lib/viewers/box3d/model3d/Model3DViewer.js @@ -13,7 +13,7 @@ import { EVENT_SET_GRID_VISIBLE, EVENT_TOGGLE_ANIMATION, EVENT_TOGGLE_HELPERS, - RENDER_MODE_LIT + RENDER_MODE_LIT, } from './model3DConstants'; import { CSS_CLASS_INVISIBLE, EVENT_LOAD } from '../box3DConstants'; import './Model3D.scss'; @@ -34,7 +34,7 @@ class Model3DViewer extends Box3DViewer { /** @property {Object} - Tracks up and forward axes for the model alignment in the scene */ axes = { up: null, - forward: null + forward: null, }; /** @inheritdoc */ @@ -165,7 +165,7 @@ class Model3DViewer extends Box3DViewer { return this.boxSdk .getMetadataClient() .get(this.options.file.id, 'global', 'box3d') - .then((response) => { + .then(response => { // Treat non-200 responses as errors. if (response.status !== 200) { throw new Error(`Received unsuccessful response status: ${response.status}`); @@ -174,7 +174,7 @@ class Model3DViewer extends Box3DViewer { return response.response; }) .catch(this.onMetadataError) - .then((defaults) => { + .then(defaults => { if (this.controls) { this.controls.addUi(); } @@ -239,7 +239,7 @@ class Model3DViewer extends Box3DViewer { if (animations.length > 0) { const clipIds = animations[0].getClipIds(); - clipIds.forEach((clipId) => { + clipIds.forEach(clipId => { const clip = animations[0].getClip(clipId); const duration = clip.stop - clip.start; this.controls.addAnimationClip(clipId, clip.name, duration); diff --git a/src/lib/viewers/box3d/model3d/Model3DVrControls.js b/src/lib/viewers/box3d/model3d/Model3DVrControls.js index 8fd9d618d..a37cdd1be 100644 --- a/src/lib/viewers/box3d/model3d/Model3DVrControls.js +++ b/src/lib/viewers/box3d/model3d/Model3DVrControls.js @@ -4,13 +4,13 @@ const controlType = { None: 0, Translation: 1, - Scale: 2 + Scale: 2, }; /** A mapping from the control to the ID of the gamepad button that triggers it. */ const buttonMap = { grabObject: 1, - grabWorld: 2 + grabWorld: 2, }; /** @@ -57,7 +57,7 @@ class Model3DVrControls { this.onGamepadButtonUp = this.onGamepadButtonUp.bind(this); // Listen for gamepad button events to trigger actions. - this.vrGamepads.forEach((gamepad) => { + this.vrGamepads.forEach(gamepad => { gamepad.listenTo(gamepad, 'gamepadButtonDown', this.onGamepadButtonDown); gamepad.listenTo(gamepad, 'gamepadButtonUp', this.onGamepadButtonUp); }); @@ -65,7 +65,7 @@ class Model3DVrControls { initiatingController: null, selectedObject: null, previousParent: null, - controlType: controlType.None + controlType: controlType.None, }; } @@ -75,7 +75,7 @@ class Model3DVrControls { * @return {void} */ destroy() { - this.vrGamepads.forEach((gamepad) => gamepad.stopListening()); + this.vrGamepads.forEach(gamepad => gamepad.stopListening()); } /** @@ -101,7 +101,7 @@ class Model3DVrControls { threeObject.quaternion.x, threeObject.quaternion.y, threeObject.quaternion.z, - threeObject.quaternion.w + threeObject.quaternion.w, ); object.setScale(threeObject.scale.x, threeObject.scale.y, threeObject.scale.z); newParent.addChild(object); @@ -180,7 +180,7 @@ class Model3DVrControls { } else if (this.controllerState.controlType === controlType.Scale) { this.controllerState.controlType = controlType.Translation; this.endScale(); - const otherGamepad = this.vrGamepads.find((obj) => { + const otherGamepad = this.vrGamepads.find(obj => { const gamepadComponent = obj.getComponentByScriptId('motion_gamepad_device'); return gamepadComponent && gamepadComponent.getGamepad() !== gamepad; }); @@ -211,7 +211,7 @@ class Model3DVrControls { return; } - const gamepadObject = this.vrGamepads.find((obj) => { + const gamepadObject = this.vrGamepads.find(obj => { const gamepadComponent = obj.getComponentByScriptId('motion_gamepad_device'); return gamepadComponent && gamepadComponent.getGamepad() === gamepad; }); @@ -229,7 +229,7 @@ class Model3DVrControls { if (selectedPrefab) { // Make sure that the selected instance isn't the other controller. - if (this.vrGamepads.find((cont) => selectedPrefab === cont.getChild())) { + if (this.vrGamepads.find(cont => selectedPrefab === cont.getChild())) { return; } diff --git a/src/lib/viewers/box3d/model3d/SceneEntities.js b/src/lib/viewers/box3d/model3d/SceneEntities.js index f9200ea76..a04d4d5c5 100644 --- a/src/lib/viewers/box3d/model3d/SceneEntities.js +++ b/src/lib/viewers/box3d/model3d/SceneEntities.js @@ -16,8 +16,8 @@ function sceneEntities(prefix) { imageId: 'MAT_CAP_IMG', wrapModeU: 'clampToEdge', wrapModeV: 'clampToEdge', - flipY: true - } + flipY: true, + }, }, { id: 'MAT_CAP_IMG', @@ -26,7 +26,7 @@ function sceneEntities(prefix) { name: 'Mat Cap Image', width: 256, height: 256, - stream: false + stream: false, }, representations: [ { @@ -36,10 +36,10 @@ function sceneEntities(prefix) { contentEncoding: 'identity', width: 256, height: 256, - compression: 'zip' - } - ] - } + compression: 'zip', + }, + ], + }, ]; } diff --git a/src/lib/viewers/box3d/model3d/__tests__/Model3DControls-test.js b/src/lib/viewers/box3d/model3d/__tests__/Model3DControls-test.js index c86fba26a..70574aad8 100644 --- a/src/lib/viewers/box3d/model3d/__tests__/Model3DControls-test.js +++ b/src/lib/viewers/box3d/model3d/__tests__/Model3DControls-test.js @@ -12,7 +12,7 @@ import { EVENT_SET_WIREFRAMES_VISIBLE, EVENT_SET_GRID_VISIBLE, EVENT_TOGGLE_ANIMATION, - EVENT_TOGGLE_HELPERS + EVENT_TOGGLE_HELPERS, } from '../model3DConstants'; import { ICON_3D_RESET, ICON_ANIMATION, ICON_GEAR, ICON_PAUSE, ICON_PLAY } from '../../../../icons/icons'; @@ -87,7 +87,7 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { it('should add an event listener to the animationClipsPullup reference for animation clip selection', () => { expect(animationListenStub).to.be.calledWith( EVENT_SELECT_ANIMATION_CLIP, - controls.handleSelectAnimationClip + controls.handleSelectAnimationClip, ); }); @@ -96,7 +96,7 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { __('box3d_toggle_animation'), controls.handleToggleAnimation, '', - ICON_PLAY + ICON_PLAY, ); }); @@ -105,13 +105,13 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { __('box3d_animation_clips'), controls.handleToggleAnimationClips, '', - ICON_ANIMATION + ICON_ANIMATION, ); }); it('should append the pullup of the animationClipsPullup to the parent element of the hide/show toggle', () => { expect(controls.animationClipButtonEl.parentNode).to.contain( - controls.animationClipsPullup.pullupEl + controls.animationClipsPullup.pullupEl, ); }); }); @@ -121,31 +121,31 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { const events = [ { event: EVENT_SET_RENDER_MODE, - callback: 'handleSetRenderMode' + callback: 'handleSetRenderMode', }, { event: EVENT_SET_SKELETONS_VISIBLE, - callback: 'handleSetSkeletonsVisible' + callback: 'handleSetSkeletonsVisible', }, { event: EVENT_SET_WIREFRAMES_VISIBLE, - callback: 'handleSetWireframesVisible' + callback: 'handleSetWireframesVisible', }, { event: EVENT_SET_GRID_VISIBLE, - callback: 'handleSetGridVisible' + callback: 'handleSetGridVisible', }, { event: EVENT_SET_CAMERA_PROJECTION, - callback: 'handleSetCameraProjection' + callback: 'handleSetCameraProjection', }, { event: EVENT_ROTATE_ON_AXIS, - callback: 'handleAxisRotation' - } + callback: 'handleAxisRotation', + }, ]; - events.forEach((e) => { + events.forEach(e => { it(`should add an event listener for ${e.event} events`, () => { const settingsListenStub = sandbox.stub(controls.settingsPullup, 'addListener'); controls.addUi(); @@ -160,7 +160,7 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { __('box3d_settings'), controls.handleToggleSettings, '', - ICON_GEAR + ICON_GEAR, ); }); @@ -210,7 +210,10 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { }); it('should emit an event to hide 3D scene helpers', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_TOGGLE_HELPERS, false); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_TOGGLE_HELPERS, false); controls.hidePullups(); }); }); @@ -229,20 +232,29 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { }); it('should emit an event to toggle the 3D scene helpers', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_TOGGLE_HELPERS); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_TOGGLE_HELPERS); controls.handleToggleSettings(); }); }); describe('handleSetRenderMode()', () => { it('should fire the "render mode set" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_RENDER_MODE); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_RENDER_MODE); controls.handleSetRenderMode(); }); it('should fire the "render mode set" event with the new render mode', () => { const renderMode = 'normals'; - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_RENDER_MODE, renderMode); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_RENDER_MODE, renderMode); controls.handleSetRenderMode(renderMode); }); @@ -256,62 +268,92 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { describe('handleSetSkeletonsVisible()', () => { it('should fire a "set skeleton visiblity" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_SKELETONS_VISIBLE); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_SKELETONS_VISIBLE); controls.handleSetSkeletonsVisible(); }); it('should fire a "set skeleton visiblity" event with a flag to turn them on and off explicitly', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_SKELETONS_VISIBLE, true); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_SKELETONS_VISIBLE, true); controls.handleSetSkeletonsVisible(true); }); }); describe('handleSetWireframesVisible()', () => { it('should fire a "set wireframe visiblity" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_WIREFRAMES_VISIBLE); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_WIREFRAMES_VISIBLE); controls.handleSetWireframesVisible(); }); it('should fire a "set wireframe visiblity" event with a flag to turn them on and off explicitly', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_WIREFRAMES_VISIBLE, true); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_WIREFRAMES_VISIBLE, true); controls.handleSetWireframesVisible(true); }); }); describe('handleSetGridVisible()', () => { it('should fire a "set grid visiblity" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_GRID_VISIBLE); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_GRID_VISIBLE); controls.handleSetGridVisible(); }); it('should fire a "set grid visiblity" event with a flag to turn them on and off explicitly', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_GRID_VISIBLE, true); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_GRID_VISIBLE, true); controls.handleSetGridVisible(true); }); }); describe('handleSetCameraProjection()', () => { it('should fire a "set camera visibility" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_CAMERA_PROJECTION); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_CAMERA_PROJECTION); controls.handleSetCameraProjection(); }); it('should fire a "set camera visibility" event with a projection mode', () => { const projection = 'orthographic'; - sandbox.mock(controls).expects('emit').withArgs(EVENT_SET_CAMERA_PROJECTION, projection); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_SET_CAMERA_PROJECTION, projection); controls.handleSetCameraProjection(projection); }); }); describe('handleAxisRotation()', () => { it('should fire a "rotate on axis" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_ROTATE_ON_AXIS); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_ROTATE_ON_AXIS); controls.handleAxisRotation(); }); it('should fire a "rotate on axis" event with an axis to rotate on', () => { const axis = '-x'; - sandbox.mock(controls).expects('emit').withArgs(EVENT_ROTATE_ON_AXIS, axis); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_ROTATE_ON_AXIS, axis); controls.handleAxisRotation(axis); }); }); @@ -324,14 +366,14 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { controls.animationToggleEl = { classList: { add: () => {}, - remove: () => {} - } + remove: () => {}, + }, }; controls.animationClipButtonEl = { classList: { add: () => {}, - remove: () => {} - } + remove: () => {}, + }, }; clipMock = sandbox.mock(controls.animationToggleEl.classList); @@ -447,7 +489,7 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { describe('setAnimationPlaying()', () => { beforeEach(() => { controls.animationToggleEl = { - innerHTML: '' + innerHTML: '', }; }); @@ -468,12 +510,18 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { }); it('should emit an "animation toggled" event', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_TOGGLE_ANIMATION); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_TOGGLE_ANIMATION); controls.setAnimationPlaying(false); }); it('should emit an "animation toggled" event with the current state of animation playback', () => { - sandbox.mock(controls).expects('emit').withArgs(EVENT_TOGGLE_ANIMATION, false); + sandbox + .mock(controls) + .expects('emit') + .withArgs(EVENT_TOGGLE_ANIMATION, false); controls.setAnimationPlaying(false); }); }); @@ -483,13 +531,19 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { const id = '1234'; const name = 'my_clip'; const duration = 10; - sandbox.mock(controls.animationClipsPullup).expects('addClip').withExactArgs(id, name, duration); + sandbox + .mock(controls.animationClipsPullup) + .expects('addClip') + .withExactArgs(id, name, duration); controls.addAnimationClip(id, name, duration); }); it('should invoke animationClipsPullup.selectClip(), via selectAnimationClip()', () => { const id = '1234'; - sandbox.mock(controls.animationClipsPullup).expects('selectClip').withExactArgs(id); + sandbox + .mock(controls.animationClipsPullup) + .expects('selectClip') + .withExactArgs(id); controls.selectAnimationClip(id); }); }); @@ -510,7 +564,10 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { it('should invoke settingsPullup.onProjectionSelected() with the new projection mode', () => { const mode = 'orthographic'; - sandbox.mock(controls.settingsPullup).expects('onProjectionSelected').withArgs(mode); + sandbox + .mock(controls.settingsPullup) + .expects('onProjectionSelected') + .withArgs(mode); controls.setCurrentProjectionMode(mode); }); @@ -521,7 +578,10 @@ describe('lib/viewers/box3d/model3d/Model3DControls', () => { it('should invoke settingsPullup.setCurrentProjectionMode() with the new projection mode', () => { const mode = 'orthographic'; - sandbox.mock(controls.settingsPullup).expects('setCurrentProjectionMode').withArgs(mode); + sandbox + .mock(controls.settingsPullup) + .expects('setCurrentProjectionMode') + .withArgs(mode); controls.setCurrentProjectionMode(mode); }); }); diff --git a/src/lib/viewers/box3d/model3d/__tests__/Model3DLoader-test.js b/src/lib/viewers/box3d/model3d/__tests__/Model3DLoader-test.js index fad301936..37bad61d6 100644 --- a/src/lib/viewers/box3d/model3d/__tests__/Model3DLoader-test.js +++ b/src/lib/viewers/box3d/model3d/__tests__/Model3DLoader-test.js @@ -13,10 +13,10 @@ describe('lib/viewers/box3d/model3d/Model3DLoader', () => { representations: { entries: [ { - representation: '3d' - } - ] - } + representation: '3d', + }, + ], + }, }; }); @@ -26,31 +26,31 @@ describe('lib/viewers/box3d/model3d/Model3DLoader', () => { }); describe('determineViewer()', () => { - it('should throw an error if browser doesn\'t support 3D and it is a 3d file', () => { + it("should throw an error if browser doesn't support 3D and it is a 3d file", () => { sandbox.stub(Browser, 'supportsModel3D').returns(false); expect(() => Model3DLoader.determineViewer(file)).to.throw( PreviewError, - /browser doesn't support preview for 3D models/ + /browser doesn't support preview for 3D models/, ); }); - it('should not throw an error if browser doesn\'t support 3D and it is a non 3d file', () => { + it("should not throw an error if browser doesn't support 3D and it is a non 3d file", () => { file = { extension: 'pdf', name: 'blah.pdf', representations: { entries: [ { - representation: 'pdf' - } - ] - } + representation: 'pdf', + }, + ], + }, }; sandbox.stub(Browser, 'supportsModel3D').returns(false); expect(() => Model3DLoader.determineViewer(file)).to.not.throw( PreviewError, - /browser doesn't support preview for 3D models/ + /browser doesn't support preview for 3D models/, ); }); diff --git a/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js b/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js index 7c673458f..ceda65412 100644 --- a/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js +++ b/src/lib/viewers/box3d/model3d/__tests__/Model3DRenderer-test.js @@ -10,7 +10,7 @@ import { EVENT_RESET_SKELETONS, EVENT_SET_RENDER_MODE, EVENT_SET_SKELETONS_VISIBLE, - EVENT_SET_WIREFRAMES_VISIBLE + EVENT_SET_WIREFRAMES_VISIBLE, } from '../model3DConstants'; describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { @@ -35,18 +35,18 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { stubs.BoxSDK = sandbox.stub(window, 'BoxSDK'); renderer = new Model3DRenderer(containerEl, {}); app = { - getComponentByScriptId: () => {} + getComponentByScriptId: () => {}, }; animationComp = { setAsset: () => null, - setLoop: () => null + setLoop: () => null, }; instance = { trigger: () => null, once: (name, fn) => fn(), id: 'INSTANCE_ID', addComponent: () => null, - getComponentByScriptId: (id) => (id === 'animation' ? animationComp : {}) + getComponentByScriptId: id => (id === 'animation' ? animationComp : {}), }; scene = { addChild: () => {}, @@ -54,20 +54,20 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { when: () => {}, runtimeData: { add: () => {}, - remove: () => {} + remove: () => {}, }, - getDescendantByName: () => instance + getDescendantByName: () => instance, }; animation = { id: 'my_animation', isLoading: () => true, - when: () => {} + when: () => {}, }; renderer.box3d = { importEntitiesFromUrl: () => Promise.resolve(), canvas: { addEventListener: () => {}, - removeEventListener: () => {} + removeEventListener: () => {}, }, createNode: () => {}, destroy: () => {}, @@ -75,17 +75,17 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { getAssetsByType: () => [], getAssetsByClass: () => [animation], getAssetById: () => {}, - getEntityById: (id) => { + getEntityById: id => { return id === 'SCENE_ID' ? scene : undefined; }, getEntitiesByType: () => [], - getObjectByClass: (classType) => { + getObjectByClass: classType => { return classType === Box3D.SceneObject ? scene : undefined; }, getVrDisplay: () => {}, off: () => {}, on: () => {}, - trigger: () => {} + trigger: () => {}, }; renderMock = sandbox.mock(renderer); }); @@ -131,9 +131,9 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { }); describe('load()', () => { - it('should do nothing with scene entities if location is not present in options', (done) => { + it('should do nothing with scene entities if location is not present in options', done => { const options = { file: { id: 'dummyId' } }; - sandbox.stub(renderer, 'initBox3d').callsFake((opts) => { + sandbox.stub(renderer, 'initBox3d').callsFake(opts => { expect(opts.sceneEntities).to.not.exist; done(); return Promise.resolve(); @@ -142,13 +142,13 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { renderer.load('', options); }); - it('should assign sceneEntities to the passed in options object', (done) => { + it('should assign sceneEntities to the passed in options object', done => { const options = { location: { - staticBaseURI: '' - } + staticBaseURI: '', + }, }; - sandbox.stub(renderer, 'initBox3d').callsFake((opts) => { + sandbox.stub(renderer, 'initBox3d').callsFake(opts => { expect(opts.sceneEntities).to.exist; done(); return Promise.resolve(); @@ -160,18 +160,18 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should initialize the box3d runtime', () => { const options = { location: { - staticBaseURI: '' + staticBaseURI: '', }, file: { - id: '' - } + id: '', + }, }; renderMock.expects('initBox3d').returns(Promise.resolve()); sandbox.stub(renderer, 'loadBox3dFile'); renderer.load('', options); }); - it('should load the box3d file after initializing the runtime', (done) => { + it('should load the box3d file after initializing the runtime', done => { const options = { file: { id: '' } }; renderMock.expects('initBox3d').returns(Promise.resolve()); renderMock.expects('loadBox3dFile').returns(Promise.resolve()); @@ -180,7 +180,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { }); }); - it('should setup the scene via onUnsupportedRepresentation() if it cannot load the model', (done) => { + it('should setup the scene via onUnsupportedRepresentation() if it cannot load the model', done => { const options = { file: { id: '' } }; renderMock.expects('onUnsupportedRepresentation'); sandbox.stub(renderer, 'loadBox3dFile').callsFake(() => Promise.reject()); @@ -192,7 +192,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { let renderMode; beforeEach(() => { renderMode = { - setAttribute: () => {} + setAttribute: () => {}, }; sandbox .mock(app) @@ -217,7 +217,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { renderer.loadBox3dFile(''); }); - it('should setup the scene via setupScene() if it can successfully load the model', (done) => { + it('should setup the scene via setupScene() if it can successfully load the model', done => { sandbox.mock(renderer.box3d, 'setupScene', () => {}); renderMock.expects('setupScene').called; renderer.loadBox3dFile('').then(() => done()); @@ -289,7 +289,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { expect(stub).to.be.called; }); - it('should invoke parent\'s reset()', () => { + it("should invoke parent's reset()", () => { sandbox.stub(renderer, 'resetModel'); const stub = sandbox.stub(Box3DRenderer.prototype, 'reset'); renderer.reset(); @@ -307,7 +307,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { scaleToSize: () => {}, unsetProperty: () => {}, getComponentByScriptId: () => {}, - runtimeData: {} + runtimeData: {}, }; }); @@ -325,7 +325,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { setPosition: () => {}, setQuaternion: () => {}, setScale: () => {}, - unsetProperty: () => {} + unsetProperty: () => {}, }; sandbox.stub(renderer.instance, 'getChildren').returns([child]); sandbox @@ -340,7 +340,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { setPosition: () => {}, setQuaternion: () => {}, setScale: () => {}, - unsetProperty: () => {} + unsetProperty: () => {}, }; sandbox.stub(renderer.instance, 'getChildren').returns([child]); sandbox @@ -355,7 +355,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { setPosition: () => {}, setQuaternion: () => {}, setScale: () => {}, - unsetProperty: () => {} + unsetProperty: () => {}, }; sandbox.stub(renderer.instance, 'getChildren').returns([child]); sandbox @@ -376,10 +376,10 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { orbitComp = { setPivotPosition: () => {}, setOrbitDistance: () => {}, - reset: () => {} + reset: () => {}, }; camera = { - getComponentByScriptId: () => {} + getComponentByScriptId: () => {}, }; renderer.instance = { getCenter: () => { @@ -392,8 +392,8 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { destroy: () => {}, runtimeData: { matrixWorld: {}, - updateMatrixWorld: () => {} - } + updateMatrixWorld: () => {}, + }, }; sandbox.stub(renderer, 'getCamera').callsFake(() => camera); }); @@ -464,7 +464,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { const videos = []; beforeEach(() => { - sandbox.stub(renderer.box3d, 'getEntitiesByType').callsFake((type) => { + sandbox.stub(renderer.box3d, 'getEntitiesByType').callsFake(type => { switch (type) { case 'animation': return animations; @@ -485,12 +485,12 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { const vid1 = { isLoading: () => false, when: () => {}, - play: sandbox.stub() + play: sandbox.stub(), }; const vid2 = { isLoading: () => false, when: () => {}, - play: sandbox.stub() + play: sandbox.stub(), }; videos.push(vid1, vid2); renderer.onSceneLoad(); @@ -505,7 +505,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { let animAsset; beforeEach(() => { animAsset = { - when: () => {} + when: () => {}, }; animComp = { asset: animAsset, @@ -515,14 +515,14 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { setAsset: () => {}, setClipId: () => {}, setLoop: () => {}, - stop: () => {} + stop: () => {}, }; renderer.instance = { alignToPosition: () => {}, destroy: () => {}, getComponentByScriptId: () => animComp, scaleToSize: () => {}, - when: () => {} + when: () => {}, }; }); @@ -546,7 +546,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should set the current animation being used by the component to the one passed in', () => { const asset = { - id: 'my_animation' + id: 'my_animation', }; sandbox .mock(animComp) @@ -733,20 +733,20 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { beforeEach(() => { grid = { material: { - dispose: sandbox.stub() + dispose: sandbox.stub(), }, geometry: { - dispose: sandbox.stub() - } + dispose: sandbox.stub(), + }, }; renderer.grid = grid; axis = { material: { - dispose: sandbox.stub() + dispose: sandbox.stub(), }, geometry: { - dispose: sandbox.stub() - } + dispose: sandbox.stub(), + }, }; renderer.axisDisplay = axis; }); @@ -823,7 +823,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should toggle axis display visiblity', () => { renderer.axisDisplay = { - visible: true + visible: true, }; renderer.toggleHelpers(); expect(renderer.axisDisplay.visible).to.be.false; @@ -831,7 +831,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should set the axis display to flag passed in', () => { renderer.axisDisplay = { - visible: undefined + visible: undefined, }; renderer.toggleHelpers(true); expect(renderer.axisDisplay.visible).to.be.true; @@ -839,7 +839,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should tell the runtime to re-render', () => { renderer.axisDisplay = { - visible: true + visible: true, }; renderer.toggleHelpers(); expect(renderer.box3d.needsRender).to.be.true; @@ -907,7 +907,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { setProperty: () => {}, getProperty: () => { return 'perspective'; - } + }, }; }); @@ -917,7 +917,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { expect(renderer.setCameraProjection(CAMERA_PROJECTION_PERSPECTIVE)).to.not.throw; }); - it('should set the perspective properties of the camera if perspective mode is selected', (done) => { + it('should set the perspective properties of the camera if perspective mode is selected', done => { sandbox.stub(renderer, 'getCamera').returns(camera); sandbox.stub(camera, 'setProperty').callsFake((prop, value) => { expect(prop).to.equal('cameraType'); @@ -927,7 +927,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { renderer.setCameraProjection(CAMERA_PROJECTION_PERSPECTIVE); }); - it('should set the orthographic properties of the camera if ortho mode is selected', (done) => { + it('should set the orthographic properties of the camera if ortho mode is selected', done => { sandbox.stub(renderer, 'getCamera').returns(camera); sandbox.stub(camera, 'setProperty').callsFake((prop, value) => { expect(prop).to.equal('cameraType'); @@ -955,7 +955,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { renderer.instance = { trigger: () => {}, getCenter: sandbox.stub().returns(center), - destroy: () => {} + destroy: () => {}, }; }); @@ -1056,7 +1056,7 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should cause a change in grid visibility', () => { renderer.grid = { - visible: false + visible: false, }; renderer.setGridVisible(true); expect(renderer.grid.visible).to.equal(true); @@ -1088,11 +1088,11 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { it('should enable the grid to be visible if the vr device has positional tracking capabilities', () => { const device = { capabilities: { - hasPosition: true - } + hasPosition: true, + }, }; renderer.grid = { - visible: false + visible: false, }; sandbox.stub(renderer.box3d, 'getVrDisplay').returns(device); renderer.enableVr(); @@ -1126,20 +1126,20 @@ describe('lib/viewers/box3d/model3d/Model3DRenderer', () => { const pos = { set: () => {}, applyQuaternion: () => {}, - add: () => {} + add: () => {}, }; position = sandbox.mock(pos); quaternion = { x: 1, y: 2, z: 3, w: 1 }; orbitCam = { getOrbitDistance: () => orbitDist, - pivotPoint: { position: pos } + pivotPoint: { position: pos }, }; camera = { runtimeData: { quaternion, - position: pos + position: pos, }, - getComponentByScriptId: () => orbitCam + getComponentByScriptId: () => orbitCam, }; sandbox .mock(renderer) diff --git a/src/lib/viewers/box3d/model3d/__tests__/Model3DViewer-test.js b/src/lib/viewers/box3d/model3d/__tests__/Model3DViewer-test.js index 1720edd60..fd1fa759c 100644 --- a/src/lib/viewers/box3d/model3d/__tests__/Model3DViewer-test.js +++ b/src/lib/viewers/box3d/model3d/__tests__/Model3DViewer-test.js @@ -13,7 +13,7 @@ import { EVENT_SET_WIREFRAMES_VISIBLE, EVENT_SET_GRID_VISIBLE, EVENT_TOGGLE_ANIMATION, - EVENT_TOGGLE_HELPERS + EVENT_TOGGLE_HELPERS, } from '../model3DConstants'; const sandbox = sinon.sandbox.create(); @@ -36,15 +36,15 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { file: { id: 0, file_version: { - id: 1 - } + id: 1, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -66,7 +66,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { hidePullups: () => {}, removeListener: () => {}, removeAllListeners: () => {}, - destroy: () => {} + destroy: () => {}, }; model3d.renderer = { destroy: () => {}, @@ -89,7 +89,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { setCameraProjection: () => {}, toggleHelpers: () => {}, setWireframesVisible: () => {}, - setGridVisible: () => {} + setGridVisible: () => {}, }; model3d.postLoad(); @@ -115,15 +115,15 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { file: { id: 0, file_version: { - id: 1 - } + id: 1, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); m3d.containerEl = containerEl; @@ -143,29 +143,29 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { file: { id: 0, file_version: { - id: 1 - } + id: 1, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); m3d.controls = { on: () => {}, hidePullups: () => {}, removeListener: () => {}, removeAllListeners: () => {}, - destroy: () => {} + destroy: () => {}, }; m3d.renderer = { load: () => Promise.resolve(), on: () => {}, removeListener: () => {}, removeAllListeners: () => {}, - destroy: () => {} + destroy: () => {}, }; }); @@ -176,40 +176,40 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { const eventBindings = [ { event: EVENT_ROTATE_ON_AXIS, - callback: 'handleRotateOnAxis' + callback: 'handleRotateOnAxis', }, { event: EVENT_SELECT_ANIMATION_CLIP, - callback: 'handleSelectAnimationClip' + callback: 'handleSelectAnimationClip', }, { event: EVENT_SET_CAMERA_PROJECTION, - callback: 'handleSetCameraProjection' + callback: 'handleSetCameraProjection', }, { event: EVENT_SET_RENDER_MODE, - callback: 'handleSetRenderMode' + callback: 'handleSetRenderMode', }, { event: EVENT_SET_SKELETONS_VISIBLE, - callback: 'handleShowSkeletons' + callback: 'handleShowSkeletons', }, { event: EVENT_SET_WIREFRAMES_VISIBLE, - callback: 'handleShowWireframes' + callback: 'handleShowWireframes', }, { event: EVENT_SET_GRID_VISIBLE, - callback: 'handleShowGrid' + callback: 'handleShowGrid', }, { event: EVENT_TOGGLE_ANIMATION, - callback: 'handleToggleAnimation' + callback: 'handleToggleAnimation', }, { event: EVENT_TOGGLE_HELPERS, - callback: 'handleToggleHelpers' - } + callback: 'handleToggleHelpers', + }, ]; describe('attachEventHandlers()', () => { @@ -220,7 +220,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); describe('with controls enabled', () => { - eventBindings.forEach((binding) => { + eventBindings.forEach(binding => { it(`should create an event listener for ${binding.event} events`, () => { const onStub = sandbox.stub(m3d.controls, 'on'); m3d.attachEventHandlers(); @@ -238,7 +238,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); describe('with controls enabled', () => { - eventBindings.forEach((binding) => { + eventBindings.forEach(binding => { it(`should remove an event listener for ${binding.event} events`, () => { const removeStub = sandbox.stub(m3d.controls, 'removeListener'); m3d.detachEventHandlers(); @@ -273,12 +273,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { model3d.handleReset(); }); - it('should populate animation controls after the scene has been loaded', (done) => { + it('should populate animation controls after the scene has been loaded', done => { const meta = { - get: () => Promise.resolve({ status: 200, response: {} }) + get: () => Promise.resolve({ status: 200, response: {} }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; const stub = sandbox.stub(model3d, 'populateAnimationControls'); @@ -296,7 +296,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { beforeEach(() => { controls = model3d.controls; // eslint-disable-line prefer-destructuring model3d.renderer.box3d = { - getEntitiesByType: () => {} + getEntitiesByType: () => {}, }; b3dMock = sandbox.mock(model3d.renderer.box3d); controlMock = sandbox.mock(model3d.controls); @@ -322,7 +322,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should get animation clip data for the first animation loaded', () => { const animation = { - getClipIds: () => [] + getClipIds: () => [], }; b3dMock .expects('getEntitiesByType') @@ -334,17 +334,17 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should add animation clip data for the first animation loaded', () => { const animation = { getClipIds: () => {}, - getClip: () => {} + getClip: () => {}, }; const clipOne = { start: 0, stop: 1, - name: 'one' + name: 'one', }; const clipTwo = { start: 0, stop: 2, - name: 'two' + name: 'two', }; const animMock = sandbox.mock(animation); animMock.expects('getClipIds').returns(['1', '2']); @@ -363,7 +363,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should not show animation controls if no animation clips loaded', () => { const animation = { - getClipIds: () => [] + getClipIds: () => [], }; b3dMock .expects('getEntitiesByType') @@ -376,7 +376,7 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should not select the first animation clip if no clips loaded', () => { const animation = { - getClipIds: () => [] + getClipIds: () => [], }; b3dMock .expects('getEntitiesByType') @@ -390,12 +390,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should show animation controls when animation is loaded', () => { const animation = { getClipIds: () => {}, - getClip: () => {} + getClip: () => {}, }; const clipOne = { start: 0, stop: 1, - name: 'one' + name: 'one', }; const animMock = sandbox.mock(animation); animMock.expects('getClipIds').returns(['1']); @@ -412,12 +412,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { it('should select the first available animation clip, when loaded', () => { const animation = { getClipIds: () => {}, - getClip: () => {} + getClip: () => {}, }; const clipOne = { start: 0, stop: 1, - name: 'one' + name: 'one', }; const animMock = sandbox.mock(animation); animMock.expects('getClipIds').returns(['1']); @@ -456,12 +456,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { model3d.handleRotationAxisSet(up, forward); }); - it('should rotate the object to the values saved in metadata, if different than defaults', (done) => { + it('should rotate the object to the values saved in metadata, if different than defaults', done => { const meta = { - get: () => Promise.resolve({ status: 200, response: { upAxis: '-z' } }) + get: () => Promise.resolve({ status: 200, response: { upAxis: '-z' } }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; sandbox.stub(model3d, 'handleReset'); @@ -475,12 +475,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); }); - it('should not rotate the object if metadata matches defaults', (done) => { + it('should not rotate the object if metadata matches defaults', done => { const meta = { - get: () => Promise.resolve({ status: 200, response: {} }) + get: () => Promise.resolve({ status: 200, response: {} }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; sandbox.stub(model3d, 'handleReset'); @@ -584,12 +584,12 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); describe('scene load errors', () => { - it('should throw an error when metadata response code != 200', (done) => { + it('should throw an error when metadata response code != 200', done => { const meta = { - get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }) + get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; const onErrorStub = sandbox.stub(model3d, 'onMetadataError'); @@ -600,13 +600,13 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); }); - it('should should invoke onMetadataError() when issues loading metadata', (done) => { + it('should should invoke onMetadataError() when issues loading metadata', done => { const errStub = sandbox.stub(model3d, 'onMetadataError'); const meta = { - get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }) + get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; model3d.handleSceneLoaded().catch(() => { @@ -615,14 +615,14 @@ describe('lib/viewers/box3d/model3d/Model3DViewer', () => { }); }); - it('should still advance the promise chain for ui setup after failed metadata load', (done) => { + it('should still advance the promise chain for ui setup after failed metadata load', done => { sandbox.stub(model3d, 'onMetadataError'); const addUi = sandbox.stub(model3d.controls, 'addUi'); const meta = { - get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }) + get: () => Promise.resolve({ status: 404, response: { status: 'metadata not found' } }), }; model3d.boxSdk = { - getMetadataClient: () => meta + getMetadataClient: () => meta, }; model3d.handleSceneLoaded().catch(() => { diff --git a/src/lib/viewers/box3d/video360/SceneEntities.js b/src/lib/viewers/box3d/video360/SceneEntities.js index 2bf77c0f7..dd73ed64b 100644 --- a/src/lib/viewers/box3d/video360/SceneEntities.js +++ b/src/lib/viewers/box3d/video360/SceneEntities.js @@ -8,14 +8,14 @@ export default [ properties: { near: 0.05, // Camera near-plane distance far: 200, - fov: 70 + fov: 70, }, components: [ // The render view controls how the scene is rendered: regular, UV-only, normal-only, etc. { name: 'Render View', enabled: true, - scriptId: 'vr_render_view' + scriptId: 'vr_render_view', }, { name: 'Orbit Camera', @@ -23,17 +23,17 @@ export default [ panEnabled: false, zoomEnabled: true, inertialDamping: 0.2, - lookSpeed: 0.5 + lookSpeed: 0.5, }, enabled: true, - scriptId: 'orbit_camera' + scriptId: 'orbit_camera', }, { name: 'VR Camera Controller', enabled: true, - scriptId: 'vr_camera_controller' - } - ] + scriptId: 'vr_camera_controller', + }, + ], }, { id: 'SCENE_ID', @@ -44,34 +44,34 @@ export default [ { name: 'Skybox', attributes: { - size: 100 + size: 100, }, scriptId: 'skybox_renderer', - enabled: false - } - ] + enabled: false, + }, + ], }, { id: 'APP_ASSET_ID', type: 'application', properties: { - startupSceneId: 'SCENE_ID' // The scene to load + startupSceneId: 'SCENE_ID', // The scene to load }, components: [ { name: 'Renderer', attributes: { antialias: !Browser.isMobile(), - renderOnDemand: true + renderOnDemand: true, }, scriptId: 'box3d_renderer', isBuiltIn: true, - enabled: true + enabled: true, }, { name: 'Debug Performance', scriptId: 'debug_performance', - enabled: false + enabled: false, }, { name: 'Input', @@ -92,7 +92,7 @@ export default [ contextMenu: true, preventContextMenuDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, touchEvents: { enable: true, @@ -105,21 +105,21 @@ export default [ move: true, preventMoveDefault: true, dragBufferDistance: 12, - eventHandler: true + eventHandler: true, }, keyEvents: { enable: true, down: true, up: true, preventDefault: false, - eventHandler: true - } - } + eventHandler: true, + }, + }, }, { name: 'VR Presenter', - scriptId: 'vr_presenter' - } - ] - } + scriptId: 'vr_presenter', + }, + ], + }, ]; diff --git a/src/lib/viewers/box3d/video360/Video360Loader.js b/src/lib/viewers/box3d/video360/Video360Loader.js index c28586cd6..f0112d344 100644 --- a/src/lib/viewers/box3d/video360/Video360Loader.js +++ b/src/lib/viewers/box3d/video360/Video360Loader.js @@ -19,7 +19,7 @@ const VIDEO_FORMATS = [ 'mpg', 'mts', 'qt', - 'wmv' + 'wmv', ]; const BROWSERS_SUPPORTED = ['Chrome', 'Edge', 'Firefox', 'Opera', 'Safari']; @@ -28,8 +28,8 @@ const VIEWERS = [ NAME: 'Video360', CONSTRUCTOR: Video360Viewer, REP: 'dash', - EXT: VIDEO_FORMATS - } + EXT: VIDEO_FORMATS, + }, ]; class Video360Loader extends Base360Loader { @@ -52,7 +52,7 @@ class Video360Loader extends Base360Loader { // Check to see if we support playback in this browser // https://bugs.webkit.org/show_bug.cgi?id=135379 - const isSupportedBrowser = BROWSERS_SUPPORTED.some((browserName) => browserName === name); + const isSupportedBrowser = BROWSERS_SUPPORTED.some(browserName => browserName === name); // If a 360 viewer but isn't a valid browser OR // If a 360 viewer but it is on IOS OR diff --git a/src/lib/viewers/box3d/video360/Video360Viewer.js b/src/lib/viewers/box3d/video360/Video360Viewer.js index 6d41c9d47..e1c0414af 100644 --- a/src/lib/viewers/box3d/video360/Video360Viewer.js +++ b/src/lib/viewers/box3d/video360/Video360Viewer.js @@ -14,7 +14,7 @@ const VIDEO_TEXTURE_PROPS = { minFilter: 'linear', magFilter: 'linear', wrapModeV: 'clampToEdge', - wrapModeU: 'clampToEdge' + wrapModeU: 'clampToEdge', }; class Video360Viewer extends DashViewer { @@ -206,15 +206,15 @@ class Video360Viewer extends DashViewer { generateMipmaps: false, querySelector: `.${this.mediaContainerEl.className} video`, autoPlay: false, - muted: false + muted: false, }, - VIDEO_ID + VIDEO_ID, ); // Texture props references the ID of the video texture created above, "VIDEO_ID" this.textureAsset = this.renderer.getBox3D().createTexture2d(VIDEO_TEXTURE_PROPS, 'VIDEO_TEX_ID'); - return new Promise((resolve) => { + return new Promise(resolve => { this.textureAsset.load(() => { this.skybox.setAttribute('skyboxTexture', this.textureAsset.id); this.skybox.enable(); diff --git a/src/lib/viewers/box3d/video360/__tests__/Video360Controls-test.js b/src/lib/viewers/box3d/video360/__tests__/Video360Controls-test.js index dc4bf10d5..428810128 100644 --- a/src/lib/viewers/box3d/video360/__tests__/Video360Controls-test.js +++ b/src/lib/viewers/box3d/video360/__tests__/Video360Controls-test.js @@ -79,12 +79,12 @@ describe('lib/viewers/box3d/video360/Video360Controls', () => { setAttribute: sandbox.stub(), appendChild: sandbox.stub().returns(iconSpanEl), classList: { - add: sandbox.stub() - } + add: sandbox.stub(), + }, }; mediaControlsEl = { - appendChild: sandbox.stub().returns(vrButtonEl) + appendChild: sandbox.stub().returns(vrButtonEl), }; sandbox.stub(Video360Controls.prototype, 'attachEventHandlers'); @@ -142,7 +142,7 @@ describe('lib/viewers/box3d/video360/Video360Controls', () => { it('should invoke .vrButtonEl.addEventListener() with args ["click", .handleToggleVr()]', () => { sandbox.stub(Video360Controls.prototype, 'addUi'); const vrButton = { - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; controls.vrButtonEl = vrButton; @@ -157,7 +157,7 @@ describe('lib/viewers/box3d/video360/Video360Controls', () => { it('should invoke .vrButtonEl.removeEventListener() with args ["click", .handleToggleVr()]', () => { sandbox.stub(Video360Controls.prototype, 'addUi'); const vrButton = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; controls.vrButtonEl = vrButton; @@ -185,8 +185,8 @@ describe('lib/viewers/box3d/video360/Video360Controls', () => { sandbox.stub(Video360Controls.prototype, 'attachEventHandlers'); const vrButton = { classList: { - remove: sandbox.stub() - } + remove: sandbox.stub(), + }, }; controls.vrButtonEl = vrButton; @@ -221,10 +221,10 @@ describe('lib/viewers/box3d/video360/Video360Controls', () => { it('should remove .vrButtonEl from control bar, if available and exists in the DOM', () => { const parent = { - removeChild: sandbox.stub() + removeChild: sandbox.stub(), }; const vrButton = { - parentElement: parent + parentElement: parent, }; controls.vrButtonEl = vrButton; diff --git a/src/lib/viewers/box3d/video360/__tests__/Video360Loader-test.js b/src/lib/viewers/box3d/video360/__tests__/Video360Loader-test.js index 39570cb28..a0a3771e4 100644 --- a/src/lib/viewers/box3d/video360/__tests__/Video360Loader-test.js +++ b/src/lib/viewers/box3d/video360/__tests__/Video360Loader-test.js @@ -17,30 +17,39 @@ describe('lib/viewers/box3d/video360/Video360Loader', () => { representations: { entries: [ { - representation: 'dash' - } - ] - } + representation: 'dash', + }, + ], + }, }; it('should throw an error if browser is not supported', () => { sandbox.stub(Browser, 'hasWebGL').returns(true); sandbox.stub(Browser, 'getName').returns('IE11'); - expect(() => Video360Loader.determineViewer(file)).to.throw(PreviewError, /support preview for 360-degree videos/); + expect(() => Video360Loader.determineViewer(file)).to.throw( + PreviewError, + /support preview for 360-degree videos/, + ); }); it('should throw an error if on iOS', () => { sandbox.stub(Browser, 'hasWebGL').returns(true); sandbox.stub(Browser, 'getName').returns('Chrome'); sandbox.stub(Browser, 'isIOS').returns(true); - expect(() => Video360Loader.determineViewer(file)).to.throw(PreviewError, /support preview for 360-degree videos/); + expect(() => Video360Loader.determineViewer(file)).to.throw( + PreviewError, + /support preview for 360-degree videos/, + ); }); it('should throw an error if browser does not support WebGL', () => { sandbox.stub(Browser, 'hasWebGL').returns(false); sandbox.stub(Browser, 'getName').returns('Chrome'); sandbox.stub(Browser, 'isIOS').returns(true); - expect(() => Video360Loader.determineViewer(file)).to.throw(PreviewError, /support preview for 360-degree videos/); + expect(() => Video360Loader.determineViewer(file)).to.throw( + PreviewError, + /support preview for 360-degree videos/, + ); }); it('should return viewer if 360 is properly supported', () => { diff --git a/src/lib/viewers/box3d/video360/__tests__/Video360Renderer-test.js b/src/lib/viewers/box3d/video360/__tests__/Video360Renderer-test.js index 0ab36bd3b..148d392a4 100644 --- a/src/lib/viewers/box3d/video360/__tests__/Video360Renderer-test.js +++ b/src/lib/viewers/box3d/video360/__tests__/Video360Renderer-test.js @@ -9,8 +9,8 @@ describe('lib/viewers/box3d/video360/Video360Renderer', () => { const OPTIONS = { token: '12345572asdfliuohhr34812348960', file: { - id: 'f_098765' - } + id: 'f_098765', + }, }; before(() => { @@ -37,7 +37,7 @@ describe('lib/viewers/box3d/video360/Video360Renderer', () => { describe('getInputController()', () => { beforeEach(() => { renderer.box3d = { - getApplication: () => {} + getApplication: () => {}, }; }); @@ -63,7 +63,7 @@ describe('lib/viewers/box3d/video360/Video360Renderer', () => { it('should invoke .getComponentByScriptName() with "Input Controller" to get Input Controller component on runtime', () => { const app = { - getComponentByScriptName: sandbox.stub().returns({}) + getComponentByScriptName: sandbox.stub().returns({}), }; sandbox.stub(renderer.box3d, 'getApplication').returns(app); const inputController = renderer.getInputController(); @@ -82,7 +82,7 @@ describe('lib/viewers/box3d/video360/Video360Renderer', () => { it('should call super.destroy()', () => { const destroyStub = sandbox.stub(); Object.defineProperty(Object.getPrototypeOf(Video360Renderer.prototype), 'destroy', { - value: destroyStub + value: destroyStub, }); renderer.destroy(); diff --git a/src/lib/viewers/box3d/video360/__tests__/Video360Viewer-test.js b/src/lib/viewers/box3d/video360/__tests__/Video360Viewer-test.js index eca2f3f8a..f73430472 100644 --- a/src/lib/viewers/box3d/video360/__tests__/Video360Viewer-test.js +++ b/src/lib/viewers/box3d/video360/__tests__/Video360Viewer-test.js @@ -12,15 +12,15 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { const options = { token: '12345572asdfliuohhr34812348960', file: { - id: 'f_098765' - } + id: 'f_098765', + }, }; const VIDEO_PROPS = { loop: false, generateMipmaps: false, querySelector: '.bp-media-container video', autoPlay: false, - muted: false + muted: false, }; // Taken from ./video360.js const VIDEO_TEXTURE_PROPS = { @@ -28,7 +28,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { minFilter: 'linear', magFilter: 'linear', wrapModeV: 'clampToEdge', - wrapModeU: 'clampToEdge' + wrapModeU: 'clampToEdge', }; let viewer; @@ -87,7 +87,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { it('should invoke skybox.setAttribute() with params "skyboxTexture" and null, if .skybox exists', () => { const spy = sandbox.spy(); const skybox = { - setAttribute: spy + setAttribute: spy, }; viewer.skybox = skybox; @@ -99,7 +99,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { it('should invoke textureAsset.destroy() if it exists', () => { const textureAsset = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; viewer.textureAsset = textureAsset; @@ -110,7 +110,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { it('should invoke videoAsset.destroy() if it exists', () => { const videoAsset = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; viewer.videoAsset = videoAsset; @@ -133,13 +133,13 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { let b3dMock; beforeEach(() => { b3dMock = { - off: sandbox.stub() + off: sandbox.stub(), }; rendererMock = { removeListener: sandbox.stub(), destroy: sandbox.stub(), - getBox3D: sandbox.stub().returns(b3dMock) + getBox3D: sandbox.stub().returns(b3dMock), }; viewer.renderer = rendererMock; @@ -172,7 +172,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { describe('getJSAssets()', () => { it('return assets including box3d-specific and WebVR JS', () => { const assets = viewer.getJSAssets(); - JS.forEach((asset) => { + JS.forEach(asset => { expect(assets.indexOf(asset) !== -1).to.be.true; }); }); @@ -184,7 +184,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { before(() => { superLoadedData = sandbox.stub(); Object.defineProperty(Object.getPrototypeOf(Video360Viewer.prototype), 'loadeddataHandler', { - value: superLoadedData + value: superLoadedData, }); }); @@ -196,7 +196,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { }); afterEach(() => { - Object.keys(stubs).forEach((key) => { + Object.keys(stubs).forEach(key => { const stub = stubs[key]; if (stub.restore) { stub.restore(); @@ -205,31 +205,31 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { viewer.renderer = null; }); - it('should create a new Video360 renderer instance', (done) => { + it('should create a new Video360 renderer instance', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(done); viewer.loadeddataHandler(); expect(viewer.renderer).to.be.an.instanceof(Video360Renderer); }); - it('should set .options.sceneEntities to the sceneEntities imported into Video360', (done) => { + it('should set .options.sceneEntities to the sceneEntities imported into Video360', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(done); viewer.loadeddataHandler(); expect(viewer.options.sceneEntities).to.deep.equal(sceneEntities); }); - it('should add custom event handler for VR Toggle to .renderer via .renderer.on()', (done) => { + it('should add custom event handler for VR Toggle to .renderer via .renderer.on()', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(done); viewer.loadeddataHandler(); expect(stubs.on).to.be.calledWith(EVENT_SHOW_VR_BUTTON, viewer.handleShowVrButton); }); - it('should invoke .renderer.initBox3d() with .options', (done) => { + it('should invoke .renderer.initBox3d() with .options', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(done); viewer.loadeddataHandler(); expect(stubs.initBox3d).to.be.calledWith(viewer.options); }); - it('should invoke .create360Environment() after successfully initializing renderer', (done) => { + it('should invoke .create360Environment() after successfully initializing renderer', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(() => { expect(stubs.create360Environment).to.be.called; done(); @@ -237,7 +237,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { viewer.loadeddataHandler(); }); - it('should invoke super.metadataloadedHandler() on successfully creating 360 environment', (done) => { + it('should invoke super.metadataloadedHandler() on successfully creating 360 environment', done => { stubs.createControls = sandbox.stub(viewer, 'createControls').callsFake(() => { expect(superLoadedData).to.be.called; done(); @@ -245,12 +245,12 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { viewer.loadeddataHandler(); }); - it('should invoke .createControls() on successfully creating 360 environment', (done) => { + it('should invoke .createControls() on successfully creating 360 environment', done => { sandbox.stub(viewer, 'createControls').callsFake(done); viewer.loadeddataHandler(); }); - it('should invoke .renderer.initVrIfPresent() on successfully creating 360 environment', (done) => { + it('should invoke .renderer.initVrIfPresent() on successfully creating 360 environment', done => { sandbox.stub(viewer, 'createControls'); stubs.initVr.restore(); stubs.initVr = sandbox.stub(Video360Renderer.prototype, 'initVr').callsFake(() => { @@ -273,8 +273,8 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { destroy: sandbox.stub(), getBox3D: sandbox.stub().returns({ canvas: document.createElement('canvas'), - off: sandbox.stub() - }) + off: sandbox.stub(), + }), }; }); @@ -314,12 +314,12 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { beforeEach(() => { controls = { removeListener: sandbox.stub(), - destroy: sandbox.stub() + destroy: sandbox.stub(), }; viewer.controls = controls; viewer.destroyControls(); canvas = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; viewer.renderer = { addListener: sandbox.stub(), @@ -327,8 +327,8 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { destroy: sandbox.stub(), getBox3D: sandbox.stub().returns({ canvas, - off: sandbox.stub() - }) + off: sandbox.stub(), + }), }; }); @@ -361,11 +361,11 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { describe('resize()', () => { it('should call resize on .renderer, if it exists', () => { Object.defineProperty(Object.getPrototypeOf(Video360Viewer.prototype), 'resize', { - value: sandbox.stub() + value: sandbox.stub(), }); viewer.renderer = { - resize: sandbox.stub() + resize: sandbox.stub(), }; viewer.resize(); @@ -384,29 +384,29 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { beforeEach(() => { skybox = { setAttribute: sandbox.stub(), - enable: sandbox.stub() + enable: sandbox.stub(), }; scene = { - getComponentByScriptId: sandbox.stub().returns(skybox) + getComponentByScriptId: sandbox.stub().returns(skybox), }; box3d = { getEntityById: sandbox.stub().returns(scene), createVideo: sandbox.stub().returns({ - setProperties: sandbox.stub() + setProperties: sandbox.stub(), }), createTexture2d: sandbox.stub().returns({ setProperties: sandbox.stub(), load: sandbox.stub().callsArg(0), - id: '12345' + id: '12345', }), - on: sandbox.stub() + on: sandbox.stub(), }; renderer = { getBox3D: sandbox.stub().returns(box3d), - getScene: sandbox.stub().returns(scene) + getScene: sandbox.stub().returns(scene), }; sandbox.stub(viewer, 'finishLoadingSetup'); @@ -450,29 +450,29 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { }); describe('load texture asset', () => { - it('should resolve the Promise returned after successfully loading .textureAsset', (done) => { + it('should resolve the Promise returned after successfully loading .textureAsset', done => { createPromise.then(done); }); - it('should invoke the texture asset\'s load() via .textureAsset.load()', () => { + it("should invoke the texture asset's load() via .textureAsset.load()", () => { expect(viewer.textureAsset.load).to.be.called; }); - it('should set the skyboxTexture attribute of the skybox component with the textureAsset via .skybox.setAttribute()', (done) => { + it('should set the skyboxTexture attribute of the skybox component with the textureAsset via .skybox.setAttribute()', done => { createPromise.then(() => { expect(skybox.setAttribute).to.be.calledWith('skyboxTexture', viewer.textureAsset.id); done(); }); }); - it('should invoke .enable() on the skybox component', (done) => { + it('should invoke .enable() on the skybox component', done => { createPromise.then(() => { expect(skybox.enable).to.have.been; done(); }); }); - it('should attach mouseDown event listener via .renderer.box3d.on()', (done) => { + it('should attach mouseDown event listener via .renderer.box3d.on()', done => { createPromise.then(() => { expect(box3d.on).to.be.calledWith('mouseDown', viewer.onCanvasMouseDown); done(); @@ -494,11 +494,11 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { beforeEach(() => { viewer.renderer = { toggleVr: sandbox.stub(), - vrEnabled: true + vrEnabled: true, }; viewer.skybox = { - setAttribute: sandbox.stub() + setAttribute: sandbox.stub(), }; }); @@ -524,7 +524,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { viewer.renderer.vrEnabled = false; viewer.mediaEl = { play: sandbox.stub(), - paused: false + paused: false, }; }); @@ -553,7 +553,7 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { describe('handleShowVrButton()', () => { it('should invoke .controls.showVrButton()', () => { viewer.controls = { - showVrButton: sandbox.stub() + showVrButton: sandbox.stub(), }; viewer.handleShowVrButton(); expect(viewer.controls.showVrButton).to.be.called; @@ -565,11 +565,11 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { describe('onCanvasMouseDown()', () => { it('should add a single use "mouseUp" event listener via .renderer.getBox3D().once()', () => { const box3d = { - once: sandbox.stub() + once: sandbox.stub(), }; viewer.renderer = { - getBox3D: sandbox.stub().returns(box3d) + getBox3D: sandbox.stub().returns(box3d), }; viewer.onCanvasMouseDown(); @@ -584,11 +584,11 @@ describe('lib/viewers/box3d/video360/Video360Viewer', () => { beforeEach(() => { input = { getPreviousMouseDragState: sandbox.stub(), - getPreviousTouchDragState: sandbox.stub() + getPreviousTouchDragState: sandbox.stub(), }; viewer.renderer = { - getInputController: sandbox.stub().returns(input) + getInputController: sandbox.stub().returns(input), }; sandbox.stub(viewer, 'togglePlay'); diff --git a/src/lib/viewers/doc/AutoCADViewer.js b/src/lib/viewers/doc/AutoCADViewer.js index 85ab7c80c..fb8d37992 100644 --- a/src/lib/viewers/doc/AutoCADViewer.js +++ b/src/lib/viewers/doc/AutoCADViewer.js @@ -28,7 +28,7 @@ class AutoCADViewer extends DocumentViewer { this.emitMetric({ name: MISSING_EXTERNAL_REFS, - data: extension + data: extension, }); } }); diff --git a/src/lib/viewers/doc/DocBaseViewer.js b/src/lib/viewers/doc/DocBaseViewer.js index 10af1f9e9..635ed6514 100644 --- a/src/lib/viewers/doc/DocBaseViewer.js +++ b/src/lib/viewers/doc/DocBaseViewer.js @@ -25,7 +25,7 @@ import { PERMISSION_DOWNLOAD, PRELOAD_REP_NAME, QUERY_PARAM_ENCODING, - STATUS_SUCCESS + STATUS_SUCCESS, } from '../../constants'; import { checkPermission, getRepresentation } from '../../file'; import { appendQueryParams, createAssetUrlCreator, getMidpoint, getDistance, getClosestPageToPinch } from '../../util'; @@ -35,7 +35,7 @@ import { ICON_ZOOM_IN, ICON_FULLSCREEN_IN, ICON_FULLSCREEN_OUT, - ICON_THUMBNAILS_TOGGLE + ICON_THUMBNAILS_TOGGLE, } from '../../icons/icons'; import { JS, PRELOAD_JS, CSS } from './docAssets'; import { ERROR_CODE, VIEWER_EVENT, LOAD_METRIC, USER_DOCUMENT_THUMBNAIL_EVENTS } from '../../events'; @@ -67,7 +67,7 @@ const THUMBNAILS_SIDEBAR_TOGGLED_MAP_KEY = 'doc-thumbnails-toggled-map'; const METRICS_WHITELIST = [ USER_DOCUMENT_THUMBNAIL_EVENTS.CLOSE, USER_DOCUMENT_THUMBNAIL_EVENTS.NAVIGATE, - USER_DOCUMENT_THUMBNAIL_EVENTS.OPEN + USER_DOCUMENT_THUMBNAIL_EVENTS.OPEN, ]; class DocBaseViewer extends BaseViewer { @@ -360,7 +360,7 @@ class DocBaseViewer extends BaseViewer { /* global PDFJS */ this.findController = new PDFJS.PDFFindController({ - pdfViewer: this.pdfViewer + pdfViewer: this.pdfViewer, }); this.pdfViewer.setFindController(this.findController); @@ -525,7 +525,7 @@ class DocBaseViewer extends BaseViewer { this.emit('zoom', { zoom: newScale, canZoomOut: true, - canZoomIn: newScale < MAX_SCALE + canZoomIn: newScale < MAX_SCALE, }); } this.pdfViewer.currentScaleValue = newScale; @@ -550,7 +550,7 @@ class DocBaseViewer extends BaseViewer { this.emit('zoom', { zoom: newScale, canZoomOut: newScale > MIN_SCALE, - canZoomIn: true + canZoomIn: true, }); } this.pdfViewer.currentScaleValue = newScale; @@ -637,20 +637,20 @@ class DocBaseViewer extends BaseViewer { // Apply encoding request to the content request if (this.encoding) { url = appendQueryParams(url, { - [QUERY_PARAM_ENCODING]: this.encoding + [QUERY_PARAM_ENCODING]: this.encoding, }); } const docInitParams = { url, - rangeChunkSize + rangeChunkSize, }; // Fix incorrectly cached range requests on older versions of iOS webkit browsers, // see: https://bugs.webkit.org/show_bug.cgi?id=82672 if (Browser.isIOS()) { docInitParams.httpHeaders = { - 'If-None-Match': 'webkit-no-cache' + 'If-None-Match': 'webkit-no-cache', }; } @@ -661,7 +661,7 @@ class DocBaseViewer extends BaseViewer { // the loading task so we can cancel if needed this.pdfLoadingTask = PDFJS.getDocument(docInitParams); return this.pdfLoadingTask - .then((doc) => { + .then(doc => { this.pdfViewer.setDocument(doc); if (this.shouldThumbnailsBeToggled()) { @@ -676,7 +676,7 @@ class DocBaseViewer extends BaseViewer { linkService.setViewer(this.pdfViewer); } }) - .catch((err) => { + .catch(err => { // eslint-disable-next-line console.error(err); @@ -687,11 +687,11 @@ class DocBaseViewer extends BaseViewer { const error = status === 202 ? new PreviewError( - ERROR_CODE.DELETED_REPS, - __('error_refresh'), - { isRepDeleted: true }, - message - ) + ERROR_CODE.DELETED_REPS, + __('error_refresh'), + { isRepDeleted: true }, + message, + ) : new PreviewError(ERROR_CODE.CONTENT_DOWNLOAD, __('error_document'), message); this.handleDownloadError(error, pdfUrl); }); @@ -709,7 +709,7 @@ class DocBaseViewer extends BaseViewer { container: this.docEl, linkService: new PDFJS.PDFLinkService(), // Enhanced text selection uses more memory, so disable on mobile - enhanceTextSelection: !this.isMobile + enhanceTextSelection: !this.isMobile, }); } @@ -773,7 +773,7 @@ class DocBaseViewer extends BaseViewer { Timer.stop(tag); this.emitMetric({ name: LOAD_METRIC.previewPreloadEvent, - data: time.elapsed + data: time.elapsed, }); Timer.reset(tag); } @@ -881,7 +881,7 @@ class DocBaseViewer extends BaseViewer { */ setupPageIds() { const pageEls = this.containerEl.querySelectorAll('.page'); - [].forEach.call(pageEls, (pageEl) => { + [].forEach.call(pageEls, pageEl => { /* eslint-disable no-param-reassign */ const { pageNumber } = pageEl.dataset; if (pageNumber) { @@ -899,7 +899,7 @@ class DocBaseViewer extends BaseViewer { * @return {Promise} Promise setting print blob */ fetchPrintBlob(pdfUrl) { - return api.get(pdfUrl, { type: 'blob' }).then((blob) => { + return api.get(pdfUrl, { type: 'blob' }).then(blob => { this.printBlob = blob; }); } @@ -1038,7 +1038,7 @@ class DocBaseViewer extends BaseViewer { __('toggle_thumbnails'), this.toggleThumbnails, 'bp-toggle-thumbnails-icon', - ICON_THUMBNAILS_TOGGLE + ICON_THUMBNAILS_TOGGLE, ); } @@ -1051,7 +1051,7 @@ class DocBaseViewer extends BaseViewer { __('enter_fullscreen'), this.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add(__('exit_fullscreen'), this.toggleFullscreen, 'bp-exit-fullscreen-icon', ICON_FULLSCREEN_OUT); } @@ -1083,7 +1083,7 @@ class DocBaseViewer extends BaseViewer { encoding: this.encoding, numPages: pagesCount, endProgress: false, // Indicate that viewer will end progress later - scale: currentScale + scale: currentScale, }); // Add page IDs to each page after page structure is available @@ -1101,7 +1101,7 @@ class DocBaseViewer extends BaseViewer { this.thumbnailsSidebar.init({ currentPage: this.pdfViewer.currentPageNumber, isOpen: this.shouldThumbnailsBeToggled(), - onSelect: this.onThumbnailSelectHandler + onSelect: this.onThumbnailSelectHandler, }); } @@ -1133,7 +1133,7 @@ class DocBaseViewer extends BaseViewer { // Set scale to current numerical scale & rendered page number this.emit('scale', { scale: this.pdfViewer.currentScale, - pageNum: pageNumber + pageNum: pageNumber, }); // Fire progressend event to hide progress bar and cleanup preload after a page is rendered @@ -1204,7 +1204,7 @@ class DocBaseViewer extends BaseViewer { if (!this.scrollStarted) { this.emit('scrollstart', { scrollTop: this.docEl.scrollTop, - scrollLeft: this.docEl.scrollLeft + scrollLeft: this.docEl.scrollLeft, }); this.scrollStarted = true; } @@ -1212,7 +1212,7 @@ class DocBaseViewer extends BaseViewer { this.scrollTimer = setTimeout(() => { this.emit('scrollend', { scrollTop: this.docEl.scrollTop, - scrollLeft: this.docEl.scrollLeft + scrollLeft: this.docEl.scrollLeft, }); this.scrollStarted = false; }, SCROLL_END_TIMEOUT); @@ -1241,18 +1241,18 @@ class DocBaseViewer extends BaseViewer { event.pageX && event.pageY ? [event.pageX, event.pageY] : getMidpoint( - event.touches[0].pageX, - event.touches[0].pageY, - event.touches[1].pageX, - event.touches[1].pageY - ); + event.touches[0].pageX, + event.touches[0].pageY, + event.touches[1].pageX, + event.touches[1].pageY, + ); // Find the page closest to the pinch const visiblePages = this.pdfViewer._getVisiblePages(); this.pinchPage = getClosestPageToPinch( this.docEl.scrollLeft + touchMidpoint[0], this.docEl.scrollTop + touchMidpoint[1], - visiblePages + visiblePages, ); // Set the scale point based on the pinch midpoint and scroll offsets @@ -1270,7 +1270,7 @@ class DocBaseViewer extends BaseViewer { event.touches[0].pageX, event.touches[0].pageY, event.touches[1].pageX, - event.touches[1].pageY + event.touches[1].pageY, ); } @@ -1289,11 +1289,11 @@ class DocBaseViewer extends BaseViewer { const scale = event.scale ? event.scale : getDistance( - event.touches[0].pageX, - event.touches[0].pageY, - event.touches[1].pageX, - event.touches[1].pageY - ) / this.originalDistance; + event.touches[0].pageX, + event.touches[0].pageY, + event.touches[1].pageX, + event.touches[1].pageY, + ) / this.originalDistance; const proposedNewScale = this.pdfViewer.currentScale * scale; if ( @@ -1341,7 +1341,7 @@ class DocBaseViewer extends BaseViewer { // Scroll to correct position after zoom this.docEl.scroll( this.scaledXOffset * this.pinchScale - this.originalXOffset, - this.scaledYOffset * this.pinchScale - this.originalYOffset + this.pinchPage.offsetTop + this.scaledYOffset * this.pinchScale - this.originalYOffset + this.pinchPage.offsetTop, ); this.isPinching = false; diff --git a/src/lib/viewers/doc/DocFindBar.js b/src/lib/viewers/doc/DocFindBar.js index e8b88af5c..1e1566b67 100644 --- a/src/lib/viewers/doc/DocFindBar.js +++ b/src/lib/viewers/doc/DocFindBar.js @@ -128,7 +128,7 @@ class DocFindBar extends EventEmitter { query: this.findFieldEl.value, phraseSearch: true, // true by default highlightAll: true, // true by default - findPrevious: findPrev + findPrevious: findPrev, }); } @@ -332,7 +332,7 @@ class DocFindBar extends EventEmitter { // Emit a metric that the user navigated forward in the find bar this.emit(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.NEXT + name: USER_DOCUMENT_FIND_EVENTS.NEXT, }); } } @@ -360,7 +360,7 @@ class DocFindBar extends EventEmitter { // Emit a metric that the user navigated back in the find bar this.emit(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.PREVIOUS + name: USER_DOCUMENT_FIND_EVENTS.PREVIOUS, }); } } @@ -383,7 +383,7 @@ class DocFindBar extends EventEmitter { this.bar.classList.remove(CLASS_HIDDEN); // Emit a metric that the user opened the find bar this.emit(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.OPEN + name: USER_DOCUMENT_FIND_EVENTS.OPEN, }); } this.findFieldEl.select(); diff --git a/src/lib/viewers/doc/DocLoader.js b/src/lib/viewers/doc/DocLoader.js index 95ae67404..e02740e12 100644 --- a/src/lib/viewers/doc/DocLoader.js +++ b/src/lib/viewers/doc/DocLoader.js @@ -16,38 +16,38 @@ const VIEWERS = [ NAME: 'Presentation', CONSTRUCTOR: PresentationViewer, REP: 'pdf', - EXT: ['gslide', 'gslides', 'odp', 'ppt', 'pptx', 'key'] + EXT: ['gslide', 'gslides', 'odp', 'ppt', 'pptx', 'key'], }, { NAME: 'AutoCAD', CONSTRUCTOR: AutoCADViewer, REP: 'pdf', - EXT: ['dwg'] + EXT: ['dwg'], }, { NAME: 'Document', CONSTRUCTOR: DocumentViewer, REP: 'pdf', - EXT: DOCUMENT_EXTENSIONS + EXT: DOCUMENT_EXTENSIONS, }, // Allows other document types to use the presentation viewer when the document viewer is disabled. { NAME: 'Presentation', CONSTRUCTOR: PresentationViewer, REP: 'pdf', - EXT: DOCUMENT_EXTENSIONS + EXT: DOCUMENT_EXTENSIONS, }, { NAME: 'SinglePage', CONSTRUCTOR: SinglePageViewer, REP: 'pdf', - EXT: DOCUMENT_EXTENSIONS + EXT: DOCUMENT_EXTENSIONS, }, { NAME: 'Document', CONSTRUCTOR: DocumentViewer, REP: ORIGINAL_REP_NAME, - EXT: ['pdf', 'lcdpdf'] + EXT: ['pdf', 'lcdpdf'], }, // Allows PDFs and lcpdf files that only have an original rep // to use the presentation viewer when the document viewer is disabled. @@ -55,14 +55,14 @@ const VIEWERS = [ NAME: 'Presentation', CONSTRUCTOR: PresentationViewer, REP: ORIGINAL_REP_NAME, - EXT: ['pdf', 'lcdpdf'] + EXT: ['pdf', 'lcdpdf'], }, { NAME: 'SinglePage', CONSTRUCTOR: SinglePageViewer, REP: ORIGINAL_REP_NAME, - EXT: ['pdf', 'lcdpdf'] - } + EXT: ['pdf', 'lcdpdf'], + }, ]; class DocLoader extends AssetLoader { diff --git a/src/lib/viewers/doc/DocPreloader.js b/src/lib/viewers/doc/DocPreloader.js index b8ea21438..3924233a0 100644 --- a/src/lib/viewers/doc/DocPreloader.js +++ b/src/lib/viewers/doc/DocPreloader.js @@ -11,7 +11,7 @@ import { PDFJS_CSS_UNITS, PDFJS_MAX_AUTO_SCALE, PDFJS_WIDTH_PADDING_PX, - PDFJS_HEIGHT_PADDING_PX + PDFJS_HEIGHT_PADDING_PX, } from '../../constants'; import { setDimensions, fetchRepresentationAsBlob } from '../../util'; @@ -80,7 +80,7 @@ class DocPreloader extends EventEmitter { this.containerEl = containerEl; // Need to load image as a blob to read EXIF - return fetchRepresentationAsBlob(preloadUrlWithAuth).then((imgBlob) => { + return fetchRepresentationAsBlob(preloadUrlWithAuth).then(imgBlob => { if (this.checkDocumentLoaded()) { return; } @@ -124,7 +124,7 @@ class DocPreloader extends EventEmitter { setDimensions(this.overlayEl, scaledWidth, scaledHeight); // Add and scale correct number of placeholder elements - for (let i = 0; i < numPages - 1; i++) { + for (let i = 0; i < numPages - 1; i += 1) { const placeholderEl = document.createElement('div'); placeholderEl.className = CLASS_BOX_PREVIEW_PRELOAD_CONTENT; placeholderEl.innerHTML = SPINNER_HTML; @@ -232,7 +232,7 @@ class DocPreloader extends EventEmitter { // Calculate pdf width, height, and number of pages from EXIF if possible return this.readEXIF(this.imageEl) - .then((pdfData) => { + .then(pdfData => { this.pdfData = pdfData; const { scaledWidth, scaledHeight } = this.getScaledWidthAndHeight(pdfData); this.scaleAndShowPreload(scaledWidth, scaledHeight, Math.min(pdfData.numPages, NUM_PAGES_MAX)); @@ -258,7 +258,7 @@ class DocPreloader extends EventEmitter { return { scaledWidth, - scaledHeight + scaledHeight, }; } @@ -283,7 +283,7 @@ class DocPreloader extends EventEmitter { const { scaledWidth, scaledHeight } = dimensionData; // Scale preload and placeholder elements const preloadEls = this.preloadEl.getElementsByClassName(CLASS_BOX_PREVIEW_PRELOAD_CONTENT); - for (let i = 0; i < preloadEls.length; i++) { + for (let i = 0; i < preloadEls.length; i += 1) { setDimensions(preloadEls[i], scaledWidth, scaledHeight); } } @@ -311,7 +311,7 @@ class DocPreloader extends EventEmitter { return { scaledWidth: Math.floor(scale * pdfWidth), - scaledHeight: Math.floor(scale * pdfHeight) + scaledHeight: Math.floor(scale * pdfHeight), }; } @@ -330,7 +330,7 @@ class DocPreloader extends EventEmitter { /* global EXIF */ EXIF.getData(imageEl, () => { const userCommentRaw = EXIF.getTag(imageEl, EXIF_COMMENT_TAG_NAME); - const userComment = userCommentRaw.map((c) => String.fromCharCode(c)).join(''); + const userComment = userCommentRaw.map(c => String.fromCharCode(c)).join(''); const match = EXIF_COMMENT_REGEX.exec(userComment); // There should be 3 pieces of metadata: PDF width, PDF height, and num pages @@ -373,7 +373,7 @@ class DocPreloader extends EventEmitter { resolve({ pdfWidth, pdfHeight, - numPages + numPages, }); }); } catch (e) { diff --git a/src/lib/viewers/doc/DocumentViewer.js b/src/lib/viewers/doc/DocumentViewer.js index f5cead7f2..94e098aab 100644 --- a/src/lib/viewers/doc/DocumentViewer.js +++ b/src/lib/viewers/doc/DocumentViewer.js @@ -45,13 +45,16 @@ class DocumentViewer extends DocBaseViewer { if (key === 'Shift++') { this.zoomIn(); return true; - } else if (key === 'Shift+_') { + } + if (key === 'Shift+_') { this.zoomOut(); return true; - } else if (key === 'ArrowUp' && fullscreen.isFullscreen(this.containerEl)) { + } + if (key === 'ArrowUp' && fullscreen.isFullscreen(this.containerEl)) { this.previousPage(); return true; - } else if (key === 'ArrowDown' && fullscreen.isFullscreen(this.containerEl)) { + } + if (key === 'ArrowDown' && fullscreen.isFullscreen(this.containerEl)) { this.nextPage(); return true; } diff --git a/src/lib/viewers/doc/PresentationViewer.js b/src/lib/viewers/doc/PresentationViewer.js index 86836b5fe..ca3ceac75 100644 --- a/src/lib/viewers/doc/PresentationViewer.js +++ b/src/lib/viewers/doc/PresentationViewer.js @@ -63,7 +63,7 @@ class PresentationViewer extends DocBaseViewer { // Hide all pages const pages = this.docEl.querySelectorAll('.page'); - [].forEach.call(pages, (pageEl) => { + [].forEach.call(pages, pageEl => { pageEl.classList.add(CLASS_INVISIBLE); }); @@ -89,7 +89,8 @@ class PresentationViewer extends DocBaseViewer { if (key === 'ArrowUp') { this.previousPage(); return true; - } else if (key === 'ArrowDown') { + } + if (key === 'ArrowDown') { this.nextPage(); return true; } @@ -222,7 +223,7 @@ class PresentationViewer extends DocBaseViewer { pagesinitHandler() { // We implement presentation mode by hiding other pages except for the first page const pageEls = [].slice.call(this.docEl.querySelectorAll('.pdfViewer .page'), 0); - pageEls.forEach((pageEl) => { + pageEls.forEach(pageEl => { if (pageEl.getAttribute('data-page-number') === '1') { return; } @@ -254,7 +255,7 @@ class PresentationViewer extends DocBaseViewer { * @return {Function} Throttled wheel handler */ getWheelHandler() { - return throttle((event) => { + return throttle(event => { // Should not change pages if there is overflow, horizontal movement or a lack of vertical movement if (event.deltaY === 0 || event.deltaX !== 0 || this.checkOverflow()) { return; @@ -282,7 +283,7 @@ class PresentationViewer extends DocBaseViewer { // Overwrite scrollPageIntoView for presentations since we have custom pagination behavior // This override is needed to allow PDF.js to change pages when clicking on links in a presentation that // navigate to other pages - this.pdfViewer.scrollPageIntoView = (pageObj) => { + this.pdfViewer.scrollPageIntoView = pageObj => { if (!this.loaded) { return; } @@ -301,14 +302,14 @@ class PresentationViewer extends DocBaseViewer { const visible = [ { id: currentPageObj.id, - view: currentPageObj - } + view: currentPageObj, + }, ]; return { first: currentPageObj, last: currentPageObj, - views: visible + views: visible, }; }; } diff --git a/src/lib/viewers/doc/SinglePageViewer.js b/src/lib/viewers/doc/SinglePageViewer.js index 7a21512d7..8babbbda1 100644 --- a/src/lib/viewers/doc/SinglePageViewer.js +++ b/src/lib/viewers/doc/SinglePageViewer.js @@ -17,7 +17,7 @@ class SinglePageViewer extends DocumentViewer { container: this.docEl, linkService: new PDFJS.PDFLinkService(), // Enhanced text selection uses more memory, so disable on mobile - enhanceTextSelection: !this.isMobile + enhanceTextSelection: !this.isMobile, }); } } diff --git a/src/lib/viewers/doc/__tests__/.eslintrc b/src/lib/viewers/doc/__tests__/.eslintrc deleted file mode 100644 index ddb79ec14..000000000 --- a/src/lib/viewers/doc/__tests__/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../../../../../.eslintrc"], - "globals": { - "Assert": false - } -} diff --git a/src/lib/viewers/doc/__tests__/AutoCADViewer-test.js b/src/lib/viewers/doc/__tests__/AutoCADViewer-test.js index ddfc37591..19afcbdb5 100644 --- a/src/lib/viewers/doc/__tests__/AutoCADViewer-test.js +++ b/src/lib/viewers/doc/__tests__/AutoCADViewer-test.js @@ -19,8 +19,8 @@ describe('lib/viewers/doc/AutoCADViewer', () => { autocad = new AutoCADViewer({ container: containerEl, file: { - id: '0' - } + id: '0', + }, }); stubs.getXrefsMetadata = sandbox.stub(metadataAPI, 'getXrefsMetadata'); @@ -30,11 +30,11 @@ describe('lib/viewers/doc/AutoCADViewer', () => { autocad.options = { file: { id: '123', - extension: EXTENSION + extension: EXTENSION, }, ui: { - showNotification: stubs.showNotification - } + showNotification: stubs.showNotification, + }, }; }); diff --git a/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js b/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js index e3c4b27e4..06b77005d 100644 --- a/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js +++ b/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js @@ -23,7 +23,7 @@ import { SELECTOR_BOX_PREVIEW_CONTENT, CLASS_BOX_PREVIEW_THUMBNAILS_CONTAINER, CLASS_BOX_PREVIEW_THUMBNAILS_OPEN, - SELECTOR_BOX_PREVIEW + SELECTOR_BOX_PREVIEW, } from '../../../constants'; import { ICON_PRINT_CHECKMARK, @@ -31,7 +31,7 @@ import { ICON_ZOOM_OUT, ICON_ZOOM_IN, ICON_FULLSCREEN_IN, - ICON_FULLSCREEN_OUT + ICON_FULLSCREEN_OUT, } from '../../../icons/icons'; import { VIEWER_EVENT, LOAD_METRIC, USER_DOCUMENT_THUMBNAIL_EVENTS } from '../../../events'; import Timer from '../../../Timer'; @@ -61,7 +61,7 @@ const STANDARD_HEADERS = [ 'Downlink', 'Save-Data', 'Viewport-Width', - 'Width' + 'Width', ]; describe('src/lib/viewers/doc/DocBaseViewer', () => { @@ -108,19 +108,19 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: true + enableThumbnailsSidebar: true, }); docBase.containerEl = containerEl; @@ -145,19 +145,19 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: false + enableThumbnailsSidebar: false, }); docBase.containerEl = containerEl; docBase.rootEl = rootEl; @@ -172,19 +172,19 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: true + enableThumbnailsSidebar: true, }); sandbox.stub(docBase, 'getCachedThumbnailsToggledState').returns(true); docBase.containerEl = containerEl; @@ -198,19 +198,19 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: true + enableThumbnailsSidebar: true, }); sandbox.stub(docBase, 'getCachedThumbnailsToggledState').returns(false); docBase.containerEl = containerEl; @@ -228,19 +228,19 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: true + enableThumbnailsSidebar: true, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -264,7 +264,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should destroy the controls', () => { docBase.controls = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; docBase.destroy(); @@ -274,7 +274,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should destroy the find bar', () => { docBase.findBar = { destroy: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; docBase.destroy(); @@ -284,7 +284,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should clean up the PDF network requests', () => { docBase.pdfLoadingTask = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; docBase.destroy(); @@ -295,8 +295,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.pdfViewer = { cleanup: sandbox.stub(), pdfDocument: { - destroy: sandbox.stub() - } + destroy: sandbox.stub(), + }, }; docBase.destroy(); @@ -306,10 +306,10 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should clean up the thumbnails sidebar instance and DOM element', () => { docBase.thumbnailsSidebar = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; const thumbnailsSidebarEl = { - remove: sandbox.stub() + remove: sandbox.stub(), }; docBase.thumbnailsSidebarEl = thumbnailsSidebarEl; @@ -332,11 +332,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const template = 'someTemplate'; const preloadRep = { content: { - url_template: template + url_template: template, }, status: { - state: 'success' - } + state: 'success', + }, }; sandbox.stub(api, 'get'); sandbox.stub(file, 'getRepresentation').returns(preloadRep); @@ -351,11 +351,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const template = 'someTemplate'; const preloadRep = { content: { - url_template: template + url_template: template, }, status: { - state: 'pending' - } + state: 'pending', + }, }; sandbox.stub(api, 'get'); sandbox.stub(file, 'getRepresentation').returns(preloadRep); @@ -368,7 +368,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should not prefetch preload if file is watermarked', () => { docBase.options.file.watermark_info = { - is_watermarked: true + is_watermarked: true, }; sandbox.stub(docBase, 'createContentUrlWithAuthParams'); @@ -400,7 +400,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should not prefetch content if file is watermarked', () => { docBase.options.file.watermark_info = { - is_watermarked: true + is_watermarked: true, }; sandbox .mock(api) @@ -439,8 +439,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should not do anything if file is watermarked', () => { docBase.options.file = { watermark_info: { - is_watermarked: true - } + is_watermarked: true, + }, }; sandbox.stub(docBase, 'getCachedPage').returns(1); sandbox @@ -496,8 +496,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { .returns(true); sandbox.stub(file, 'getRepresentation').returns({ status: { - state: STATUS_ERROR - } + state: STATUS_ERROR, + }, }); sandbox .mock(docBase.preloader) @@ -515,8 +515,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { .returns(true); sandbox.stub(file, 'getRepresentation').returns({ status: { - state: STATUS_PENDING - } + state: STATUS_PENDING, + }, }); sandbox .mock(docBase.preloader) @@ -532,11 +532,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { sandbox.stub(docBase, 'getCachedPage').returns(1); sandbox.stub(file, 'getRepresentation').returns({ content: { - url_template: '' + url_template: '', }, status: { - state: STATUS_SUCCESS - } + state: STATUS_SUCCESS, + }, }); sandbox .stub(docBase, 'getViewerOption') @@ -557,11 +557,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { sandbox.stub(docBase, 'getCachedPage').returns(1); sandbox.stub(file, 'getRepresentation').returns({ content: { - url_template: '' + url_template: '', }, status: { - state: STATUS_SUCCESS - } + state: STATUS_SUCCESS, + }, }); sandbox .stub(docBase, 'getViewerOption') @@ -615,11 +615,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { }); describe('handleAssetAndRepLoad', () => { - it('should setup pdfjs, init viewer, print, and find', (done) => { + it('should setup pdfjs, init viewer, print, and find', done => { const url = 'foo'; docBase.pdfUrl = url; docBase.pdfViewer = { - currentScale: 1 + currentScale: 1, }; const setupPdfjsStub = sandbox.stub(docBase, 'setupPdfjs'); @@ -628,10 +628,10 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const initFindStub = sandbox.stub(docBase, 'initFind'); const loadBoxAnnotations = sandbox.stub(docBase, 'loadBoxAnnotations').returns(Promise.resolve()); const createAnnotator = sandbox.stub(docBase, 'createAnnotator').returns( - new Promise((resolve) => { + new Promise(resolve => { resolve(); done(); - }) + }), ); docBase.handleAssetAndRepLoad(); @@ -648,7 +648,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { describe('initFind()', () => { beforeEach(() => { docBase.pdfViewer = { - setFindController: sandbox.stub() + setFindController: sandbox.stub(), }; }); @@ -685,7 +685,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { findFieldHandler: sandbox.stub(), open: sandbox.stub(), destroy: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; sandbox.stub(docBase, 'setPage'); @@ -788,7 +788,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { describe('Page Methods', () => { beforeEach(() => { docBase.pdfViewer = { - currentPageNumber: 1 + currentPageNumber: 1, }; stubs.cachePage = sandbox.stub(docBase, 'cachePage'); }); @@ -805,7 +805,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { describe('nextPage()', () => { it('should call setPage', () => { docBase.pdfViewer = { - currentPageNumber: 0 + currentPageNumber: 0, }; const setPageStub = sandbox.stub(docBase, 'setPage'); @@ -815,10 +815,10 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { }); describe('setPage()', () => { - it('should set the pdfViewer\'s page and cache it', () => { + it("should set the pdfViewer's page and cache it", () => { docBase.pdfViewer = { currentPageNumber: 1, - pagesCount: 3 + pagesCount: 3, }; docBase.setPage(2); @@ -830,7 +830,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should not do anything if setting an invalid page', () => { docBase.pdfViewer = { currentPageNumber: 1, - pagesCount: 3 + pagesCount: 3, }; // Too low @@ -856,8 +856,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return the cached current page if present', () => { docBase.options = { file: { - id: 0 - } + id: 0, + }, }; const page = docBase.getCachedPage(); @@ -879,8 +879,8 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { beforeEach(() => { docBase.options = { file: { - id: 0 - } + id: 0, + }, }; stubs.has = sandbox.stub(docBase.cache, 'has').returns(true); stubs.get = sandbox.stub(docBase.cache, 'get').returns({ 0: 10 }); @@ -907,7 +907,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { describe('zoom methods', () => { beforeEach(() => { docBase.pdfViewer = { - currentScale: 5 + currentScale: 5, }; stubs.emit = sandbox.stub(docBase, 'emit'); }); @@ -931,7 +931,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.emit).to.be.calledWith('zoom'); }); - it('should not emit the zoom event if we can\'t zoom in', () => { + it("should not emit the zoom event if we can't zoom in", () => { docBase.pdfViewer.currentScale = MAX_SCALE; docBase.zoomIn(1); @@ -956,7 +956,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.emit).to.be.calledWith('zoom'); }); - it('should not emit the zoom event if we can\'t zoom out', () => { + it("should not emit the zoom event if we can't zoom out", () => { docBase.pdfViewer.currentScale = MIN_SCALE; docBase.zoomOut(1); @@ -996,7 +996,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.findBar = { onKeydown: onKeydownStub, destroy: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; docBase.onKeydown(keys, mockEvent); expect(onKeydownStub).to.have.been.calledOnce; @@ -1014,7 +1014,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { beforeEach(() => { stubs.pdfViewer = { linkService: new PDFJS.PDFLinkService(), - setDocument: sandbox.stub() + setDocument: sandbox.stub(), }; stubs.pdfViewer.linkService.setDocument = sandbox.stub(); stubs.pdfViewerStub = sandbox.stub(PDFJS, 'PDFViewer').returns(stubs.pdfViewer); @@ -1026,7 +1026,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should turn on enhanced text selection if not on mobile', () => { docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; docBase.isMobile = false; sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({})); @@ -1035,14 +1035,14 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.pdfViewerStub).to.be.calledWith({ container: sinon.match.any, linkService: sinon.match.any, - enhanceTextSelection: true + enhanceTextSelection: true, }); }); }); it('should turn off enhanced text selection if on mobile', () => { docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; docBase.isMobile = true; sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({})); @@ -1051,7 +1051,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.pdfViewerStub).to.be.calledWith({ container: sinon.match.any, linkService: sinon.match.any, - enhanceTextSelection: false + enhanceTextSelection: false, }); }); }); @@ -1066,7 +1066,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { return docBase.initViewer(url).then(() => { expect(PDFJS.getDocument).to.be.calledWith({ url: sinon.match.string, - rangeChunkSize + rangeChunkSize, }); }); }); @@ -1076,7 +1076,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const defaultChunkSize = 524288; // 512KB docBase.options.location = { - locale: 'not-en-US' + locale: 'not-en-US', }; sandbox.stub(docBase, 'getViewerOption').returns(null); sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({})); @@ -1084,7 +1084,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { return docBase.initViewer(url).then(() => { expect(PDFJS.getDocument).to.be.calledWith({ url: sinon.match.string, - rangeChunkSize: defaultChunkSize + rangeChunkSize: defaultChunkSize, }); }); }); @@ -1094,7 +1094,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const largeChunkSize = 1048576; // 1MB docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; sandbox.stub(docBase, 'getViewerOption').returns(null); sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({})); @@ -1102,14 +1102,14 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { return docBase.initViewer(url).then(() => { expect(PDFJS.getDocument).to.be.calledWith({ url: sinon.match.string, - rangeChunkSize: largeChunkSize + rangeChunkSize: largeChunkSize, }); }); }); it('should set a cache-busting header if on mobile', () => { docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; sandbox.stub(Browser, 'isIOS').returns(true); sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve({})); @@ -1119,24 +1119,24 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { url: sinon.match.string, rangeChunkSize: 1048576, httpHeaders: { - 'If-None-Match': 'webkit-no-cache' - } + 'If-None-Match': 'webkit-no-cache', + }, }); }); }); - it('should avoid preflight requests by not adding non-standard headers', (done) => { + it('should avoid preflight requests by not adding non-standard headers', done => { docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; // Excluding IOS for If-None-Match cache busting sandbox.stub(Browser, 'isIOS').returns(false); - sandbox.stub(PDFJS, 'getDocument').callsFake((docInitParams) => { + sandbox.stub(PDFJS, 'getDocument').callsFake(docInitParams => { return new Promise(() => { const { httpHeaders = {} } = docInitParams; const headerKeys = Object.keys(httpHeaders); - const containsNonStandardHeader = headerKeys.some((header) => { + const containsNonStandardHeader = headerKeys.some(header => { return !STANDARD_HEADERS.includes(header); }); @@ -1151,7 +1151,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should append encoding query parameter for gzip content when range requests are disabled', () => { // en-US allows for disabled range requests docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; const defaultChunkSize = 1048576; // Taken from RANGE_REQUEST_CHUNK_SIZE_US const url = 'www.myTestPDF.com/123456'; @@ -1163,7 +1163,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { return docBase.initViewer(url).then(() => { expect(PDFJS.getDocument).to.be.calledWith({ url: `${url}?${paramsList}`, - rangeChunkSize: defaultChunkSize + rangeChunkSize: defaultChunkSize, }); // Reset to original value @@ -1173,7 +1173,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should resolve the loading task and set the document/viewer', () => { const doc = { - url: 'url' + url: 'url', }; const getDocumentStub = sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve(doc)); sandbox.stub(docBase, 'getViewerOption').returns(100); @@ -1190,7 +1190,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should invoke startLoadTimer()', () => { const doc = { - url: 'url' + url: 'url', }; sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve(doc)); sandbox.stub(docBase, 'getViewerOption').returns(100); @@ -1203,11 +1203,11 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should handle any download error', () => { stubs.handleDownloadError = sandbox.stub(docBase, 'handleDownloadError'); const doc = { - url: 'url' + url: 'url', }; docBase.options.location = { - locale: 'en-US' + locale: 'en-US', }; sandbox.stub(PDFJS, 'getDocument').returns(Promise.reject(doc)); @@ -1219,7 +1219,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should adjust the layout if thumbnails should be toggled', () => { const doc = { - url: 'url' + url: 'url', }; const getDocumentStub = sandbox.stub(PDFJS, 'getDocument').returns(Promise.resolve(doc)); sandbox.stub(docBase, 'getViewerOption').returns(100); @@ -1244,14 +1244,14 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.pdfViewer = { update: sandbox.stub(), currentScaleValue: 0, - currentPageNumber: 0 + currentPageNumber: 0, }; docBase.somePageRendered = true; stubs.setPage = sandbox.stub(docBase, 'setPage'); Object.defineProperty(Object.getPrototypeOf(DocBaseViewer.prototype), 'resize', { - value: sandbox.stub() + value: sandbox.stub(), }); stubs.thumbnailsResize = sandbox.stub(); docBase.thumbnailsSidebar = { resize: stubs.thumbnailsResize, destroy: () => {} }; @@ -1259,7 +1259,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { afterEach(() => { Object.defineProperty(Object.getPrototypeOf(DocBaseViewer.prototype), 'resize', { - value: resizeFunc + value: resizeFunc, }); }); @@ -1280,7 +1280,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should resize the preload', () => { docBase.pdfViewer = null; docBase.preloader = { - resize: sandbox.stub() + resize: sandbox.stub(), }; docBase.resize(); expect(docBase.preloader.resize).to.be.called; @@ -1306,7 +1306,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const id = '12345'; const tag = Timer.createTag(id, LOAD_METRIC.preloadTime); docBase.options.file = { - id + id, }; const startStub = sandbox.stub(Timer, 'start'); @@ -1321,7 +1321,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const tag = Timer.createTag(id, LOAD_METRIC.preloadTime); beforeEach(() => { docBase.options.file = { - id + id, }; }); @@ -1352,7 +1352,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const preloadTime = { start: 1, end: 101, - elapsed + elapsed, }; sandbox.stub(Timer, 'get').returns(preloadTime); const metricStub = sandbox.stub(docBase, 'emitMetric'); @@ -1361,7 +1361,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(metricStub).to.be.calledWith({ name: LOAD_METRIC.previewPreloadEvent, - data: elapsed + data: elapsed, }); }); }); @@ -1370,7 +1370,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { let logger; beforeEach(() => { logger = { - setPreloaded: sandbox.stub() + setPreloaded: sandbox.stub(), }; docBase.options.logger = logger; }); @@ -1407,18 +1407,18 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.options = { location: { staticBaseURI: 'test/', - locale: 'en-US' + locale: 'en-US', }, file: { size: 10000000, extension: 'pdf', watermark_info: { - is_watermarked: false + is_watermarked: false, }, permissions: { - can_download: undefined - } - } + can_download: undefined, + }, + }, }; PDFJS.disableRange = false; @@ -1539,7 +1539,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => {
`.trim(); expect(docBase.printPopup.loadingIndicator.innerHTML.replace(/\s/g, '')).to.equal( - mockIndicator.innerHTML.replace(/\s/g, '') + mockIndicator.innerHTML.replace(/\s/g, ''), ); expect(docBase.printPopup.loadingIndicator.classList.contains('bp-crawler')).to.be.true; }); @@ -1552,7 +1552,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { clock = sinon.useFakeTimers(); docBase.printBlob = undefined; stubs.fetchPrintBlob = sandbox.stub(docBase, 'fetchPrintBlob').returns({ - then: sandbox.stub() + then: sandbox.stub(), }); docBase.initPrint(); stubs.show = sandbox.stub(docBase.printPopup, 'show'); @@ -1577,7 +1577,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(docBase.printPopup.disableButton).to.be.called; }); - it('should directly print if print blob is ready and the print dialog hasn\'t been shown yet', () => { + it("should directly print if print blob is ready and the print dialog hasn't been shown yet", () => { docBase.printBlob = {}; docBase.printDialogTimeout = setTimeout(() => {}); sandbox.stub(docBase, 'browserPrint'); @@ -1586,7 +1586,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(docBase.browserPrint).to.be.called; }); - it('should directly print if print blob is ready and the print dialog isn\'t visible', () => { + it("should directly print if print blob is ready and the print dialog isn't visible", () => { docBase.printBlob = {}; docBase.printDialogTimeout = null; sandbox.stub(docBase.printPopup, 'isVisible').returns(false); @@ -1732,7 +1732,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should load UI, check the pagination buttons, set the page, and make document scrollable', () => { docBase.pdfViewer = { - currentScale: 'unknown' + currentScale: 'unknown', }; docBase.pagesinitHandler(); @@ -1742,9 +1742,9 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.setupPages).to.be.called; }); - it('should broadcast that the preview is loaded if it hasn\'t already', () => { + it("should broadcast that the preview is loaded if it hasn't already", () => { docBase.pdfViewer = { - currentScale: 'unknown' + currentScale: 'unknown', }; docBase.loaded = false; docBase.pdfViewer.pagesCount = 5; @@ -1755,7 +1755,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { encoding: docBase.encoding, endProgress: false, numPages: 5, - scale: sinon.match.any + scale: sinon.match.any, }); expect(docBase.loaded).to.be.true; }); @@ -1765,7 +1765,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const PAGES_COUNT = 3; docBase.startPageNum = START_PAGE_NUM; docBase.pdfViewer = { - pagesCount: PAGES_COUNT + pagesCount: PAGES_COUNT, }; docBase.pagesinitHandler(); @@ -1777,12 +1777,12 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { beforeEach(() => { docBase.pdfViewer = { currentScale: 0.5, - currentScaleValue: 0.5 + currentScaleValue: 0.5, }; docBase.event = { detail: { - pageNumber: 1 - } + pageNumber: 1, + }, }; docBase.somePageRendered = false; @@ -1824,14 +1824,14 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { stubs.cachePage = sandbox.stub(docBase, 'cachePage'); stubs.emit = sandbox.stub(docBase, 'emit'); docBase.event = { - pageNumber: 1 + pageNumber: 1, }; docBase.pdfViewer = { - pageCount: 1 + pageCount: 1, }; docBase.pageControls = { updateCurrentPage: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; stubs.updateCurrentPage = docBase.pageControls.updateCurrentPage; }); @@ -1867,7 +1867,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should update the scale value, and resize the page', () => { docBase.pdfViewer = { presentationModeState: 'normal', - currentScaleValue: 'normal' + currentScaleValue: 'normal', }; const resizeStub = sandbox.stub(docBase, 'resize'); @@ -1881,7 +1881,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should update the scale value, and resize the page', () => { docBase.pdfViewer = { presentationModeState: 'fullscreen', - currentScaleValue: 'pagefit' + currentScaleValue: 'pagefit', }; const resizeStub = sandbox.stub(docBase, 'resize'); @@ -1934,17 +1934,17 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { touches: [ { pageX: 0, - pageY: 100 + pageY: 100, }, { pageX: 200, - pageY: 200 - } - ] + pageY: 200, + }, + ], }; docBase.isPinching = false; docBase.pdfViewer = { - _getVisiblePages: sandbox.stub() + _getVisiblePages: sandbox.stub(), }; sandbox.stub(util, 'getClosestPageToPinch').returns(document.createElement('div')); sandbox.stub(util, 'getDistance'); @@ -1959,12 +1959,12 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { event.touches = [ { pageX: 0, - pageY: 100 + pageY: 100, }, { pageX: 200, - pageY: 200 - } + pageY: 200, + }, ]; docBase.pinchToZoomStartHandler(event); @@ -1995,7 +1995,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { event.touches[0].pageX, event.touches[0].pageY, event.touches[1].pageX, - event.touches[1].pageY + event.touches[1].pageY, ); }); }); @@ -2009,24 +2009,24 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.pinchPage = document.createElement('div'); docBase.isPinching = true; eventWithScale = { - scale: 1.5 + scale: 1.5, }; eventWithoutScale = { touches: [ { pageX: 100, - pageY: 100 + pageY: 100, }, { pageX: 300, - pageY: 300 - } - ] + pageY: 300, + }, + ], }; docBase.pdfViewer = { - currentScale: 1 + currentScale: 1, }; sandbox.stub(util, 'getDistance'); @@ -2078,7 +2078,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should do nothing if the proposed scale is greater than the MAX_SCALE', () => { docBase.pdfViewer = { - currentScale: 7 + currentScale: 7, }; eventWithScale.scale = 2; @@ -2089,7 +2089,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should do nothing if the proposed scale is less than the MIN_SCALE', () => { docBase.pdfViewer = { - currentScale: 0.12 + currentScale: 0.12, }; eventWithScale.scale = 0.25; @@ -2111,7 +2111,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.pdfViewer = { currentScaleValue: 1, currentScale: 1, - update: sandbox.stub() + update: sandbox.stub(), }; docBase.pinchScale = 1.5; @@ -2158,7 +2158,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return the start page as a number', () => { const startAt = { value: 3, - unit: PAGES_UNIT_NAME + unit: PAGES_UNIT_NAME, }; expect(docBase.getStartPage(startAt)).to.equal(3); @@ -2167,7 +2167,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return the floored number if a floating point number is passed', () => { const startAt = { value: 4.1, - unit: PAGES_UNIT_NAME + unit: PAGES_UNIT_NAME, }; expect(docBase.getStartPage(startAt)).to.equal(4); @@ -2176,14 +2176,14 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return undefined if a value < 1 is passed', () => { let startAt = { value: 0, - unit: PAGES_UNIT_NAME + unit: PAGES_UNIT_NAME, }; expect(docBase.getStartPage(startAt)).to.be.undefined; startAt = { value: -100, - unit: PAGES_UNIT_NAME + unit: PAGES_UNIT_NAME, }; expect(docBase.getStartPage(startAt)).to.be.undefined; @@ -2192,7 +2192,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return undefined if an invalid unit is passed', () => { const startAt = { value: 3, - unit: 'foo' + unit: 'foo', }; expect(docBase.getStartPage(startAt)).to.be.undefined; @@ -2201,7 +2201,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return undefined if an invalid value is passed', () => { const startAt = { value: 'foo', - unit: PAGES_UNIT_NAME + unit: PAGES_UNIT_NAME, }; expect(docBase.getStartPage(startAt)).to.be.undefined; @@ -2218,17 +2218,17 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { docBase.pdfViewer = { pagesCount: 4, currentPageNumber: 1, - cleanup: sandbox.stub() + cleanup: sandbox.stub(), }; docBase.controls = { add: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; docBase.pageControls = { add: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; }); @@ -2239,20 +2239,20 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { __('toggle_thumbnails'), docBase.toggleThumbnails, 'bp-toggle-thumbnails-icon', - ICON_THUMBNAILS_TOGGLE + ICON_THUMBNAILS_TOGGLE, ); expect(docBase.controls.add).to.be.calledWith( __('zoom_out'), docBase.zoomOut, 'bp-doc-zoom-out-icon', - ICON_ZOOM_OUT + ICON_ZOOM_OUT, ); expect(docBase.controls.add).to.be.calledWith( __('zoom_in'), docBase.zoomIn, 'bp-doc-zoom-in-icon', - ICON_ZOOM_IN + ICON_ZOOM_IN, ); expect(docBase.pageControls.add).to.be.calledWith(1, 4); @@ -2261,13 +2261,13 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { __('enter_fullscreen'), docBase.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); expect(docBase.controls.add).to.be.calledWith( __('exit_fullscreen'), docBase.toggleFullscreen, 'bp-exit-fullscreen-icon', - ICON_FULLSCREEN_OUT + ICON_FULLSCREEN_OUT, ); }); @@ -2278,37 +2278,37 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, representation: { content: { - url_template: 'foo' - } + url_template: 'foo', + }, }, file: { id: '0', - extension: 'ppt' + extension: 'ppt', }, - enableThumbnailsSidebar: false + enableThumbnailsSidebar: false, }); docBase.containerEl = containerEl; docBase.setup(); docBase.controls = { add: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; docBase.pageControls = { add: sandbox.stub(), - removeListener: sandbox.stub() + removeListener: sandbox.stub(), }; docBase.pdfViewer = { pagesCount: 4, currentPageNumber: 1, - cleanup: sandbox.stub() + cleanup: sandbox.stub(), }; // Invoke the method to test @@ -2319,7 +2319,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { __('toggle_thumbnails'), docBase.toggleThumbnails, 'bp-toggle-thumbnails-icon', - ICON_THUMBNAILS_TOGGLE + ICON_THUMBNAILS_TOGGLE, ); }); }); @@ -2341,7 +2341,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { thumbnailsSidebar = { toggle: stubs.toggleSidebar, isOpen: false, - destroy: () => {} + destroy: () => {}, }; }); @@ -2393,7 +2393,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { const expWhitelist = [ USER_DOCUMENT_THUMBNAIL_EVENTS.CLOSE, USER_DOCUMENT_THUMBNAIL_EVENTS.NAVIGATE, - USER_DOCUMENT_THUMBNAIL_EVENTS.OPEN + USER_DOCUMENT_THUMBNAIL_EVENTS.OPEN, ]; expect(docBase.getMetricsWhitelist()).to.be.eql(expWhitelist); @@ -2410,9 +2410,9 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { thumbnailsSidebarEl = { classList: { add: stubs.classListAdd, - remove: stubs.classListRemove + remove: stubs.classListRemove, }, - remove: sandbox.stub() + remove: sandbox.stub(), }; docBase.thumbnailsSidebarEl = thumbnailsSidebarEl; @@ -2501,7 +2501,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(stubs.set).to.be.calledWith( THUMBNAILS_SIDEBAR_TOGGLED_MAP_KEY, { '0': true, '123': false }, - true + true, ); }); @@ -2520,7 +2520,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { beforeEach(() => { stubs.getCachedThumbnailsToggledState = sandbox.stub(docBase, 'getCachedThumbnailsToggledState'); mockPdfViewer = { - pdfDocument: { numPages: 5 } + pdfDocument: { numPages: 5 }, }; docBase.pdfViewer = mockPdfViewer; }); @@ -2549,7 +2549,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return false if document only has 1 page, even if cached state is true', () => { stubs.getCachedThumbnailsToggledState.returns(true); mockPdfViewer = { - pdfDocument: { numPages: 1 } + pdfDocument: { numPages: 1 }, }; docBase.pdfViewer = mockPdfViewer; @@ -2559,7 +2559,7 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { it('should return false if pdfDocument is not found', () => { stubs.getCachedThumbnailsToggledState.returns(true); mockPdfViewer = { - pdfDocument: {} + pdfDocument: {}, }; docBase.pdfViewer = mockPdfViewer; diff --git a/src/lib/viewers/doc/__tests__/DocFindBar-test.js b/src/lib/viewers/doc/__tests__/DocFindBar-test.js index 7988b1265..188753d2d 100644 --- a/src/lib/viewers/doc/__tests__/DocFindBar-test.js +++ b/src/lib/viewers/doc/__tests__/DocFindBar-test.js @@ -35,11 +35,11 @@ describe('lib/viewers/doc/DocFindBar', () => { pdfViewer = new PDFJS.PDFViewer({ container: docEl, linkService: new PDFJS.PDFLinkService(), - enhanceTextSelection: false // improves text selection if true + enhanceTextSelection: false, // improves text selection if true }); findController = new PDFJS.PDFFindController({ - pdfViewer + pdfViewer, }); docFindBar = new DocFindBar(findBarEl, findController, true); @@ -156,7 +156,7 @@ describe('lib/viewers/doc/DocFindBar', () => { query: docFindBar.findFieldEl.value, phraseSearch: true, highlightAll: true, - findPrevious: 'test' + findPrevious: 'test', }; docFindBar.dispatchFindEvent('string', 'test'); @@ -199,7 +199,7 @@ describe('lib/viewers/doc/DocFindBar', () => { describe('updateUIResultsCount()', () => { beforeEach(() => { stubs.getBoundingClientRect = sandbox.stub(docFindBar.findResultsCountEl, 'getBoundingClientRect').returns({ - width: 5 + width: 5, }); }); @@ -233,7 +233,7 @@ describe('lib/viewers/doc/DocFindBar', () => { describe('setFindFieldElValue()', () => { it('should set the findFieldEl value', () => { docFindBar.findFieldEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; docFindBar.setFindFieldElValue('test'); @@ -282,7 +282,7 @@ describe('lib/viewers/doc/DocFindBar', () => { stubs.open = sandbox.stub(docFindBar, 'open'); stubs.event = { preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; stubs.close = sandbox.stub(docFindBar, 'close'); }); @@ -362,7 +362,7 @@ describe('lib/viewers/doc/DocFindBar', () => { stubs.decodeKeydown = sandbox.stub(util, 'decodeKeydown'); stubs.event = { preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; stubs.findNextHandler = sandbox.stub(docFindBar, 'findNextHandler'); stubs.findPreviousHandler = sandbox.stub(docFindBar, 'findPreviousHandler'); @@ -489,7 +489,7 @@ describe('lib/viewers/doc/DocFindBar', () => { docFindBar.findNextHandler(true); expect(docFindBar.emit).to.be.calledWith(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.NEXT + name: USER_DOCUMENT_FIND_EVENTS.NEXT, }); }); }); @@ -538,7 +538,7 @@ describe('lib/viewers/doc/DocFindBar', () => { docFindBar.findPreviousHandler(true); expect(docFindBar.emit).to.be.calledWith(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.PREVIOUS + name: USER_DOCUMENT_FIND_EVENTS.PREVIOUS, }); }); }); @@ -573,7 +573,7 @@ describe('lib/viewers/doc/DocFindBar', () => { expect(docFindBar.opened).to.equal(true); expect(stubs.remove).to.be.called; expect(docFindBar.emit).to.be.calledWith(VIEWER_EVENT.metric, { - name: USER_DOCUMENT_FIND_EVENTS.OPEN + name: USER_DOCUMENT_FIND_EVENTS.OPEN, }); }); diff --git a/src/lib/viewers/doc/__tests__/DocLoader-test.js b/src/lib/viewers/doc/__tests__/DocLoader-test.js index 92654093a..0a21d3a41 100644 --- a/src/lib/viewers/doc/__tests__/DocLoader-test.js +++ b/src/lib/viewers/doc/__tests__/DocLoader-test.js @@ -21,24 +21,24 @@ describe('lib/viewers/doc/DocLoader', () => { { representation: 'pdf', status: { - state: 'success' - } + state: 'success', + }, }, { representation: 'ORIGINAL', status: { - state: 'success' - } - } - ] - } + state: 'success', + }, + }, + ], + }, }; viewer = { NAME: 'Document', CONSTRUCTOR: DocumentViewer, REP: 'pdf', - EXT: ['docx'] + EXT: ['docx'], }; }); diff --git a/src/lib/viewers/doc/__tests__/DocPreloader-test.js b/src/lib/viewers/doc/__tests__/DocPreloader-test.js index 9bcc65f1d..c6e3ad9c5 100644 --- a/src/lib/viewers/doc/__tests__/DocPreloader-test.js +++ b/src/lib/viewers/doc/__tests__/DocPreloader-test.js @@ -7,7 +7,7 @@ import { CLASS_BOX_PREVIEW_PRELOAD_CONTENT, CLASS_BOX_PREVIEW_PRELOAD_OVERLAY, CLASS_INVISIBLE, - CLASS_PREVIEW_LOADED + CLASS_PREVIEW_LOADED, } from '../../../constants'; const PDFJS_CSS_UNITS = 96.0 / 72.0; @@ -26,13 +26,13 @@ describe('lib/viewers/doc/DocPreloader', () => { fixture.load('viewers/doc/__tests__/DocPreloader-test.html'); containerEl = document.querySelector('.container'); docPreloader = new DocPreloader({ - hideLoadingIndicator: () => {} + hideLoadingIndicator: () => {}, }); stubs = {}; docPreloader.previewUI = { hideLoadingIndicator: sandbox.stub(), - previewContainer: document.createElement('div') + previewContainer: document.createElement('div'), }; }); @@ -104,7 +104,7 @@ describe('lib/viewers/doc/DocPreloader', () => { expect(docPreloader.preloadEl).to.not.have.class(CLASS_INVISIBLE); }); - [5, 10, 11, 100].forEach((numPages) => { + [5, 10, 11, 100].forEach(numPages => { it('should create and set dimensions for numPages - 1 placeholders', () => { docPreloader.scaleAndShowPreload(100, 100, numPages); @@ -188,7 +188,7 @@ describe('lib/viewers/doc/DocPreloader', () => { describe('bindDOMListeners()', () => { it('should bind load event listener to image element', () => { docPreloader.imageEl = { - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; docPreloader.bindDOMListeners(); @@ -200,7 +200,7 @@ describe('lib/viewers/doc/DocPreloader', () => { describe('unbindDOMListeners()', () => { it('should unbind load event listener to image element', () => { docPreloader.imageEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; docPreloader.unbindDOMListeners(); @@ -272,15 +272,15 @@ describe('lib/viewers/doc/DocPreloader', () => { Promise.resolve({ pdfWidth, pdfHeight, - numPages - }) + numPages, + }), ); const scaledWidth = 200; const scaledHeight = 200; stubs.getScaledDimensions.returns({ scaledWidth, - scaledHeight + scaledHeight, }); docPreloader.preloadEl = {}; @@ -297,13 +297,13 @@ describe('lib/viewers/doc/DocPreloader', () => { Promise.resolve({ pdfWidth: 100, pdfHeight: 100, - numPages: NUM_PAGES_MAX + 1 // NUM_PAGES_MAX + 1 - }) + numPages: NUM_PAGES_MAX + 1, // NUM_PAGES_MAX + 1 + }), ); stubs.getScaledDimensions.returns({ scaledWidth: 200, - scaledHeight: 200 + scaledHeight: 200, }); docPreloader.preloadEl = {}; @@ -317,7 +317,7 @@ describe('lib/viewers/doc/DocPreloader', () => { stubs.readEXIF.returns(Promise.reject()); stubs.getScaledDimensions.returns({ scaledWidth: 200, - scaledHeight: 200 + scaledHeight: 200, }); docPreloader.preloadEl = {}; @@ -326,7 +326,7 @@ describe('lib/viewers/doc/DocPreloader', () => { const naturalHeight = 100; docPreloader.imageEl = { naturalWidth, - naturalHeight + naturalHeight, }; return docPreloader.loadHandler().then(() => { @@ -352,7 +352,7 @@ describe('lib/viewers/doc/DocPreloader', () => { const scaledDimensions = docPreloader.getScaledDimensions(100, 100); expect(scaledDimensions).to.deep.equal({ scaledWidth: Math.floor(expectedScale * 100), - scaledHeight: Math.floor(expectedScale * 100) + scaledHeight: Math.floor(expectedScale * 100), }); }); @@ -370,7 +370,7 @@ describe('lib/viewers/doc/DocPreloader', () => { const expectedScale = (clientHeight - 5) / pdfHeight; expect(scaledDimensions).to.deep.equal({ scaledWidth: Math.floor(expectedScale * pdfWidth), - scaledHeight: Math.floor(expectedScale * pdfHeight) + scaledHeight: Math.floor(expectedScale * pdfHeight), }); }); @@ -388,7 +388,7 @@ describe('lib/viewers/doc/DocPreloader', () => { const expectedScale = (clientWidth - 40) / pdfWidth; expect(scaledDimensions).to.deep.equal({ scaledWidth: Math.floor(expectedScale * pdfWidth), - scaledHeight: Math.floor(expectedScale * pdfHeight) + scaledHeight: Math.floor(expectedScale * pdfHeight), }); }); @@ -406,7 +406,7 @@ describe('lib/viewers/doc/DocPreloader', () => { const expectedScale = (clientWidth - 40) / pdfWidth; expect(scaledDimensions).to.deep.equal({ scaledWidth: Math.floor(expectedScale * pdfWidth), - scaledHeight: Math.floor(expectedScale * pdfHeight) + scaledHeight: Math.floor(expectedScale * pdfHeight), }); }); }); @@ -417,7 +417,7 @@ describe('lib/viewers/doc/DocPreloader', () => { beforeEach(() => { fakeImageEl = { naturalWidth: 50, - naturalHeight: 100 + naturalHeight: 100, }; }); @@ -426,12 +426,12 @@ describe('lib/viewers/doc/DocPreloader', () => { getData: (imageEl, func) => { func(); }, - getTag: sandbox.stub().returns('') + getTag: sandbox.stub().returns(''), }; docPreloader .readEXIF(fakeImageEl) .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); @@ -441,7 +441,7 @@ describe('lib/viewers/doc/DocPreloader', () => { return docPreloader .readEXIF(fakeImageEl) .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); @@ -453,18 +453,18 @@ describe('lib/viewers/doc/DocPreloader', () => { const exifRawArray = `pdfWidth:${pdfWidth}pts,pdfHeight:${pdfHeight}pts,numPages:${numPages}` .split('') - .map((c) => c.charCodeAt(0)); + .map(c => c.charCodeAt(0)); window.EXIF = { getData: (imageEl, func) => { func(); }, - getTag: sandbox.stub().returns(exifRawArray) + getTag: sandbox.stub().returns(exifRawArray), }; return docPreloader .readEXIF(fakeImageEl) .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); @@ -476,18 +476,18 @@ describe('lib/viewers/doc/DocPreloader', () => { const exifRawArray = `pdfWidth:${pdfWidth}pts,pdfHeight:${pdfHeight}pts,numPages:${numPages}` .split('') - .map((c) => c.charCodeAt(0)); + .map(c => c.charCodeAt(0)); window.EXIF = { getData: (imageEl, func) => { func(); }, - getTag: sandbox.stub().returns(exifRawArray) + getTag: sandbox.stub().returns(exifRawArray), }; return docPreloader .readEXIF(fakeImageEl) .then(() => Assert.fail()) - .catch((err) => { + .catch(err => { expect(err).to.be.an('error'); }); }); @@ -499,21 +499,21 @@ describe('lib/viewers/doc/DocPreloader', () => { const exifRawArray = `pdfWidth:${pdfWidth}pts,pdfHeight:${pdfHeight}pts,numPages:${numPages}` .split('') - .map((c) => c.charCodeAt(0)); + .map(c => c.charCodeAt(0)); window.EXIF = { getData: (imageEl, func) => { func(); }, - getTag: sandbox.stub().returns(exifRawArray) + getTag: sandbox.stub().returns(exifRawArray), }; return docPreloader .readEXIF(fakeImageEl) - .then((response) => { + .then(response => { response.should.deep.equal({ pdfWidth: pdfWidth * PDFJS_CSS_UNITS, pdfHeight: pdfHeight * PDFJS_CSS_UNITS, - numPages + numPages, }); }) .catch(() => Assert.fail()); @@ -526,21 +526,21 @@ describe('lib/viewers/doc/DocPreloader', () => { const exifRawArray = `pdfWidth:${pdfWidth}pts,pdfHeight:${pdfHeight}pts,numPages:${numPages}` .split('') - .map((c) => c.charCodeAt(0)); + .map(c => c.charCodeAt(0)); window.EXIF = { getData: (imageEl, func) => { func(); }, - getTag: sandbox.stub().returns(exifRawArray) + getTag: sandbox.stub().returns(exifRawArray), }; return docPreloader .readEXIF(fakeImageEl) - .then((response) => { + .then(response => { response.should.deep.equal({ pdfWidth: pdfHeight * PDFJS_CSS_UNITS, pdfHeight: pdfWidth * PDFJS_CSS_UNITS, - numPages + numPages, }); }) .catch(() => Assert.fail()); @@ -567,11 +567,11 @@ describe('lib/viewers/doc/DocPreloader', () => { beforeEach(() => { sandbox.stub(docPreloader, 'getScaledWidthAndHeight').returns({ scaledWidth: 1000, - scaledHeight: 800 + scaledHeight: 800, }); sandbox.stub(docPreloader, 'getScaledDimensions').returns({ scaledWidth: 1000, - scaledHeight: 800 + scaledHeight: 800, }); sandbox.stub(util, 'setDimensions'); docPreloader.preloadEl = document.createElement('div'); @@ -594,7 +594,7 @@ describe('lib/viewers/doc/DocPreloader', () => { it('should prefer to resize using the pdfData', () => { docPreloader.pdfData = { pdfWidth: 800, - pdfHeight: 600 + pdfHeight: 600, }; docPreloader.resize(); @@ -606,7 +606,7 @@ describe('lib/viewers/doc/DocPreloader', () => { docPreloader.pdfData = null; docPreloader.imageEl = { naturalWidth: 800, - naturalHeight: 600 + naturalHeight: 600, }; docPreloader.resize(); @@ -617,7 +617,7 @@ describe('lib/viewers/doc/DocPreloader', () => { it('should resize all the elements', () => { docPreloader.pdfData = { pdfWidth: 800, - pdfHeight: 600 + pdfHeight: 600, }; docPreloader.resize(); expect(docPreloader.getScaledWidthAndHeight).to.be.called; @@ -628,11 +628,11 @@ describe('lib/viewers/doc/DocPreloader', () => { describe('getScaledWidthAndHeight()', () => { const scaledDimensions = { scaledWidth: 1000, - scaledHeight: 800 + scaledHeight: 800, }; const pdfData = { pdfWidth: 800, - pdfHeight: 600 + pdfHeight: 600, }; beforeEach(() => { sandbox.stub(docPreloader, 'getScaledDimensions').returns(scaledDimensions); diff --git a/src/lib/viewers/doc/__tests__/DocumentViewer-test.js b/src/lib/viewers/doc/__tests__/DocumentViewer-test.js index 53635bcc2..1ec7d5d4b 100644 --- a/src/lib/viewers/doc/__tests__/DocumentViewer-test.js +++ b/src/lib/viewers/doc/__tests__/DocumentViewer-test.js @@ -25,8 +25,8 @@ describe('lib/viewers/doc/DocumentViewer', () => { doc = new DocumentViewer({ container: containerEl, file: { - id: '0' - } + id: '0', + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -35,10 +35,10 @@ describe('lib/viewers/doc/DocumentViewer', () => { doc.pdfViewer = { currentPageNumber: 0, - cleanup: sandbox.stub() + cleanup: sandbox.stub(), }; doc.controls = { - add: sandbox.stub() + add: sandbox.stub(), }; }); @@ -64,7 +64,7 @@ describe('lib/viewers/doc/DocumentViewer', () => { it('should invoke onPreload callback', () => { doc.options.logger = { - setPreloaded: sandbox.stub() + setPreloaded: sandbox.stub(), }; stubs.setPreloaded = doc.options.logger.setPreloaded; doc.preloader.emit('preload'); @@ -83,7 +83,7 @@ describe('lib/viewers/doc/DocumentViewer', () => { it('should remove listeners from preloader', () => { Object.defineProperty(DocBaseViewer.prototype, 'destroy', { value: sandbox.stub() }); doc.preloader = { - removeAllListeners: sandbox.mock().withArgs('preload') + removeAllListeners: sandbox.mock().withArgs('preload'), }; doc.destroy(); doc = null; // Don't call destroy again during cleanup @@ -127,7 +127,7 @@ describe('lib/viewers/doc/DocumentViewer', () => { expect(stubs.nextPage).to.be.called; }); - it('should fallback to doc base\'s onKeydown if no entry matches', () => { + it("should fallback to doc base's onKeydown if no entry matches", () => { const docbaseStub = sandbox.spy(DocBaseViewer.prototype, 'onKeydown'); const eventStub = sandbox.stub(); stubs.fullscreen.returns(false); diff --git a/src/lib/viewers/doc/__tests__/PresentationPreloader-test.js b/src/lib/viewers/doc/__tests__/PresentationPreloader-test.js index d83be4bdc..17e275067 100644 --- a/src/lib/viewers/doc/__tests__/PresentationPreloader-test.js +++ b/src/lib/viewers/doc/__tests__/PresentationPreloader-test.js @@ -15,7 +15,7 @@ describe('lib/viewers/doc/PresentationPreloader', () => { beforeEach(() => { fixture.load('viewers/doc/__tests__/PresentationPreloader-test.html'); preloader = new PresentationPreloader({ - hideLoadingIndicator: () => {} + hideLoadingIndicator: () => {}, }); stubs = {}; }); diff --git a/src/lib/viewers/doc/__tests__/PresentationViewer-test.js b/src/lib/viewers/doc/__tests__/PresentationViewer-test.js index d09d56396..02e80bc10 100644 --- a/src/lib/viewers/doc/__tests__/PresentationViewer-test.js +++ b/src/lib/viewers/doc/__tests__/PresentationViewer-test.js @@ -27,12 +27,12 @@ describe('lib/viewers/doc/PresentationViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, container: containerEl, file: { - extension: 'ppt' - } + extension: 'ppt', + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -42,11 +42,11 @@ describe('lib/viewers/doc/PresentationViewer', () => { presentation.pdfViewer = { currentPageNumber: 1, update: sandbox.stub(), - cleanup: sandbox.stub() + cleanup: sandbox.stub(), }; presentation.controls = { - add: sandbox.stub() + add: sandbox.stub(), }; }); @@ -73,7 +73,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { it('should invoke onPreload callback', () => { presentation.options.logger = { - setPreloaded: sandbox.stub() + setPreloaded: sandbox.stub(), }; stubs.setPreloaded = presentation.options.logger.setPreloaded; presentation.preloader.emit('preload'); @@ -92,7 +92,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { it('should remove listeners from preloader', () => { Object.defineProperty(DocBaseViewer.prototype, 'destroy', { value: sandbox.stub() }); presentation.preloader = { - removeAllListeners: sandbox.mock().withArgs('preload') + removeAllListeners: sandbox.mock().withArgs('preload'), }; presentation.destroy(); presentation = null; // Don't call destroy again during cleanup @@ -171,7 +171,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { expect(stubs.nextPage).to.be.called; }); - it('should fallback to doc base\'s onKeydown if no entry matches', () => { + it("should fallback to doc base's onKeydown if no entry matches", () => { const docBaseSpy = sandbox.spy(DocBaseViewer.prototype, 'onKeydown'); const eventStub = sandbox.stub(); @@ -299,11 +299,11 @@ describe('lib/viewers/doc/PresentationViewer', () => { changedTouches: [ { clientX: 0, - clientY: 0 - } + clientY: 0, + }, ], touches: [1], - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; stubs.nextPage = sandbox.stub(presentation, 'nextPage'); stubs.previousPage = sandbox.stub(presentation, 'previousPage'); @@ -411,7 +411,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { stubs.checkOverflow = sandbox.stub(presentation, 'checkOverflow').returns(false); presentation.event = { deltaY: 5, - deltaX: -0 + deltaX: -0, }; wheelHandler = presentation.getWheelHandler(); }); @@ -447,7 +447,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { it('should do nothing if the viewer is not loaded', () => { const setPageStub = sandbox.stub(presentation, 'setPage'); const page = { - pageNumber: 3 + pageNumber: 3, }; presentation.loaded = false; @@ -460,7 +460,7 @@ describe('lib/viewers/doc/PresentationViewer', () => { it('should change the page if the viewer is loaded', () => { const setPageStub = sandbox.stub(presentation, 'setPage'); const page = { - pageNumber: 3 + pageNumber: 3, }; presentation.loaded = true; @@ -476,10 +476,10 @@ describe('lib/viewers/doc/PresentationViewer', () => { _pages: { 0: { id: 1, - view: 'pageObj' - } + view: 'pageObj', + }, }, - _currentPageNumber: 1 + _currentPageNumber: 1, }; presentation.overwritePdfViewerBehavior(); diff --git a/src/lib/viewers/doc/__tests__/SinglePageViewer-test.js b/src/lib/viewers/doc/__tests__/SinglePageViewer-test.js index 17a2fcef1..153bf8f30 100644 --- a/src/lib/viewers/doc/__tests__/SinglePageViewer-test.js +++ b/src/lib/viewers/doc/__tests__/SinglePageViewer-test.js @@ -21,8 +21,8 @@ describe('lib/viewers/doc/SinglePageViewer', () => { doc = new SinglePageViewer({ container: containerEl, file: { - id: '0' - } + id: '0', + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -48,7 +48,7 @@ describe('lib/viewers/doc/SinglePageViewer', () => { const pdfViewer = { linkService: new PDFJS.PDFLinkService(), setDocument: sandbox.stub(), - enhanceTextSelection: true + enhanceTextSelection: true, }; beforeEach(() => { @@ -60,7 +60,7 @@ describe('lib/viewers/doc/SinglePageViewer', () => { expect(stubs.pdfViewerStub).to.be.calledWith({ container: sinon.match.any, linkService: sinon.match.any, - enhanceTextSelection: true + enhanceTextSelection: true, }); expect(result).to.equal(pdfViewer); }); diff --git a/src/lib/viewers/error/PreviewErrorViewer.js b/src/lib/viewers/error/PreviewErrorViewer.js index 92f515f28..7f30c08f4 100644 --- a/src/lib/viewers/error/PreviewErrorViewer.js +++ b/src/lib/viewers/error/PreviewErrorViewer.js @@ -108,7 +108,7 @@ class PreviewErrorViewer extends BaseViewer { // Log error message - this will be the original error message if available, display message if not this.emit(VIEWER_EVENT.load, { - error: stripAuthFromString(message) + error: stripAuthFromString(message), }); } diff --git a/src/lib/viewers/error/__tests__/PreviewErrorViewer-test.js b/src/lib/viewers/error/__tests__/PreviewErrorViewer-test.js index 3e40078a1..7d3eb9dfd 100644 --- a/src/lib/viewers/error/__tests__/PreviewErrorViewer-test.js +++ b/src/lib/viewers/error/__tests__/PreviewErrorViewer-test.js @@ -23,9 +23,9 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { containerEl = document.querySelector('.container'); error = new PreviewErrorViewer({ file: { - id: '1' + id: '1', }, - container: containerEl + container: containerEl, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); error.containerEl = containerEl; @@ -55,7 +55,7 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { }); describe('load()', () => { - [['zip', true], ['tgz', true], ['flv', true], ['blah', false]].forEach((testCase) => { + [['zip', true], ['tgz', true], ['flv', true], ['blah', false]].forEach(testCase => { it('should set appropriate icon', () => { const getIconFromExtensionStub = sandbox.stub(icons, 'getIconFromExtension'); const getIconFromNameStub = sandbox.stub(icons, 'getIconFromName'); @@ -79,7 +79,7 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { const err = new PreviewError('some_error_code', '', { linkText: 'test', - linkUrl: 'someUrl' + linkUrl: 'someUrl', }); error.load(err); @@ -97,7 +97,7 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { expect(error.addDownloadButton).to.be.called; }); - it('should not add download button if file can\'t be downloaded', () => { + it("should not add download button if file can't be downloaded", () => { sandbox.stub(error, 'addDownloadButton'); sandbox.stub(file, 'canDownload').returns(false); @@ -128,7 +128,7 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { error.load(err); expect(error.emit).to.be.calledWith(VIEWER_EVENT.load, { - error: 'this is bad' + error: 'this is bad', }); }); @@ -139,7 +139,7 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { error.load(err); expect(error.emit).to.be.calledWith(VIEWER_EVENT.load, { - error: 'display message!' + error: 'display message!', }); }); @@ -149,14 +149,14 @@ describe('lib/viewers/error/PreviewErrorViewer', () => { 'some_code', 'display', {}, - 'Unexpected server response (0) while retrieving PDF "www.box.com?access_token=blah&test=okay"' + 'Unexpected server response (0) while retrieving PDF "www.box.com?access_token=blah&test=okay"', ); error.load(err); expect(error.emit).to.be.calledWith(VIEWER_EVENT.load, { error: - 'Unexpected server response (0) while retrieving PDF "www.box.com?access_token=[FILTERED]&test=okay"' + 'Unexpected server response (0) while retrieving PDF "www.box.com?access_token=[FILTERED]&test=okay"', }); }); }); diff --git a/src/lib/viewers/iframe/IFrameLoader.js b/src/lib/viewers/iframe/IFrameLoader.js index 428e6d4c5..303fd33da 100644 --- a/src/lib/viewers/iframe/IFrameLoader.js +++ b/src/lib/viewers/iframe/IFrameLoader.js @@ -8,8 +8,8 @@ const VIEWERS = [ NAME: 'IFrame', CONSTRUCTOR: IFrameViewer, REP: ORIGINAL_REP_NAME, - EXT: ['boxnote', 'boxdicom'] - } + EXT: ['boxnote', 'boxdicom'], + }, ]; class IFrameLoader extends AssetLoader { diff --git a/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js b/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js index 8f320de5b..d049130aa 100644 --- a/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js +++ b/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js @@ -15,7 +15,7 @@ describe('lib/viewers/iframe/IFrameLoader', () => { NAME: 'IFrame', CONSTRUCTOR: IFrameViewer, REP: 'ORIGINAL', - EXT: ['boxnote', 'boxdicom'] + EXT: ['boxnote', 'boxdicom'], }); }); }); diff --git a/src/lib/viewers/iframe/__tests__/IFrameViewer-test.js b/src/lib/viewers/iframe/__tests__/IFrameViewer-test.js index be5d015db..39fa925de 100644 --- a/src/lib/viewers/iframe/__tests__/IFrameViewer-test.js +++ b/src/lib/viewers/iframe/__tests__/IFrameViewer-test.js @@ -19,8 +19,8 @@ describe('lib/viewers/iframe/IFrameViewer', () => { container: containerEl, file: { id: '123', - extension: 'boxnote' - } + extension: 'boxnote', + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -55,7 +55,7 @@ describe('lib/viewers/iframe/IFrameViewer', () => { iframe.options.appHost = 'https://app.box.com'; }); - it('should load a boxnote and fire load event', (done) => { + it('should load a boxnote and fire load event', done => { iframe.on('load', () => { assert.equal(iframe.iframeEl.src, 'https://app.box.com/notes_embedded/123?isReadonly=1&is_preview=1'); done(); @@ -64,13 +64,13 @@ describe('lib/viewers/iframe/IFrameViewer', () => { iframe.load(); }); - it('should load a boxnote with a shared name if a shared link exists and fire load event', (done) => { + it('should load a boxnote with a shared name if a shared link exists and fire load event', done => { iframe.options.sharedLink = 'https://app.box.com/s/foobar'; iframe.on('load', () => { assert.equal( iframe.iframeEl.src, - 'https://app.box.com/notes_embedded/123?isReadonly=1&is_preview=1&s=foobar' + 'https://app.box.com/notes_embedded/123?isReadonly=1&is_preview=1&s=foobar', ); done(); }); @@ -78,7 +78,7 @@ describe('lib/viewers/iframe/IFrameViewer', () => { iframe.load(); }); - it('should load a boxdicom and fire load event', (done) => { + it('should load a boxdicom and fire load event', done => { iframe.options.file.extension = 'boxdicom'; iframe.on('load', () => { diff --git a/src/lib/viewers/image/ImageBaseViewer.js b/src/lib/viewers/image/ImageBaseViewer.js index d9c04fd89..f6055ede6 100644 --- a/src/lib/viewers/image/ImageBaseViewer.js +++ b/src/lib/viewers/image/ImageBaseViewer.js @@ -207,7 +207,7 @@ class ImageBaseViewer extends BaseViewer { * @return {Promise} A promise that is resolved if the original image dimensions were set. */ setOriginalImageSize(imageEl) { - const promise = new Promise((resolve) => { + const promise = new Promise(resolve => { // Do not bother loading a new image when the natural size attributes exist if (imageEl.naturalWidth && imageEl.naturalHeight) { imageEl.setAttribute('originalWidth', imageEl.naturalWidth); @@ -217,9 +217,8 @@ class ImageBaseViewer extends BaseViewer { // Case when natural dimensions are not assigned // By default, assigned width and height in Chrome/Safari/Firefox will be 300x150. // IE11 workaround. Dimensions only displayed if the image is attached to the document. - api - .get(imageEl.src, { type: 'text' }) - .then((imageAsText) => { + api.get(imageEl.src, { type: 'text' }) + .then(imageAsText => { const parser = new DOMParser(); const svgEl = parser.parseFromString(imageAsText, 'image/svg+xml'); @@ -341,7 +340,8 @@ class ImageBaseViewer extends BaseViewer { if (key === 'Shift++') { this.zoomIn(); return true; - } else if (key === 'Shift+_') { + } + if (key === 'Shift+_') { this.zoomOut(); return true; } diff --git a/src/lib/viewers/image/ImageLoader.js b/src/lib/viewers/image/ImageLoader.js index b09b5b423..6dae809c2 100644 --- a/src/lib/viewers/image/ImageLoader.js +++ b/src/lib/viewers/image/ImageLoader.js @@ -11,29 +11,29 @@ const VIEWERS = [ NAME: 'Image', CONSTRUCTOR: ImageViewer, REP: ORIGINAL_REP_NAME, - EXT: ['svg', 'gif'] + EXT: ['svg', 'gif'], }, { NAME: 'MultiImage', CONSTRUCTOR: MultiImageViewer, REP: 'png', EXT: ['tif', 'tiff'], - ASSET: '{page}.png' + ASSET: '{page}.png', }, { NAME: 'Image', CONSTRUCTOR: ImageViewer, REP: 'jpg', EXT: ['jpeg', 'jpg'], - ASSET: '1.jpg' + ASSET: '1.jpg', }, { NAME: 'Image', CONSTRUCTOR: ImageViewer, REP: 'png', EXT: ['ai', 'bmp', 'dcm', 'eps', 'gif', 'heic', 'png', 'ps', 'psd', 'svs', 'tga', 'tif', 'tiff'], - ASSET: '1.png' - } + ASSET: '1.png', + }, ]; class ImageLoader extends AssetLoader { @@ -56,7 +56,7 @@ class ImageLoader extends AssetLoader { * @return {Object} The representation to load */ determineRepresentation(file, viewer) { - return file.representations.entries.find((entry) => { + return file.representations.entries.find(entry => { // Do not use the dimensions=1024x1024&paged=false rep that is for document preloading if (entry.properties && entry.properties.paged === 'false') { return false; diff --git a/src/lib/viewers/image/ImageViewer.js b/src/lib/viewers/image/ImageViewer.js index 0bc698a74..beca59db5 100644 --- a/src/lib/viewers/image/ImageViewer.js +++ b/src/lib/viewers/image/ImageViewer.js @@ -150,12 +150,12 @@ class ImageViewer extends ImageBaseViewer { if (isRotated) { return { width: height, - height: width + height: width, }; } return { width, - height + height, }; } @@ -180,7 +180,7 @@ class ImageViewer extends ImageBaseViewer { ({ width, height } = this.getTransformWidthAndHeight( this.imageEl.offsetWidth, this.imageEl.offsetHeight, - isRotated + isRotated, )); // Since we are taking offsetWidth, we only need to apply the zoom to the width @@ -196,7 +196,7 @@ class ImageViewer extends ImageBaseViewer { const viewport = { width: this.wrapperEl.clientWidth - 2 * IMAGE_PADDING, - height: this.wrapperEl.clientHeight - 2 * IMAGE_PADDING + height: this.wrapperEl.clientHeight - 2 * IMAGE_PADDING, }; // If the image is overflowing the viewport, figure out by how much // Then take that aspect that reduces the image the maximum (hence min ratio) to fit both width and height @@ -242,7 +242,7 @@ class ImageViewer extends ImageBaseViewer { this.emit('zoom', { newScale: [newWidth || width, newHeight || height], canZoomIn: true, - canZoomOut: true + canZoomOut: true, }); } @@ -262,7 +262,7 @@ class ImageViewer extends ImageBaseViewer { this.rotationAngle = (this.currentRotationAngle % 3600) % 360; this.emit('scale', { scale: this.scale, - rotationAngle: this.rotationAngle + rotationAngle: this.rotationAngle, }); } @@ -280,7 +280,7 @@ class ImageViewer extends ImageBaseViewer { __('enter_fullscreen'), this.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add(__('exit_fullscreen'), this.toggleFullscreen, 'bp-exit-fullscreen-icon', ICON_FULLSCREEN_OUT); } @@ -343,7 +343,7 @@ class ImageViewer extends ImageBaseViewer { const wrapperDimensions = this.wrapperEl.getBoundingClientRect(); const viewport = { width: this.wrapperEl.clientWidth - IMAGE_PADDING, - height: this.wrapperEl.clientHeight - IMAGE_PADDING + height: this.wrapperEl.clientHeight - IMAGE_PADDING, }; if (this.isRotated()) { @@ -440,7 +440,7 @@ class ImageViewer extends ImageBaseViewer { this.rotationAngle = (this.currentRotationAngle % 3600) % 360; this.emit('scale', { scale: this.scale, - rotationAngle: this.rotationAngle + rotationAngle: this.rotationAngle, }); } } diff --git a/src/lib/viewers/image/MultiImageViewer.js b/src/lib/viewers/image/MultiImageViewer.js index e860f8832..9d7d5fa74 100644 --- a/src/lib/viewers/image/MultiImageViewer.js +++ b/src/lib/viewers/image/MultiImageViewer.js @@ -124,7 +124,7 @@ class MultiImageViewer extends ImageBaseViewer { const urlBase = this.createContentUrlWithAuthParams(template, asset); const urls = []; - for (let pageNum = 1; pageNum <= this.pagesCount; pageNum++) { + for (let pageNum = 1; pageNum <= this.pagesCount; pageNum += 1) { urls.push(urlBase.replace('{page}', pageNum)); } @@ -155,7 +155,7 @@ class MultiImageViewer extends ImageBaseViewer { setOriginalImageSize() { const promises = []; - this.singleImageEls.forEach((imageEl) => { + this.singleImageEls.forEach(imageEl => { promises.push(super.setOriginalImageSize(imageEl)); }); @@ -255,7 +255,7 @@ class MultiImageViewer extends ImageBaseViewer { __('enter_fullscreen'), this.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add(__('exit_fullscreen'), this.toggleFullscreen, 'bp-exit-fullscreen-icon', ICON_FULLSCREEN_OUT); } @@ -357,7 +357,7 @@ class MultiImageViewer extends ImageBaseViewer { this.pageControls.updateCurrentPage(pageNumber); this.emit('pagefocus', { - pageNumber + pageNumber, }); } @@ -397,7 +397,7 @@ class MultiImageViewer extends ImageBaseViewer { this.currentPageNumber, this.previousScrollTop, this.singleImageEls[this.currentPageNumber - 1], - this.wrapperEl + this.wrapperEl, ); this.updateCurrentPage(pageChange); diff --git a/src/lib/viewers/image/__tests__/.eslintrc b/src/lib/viewers/image/__tests__/.eslintrc deleted file mode 100644 index ddb79ec14..000000000 --- a/src/lib/viewers/image/__tests__/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": ["../../../../../.eslintrc"], - "globals": { - "Assert": false - } -} diff --git a/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js b/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js index 9bccac946..fa8cee5ac 100644 --- a/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js +++ b/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js @@ -29,8 +29,8 @@ describe('lib/viewers/image/ImageBaseViewer', () => { containerEl = document.querySelector('.container'); imageBase = new ImageBaseViewer({ file: { - id: '1234' - } + id: '1234', + }, }); imageBase.containerEl = containerEl; imageBase.imageEl = document.createElement('div'); @@ -57,7 +57,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { sandbox.stub(imageBase.imageEl, 'removeEventListener'); Object.defineProperty(Object.getPrototypeOf(ImageBaseViewer.prototype), 'destroy', { - value: sandbox.stub() + value: sandbox.stub(), }); imageBase.destroy(); @@ -101,7 +101,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { sandbox.stub(imageBase, 'zoom'); Object.defineProperty(Object.getPrototypeOf(ImageBaseViewer.prototype), 'resize', { - value: sandbox.stub() + value: sandbox.stub(), }); imageBase.resize(); @@ -219,14 +219,14 @@ describe('lib/viewers/image/ImageBaseViewer', () => { }); describe('setOriginalImageSize()', () => { - it('should use the naturalHeight and naturalWidth when available', (done) => { + it('should use the naturalHeight and naturalWidth when available', done => { const imageEl = { naturalWidth: 100, naturalHeight: 100, setAttribute: (name, value) => { imageEl[name] = value; }, - getAttribute: (name) => imageEl[name] + getAttribute: name => imageEl[name], }; const promise = imageBase.setOriginalImageSize(imageEl); @@ -241,14 +241,14 @@ describe('lib/viewers/image/ImageBaseViewer', () => { }); }); - it('should default to 300x150 when naturalHeight and naturalWidth are 0x0', (done) => { + it('should default to 300x150 when naturalHeight and naturalWidth are 0x0', done => { const imageEl = { naturalWidth: 0, naturalHeight: 0, setAttribute: (name, value) => { imageEl[name] = value; }, - getAttribute: (name) => imageEl[name] + getAttribute: name => imageEl[name], }; sandbox.stub(api, 'get').resolves('not real a image'); @@ -264,7 +264,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { }); }); - it('should resolve when the get call fails', (done) => { + it('should resolve when the get call fails', done => { const imageEl = {}; sandbox.stub(api, 'get').returns(Promise.reject()); const promise = imageBase.setOriginalImageSize(imageEl); @@ -275,7 +275,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { describe('bindControlListeners()', () => { it('should add the correct controls', () => { imageBase.controls = { - add: sandbox.stub() + add: sandbox.stub(), }; imageBase.bindControlListeners(); @@ -283,13 +283,13 @@ describe('lib/viewers/image/ImageBaseViewer', () => { __('zoom_out'), imageBase.zoomOut, 'bp-image-zoom-out-icon', - ICON_ZOOM_OUT + ICON_ZOOM_OUT, ); expect(imageBase.controls.add).to.be.calledWith( __('zoom_in'), imageBase.zoomIn, 'bp-image-zoom-in-icon', - ICON_ZOOM_IN + ICON_ZOOM_IN, ); }); }); @@ -306,7 +306,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.handleMouseDown(event); event.button = 1; @@ -325,7 +325,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.handleMouseDown(event); expect(stubs.pan).to.have.been.called; @@ -346,7 +346,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.handleMouseUp(event); event.button = 1; @@ -365,7 +365,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.isZoomable = true; imageBase.handleMouseUp(event); @@ -379,7 +379,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.isZoomable = false; imageBase.didPan = false; @@ -394,7 +394,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; imageBase.isZoomable = false; imageBase.didPan = true; @@ -407,7 +407,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { it('should prevent drag events on the image', () => { const event = { preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; imageBase.cancelDragEvent(event); expect(event.preventDefault).to.be.called; @@ -462,7 +462,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { beforeEach(() => { imageBase.imageEl = { addEventListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; sandbox.stub(document, 'addEventListener'); @@ -497,7 +497,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { beforeEach(() => { imageBase.imageEl = { addEventListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; imageBase.imageEl.removeEventListener = sandbox.stub(); @@ -542,13 +542,13 @@ describe('lib/viewers/image/ImageBaseViewer', () => { beforeEach(() => { Object.defineProperty(Object.getPrototypeOf(ImageBaseViewer.prototype), 'handleDownloadError', { - value: sandbox.stub() + value: sandbox.stub(), }); }); afterEach(() => { Object.defineProperty(Object.getPrototypeOf(ImageBaseViewer.prototype), 'handleDownloadError', { - value: handleDownloadErrorFunc + value: handleDownloadErrorFunc, }); }); @@ -572,11 +572,11 @@ describe('lib/viewers/image/ImageBaseViewer', () => { stubs.setOriginalImageSize = sandbox.stub(imageBase, 'setOriginalImageSize'); imageBase.options = { file: { - id: 1 + id: 1, }, viewer: { - viewerName: 'Image' - } + viewerName: 'Image', + }, }; }); @@ -592,7 +592,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { expect(stubs.loadUI).to.not.have.been.called; }); - it('should load UI if not destroyed', (done) => { + it('should load UI if not destroyed', done => { imageBase.on(VIEWER_EVENT.load, () => { expect(imageBase.loaded).to.be.true; expect(stubs.zoom).to.have.been.called; @@ -610,7 +610,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { describe('disableViewerControls()', () => { it('should disable viewer controls', () => { imageBase.controls = { - disable: sandbox.stub() + disable: sandbox.stub(), }; sandbox.stub(imageBase, 'unbindDOMListeners'); imageBase.disableViewerControls(); @@ -624,7 +624,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { describe('enableViewerControls()', () => { it('should enable viewer controls', () => { imageBase.controls = { - enable: sandbox.stub() + enable: sandbox.stub(), }; imageBase.isMobile = true; sandbox.stub(imageBase, 'bindDOMListeners'); @@ -637,7 +637,7 @@ describe('lib/viewers/image/ImageBaseViewer', () => { it('should update cursor if not on mobile', () => { imageBase.controls = { - enable: sandbox.stub() + enable: sandbox.stub(), }; imageBase.isMobile = false; sandbox.stub(imageBase, 'bindDOMListeners'); diff --git a/src/lib/viewers/image/__tests__/ImageLoader-test.js b/src/lib/viewers/image/__tests__/ImageLoader-test.js index 9e3887244..72ce44b4d 100644 --- a/src/lib/viewers/image/__tests__/ImageLoader-test.js +++ b/src/lib/viewers/image/__tests__/ImageLoader-test.js @@ -22,24 +22,24 @@ describe('lib/viewers/image/ImageLoader', () => { representation: 'jpg', properties: { dimensions: '1024x1024', - paged: 'false' - } + paged: 'false', + }, }, { representation: 'jpg', properties: { - dimensions: '2048x2048' - } - } - ] - } + dimensions: '2048x2048', + }, + }, + ], + }, }; viewer = { NAME: 'Image', CONSTRUCTOR: ImageViewer, REP: 'jpg', - EXT: ['jpg'] + EXT: ['jpg'], }; }); diff --git a/src/lib/viewers/image/__tests__/ImageViewer-test.js b/src/lib/viewers/image/__tests__/ImageViewer-test.js index 3750137be..7e3ba5eb2 100644 --- a/src/lib/viewers/image/__tests__/ImageViewer-test.js +++ b/src/lib/viewers/image/__tests__/ImageViewer-test.js @@ -28,18 +28,18 @@ describe('lib/viewers/image/ImageViewer', () => { file: { id: '1', file_version: { - id: '1' - } + id: '1', + }, }, viewer: { NAME: 'Image', - ASSET: '1.png' + ASSET: '1.png', }, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -118,7 +118,7 @@ describe('lib/viewers/image/ImageViewer', () => { it('should not prefetch content if file is watermarked', () => { image.options.file.watermark_info = { - is_watermarked: true + is_watermarked: true, }; sandbox.stub(image, 'createContentUrlWithAuthParams'); @@ -333,7 +333,7 @@ describe('lib/viewers/image/ImageViewer', () => { image.setScale(width, height); expect(image.emit).to.be.calledWith('scale', { scale: sinon.match.any, - rotationAngle: sinon.match.number + rotationAngle: sinon.match.number, }); }); }); @@ -356,15 +356,15 @@ describe('lib/viewers/image/ImageViewer', () => { addEventListener() {}, contentWindow: { document: { - execCommand: stubs.execCommand + execCommand: stubs.execCommand, }, focus: stubs.focus, - print: stubs.print + print: stubs.print, }, contentDocument: { - querySelector: sandbox.stub().returns(containerEl.querySelector('img')) + querySelector: sandbox.stub().returns(containerEl.querySelector('img')), }, - removeEventListener() {} + removeEventListener() {}, }; stubs.openContentInsideIframe = sandbox.stub(util, 'openContentInsideIframe').returns(stubs.mockIframe); @@ -379,7 +379,7 @@ describe('lib/viewers/image/ImageViewer', () => { expect(stubs.focus).to.be.called; }); - it('should execute the print command if the browser is Explorer', (done) => { + it('should execute the print command if the browser is Explorer', done => { stubs.getName.returns('Explorer'); stubs.mockIframe.addEventListener = (type, callback) => { callback(); @@ -391,7 +391,7 @@ describe('lib/viewers/image/ImageViewer', () => { image.print(); }); - it('should execute the print command if the browser is Edge', (done) => { + it('should execute the print command if the browser is Edge', done => { stubs.getName.returns('Edge'); stubs.mockIframe.addEventListener = (type, callback) => { callback(); @@ -403,7 +403,7 @@ describe('lib/viewers/image/ImageViewer', () => { image.print(); }); - it('should call the contentWindow print for other browsers', (done) => { + it('should call the contentWindow print for other browsers', done => { stubs.getName.returns('Chrome'); stubs.mockIframe.addEventListener = (type, callback) => { callback(); @@ -436,7 +436,7 @@ describe('lib/viewers/image/ImageViewer', () => { const widthAndHeightObj = image.getTransformWidthAndHeight(width, height, false); expect(widthAndHeightObj).to.deep.equal({ width, - height + height, }); }); @@ -446,7 +446,7 @@ describe('lib/viewers/image/ImageViewer', () => { const widthAndHeightObj = image.getTransformWidthAndHeight(width, height, true); expect(widthAndHeightObj).to.deep.equal({ width: height, - height: width + height: width, }); }); }); @@ -532,7 +532,7 @@ describe('lib/viewers/image/ImageViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; image.handleMouseUp(event); event.button = 1; @@ -551,7 +551,7 @@ describe('lib/viewers/image/ImageViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; image.isZoomable = true; image.handleMouseUp(event); @@ -565,7 +565,7 @@ describe('lib/viewers/image/ImageViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; image.isZoomable = false; image.didPan = false; @@ -580,7 +580,7 @@ describe('lib/viewers/image/ImageViewer', () => { metaKey: null, clientX: 1, clientY: 1, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; image.isZoomable = false; image.didPan = true; @@ -597,13 +597,13 @@ describe('lib/viewers/image/ImageViewer', () => { expect(stubs.padding).to.be.called; expect(image.emit).to.be.calledWith('scale', { scale: sinon.match.any, - rotationAngle: sinon.match.number + rotationAngle: sinon.match.number, }); }); }); describe('handleAssetAndRepLoad', () => { - it('should setup image src', (done) => { + it('should setup image src', done => { const url = 'foo'; const imageEl = document.createElement('img'); @@ -611,10 +611,10 @@ describe('lib/viewers/image/ImageViewer', () => { const startLoadTimer = sandbox.stub(image, 'startLoadTimer'); const loadBoxAnnotations = sandbox.stub(image, 'loadBoxAnnotations').returns(Promise.resolve()); const createAnnotator = sandbox.stub(image, 'createAnnotator').returns( - new Promise((resolve) => { + new Promise(resolve => { resolve(); done(); - }) + }), ); image.handleAssetAndRepLoad(url); diff --git a/src/lib/viewers/image/__tests__/MultiImageViewer-test.js b/src/lib/viewers/image/__tests__/MultiImageViewer-test.js index 39e1b35c9..6af7a5b3d 100644 --- a/src/lib/viewers/image/__tests__/MultiImageViewer-test.js +++ b/src/lib/viewers/image/__tests__/MultiImageViewer-test.js @@ -34,37 +34,37 @@ describe('lib/viewers/image/MultiImageViewer', () => { stubs.emit = sandbox.stub(fullscreen, 'addListener'); options = { file: { - id: 100 + id: 100, }, viewerAsset: '{page}.png', viewer: { - ASSET: '{page}.png' + ASSET: '{page}.png', }, container: containerEl, representation: { content: { - url_template: 'link' + url_template: 'link', }, metadata: { - pages: 3 - } - } + pages: 3, + }, + }, }; stubs.singleImageEl = { src: undefined, setAttribute: sandbox.stub(), classList: { - add: sandbox.stub() + add: sandbox.stub(), }, - scrollIntoView: sandbox.stub() + scrollIntoView: sandbox.stub(), }; multiImage = new MultiImageViewer(options); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); Object.defineProperty(ImageBaseViewer.prototype, 'setOriginalImageSize', { - value: sandbox.stub().returns(Promise.resolve()) + value: sandbox.stub().returns(Promise.resolve()), }); multiImage.containerEl = containerEl; multiImage.setup(); @@ -96,8 +96,8 @@ describe('lib/viewers/image/MultiImageViewer', () => { stubs.unbindDOMListeners = sandbox.stub(multiImage, 'unbindDOMListeners'); multiImage.singleImageEls = [ { - removeEventListener: sandbox.stub() - } + removeEventListener: sandbox.stub(), + }, ]; }); @@ -122,7 +122,7 @@ describe('lib/viewers/image/MultiImageViewer', () => { stubs.bindImageListeners = sandbox.stub(multiImage, 'bindImageListeners'); stubs.setupImageEls = sandbox.stub(multiImage, 'setupImageEls'); multiImage.wrapperEl = { - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; stubs.addWrapperListener = multiImage.wrapperEl.addEventListener; }); @@ -178,13 +178,13 @@ describe('lib/viewers/image/MultiImageViewer', () => { multiImage.options = { viewerAsset: '{asset_path}', viewer: { - ASSET: '{page}.png' + ASSET: '{page}.png', }, representation: { metadata: { - pages: 3 - } - } + pages: 3, + }, + }, }; const result2 = multiImage.constructImageUrls('file/100/content/{+asset_path}'); expect(result2[0]).to.equal(firstURL); @@ -242,7 +242,7 @@ describe('lib/viewers/image/MultiImageViewer', () => { expect(promise).to.be.a('Promise'); }); - it('should return a promise that resolves after each image has a proper size', (done) => { + it('should return a promise that resolves after each image has a proper size', done => { // We've overridden super.setOriginalImageSize() to resolve immediately multiImage.setOriginalImageSize().then(() => { done(); @@ -326,11 +326,11 @@ describe('lib/viewers/image/MultiImageViewer', () => { multiImage.singleImageEls = [ { naturalWidth: 1024, - naturalHeight: 1024 + naturalHeight: 1024, }, { - src: 'www.NotTheRightImage.net' - } + src: 'www.NotTheRightImage.net', + }, ]; sandbox.stub(multiImage, 'emit'); @@ -356,11 +356,11 @@ describe('lib/viewers/image/MultiImageViewer', () => { multiImage.pagesCount = 10; multiImage.pageControls = { add: sandbox.stub(), - addListener: sandbox.stub() + addListener: sandbox.stub(), }; multiImage.controls = { - add: sandbox.stub() + add: sandbox.stub(), }; }); @@ -378,13 +378,13 @@ describe('lib/viewers/image/MultiImageViewer', () => { __('enter_fullscreen'), multiImage.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); expect(multiImage.controls.add).to.be.calledWith( __('exit_fullscreen'), multiImage.toggleFullscreen, 'bp-exit-fullscreen-icon', - ICON_FULLSCREEN_OUT + ICON_FULLSCREEN_OUT, ); }); }); @@ -393,11 +393,11 @@ describe('lib/viewers/image/MultiImageViewer', () => { beforeEach(() => { multiImage.singleImageEls = [ { - src: 'foo' + src: 'foo', }, { - src: 'baz' - } + src: 'baz', + }, ]; sandbox.stub(multiImage, 'handleDownloadError'); @@ -419,11 +419,11 @@ describe('lib/viewers/image/MultiImageViewer', () => { beforeEach(() => { multiImage.singleImageEls = [ { - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }, { - addEventListener: sandbox.stub() - } + addEventListener: sandbox.stub(), + }, ]; }); @@ -442,11 +442,11 @@ describe('lib/viewers/image/MultiImageViewer', () => { beforeEach(() => { multiImage.singleImageEls = [ { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }, { - removeEventListener: sandbox.stub() - } + removeEventListener: sandbox.stub(), + }, ]; }); @@ -493,7 +493,7 @@ describe('lib/viewers/image/MultiImageViewer', () => { beforeEach(() => { stubs.isValidPageChange = sandbox.stub(multiImage, 'isValidPageChange'); multiImage.pageControls = { - updateCurrentPage: sandbox.stub() + updateCurrentPage: sandbox.stub(), }; stubs.emit = sandbox.stub(multiImage, 'emit'); @@ -585,7 +585,7 @@ describe('lib/viewers/image/MultiImageViewer', () => { stubs.singleImageEls = multiImage.singleImageEls; multiImage.wrapperEl = { - scrollTop: 100 + scrollTop: 100, }; stubs.wrapperEl = multiImage.wrapperEl; diff --git a/src/lib/viewers/media/DashViewer.js b/src/lib/viewers/media/DashViewer.js index 1206fb646..974a2a609 100644 --- a/src/lib/viewers/media/DashViewer.js +++ b/src/lib/viewers/media/DashViewer.js @@ -163,7 +163,7 @@ class DashViewer extends VideoBaseViewer { this.player.addEventListener('error', this.shakaErrorHandler); this.player.configure({ abr: { - enabled: false + enabled: false, }, streaming: { bufferingGoal: MAX_BUFFER, @@ -172,9 +172,9 @@ class DashViewer extends VideoBaseViewer { maxAttempts: 100, // the maximum number of requests before we fail baseDelay: 500, // the base delay in ms between retries backoffFactor: 2, // the multiplicative backoff factor between retries - fuzzFactor: 0.5 // the fuzz factor to apply to each retry delay - } - } + fuzzFactor: 0.5, // the fuzz factor to apply to each retry delay + }, + }, }); this.player.getNetworkingEngine().registerRequestFilter(this.requestFilter); @@ -194,7 +194,7 @@ class DashViewer extends VideoBaseViewer { requestFilter(type, request) { const asset = type === shaka.net.NetworkingEngine.RequestType.MANIFEST ? MANIFEST : undefined; /* eslint-disable no-param-reassign */ - request.uris = request.uris.map((uri) => { + request.uris = request.uris.map(uri => { let newUri = this.createContentUrlWithAuthParams(uri, asset); if (asset !== MANIFEST && this.options.file.watermark_info.is_watermarked) { newUri = appendQueryParams(newUri, { watermark_content: this.watermarkCacheBust }); @@ -212,7 +212,7 @@ class DashViewer extends VideoBaseViewer { */ getActiveTrack() { const tracks = this.player.getVariantTracks(); - return tracks.find((track) => track.active); + return tracks.find(track => track.active); } /** @@ -240,7 +240,7 @@ class DashViewer extends VideoBaseViewer { enableVideoId(videoId) { const tracks = this.player.getVariantTracks(); const activeTrack = this.getActiveTrack(); - const newTrack = tracks.find((track) => track.videoId === videoId && track.audioId === activeTrack.audioId); + const newTrack = tracks.find(track => track.videoId === videoId && track.audioId === activeTrack.audioId); if (newTrack && newTrack.id !== activeTrack.id) { this.showLoadingIcon(newTrack.id); this.player.selectVariantTrack(newTrack, true); @@ -259,7 +259,7 @@ class DashViewer extends VideoBaseViewer { const tracks = this.player.getVariantTracks(); const activeTrack = this.getActiveTrack(); // We select a track that has the desired audio role but maintains the same video ID as our currently active track. - const newTrack = tracks.find((track) => track.roles[0] === role && track.videoId === activeTrack.videoId); + const newTrack = tracks.find(track => track.roles[0] === role && track.videoId === activeTrack.videoId); if (newTrack && newTrack.audioId !== activeTrack.audioId) { this.showLoadingIcon(newTrack.id); this.player.selectVariantTrack(newTrack, true); @@ -412,11 +412,11 @@ class DashViewer extends VideoBaseViewer { __('error_refresh'), { code: normalizedShakaError.code, - severity: normalizedShakaError.severity + severity: normalizedShakaError.severity, }, `Shaka error. Code = ${normalizedShakaError.code}, Category = ${ normalizedShakaError.category - }, Severity = ${normalizedShakaError.severity}, Data = ${normalizedShakaError.data.toString()}` + }, Severity = ${normalizedShakaError.severity}, Data = ${normalizedShakaError.data.toString()}`, ); if (normalizedShakaError.severity > SHAKA_CODE_ERROR_RECOVERABLE) { @@ -455,8 +455,8 @@ class DashViewer extends VideoBaseViewer { this.textTracks = this.player.getTextTracks().sort((track1, track2) => track1.id - track2.id); if (this.textTracks.length > 0) { this.mediaControls.initSubtitles( - this.textTracks.map((track) => getLanguageName(track.language) || track.language), - getLanguageName(this.options.location.locale.substring(0, 2)) + this.textTracks.map(track => getLanguageName(track.language) || track.language), + getLanguageName(this.options.location.locale.substring(0, 2)), ); } } @@ -495,7 +495,7 @@ class DashViewer extends VideoBaseViewer { this.mediaControls.setLabel(this.mediaControls.subtitlesButtonEl, __('media_auto_generated_captions')); this.mediaControls.initSubtitles( [__('auto_generated')], - getLanguageName(this.options.location.locale.substring(0, 2)) + getLanguageName(this.options.location.locale.substring(0, 2)), ); } } @@ -508,7 +508,7 @@ class DashViewer extends VideoBaseViewer { */ createTextCues(transcriptCard) { const entries = getProp(transcriptCard, 'entries', []); - return entries.map((entry) => { + return entries.map(entry => { // Set defaults if transcript data is malformed (start/end: 0s, text: '') const { appears = [{}], text = '' } = entry; const { start = 0, end = 0 } = Array.isArray(appears) && appears.length > 0 ? appears[0] : {}; @@ -540,7 +540,7 @@ class DashViewer extends VideoBaseViewer { const uniqueAudioVariants = []; let i = 0; - for (i = 0; i < variants.length; i++) { + for (i = 0; i < variants.length; i += 1) { const audioTrack = variants[i]; if (audioIds.indexOf(audioTrack.audioId) < 0) { audioIds.push(audioTrack.audioId); @@ -548,14 +548,14 @@ class DashViewer extends VideoBaseViewer { } } - this.audioTracks = uniqueAudioVariants.map((track) => ({ + this.audioTracks = uniqueAudioVariants.map(track => ({ language: track.language, - role: track.roles[0] + role: track.roles[0], })); if (this.audioTracks.length > 1) { // translate the language first - const languages = this.audioTracks.map((track) => getLanguageName(track.language) || track.language); + const languages = this.audioTracks.map(track => getLanguageName(track.language) || track.language); this.mediaControls.initAlternateAudio(languages); } } @@ -667,7 +667,7 @@ class DashViewer extends VideoBaseViewer { let height = this.videoHeight || 0; const viewport = { height: this.wrapperEl.clientHeight, - width: this.wrapperEl.clientWidth + width: this.wrapperEl.clientWidth, }; // We need the width to be atleast wide enough for the controls diff --git a/src/lib/viewers/media/MediaBaseViewer.js b/src/lib/viewers/media/MediaBaseViewer.js index 785bdaf15..7b17e96be 100644 --- a/src/lib/viewers/media/MediaBaseViewer.js +++ b/src/lib/viewers/media/MediaBaseViewer.js @@ -46,6 +46,7 @@ class MediaBaseViewer extends BaseViewer { this.handleAutoplay = this.handleAutoplay.bind(this); this.mediaendHandler = this.mediaendHandler.bind(this); } + /** * @inheritdoc */ @@ -604,7 +605,7 @@ class MediaBaseViewer extends BaseViewer { } else { this.mediaEl.pause(); this.emit('pause', { - userInitiated + userInitiated, }); } } @@ -837,7 +838,7 @@ class MediaBaseViewer extends BaseViewer { * @param {string} match - the timestamp substring e.g. 1h, 2m, or 3s * @return {number} - the number for the given unit */ - const getValueOfMatch = (match) => { + const getValueOfMatch = match => { // Strip off unit (h, m, s) and convert to float const parsedMatch = parseFloat(match[0].slice(0, -1), 10); return Number.isNaN(parsedMatch) ? 0 : parsedMatch; diff --git a/src/lib/viewers/media/MediaControls.js b/src/lib/viewers/media/MediaControls.js index c6a6a6e00..2f0a081be 100644 --- a/src/lib/viewers/media/MediaControls.js +++ b/src/lib/viewers/media/MediaControls.js @@ -13,7 +13,7 @@ const VOLUME_LEVEL_CLASS_NAMES = [ 'bp-media-volume-icon-is-mute', 'bp-media-volume-icon-is-low', 'bp-media-volume-icon-is-medium', - 'bp-media-volume-icon-is-high' + 'bp-media-volume-icon-is-high', ]; const CRAWLER = '
'; @@ -284,7 +284,7 @@ class MediaControls extends EventEmitter { Math.floor(this.mediaEl.duration), 0, 0, - 1 + 1, ); this.setTimeCode(this.mediaEl.currentTime || 0); // This also sets the aria values this.timeScrubber.on('valuechange', () => { @@ -341,7 +341,7 @@ class MediaControls extends EventEmitter { this.timecodeEl.textContent = this.formatTime(time || 0); this.timeScrubber.setAriaValues( Math.floor(time), - `${this.timecodeEl.textContent} ${__('of')} ${this.durationEl.textContent}` + `${this.timecodeEl.textContent} ${__('of')} ${this.durationEl.textContent}`, ); } @@ -466,7 +466,7 @@ class MediaControls extends EventEmitter { * @return {void} */ updateVolumeIcon(volume) { - VOLUME_LEVEL_CLASS_NAMES.forEach((className) => { + VOLUME_LEVEL_CLASS_NAMES.forEach(className => { this.volButtonEl.classList.remove(className); }); this.volButtonEl.classList.add(VOLUME_LEVEL_CLASS_NAMES[Math.ceil(volume * 3)]); @@ -780,7 +780,7 @@ class MediaControls extends EventEmitter { * @return {Function} - the handler function */ timeScrubberHandler(cb) { - return (event) => { + return event => { const { target } = event; const { playedEl, convertedEl } = this.timeScrubber; if (target === convertedEl || target === playedEl) { @@ -877,7 +877,7 @@ class MediaControls extends EventEmitter { time, left, top, - containerLeft + containerLeft, }; } @@ -900,7 +900,7 @@ class MediaControls extends EventEmitter { pageX, rect.left, rect.width, - this.filmstripEl.naturalWidth + this.filmstripEl.naturalWidth, ); this.filmstripEl.style.left = `${filmstripPositions.left}px`; diff --git a/src/lib/viewers/media/MediaLoader.js b/src/lib/viewers/media/MediaLoader.js index 16dd34bd5..417bcd675 100644 --- a/src/lib/viewers/media/MediaLoader.js +++ b/src/lib/viewers/media/MediaLoader.js @@ -24,7 +24,7 @@ const VIDEO_FORMATS = [ 'ogg', 'qt', 'ts', - 'wmv' + 'wmv', ]; // Order of the viewers matters. Prefer original before others. Go from specific to general. @@ -35,26 +35,26 @@ const VIEWERS = [ NAME: 'MP3', CONSTRUCTOR: MP3Viewer, REP: ORIGINAL_REP_NAME, - EXT: ['mp3'] + EXT: ['mp3'], }, { NAME: 'Dash', CONSTRUCTOR: DashViewer, REP: 'dash', - EXT: VIDEO_FORMATS + EXT: VIDEO_FORMATS, }, { NAME: 'MP4', CONSTRUCTOR: MP4Viewer, REP: 'mp4', - EXT: VIDEO_FORMATS + EXT: VIDEO_FORMATS, }, { NAME: 'MP3', CONSTRUCTOR: MP3Viewer, REP: 'mp3', - EXT: ['aac', 'aif', 'aifc', 'aiff', 'amr', 'au', 'flac', 'm4a', 'mp3', 'ra', 'wav', 'wma'] - } + EXT: ['aac', 'aif', 'aifc', 'aiff', 'amr', 'au', 'flac', 'm4a', 'mp3', 'ra', 'wav', 'wma'], + }, ]; class MediaLoader extends AssetLoader { diff --git a/src/lib/viewers/media/Scrubber.js b/src/lib/viewers/media/Scrubber.js index b3f6ddb56..4e8576ca9 100644 --- a/src/lib/viewers/media/Scrubber.js +++ b/src/lib/viewers/media/Scrubber.js @@ -28,7 +28,7 @@ class Scrubber extends EventEmitter { ariaValuemax, value = MIN_VALUE, bufferedValue = MAX_VALUE, - convertedValue = MAX_VALUE + convertedValue = MAX_VALUE, ) { super(); @@ -181,7 +181,7 @@ class Scrubber extends EventEmitter { // no less than the last converted value this.convertedValue = Math.max( Math.min(Math.max(value, this.convertedValue || MIN_VALUE), MAX_VALUE), - MIN_VALUE + MIN_VALUE, ); this.convertedEl.style.width = `${this.convertedValue * 100}%`; } diff --git a/src/lib/viewers/media/Settings.js b/src/lib/viewers/media/Settings.js index e2b2ce385..1c0a5db5b 100644 --- a/src/lib/viewers/media/Settings.js +++ b/src/lib/viewers/media/Settings.js @@ -262,7 +262,7 @@ class Settings extends EventEmitter { */ increaseSpeed() { const current = parseFloat(this.cache.get('media-speed') || '1.0'); - const higherSpeeds = MEDIA_SPEEDS.filter((speed) => parseFloat(speed) > current); + const higherSpeeds = MEDIA_SPEEDS.filter(speed => parseFloat(speed) > current); if (higherSpeeds.length > 0) { this.chooseOption(TYPE_SPEED, higherSpeeds[0]); } @@ -275,7 +275,7 @@ class Settings extends EventEmitter { */ decreaseSpeed() { const current = parseFloat(this.cache.get('media-speed') || '1.0'); - const lowerSpeeds = MEDIA_SPEEDS.filter((speed) => parseFloat(speed) < current); + const lowerSpeeds = MEDIA_SPEEDS.filter(speed => parseFloat(speed) < current); if (lowerSpeeds.length > 0) { this.chooseOption(TYPE_SPEED, lowerSpeeds[lowerSpeeds.length - 1]); } @@ -339,7 +339,7 @@ class Settings extends EventEmitter { this.setMenuContainerDimensions(subMenu); // Move focus to the currently selected value const curSelectedOption = this.settingsEl.querySelector( - `[data-type="${type}"]${SELECTOR_SETTINGS_SUB_ITEM}.${CLASS_SETTINGS_SELECTED}` + `[data-type="${type}"]${SELECTOR_SETTINGS_SUB_ITEM}.${CLASS_SETTINGS_SELECTED}`, ); curSelectedOption.focus(); } @@ -389,8 +389,8 @@ class Settings extends EventEmitter { } else if (event.type === 'keydown') { const key = decodeKeydown(event).toLowerCase(); const menuEl = menuItem.parentElement; - const visibleOptions = [].filter.call(menuEl.children, (option) => option.offsetParent !== null); - const itemIdx = [].findIndex.call(visibleOptions, (e) => { + const visibleOptions = [].filter.call(menuEl.children, option => option.offsetParent !== null); + const itemIdx = [].findIndex.call(visibleOptions, e => { return e.contains(menuItem); }); @@ -473,7 +473,7 @@ class Settings extends EventEmitter { */ getSelectedOption(type) { return this.settingsEl.querySelector( - `[data-type="${type}"]${SELECTOR_SETTINGS_SUB_ITEM}.${CLASS_SETTINGS_SELECTED}` + `[data-type="${type}"]${SELECTOR_SETTINGS_SUB_ITEM}.${CLASS_SETTINGS_SELECTED}`, ); } @@ -650,10 +650,10 @@ class Settings extends EventEmitter { } else { // Do intelligent selection: Prefer user's language, fallback to English, then first subtitle in list // Use the previewer's locale to determine preferred language - let idx = this.subtitles.findIndex((subtitle) => subtitle === this.language); + let idx = this.subtitles.findIndex(subtitle => subtitle === this.language); if (idx === -1) { // Fall back to English if user's language doesn't exist - idx = this.subtitles.findIndex((subtitle) => subtitle === 'English'); + idx = this.subtitles.findIndex(subtitle => subtitle === 'English'); if (idx === -1) { idx = 0; // Fall back to first subtitle in list } @@ -676,7 +676,7 @@ class Settings extends EventEmitter { this.subtitles.forEach((subtitle, idx) => { insertTemplate( subtitlesSubMenu, - SUBMENU_SUBITEM_TEMPLATE.replace(/{{dataType}}/g, 'subtitles').replace(/{{dataValue}}/g, idx) + SUBMENU_SUBITEM_TEMPLATE.replace(/{{dataType}}/g, 'subtitles').replace(/{{dataValue}}/g, idx), ); const languageNode = subtitlesSubMenu.lastChild.querySelector('.bp-media-settings-value'); languageNode.textContent = subtitle; @@ -703,7 +703,7 @@ class Settings extends EventEmitter { audioLanguages.forEach((language, idx) => { insertTemplate( audioTracksSubMenu, - SUBMENU_SUBITEM_TEMPLATE.replace(/{{dataType}}/g, 'audiotracks').replace(/{{dataValue}}/g, idx) + SUBMENU_SUBITEM_TEMPLATE.replace(/{{dataType}}/g, 'audiotracks').replace(/{{dataValue}}/g, idx), ); const trackNode = audioTracksSubMenu.lastChild.querySelector('.bp-media-settings-value'); // It's common for the language to be unknown and show up as "und" language code. Just omit diff --git a/src/lib/viewers/media/__tests__/DashViewer-test.js b/src/lib/viewers/media/__tests__/DashViewer-test.js index ad4ea8076..0975b32c6 100644 --- a/src/lib/viewers/media/__tests__/DashViewer-test.js +++ b/src/lib/viewers/media/__tests__/DashViewer-test.js @@ -31,32 +31,32 @@ describe('lib/viewers/media/DashViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, file: { id: 0, permissions: { - can_download: true - } + can_download: true, + }, }, container: containerEl, location: { locale: 'en-US' }, representation: { content: { - url_template: 'url' + url_template: 'url', }, - status: {} - } + status: {}, + }, }); // Stubbing out sub-components of the dash player stubs.emit = sandbox.stub(dash, 'emit'); dash.filmstripStatus = { - destroy: () => {} + destroy: () => {}, }; stubs.networkEngine = { - registerRequestFilter: () => {} + registerRequestFilter: () => {}, }; dash.player = { addEventListener: () => {}, @@ -71,11 +71,11 @@ describe('lib/viewers/media/DashViewer', () => { selectTextTrack: () => {}, selectVariantTrack: () => {}, selectAudioLanguage: () => {}, - setTextTrackVisibility: () => {} + setTextTrackVisibility: () => {}, }; dash.autoCaptionDisplayer = { append: () => {}, - setTextVisibility: () => {} + setTextVisibility: () => {}, }; stubs.mockPlayer = sandbox.mock(dash.player); stubs.mockDisplayer = sandbox.mock(dash.autoCaptionDisplayer); @@ -90,7 +90,7 @@ describe('lib/viewers/media/DashViewer', () => { removeAllListeners: () => {}, removeListener: () => {}, show: sandbox.stub(), - setLabel: () => {} + setLabel: () => {}, }; stubs.mockControls = sandbox.mock(dash.mediaControls); @@ -265,12 +265,12 @@ describe('lib/viewers/media/DashViewer', () => { dash.options = { file: { watermark_info: { - is_watermarked: false + is_watermarked: false, }, representations: { - entries: [{ representation: 'dash' }] - } - } + entries: [{ representation: 'dash' }], + }, + }, }; dash.requestFilter('', stubs.req); @@ -286,12 +286,12 @@ describe('lib/viewers/media/DashViewer', () => { dash.options = { file: { watermark_info: { - is_watermarked: true + is_watermarked: true, }, representations: { - entries: [{ representation: 'dash' }] - } - } + entries: [{ representation: 'dash' }], + }, + }, }; dash.requestFilter('', stubs.req); @@ -538,8 +538,8 @@ describe('lib/viewers/media/DashViewer', () => { severity: 2, // critical severity category: 1, code: 1100, - data: ['foobar'] - } + data: ['foobar'], + }, }; dash.shakaErrorHandler(shakaError); @@ -558,8 +558,8 @@ describe('lib/viewers/media/DashViewer', () => { severity: 1, // recoverable severity category: 1, code: 1100, - data: ['foobar'] - } + data: ['foobar'], + }, }; dash.shakaErrorHandler(shakaError); @@ -572,7 +572,7 @@ describe('lib/viewers/media/DashViewer', () => { severity: 2, // critical severity category: 1, code: 1100, // HTTP Error code - data: ['foobar'] + data: ['foobar'], }; dash.shakaErrorHandler(shakaError); @@ -587,7 +587,7 @@ describe('lib/viewers/media/DashViewer', () => { severity: 2, // critical severity category: 1, code: 1002, // hTTP Error code - data: ['foobar'] + data: ['foobar'], }; sandbox.stub(dash, 'handleDownloadError'); dash.shakaErrorHandler(shakaError); @@ -601,13 +601,13 @@ describe('lib/viewers/media/DashViewer', () => { afterEach(() => { Object.defineProperty(VideoBaseViewer.prototype, 'addEventListenersForMediaControls', { - value: listenerFunc + value: listenerFunc, }); }); it('should add event listeners to the media controls', () => { Object.defineProperty(VideoBaseViewer.prototype, 'addEventListenersForMediaControls', { - value: sandbox.mock() + value: sandbox.mock(), }); stubs.mockControls.expects('addListener').withArgs('qualitychange', sinon.match.func); stubs.mockControls.expects('addListener').withArgs('subtitlechange', sinon.match.func); @@ -663,7 +663,7 @@ describe('lib/viewers/media/DashViewer', () => { enableHDSettings: sandbox.stub(), removeListener: sandbox.stub(), removeAllListeners: sandbox.stub(), - destroy: sandbox.stub() + destroy: sandbox.stub(), }; Object.defineProperty(VideoBaseViewer.prototype, 'loadUI', { value: sandbox.mock() }); @@ -696,11 +696,11 @@ describe('lib/viewers/media/DashViewer', () => { { representation: 'filmstrip', content: { url_template: '' }, - metadata: { interval: 1 } - } - ] - } - } + metadata: { interval: 1 }, + }, + ], + }, + }, }; stubs.createUrl = sandbox.stub(dash, 'createContentUrlWithAuthParams'); sandbox.stub(dash, 'getRepStatus'); @@ -715,7 +715,7 @@ describe('lib/viewers/media/DashViewer', () => { it('should do nothing if the filmstrip metadata field does not exist', () => { dash.options.file.representations.entries[1] = { representation: 'filmstrip', - content: { url_template: '' } + content: { url_template: '' }, // Missing metadata field }; dash.loadFilmStrip(); @@ -805,7 +805,7 @@ describe('lib/viewers/media/DashViewer', () => { append: () => {}, setTextVisibility: () => {}, isTextVisible: () => {}, - destroy: () => {} + destroy: () => {}, }; dash.createTextCues = sandbox.stub(); dash.setupAutoCaptionDisplayer = sandbox.stub(); @@ -817,10 +817,10 @@ describe('lib/viewers/media/DashViewer', () => { appears: [ { start: 0, - end: 1 - } + end: 1, + }, ], - text: 'sometext' + text: 'sometext', }; const cues = [{ 1: 'foo' }, { 2: 'bar' }]; @@ -874,13 +874,13 @@ describe('lib/viewers/media/DashViewer', () => { beforeEach(() => { stubs.appendStub = sandbox.stub(); sandbox.stub(shaka.text, 'SimpleTextDisplayer').returns({ - append: stubs.appendStub + append: stubs.appendStub, }); }); it('should setup a simpleTextDisplayer and configure the player', () => { stubs.mockPlayer.expects('configure').withArgs({ - textDisplayFactory: sandbox.match.any + textDisplayFactory: sandbox.match.any, }); dash.setupAutoCaptionDisplayer('foo'); @@ -903,7 +903,7 @@ describe('lib/viewers/media/DashViewer', () => { expect(dash.audioTracks).to.deep.equal([ { language: 'eng', role: 'audio0' }, - { language: 'rus', role: 'audio1' } + { language: 'rus', role: 'audio1' }, ]); }); @@ -1022,7 +1022,7 @@ describe('lib/viewers/media/DashViewer', () => { dash.audioTracks = [ { language: 'eng', role: 'audio0' }, { language: 'eng', role: 'audio1' }, - { language: 'eng', role: 'audio2' } + { language: 'eng', role: 'audio2' }, ]; sandbox.stub(dash.cache, 'get').returns('1'); @@ -1034,7 +1034,7 @@ describe('lib/viewers/media/DashViewer', () => { dash.audioTracks = [ { language: 'eng', role: 'audio0' }, { language: 'eng', role: 'audio1' }, - { language: 'eng', role: 'audio2' } + { language: 'eng', role: 'audio2' }, ]; sandbox.stub(dash.cache, 'get').returns('3'); @@ -1166,7 +1166,7 @@ describe('lib/viewers/media/DashViewer', () => { stubs.mockPlayer.expects('getStats').returns({ estimatedBandwidth: 2000, streamBandwidth: 1000, - switchHistory: 'history' + switchHistory: 'history', }); dash.getBandwidthInterval(); expect(dash.bandwidthHistory[0]).to.deep.equal({ bandwidth: 2000, stream: 1000 }); @@ -1177,7 +1177,7 @@ describe('lib/viewers/media/DashViewer', () => { stubs.mockPlayer.expects('getStats').returns({ estimatedBandwidth: 2000, streamBandwidth: 1000, - switchHistory: 'history' + switchHistory: 'history', }); dash.statsEl = { textContent: '' }; dash.mediaContainerEl = null; @@ -1197,7 +1197,7 @@ describe('lib/viewers/media/DashViewer', () => { describe('removeStats()', () => { beforeEach(() => { dash.mediaContainerEl = { - removeChild: () => {} + removeChild: () => {}, }; stubs.mock = sandbox.mock(dash.mediaContainerEl); }); @@ -1264,11 +1264,11 @@ describe('lib/viewers/media/DashViewer', () => { describe('showGearHdIcon()', () => { const hdTrack = { - videoId: 1 + videoId: 1, }; const sdTrack = { - videoId: 2 + videoId: 2, }; beforeEach(() => { diff --git a/src/lib/viewers/media/__tests__/MP3Viewer-test.js b/src/lib/viewers/media/__tests__/MP3Viewer-test.js index 9eb0c93cd..e38edbc1e 100644 --- a/src/lib/viewers/media/__tests__/MP3Viewer-test.js +++ b/src/lib/viewers/media/__tests__/MP3Viewer-test.js @@ -19,8 +19,8 @@ describe('lib/viewers/media/MP3Viewer', () => { mp3 = new MP3Viewer({ container: containerEl, file: { - id: 1 - } + id: 1, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -64,7 +64,7 @@ describe('lib/viewers/media/MP3Viewer', () => { show: () => {}, destroy: () => {}, resizeTimeScrubber: () => {}, - removeAllListeners: () => {} + removeAllListeners: () => {}, }; const controlsMock = sandbox.mock(mp3.mediaControls); diff --git a/src/lib/viewers/media/__tests__/MP4Viewer-test.js b/src/lib/viewers/media/__tests__/MP4Viewer-test.js index 0995e57d5..84ce6ae8c 100644 --- a/src/lib/viewers/media/__tests__/MP4Viewer-test.js +++ b/src/lib/viewers/media/__tests__/MP4Viewer-test.js @@ -18,8 +18,8 @@ describe('lib/viewers/media/MP4Viewer', () => { mp4 = new MP4Viewer({ container: containerEl, file: { - id: 1 - } + id: 1, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); diff --git a/src/lib/viewers/media/__tests__/MediaBaseViewer-test.js b/src/lib/viewers/media/__tests__/MediaBaseViewer-test.js index 45d1188f5..251f11783 100644 --- a/src/lib/viewers/media/__tests__/MediaBaseViewer-test.js +++ b/src/lib/viewers/media/__tests__/MediaBaseViewer-test.js @@ -26,17 +26,17 @@ describe('lib/viewers/media/MediaBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, file: { - id: 1 + id: 1, }, container: containerEl, representation: { content: { - url_template: 'www.netflix.com' - } - } + url_template: 'www.netflix.com', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -57,7 +57,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { increaseSpeed: sandbox.stub(), decreaseSpeed: sandbox.stub(), isVolumeScrubberFocused: sandbox.stub(), - isTimeScrubberFocused: sandbox.stub() + isTimeScrubberFocused: sandbox.stub(), }; }); @@ -276,7 +276,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { describe('autoplay()', () => { beforeEach(() => { media.mediaEl = { - play: sandbox.stub().returns(Promise.resolve()) + play: sandbox.stub().returns(Promise.resolve()), }; sandbox.stub(media, 'isAutoplayEnabled').returns(true); @@ -584,7 +584,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { const pauseListener = () => {}; // eslint-disable-line require-jsdoc media.mediaEl = { duration: 100, - pause: sandbox.stub() + pause: sandbox.stub(), }; media.pauseListener = pauseListener; sandbox.stub(media, 'removePauseEventListener'); @@ -593,20 +593,20 @@ describe('lib/viewers/media/MediaBaseViewer', () => { expect(media.removePauseEventListener.callCount).to.equal(1); expect(media.mediaEl.pause.callCount).to.equal(1); expect(media.emit).to.be.calledWith('pause', { - userInitiated: false + userInitiated: false, }); }); it('should update userInitiated flag IF the pause has been triggered by user interaction', () => { media.mediaEl = { duration: 100, - pause: sandbox.stub() + pause: sandbox.stub(), }; sandbox.stub(media, 'removePauseEventListener'); sandbox.stub(media, 'emit'); media.pause(undefined, true); expect(media.emit).to.be.calledWith('pause', { - userInitiated: true + userInitiated: true, }); }); @@ -614,7 +614,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { const pauseListener = () => {}; // eslint-disable-line require-jsdoc media.mediaEl = { duration: 100, - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; media.pauseListener = pauseListener; sandbox.stub(media, 'removePauseEventListener'); @@ -649,7 +649,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { sandbox.stub(media.cache, 'set'); media.mediaEl = { - volume: 0.3 + volume: 0.3, }; media.toggleMute(); @@ -662,7 +662,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { const oldVol = 0.3; media.mediaEl = { - volume: 0 + volume: 0, }; media.oldVolume = oldVol; @@ -676,7 +676,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { const vol = 0.3; media.mediaEl = { - volume: vol + volume: vol, }; media.toggleMute(); @@ -697,7 +697,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should remove the loaded class and hide the play button if media is not paused nor ended', () => { media.mediaEl = { paused: false, - ended: false + ended: false, }; sandbox.stub(media, 'hidePlayButton'); @@ -711,7 +711,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { describe('addEventListenersForMediaElement()', () => { it('should add event listeners to media element', () => { media.mediaEl = { - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; media.addEventListenersForMediaElement(); @@ -724,7 +724,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should seek with positive increments', () => { media.mediaEl = { currentTime: 30, - duration: 60 + duration: 60, }; sandbox.stub(media, 'setMediaTime'); sandbox.stub(media, 'removePauseEventListener'); @@ -738,7 +738,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should seek with negative increments', () => { media.mediaEl = { currentTime: 30, - duration: 60 + duration: 60, }; sandbox.stub(media, 'setMediaTime'); sandbox.stub(media, 'removePauseEventListener'); @@ -752,7 +752,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should not go beyond beginning of video', () => { media.mediaEl = { currentTime: 3, - duration: 60 + duration: 60, }; sandbox.stub(media, 'setMediaTime'); sandbox.stub(media, 'removePauseEventListener'); @@ -766,7 +766,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should not go beyond end of video', () => { media.mediaEl = { currentTime: 57, - duration: 60 + duration: 60, }; sandbox.stub(media, 'setMediaTime'); sandbox.stub(media, 'removePauseEventListener'); @@ -781,7 +781,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { describe('increaseVolume', () => { it('should not exceed maximum volume', () => { media.mediaEl = { - volume: 0.99 + volume: 0.99, }; sandbox.stub(media, 'setVolume'); @@ -794,7 +794,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { describe('decreaseVolume', () => { it('should not fall below minimum volume', () => { media.mediaEl = { - volume: 0.01 + volume: 0.01, }; sandbox.stub(media, 'setVolume'); @@ -1000,7 +1000,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should parse seconds', () => { const startAt = { unit: 'seconds', - value: 55 + value: 55, }; expect(media.getStartTimeInSeconds(startAt)).to.equal(55); @@ -1009,7 +1009,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should parse timestamp', () => { const startAt = { unit: 'timestamp', - value: '1m2s' + value: '1m2s', }; expect(media.getStartTimeInSeconds(startAt)).to.equal(62); @@ -1018,7 +1018,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should return the default value if invalid unit', () => { const startAt = { unit: 'foo', - value: 55 + value: 55, }; expect(media.getStartTimeInSeconds(startAt)).to.equal(0); @@ -1027,7 +1027,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should return the default value if invalid value', () => { const startAt = { unit: 'seconds', - value: 'foo' + value: 'foo', }; expect(media.getStartTimeInSeconds(startAt)).to.equal(0); @@ -1035,13 +1035,13 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should return the default value if invalid startAt', () => { let startAt = { - value: 'foo' + value: 'foo', }; expect(media.getStartTimeInSeconds(startAt)).to.equal(0); startAt = { - unit: 'seconds' + unit: 'seconds', }; expect(media.getStartTimeInSeconds(startAt)).to.equal(0); @@ -1080,7 +1080,7 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should parse the timestamp with hours and minutes', () => { const timestamp = '6h7m'; expect(media.convertTimestampToSeconds(timestamp)).to.equal( - 6 * ONE_HOUR_IN_SECONDS + 7 * ONE_MINUTE_IN_SECONDS + 6 * ONE_HOUR_IN_SECONDS + 7 * ONE_MINUTE_IN_SECONDS, ); }); @@ -1092,21 +1092,21 @@ describe('lib/viewers/media/MediaBaseViewer', () => { it('should parse the timestamp with hours, minutes and seconds', () => { const timestamp = '5h30m15s'; expect(media.convertTimestampToSeconds(timestamp)).to.equal( - 5 * ONE_HOUR_IN_SECONDS + 30 * ONE_MINUTE_IN_SECONDS + 15 + 5 * ONE_HOUR_IN_SECONDS + 30 * ONE_MINUTE_IN_SECONDS + 15, ); }); it('should parse the timestamp with hours, minutes, and seconds', () => { const timestamp = '5h30m15s'; expect(media.convertTimestampToSeconds(timestamp)).to.equal( - 5 * ONE_HOUR_IN_SECONDS + 30 * ONE_MINUTE_IN_SECONDS + 15 + 5 * ONE_HOUR_IN_SECONDS + 30 * ONE_MINUTE_IN_SECONDS + 15, ); }); it('should parse the timestamp with hours, minutes, seconds (large values and decimal)', () => { const timestamp = '5h75m653.546s'; expect(media.convertTimestampToSeconds(timestamp)).to.equal( - 5 * ONE_HOUR_IN_SECONDS + 75 * ONE_MINUTE_IN_SECONDS + 653.546 + 5 * ONE_HOUR_IN_SECONDS + 75 * ONE_MINUTE_IN_SECONDS + 653.546, ); }); diff --git a/src/lib/viewers/media/__tests__/MediaControls-test.js b/src/lib/viewers/media/__tests__/MediaControls-test.js index 81dd256e0..266d80167 100644 --- a/src/lib/viewers/media/__tests__/MediaControls-test.js +++ b/src/lib/viewers/media/__tests__/MediaControls-test.js @@ -47,8 +47,8 @@ describe('lib/viewers/media/MediaControls', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} - } + unset: () => {}, + }, ); }); @@ -91,8 +91,8 @@ describe('lib/viewers/media/MediaControls', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} - } + unset: () => {}, + }, ); }); @@ -101,7 +101,7 @@ describe('lib/viewers/media/MediaControls', () => { stubs.removeAllListeners = sandbox.stub(mediaControls, 'removeAllListeners'); stubs.removeVolumeScrubberWrapperExpansionHandlers = sandbox.stub( mediaControls, - 'removeVolumeScrubberWrapperExpansionHandlers' + 'removeVolumeScrubberWrapperExpansionHandlers', ); stubs.removeEventListener = sandbox.stub(document, 'removeEventListener'); stubs.removeActivationListener = sandbox.stub(util, 'removeActivationListener'); @@ -109,18 +109,18 @@ describe('lib/viewers/media/MediaControls', () => { stubs.genericEl = { getHandleEl: sandbox.stub().returns({ - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }), getConvertedEl: sandbox.stub().returns({ - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }), destroy: sandbox.stub(), removeListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; stubs.timeScrubberEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; }); @@ -148,15 +148,15 @@ describe('lib/viewers/media/MediaControls', () => { expect(stubs.genericEl.getHandleEl().removeEventListener).to.be.calledWith( 'mousedown', - mediaControls.timeScrubbingStartHandler + mediaControls.timeScrubbingStartHandler, ); expect(stubs.timeScrubberEl.removeEventListener).to.be.calledWith( 'mousemove', - stubs.timeScrubberElShowHandler + stubs.timeScrubberElShowHandler, ); expect(stubs.timeScrubberEl.removeEventListener).to.be.calledWith( 'mouseleave', - mediaControls.filmstripHideHandler + mediaControls.filmstripHideHandler, ); expect(stubs.genericEl.destroy).to.be.called; expect(mediaControls.timeScrubber).to.equal(undefined); @@ -196,15 +196,15 @@ describe('lib/viewers/media/MediaControls', () => { expect(stubs.removeActivationListener).to.be.calledWith(stubs.genericEl, mediaControls.toggleMuteHandler); expect(stubs.removeActivationListener).to.be.calledWith( stubs.genericEl, - mediaControls.toggleFullscreenHandler + mediaControls.toggleFullscreenHandler, ); expect(stubs.removeActivationListener).to.be.calledWith( stubs.genericEl, - mediaControls.toggleSettingsHandler + mediaControls.toggleSettingsHandler, ); expect(stubs.removeActivationListener).to.be.calledWith( stubs.genericEl, - mediaControls.toggleSubtitlesHandler + mediaControls.toggleSubtitlesHandler, ); }); }); @@ -278,7 +278,7 @@ describe('lib/viewers/media/MediaControls', () => { describe('getTimeFromScrubber()', () => { it('should compute the right time', () => { mediaControls.mediaEl = { - duration: 100 + duration: 100, }; mediaControls.setupScrubbers(); sandbox.stub(mediaControls.timeScrubber, 'getValue').returns(0.3); @@ -324,7 +324,7 @@ describe('lib/viewers/media/MediaControls', () => { describe('setDuration()', () => { beforeEach(() => { mediaControls.durationEl = { - textContent: '' + textContent: '', }; stubs.formatTime = sandbox.stub(mediaControls, 'formatTime'); }); @@ -344,10 +344,10 @@ describe('lib/viewers/media/MediaControls', () => { beforeEach(() => { mediaControls.mediaEl = { textContent: '', - duration: 500 + duration: 500, }; mediaControls.durationEl = { - textContent: '8:20' + textContent: '8:20', }; mediaControls.setupScrubbers(); stubs.setValue = sandbox.stub(mediaControls.timeScrubber, 'setValue'); @@ -378,9 +378,9 @@ describe('lib/viewers/media/MediaControls', () => { mediaControls.mediaEl = { buffered: { length: 5, - end: sandbox.stub().returns(1) + end: sandbox.stub().returns(1), }, - duration: 1 + duration: 1, }; mediaControls.setupScrubbers(); stubs.setBufferedValueStub = sandbox.stub(mediaControls.timeScrubber, 'setBufferedValue'); @@ -445,7 +445,7 @@ describe('lib/viewers/media/MediaControls', () => { expect(mediaControls.containerEl.classList.contains('bp-is-fullscreen')).to.be.true; }); - it('should set the label to enter fullscreen if it\'s not fullscreen', () => { + it("should set the label to enter fullscreen if it's not fullscreen", () => { stubs.isFullscreen.returns(false); mediaControls.handleFullscreenExit(); @@ -568,23 +568,23 @@ describe('lib/viewers/media/MediaControls', () => { expect(stubs.wrapperAddEventListener).to.be.calledWith('mouseleave', mediaControls.mouseleaveHandler); expect(stubs.addActivationListener).to.be.calledWith( mediaControls.playButtonEl, - mediaControls.togglePlayHandler + mediaControls.togglePlayHandler, ); expect(stubs.addActivationListener).to.be.calledWith( mediaControls.volButtonEl, - mediaControls.toggleMuteHandler + mediaControls.toggleMuteHandler, ); expect(stubs.addActivationListener).to.be.calledWith( mediaControls.fullscreenButtonEl, - mediaControls.toggleFullscreenHandler + mediaControls.toggleFullscreenHandler, ); expect(stubs.addActivationListener).to.be.calledWith( mediaControls.settingsButtonEl, - mediaControls.toggleSettingsHandler + mediaControls.toggleSettingsHandler, ); expect(stubs.addActivationListener).to.be.calledWith( mediaControls.subtitlesButtonEl, - mediaControls.toggleSubtitlesHandler + mediaControls.toggleSubtitlesHandler, ); expect(stubs.addListener).to.be.called; }); @@ -734,7 +734,7 @@ describe('lib/viewers/media/MediaControls', () => { describe('setFilmstrip()', () => { it('should set the filmstrip source to the provided URL', () => { mediaControls.filmstripEl = { - src: '' + src: '', }; mediaControls.filmstripUrl = 'testurl'; @@ -747,13 +747,13 @@ describe('lib/viewers/media/MediaControls', () => { describe('initFilmstrip()', () => { beforeEach(() => { stubs.status = { - getPromise: sandbox.stub().returns(Promise.resolve()) + getPromise: sandbox.stub().returns(Promise.resolve()), }; mediaControls.setupScrubbers(); stubs.handleElAddEventListener = sandbox.stub(mediaControls.timeScrubber.getHandleEl(), 'addEventListener'); stubs.timeScrubberEl = { addEventListener: sandbox.stub(), - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; mediaControls.timeScrubberEl = stubs.timeScrubberEl; stubs.setFilmstrip = sandbox.stub(mediaControls, 'setFilmstrip'); @@ -780,15 +780,15 @@ describe('lib/viewers/media/MediaControls', () => { mediaControls.initFilmstrip('url', stubs.status, '380', 1); expect(stubs.handleElAddEventListener).to.be.calledWith( 'mousedown', - mediaControls.timeScrubbingStartHandler + mediaControls.timeScrubbingStartHandler, ); expect(stubs.timeScrubberEl.addEventListener).to.be.calledWith( 'mousemove', - mediaControls.timeScrubberElShowHandler + mediaControls.timeScrubberElShowHandler, ); expect(stubs.timeScrubberEl.addEventListener).to.be.calledWith( 'mouseleave', - mediaControls.filmstripHideHandler + mediaControls.filmstripHideHandler, ); expect(spy).to.have.been.called.twice; }); @@ -798,7 +798,7 @@ describe('lib/viewers/media/MediaControls', () => { mediaControls.initFilmstrip('url', stubs.status, '380', 1); expect(mediaControls.timeScrubberEl.addEventListener).to.be.calledWith( 'touchstart', - mediaControls.timeScrubbingStartHandler + mediaControls.timeScrubbingStartHandler, ); }); @@ -833,7 +833,7 @@ describe('lib/viewers/media/MediaControls', () => { beforeEach(() => { mediaControls.setupScrubbers(); stubs.event = { - target: mediaControls.timeScrubberEl.firstChild + target: mediaControls.timeScrubberEl.firstChild, }; stubs.removeEventListener = sandbox.stub(document, 'removeEventListener'); mediaControls.filmstripContainerEl = document.createElement('div'); @@ -867,18 +867,18 @@ describe('lib/viewers/media/MediaControls', () => { beforeEach(() => { stubs.getBoundingClientRect = sandbox.stub(mediaControls.containerEl, 'getBoundingClientRect').returns({ left: 0, - width: 260 + width: 260, }); stubs.event = { - pageX: 100 + pageX: 100, }; stubs.isSettingsVisible = sandbox.stub(mediaControls, 'isSettingsVisible'); stubs.formatTime = sandbox.stub(mediaControls, 'formatTime'); mediaControls.mediaEl = { - duration: 3600 + duration: 3600, }; stubs.status = { - getPromise: sandbox.stub().returns(Promise.resolve()) + getPromise: sandbox.stub().returns(Promise.resolve()), }; mediaControls.initFilmstrip('url', stubs.status, '380', 1); @@ -886,7 +886,7 @@ describe('lib/viewers/media/MediaControls', () => { time: 10, left: -100, top: -180, - containerLeft: 20 + containerLeft: 20, }); }); @@ -912,7 +912,7 @@ describe('lib/viewers/media/MediaControls', () => { describe('computeFilmstripPositions()', () => { it('should compute correct positions when filmstrip not ready', () => { mediaControls.mediaEl = { - duration: 100 + duration: 100, }; mediaControls.filmstripInterval = 1; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.25); @@ -927,7 +927,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should compute correct horizontal offset into filmstrip', () => { mediaControls.mediaEl = { - duration: 100 + duration: 100, }; mediaControls.filmstripInterval = 1; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.2); @@ -942,7 +942,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should compute correct vertical offset into filmstrip', () => { mediaControls.mediaEl = { - duration: 1100 + duration: 1100, }; mediaControls.filmstripInterval = 1; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.2); @@ -957,7 +957,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should compute correct offset into filmstrip with different interval', () => { mediaControls.mediaEl = { - duration: 2000 + duration: 2000, }; mediaControls.filmstripInterval = 5; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.6); @@ -972,7 +972,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should compute correct container position when hovering near left boundary', () => { mediaControls.mediaEl = { - duration: 100 + duration: 100, }; mediaControls.filmstripInterval = 1; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.01); @@ -987,7 +987,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should compute correct container position when hovering near right boundary', () => { mediaControls.mediaEl = { - duration: 100 + duration: 100, }; mediaControls.filmstripInterval = 1; sandbox.stub(mediaControls.timeScrubber, 'computeScrubberPosition').returns(0.99); @@ -1004,7 +1004,7 @@ describe('lib/viewers/media/MediaControls', () => { describe('filmstripHideHandler()', () => { beforeEach(() => { stubs.status = { - getPromise: sandbox.stub().returns(Promise.resolve()) + getPromise: sandbox.stub().returns(Promise.resolve()), }; mediaControls.initFilmstrip('url', stubs.status, '380', 1); @@ -1066,10 +1066,10 @@ describe('lib/viewers/media/MediaControls', () => { handler = mediaControls.timeScrubberHandler(stubs.timeScrubberCallbackSpy); stubs.playedEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; stubs.convertedEl = { - removeEventListener: sandbox.stub() + removeEventListener: sandbox.stub(), }; mediaControls.timeScrubber.playedEl = stubs.playedEl; @@ -1078,7 +1078,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should execute the callback when target is playedEl', () => { const eventStub = { - target: stubs.playedEl + target: stubs.playedEl, }; handler(eventStub); expect(stubs.timeScrubberCallbackSpy).to.have.been.called; @@ -1086,7 +1086,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should execute the callback when target is convertedEl', () => { const eventStub = { - target: stubs.convertedEl + target: stubs.convertedEl, }; handler(eventStub); expect(stubs.timeScrubberCallbackSpy).to.have.been.called; @@ -1094,7 +1094,7 @@ describe('lib/viewers/media/MediaControls', () => { it('should not execute the callback when target is not playedEl or convertedEl', () => { const eventStub = { - target: sandbox.stub() + target: sandbox.stub(), }; handler(eventStub); expect(stubs.timeScrubberCallbackSpy).to.have.not.been.called; diff --git a/src/lib/viewers/media/__tests__/MediaLoader-test.js b/src/lib/viewers/media/__tests__/MediaLoader-test.js index c87cb7291..22a86f39f 100644 --- a/src/lib/viewers/media/__tests__/MediaLoader-test.js +++ b/src/lib/viewers/media/__tests__/MediaLoader-test.js @@ -18,16 +18,16 @@ describe('lib/viewers/media/MediaLoader', () => { representations: { entries: [ { - representation: 'dash' - } - ] - } + representation: 'dash', + }, + ], + }, }; sandbox.stub(util, 'requires360Viewer').returns(true); expect(() => MediaLoader.determineViewer(file)).to.throw( PreviewError, - /browser doesn't support preview for 360-degree videos/ + /browser doesn't support preview for 360-degree videos/, ); }); @@ -38,10 +38,10 @@ describe('lib/viewers/media/MediaLoader', () => { representations: { entries: [ { - representation: 'dash' - } - ] - } + representation: 'dash', + }, + ], + }, }; sandbox.stub(util, 'requires360Viewer').returns(false); diff --git a/src/lib/viewers/media/__tests__/Scrubber-test.js b/src/lib/viewers/media/__tests__/Scrubber-test.js index c0e4dbdf9..9871f8818 100644 --- a/src/lib/viewers/media/__tests__/Scrubber-test.js +++ b/src/lib/viewers/media/__tests__/Scrubber-test.js @@ -125,7 +125,7 @@ describe('lib/viewers/media/Scrubber', () => { stubs.scrubberPosition = sandbox.stub(scrubber, 'computeScrubberPosition').returns(0.5); stubs.event = { pageX: 50, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; }); it('should adjust the scrubber value to the current scrubber handle position value in the video', () => { @@ -140,8 +140,8 @@ describe('lib/viewers/media/Scrubber', () => { it('should use the touch list if the event contains touches', () => { stubs.event.touches = [ { - pageX: 55 - } + pageX: 55, + }, ]; scrubber.scrubbingHandler(stubs.event); @@ -154,7 +154,7 @@ describe('lib/viewers/media/Scrubber', () => { it('should compute correct scrubber position', () => { sandbox.stub(scrubber.scrubberEl, 'getBoundingClientRect').returns({ left: 20, - width: 100 + width: 100, }); const position = scrubber.computeScrubberPosition(30); @@ -165,7 +165,7 @@ describe('lib/viewers/media/Scrubber', () => { it('should cap the scrubber position to 1', () => { sandbox.stub(scrubber.scrubberEl, 'getBoundingClientRect').returns({ left: 20, - width: 100 + width: 100, }); const position = scrubber.computeScrubberPosition(130); @@ -176,7 +176,7 @@ describe('lib/viewers/media/Scrubber', () => { it('should floor the scrubber position to 0', () => { sandbox.stub(scrubber.scrubberEl, 'getBoundingClientRect').returns({ left: 20, - width: 100 + width: 100, }); const position = scrubber.computeScrubberPosition(10); @@ -192,7 +192,7 @@ describe('lib/viewers/media/Scrubber', () => { button: 5, ctrlKey: undefined, metaKey: undefined, - preventDefault: sandbox.stub() + preventDefault: sandbox.stub(), }; }); diff --git a/src/lib/viewers/media/__tests__/Settings-test.js b/src/lib/viewers/media/__tests__/Settings-test.js index 878f1c3bd..ba2607eec 100644 --- a/src/lib/viewers/media/__tests__/Settings-test.js +++ b/src/lib/viewers/media/__tests__/Settings-test.js @@ -18,7 +18,7 @@ describe('lib/viewers/media/Settings', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }); }); @@ -52,7 +52,7 @@ describe('lib/viewers/media/Settings', () => { describe('MEDIA_SPEEDS', () => { it('should be aligned with speed options in template', () => { const speedElements = [...document.querySelectorAll('.bp-media-settings-sub-item[data-type="speed"]')]; - const dataValues = speedElements.map((elem) => elem.getAttribute('data-value')); + const dataValues = speedElements.map(elem => elem.getAttribute('data-value')); const mediaSpeeds = settings.getMediaSpeeds(); expect(mediaSpeeds).to.deep.equal(dataValues); }); @@ -126,8 +126,8 @@ describe('lib/viewers/media/Settings', () => { const menuEl = { getBoundingClientRect: () => ({ width: 0, - height: 500 // 210 is max height of settings menu - }) + height: 500, // 210 is max height of settings menu + }), }; settings.setMenuContainerDimensions(menuEl); @@ -140,8 +140,8 @@ describe('lib/viewers/media/Settings', () => { const menuEl = { getBoundingClientRect: () => ({ width: 0, - height: MENU_HEIGHT - }) + height: MENU_HEIGHT, + }), }; settings.setMenuContainerDimensions(menuEl); @@ -247,7 +247,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Space', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -268,7 +268,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Enter', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -304,7 +304,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Space', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); settings.settingsEl.classList.remove('bp-media-settings-in-transition'); // simulate transition end @@ -326,7 +326,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Enter', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); settings.settingsEl.classList.remove('bp-media-settings-in-transition'); // simulate transition end @@ -361,7 +361,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Space', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -382,7 +382,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Enter', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -410,7 +410,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowUp', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -432,7 +432,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowUp', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -453,7 +453,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowDown', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -475,7 +475,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowDown', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -496,7 +496,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowLeft', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -517,7 +517,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowLeft', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -538,7 +538,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowRight', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -558,7 +558,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowRight', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -578,7 +578,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'ArrowRight', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -599,7 +599,7 @@ describe('lib/viewers/media/Settings', () => { type: 'keydown', key: 'Escape', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.menuEventHandler(event); @@ -640,7 +640,7 @@ describe('lib/viewers/media/Settings', () => { it('should focus on the currently selected value', () => { // Select a different speed for testing purposes const prevSelected = settings.settingsEl.querySelector( - '[data-type="speed"].bp-media-settings-sub-item.bp-media-settings-selected' + '[data-type="speed"].bp-media-settings-sub-item.bp-media-settings-selected', ); prevSelected.classList.remove('bp-media-settings-selected'); const selected = settings.settingsEl.querySelector('[data-value="1.25"]'); @@ -670,7 +670,7 @@ describe('lib/viewers/media/Settings', () => { sandbox.stub(settings, 'reset'); settings.firstMenuItem = { - focus: sandbox.stub() + focus: sandbox.stub(), }; sandbox.stub(settings, 'chooseOption'); sandbox.stub(settings, 'showSubMenu'); @@ -725,10 +725,10 @@ describe('lib/viewers/media/Settings', () => { expect(document.querySelector('[data-type="speed"] .bp-media-settings-value').textContent).to.equal('0.5'); expect(document.querySelector('[data-type="speed"][data-value="1.0"]')).to.not.have.class( - 'bp-media-settings-selected' + 'bp-media-settings-selected', ); expect(document.querySelector('[data-type="speed"][data-value="0.5"]')).to.have.class( - 'bp-media-settings-selected' + 'bp-media-settings-selected', ); }); @@ -999,7 +999,7 @@ describe('lib/viewers/media/Settings', () => { settings.blurHandler({ type: 'keydown', key: 'Space', - target: document.querySelector('.bp-media-gear-icon') + target: document.querySelector('.bp-media-gear-icon'), }); expect(settings.hide).to.not.be.called; @@ -1011,7 +1011,7 @@ describe('lib/viewers/media/Settings', () => { settings.blurHandler({ type: 'keydown', key: 'Enter', - target: document.querySelector('.bp-media-gear-icon') + target: document.querySelector('.bp-media-gear-icon'), }); expect(settings.hide).to.not.be.called; @@ -1031,7 +1031,7 @@ describe('lib/viewers/media/Settings', () => { settings.blurHandler({ type: 'keydown', key: 'Space', - target: document.querySelector('.bp-media-settings-item') + target: document.querySelector('.bp-media-settings-item'), }); expect(settings.hide).to.not.be.called; @@ -1043,7 +1043,7 @@ describe('lib/viewers/media/Settings', () => { settings.blurHandler({ type: 'keydown', key: 'Enter', - target: document.querySelector('.bp-media-settings-item') + target: document.querySelector('.bp-media-settings-item'), }); expect(settings.hide).to.not.be.called; @@ -1056,7 +1056,7 @@ describe('lib/viewers/media/Settings', () => { key: 'Escape', target: document.querySelector('.bp-media-gear-icon'), preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.blurHandler(event); @@ -1073,7 +1073,7 @@ describe('lib/viewers/media/Settings', () => { key: 'Escape', target: document.querySelector('.bp-media-settings-item'), preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; settings.blurHandler(event); diff --git a/src/lib/viewers/media/__tests__/VideoBaseViewer-test.js b/src/lib/viewers/media/__tests__/VideoBaseViewer-test.js index 8a037217b..ff32c51bc 100644 --- a/src/lib/viewers/media/__tests__/VideoBaseViewer-test.js +++ b/src/lib/viewers/media/__tests__/VideoBaseViewer-test.js @@ -24,15 +24,15 @@ describe('lib/viewers/media/VideoBaseViewer', () => { set: () => {}, has: () => {}, get: () => {}, - unset: () => {} + unset: () => {}, }, file: { - id: 1 + id: 1, }, container: containerEl, content: { - url_template: 'www.netflix.com' - } + url_template: 'www.netflix.com', + }, }); videoBase.mediaControls = { on: sandbox.stub(), @@ -41,7 +41,7 @@ describe('lib/viewers/media/VideoBaseViewer', () => { destroy: sandbox.stub(), show: sandbox.stub(), toggle: sandbox.stub(), - resizeTimeScrubber: sandbox.stub() + resizeTimeScrubber: sandbox.stub(), }; Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -66,14 +66,14 @@ describe('lib/viewers/media/VideoBaseViewer', () => { const { lowerLights } = VideoBaseViewer.prototype; Object.defineProperty(VideoBaseViewer.prototype, 'lowerLights', { - value: sandbox.stub() + value: sandbox.stub(), }); videoBase = new VideoBaseViewer({ file: { - id: 1 + id: 1, }, - container: containerEl + container: containerEl, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); videoBase.containerEl = containerEl; @@ -86,7 +86,7 @@ describe('lib/viewers/media/VideoBaseViewer', () => { expect(VideoBaseViewer.prototype.lowerLights).to.be.called; Object.defineProperty(VideoBaseViewer.prototype, 'lowerLights', { - value: lowerLights + value: lowerLights, }); }); }); @@ -126,7 +126,7 @@ describe('lib/viewers/media/VideoBaseViewer', () => { const event = { type: 'touchstart', preventDefault: sandbox.stub(), - stopPropagation: sandbox.stub() + stopPropagation: sandbox.stub(), }; videoBase.pointerHandler(event); @@ -137,7 +137,7 @@ describe('lib/viewers/media/VideoBaseViewer', () => { it('should toggle play on click', () => { const event = { - type: 'click' + type: 'click', }; const togglePlayStub = sandbox.stub(videoBase, 'togglePlay'); @@ -229,7 +229,7 @@ describe('lib/viewers/media/VideoBaseViewer', () => { videoBase.mediaControls = { isSettingsVisible: sandbox.stub().returns(false), removeAllListeners: sandbox.stub(), - destroy: sandbox.stub() + destroy: sandbox.stub(), }; expect(videoBase.allowNavigationArrows()).to.be.true; diff --git a/src/lib/viewers/office/OfficeLoader.js b/src/lib/viewers/office/OfficeLoader.js index 355c69b6d..07edbb7ca 100644 --- a/src/lib/viewers/office/OfficeLoader.js +++ b/src/lib/viewers/office/OfficeLoader.js @@ -12,8 +12,8 @@ const VIEWERS = [ NAME: 'Office', CONSTRUCTOR: OfficeViewer, REP: ORIGINAL_REP_NAME, - EXT: ['xlsx', 'xlsm', 'xlsb'] - } + EXT: ['xlsx', 'xlsm', 'xlsb'], + }, ]; class OfficeLoader extends AssetLoader { diff --git a/src/lib/viewers/office/OfficeViewer.js b/src/lib/viewers/office/OfficeViewer.js index 975d234be..9e04f044e 100644 --- a/src/lib/viewers/office/OfficeViewer.js +++ b/src/lib/viewers/office/OfficeViewer.js @@ -177,7 +177,13 @@ class OfficeViewer extends BaseViewer { * @return {void} */ setupIframe() { - const { appHost, apiHost, file, sharedLink, location: { locale } } = this.options; + const { + appHost, + apiHost, + file, + sharedLink, + location: { locale }, + } = this.options; const iframeEl = this.createIframeElement(); this.createViewer(iframeEl); @@ -296,7 +302,7 @@ class OfficeViewer extends BaseViewer { // origin for iframe postMessage communications. formEl.setAttribute( 'action', - `${EXCEL_ONLINE_EMBED_URL}?ui=${locale}&rs=${locale}&WOPISrc=${WOPISrc}&sc=${JSON.stringify(origin)}` + `${EXCEL_ONLINE_EMBED_URL}?ui=${locale}&rs=${locale}&WOPISrc=${WOPISrc}&sc=${JSON.stringify(origin)}`, ); formEl.setAttribute('method', 'POST'); formEl.setAttribute('target', OFFICE_ONLINE_IFRAME_NAME); @@ -327,7 +333,7 @@ class OfficeViewer extends BaseViewer { * @return {Promise} Promise setting print blob */ fetchPrintBlob(pdfUrl) { - return api.get(pdfUrl, { type: 'blob' }).then((blob) => { + return api.get(pdfUrl, { type: 'blob' }).then(blob => { this.printBlob = blob; }); } diff --git a/src/lib/viewers/office/__tests__/OfficeLoader-test.js b/src/lib/viewers/office/__tests__/OfficeLoader-test.js index e23b31de9..7e13cab07 100644 --- a/src/lib/viewers/office/__tests__/OfficeLoader-test.js +++ b/src/lib/viewers/office/__tests__/OfficeLoader-test.js @@ -9,15 +9,15 @@ describe('lib/viewers/office/OfficeLoader', () => { const fakeFileTemplate = { size: 1000, permissions: { - can_download: true + can_download: true, }, representations: { entries: [ { - representation: 'ORIGINAL' - } - ] - } + representation: 'ORIGINAL', + }, + ], + }, }; afterEach(() => { @@ -28,24 +28,24 @@ describe('lib/viewers/office/OfficeLoader', () => { const fakeFiles = [ Object.assign({}, fakeFileTemplate, { extension: 'xlsx' }), Object.assign({}, fakeFileTemplate, { extension: 'xlsm' }), - Object.assign({}, fakeFileTemplate, { extension: 'xlsb' }) + Object.assign({}, fakeFileTemplate, { extension: 'xlsb' }), ]; - fakeFiles.forEach((fakeFile) => { + fakeFiles.forEach(fakeFile => { it('should choose the Office viewer if it is not disabled and the file is ok', () => { const viewer = OfficeLoader.determineViewer(fakeFile); expect(viewer).to.deep.equal({ NAME: 'Office', CONSTRUCTOR: OfficeViewer, REP: 'ORIGINAL', - EXT: ['xlsx', 'xlsm', 'xlsb'] + EXT: ['xlsx', 'xlsm', 'xlsb'], }); }); it('should choose the Office viewer if it is not disabled and the file is a shared link that is not password-protected', () => { const editedFakeFile = fakeFile; editedFakeFile.shared_link = { - is_password_enabled: false + is_password_enabled: false, }; const viewer = OfficeLoader.determineViewer(editedFakeFile); expect(viewer.NAME).to.equal('Office'); @@ -75,7 +75,7 @@ describe('lib/viewers/office/OfficeLoader', () => { it('should not return a viewer if the file is a password-protected shared link', () => { const editedFakeFile = fakeFile; editedFakeFile.shared_link = { - is_password_enabled: true + is_password_enabled: true, }; const viewer = OfficeLoader.determineViewer(editedFakeFile, []); expect(viewer).to.equal(undefined); diff --git a/src/lib/viewers/office/__tests__/OfficeViewer-test.js b/src/lib/viewers/office/__tests__/OfficeViewer-test.js index 399df1e33..e15f58604 100644 --- a/src/lib/viewers/office/__tests__/OfficeViewer-test.js +++ b/src/lib/viewers/office/__tests__/OfficeViewer-test.js @@ -33,22 +33,22 @@ describe('lib/viewers/office/OfficeViewer', () => { office = new OfficeViewer({ container: containerEl, file: { - id: '123' + id: '123', }, viewers: { Office: { - shouldUsePlatformSetup: false - } + shouldUsePlatformSetup: false, + }, }, location: { - locale: 'en-US' + locale: 'en-US', }, appHost: 'https://app.box.com', apiHost: 'https://app.box.com', - token: 'token' + token: 'token', }); stubs = { - setupPDFUrl: sandbox.stub(office, 'setupPDFUrl') + setupPDFUrl: sandbox.stub(office, 'setupPDFUrl'), }; clock = sinon.useFakeTimers(); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -134,7 +134,7 @@ describe('lib/viewers/office/OfficeViewer', () => { beforeEach(() => { stubs.createIframeElement = sandbox.spy(office, 'createIframeElement'); stubs.form = { - submit: sandbox.stub() + submit: sandbox.stub(), }; stubs.createFormElement = sandbox.stub(office, 'createFormElement').returns(stubs.form); @@ -164,7 +164,7 @@ describe('lib/viewers/office/OfficeViewer', () => { office.options.appHost, office.options.file.id, office.options.sharedLink, - office.options.location.locale + office.options.location.locale, ); expect(stubs.form.submit).to.be.called; }); @@ -181,7 +181,7 @@ describe('lib/viewers/office/OfficeViewer', () => { const src = office.setupRunmodeURL( office.options.appHost, office.options.file.id, - office.options.sharedLink + office.options.sharedLink, ); expect(src).to.equal('https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?fileId=123'); }); @@ -191,10 +191,10 @@ describe('lib/viewers/office/OfficeViewer', () => { const src = office.setupRunmodeURL( office.options.appHost, office.options.file.id, - office.options.sharedLink + office.options.sharedLink, ); expect(src).to.equal( - 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123' + 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123', ); }); @@ -203,10 +203,10 @@ describe('lib/viewers/office/OfficeViewer', () => { const src = office.setupRunmodeURL( office.options.appHost, office.options.file.id, - office.options.sharedLink + office.options.sharedLink, ); expect(src).to.equal( - 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=app&fileId=123' + 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=app&fileId=123', ); }); @@ -215,10 +215,10 @@ describe('lib/viewers/office/OfficeViewer', () => { const src = office.setupRunmodeURL( office.options.appHost, office.options.file.id, - office.options.sharedLink + office.options.sharedLink, ); expect(src).to.equal( - 'https://cloud.app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=cloud&fileId=123' + 'https://cloud.app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=cloud&fileId=123', ); }); @@ -227,13 +227,13 @@ describe('lib/viewers/office/OfficeViewer', () => { office.options.appHost = 'https://cloud.app.box.com'; let src = office.setupRunmodeURL(office.options.appHost, office.options.file.id, office.options.sharedLink); expect(src).to.equal( - 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=app&fileId=123' + 'https://app.box.com/integrations/officeonline/openExcelOnlinePreviewer?v=test&vanity_subdomain=app&fileId=123', ); office.options.sharedLink = 'https://ibm.box.com/s/abcd'; src = office.setupRunmodeURL(office.options.appHost, office.options.file.id, office.options.sharedLink); expect(src).to.equal( - 'https://ibm.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123' + 'https://ibm.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123', ); office.options.sharedLink = 'https://cloud.box.com/s/abcd'; @@ -241,7 +241,7 @@ describe('lib/viewers/office/OfficeViewer', () => { src = office.setupRunmodeURL(office.options.appHost, office.options.file.id, office.options.sharedLink); expect(src).to.equal( - 'https://cloud.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123' + 'https://cloud.box.com/integrations/officeonline/openExcelOnlinePreviewer?s=abcd&fileId=123', ); }); }); @@ -273,7 +273,7 @@ describe('lib/viewers/office/OfficeViewer', () => { expect(iframeEl.height).to.equal('100%'); expect(iframeEl.frameBorder).to.equal('0'); expect(iframeEl.getAttribute('sandbox')).to.equal( - 'allow-scripts allow-same-origin allow-forms allow-popups' + 'allow-scripts allow-same-origin allow-forms allow-popups', ); }); @@ -295,15 +295,13 @@ describe('lib/viewers/office/OfficeViewer', () => { office.options.apiHost, office.options.file.id, office.options.sharedLink, - office.options.location.locale + office.options.location.locale, ); }); it('should correctly set the action URL', () => { expect(stubs.formEl.getAttribute('action')).to.equal( - `${EXCEL_ONLINE_URL}?ui=${office.options.location.locale}&rs=${ - office.options.location.locale - }&WOPISrc=src&sc=${stubs.sessionContext}` + `${EXCEL_ONLINE_URL}?ui=${office.options.location.locale}&rs=${office.options.location.locale}&WOPISrc=src&sc=${stubs.sessionContext}`, ); expect(stubs.formEl.getAttribute('method')).to.equal('POST'); expect(stubs.formEl.getAttribute('target')).to.equal(OFFICE_ONLINE_IFRAME_NAME); @@ -328,7 +326,7 @@ describe('lib/viewers/office/OfficeViewer', () => { beforeEach(() => { office.printBlob = undefined; stubs.fetchPrintBlob = sandbox.stub(office, 'fetchPrintBlob').returns({ - then: sandbox.stub() + then: sandbox.stub(), }); office.initPrint(); stubs.show = sandbox.stub(office.printPopup, 'show'); @@ -339,7 +337,7 @@ describe('lib/viewers/office/OfficeViewer', () => { expect(stubs.fetchPrintBlob).to.be.called; }); - it('should directly print if print blob is ready and the print dialog hasn\'t been shown yet', () => { + it("should directly print if print blob is ready and the print dialog hasn't been shown yet", () => { office.printBlob = {}; office.printDialogTimeout = setTimeout(() => {}); sandbox.stub(office, 'browserPrint'); @@ -348,7 +346,7 @@ describe('lib/viewers/office/OfficeViewer', () => { expect(office.browserPrint).to.be.called; }); - it('should directly print if print blob is ready and the print dialog isn\'t visible', () => { + it("should directly print if print blob is ready and the print dialog isn't visible", () => { office.printBlob = {}; office.printDialogTimeout = null; sandbox.stub(office.printPopup, 'isVisible').returns(false); @@ -406,7 +404,7 @@ describe('lib/viewers/office/OfficeViewer', () => { stubs.browser = sandbox.stub(Browser, 'getName').returns('Chrome'); stubs.printResult = { print: sandbox.stub(), - addEventListener: sandbox.stub() + addEventListener: sandbox.stub(), }; office.printBlob = true; window.navigator.msSaveOrOpenBlob = sandbox.stub().returns(true); @@ -479,7 +477,7 @@ describe('lib/viewers/office/OfficeViewer', () => { it('should get and return the blob', () => { office.fetchPrintBlob('url'); - return stubs.promise.then((blob) => { + return stubs.promise.then(blob => { expect(stubs.get).to.be.called; expect(blob.blob).to.equal('blob'); }); @@ -494,7 +492,7 @@ describe('lib/viewers/office/OfficeViewer', () => { it('should not attempt to set pdfUrl if no pdf rep exist', () => { office.options.file.representations = { - entries: [] + entries: [], }; office.setupPDFUrl(); @@ -505,7 +503,7 @@ describe('lib/viewers/office/OfficeViewer', () => { it('should not attempt to set pdfUrl if no content exists', () => { office.options.file.representations = { - entries: [{ representation: 'pdf' }] + entries: [{ representation: 'pdf' }], }; office.setupPDFUrl(); @@ -517,7 +515,7 @@ describe('lib/viewers/office/OfficeViewer', () => { it('should set pdfUrl if pdf rep exists', () => { stubs.createContentUrl.returns('url'); office.options.file.representations = { - entries: [{ representation: 'pdf', content: { url_template: 'template' } }] + entries: [{ representation: 'pdf', content: { url_template: 'template' } }], }; office.setupPDFUrl(); diff --git a/src/lib/viewers/swf/SWFLoader.js b/src/lib/viewers/swf/SWFLoader.js index ecec5ce8e..0648d5a40 100644 --- a/src/lib/viewers/swf/SWFLoader.js +++ b/src/lib/viewers/swf/SWFLoader.js @@ -11,8 +11,8 @@ const VIEWERS = [ NAME: 'SWF', CONSTRUCTOR: SWFViewer, REP: ORIGINAL_REP_NAME, - EXT: ['swf'] - } + EXT: ['swf'], + }, ]; class SWFLoader extends AssetLoader { diff --git a/src/lib/viewers/swf/SWFViewer.js b/src/lib/viewers/swf/SWFViewer.js index b0e4b1b47..fbac331b8 100644 --- a/src/lib/viewers/swf/SWFViewer.js +++ b/src/lib/viewers/swf/SWFViewer.js @@ -9,7 +9,7 @@ const SWF_PARAMS = { allowNetworking: 'none', allowscriptaccess: 'never', allowScriptAccess: 'never', - wmode: 'transparent' + wmode: 'transparent', }; const JS = [`third-party/swf/${SWF_STATIC_ASSETS_VERSION}/swfobject.js`]; @@ -71,7 +71,7 @@ class SWFViewer extends BaseViewer { } this.loaded = true; this.emit(VIEWER_EVENT.load); - } + }, ); }; diff --git a/src/lib/viewers/swf/__tests__/SWFLoader-test.js b/src/lib/viewers/swf/__tests__/SWFLoader-test.js index 98072182a..aa4dcdca6 100644 --- a/src/lib/viewers/swf/__tests__/SWFLoader-test.js +++ b/src/lib/viewers/swf/__tests__/SWFLoader-test.js @@ -19,10 +19,10 @@ describe('lib/viewers/SWFLoader', () => { representations: { entries: [ { - representation: 'ORIGINAL' - } - ] - } + representation: 'ORIGINAL', + }, + ], + }, }; }); diff --git a/src/lib/viewers/swf/__tests__/SWFViewer-test.js b/src/lib/viewers/swf/__tests__/SWFViewer-test.js index affe4e0d5..627bea335 100644 --- a/src/lib/viewers/swf/__tests__/SWFViewer-test.js +++ b/src/lib/viewers/swf/__tests__/SWFViewer-test.js @@ -21,15 +21,15 @@ describe('lib/viewers/SWFViewer', () => { file: { id: 0, permissions: { - can_download: true - } + can_download: true, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -103,10 +103,10 @@ describe('lib/viewers/SWFViewer', () => { allowNetworking: 'none', allowscriptaccess: 'never', allowScriptAccess: 'never', - wmode: 'transparent' + wmode: 'transparent', }, null, - sinon.match.func + sinon.match.func, ); sandbox.stub(swf, 'createContentUrlWithAuthParams').returns(contentUrl); diff --git a/src/lib/viewers/text/BoxCSV.js b/src/lib/viewers/text/BoxCSV.js index 761471584..5a7bb71df 100644 --- a/src/lib/viewers/text/BoxCSV.js +++ b/src/lib/viewers/text/BoxCSV.js @@ -58,7 +58,7 @@ class BoxCSV { cellRenderer = ({ columnIndex, key, rowIndex, style }) => { const rowClass = this.getRowClassName(rowIndex); return ( -
+
{this.data[rowIndex][columnIndex]}
); @@ -89,16 +89,16 @@ class BoxCSV { this.gridComponent = render( , - this.csvEl + this.csvEl, ); } } diff --git a/src/lib/viewers/text/CSVViewer.js b/src/lib/viewers/text/CSVViewer.js index 95da0936f..19108431f 100644 --- a/src/lib/viewers/text/CSVViewer.js +++ b/src/lib/viewers/text/CSVViewer.js @@ -51,7 +51,7 @@ class CSVViewer extends TextBaseViewer { return Promise.all([this.loadAssets(JS), this.getRepStatus().getPromise()]) .then(() => { - api.get(papaWorkerUrl, { type: 'blob' }).then((papaWorkerBlob) => { + api.get(papaWorkerUrl, { type: 'blob' }).then(papaWorkerBlob => { /* global Papa */ const workerSrc = URL.createObjectURL(papaWorkerBlob); Papa.SCRIPT_PATH = workerSrc; @@ -64,14 +64,14 @@ class CSVViewer extends TextBaseViewer { const error = new PreviewError(ERROR_CODE.LOAD_CSV, __('error_refresh'), { reason }); this.handleDownloadError(error, urlWithAuth); }, - complete: (results) => { + complete: results => { if (this.isDestroyed() || !results) { return; } this.data = results.data; this.finishLoading(); URL.revokeObjectURL(workerSrc); - } + }, }); }); }) diff --git a/src/lib/viewers/text/MarkdownViewer.js b/src/lib/viewers/text/MarkdownViewer.js index 0144e642f..f8490c561 100644 --- a/src/lib/viewers/text/MarkdownViewer.js +++ b/src/lib/viewers/text/MarkdownViewer.js @@ -103,7 +103,7 @@ class MarkdownViewer extends PlainTextViewer { __('enter_fullscreen'), this.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add(__('exit_fullscreen'), this.toggleFullscreen, 'bp-exit-fullscreen-icon', ICON_FULLSCREEN_OUT); } @@ -142,7 +142,7 @@ class MarkdownViewer extends PlainTextViewer { // Use default escaping if no highlighting was successful return ''; - } + }, }); // Custom renderer for links to add rel="noopener noreferrer" diff --git a/src/lib/viewers/text/PlainTextViewer.js b/src/lib/viewers/text/PlainTextViewer.js index a2563c690..e66ede2ef 100644 --- a/src/lib/viewers/text/PlainTextViewer.js +++ b/src/lib/viewers/text/PlainTextViewer.js @@ -200,10 +200,10 @@ class PlainTextViewer extends TextBaseViewer { this.startLoadTimer(); return api .get(contentUrl, { headers, type: 'text' }) - .catch((error) => { + .catch(error => { this.handleDownloadError(error, contentUrl); }) - .then((text) => { + .then(text => { if (this.isDestroyed()) { return; } @@ -232,13 +232,13 @@ class PlainTextViewer extends TextBaseViewer { */ initHighlightJs(text) { const workerBlob = new Blob([HIGHLIGHT_WORKER_JS], { - type: 'application/javascript' + type: 'application/javascript', }); this.workerSrc = URL.createObjectURL(workerBlob); const worker = new Worker(this.workerSrc); // Once highlighting is done, replace content and finish loading - worker.onmessage = (event) => { + worker.onmessage = event => { this.finishLoading(event.data, true); }; @@ -247,7 +247,7 @@ class PlainTextViewer extends TextBaseViewer { const highlightSrc = assetUrlCreator(`third-party/text/${TEXT_STATIC_ASSETS_VERSION}/highlight.min.js`); worker.postMessage({ highlightSrc, - text + text, }); } @@ -290,7 +290,7 @@ class PlainTextViewer extends TextBaseViewer { preparePrint(stylesheets) { const assetUrlCreator = createAssetUrlCreator(this.options.location); this.printframe = openContentInsideIframe(this.textEl.outerHTML); - stylesheets.forEach((stylesheet) => { + stylesheets.forEach(stylesheet => { this.printframe.contentDocument.head.appendChild(createStylesheet(assetUrlCreator(stylesheet))); }); diff --git a/src/lib/viewers/text/TextBaseViewer.js b/src/lib/viewers/text/TextBaseViewer.js index fda1ee50c..8215079bc 100644 --- a/src/lib/viewers/text/TextBaseViewer.js +++ b/src/lib/viewers/text/TextBaseViewer.js @@ -16,6 +16,7 @@ class TextBaseViewer extends BaseViewer { this.zoomOut = this.zoomOut.bind(this); this.zoomIn = this.zoomIn.bind(this); } + /** * @inheritdoc */ @@ -62,7 +63,7 @@ class TextBaseViewer extends BaseViewer { this.emit('zoom', { zoom: newFontSize, canZoomIn: true, - canZoomOut: true + canZoomOut: true, }); } @@ -115,7 +116,7 @@ class TextBaseViewer extends BaseViewer { __('enter_fullscreen'), this.toggleFullscreen, 'bp-enter-fullscreen-icon', - ICON_FULLSCREEN_IN + ICON_FULLSCREEN_IN, ); this.controls.add(__('exit_fullscreen'), this.toggleFullscreen, 'bp-exit-fullscreen-icon', ICON_FULLSCREEN_OUT); } @@ -136,7 +137,8 @@ class TextBaseViewer extends BaseViewer { if (key === 'Shift++') { this.zoomIn(); return true; - } else if (key === 'Shift+_') { + } + if (key === 'Shift+_') { this.zoomOut(); return true; } diff --git a/src/lib/viewers/text/TextLoader.js b/src/lib/viewers/text/TextLoader.js index 3a4d68f5d..f10f10680 100644 --- a/src/lib/viewers/text/TextLoader.js +++ b/src/lib/viewers/text/TextLoader.js @@ -12,26 +12,26 @@ const VIEWERS = [ NAME: 'CSV', CONSTRUCTOR: CSVViewer, REP: 'text', - EXT: ['csv', 'tsv'] + EXT: ['csv', 'tsv'], }, { NAME: 'Markdown', CONSTRUCTOR: MarkdownViewer, REP: 'text', - EXT: ['md'] + EXT: ['md'], }, { NAME: 'Text', CONSTRUCTOR: PlainTextViewer, REP: ORIGINAL_REP_NAME, - EXT: HTML_EXTENSIONS + EXT: HTML_EXTENSIONS, }, { NAME: 'Text', CONSTRUCTOR: PlainTextViewer, REP: 'text', - EXT: TXT_EXTENSIONS - } + EXT: TXT_EXTENSIONS, + }, ]; class TextLoader extends AssetLoader { diff --git a/src/lib/viewers/text/__tests__/BoxCSV-test.js b/src/lib/viewers/text/__tests__/BoxCSV-test.js index c99439367..7b668dc3f 100644 --- a/src/lib/viewers/text/__tests__/BoxCSV-test.js +++ b/src/lib/viewers/text/__tests__/BoxCSV-test.js @@ -56,7 +56,7 @@ describe('lib/viewers/text/BoxCSV', () => { columnIndex: 1, key: 'key', rowIndex: 2, - style: 'style' + style: 'style', }); expect(cell.props.className).to.equal('rowClass bp-text-csv-cell'); diff --git a/src/lib/viewers/text/__tests__/CSVViewer-test.js b/src/lib/viewers/text/__tests__/CSVViewer-test.js index 44241a31d..b8ed0aac3 100644 --- a/src/lib/viewers/text/__tests__/CSVViewer-test.js +++ b/src/lib/viewers/text/__tests__/CSVViewer-test.js @@ -26,13 +26,13 @@ describe('lib/viewers/text/CSVViewer', () => { options = { container: containerEl, file: { - id: 0 + id: 0, }, representation: { content: { - url_template: 'csvUrl{+asset_path}' - } - } + url_template: 'csvUrl{+asset_path}', + }, + }, }; csv = new CSVViewer(options); @@ -110,7 +110,7 @@ describe('lib/viewers/text/CSVViewer', () => { expect(window.Papa.parse).to.be.calledWith(csvUrlWithAuth, { download: true, error: sinon.match.func, - complete: sinon.match.func + complete: sinon.match.func, }); }); }); @@ -171,7 +171,7 @@ describe('lib/viewers/text/CSVViewer', () => { Object.defineProperty(TextBaseViewer.prototype, 'resize', { value: sandbox.mock() }); csv.csvComponent = { renderCSV: sandbox.mock(), - destroy: sandbox.stub() + destroy: sandbox.stub(), }; csv.resize(); @@ -186,7 +186,7 @@ describe('lib/viewers/text/CSVViewer', () => { renderCSV: sandbox.mock(), render: () => { return ''; - } + }, }); /* eslint-enable react/prefer-es6-class */ sandbox.stub(csv, 'loadUI'); diff --git a/src/lib/viewers/text/__tests__/MarkdownViewer-test.js b/src/lib/viewers/text/__tests__/MarkdownViewer-test.js index c5cc8eb06..553435b07 100644 --- a/src/lib/viewers/text/__tests__/MarkdownViewer-test.js +++ b/src/lib/viewers/text/__tests__/MarkdownViewer-test.js @@ -23,9 +23,9 @@ describe('lib/viewers/text/MarkdownViewer', () => { rootEl = document.querySelector(SELECTOR_BOX_PREVIEW); markdown = new MarkdownViewer({ file: { - id: 0 + id: 0, }, - container: containerEl + container: containerEl, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -66,7 +66,7 @@ describe('lib/viewers/text/MarkdownViewer', () => { markdown.printReady = false; markdown.printPopup = { show: sandbox.stub(), - disableButton: sandbox.stub() + disableButton: sandbox.stub(), }; markdown.print(); @@ -74,7 +74,7 @@ describe('lib/viewers/text/MarkdownViewer', () => { expect(markdown.preparePrint).to.be.calledWith([ `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/github.min.css`, `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/github-markdown.min.css`, - 'preview.css' + 'preview.css', ]); expect(markdown.printPopup.show).to.be.calledWith('Preparing to print...', 'Print', sinon.match.func); expect(markdown.printPopup.disableButton).to.be.called; @@ -91,7 +91,7 @@ describe('lib/viewers/text/MarkdownViewer', () => { const event = { preventDefault: () => {}, stopPropagation: () => {}, - target: markdown.printPopup.buttonEl + target: markdown.printPopup.buttonEl, }; markdown.printPopup.popupClickHandler(event); @@ -120,7 +120,7 @@ describe('lib/viewers/text/MarkdownViewer', () => { it('should finish loading, init markdown renderer, show the markdown, and emit load', () => { const md = { - render: sandbox.stub() + render: sandbox.stub(), }; sandbox.stub(markdown, 'initRemarkable').returns(md); sandbox.stub(markdown, 'loadUI'); @@ -138,7 +138,7 @@ describe('lib/viewers/text/MarkdownViewer', () => { it('should show truncated download button if text is truncated', () => { sandbox.stub(markdown, 'initRemarkable').returns({ - render: () => {} + render: () => {}, }); sandbox.stub(markdown, 'loadUI'); sandbox.stub(markdown, 'emit'); diff --git a/src/lib/viewers/text/__tests__/PlainTextViewer-test.js b/src/lib/viewers/text/__tests__/PlainTextViewer-test.js index fd769f767..9a1d4ad97 100644 --- a/src/lib/viewers/text/__tests__/PlainTextViewer-test.js +++ b/src/lib/viewers/text/__tests__/PlainTextViewer-test.js @@ -29,15 +29,15 @@ describe('lib/viewers/text/PlainTextViewer', () => { file: { id: 0, permissions: { - can_download: true - } + can_download: true, + }, }, container: containerEl, representation: { content: { - url_template: 'foo' - } - } + url_template: 'foo', + }, + }, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -62,9 +62,9 @@ describe('lib/viewers/text/PlainTextViewer', () => { it('should set up proper text elements and initialize print', () => { text = new PlainTextViewer({ file: { - id: 0 + id: 0, }, - container: containerEl + container: containerEl, }); sandbox.stub(text, 'initPrint'); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); @@ -167,14 +167,14 @@ describe('lib/viewers/text/PlainTextViewer', () => { text.printReady = false; text.printPopup = { show: sandbox.stub(), - disableButton: sandbox.stub() + disableButton: sandbox.stub(), }; text.print(); expect(text.preparePrint).to.be.calledWith([ `third-party/text/${TEXT_STATIC_ASSETS_VERSION}/github.min.css`, - 'preview.css' + 'preview.css', ]); expect(text.printPopup.show).to.be.called; expect(text.printPopup.disableButton).to.be.called; @@ -286,8 +286,8 @@ describe('lib/viewers/text/PlainTextViewer', () => { Object.defineProperty(Worker.prototype, 'postMessage', { value: sandbox.mock().withArgs({ highlightSrc: hljs, - text: someText - }) + text: someText, + }), }); text.initHighlightJs(someText); @@ -301,9 +301,9 @@ describe('lib/viewers/text/PlainTextViewer', () => { beforeEach(() => { text = new PlainTextViewer({ file: { - id: 0 + id: 0, }, - container: containerEl + container: containerEl, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.stub() }); text.containerEl = containerEl; @@ -343,9 +343,9 @@ describe('lib/viewers/text/PlainTextViewer', () => { sandbox.stub(util, 'openContentInsideIframe').returns({ contentDocument: { head: { - appendChild: appendStub - } - } + appendChild: appendStub, + }, + }, }); text.options.location = 'en-US'; sandbox.stub(window, 'setTimeout'); @@ -363,9 +363,9 @@ describe('lib/viewers/text/PlainTextViewer', () => { sandbox.stub(util, 'openContentInsideIframe').returns({ contentDocument: { head: { - appendChild: sandbox.stub() - } - } + appendChild: sandbox.stub(), + }, + }, }); text.initPrint(); @@ -387,8 +387,8 @@ describe('lib/viewers/text/PlainTextViewer', () => { text.printframe = { contentWindow: { focus: sandbox.stub(), - print: sandbox.stub() - } + print: sandbox.stub(), + }, }; sandbox.stub(Browser, 'getName').returns('NotExplorer'); @@ -441,7 +441,7 @@ describe('lib/viewers/text/PlainTextViewer', () => { it('should set up download button and bind click handler', () => { const bindDownload = sandbox.stub(); text.download = { - bind: sandbox.stub().returns(bindDownload) + bind: sandbox.stub().returns(bindDownload), }; text.showTruncatedDownloadButton(); diff --git a/src/lib/viewers/text/__tests__/TextBaseViewer-test.js b/src/lib/viewers/text/__tests__/TextBaseViewer-test.js index a28a4e009..f9b298f99 100644 --- a/src/lib/viewers/text/__tests__/TextBaseViewer-test.js +++ b/src/lib/viewers/text/__tests__/TextBaseViewer-test.js @@ -21,9 +21,9 @@ describe('lib/viewers/text/TextBaseViewer', () => { containerEl = document.querySelector('.container'); textBase = new TextBaseViewer({ file: { - id: 0 + id: 0, }, - container: containerEl + container: containerEl, }); Object.defineProperty(BaseViewer.prototype, 'setup', { value: sandbox.mock() }); @@ -44,7 +44,7 @@ describe('lib/viewers/text/TextBaseViewer', () => { describe('destroy()', () => { it('should destroy the controls if they exist', () => { textBase.controls = { - destroy: sandbox.stub() + destroy: sandbox.stub(), }; textBase.destroy(); @@ -96,14 +96,23 @@ describe('lib/viewers/text/TextBaseViewer', () => { describe('load()', () => { it('should add selectable class if user has download permissions', () => { - sandbox.stub(file, 'checkPermission').withArgs(textBase.options.file, PERMISSION_DOWNLOAD).returns(true); + sandbox + .stub(file, 'checkPermission') + .withArgs(textBase.options.file, PERMISSION_DOWNLOAD) + .returns(true); textBase.load(); expect(textBase.containerEl).to.have.class('bp-is-selectable'); }); it('should not add selectable class if disableTextViewer option is true', () => { - sandbox.stub(file, 'checkPermission').withArgs(textBase.options.file, PERMISSION_DOWNLOAD).returns(true); - sandbox.stub(textBase, 'getViewerOption').withArgs('disableTextLayer').returns(true); + sandbox + .stub(file, 'checkPermission') + .withArgs(textBase.options.file, PERMISSION_DOWNLOAD) + .returns(true); + sandbox + .stub(textBase, 'getViewerOption') + .withArgs('disableTextLayer') + .returns(true); textBase.load(); @@ -128,19 +137,19 @@ describe('lib/viewers/text/TextBaseViewer', () => { sinon.match.string, textBase.zoomOut, sinon.match.string, - sinon.match.string + sinon.match.string, ); expect(Controls.prototype.add).to.be.calledWith( sinon.match.string, textBase.zoomIn, sinon.match.string, - sinon.match.string + sinon.match.string, ); expect(Controls.prototype.add).to.be.calledWith( sinon.match.string, textBase.toggleFullscreen, sinon.match.string, - sinon.match.string + sinon.match.string, ); }); }); diff --git a/src/lib/viewers/text/__tests__/TextLoader-test.js b/src/lib/viewers/text/__tests__/TextLoader-test.js index b37129f4c..33b4d6531 100644 --- a/src/lib/viewers/text/__tests__/TextLoader-test.js +++ b/src/lib/viewers/text/__tests__/TextLoader-test.js @@ -10,8 +10,8 @@ describe('lib/viewers/text/TextLoader', () => { TextLoader.viewers = [ { REP: 'ORIGINAL', - EXT: 'html' - } + EXT: 'html', + }, ]; stubFile = { @@ -19,10 +19,10 @@ describe('lib/viewers/text/TextLoader', () => { representations: { entries: [ { - representation: 'ORIGINAL' - } - ] - } + representation: 'ORIGINAL', + }, + ], + }, }; }); diff --git a/stylelint.config.js b/stylelint.config.js new file mode 100644 index 000000000..81e85403d --- /dev/null +++ b/stylelint.config.js @@ -0,0 +1,8 @@ +const stylelintrc = require.resolve('@box/frontend/stylelint/stylelint.config.js'); + +module.exports = { + extends: [stylelintrc], + rules: { + 'no-descending-specificity': null, // fixme + }, +}; diff --git a/yarn.lock b/yarn.lock index 83c1115bd..7757ba8bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,6 +9,33 @@ dependencies: "@babel/highlight" "7.0.0-beta.40" +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@>=7.2.2": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.5.tgz#17b2686ef0d6bc58f963dddd68ab669755582c30" + integrity sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" + "@babel/helpers" "^7.5.5" + "@babel/parser" "^7.5.5" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.13" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.40.tgz#ab61f9556f4f71dbd1138949c795bb9a21e302ea" @@ -20,6 +47,17 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.5.tgz#873a7f936a3c89491b43536d12245b626664e3cf" + integrity sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ== + dependencies: + "@babel/types" "^7.5.5" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/helper-function-name@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz#9d033341ab16517f40d43a73f2d81fc431ccd7b6" @@ -29,6 +67,15 @@ "@babel/template" "7.0.0-beta.40" "@babel/types" "7.0.0-beta.40" +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + "@babel/helper-get-function-arity@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz#ac0419cf067b0ec16453e1274f03878195791c6e" @@ -36,6 +83,29 @@ dependencies: "@babel/types" "7.0.0-beta.40" +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helpers@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" + integrity sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g== + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" + "@babel/highlight@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255" @@ -45,6 +115,27 @@ esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/highlight@^7.0.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.4.4", "@babel/parser@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" + integrity sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g== + +"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" + integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== + dependencies: + regenerator-runtime "^0.13.2" + "@babel/template@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.40.tgz#034988c6424eb5c3268fe6a608626de1f4410fc8" @@ -55,6 +146,15 @@ babylon "7.0.0-beta.40" lodash "^4.2.0" +"@babel/template@^7.1.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + "@babel/traverse@^7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e" @@ -70,6 +170,21 @@ invariant "^2.2.0" lodash "^4.2.0" +"@babel/traverse@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" + integrity sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.5.5" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.5.5" + "@babel/types" "^7.5.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + "@babel/types@7.0.0-beta.40", "@babel/types@^7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14" @@ -79,113 +194,288 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@commitlint/cli@^5.2.0": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-5.2.8.tgz#593e0d16d1d6ebba9994893a4cc933d1b212ae0c" - integrity sha512-XSej+/Pvl3gMOahEZpbsE5F1hPzMVPMXuK6MWZxsou3fyPUeAzHK9F2C76WCDVLIBVte/lxow7QQtUtMQEyiOg== +"@babel/types@^7.0.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.5.tgz#97b9f728e182785909aa4ab56264f090a028d18a" + integrity sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw== dependencies: - "@commitlint/core" "^5.2.8" + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + +"@box/frontend@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@box/frontend/-/frontend-1.4.0.tgz#faa93ce486120999f48a6b6c2e08e3dd0115fde8" + integrity sha512-MEdVBXAWLyKDtsb3g0J/d+rxGRxKfxZnQm4qf4FNd81FWFBwCzSG9KL3U18PPWrk4D9+NjXqVh/yGX9Kn18ilQ== + dependencies: + properties-parser "^0.3.1" + rimraf "^2.6.3" + +"@commitlint/cli@^7.2.1": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-7.6.1.tgz#a93cf995082831999937f6d5ec1a582c8fc0393a" + integrity sha512-HEJwQ/aK0AOcAwn77ZKbb/GZhlGxBSPhtVp07uoJFVqM12l2Ia2JHA+MTpfHCFdVahKyYGREZgxde6LyKyG8aQ== + dependencies: + "@commitlint/format" "^7.6.1" + "@commitlint/lint" "^7.6.0" + "@commitlint/load" "^7.6.1" + "@commitlint/read" "^7.6.0" babel-polyfill "6.26.0" - chalk "2.3.0" - get-stdin "5.0.1" - lodash.merge "4.6.0" - lodash.pick "4.4.0" - meow "3.7.0" - -"@commitlint/core@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/core/-/core-5.2.8.tgz#a04a1beb2d25c8b70b19d4c309af50902d4f1057" - integrity sha512-E/2gJ6BpO43E3OeT1z99oPzVu9SHOprdjiBZ8ZwgmW8NynzhfSsSqrP+fHcro0ig8FcynRI/tYnpGeBGFC8DXg== - dependencies: - "@commitlint/execute-rule" "^5.2.8" - "@commitlint/is-ignored" "^5.2.8" - "@commitlint/parse" "^5.2.8" - "@commitlint/resolve-extends" "^5.2.8" - "@commitlint/rules" "^5.2.8" - "@commitlint/top-level" "^5.2.8" - "@marionebl/sander" "^0.6.0" + chalk "2.3.1" + get-stdin "7.0.0" + lodash "4.17.11" + meow "5.0.0" + resolve-from "5.0.0" + resolve-global "1.0.0" + +"@commitlint/cli@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-8.1.0.tgz#a3d4236c0ac961d7026a53d728b179c696d6a045" + integrity sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig== + dependencies: + "@commitlint/format" "^8.1.0" + "@commitlint/lint" "^8.1.0" + "@commitlint/load" "^8.1.0" + "@commitlint/read" "^8.1.0" + babel-polyfill "6.26.0" + chalk "2.3.1" + get-stdin "7.0.0" + lodash "4.17.14" + meow "5.0.0" + resolve-from "5.0.0" + resolve-global "1.0.0" + +"@commitlint/config-conventional@7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@commitlint/config-conventional/-/config-conventional-7.1.2.tgz#5b5e45924c9abd8f9a8d83eb1f66e24e5f66916f" + integrity sha512-DmA4ixkpv03qA1TVs1Bl25QsVym2bPL6pKapesALWIVggG3OpwqGZ55vN75Tx8xZoG7LFKrVyrt7kwhA7X8njQ== + +"@commitlint/ensure@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-7.6.0.tgz#e873ff6786a3b9504e88a4debed41df29cd8ac36" + integrity sha512-pSUrNud5L/8y+cLWo3LEa8Ce4bAAR33xMderFUhuNPHj7TwpNS7L4ROMnhL4ZlCYRazCRDlnPaJLPikMoWThfA== + dependencies: + lodash "4.17.11" + +"@commitlint/ensure@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-8.1.0.tgz#6c669f85c3005ed15c8141d83cf5312c43001613" + integrity sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ== + dependencies: + lodash "4.17.14" + +"@commitlint/execute-rule@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-7.6.0.tgz#60c1c34b5f2fca6c6cbca019a9c7d81c2fab1e4a" + integrity sha512-0inGOIlLefPDtiDOaZ6WoE1p+GEZZIj2VwUftUozD3C71TiwP9UfKAVVtUDFPIeL6RgSqCkCf7zsy6NKNxwkBg== + dependencies: + babel-runtime "6.26.0" + +"@commitlint/execute-rule@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz#e8386bd0836b3dcdd41ebb9d5904bbeb447e4715" + integrity sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg== + +"@commitlint/format@^7.6.1": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-7.6.1.tgz#106750de50fab7d153eed80e7577c768bb9a3a1b" + integrity sha512-Ldzf5N2Sr9RQqvlYwaQn4vz1WOZ7byYinspC/WCrbfcETGy28j7QE4OueZU6nNB9TjwwEorKm13uy7tDWPR7dg== + dependencies: babel-runtime "^6.23.0" chalk "^2.0.1" - cosmiconfig "^3.0.1" - git-raw-commits "^1.3.0" - lodash.merge "4.6.0" - lodash.mergewith "4.6.0" - lodash.pick "4.4.0" - lodash.topairs "4.3.0" - resolve-from "4.0.0" - -"@commitlint/ensure@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/ensure/-/ensure-5.2.8.tgz#15a01ca825db4b0e9a79d792a832727396f349b3" - integrity sha512-SWclCuYUmzTUDw0RL/ktO6qzkX2uo3PwGz+4nEyZK00ZCnZk9V99A4AX1fW3VyhB3J1C40QIztNGpafk3iCvkg== - dependencies: - lodash.camelcase "4.3.0" - lodash.kebabcase "4.1.1" - lodash.snakecase "4.1.1" - lodash.startcase "4.4.0" - lodash.upperfirst "4.3.1" - -"@commitlint/execute-rule@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/execute-rule/-/execute-rule-5.2.8.tgz#d6422f14e9acf39ab5f520dc810fe727b679d30f" - integrity sha512-0ShMDkTXdGnb21U2MfTtpnhySVZJ8FuEH4F9S9c0zoRlbVrphIfX8m+2T4p4ge3AGM0E/QDi8bZqLrD/E8edHQ== + +"@commitlint/format@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/format/-/format-8.1.0.tgz#c3f3ca78bb74cbc1cce1368c0974b0cb8f31b98e" + integrity sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q== dependencies: - babel-runtime "6.26.0" + chalk "^2.0.1" -"@commitlint/is-ignored@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-5.2.8.tgz#c2b12e86eab7d02e0e3a576eddab993dd3cd55d2" - integrity sha512-AGViKcJ2/F2HXJNM+vBHxGrAMxJ3ZXGqQYZXC9hjF5d1x3tLFe5uYkI2WBdX6YiAsZbKk5a+Cchr2qojkckqRA== +"@commitlint/is-ignored@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-7.6.0.tgz#d069f25741dcf859b324e5f709835af3aac9cf45" + integrity sha512-By/mLNhz+6Rtix9+Kyof1gdKiELchAnQHpdeKIHIOe9sjbvd3HqDoFHh/mGMMRnGIPMZOX5TO8Fqy3A/2HqlTw== dependencies: - semver "5.4.1" + semver "6.0.0" + +"@commitlint/is-ignored@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz#c0583fa3c641b2d4898be1443e70e9c467429de2" + integrity sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg== + dependencies: + "@types/semver" "^6.0.1" + semver "6.1.1" + +"@commitlint/lint@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-7.6.0.tgz#a6da320026b937aa9bf971e060e471edd6b088ec" + integrity sha512-aUIFX0lPRZL7WmT8W8qzogJD4LmHk6JPG3XUAX+K0pOHGjC/0ALvSAytvoLXy4fvmSnGJkXmWhzSW7c0Spa14Q== + dependencies: + "@commitlint/is-ignored" "^7.6.0" + "@commitlint/parse" "^7.6.0" + "@commitlint/rules" "^7.6.0" + babel-runtime "^6.23.0" + lodash "4.17.11" + +"@commitlint/lint@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/lint/-/lint-8.1.0.tgz#ad10f4885c06f14c71de11dcd6bf2ca54a395141" + integrity sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ== + dependencies: + "@commitlint/is-ignored" "^8.1.0" + "@commitlint/parse" "^8.1.0" + "@commitlint/rules" "^8.1.0" + babel-runtime "^6.23.0" + lodash "4.17.14" + +"@commitlint/load@^7.6.1": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-7.6.2.tgz#b5ed8163fa3117d60faf70a4e677b2017bbc71bb" + integrity sha512-I+xk+BkXAG1roXNrPsR1eOd5hEa+oLc6HLYnHAT/HLGKKB3E01IGg3O5SGlg7lpf1yiAaYI+wAnNTr3f3sIbWQ== + dependencies: + "@commitlint/execute-rule" "^7.6.0" + "@commitlint/resolve-extends" "^7.6.0" + babel-runtime "^6.23.0" + cosmiconfig "^5.2.0" + lodash "4.17.11" + resolve-from "^5.0.0" + +"@commitlint/load@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/load/-/load-8.1.0.tgz#63b72ae5bb9152b8fa5b17c5428053032a9a49c8" + integrity sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg== + dependencies: + "@commitlint/execute-rule" "^8.1.0" + "@commitlint/resolve-extends" "^8.1.0" + babel-runtime "^6.23.0" + chalk "2.4.2" + cosmiconfig "^5.2.0" + lodash "4.17.14" + resolve-from "^5.0.0" -"@commitlint/message@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-5.2.8.tgz#189e054d108c3dd3f0a4da20c3695e3b3e682d86" - integrity sha512-5k4pOPX5hwS34xAYzSZZFxsW0MCaJbbcjCTiqbyf8WEPep0ru2dsZg6EsBqLTe9IG1YjQM/Z5/udkfIwBXOYpw== +"@commitlint/message@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-7.6.0.tgz#899b6b411945dd091d261408b6e994043967bc06" + integrity sha512-PtP4jhBYGXLaQQC5jel+RQczG2tS3Cy6rRxQioUfCUaEg/LV029ao/KcL1kHEBJ8hSW/SUmnvDaD9Y6nozLQMA== -"@commitlint/parse@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-5.2.8.tgz#2424ebde2c2925f3119cfafb6d605494f25beaed" - integrity sha512-XSBuLXuyOJ7u4aOM4XdGUvcfaLZ8By4abFF9VzF6tbek+R3jylSlrULqeX8oNnzkSn2PWtf9sYDb2dt5z9XWjw== +"@commitlint/message@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/message/-/message-8.1.0.tgz#8fb8046ddaa7e5c846a79da7cdbd15cf1a7770ae" + integrity sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A== + +"@commitlint/parse@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-7.6.0.tgz#e7b8d6dc145e78cf56940bbf405ca6fac3085196" + integrity sha512-1x60kTqz2VBCjYE+8MV5BhE+ShPo7MgVlrMWSlxiiJDWP5CvWa+SBbUayDJ7rtOXimjTASZ9ZNZTuFPdJE/Y7A== dependencies: conventional-changelog-angular "^1.3.3" conventional-commits-parser "^2.1.0" + lodash "^4.17.11" -"@commitlint/resolve-extends@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-5.2.8.tgz#a8a2a6b6ee45261ce04572eea3af6bd479205ff1" - integrity sha512-3d4Qk5/IQiX95nGn5pmtPAkoueKZLgz8VCdOxf1fNegudyl2EaRxKLIoaZ9DmZz6RE1CpRCinvsFFdESq3tvTw== +"@commitlint/parse@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/parse/-/parse-8.1.0.tgz#833243c6d848e7a7e775a283b38697166ed2fd22" + integrity sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA== + dependencies: + conventional-changelog-angular "^1.3.3" + conventional-commits-parser "^2.1.0" + lodash "^4.17.11" + +"@commitlint/read@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-7.6.0.tgz#e55863354b436683daa2081de7ec2189573bc306" + integrity sha512-OyligtK/e4xnQklrQqTcSMM27eNhq+LqXfoeVouuPx059oDEw9wZYNN4HGzyxs4Pb6GdMpzRHLdeMQ24M+AiYw== + dependencies: + "@commitlint/top-level" "^7.6.0" + "@marionebl/sander" "^0.6.0" + babel-runtime "^6.23.0" + git-raw-commits "^1.3.0" + +"@commitlint/read@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/read/-/read-8.1.0.tgz#effe07c965ba1735a5f7f8b7b19ac4d98c887507" + integrity sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg== + dependencies: + "@commitlint/top-level" "^8.1.0" + "@marionebl/sander" "^0.6.0" + babel-runtime "^6.23.0" + git-raw-commits "^1.3.0" + +"@commitlint/resolve-extends@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-7.6.0.tgz#0680b76eeb0e41f728c2f38645473a0956299edb" + integrity sha512-fk8KvNiEbRc+p8nPFuysVP2O95+sb8vlIDTjqtGVObqrzFINRfERXwqBmTBtcu556BoDAR2hwRVXmuwhns+Duw== dependencies: babel-runtime "6.26.0" - lodash.merge "4.6.0" - lodash.omit "4.5.0" - require-uncached "^1.0.3" - resolve-from "^4.0.0" - resolve-global "^0.1.0" + import-fresh "^3.0.0" + lodash "4.17.11" + resolve-from "^5.0.0" + resolve-global "^1.0.0" + +"@commitlint/resolve-extends@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz#ed67f2ee484160ac8e0078bae52f172625157472" + integrity sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw== + dependencies: + "@types/node" "^12.0.2" + import-fresh "^3.0.0" + lodash "4.17.14" + resolve-from "^5.0.0" + resolve-global "^1.0.0" + +"@commitlint/rules@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-7.6.0.tgz#f9a833c1eab8144fd8f545a71408b39e51acb64e" + integrity sha512-shLJdMUwdVeE5UgOE8E+c+PFS7+0FFGfheMa3s6ZK+xX8pTUxseXZu9iCF4mwF+WWkVk518xPuNLvmYE96salQ== + dependencies: + "@commitlint/ensure" "^7.6.0" + "@commitlint/message" "^7.6.0" + "@commitlint/to-lines" "^7.6.0" + babel-runtime "^6.23.0" -"@commitlint/rules@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-5.2.8.tgz#a2519163bffc1b85cd06c3ca584f8c5956e8c8e6" - integrity sha512-R2shsQJk2q0Wd+zBKbeKDVJszEpiTNL7OnPavXr9wdseHPtpXNUTn3YiWtipgNOW3Rfb9t2A5mxgn0uF0ce3iQ== +"@commitlint/rules@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/rules/-/rules-8.1.0.tgz#009c64a8a23feb4647e5a25057997be62a272c8a" + integrity sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA== dependencies: - "@commitlint/ensure" "^5.2.8" - "@commitlint/message" "^5.2.8" - "@commitlint/to-lines" "^5.2.8" + "@commitlint/ensure" "^8.1.0" + "@commitlint/message" "^8.1.0" + "@commitlint/to-lines" "^8.1.0" babel-runtime "^6.23.0" -"@commitlint/to-lines@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-5.2.8.tgz#2008a7e3913e70c370b814138d09441d33db33ee" - integrity sha512-BI0wuimKkV/DrEHf7Ze2DIY9tY9E1MWz3/Ox3hheyQeTjDD3MSNdEs4KmXtIXfoAAPifOMmRUccbcEIR6vW3UQ== +"@commitlint/to-lines@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-7.6.0.tgz#5ed4dbf39db0ceff96dbb661b9ce048ed3db7a4b" + integrity sha512-L/Vl5ThRuBHnSNZBtc+p2LCs2ayxWodC+I/X3NKUywSmr6kKpJJCFqHHHqPu+yXwGUPwqCMQhogIGLuv9TtWWw== + +"@commitlint/to-lines@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/to-lines/-/to-lines-8.1.0.tgz#5bf2597f46acacec4b1b3dba832ac8934798b22a" + integrity sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ== -"@commitlint/top-level@^5.2.8": - version "5.2.8" - resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-5.2.8.tgz#ccd31c5496695e0ee128085d45a6c7cd84bb60c8" - integrity sha512-0WdwHKLUXVCr2CYtAIZWdYLo4kSIlEs+q24/rt55SNl7/QRT6/UKMiyHN/gLeK7Q0CzEOebXD8Jjrl3BCUTyYg== +"@commitlint/top-level@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-7.6.0.tgz#0ed88078ac585c93ee314ff3b7f8c20143c57652" + integrity sha512-R2RzJZDuT2TU2dZMrRd7olax5IDVcUB/O8k76d1LW13CQ9/2ArJi3TCFXSZIaGpCUnyAYA5KiCZ+c1opnyQuog== dependencies: find-up "^2.1.0" +"@commitlint/top-level@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/top-level/-/top-level-8.1.0.tgz#f1950de73a1f76ef5c9e753a6b77402e0755d677" + integrity sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA== + dependencies: + find-up "^4.0.0" + +"@commitlint/travis-cli@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@commitlint/travis-cli/-/travis-cli-8.1.0.tgz#0c8dc099644cd2da8bd3e55ac9cc3055f1906504" + integrity sha512-HSeinF08sstSTXDIPvTx5evAd4U49NLF1n0eAXu9rzyHA+ELc6gVSiW3HnIdNx83WkTV+nuQIPQGXqXYx9vleA== + dependencies: + "@commitlint/cli" "^8.1.0" + babel-runtime "6.26.0" + execa "0.9.0" + "@cypress/listr-verbose-renderer@0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#a77492f4b11dcc7c446a34b3e28721afd33c642a" @@ -213,6 +503,26 @@ mkdirp "^0.5.1" rimraf "^2.5.2" +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== + +"@samverschueren/stream-to-observable@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== + dependencies: + any-observable "^0.3.0" + "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.3.0.tgz#50a2754016b6f30a994ceda6d9a0a8c36adda849" @@ -278,6 +588,20 @@ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.8.tgz#d27600e9ba2f371e08695d90a0fe0408d89c7be7" integrity sha512-m812CONwdZn/dMzkIJEY0yAs4apyTkTORgfB2UsMOxgkUbC205AHnm4T8I0I5gPg9MHrFc1dJ35iS75c0CJkjg== +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + "@types/jquery@*": version "3.3.29" resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.3.29.tgz#680a2219ce3c9250483722fccf5570d1e2d08abd" @@ -295,7 +619,7 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.87.tgz#55f92183b048c2c64402afe472f8333f4e319a6b" integrity sha512-AqRC+aEF4N0LuNHtcjKtvF9OTfqZI0iaBoe3dA6m/W+/YZJBZjBmW/QIZ8fBeXC6cnytSY9tBoFBqZ9uSCeVsw== -"@types/minimatch@3.0.3": +"@types/minimatch@*", "@types/minimatch@3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== @@ -305,6 +629,16 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.44.tgz#1d4a798e53f35212fd5ad4d04050620171cd5b5e" integrity sha512-k2tWTQU8G4+iSMvqKi0Q9IIsWAp/n8xzdZS4Q4YVIltApoMA00wFBFdlJnmoaK1/z7B0Cy0yPe6GgXteSmdUNw== +"@types/node@*", "@types/node@^12.0.2": + version "12.6.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.8.tgz#e469b4bf9d1c9832aee4907ba8a051494357c12c" + integrity sha512-aX+gFgA5GHcDi89KG5keey2zf0WfZk/HAQotEamsK2kbey+8yGKcson0hbK8E+v0NArlCJQCqMP161YhV6ZXLg== + +"@types/semver@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-6.0.1.tgz#a984b405c702fa5a7ec6abc56b37f2ba35ef5af6" + integrity sha512-ffCdcrEE5h8DqVxinQjo+2d1q+FV5z7iNtPofw3JsrltSoSVlOGaW0rY8XxtO9XukdTn8TaCGWmk2VFGhI70mg== + "@types/sinon-chai@3.2.2": version "3.2.2" resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.2.tgz#5cfdbda70bae30f79a9423334af9e490e4cce793" @@ -328,6 +662,28 @@ resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== +"@types/unist@*", "@types/unist@^2.0.0": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e" + integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ== + +"@types/vfile-message@*": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a" + integrity sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA== + dependencies: + "@types/node" "*" + "@types/unist" "*" + +"@types/vfile@^3.0.0": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/vfile/-/vfile-3.0.2.tgz#19c18cd232df11ce6fa6ad80259bc86c366b09b9" + integrity sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw== + dependencies: + "@types/node" "*" + "@types/unist" "*" + "@types/vfile-message" "*" + JSONStream@^1.0.4: version "1.3.2" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" @@ -398,7 +754,7 @@ ajv-keywords@^2.1.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= -ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: +ajv-keywords@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" integrity sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74= @@ -413,7 +769,7 @@ ajv@^5.0.0, ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.0.1, ajv@^6.1.0: +ajv@^6.1.0: version "6.2.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.1.tgz#28a6abc493a2abe0fb4c8507acaedb43fa550671" integrity sha1-KKarxJOiq+D7TIUHrK7bQ/pVBnE= @@ -422,6 +778,16 @@ ajv@^6.0.1, ajv@^6.1.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@^6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ajv@^6.5.5: version "6.7.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.7.0.tgz#e3ce7bb372d6577bb1839f1dfdfcbf5ad2948d96" @@ -476,6 +842,11 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -488,10 +859,10 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -any-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" - integrity sha1-xnhwBYADV5AJCD9UrAq6+1wz0kI= +any-observable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== anymatch@^2.0.0: version "2.0.0" @@ -501,11 +872,6 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -app-root-path@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" - integrity sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y= - aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -526,10 +892,10 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" -aria-query@^0.7.0: - version "0.7.1" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.7.1.tgz#26cbb5aff64144b0a825be1846e0b16cfa00b11e" - integrity sha1-Jsu1r/ZBRLCoJb4YRuCxbPoAsR4= +aria-query@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" + integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w= dependencies: ast-types-flow "0.0.7" commander "^2.11.0" @@ -619,7 +985,7 @@ array-slice@^0.2.3: resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= -array-union@^1.0.1: +array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= @@ -694,11 +1060,16 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types-flow@0.0.7: +ast-types-flow@0.0.7, ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0= +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -755,7 +1126,7 @@ autoprefixer@^6.3.1: postcss "^5.2.16" postcss-value-parser "^3.2.3" -autoprefixer@^7.1.2, autoprefixer@^7.2.1: +autoprefixer@^7.2.1: version "7.2.6" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.2.6.tgz#256672f86f7c735da849c4f07d008abb056067dc" integrity sha512-Iq8TRIB+/9eQ8rbGhcP7ct5cYb/3qjNYAR2SnzLCEcwF6rvVOax8+9+fccgXk4bEhQGjOZd5TLhsksmAdsbGqQ== @@ -767,6 +1138,19 @@ autoprefixer@^7.1.2, autoprefixer@^7.2.1: postcss "^6.0.17" postcss-value-parser "^3.2.3" +autoprefixer@^9.0.0: + version "9.6.1" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.6.1.tgz#51967a02d2d2300bb01866c1611ec8348d355a47" + integrity sha512-aVo5WxR3VyvyJxcJC3h4FKfwCQvQWb1tSI5VHNibddCVWrcD1NvlxEweg3TSgiPztMnWfjpy2FURKA2kvDE+Tw== + dependencies: + browserslist "^4.6.3" + caniuse-lite "^1.0.30000980" + chalk "^2.4.2" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^7.0.17" + postcss-value-parser "^4.0.0" + aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -785,10 +1169,10 @@ axios@^0.19.0: follow-redirects "1.5.10" is-buffer "^2.0.2" -axobject-query@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-0.1.0.tgz#62f59dbc59c9f9242759ca349960e7a2fe3c36c0" - integrity sha1-YvWdvFnJ+SQnWco0mWDnov48NsA= +axobject-query@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9" + integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww== dependencies: ast-types-flow "0.0.7" @@ -1757,6 +2141,15 @@ browserslist@^2.11.3: caniuse-lite "^1.0.30000792" electron-to-chromium "^1.3.30" +browserslist@^4.6.3: + version "4.6.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" + integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== + dependencies: + caniuse-lite "^1.0.30000984" + electron-to-chromium "^1.3.191" + node-releases "^1.1.25" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" @@ -1781,7 +2174,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -builtin-modules@^1.0.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= @@ -1818,6 +2211,11 @@ cachedir@1.3.0: dependencies: os-homedir "^1.0.1" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -1854,6 +2252,11 @@ callsites@^2.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1911,6 +2314,11 @@ caniuse-lite@^1.0.30000792, caniuse-lite@^1.0.30000805: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000813.tgz#7b25e27fdfb8d133f3c932b01f77452140fcc6c9" integrity sha512-A8ITSmH5SFdMFdC704ggjg+x2z5PzQmVlG8tavwnfvbC33Q1UYrj0+G+Xm0SNAnd4He36fwUE/KEWytOEchw+A== +caniuse-lite@^1.0.30000980, caniuse-lite@^1.0.30000984: + version "1.0.30000984" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz#dc96c3c469e9bcfc6ad5bdd24c77ec918ea76fe0" + integrity sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA== + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -1960,6 +2368,15 @@ chalk@2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + integrity sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g== + dependencies: + ansi-styles "^3.2.0" + escape-string-regexp "^1.0.5" + supports-color "^5.2.0" + chalk@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" @@ -1969,6 +2386,15 @@ chalk@2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@2.4.2, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -1989,15 +2415,6 @@ chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^2.0.1, chalk@^2.4.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - character-entities-html4@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50" @@ -2120,7 +2537,7 @@ cli-cursor@^1.0.2: dependencies: restore-cursor "^1.0.1" -cli-cursor@^2.1.0: +cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= @@ -2307,7 +2724,7 @@ commander@^2.11.0, commander@^2.13.0, commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.0.tgz#ad2a23a1c3b036e392469b8012cec6b33b4c1322" integrity sha512-7B1ilBwtYSbetCgTY1NJFg+gVpestg0fdA1MhC1Vs4ssyfSXnCAjFr+QcQM9/RedXC0EaUx1sG8Smgw2VfgKEg== -commander@~2.20.0: +commander@^2.14.1, commander@~2.20.0: version "2.20.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== @@ -2397,6 +2814,11 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +confusing-browser-globals@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.7.tgz#5ae852bd541a910e7ffb2dbb864a2d21a36ad29b" + integrity sha512-cgHI1azax5ATrZ8rJ+ODDML9Fvu67PimB6aNxBrc/QwSaDaM9eTfIEUHx3bBLJJ82ioSb+/5zfsMCCEJax3ByQ== + connect-history-api-fallback@^1.3.0: version "1.6.0" resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" @@ -2452,6 +2874,14 @@ conventional-changelog-angular@^1.3.3, conventional-changelog-angular@^1.6.6: compare-func "^1.3.1" q "^1.5.1" +conventional-changelog-angular@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.3.tgz#299fdd43df5a1f095283ac16aeedfb0a682ecab0" + integrity sha512-YD1xzH7r9yXQte/HF9JBuEDfvjxxwDGGwZU1+ndanbY0oFgA+Po1T9JDSpPLdP0pZT6MhCAsdvFKC4TJ4MTJTA== + dependencies: + compare-func "^1.3.1" + q "^1.5.1" + conventional-changelog-atom@^0.2.4: version "0.2.4" resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.2.4.tgz#4917759947f4db86073f9d3838a2d54302d5843d" @@ -2459,13 +2889,20 @@ conventional-changelog-atom@^0.2.4: dependencies: q "^1.5.1" -conventional-changelog-cli@^1.3.5: - version "1.3.16" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.16.tgz#69acdcc4b68b4d123c5945868dffe394960cea9d" - integrity sha512-zNDG/rNbh29Z+d6zzrHN63dFZ4q9k1Ri0V8lXGw1q2ia6+FaE7AqJKccObbBFRmRISXpFESrqZiXpM4QeA84YA== +conventional-changelog-atom@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-2.0.1.tgz#dc88ce650ffa9ceace805cbe70f88bfd0cb2c13a" + integrity sha512-9BniJa4gLwL20Sm7HWSNXd0gd9c5qo49gCi8nylLFpqAHhkFTj7NQfROq3f1VpffRtzfTQp4VKU5nxbe2v+eZQ== + dependencies: + q "^1.5.1" + +conventional-changelog-cli@^2.0.5: + version "2.0.21" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-2.0.21.tgz#7469ddd663a8e68967b6d8c9c2cf207d1d7462f7" + integrity sha512-gMT1XvSVmo9Np1WUXz8Mvt3K+OtzR+Xu13z0jq/3qsXBbLuYc2/oaUXVr68r3fYOL8E9dN2uvX7Hc7RkeWvRVA== dependencies: add-stream "^1.0.0" - conventional-changelog "^1.1.18" + conventional-changelog "^3.1.8" lodash "^4.2.1" meow "^4.0.0" tempfile "^1.1.1" @@ -2477,6 +2914,21 @@ conventional-changelog-codemirror@^0.3.4: dependencies: q "^1.5.1" +conventional-changelog-codemirror@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.1.tgz#acc046bc0971460939a0cc2d390e5eafc5eb30da" + integrity sha512-23kT5IZWa+oNoUaDUzVXMYn60MCdOygTA2I+UjnOMiYVhZgmVwNd6ri/yDlmQGXHqbKhNR5NoXdBzSOSGxsgIQ== + dependencies: + q "^1.5.1" + +conventional-changelog-conventionalcommits@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-3.0.2.tgz#3a380a14ecd6f5056da6d460e30dd6c0c9f1aebe" + integrity sha512-w1+fQSDnm/7+sPKIYC5nfRVYDszt+6HdWizrigSqWFVIiiBVzkHGeqDLMSHc+Qq9qssHVAxAak5206epZyK87A== + dependencies: + compare-func "^1.3.1" + q "^1.5.1" + conventional-changelog-core@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz#45b6347c4c6512e1f163f7ff55c9f5bcb88fd990" @@ -2496,6 +2948,25 @@ conventional-changelog-core@^2.0.5: read-pkg-up "^1.0.1" through2 "^2.0.0" +conventional-changelog-core@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz#de41e6b4a71011a18bcee58e744f6f8f0e7c29c0" + integrity sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g== + dependencies: + conventional-changelog-writer "^4.0.5" + conventional-commits-parser "^3.0.2" + dateformat "^3.0.0" + get-pkg-repo "^1.0.0" + git-raw-commits "2.0.0" + git-remote-origin-url "^2.0.0" + git-semver-tags "^2.0.2" + lodash "^4.2.1" + normalize-package-data "^2.3.5" + q "^1.5.1" + read-pkg "^3.0.0" + read-pkg-up "^3.0.0" + through2 "^3.0.0" + conventional-changelog-ember@^0.3.6: version "0.3.6" resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.3.6.tgz#f3825d7434168f3d9211b5532dc1d5769532b668" @@ -2503,6 +2974,13 @@ conventional-changelog-ember@^0.3.6: dependencies: q "^1.5.1" +conventional-changelog-ember@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-2.0.2.tgz#284ffdea8c83ea8c210b65c5b4eb3e5cc0f4f51a" + integrity sha512-qtZbA3XefO/n6DDmkYywDYi6wDKNNc98MMl2F9PKSaheJ25Trpi3336W8fDlBhq0X+EJRuseceAdKLEMmuX2tg== + dependencies: + q "^1.5.1" + conventional-changelog-eslint@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz#8bae05ebbf574e6506caf7b37dc51ca21b74d220" @@ -2510,6 +2988,13 @@ conventional-changelog-eslint@^1.0.5: dependencies: q "^1.5.1" +conventional-changelog-eslint@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.2.tgz#e9eb088cda6be3e58b2de6a5aac63df0277f3cbe" + integrity sha512-Yi7tOnxjZLXlCYBHArbIAm8vZ68QUSygFS7PgumPRiEk+9NPUeucy5Wg9AAyKoBprSV3o6P7Oghh4IZSLtKCvQ== + dependencies: + q "^1.5.1" + conventional-changelog-express@^0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.3.4.tgz#812a9cf778677e12f978ac9c40d85297c0bfcca9" @@ -2517,6 +3002,13 @@ conventional-changelog-express@^0.3.4: dependencies: q "^1.5.1" +conventional-changelog-express@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-2.0.1.tgz#fea2231d99a5381b4e6badb0c1c40a41fcacb755" + integrity sha512-G6uCuCaQhLxdb4eEfAIHpcfcJ2+ao3hJkbLrw/jSK/eROeNfnxCJasaWdDAfFkxsbpzvQT4W01iSynU3OoPLIw== + dependencies: + q "^1.5.1" + conventional-changelog-jquery@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz#0208397162e3846986e71273b6c79c5b5f80f510" @@ -2524,6 +3016,13 @@ conventional-changelog-jquery@^0.1.0: dependencies: q "^1.4.1" +conventional-changelog-jquery@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.4.tgz#7eb598467b83db96742178e1e8d68598bffcd7ae" + integrity sha512-IVJGI3MseYoY6eybknnTf9WzeQIKZv7aNTm2KQsiFVJH21bfP2q7XVjfoMibdCg95GmgeFlaygMdeoDDa+ZbEQ== + dependencies: + q "^1.5.1" + conventional-changelog-jscs@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz#0479eb443cc7d72c58bf0bcf0ef1d444a92f0e5c" @@ -2539,11 +3038,24 @@ conventional-changelog-jshint@^0.3.4: compare-func "^1.3.1" q "^1.5.1" +conventional-changelog-jshint@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.1.tgz#11c0e8283abf156a4ff78e89be6fdedf9bd72202" + integrity sha512-kRFJsCOZzPFm2tzRHULWP4tauGMvccOlXYf3zGeuSW4U0mZhk5NsjnRZ7xFWrTFPlCLV+PNmHMuXp5atdoZmEg== + dependencies: + compare-func "^1.3.1" + q "^1.5.1" + conventional-changelog-preset-loader@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz#b29af6332f9313857be36427623c9016bfeeaf33" integrity sha512-yWPIP9wwsCKeUSPYApnApWhKIDjWRIX/uHejGS1tYfEsQR/bwpDFET7LYiHT+ujNbrlf6h1s3NlPGheOd4yJRQ== +conventional-changelog-preset-loader@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4" + integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== + conventional-changelog-writer@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz#705b46a8b8277bd7fd79cad8032095b5d803864c" @@ -2560,7 +3072,23 @@ conventional-changelog-writer@^3.0.4: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.0, conventional-changelog@^1.1.18: +conventional-changelog-writer@^4.0.5: + version "4.0.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" + integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== + dependencies: + compare-func "^1.3.1" + conventional-commits-filter "^2.0.2" + dateformat "^3.0.0" + handlebars "^4.1.0" + json-stringify-safe "^5.0.1" + lodash "^4.2.1" + meow "^4.0.0" + semver "^6.0.0" + split "^1.0.0" + through2 "^3.0.0" + +conventional-changelog@^1.1.0: version "1.1.18" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.18.tgz#ffe28798e4ddef5f6e2f74398e8248bcb233360b" integrity sha512-swf5bqhm7PsY2cw6zxuPy6+rZiiGwEpQnrWki+L+z2oZI53QSYwU4brpljmmWss821AsiwmVL+7V6hP+ER+TBA== @@ -2577,6 +3105,23 @@ conventional-changelog@^1.1.0, conventional-changelog@^1.1.18: conventional-changelog-jshint "^0.3.4" conventional-changelog-preset-loader "^1.1.6" +conventional-changelog@^3.1.8: + version "3.1.8" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.8.tgz#091382b5a0820bf8ec8e75ad2664a3688c31b07d" + integrity sha512-fb3/DOLLrQdNqN0yYn/lT6HcNsAa9A+VTDBqlZBMQcEPPIeJIMI+DBs3yu+eiYOLi22w9oShq3nn/zN6qm1Hmw== + dependencies: + conventional-changelog-angular "^5.0.3" + conventional-changelog-atom "^2.0.1" + conventional-changelog-codemirror "^2.0.1" + conventional-changelog-conventionalcommits "^3.0.2" + conventional-changelog-core "^3.2.2" + conventional-changelog-ember "^2.0.2" + conventional-changelog-eslint "^3.0.2" + conventional-changelog-express "^2.0.1" + conventional-changelog-jquery "^3.0.4" + conventional-changelog-jshint "^2.0.1" + conventional-changelog-preset-loader "^2.1.1" + conventional-commits-filter@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz#77aac065e3de9c1a74b801e8e25c9affb3184f65" @@ -2585,6 +3130,14 @@ conventional-commits-filter@^1.1.5: is-subset "^0.1.1" modify-values "^1.0.0" +conventional-commits-filter@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz#f122f89fbcd5bb81e2af2fcac0254d062d1039c1" + integrity sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ== + dependencies: + lodash.ismatch "^4.4.0" + modify-values "^1.0.0" + conventional-commits-parser@^2.1.0, conventional-commits-parser@^2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz#9ac3a4ab221c0c3c9e9dd2c09ae01e6d1e1dabe0" @@ -2598,6 +3151,19 @@ conventional-commits-parser@^2.1.0, conventional-commits-parser@^2.1.5: through2 "^2.0.0" trim-off-newlines "^1.0.0" +conventional-commits-parser@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" + integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== + dependencies: + JSONStream "^1.0.4" + is-text-path "^2.0.0" + lodash "^4.2.1" + meow "^4.0.0" + split2 "^2.0.0" + through2 "^3.0.0" + trim-off-newlines "^1.0.0" + conventional-github-releaser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/conventional-github-releaser/-/conventional-github-releaser-2.0.0.tgz#eed95c3f5c37b93ecbf2a2ed2fefb9fc26e1d31b" @@ -2615,6 +3181,13 @@ conventional-github-releaser@^2.0.0: semver-regex "^1.0.0" through2 "^2.0.0" +convert-source-map@^1.1.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + convert-source-map@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" @@ -2673,15 +3246,15 @@ cosmiconfig@^2.1.0, cosmiconfig@^2.1.1: parse-json "^2.2.0" require-from-string "^1.1.0" -cosmiconfig@^3.0.1, cosmiconfig@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" - integrity sha512-zedsBhLSbPBms+kE7AH4vHg6JsKDz6epSv2/+5XHs8ILHlgDciSJfSWf8sX9aQ52Jb7KI7VswUTsLpR/G0cr2Q== +cosmiconfig@^5.0.0, cosmiconfig@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== dependencies: + import-fresh "^2.0.0" is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^3.0.0" - require-from-string "^2.0.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" cosmiconfig@^5.0.7: version "5.2.0" @@ -2944,10 +3517,10 @@ d@1: dependencies: es5-ext "^0.10.9" -damerau-levenshtein@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514" - integrity sha1-AxkcQyy27qFou3fzpV/9zLiXhRQ= +damerau-levenshtein@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" + integrity sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA== dargs@^4.0.1: version "4.1.0" @@ -2998,7 +3571,7 @@ debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6. dependencies: ms "2.0.0" -debug@3.1.0, debug@=3.1.0, debug@^3.0.0, debug@^3.0.1, debug@~3.1.0: +debug@3.1.0, debug@=3.1.0, debug@^3.0.1, debug@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== @@ -3012,6 +3585,13 @@ debug@^3.1.0: dependencies: ms "^2.1.1" +debug@^4.0.0, debug@^4.0.1, debug@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + decamelize-keys@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -3072,6 +3652,13 @@ define-properties@^1.1.2: foreach "^2.0.5" object-keys "^1.0.8" +define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -3198,12 +3785,11 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -dir-glob@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" - integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== +dir-glob@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" + integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== dependencies: - arrify "^1.0.1" path-type "^3.0.0" dlv@^1.1.0: @@ -3239,7 +3825,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2, doctrine@^2.1.0: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== @@ -3279,11 +3865,16 @@ domain-browser@^1.1.1: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domelementtype@1, domelementtype@^1.3.0: +domelementtype@1: version "1.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" integrity sha1-sXrtguirWeUt2cGbF1bg/BhyBMI= +domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + domelementtype@~1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" @@ -3351,6 +3942,11 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.30: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.37.tgz#4a92734e0044c8cf0b1553be57eae21a4c6e5fab" integrity sha1-SpJzTgBEyM8LFVO+V+riGkxuX6s= +electron-to-chromium@^1.3.191: + version "1.3.193" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.193.tgz#de9b89959288070bffb14557daf8cf9f75b2caf8" + integrity sha512-WX01CG1UoPtTUFaKKwMn+u8nJ63loP6hNxePWtk1pN8ibWMyX1q6TiWPsz1ABBKXezvmaIdtP+0BwzjC1wyCaw== + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -3369,10 +3965,10 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -emoji-regex@^6.1.0: - version "6.5.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2" - integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ== +emoji-regex@^7.0.1, emoji-regex@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== emojis-list@^2.0.0: version "2.1.0" @@ -3481,7 +4077,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3: +es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.4.3: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -3590,7 +4186,7 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -3617,28 +4213,32 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-airbnb-base@^12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.1.0.tgz#386441e54a12ccd957b0a92564a4bafebd747944" - integrity sha512-/vjm0Px5ZCpmJqnjIzcFb9TKZrKWz0gnuG/7Gfkt0Db1ELJR51xkZth+t14rYdqWgX836XbuxtArbIHlVhbLBA== +eslint-config-airbnb-base@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz#f6ea81459ff4dec2dda200c35f1d8f7419d57943" + integrity sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w== dependencies: - eslint-restricted-globals "^0.1.1" + confusing-browser-globals "^1.0.5" + object.assign "^4.1.0" + object.entries "^1.1.0" -eslint-config-airbnb@^16.1.0: - version "16.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-16.1.0.tgz#2546bfb02cc9fe92284bf1723ccf2e87bc45ca46" - integrity sha512-zLyOhVWhzB/jwbz7IPSbkUuj7X2ox4PHXTcZkEmDqTvd0baJmJyuxlFPDlZOE/Y5bC+HQRaEkT3FoHo9wIdRiw== +eslint-config-airbnb@^17.1.0: + version "17.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz#2272e0b86bb1e2b138cdf88d07a3b6f4cda3d626" + integrity sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg== dependencies: - eslint-config-airbnb-base "^12.1.0" + eslint-config-airbnb-base "^13.2.0" + object.assign "^4.1.0" + object.entries "^1.1.0" -eslint-config-prettier@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" - integrity sha512-ag8YEyBXsm3nmOv1Hz991VtNNDMRa+MNy8cY47Pl4bw6iuzqKbJajXdqUpiw13STdLLrznxgm1hj9NhxeOYq0A== +eslint-config-prettier@^3.0.1: + version "3.6.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-3.6.0.tgz#8ca3ffac4bd6eeef623a0651f9d754900e3ec217" + integrity sha512-ixJ4U3uTLXwJts4rmSVW/lMXjlGwCijhBJHk8iVqKKSifeI0qgFEfWl8L63isfc8Od7EiBALF6BX3jKLluf/jQ== dependencies: - get-stdin "^5.0.1" + get-stdin "^6.0.0" -eslint-import-resolver-node@^0.3.1: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== @@ -3663,74 +4263,116 @@ eslint-import-resolver-webpack@^0.8.3: resolve "^1.2.0" semver "^5.3.0" -eslint-module-utils@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" - integrity sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw== +eslint-module-utils@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" + integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" -eslint-plugin-babel@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.1.2.tgz#79202a0e35757dd92780919b2336f1fa2fe53c1e" - integrity sha1-eSAqDjV1fdkngJGbIzbx+i/lPB4= +eslint-plugin-babel@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" + integrity sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w== + dependencies: + eslint-rule-composer "^0.3.0" eslint-plugin-chai-friendly@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz#9eeb17f92277ba80bb64f0e946c6936a3ae707b4" integrity sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA== -eslint-plugin-cypress@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.2.0.tgz#31f23bec82eb4078711b374af66af3daa9fdbd2e" - integrity sha512-Xk1DMXPfnSChpNhQPw8E9lfRUse9nSyPccxMbKlOuwCmTm2fhyNQWfulDr9DDgUL1Xetdub5lnYQkKniHjNbYw== +eslint-plugin-cypress@^2.2.1: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.6.0.tgz#c726dd1a312cd5234de94765ca79718a14edf0ef" + integrity sha512-/YmvhYFqjFLYw7llDl56U9KW+Z25TZJjDofT47aUnAFRRvOhj1y2nxJzZ1ZTnqBO1ja8gwRhtdT7LfTLg9ANJw== dependencies: - globals "^11.0.1" + globals "^11.12.0" + +eslint-plugin-flowtype@^2.34.1: + version "2.50.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.3.tgz#61379d6dce1d010370acd6681740fd913d68175f" + integrity sha512-X+AoKVOr7Re0ko/yEXyM5SSZ0tazc6ffdIOocp2fFUlWoDt7DV0Bz99mngOkAFLOAWjqRA5jPwqUCbrx13XoxQ== + dependencies: + lodash "^4.17.10" -eslint-plugin-import@^2.8.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz#26002efbfca5989b7288ac047508bd24f217b169" - integrity sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk= +eslint-plugin-import@^2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" + integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== dependencies: - builtin-modules "^1.1.1" + array-includes "^3.0.3" contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.1.1" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" + resolve "^1.11.0" -eslint-plugin-jsx-a11y@^6.0.2: - version "6.0.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.3.tgz#54583d1ae442483162e040e13cc31865465100e5" - integrity sha1-VFg9GuRCSDFi4EDhPMMYZUZRAOU= +eslint-plugin-jest@^21.21.0: + version "21.27.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz#2a795b7c3b5e707df48a953d651042bd01d7b0a8" + integrity sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw== + +eslint-plugin-jsx-a11y@^6.2.3: + version "6.2.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.3.tgz#b872a09d5de51af70a97db1eea7dc933043708aa" + integrity sha512-CawzfGt9w83tyuVekn0GDPU9ytYtxyxyFZ3aSWROmnRRFQFT2BiPJd7jvRdzNDi6oLWaS2asMeYSNMjWTV4eNg== dependencies: - aria-query "^0.7.0" + "@babel/runtime" "^7.4.5" + aria-query "^3.0.0" array-includes "^3.0.3" - ast-types-flow "0.0.7" - axobject-query "^0.1.0" - damerau-levenshtein "^1.0.0" - emoji-regex "^6.1.0" - jsx-ast-utils "^2.0.0" + ast-types-flow "^0.0.7" + axobject-query "^2.0.2" + damerau-levenshtein "^1.0.4" + emoji-regex "^7.0.2" + has "^1.0.3" + jsx-ast-utils "^2.2.1" -eslint-plugin-react@^7.5.1: - version "7.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz#f606c719dbd8a1a2b3d25c16299813878cca0160" - integrity sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA== +eslint-plugin-lodash@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-lodash/-/eslint-plugin-lodash-5.1.0.tgz#f7dc6c14f104cacb169a18d17c27d9c015a53924" + integrity sha512-mMKmf1OMLS8VExtaHCcrwBmsYIiOVYEibnAFDzXrbJdtFGOcLEw37tryN/WGYKBiJy6nAIGC43i5Wh3KA9lO2g== dependencies: - doctrine "^2.0.2" - has "^1.0.1" - jsx-ast-utils "^2.0.1" - prop-types "^15.6.0" + lodash "4.17.11" -eslint-restricted-globals@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7" - integrity sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc= +eslint-plugin-prettier@^2.6.2: + version "2.7.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.7.0.tgz#b4312dcf2c1d965379d7f9d5b5f8aaadc6a45904" + integrity sha512-CStQYJgALoQBw3FsBzH0VOVDRnJ/ZimUlpLm226U8qgqYJfPOY/CPK6wyRInMxh73HSKg5wyRwdS4BVYYHwokA== + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + +eslint-plugin-react-hooks@^1.6.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.1.tgz#3c66a5515ea3e0a221ffc5d4e75c971c217b1a4c" + integrity sha512-wHhmGJyVuijnYIJXZJHDUF2WM+rJYTjulUTqF9k61d3BTk8etydz+M4dXUVH7M76ZRS85rqBTCx0Es/lLsrjnA== + +eslint-plugin-react@^7.8.2: + version "7.14.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.14.2.tgz#94c193cc77a899ac0ecbb2766fbef88685b7ecc1" + integrity sha512-jZdnKe3ip7FQOdjxks9XPN0pjUKZYq48OggNMd16Sk+8VXx6JOvXmlElxROCgp7tiUsTsze3jd78s/9AFJP2mA== + dependencies: + array-includes "^3.0.3" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.1.0" + object.entries "^1.1.0" + object.fromentries "^2.0.0" + object.values "^1.1.0" + prop-types "^15.7.2" + resolve "^1.10.1" + +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" + integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" @@ -3745,7 +4387,7 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^4.0.0, eslint@^4.12.1, eslint@^4.5.0: +eslint@^4.0.0, eslint@^4.5.0: version "4.18.2" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" integrity sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw== @@ -3788,7 +4430,51 @@ eslint@^4.0.0, eslint@^4.12.1, eslint@^4.5.0: table "4.0.2" text-table "~0.2.0" -espree@^3.5.2: +eslint@^4.19.1: + version "4.19.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" + integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.4" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^1.0.1" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "4.0.2" + text-table "~0.2.0" + +espree@^3.5.2, espree@^3.5.4: version "3.5.4" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== @@ -3891,10 +4577,10 @@ execa@0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= +execa@0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" + integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -3904,10 +4590,10 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" - integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -4129,6 +4815,23 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-diff@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^2.2.6: + version "2.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" + integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.1.2" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.3" + micromatch "^3.1.10" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -4201,6 +4904,13 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +file-entry-cache@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-4.0.0.tgz#633567d15364aefe0b299e1e217735e8f3a9f6e8" + integrity sha512-AVSwsnbV8vH/UVbvgEhf3saVQXORNv0ZzSkvkhQIaia5Tia+JhGTaa/ePUSVoPHQyGayQNmYfkzFi3WZV5zcpA== + dependencies: + flat-cache "^2.0.1" + file-loader@^1.1.5: version "1.1.11" resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.11.tgz#6fe886449b0f2a936e43cabaac0cdbfb369506f8" @@ -4275,11 +4985,6 @@ find-cache-dir@^1.0.0: make-dir "^1.0.0" pkg-dir "^2.0.0" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= - find-root@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/find-root/-/find-root-0.1.2.tgz#98d2267cff1916ccaf2743b3a0eea81d79d7dcd1" @@ -4307,6 +5012,14 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" @@ -4317,6 +5030,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + flatted@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" @@ -4327,6 +5049,11 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= +fn-name@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" + integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= + follow-redirects@1.5.10: version "1.5.10" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" @@ -4471,6 +5198,15 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +g-status@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/g-status/-/g-status-2.0.2.tgz#270fd32119e8fc9496f066fe5fe88e0a6bc78b97" + integrity sha512-kQoE9qH+T1AHKgSSD0Hkv98bobE90ILQcXAF4wvGgsr7uFqNvwmh8j+Lq3l0RVt3E3HjSbv2B9biEGcEtpHLCA== + dependencies: + arrify "^1.0.1" + matcher "^1.0.0" + simple-git "^1.85.0" + gather-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gather-stream/-/gather-stream-1.0.0.tgz#b33994af457a8115700d410f317733cbe7a0904b" @@ -4507,10 +5243,10 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= -get-own-enumerable-property-symbols@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" - integrity sha512-TtY/sbOemiMKPRUDDanGCSgBYe7Mf0vbRsWnBZ+9yghpZ1MvcpSpuZFjHdEeY/LZjZy0vdLjS77L6HosisFiug== +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== get-pkg-repo@^1.0.0: version "1.4.0" @@ -4523,16 +5259,21 @@ get-pkg-repo@^1.0.0: parse-github-repo-url "^1.3.0" through2 "^2.0.0" -get-stdin@5.0.1, get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - integrity sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g= +get-stdin@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" + integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + integrity sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g= + get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" @@ -4577,6 +5318,17 @@ gh-got@^6.0.0: got "^7.0.0" is-plain-obj "^1.1.0" +git-raw-commits@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.0.tgz#d92addf74440c14bcc5c83ecce3fb7f8a79118b5" + integrity sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg== + dependencies: + dargs "^4.0.1" + lodash.template "^4.0.2" + meow "^4.0.0" + split2 "^2.0.0" + through2 "^2.0.0" + git-raw-commits@^1.3.0, git-raw-commits@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.4.tgz#442c3df5985b4f5689e9e43597f5194736aac001" @@ -4604,6 +5356,14 @@ git-semver-tags@^1.0.0, git-semver-tags@^1.3.4: meow "^4.0.0" semver "^5.5.0" +git-semver-tags@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3" + integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w== + dependencies: + meow "^4.0.0" + semver "^5.5.0" + gitconfiglocal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" @@ -4634,6 +5394,11 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= + glob@7.1.2, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.1: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -4668,6 +5433,18 @@ glob@^6.0.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@~7.0.6: version "7.0.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a" @@ -4680,13 +5457,29 @@ glob@~7.0.6: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^0.1.0: +global-dirs@^0.1.0, global-dirs@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= dependencies: ini "^1.3.4" +global-modules@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" + integrity sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A== + dependencies: + global-prefix "^3.0.0" + +global-prefix@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-3.0.0.tgz#fc85f73064df69f50421f47f883fe5b913ba9b97" + integrity sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg== + dependencies: + ini "^1.3.5" + kind-of "^6.0.2" + which "^1.3.1" + global@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" @@ -4700,6 +5493,11 @@ globals@^11.0.1, globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" integrity sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw== +globals@^11.12.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -4728,17 +5526,19 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" - integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA= - dependencies: - array-union "^1.0.1" - dir-glob "^2.0.0" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" +globby@^9.0.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" + integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== + dependencies: + "@types/glob" "^7.1.1" + array-union "^1.0.2" + dir-glob "^2.2.2" + fast-glob "^2.2.6" + glob "^7.1.3" + ignore "^4.0.3" + pify "^4.0.1" + slash "^2.0.0" globjoin@^0.1.4: version "0.1.4" @@ -4754,7 +5554,7 @@ globule@^1.0.0: lodash "~4.17.4" minimatch "~3.0.2" -gonzales-pe@^4.0.3, gonzales-pe@^4.2.3: +gonzales-pe@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.2.3.tgz#41091703625433285e0aee3aa47829fc1fbeb6f2" integrity sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw== @@ -4809,7 +5609,7 @@ handle-thing@^1.2.5: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" integrity sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ= -handlebars@^4.0.1, handlebars@^4.0.2: +handlebars@^4.0.1, handlebars@^4.0.2, handlebars@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== @@ -5050,17 +5850,17 @@ html-tags@^2.0.0: resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-2.0.0.tgz#10b30a386085f43cede353cc8fa7cb0deeea668b" integrity sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos= -htmlparser2@^3.9.2: - version "3.9.2" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" - integrity sha1-G9+HrMoPP55T+k/M6w9LTLsAszg= +htmlparser2@^3.10.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== dependencies: - domelementtype "^1.3.0" + domelementtype "^1.3.1" domhandler "^2.3.0" domutils "^1.5.1" entities "^1.1.1" inherits "^2.0.1" - readable-stream "^2.0.2" + readable-stream "^3.1.1" http-deceiver@^1.2.7: version "1.2.7" @@ -5180,11 +5980,21 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.2.7, ignore@^3.3.3, ignore@^3.3.5: +ignore@^3.2.7, ignore@^3.3.3: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" integrity sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA== +ignore@^4.0.3: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +ignore@^5.0.4: + version "5.1.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.2.tgz#e28e584d43ad7e92f96995019cc43b9e1ac49558" + integrity sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -5193,6 +6003,19 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-lazy@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-3.1.0.tgz#891279202c8a2280fdbd6674dbd8da1a1dfc67cc" + integrity sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ== + import-local@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" @@ -5251,7 +6074,7 @@ inherits@2.0.1: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: +ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -5367,12 +6190,12 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.1.4, is-buffer@^1.1.5: +is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-buffer@^2.0.2: +is-buffer@^2.0.0, is-buffer@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== @@ -5576,12 +6399,12 @@ is-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" integrity sha1-iVJojF7C/9awPsyF52ngKQMINHA= -is-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" - integrity sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI= +is-observable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== dependencies: - symbol-observable "^0.2.2" + symbol-observable "^1.1.0" is-odd@^2.0.0: version "2.0.0" @@ -5706,6 +6529,13 @@ is-text-path@^1.0.0: dependencies: text-extensions "^1.0.0" +is-text-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" + integrity sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw== + dependencies: + text-extensions "^2.0.0" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -5851,20 +6681,10 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -jest-get-type@^21.2.0: +jest-docblock@^21.0.0: version "21.2.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" - integrity sha512-y2fFw3C+D0yjNSDp7ab1kcd6NUYfy3waPTlD8yWkAtiocJdBRQqNoRqVfMNxgj+IjT0V5cBIHJO0z9vuSSZ43Q== - -jest-validate@^21.1.0: - version "21.2.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" - integrity sha512-k4HLI1rZQjlU+EC682RlQ6oZvLrE5SCh3brseQc24vbZTxzT/k/3urar5QMCVgjadmSO7lECeGdc6YxnM3yEGg== - dependencies: - chalk "^2.0.1" - jest-get-type "^21.2.0" - leven "^2.1.0" - pretty-format "^21.2.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + integrity sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw== joi@^13.0.0: version "13.7.0" @@ -5885,7 +6705,12 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.9.0, js-yaml@^3.9.1: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.9.1: version "3.11.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" integrity sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw== @@ -5893,7 +6718,7 @@ js-yaml@3.x, js-yaml@^3.4.3, js-yaml@^3.9.0, js-yaml@^3.9.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.13.0: +js-yaml@^3.13.0, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -5974,6 +6799,13 @@ json5@^0.5.0, json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -6013,12 +6845,13 @@ jsuri@^1.3.1: resolved "https://registry.yarnpkg.com/jsuri/-/jsuri-1.3.1.tgz#cd93fc6a87b255142cb7b0f479f00517ab9395ed" integrity sha1-zZP8aoeyVRQst7D0efAFF6uTle0= -jsx-ast-utils@^2.0.0, jsx-ast-utils@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" - integrity sha1-6AGxs5mF4g//yHtA43SAgOLcrH8= +jsx-ast-utils@^2.1.0, jsx-ast-utils@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz#4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb" + integrity sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ== dependencies: array-includes "^3.0.3" + object.assign "^4.1.0" just-extend@^4.0.2: version "4.0.2" @@ -6202,10 +7035,10 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" -known-css-properties@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.5.0.tgz#6ff66943ed4a5b55657ee095779a91f4536f8084" - integrity sha512-LOS0CoS8zcZnB1EjLw4LLqDXw8nvt3AGH5dXLQP3D9O1nLLA+9GC5GnPl5mmF+JiQAtSX4VyZC7KvEtcA4kUtA== +known-css-properties@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.11.0.tgz#0da784f115ea77c76b81536d7052e90ee6c86a8a" + integrity sha512-bEZlJzXo5V/ApNNa5z375mJC6Nrz4vG43UgcSCrg2OHC+yuB6j0iDSrY7RQ/+PRofFB03wNIIt9iXIVLr4wc7w== last-call-webpack-plugin@^2.1.2: version "2.1.2" @@ -6245,30 +7078,35 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-5.0.0.tgz#f1c670e03e2fdf3f3d0eb81f72d3bcf658770e54" - integrity sha512-nKwjLlYOd6Eqog3cg3aDulrRfLkR3GPasqTI7+3ZKucLATqay86wOaEM0gtYVmTS0/ihHSARnOWduAqNJZAbeQ== +lint-staged@^8.0.4: + version "8.2.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.1.tgz#752fcf222d9d28f323a3b80f1e668f3654ff221f" + integrity sha512-n0tDGR/rTCgQNwXnUf/eWIpPNddGWxC32ANTNYsj2k02iZb7Cz5ox2tytwBu+2r0zDXMEMKw7Y9OD/qsav561A== dependencies: - app-root-path "^2.0.0" - chalk "^2.1.0" - commander "^2.11.0" - cosmiconfig "^3.1.0" + chalk "^2.3.1" + commander "^2.14.1" + cosmiconfig "^5.2.0" + debug "^3.1.0" dedent "^0.7.0" - execa "^0.8.0" - find-parent-dir "^0.3.0" + del "^3.0.0" + execa "^1.0.0" + g-status "^2.0.2" is-glob "^4.0.0" - jest-validate "^21.1.0" - listr "^0.13.0" - lodash "^4.17.4" - log-symbols "^2.0.0" - minimatch "^3.0.0" + is-windows "^1.0.2" + listr "^0.14.2" + listr-update-renderer "^0.5.0" + lodash "^4.17.11" + log-symbols "^2.2.0" + micromatch "^3.1.8" npm-which "^3.0.1" p-map "^1.1.1" path-is-inside "^1.0.2" pify "^3.0.0" - staged-git-files "0.0.4" - stringify-object "^3.2.0" + please-upgrade-node "^3.0.2" + staged-git-files "1.1.2" + string-argv "^0.0.2" + stringify-object "^3.2.2" + yup "^0.27.0" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -6289,10 +7127,10 @@ listr-update-renderer@^0.2.0: log-update "^1.0.2" strip-ansi "^3.0.1" -listr-update-renderer@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" - integrity sha1-NE2YDaLKLosUW6MFkI8yrj9MyKc= +listr-update-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" + integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -6300,7 +7138,7 @@ listr-update-renderer@^0.4.0: figures "^1.7.0" indent-string "^3.0.0" log-symbols "^1.0.2" - log-update "^1.0.2" + log-update "^2.3.0" strip-ansi "^3.0.1" listr-verbose-renderer@^0.4.0: @@ -6313,6 +7151,16 @@ listr-verbose-renderer@^0.4.0: date-fns "^1.27.2" figures "^1.7.0" +listr-verbose-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" + integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== + dependencies: + chalk "^2.4.1" + cli-cursor "^2.1.0" + date-fns "^1.27.2" + figures "^2.0.0" + listr@0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" @@ -6335,28 +7183,20 @@ listr@0.12.0: stream-to-observable "^0.1.0" strip-ansi "^3.0.1" -listr@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" - integrity sha1-ILsLowuuZg7oTMBQPfS+PVYjiH0= +listr@^0.14.2: + version "0.14.3" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" + integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - figures "^1.7.0" - indent-string "^2.1.0" - is-observable "^0.2.0" + "@samverschueren/stream-to-observable" "^0.3.0" + is-observable "^1.1.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.4.0" - listr-verbose-renderer "^0.4.0" - log-symbols "^1.0.2" - log-update "^1.0.2" - ora "^0.2.3" - p-map "^1.1.1" - rxjs "^5.4.2" - stream-to-observable "^0.2.0" - strip-ansi "^3.0.1" + listr-update-renderer "^0.5.0" + listr-verbose-renderer "^0.5.0" + p-map "^2.0.0" + rxjs "^6.3.3" load-json-file@^1.0.0: version "1.1.0" @@ -6419,6 +7259,13 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + lodash._baseget@^3.0.0: version "3.7.2" resolved "https://registry.yarnpkg.com/lodash._baseget/-/lodash._baseget-3.7.2.tgz#1b6ae1d5facf3c25532350a13c1197cb8bb674f4" @@ -6441,7 +7288,7 @@ lodash.assign@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= -lodash.camelcase@4.3.0, lodash.camelcase@^4.3.0: +lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= @@ -6474,61 +7321,31 @@ lodash.isarray@^3.0.0: resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U= -lodash.kebabcase@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" - integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= +lodash.ismatch@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" + integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.merge@4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" - integrity sha1-aYhLoUSsM/5plzemCG3v+t0PicU= - lodash.merge@^4.0.2, lodash.merge@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== -lodash.mergewith@4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55" - integrity sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU= - lodash.mergewith@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ== -lodash.omit@4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.omit/-/lodash.omit-4.5.0.tgz#6eb19ae5a1ee1dd9df0b969e66ce0b7fa30b5e60" - integrity sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA= - lodash.once@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash.pick@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" - integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= - -lodash.snakecase@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" - integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= - -lodash.startcase@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" - integrity sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg= - lodash.tail@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" @@ -6549,11 +7366,6 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash.topairs@4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.topairs/-/lodash.topairs-4.3.0.tgz#3b6deaa37d60fb116713c46c5f17ea190ec48d64" - integrity sha1-O23qo31g+xFnE8RsXxfqGQ7EjWQ= - lodash.unescape@4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" @@ -6564,16 +7376,16 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash.upperfirst@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" - integrity sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984= - lodash@4.17.11, lodash@^4.14.0, lodash@^4.17.0, lodash@^4.17.11, lodash@^4.17.2: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== +lodash@4.17.14, lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.14: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== + lodash@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" @@ -6584,7 +7396,7 @@ lodash@^4, lodash@^4.0.0, lodash@^4.0.1, lodash@^4.17.4, lodash@^4.17.5, lodash@ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" integrity sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw== -log-symbols@2.2.0, log-symbols@^2.0.0, log-symbols@^2.1.0: +log-symbols@2.2.0, log-symbols@^2.0.0, log-symbols@^2.1.0, log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== @@ -6606,6 +7418,15 @@ log-update@^1.0.2: ansi-escapes "^1.0.0" cli-cursor "^1.0.2" +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= + dependencies: + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" + log4js@^3.0.0: version "3.0.6" resolved "https://registry.yarnpkg.com/log4js/-/log4js-3.0.6.tgz#e6caced94967eeeb9ce399f9f8682a4b2b28c8ff" @@ -6665,6 +7486,13 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.0, loose-envify@^1.3 dependencies: js-tokens "^3.0.0" +loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + loud-rejection@^1.0.0, loud-rejection@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" @@ -6737,6 +7565,13 @@ markdown-table@^1.1.0: resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.1.tgz#4b3dd3a133d1518b8ef0dbc709bf2a1b4824bc8c" integrity sha1-Sz3ToTPRUYuO8NvHCb8qG0gkvIw= +matcher@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2" + integrity sha512-+BmqxWIubKTRKNWx/ahnCkk3mG8m7OturVlqq6HiojGJTd5hVYbgZm6WzcYPCoB+KBT4Vd6R7WSRG2OADNaCjg== + dependencies: + escape-string-regexp "^1.0.4" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" @@ -6793,7 +7628,22 @@ memorystream@^0.3.1: resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= -meow@3.7.0, meow@^3.3.0, meow@^3.7.0: +meow@5.0.0, meow@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" + integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== + dependencies: + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist-options "^3.0.1" + normalize-package-data "^2.3.4" + read-pkg-up "^3.0.0" + redent "^2.0.0" + trim-newlines "^2.0.0" + yargs-parser "^10.0.0" + +meow@^3.3.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= @@ -6829,6 +7679,11 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + merge@1.2.1, merge@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" @@ -6874,6 +7729,25 @@ micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.9" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" @@ -6967,7 +7841,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -7264,6 +8138,13 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" +node-releases@^1.1.25: + version "1.1.25" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" + integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== + dependencies: + semver "^5.3.0" + node-sass@4.9.3: version "4.9.3" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.3.tgz#f407cf3d66f78308bb1e346b24fa428703196224" @@ -7473,6 +8354,26 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" +object.entries@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" + integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +object.fromentries@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" + integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.11.0" + function-bind "^1.1.1" + has "^1.0.1" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -7488,6 +8389,16 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + obuf@^1.0.0, obuf@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" @@ -7637,7 +8548,7 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== @@ -7658,11 +8569,23 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== +p-map@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== + p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" @@ -7685,6 +8608,13 @@ pako@~1.0.5: resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" integrity sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg== +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" @@ -7708,6 +8638,18 @@ parse-entities@^1.0.2: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^1.1.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50" + integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg== + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -7730,13 +8672,6 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" - integrity sha1-+m9HsY4jgm6tMvJj50TQ4ehH+xM= - dependencies: - error-ex "^1.3.1" - parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -7791,6 +8726,11 @@ path-exists@^3.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -7811,6 +8751,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -7902,6 +8847,11 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= +pify@^4.0.0, pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -7914,13 +8864,6 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= - dependencies: - find-up "^1.0.0" - pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -7935,7 +8878,7 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -please-upgrade-node@^3.1.1: +please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== @@ -8031,21 +8974,26 @@ postcss-filter-plugins@^2.0.0: postcss "^5.0.4" uniqid "^4.0.0" -postcss-html@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/postcss-html/-/postcss-html-0.12.0.tgz#39b6adb4005dfc5464df7999c0f81c95bced7e50" - integrity sha512-KxKUpj7AY7nlCbLcTOYxdfJnGE7QFAfU2n95ADj1Q90RM/pOLdz8k3n4avOyRFs7MDQHcRzJQWM1dehCwJxisQ== +postcss-html@^0.36.0: + version "0.36.0" + resolved "https://registry.yarnpkg.com/postcss-html/-/postcss-html-0.36.0.tgz#b40913f94eaacc2453fd30a1327ad6ee1f88b204" + integrity sha512-HeiOxGcuwID0AFsNAL0ox3mW6MHH5cstWN1Z3Y+n6H+g12ih7LHdYxWwEA/QmrebctLjo79xz9ouK3MroHwOJw== dependencies: - htmlparser2 "^3.9.2" - remark "^8.0.0" - unist-util-find-all-after "^1.0.1" + htmlparser2 "^3.10.0" -postcss-less@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-1.1.3.tgz#6930525271bfe38d5793d33ac09c1a546b87bb51" - integrity sha512-WS0wsQxRm+kmN8wEYAGZ3t4lnoNfoyx9EJZrhiPR1K0lMHR0UNWnz52Ya5QRXChHtY75Ef+kDc05FpnBujebgw== +postcss-jsx@^0.36.0: + version "0.36.1" + resolved "https://registry.yarnpkg.com/postcss-jsx/-/postcss-jsx-0.36.1.tgz#ab5e469e7449b84bd1a5973ff555fbe84c39f91d" + integrity sha512-xaZpy01YR7ijsFUtu5rViYCFHurFIPHir+faiOQp8g/NfTfWqZCKDhKrydQZ4d8WlSAmVdXGwLjpFbsNUI26Sw== dependencies: - postcss "^5.2.16" + "@babel/core" ">=7.2.2" + +postcss-less@^3.1.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/postcss-less/-/postcss-less-3.1.4.tgz#369f58642b5928ef898ffbc1a6e93c958304c5ad" + integrity sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA== + dependencies: + postcss "^7.0.14" postcss-load-config@^1.2.0: version "1.2.0" @@ -8083,6 +9031,14 @@ postcss-loader@^2.0.9: postcss-load-config "^1.2.0" schema-utils "^0.4.0" +postcss-markdown@^0.36.0: + version "0.36.0" + resolved "https://registry.yarnpkg.com/postcss-markdown/-/postcss-markdown-0.36.0.tgz#7f22849ae0e3db18820b7b0d5e7833f13a447560" + integrity sha512-rl7fs1r/LNSB2bWRhyZ+lM/0bwKv9fhl38/06gF6mKMo/NPnp55+K1dSTosSVjFZc0e1ppBlu+WT91ba0PMBfQ== + dependencies: + remark "^10.0.1" + unist-util-find-all-after "^1.0.2" + postcss-media-query-parser@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244" @@ -8237,35 +9193,27 @@ postcss-reduce-transforms@^1.0.3: postcss "^5.0.8" postcss-value-parser "^3.0.1" -postcss-reporter@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/postcss-reporter/-/postcss-reporter-5.0.0.tgz#a14177fd1342829d291653f2786efd67110332c3" - integrity sha512-rBkDbaHAu5uywbCR2XE8a25tats3xSOsGNx6mppK6Q9kSFGKc/FyAzfci+fWM2l+K402p1D0pNcfDGxeje5IKg== +postcss-reporter@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/postcss-reporter/-/postcss-reporter-6.0.1.tgz#7c055120060a97c8837b4e48215661aafb74245f" + integrity sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw== dependencies: - chalk "^2.0.1" - lodash "^4.17.4" - log-symbols "^2.0.0" - postcss "^6.0.8" + chalk "^2.4.1" + lodash "^4.17.11" + log-symbols "^2.2.0" + postcss "^7.0.7" postcss-resolve-nested-selector@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz#29ccbc7c37dedfac304e9fff0bf1596b3f6a0e4e" integrity sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4= -postcss-safe-parser@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-3.0.1.tgz#b753eff6c7c0aea5e8375fbe4cde8bf9063ff142" - integrity sha1-t1Pv9sfArqXoN1++TN6L+QY/8UI= - dependencies: - postcss "^6.0.6" - -postcss-sass@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/postcss-sass/-/postcss-sass-0.2.0.tgz#e55516441e9526ba4b380a730d3a02e9eaa78c7a" - integrity sha512-cUmYzkP747fPCQE6d+CH2l1L4VSyIlAzZsok3HPjb5Gzsq3jE+VjpAdGlPsnQ310WKWI42sw+ar0UNN59/f3hg== +postcss-safe-parser@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-4.0.1.tgz#8756d9e4c36fdce2c72b091bbc8ca176ab1fcdea" + integrity sha512-xZsFA3uX8MO3yAda03QrG3/Eg1LN3EPfjjf07vke/46HERLZyHrTsQ9E1r1w1W//fWEhtYNndo2hQplN2cVpCQ== dependencies: - gonzales-pe "^4.0.3" - postcss "^6.0.6" + postcss "^7.0.0" postcss-sass@^0.3.0: version "0.3.0" @@ -8275,12 +9223,20 @@ postcss-sass@^0.3.0: gonzales-pe "^4.2.3" postcss "^6.0.16" -postcss-scss@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-1.0.4.tgz#6310fe1a15be418707a2cfd77f21dd4a06d1e09d" - integrity sha512-IFj42Hz2cBHHFvZTqkJqU08JCCM/MZU5/uNkTUZBaBFP2d4C5unw4HyCL52RfCwJb6KoVUD3eoepxMh1dfBFCQ== +postcss-sass@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/postcss-sass/-/postcss-sass-0.3.5.tgz#6d3e39f101a53d2efa091f953493116d32beb68c" + integrity sha512-B5z2Kob4xBxFjcufFnhQ2HqJQ2y/Zs/ic5EZbCywCkxKd756Q40cIQ/veRDwSrw1BF6+4wUgmpm0sBASqVi65A== dependencies: - postcss "^6.0.19" + gonzales-pe "^4.2.3" + postcss "^7.0.1" + +postcss-scss@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-2.0.0.tgz#248b0a28af77ea7b32b1011aba0f738bda27dea1" + integrity sha512-um9zdGKaDZirMm+kZFKKVsnKPF7zF7qBAtIfTSnZXD1jZ0JNZIxdB6TxQOjCnlSzLRInVl2v3YdBh/M881C4ug== + dependencies: + postcss "^7.0.0" postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: version "2.2.3" @@ -8300,13 +9256,13 @@ postcss-selector-parser@^3.1.0, postcss-selector-parser@^3.1.1: indexes-of "^1.0.1" uniq "^1.0.1" -postcss-sorting@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-3.1.0.tgz#af7c90ee73ad12569a57664eaf06735c2e25bec0" - integrity sha512-YCPTcJwGIInF1LpMD1lIYvMHTGUL4s97o/OraA6eKvoauhhk6vjwOWDDjm6uRKqug/kyDPMKEzmYZ6FtW6RDgw== +postcss-sorting@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-4.1.0.tgz#a107f0bf3852977fa64e4442bc340c88d5aacdb3" + integrity sha512-r4T2oQd1giURJdHQ/RMb72dKZCuLOdWx2B/XhXN1Y1ZdnwXsKH896Qz6vD4tFy9xSjpKNYhlZoJmWyhH/7JUQw== dependencies: lodash "^4.17.4" - postcss "^6.0.13" + postcss "^7.0.0" postcss-svgo@^2.1.1: version "2.1.6" @@ -8318,6 +9274,11 @@ postcss-svgo@^2.1.1: postcss-value-parser "^3.2.3" svgo "^0.7.0" +postcss-syntax@^0.36.2: + version "0.36.2" + resolved "https://registry.yarnpkg.com/postcss-syntax/-/postcss-syntax-0.36.2.tgz#f08578c7d95834574e5593a82dfbfa8afae3b51c" + integrity sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w== + postcss-unique-selectors@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" @@ -8332,6 +9293,11 @@ postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^ resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15" integrity sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU= +postcss-value-parser@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz#99a983d365f7b2ad8d0f9b8c3094926eab4b936d" + integrity sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ== + postcss-zindex@^2.0.1: version "2.2.0" resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" @@ -8351,7 +9317,7 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 source-map "^0.5.6" supports-color "^3.2.3" -postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.13, postcss@^6.0.14, postcss@^6.0.16, postcss@^6.0.17, postcss@^6.0.19, postcss@^6.0.6, postcss@^6.0.8: +postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.16, postcss@^6.0.17: version "6.0.19" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.19.tgz#76a78386f670b9d9494a655bf23ac012effd1555" integrity sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg== @@ -8360,6 +9326,15 @@ postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.13, postcss@^6.0.1 source-map "^0.6.1" supports-color "^5.2.0" +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.13, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.7: + version "7.0.17" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.17.tgz#4da1bdff5322d4a0acaab4d87f3e782436bad31f" + integrity sha512-546ZowA+KZ3OasvQZHsbuEpysvwTZNGJv9EfyCQdsIDltPSWHAeTQ5fQy/Npi2ZDtLI3zs7Ps/p6wThErhm9fQ== + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -8417,19 +9392,16 @@ prettier-eslint@^8.5.0: typescript "^2.5.1" typescript-eslint-parser "^11.0.0" -prettier@^1.7.0, prettier@^1.8.2: +prettier@^1.14.2: + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== + +prettier@^1.7.0: version "1.11.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" integrity sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw== -pretty-format@^21.2.1: - version "21.2.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" - integrity sha512-ZdWPGYAnYfcVP8yKA3zFjCn8s4/17TeYH28MXuC8vTp0o21eXjbFGcOAXZEaDaOFJjc3h2qa7HQNHNshhvoh2A== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - pretty-format@^22.0.3: version "22.4.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.0.tgz#237b1f7e1c50ed03bc65c03ccc29d7c8bb7beb94" @@ -8492,11 +9464,32 @@ prop-types@^15.6.2: loose-envify "^1.3.1" object-assign "^4.1.1" +prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +properties-parser@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/properties-parser/-/properties-parser-0.3.1.tgz#1316e9539ffbfd93845e369b211022abd478771a" + integrity sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo= + dependencies: + string.prototype.codepointat "^0.2.0" + properties@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/properties/-/properties-1.2.1.tgz#0ee97a7fc020b1a2a55b8659eda4aa8d869094bd" integrity sha1-Dul6f8AgsaKlW4ZZ7aSqjYaQlL0= +property-expr@^1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-1.5.1.tgz#22e8706894a0c8e28d58735804f6ba3a3673314f" + integrity sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g== + proxy-addr@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.3.tgz#355f262505a621646b3130a728eb647e22055341" @@ -8670,6 +9663,11 @@ react-dom@^16.7.0: prop-types "^15.6.2" scheduler "^0.12.0" +react-is@^16.8.1: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + react-virtualized@^9.13.0: version "9.18.5" resolved "https://registry.yarnpkg.com/react-virtualized/-/react-virtualized-9.18.5.tgz#42dd390ebaa7ea809bfcaf775d39872641679b89" @@ -8758,6 +9756,15 @@ read-pkg@^4.0.1: parse-json "^4.0.0" pify "^3.0.0" +"readable-stream@2 || 3", readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.3.3: version "2.3.5" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" @@ -8841,6 +9848,11 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== +regenerator-runtime@^0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" + integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + regenerator-transform@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" @@ -8865,6 +9877,11 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" + integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== + regexpu-core@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" @@ -8895,10 +9912,10 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" -remark-parse@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-4.0.0.tgz#99f1f049afac80382366e2e0d0bd55429dd45d8b" - integrity sha512-XZgICP2gJ1MHU7+vQaRM+VA9HEL3X253uwUM/BGgx3iv6TH2B3bF3B8q00DKcyP9YrJV+/7WOWEWBFF/u8cIsw== +remark-parse@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-6.0.3.tgz#c99131052809da482108413f87b0ee7f52180a3a" + integrity sha512-QbDXWN4HfKTUC0hHa4teU463KclLAnwpn/FBn87j9cKYJWWawbiLgMfP2Q4XwhxxuuuOxHlw+pSN0OKuJwyVvg== dependencies: collapse-white-space "^1.0.2" is-alphabetical "^1.0.0" @@ -8906,7 +9923,7 @@ remark-parse@^4.0.0: is-whitespace-character "^1.0.0" is-word-character "^1.0.0" markdown-escapes "^1.0.0" - parse-entities "^1.0.2" + parse-entities "^1.1.0" repeat-string "^1.5.4" state-toggle "^1.0.0" trim "0.0.1" @@ -8916,10 +9933,10 @@ remark-parse@^4.0.0: vfile-location "^2.0.0" xtend "^4.0.1" -remark-stringify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-4.0.0.tgz#4431884c0418f112da44991b4e356cfe37facd87" - integrity sha512-xLuyKTnuQer3ke9hkU38SUYLiTmS078QOnoFavztmbt/pAJtNSkNtFgR0U//uCcmG0qnyxao+PDuatQav46F1w== +remark-stringify@^6.0.0: + version "6.0.4" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-6.0.4.tgz#16ac229d4d1593249018663c7bddf28aafc4e088" + integrity sha512-eRWGdEPMVudijE/psbIDNcnJLRVx3xhfuEsTDGgH4GsFF91dVhw5nhmnBppafJ7+NWINW6C7ZwWbi30ImJzqWg== dependencies: ccount "^1.0.0" is-alphanumeric "^1.0.0" @@ -8936,14 +9953,14 @@ remark-stringify@^4.0.0: unherit "^1.0.4" xtend "^4.0.1" -remark@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-8.0.0.tgz#287b6df2fe1190e263c1d15e486d3fa835594d6d" - integrity sha512-K0PTsaZvJlXTl9DN6qYlvjTkqSZBFELhROZMrblm2rB+085flN84nz4g/BscKRMqDvhzlK1oQ/xnWQumdeNZYw== +remark@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/remark/-/remark-10.0.1.tgz#3058076dc41781bf505d8978c291485fe47667df" + integrity sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ== dependencies: - remark-parse "^4.0.0" - remark-stringify "^4.0.0" - unified "^6.0.0" + remark-parse "^6.0.0" + remark-stringify "^6.0.0" + unified "^7.0.0" remove-trailing-separator@^1.0.1: version "1.1.0" @@ -9081,11 +10098,6 @@ require-from-string@^1.1.0: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= -require-from-string@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" - integrity sha1-xUUjPp19pmFunVmt+zn8n1iGdv8= - require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" @@ -9121,10 +10133,10 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" -resolve-from@4.0.0, resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve-from@5.0.0, resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve-from@^1.0.0: version "1.0.1" @@ -9136,12 +10148,17 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= -resolve-global@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-0.1.0.tgz#8fb02cfd5b7db20118e886311f15af95bd15fbd9" - integrity sha1-j7As/Vt9sgEY6IYxHxWvlb0V+9k= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-global@1.0.0, resolve-global@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-global/-/resolve-global-1.0.0.tgz#a2a79df4af2ca3f49bf77ef9ddacd322dad19255" + integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== dependencies: - global-dirs "^0.1.0" + global-dirs "^0.1.1" resolve-url@^0.2.1: version "0.2.1" @@ -9153,6 +10170,13 @@ resolve@1.1.x: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= +resolve@^1.10.1, resolve@^1.11.0, resolve@^1.3.2: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== + dependencies: + path-parse "^1.0.6" + resolve@^1.2.0, resolve@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" @@ -9200,6 +10224,13 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.6.0, rimraf@^2.6.1: dependencies: glob "^7.0.5" +rimraf@2.6.3, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" @@ -9244,13 +10275,20 @@ rxjs@^5.0.0-beta.11: dependencies: symbol-observable "1.0.1" -rxjs@^5.3.0, rxjs@^5.4.2: +rxjs@^5.3.0: version "5.5.6" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" integrity sha512-v4Q5HDC0FHAQ7zcBX7T2IL6O5ltl1a2GX4ENjPXg6SjDY69Cmx9v4113C99a4wGF16ClPv5Z8mghuYorVkg/kg== dependencies: symbol-observable "1.0.1" +rxjs@^6.3.3: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1, safe-buffer@^5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -9362,11 +10400,31 @@ semver@5.4.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== +semver@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" + integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== + +semver@6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + +semver@^5.4.1: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + semver@^5.5.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +semver@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -9503,6 +10561,13 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= +simple-git@^1.85.0: + version "1.121.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.121.0.tgz#4bdf0828cd1b0bb3cb7ed9bead2771982ef5876a" + integrity sha512-LyYri/nuAX8+cx9nZw38mWO6oHNi//CmiPlkBL7aVjZIsdldve7eeDwXu9L4wP/74MpNHucXkXc/BOuIQShhPg== + dependencies: + debug "^4.0.1" + sinon-chai@3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/sinon-chai/-/sinon-chai-3.3.0.tgz#8084ff99451064910fbe2c2cb8ab540c00b740ea" @@ -9543,6 +10608,15 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -9756,10 +10830,10 @@ spdy@^3.4.1: select-hose "^2.0.0" spdy-transport "^2.0.18" -specificity@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/specificity/-/specificity-0.3.2.tgz#99e6511eceef0f8d9b57924937aac2cb13d13c42" - integrity sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A== +specificity@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/specificity/-/specificity-0.4.1.tgz#aab5e645012db08ba182e151165738d00887b019" + integrity sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -9802,10 +10876,10 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -staged-git-files@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" - integrity sha1-15fhtVHKemOd7AI33G60u5vhfTU= +staged-git-files@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.2.tgz#4326d33886dc9ecfa29a6193bf511ba90a46454b" + integrity sha512-0Eyrk6uXW6tg9PYkhi/V/J4zHp33aNyi2hOCmhFLqLTIhbgqWn5jlSzI+IU0VqrZq6+DbHcabQl/WP6P3BG0QA== state-toggle@^1.0.0: version "1.0.0" @@ -9861,13 +10935,6 @@ stream-to-observable@^0.1.0: resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" integrity sha1-Rb8dny19wJvtgfHDB8Qw5ouEz/4= -stream-to-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" - integrity sha1-WdbqOT2HwsDdrBCqDVYbxrpvDhA= - dependencies: - any-observable "^0.2.0" - streamroller@0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-0.7.0.tgz#a1d1b7cf83d39afb0d63049a5acbf93493bdf64b" @@ -9883,6 +10950,11 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= +string-argv@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" + integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= + string-replace-loader@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-1.3.0.tgz#1d404a7bf5e2ec21b08ffc76d89445fbe49bc01d" @@ -9908,6 +10980,20 @@ string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string.prototype.codepointat@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz#004ad44c8afc727527b108cd462b4d971cd469bc" + integrity sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg== + string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" @@ -9924,6 +11010,13 @@ string_decoder@^1.0.0: dependencies: safe-buffer "~5.1.0" +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + string_decoder@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" @@ -9948,12 +11041,12 @@ stringify-entities@^1.0.1: is-alphanumerical "^1.0.0" is-hexadecimal "^1.0.0" -stringify-object@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" - integrity sha512-O696NF21oLiDy8PhpWu8AEqoZHw++QW6mUv0UvKZe8gWSdSvMXkiLufK7OmnP27Dro4GU5kb9U7JIO0mBuCRQg== +stringify-object@^3.2.2: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== dependencies: - get-own-enumerable-property-symbols "^2.0.1" + get-own-enumerable-property-symbols "^3.0.0" is-obj "^1.0.1" is-regexp "^1.0.0" @@ -9976,6 +11069,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -10023,26 +11123,26 @@ style-search@^0.1.0: resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902" integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI= -stylelint-config-recommended@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-2.1.0.tgz#f526d5c771c6811186d9eaedbed02195fee30858" - integrity sha512-ajMbivOD7JxdsnlS5945KYhvt7L/HwN6YeYF2BH6kE4UCLJR0YvXMf+2j7nQpJyYLZx9uZzU5G1ZOSBiWAc6yA== +stylelint-config-recommended@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-2.2.0.tgz#46ab139db4a0e7151fd5f94af155512886c96d3f" + integrity sha512-bZ+d4RiNEfmoR74KZtCKmsABdBJr4iXRiCso+6LtMJPw5rd/KnxUWTxht7TbafrTJK1YRjNgnN0iVZaJfc3xJA== -stylelint-config-standard@^18.0.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-18.2.0.tgz#6283149aba7f64f18731aef8f0abfb35cf619e06" - integrity sha512-07x0TaSIzvXlbOioUU4ORkCIM07kyIuojkbSVCyFWNVgXMXYHfhnQSCkqu+oHWJf3YADAnPGWzdJ53NxkoJ7RA== +stylelint-config-standard@^18.2.0: + version "18.3.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-18.3.0.tgz#a2a1b788d2cf876c013feaff8ae276117a1befa7" + integrity sha512-Tdc/TFeddjjy64LvjPau9SsfVRexmTFqUhnMBrzz07J4p2dVQtmpncRF/o8yZn8ugA3Ut43E6o1GtjX80TFytw== dependencies: - stylelint-config-recommended "^2.1.0" + stylelint-config-recommended "^2.2.0" -stylelint-order@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/stylelint-order/-/stylelint-order-0.7.0.tgz#ceab5cbe24aa33fa63590024995395f6edfc9ab7" - integrity sha1-zqtcviSqM/pjWQAkmVOV9u38mrc= +stylelint-order@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stylelint-order/-/stylelint-order-1.0.0.tgz#089fc3d5cdf7e7d4ac1882f65b60b25db750413c" + integrity sha512-2IVM8GzeKIDQDTETNdmgX99ywGrb7OqFWkniCw7QLqS/xONPGMLY/xAQnvGcUS3oBSo8znsoshsWVBqPz2Kv4Q== dependencies: - lodash "^4.17.4" - postcss "^6.0.11" - postcss-sorting "^3.0.2" + lodash "^4.17.10" + postcss "^7.0.2" + postcss-sorting "^4.0.0" stylelint-scss@^2.2.0: version "2.5.0" @@ -10055,57 +11155,65 @@ stylelint-scss@^2.2.0: postcss-selector-parser "^3.1.1" postcss-value-parser "^3.3.0" -stylelint@^8.3.1: - version "8.4.0" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-8.4.0.tgz#c2dbaeb17236917819f9206e1c0df5fddf6f83c3" - integrity sha512-56hPH5mTFnk8LzlEuTWq0epa34fHuS54UFYQidBOFt563RJBNi1nz1F2HK2MoT1X1waq47milvRsRahFCCJs/Q== +stylelint@^9.5.0: + version "9.10.1" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-9.10.1.tgz#5f0ee3701461dff1d68284e1386efe8f0677a75d" + integrity sha512-9UiHxZhOAHEgeQ7oLGwrwoDR8vclBKlSX7r4fH0iuu0SfPwFaLkb1c7Q2j1cqg9P7IDXeAV2TvQML/fRQzGBBQ== dependencies: - autoprefixer "^7.1.2" + autoprefixer "^9.0.0" balanced-match "^1.0.0" - chalk "^2.0.1" - cosmiconfig "^3.1.0" - debug "^3.0.0" + chalk "^2.4.1" + cosmiconfig "^5.0.0" + debug "^4.0.0" execall "^1.0.0" - file-entry-cache "^2.0.0" - get-stdin "^5.0.1" - globby "^7.0.0" + file-entry-cache "^4.0.0" + get-stdin "^6.0.0" + global-modules "^2.0.0" + globby "^9.0.0" globjoin "^0.1.4" html-tags "^2.0.0" - ignore "^3.3.3" + ignore "^5.0.4" + import-lazy "^3.1.0" imurmurhash "^0.1.4" - known-css-properties "^0.5.0" + known-css-properties "^0.11.0" + leven "^2.1.0" lodash "^4.17.4" log-symbols "^2.0.0" mathml-tag-names "^2.0.1" - meow "^4.0.0" - micromatch "^2.3.11" + meow "^5.0.0" + micromatch "^3.1.10" normalize-selector "^0.2.0" - pify "^3.0.0" - postcss "^6.0.6" - postcss-html "^0.12.0" - postcss-less "^1.1.0" + pify "^4.0.0" + postcss "^7.0.13" + postcss-html "^0.36.0" + postcss-jsx "^0.36.0" + postcss-less "^3.1.0" + postcss-markdown "^0.36.0" postcss-media-query-parser "^0.2.3" - postcss-reporter "^5.0.0" + postcss-reporter "^6.0.0" postcss-resolve-nested-selector "^0.1.1" - postcss-safe-parser "^3.0.1" - postcss-sass "^0.2.0" - postcss-scss "^1.0.2" + postcss-safe-parser "^4.0.0" + postcss-sass "^0.3.5" + postcss-scss "^2.0.0" postcss-selector-parser "^3.1.0" + postcss-syntax "^0.36.2" postcss-value-parser "^3.3.0" resolve-from "^4.0.0" - specificity "^0.3.1" - string-width "^2.1.0" + signal-exit "^3.0.2" + slash "^2.0.0" + specificity "^0.4.1" + string-width "^3.0.0" style-search "^0.1.0" - sugarss "^1.0.0" + sugarss "^2.0.0" svg-tags "^1.0.0" - table "^4.0.1" + table "^5.0.0" -sugarss@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sugarss/-/sugarss-1.0.1.tgz#be826d9003e0f247735f92365dc3fd7f1bae9e44" - integrity sha512-3qgLZytikQQEVn1/FrhY7B68gPUUGY3R1Q1vTiD5xT+Ti1DP/8iZuwFet9ONs5+bmL8pZoDQ6JrQHVgrNlK6mA== +sugarss@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sugarss/-/sugarss-2.0.0.tgz#ddd76e0124b297d40bf3cca31c8b22ecb43bc61d" + integrity sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ== dependencies: - postcss "^6.0.14" + postcss "^7.0.2" supports-color@4.4.0: version "4.4.0" @@ -10154,6 +11262,13 @@ supports-color@^5.2.0: dependencies: has-flag "^3.0.0" +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + svg-tags@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764" @@ -10177,10 +11292,15 @@ symbol-observable@1.0.1: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" integrity sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ= -symbol-observable@^0.2.2: - version "0.2.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" - integrity sha1-lag9smGG1q9+ehjb2XYKL4bQj0A= +symbol-observable@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== + +synchronous-promise@^2.0.6: + version "2.0.9" + resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.9.tgz#b83db98e9e7ae826bf9c8261fd8ac859126c780a" + integrity sha512-LO95GIW16x69LuND1nuuwM4pjgFGupg7pZ/4lU86AmchPKrhk0o2tpMU2unXRrqo81iAFe1YJ0nAGEVwsrZAgg== table@4.0.2: version "4.0.2" @@ -10194,17 +11314,15 @@ table@4.0.2: slice-ansi "1.0.0" string-width "^2.1.1" -table@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" - integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== +table@^5.0.0: + version "5.4.4" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.4.tgz#6e0f88fdae3692793d1077fd172a4667afe986a6" + integrity sha512-IIfEAUx5QlODLblLrGTTLJA7Tk0iLSGBvgY8essPRVNGHAzThujww1YqHLs6h3HfTg55h++RzLHH5Xw/rfv+mg== dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" tapable@^0.1.8: version "0.1.10" @@ -10262,6 +11380,11 @@ text-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" integrity sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg== +text-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.0.0.tgz#43eabd1b495482fae4a2bf65e5f56c29f69220f6" + integrity sha512-F91ZqLgvi1E0PdvmxMgp+gcf6q8fMH7mhdwWfzXnl1k+GbpQDmi8l7DzLC5JTASKbwpY3TfxajAUzAXcv2NmsQ== + text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -10285,6 +11408,13 @@ through2@^2.0.0, through2@^2.0.2: readable-stream "^2.1.5" xtend "~4.0.1" +through2@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.1.tgz#39276e713c3302edf9e388dd9c812dd3b825bd5a" + integrity sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww== + dependencies: + readable-stream "2 || 3" + through@2, "through@>=2.2.7 <3", through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -10361,7 +11491,7 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" -to-regex@^3.0.1: +to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== @@ -10378,6 +11508,11 @@ topo@3.x.x: dependencies: hoek "6.x.x" +toposort@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330" + integrity sha1-riF2gXXRVZ1IvvNUILL0li8JwzA= + tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" @@ -10440,6 +11575,11 @@ tryer@^1.0.0: resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.0.tgz#027b69fa823225e551cace3ef03b11f6ab37c1d7" integrity sha1-Antp+oIyJeVRys4+8DsR9qs3wdc= +tslib@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" @@ -10550,17 +11690,18 @@ unherit@^1.0.4: inherits "^2.0.1" xtend "^4.0.1" -unified@^6.0.0: - version "6.1.6" - resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.6.tgz#5ea7f807a0898f1f8acdeefe5f25faa010cc42b1" - integrity sha512-pW2f82bCIo2ifuIGYcV12fL96kMMYgw7JKVEgh7ODlrM9rj6vXSY3BV+H6lCcv1ksxynFf582hwWLnA1qRFy4w== +unified@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/unified/-/unified-7.1.0.tgz#5032f1c1ee3364bd09da12e27fdd4a7553c7be13" + integrity sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw== dependencies: + "@types/unist" "^2.0.0" + "@types/vfile" "^3.0.0" bail "^1.0.0" extend "^3.0.0" is-plain-obj "^1.1.0" trough "^1.0.0" - vfile "^2.0.0" - x-is-function "^1.0.4" + vfile "^3.0.0" x-is-string "^0.1.0" union-value@^1.0.0: @@ -10590,18 +11731,23 @@ uniqs@^2.0.0: resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= -unist-util-find-all-after@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unist-util-find-all-after/-/unist-util-find-all-after-1.0.1.tgz#4e5512abfef7e0616781aecf7b1ed751c00af908" - integrity sha1-TlUSq/734GFnga7Pex7XUcAK+Qg= +unist-util-find-all-after@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unist-util-find-all-after/-/unist-util-find-all-after-1.0.4.tgz#2eeaba818fd98492d69c44f9bee52c6a25282eef" + integrity sha512-CaxvMjTd+yF93BKLJvZnEfqdM7fgEACsIpQqz8vIj9CJnUb9VpyymFS3tg6TCtgrF7vfCJBF5jbT2Ox9CBRYRQ== dependencies: - unist-util-is "^2.0.0" + unist-util-is "^3.0.0" -unist-util-is@^2.0.0, unist-util-is@^2.1.1: +unist-util-is@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.1.tgz#0c312629e3f960c66e931e812d3d80e77010947b" integrity sha1-DDEmKeP5YMZukx6BLT2A53AQlHs= +unist-util-is@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" + integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== + unist-util-modify-children@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.1.tgz#66d7e6a449e6f67220b976ab3cb8b5ebac39e51d" @@ -10711,7 +11857,7 @@ useragent@2.3.0: lru-cache "4.1.x" tmp "0.0.x" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -10777,12 +11923,12 @@ vfile-message@^1.0.0: dependencies: unist-util-stringify-position "^1.1.1" -vfile@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.3.0.tgz#e62d8e72b20e83c324bc6c67278ee272488bf84a" - integrity sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w== +vfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-3.0.1.tgz#47331d2abe3282424f4a4bb6acd20a44c4121803" + integrity sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ== dependencies: - is-buffer "^1.1.4" + is-buffer "^2.0.0" replace-ext "1.0.0" unist-util-stringify-position "^1.0.0" vfile-message "^1.0.0" @@ -10987,7 +12133,7 @@ which@1, which@^1.1.1, which@^1.2.1, which@^1.2.10: dependencies: isexe "^2.0.0" -which@^1.2.9: +which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -11029,6 +12175,14 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -11039,6 +12193,13 @@ write-file-stdout@0.0.2: resolved "https://registry.yarnpkg.com/write-file-stdout/-/write-file-stdout-0.0.2.tgz#c252d7c7c5b1b402897630e3453c7bfe690d9ca1" integrity sha1-wlLXx8WxtAKJdjDjRTx7/mkNnKE= +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -11063,11 +12224,6 @@ ws@~3.3.1: safe-buffer "~5.1.0" ultron "~1.1.0" -x-is-function@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" - integrity sha1-XSlNw9Joy90GJYDgxd93o5HR+h4= - x-is-string@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" @@ -11103,6 +12259,13 @@ yallist@^3.0.0, yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha1-tLBJ4xS+VF486AIjbWzSLNkcPek= +yargs-parser@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== + dependencies: + camelcase "^4.1.0" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" @@ -11235,3 +12398,15 @@ yeast@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419" integrity sha1-AI4G2AlDIMNy28L47XagymyKxBk= + +yup@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/yup/-/yup-0.27.0.tgz#f8cb198c8e7dd2124beddc2457571329096b06e7" + integrity sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ== + dependencies: + "@babel/runtime" "^7.0.0" + fn-name "~2.0.1" + lodash "^4.17.11" + property-expr "^1.5.0" + synchronous-promise "^2.0.6" + toposort "^2.0.2"