diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 8ec25ad..0000000 --- a/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - "env", - "react", - ], - "plugins": [ - "transform-class-properties", - "transform-object-rest-spread" - ] -} diff --git a/.csscomb.json b/.csscomb.json deleted file mode 100644 index c5ae1b1..0000000 --- a/.csscomb.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "always-semicolon": true, - "block-indent": 2, - "color-case": "lower", - "color-shorthand": true, - "element-case": "lower", - "eof-newline": true, - "exclude": [], - "leading-zero": true, - "quotes": "single", - "remove-empty-rulesets": false, - "space-before-colon": 0, - "space-after-colon": 1, - "space-before-combinator": 1, - "space-after-combinator": 1, - "space-before-selector-delimiter": 0, - "space-after-selector-delimiter": "\n", - "space-before-opening-brace": 1, - "space-before-closing-brace": "\n", - "space-after-opening-brace": "\n", - "space-between-declarations": "\n", - "strip-spaces": true, - "tab-size": 2, - "unitless-zero": true, - "lines-between-rulesets": 1, - "sort-order-fallback": "abc", - "sort-order": [ - [ - "$include", - "$extend", - "$variable", - "composes" - ], [ - "..." - ], [ - "appearance", - "display", - "position", - "top", - "right", - "bottom", - "left", - "float", - "clear", - "overflow", - "overflow-x", - "overflow-y", - "z-index", - - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "align-content", - "align-items", - "align-self", - "justify-content", - "order", - - "width", - "min-width", - "max-width", - "height", - "min-height", - "max-height", - "margin", - "margin-top", - "margin-right", - "margin-bottom", - "margin-left", - "padding", - "padding-top", - "padding-right", - "padding-bottom", - "padding-left", - - "border", - "border-top", - "border-right", - "border-bottom", - "border-left", - "border-width", - "border-top-width", - "border-right-width", - "border-bottom-width", - "border-left-width", - "border-style", - "border-top-style", - "border-right-style", - "border-bottom-style", - "border-left-style", - "border-radius", - "border-top-left-radius", - "border-top-right-radius", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-color", - "border-top-color", - "border-right-color", - "border-bottom-color", - "border-left-color", - "border-collapse", - "border-spacing", - "box-sizing", - "box-shadow", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "background", - "background-attachment", - "background-color", - "background-image", - "background-repeat", - "background-position", - "background-size", - "color", - "font", - "font-family", - "font-size", - "font-smoothing", - "font-style", - "font-variant", - "font-weight", - "letter-spacing", - "line-height", - "list-style", - "text-align", - "text-decoration", - "text-indent", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-wrap", - "white-space", - "word-spacing", - - "columns", - "column-gap", - "column-fill", - "column-rule", - "column-span", - "column-count", - "column-width", - - "table-layout", - "vertical-align", - "empty-cells", - "caption-side", - - "opacity", - "visibility", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "animation", - "animation-duration", - "animation-timing-function", - "animation-delay", - "animation-iteration-count", - "animation-direction", - "animation-fill-mode", - "animation-play-state", - "animation-name", - - "content", - "quotes", - "cursor", - "speak" - ] - ] -} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..3661717 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +insert_final_newline = true + +[*.{js,jsx,ts,tsx,mjs,mjsx,es6,sh,rb}] +indent_size = 2 +max_line_length = 80 +trim_trailing_whitespace = true + +[*.{py}] +indent_size = 4 +max_line_length = 80 +trim_trailing_whitespace = true + +[*.{css,scss,less,html,hbs,ejs,json,yml,yaml,gql}] +indent_size = 2 +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.eslintignore b/.eslintignore index e69de29..c692ef1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -0,0 +1,2 @@ +postcss.config.js +webpack.config.js diff --git a/.eslintrc b/.eslintrc index ec605f5..3d86c47 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,37 +1,61 @@ { + "parser": "@typescript-eslint/parser", // Specifies the ESLint parser + "extends": [ + "airbnb", + "airbnb/hooks", + "prettier", + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript" + ], + "plugins": ["@typescript-eslint"], "parserOptions": { - "ecmaVersion": 8, + "ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features + "sourceType": "module", // Allows for the use of imports "ecmaFeatures": { + "jsx": true, // Allows for the parsing of JSX "impliedStrict": true, - "experimentalObjectRestSpread": true, - "jsx": true + "experimentalObjectRestSpread": true }, - "sourceType": "module" + "settings": { + "react": { + "version": "detect" // Tells eslint-plugin-react to automatically detect the version of React to use + } + } }, - "plugins": [ - "react", - "prettier" - ], "env": { "browser": true, "node": true, "jest": true, "es6": true }, - "extends": [ - "prettier", - "airbnb" - ], - "parser": "babel-eslint", + "settings": { + "import/parsers": { + "@typescript-eslint/parser": [".ts", ".tsx"] + }, + "import/extensions": [".js", ".jsx"] + }, "rules": { - "react/prop-types": 0, - "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], - "react/jsx-closing-bracket-location": [1, "after-props"], - "react/sort-comp": 0, - "import/no-extraneous-dependencies": [error, { devDependencies: true }], - "func-names": 0, - "prefer-arrow-callback": 0, - "arrow-parens": ["error", "as-needed"], - "no-mixed-operators": 0 - } + "no-param-reassign": "warn", + "func-names": 0, + "prefer-arrow-callback": 0, + "arrow-parens": ["error", "as-needed"], + "no-mixed-operators": 0, + "no-use-before-define": "off", + "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], + "import/extensions": "off", + "import/no-extraneous-dependencies": 0, + "react/jsx-filename-extension": [1, { "extensions": [".tsx", ".jsx"] }], + "react/prop-types": "off", + "react/static-property-placement": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-use-before-define": ["error"] + }, + "overrides": [ + { + "files": ["*.js"], + "rules": { + "@typescript-eslint/no-var-requires": "off" + } + } + ] } diff --git a/.gitignore b/.gitignore index 71644e5..50fb52a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,11 @@ node_modules/ +dist/ +dist-esm/ +lib/ .vscode +.idea .npm -*.log -*.pid -configs/* -!src/configs/ -tools/* -!src/tools/ -utils/* -!src/utils/ -/public/* +.pid npm-debug.* +yarn-error.log +.log diff --git a/.prettierrc b/.prettierrc index e5b33f3..ce403c4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,10 +1,11 @@ { - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": true, - "trailingComma": "all", - "bracketSpacing": true, - "jsxBracketSameLine": true + "printWidth": 100, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "bracketSpacing": true, + "arrowParens": "avoid", + "jsxBracketSameLine": true } diff --git a/.storybook/config.js b/.storybook/config.js deleted file mode 100644 index 9154670..0000000 --- a/.storybook/config.js +++ /dev/null @@ -1,7 +0,0 @@ -import { configure } from '@storybook/react'; - -function loadStories() { - require('../stories'); -} - -configure(loadStories, module); diff --git a/.storybook/main.js b/.storybook/main.js new file mode 100644 index 0000000..68c9ded --- /dev/null +++ b/.storybook/main.js @@ -0,0 +1,5 @@ +const path = require('path'); + +module.exports = { + stories: ['../stories/**/*.@(tsx|jsx)'], +}; diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 0000000..645f52d --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,10 @@ + +export const parameters = { + actions: { argTypesRegex: "^on[A-Z].*" }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, +} \ No newline at end of file diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js deleted file mode 100644 index 26645be..0000000 --- a/.storybook/webpack.config.js +++ /dev/null @@ -1,12 +0,0 @@ -// you can use this file to add your custom webpack plugins, loaders and anything you like. -// This is just the basic way to add additional webpack configurations. -// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config - -// IMPORTANT -// When you add this file, we won't add the default configurations which is similar -// to "React Create App". This only has babel loader to load JavaScript. -const defaultConfig = require('../webpack.config.js'); -module.exports = { - plugins: defaultConfig.plugins.slice(1), - module: defaultConfig.module, -}; diff --git a/.stylelintrc b/.stylelintrc index ef96960..2f3ceab 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,670 +1,165 @@ -# http://stylelint.io/CHANGELOG/ - -plugins: - - # https://github.com/hudochenkov/stylelint-order - "stylelint-order" - -rules: - - # Color - - # Specify lowercase or uppercase for hex colors. - # http://stylelint.io/user-guide/rules/color-hex-case - color-hex-case: "lower" - - # Specify short or long notation for hex colors. - # http://stylelint.io/user-guide/rules/color-hex-length - color-hex-length: "short" - - # Require (where possible) or disallow named colors. - # http://stylelint.io/user-guide/rules/color-named/ - color-named: never - - # Disallow hex colors. - # http://stylelint.io/user-guide/rules/color-no-hex/ - color-no-hex: null - - # Disallow invalid hex colors. - # http://stylelint.io/user-guide/rules/color-no-invalid-hex/ - color-no-invalid-hex: true - - # Font family - - # Specify whether or not quotation marks should be used around font family names, and whether single or double. - # http://stylelint.io/user-guide/rules/font-family-name-quotes/ - font-family-name-quotes: "always-where-recommended" - - # Font weight - - # Require consistent numeric or named font-weight values. - # http://stylelint.io/user-guide/rules/font-weight-notation/ - # font-weight-notation: "numeric" - - # Function - - # Specify a blacklist of disallowed functions. - # http://stylelint.io/user-guide/rules/function-blacklist/ - # function-blacklist: [] - - # Disallow an unspaced operator within calc functions. - # http://stylelint.io/user-guide/rules/function-calc-no-unspaced-operator/ - function-calc-no-unspaced-operator: true - - # Require a newline or disallow whitespace after the commas of functions. - # http://stylelint.io/user-guide/rules/function-comma-newline-after/ - function-comma-newline-after: "always-multi-line" - - # Require a newline or disallow whitespace before the commas of functions. - # http://stylelint.io/user-guide/rules/function-comma-newline-before/ - function-comma-newline-before: "never-multi-line" - - # Require a single space or disallow whitespace after the commas of functions. - # http://stylelint.io/user-guide/rules/function-comma-space-after/ - function-comma-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the commas of functions. - # http://stylelint.io/user-guide/rules/function-comma-space-before/ - function-comma-space-before: "never" - - # Disallow direction values in linear-gradient() calls that are not valid according to the standard syntax. - # http://stylelint.io/user-guide/rules/function-linear-gradient-no-nonstandard-direction/ - function-linear-gradient-no-nonstandard-direction: true - - # Require a newline or disallow whitespace on the inside of the parentheses of functions. - # http://stylelint.io/user-guide/rules/function-parentheses-newline-inside/ - function-parentheses-newline-inside: "always-multi-line" - - # Require a single space or disallow whitespace on the inside of the parentheses of functions. - # http://stylelint.io/user-guide/rules/function-parentheses-space-inside/ - function-parentheses-space-inside: "never-single-line" - - # Specify single, double or no quotes for urls. - # http://stylelint.io/user-guide/rules/function-url-quotes/ - function-url-quotes: "always" - - # Specify a whitelist of only allowed functions. - # http://stylelint.io/user-guide/rules/function-whitelist/ - # function-whitelist: [] - - # Require a single space or disallow whitespace after functions. - # http://stylelint.io/user-guide/rules/function-whitespace-after/ - function-whitespace-after: "always" - - # Number - - # Require or disallow a leading zero for fractional numbers less than 1. - # http://stylelint.io/user-guide/rules/number-leading-zero/ - number-leading-zero: "always" - - # Limit the number of decimal places allowed in numbers. - # http://stylelint.io/user-guide/rules/number-max-precision/ - # number-max-precision: 2 - - # Disallow trailing zeros within numbers. - # http://stylelint.io/user-guide/rules/number-no-trailing-zeros/ - number-no-trailing-zeros: null - - # Disallow units for zero lengths. - # http://stylelint.io/user-guide/rules/length-zero-no-unit/ - length-zero-no-unit: true - - # String - - # Disallow (unescaped) newlines in strings. - # http://stylelint.io/user-guide/rules/string-no-newline/ - string-no-newline: true - - # Specify single or double quotes around strings. - # http://stylelint.io/user-guide/rules/string-quotes/ - string-quotes: "single" - - # Time - - # Disallow animation and transition times under 100ms. - # http://stylelint.io/user-guide/rules/time-no-imperceptible/ - # time-no-imperceptible: null - - # Unit - - # Specify a blacklist of disallowed units. - # http://stylelint.io/user-guide/rules/unit-blacklist/ - # unit-blacklist: [] - - # Specify a whitelist of allowed units. - # http://stylelint.io/user-guide/rules/unit-whitelist/ - # unit-whitelist: [] - - # Value - - # Disallow vendor prefixes for values. - # http://stylelint.io/user-guide/rules/value-no-vendor-prefix/ - value-no-vendor-prefix: true - - # Value list - - # Require a newline or disallow whitespace after the commas of value lists. - # http://stylelint.io/user-guide/rules/value-list-comma-newline-after/ - value-list-comma-newline-after: "always-multi-line" - - # Require a newline or disallow whitespace before the commas of value lists. - # http://stylelint.io/user-guide/rules/value-list-comma-newline-before/ - value-list-comma-newline-before: "never-multi-line" - - # Require a single space or disallow whitespace after the commas of value lists. - # http://stylelint.io/user-guide/rules/value-list-comma-space-after/ - value-list-comma-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the commas of value lists. - # http://stylelint.io/user-guide/rules/value-list-comma-space-before/ - value-list-comma-space-before: "never" - - # Custom property - - # Specify pattern of custom properties. - # http://stylelint.io/user-guide/rules/custom-property-pattern/ - custom-property-pattern: "^[a-z][a-z0-9-]*$" - - # Property - - # Specify a blacklist of disallowed properties. - # http://stylelint.io/user-guide/rules/property-blacklist/ - # property-blacklist: [] - - # Disallow vendor prefixes for properties. - # http://stylelint.io/user-guide/rules/property-no-vendor-prefix/ - property-no-vendor-prefix: true - - # Specify a blacklist of disallowed units for specific properties. - # http://stylelint.io/user-guide/rules/declaration-property-unit-blacklist/ - # declaration-property-unit-blacklist: { "unprefixed-property-name": [] } - - # Specify a whitelist of disallowed units for specific properties. - # http://stylelint.io/user-guide/rules/declaration-property-unit-whitelist/ - # declaration-property-unit-whitelist: { "unprefixed-property-name": ["array", "of", "units"] } - - # Specify a blacklist of disallowed property-value pairs. - # http://stylelint.io/user-guide/rules/declaration-property-value-blacklist/ - # declaration-property-value-blacklist: { "unprefixed-property-name": ["array", "of", "values"], "unprefixed-property-name": ["/regex/", "non-regex"] } - - # Specify a whitelist of allowed property-value pairs. - # http://stylelint.io/user-guide/rules/declaration-property-value-whitelist/ - # declaration-property-value-whitelist: { "unprefixed-property-name": ["array", "of", "values"], "unprefixed-property-name": ["/regex/", "non-regex"] } - - # Specify a whitelist of allowed properties. - # http://stylelint.io/user-guide/rules/property-whitelist/ - # property-whitelist: [] - - # Declaration - - # Require a single space or disallow whitespace after the bang of declarations. - # http://stylelint.io/user-guide/rules/declaration-bang-space-after/ - declaration-bang-space-after: "never" - - # Require a single space or disallow whitespace before the bang of declarations. - # http://stylelint.io/user-guide/rules/declaration-bang-space-before/ - declaration-bang-space-before: "always" - - # Require a newline or disallow whitespace after the colon of declarations. - # http://stylelint.io/user-guide/rules/declaration-colon-newline-after/ - declaration-colon-newline-after: "always-multi-line" - - # Require a single space or disallow whitespace after the colon of declarations. - # http://stylelint.io/user-guide/rules/declaration-colon-space-after/ - declaration-colon-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the colon of declarations. - # http://stylelint.io/user-guide/rules/declaration-colon-space-before/ - declaration-colon-space-before: "never" - - # Disallow !important within declarations. - # http://stylelint.io/user-guide/rules/declaration-no-important/ - declaration-no-important: null - - # Declaration block - - # Disallow duplicate properties within declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-no-duplicate-properties/ - # bug: composes - # declaration-block-no-duplicate-properties: true - - # Disallow shorthand properties that override related longhand properties. - # http://stylelint.io/user-guide/rules/declaration-block-no-shorthand-property-overrides/ - declaration-block-no-shorthand-property-overrides: true - - # Require a newline or disallow whitespace after the semicolons of declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after/ - declaration-block-semicolon-newline-after: "always" - - # Require a newline or disallow whitespace before the semicolons of declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-before/ - declaration-block-semicolon-newline-before: "never-multi-line" - - # Require a single space or disallow whitespace after the semicolons of declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-semicolon-space-after/ - declaration-block-semicolon-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the semicolons of declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before/ - declaration-block-semicolon-space-before: "never" - - # Limit the number of declaration within single line declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations/ - # declaration-block-single-line-max-declarations: 1 - - # Require or disallow a trailing semicolon within declaration blocks. - # http://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon/ - declaration-block-trailing-semicolon: "always" - - # Block - - # Require a newline or disallow whitespace after the closing brace of blocks. - # http://stylelint.io/user-guide/rules/block-closing-brace-newline-after/ - block-closing-brace-newline-after: "always" - - # Require a newline or disallow whitespace before the closing brace of blocks. - # http://stylelint.io/user-guide/rules/block-closing-brace-newline-before/ - block-closing-brace-newline-before: "always" - - # Require a single space or disallow whitespace after the closing brace of blocks. - # http://stylelint.io/user-guide/rules/block-closing-brace-space-after/ - block-closing-brace-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the closing brace of blocks. - # http://stylelint.io/user-guide/rules/block-closing-brace-space-before/ - block-closing-brace-space-before: "always-single-line" - - # Disallow empty blocks. - # http://stylelint.io/user-guide/rules/block-no-empty/ - block-no-empty: null - - # Require a newline after the opening brace of blocks. - # http://stylelint.io/user-guide/rules/block-opening-brace-newline-after/ - block-opening-brace-newline-after: "always" - - # Require a newline or disallow whitespace before the opening brace of blocks. - # http://stylelint.io/user-guide/rules/block-opening-brace-newline-before/ - # block-opening-brace-newline-before: "always-multi-line" - - # Require a single space or disallow whitespace after the opening brace of blocks. - # http://stylelint.io/user-guide/rules/block-opening-brace-space-after/ - block-opening-brace-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the opening brace of blocks. - # http://stylelint.io/user-guide/rules/block-opening-brace-space-before/ - block-opening-brace-space-before: "always" - - # Root selector - - # Selector - - # Specify a pattern for class selectors. - # http://stylelint.io/user-guide/rules/selector-class-pattern/ - selector-class-pattern: - - "^[a-z][a-z0-9-_]*$" - - - resolveNestedSelectors: true - - # Require a single space or disallow whitespace after the combinators of selectors. - # http://stylelint.io/user-guide/rules/selector-combinator-space-after/ - selector-combinator-space-after: "always" - - # Require a single space or disallow whitespace before the combinators of selectors. - # http://stylelint.io/user-guide/rules/selector-combinator-space-before/ - selector-combinator-space-before: "always" - - # Specify a pattern for id selectors. - # http://stylelint.io/user-guide/rules/selector-id-pattern/ - # selector-id-pattern: /foo-[a-z]+/ - - # Limit the specificity of selectors. - # http://stylelint.io/user-guide/rules/selector-max-specificity/ - # selector-max-specificity: - - # Disallow attribute selectors. - # http://stylelint.io/user-guide/rules/selector-no-attribute/ - # selector-no-attribute: null - - # Disallow combinators in selectors. - # http://stylelint.io/user-guide/rules/selector-no-combinator/ - # Disallow universal selectors. - # http://stylelint.io/user-guide/rules/selector-no-universal/ - - # Disallow vendor prefixes for selectors. - # http://stylelint.io/user-guide/rules/selector-no-vendor-prefix/ - selector-no-vendor-prefix: true - - # Specify single or double colon notation for applicable pseudo-elements. - # http://stylelint.io/user-guide/rules/selector-pseudo-element-colon-notation/ - selector-pseudo-element-colon-notation: "double" - - # Selector list - - # Require a newline or disallow whitespace after the commas of selector lists. - # http://stylelint.io/user-guide/rules/selector-list-comma-newline-after/ - selector-list-comma-newline-after: "always" - - # Require a newline or disallow whitespace before the commas of selector lists. - # http://stylelint.io/user-guide/rules/selector-list-comma-newline-before/ - selector-list-comma-newline-before: "never-multi-line" - - # Require a single space or disallow whitespace after the commas of selector lists. - # http://stylelint.io/user-guide/rules/selector-list-comma-space-after/ - selector-list-comma-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the commas of selector lists. - # http://stylelint.io/user-guide/rules/selector-list-comma-space-before/ - selector-list-comma-space-before: "never" - - # Rule - - # https://github.com/hudochenkov/stylelint-order/blob/master/rules/declaration-block-order/README.md - order/order: - - [ - { - type: 'at-rule', - name: 'include', - }, - { - type: 'at-rule', - name: 'extend', - }, - "at-variables", - "dollar-variables", - "custom-properties", - "declarations", - "rules", - "at-rules", - ] - - - unspecified: "ignore" - - # https://github.com/hudochenkov/stylelint-order/blob/master/rules/declaration-block-properties-specified-order/README.md - order/properties-order: - - [ - "composes", - "appearance", - "display", - "position", - "top", - "right", - "bottom", - "left", - "float", - "clear", - "overflow", - "overflow-x", - "overflow-y", - "z-index", - - "flex", - "flex-basis", - "flex-direction", - "flex-flow", - "flex-grow", - "flex-shrink", - "flex-wrap", - "align-content", - "align-items", - "align-self", - "justify-content", - "order", - - "width", - "min-width", - "max-width", - "height", - "min-height", - "max-height", - "margin", - "margin-top", - "margin-right", - "margin-bottom", - "margin-left", - "padding", - "padding-top", - "padding-right", - "padding-bottom", - "padding-left", - - "border", - "border-top", - "border-right", - "border-bottom", - "border-left", - "border-width", - "border-top-width", - "border-right-width", - "border-bottom-width", - "border-left-width", - "border-style", - "border-top-style", - "border-right-style", - "border-bottom-style", - "border-left-style", - "border-radius", - "border-top-left-radius", - "border-top-right-radius", - "border-bottom-left-radius", - "border-bottom-right-radius", - "border-color", - "border-top-color", - "border-right-color", - "border-bottom-color", - "border-left-color", - "border-collapse", - "border-spacing", - "box-sizing", - "box-shadow", - "outline", - "outline-color", - "outline-offset", - "outline-style", - "outline-width", - "background", - "background-attachment", - "background-color", - "background-image", - "background-repeat", - "background-position", - "background-size", - "color", - "font", - "font-family", - "font-size", - "font-smoothing", - "font-style", - "font-variant", - "font-weight", - "letter-spacing", - "line-height", - "list-style", - "text-align", - "text-decoration", - "text-indent", - "text-overflow", - "text-rendering", - "text-shadow", - "text-transform", - "text-wrap", - "white-space", - "word-spacing", - - "columns", - "column-gap", - "column-fill", - "column-rule", - "column-span", - "column-count", - "column-width", - - "table-layout", - "vertical-align", - "empty-cells", - "caption-side", - - "opacity", - "visibility", - "transform", - "transform-box", - "transform-origin", - "transform-style", - "transition", - "transition-delay", - "transition-duration", - "transition-property", - "transition-timing-function", - "animation", - "animation-duration", - "animation-timing-function", - "animation-delay", - "animation-iteration-count", - "animation-direction", - "animation-fill-mode", - "animation-play-state", - "animation-name", - - "content", - "quotes", - "cursor", - "speak" - ] - - - unspecified: "ignore" - - # Media feature - - # Require a single space or disallow whitespace after the colon in media features. - # http://stylelint.io/user-guide/rules/media-feature-colon-space-after/ - media-feature-colon-space-after: "always" - - # Require a single space or disallow whitespace before the colon in media features. - # http://stylelint.io/user-guide/rules/media-feature-colon-space-before/ - media-feature-colon-space-before: "never" - - # Disallow vendor prefixes for media feature names. - # http://stylelint.io/user-guide/rules/media-feature-name-no-vendor-prefix/ - media-feature-name-no-vendor-prefix: true - - # Require a single space or disallow whitespace after the range operator in media features. - # http://stylelint.io/user-guide/rules/media-feature-range-operator-space-after/ - media-feature-range-operator-space-after: "always" - - # Require a single space or disallow whitespace before the range operator in media features. - # http://stylelint.io/user-guide/rules/media-feature-range-operator-space-before/ - media-feature-range-operator-space-before: "always" - - # Custom media - - # Specify pattern of custom media query names. - # http://stylelint.io/user-guide/rules/custom-media-pattern/ - custom-media-pattern: "^[a-z][a-z0-9-]*$" - - # Media query - - # Require a single space or disallow whitespace on the inside of the parentheses within media queries. - # http://stylelint.io/user-guide/rules/media-feature-parentheses-space-inside/ - media-feature-parentheses-space-inside: "never" - - # Media query list - - # Require a newline or disallow whitespace after the commas of media query lists. - # http://stylelint.io/user-guide/rules/media-query-list-comma-newline-after/ - media-query-list-comma-newline-after: "always-multi-line" - - # Require a newline or disallow whitespace before the commas of media query lists. - # http://stylelint.io/user-guide/rules/media-query-list-comma-newline-before/ - media-query-list-comma-newline-before: "never-multi-line" - - # Require a single space or disallow whitespace after the commas of media query lists. - # http://stylelint.io/user-guide/rules/media-query-list-comma-space-after/ - media-query-list-comma-space-after: "always-single-line" - - # Require a single space or disallow whitespace before the commas of media query lists. - # http://stylelint.io/user-guide/rules/media-query-list-comma-space-before/ - media-query-list-comma-space-before: "never" - - # At rule - - # Require or disallow an empty line before @rules. - # http://stylelint.io/user-guide/rules/at-rule-empty-line-before/ - at-rule-empty-line-before: - - "always" - - except: [ - # "after-same-name", - "blockless-after-blockless", - # "blockless-after-same-name-blockless", - "first-nested", - ] - - ignore: [ - "after-comment", - "inside-block", - ] - - # Disallow vendor prefixes for @rules. - # http://stylelint.io/user-guide/rules/at-rule-no-vendor-prefix/ - at-rule-no-vendor-prefix: true - - # Comment - - # Require or disallow an empty line before comments. - # http://stylelint.io/user-guide/rules/comment-empty-line-before/ - comment-empty-line-before: - - "always" - - except: ["first-nested"] - - ignore: ["stylelint-commands", "between-comments"] - - # Require a single space or disallow whitespace on the inside of comment markers. - # http://stylelint.io/user-guide/rules/comment-whitespace-inside/ - comment-whitespace-inside: "always" - - # General / Sheet - - # Specify indentation. - # http://stylelint.io/user-guide/rules/indentation/ - indentation: 2 - - # Disallow more than a specified number of adjacent empty lines. - # http://stylelint.io/user-guide/rules/max-empty-lines/ - max-empty-lines: 1 - - # Limit the length of a line. - # http://stylelint.io/user-guide/rules/max-line-length/ - # max-line-length: 20 - - # Limit the allowed nesting depth. - # http://stylelint.io/user-guide/rules/max-nesting-depth/ - max-nesting-depth: 4 - - # Disallow browser hacks that are irrelevant to the browsers you are targeting. - # http://stylelint.io/user-guide/rules/no-browser-hacks/ - # no-browser-hacks: true - - # Disallow selectors of lower specificity from coming after overriding selectors of higher specificity. - # http://stylelint.io/user-guide/rules/no-descending-specificity/ - no-descending-specificity: true - - # Disallow duplicate selectors. - # http://stylelint.io/user-guide/rules/no-duplicate-selectors/ - # bug - # no-duplicate-selectors: true - - # Disallow end-of-line whitespace. - # http://stylelint.io/user-guide/rules/no-eol-whitespace/ - no-eol-whitespace: true - - # Disallow double-slash comments (//...) which are not supported by CSS. - # http://stylelint.io/user-guide/rules/no-invalid-double-slash-comments/ - no-invalid-double-slash-comments: null - - # Disallow missing end-of-file newline. - # http://stylelint.io/user-guide/rules/no-missing-end-of-source-newline/ - no-missing-end-of-source-newline: true - - # Disallow animation names that do not correspond to a @keyframes declaration. - # http://stylelint.io/user-guide/rules/no-unknown-animations/ - no-unknown-animations: true - - # Disallow features that are unsupported by the browsers that you are targeting. - # http://stylelint.io/user-guide/rules/ - # no-unsupported-browser-features: +{ + "extends": ["stylelint-config-standard", "stylelint-prettier/recommended"], + "plugins": ["stylelint-order"], + "ignoreFiles": ["**/*.(t|j)sx", "**/*.(t|j)s"], + "rules": { + "order/order": [ + { + "type": "at-rule", + "name": "include" + }, + { + "type": "at-rule", + "name": "extend" + }, + "at-variables", + "dollar-variables", + "custom-properties", + "declarations", + "rules", + "at-rules" + ], + "no-descending-specificity": null, + "order/properties-order": [ + "composes", + "appearance", + "display", + "position", + "top", + "right", + "bottom", + "left", + "float", + "clear", + "overflow", + "overflow-x", + "overflow-y", + "z-index", + "flex", + "flex-basis", + "flex-direction", + "flex-flow", + "flex-grow", + "flex-shrink", + "flex-wrap", + "align-content", + "align-items", + "align-self", + "justify-content", + "order", + "width", + "min-width", + "max-width", + "height", + "min-height", + "max-height", + "margin", + "margin-top", + "margin-right", + "margin-bottom", + "margin-left", + "padding", + "padding-top", + "padding-right", + "padding-bottom", + "padding-left", + "border", + "border-top", + "border-right", + "border-bottom", + "border-left", + "border-width", + "border-top-width", + "border-right-width", + "border-bottom-width", + "border-left-width", + "border-style", + "border-top-style", + "border-right-style", + "border-bottom-style", + "border-left-style", + "border-radius", + "border-top-left-radius", + "border-top-right-radius", + "border-bottom-left-radius", + "border-bottom-right-radius", + "border-color", + "border-top-color", + "border-right-color", + "border-bottom-color", + "border-left-color", + "border-collapse", + "border-spacing", + "box-sizing", + "box-shadow", + "outline", + "outline-color", + "outline-offset", + "outline-style", + "outline-width", + "background", + "background-attachment", + "background-color", + "background-image", + "background-repeat", + "background-position", + "background-size", + "color", + "font", + "font-family", + "font-size", + "font-smoothing", + "font-style", + "font-variant", + "font-weight", + "letter-spacing", + "line-height", + "list-style", + "text-align", + "text-decoration", + "text-indent", + "text-overflow", + "text-rendering", + "text-shadow", + "text-transform", + "text-wrap", + "white-space", + "word-spacing", + "columns", + "column-gap", + "column-fill", + "column-rule", + "column-span", + "column-count", + "column-width", + "table-layout", + "vertical-align", + "empty-cells", + "caption-side", + "opacity", + "visibility", + "transform", + "transform-box", + "transform-origin", + "transform-style", + "transition", + "transition-delay", + "transition-duration", + "transition-property", + "transition-timing-function", + "animation", + "animation-duration", + "animation-timing-function", + "animation-delay", + "animation-iteration-count", + "animation-direction", + "animation-fill-mode", + "animation-play-state", + "animation-name", + "content", + "quotes", + "cursor", + "speak" + ] + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f68dfd8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 loadingwyn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 577493d..e31aebe 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,61 @@ -# React Image Slides -> A mobile friendly images slideshow react component +# React Image Viewer + +[![version](https://img.shields.io/npm/v/react-imageslides)](https://www.npmjs.com/package/react-imageslides) + +> React-slides@3 has been rewriten with React Hooks and all apis of it have been redesigned. If you are using React-slides@2, please read api docs carefully. + ## Example + ![demo](demo/demo.gif) -Features -- Support pinching to zoom and swiping smoothly(use [Alloyfinger](https://github.com/AlloyTeam/AlloyFinger)) -- Preload Images -- Only render no more than 3 images (previous, current, next) at a time for performance +[![Edit focused-resonance-oxzgn](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/focused-resonance-oxzgn?fontsize=14&hidenavigation=1&theme=dark) -## Install -`yarn add react-imageslides` +## Features -## Apis +- Support multi-touch and mouse gestures (powered by [Alloyfinger](https://github.com/AlloyTeam/AlloyFinger)) +- High performance(no unneccessary rendering) + +## Get Started -Property | Type | Default | Required | Description -:-------------------|:------:|:--------------:|:--------:|:---------------------------------------- -images | array | | yes | image urls to display -isOpen | boolean| false | | whether component is open -index | number | 0 | | index of the first image to display -useTouchEmulator | boolean| false | | whether touch emulator is used -onClose | func | | | close window event +1. Run `yarn add react-imageslides react react-dom alloyfinger` -## Todo + > The package has peer dependencies on `react@^17.0.0`, `react-dom@^17.0.0` and `alloyfinger`. + +2. Render it! + +```js +import React, { useState, useCallback } from 'react'; +import ReactDOM from 'react-dom'; +import Gallery from 'react-imageslides'; +import 'react-imageslides/lib/index.css'; + +const images = [ + 'http://dingyue.nosdn.127.net/0UDLpU6BsCNm9v9OpT0Dhn=nHKJFC6SMByz8bMWxFM=1t1531988836046compressflag.jpeg', + 'http://dingyue.nosdn.127.net/9sFTTWDQoHjxyIkU9wzm8CiDNVbq48Mwf2hyhgRghxA5O1527909480497compressflag.jpeg', + 'http://dingyue.nosdn.127.net/eSJPDtcP9NBvEOIMPyPLxwpJSZIu4D36qDss2RGQjNHBp1531990042001compressflag.jpeg', + 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1503235534249&di=4c198d5a305627d12e5dae4c581c9e57&imgtype=0&src=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fimg2.niutuku.com%2Fdesk%2Fanime%2F0529%2F0529-17277.jpg', +]; +export default function App() { + const [activeIndex, setActiveIndex] = useState(0); + + const handleChange = useCallback(newIndex => { + setActiveIndex(newIndex); + }, []); + return ; +} +ReactDOM.render(, document.getElementById('root')); +``` + +## Apis -- ~~Add tests~~ -- Add pop-up animation effects +| Property | Type | Required | Description | +| :------------ | :----: | :------: | :------------------------------------------ | +| images | array | yes | Image urls to display | +| onChange | func | yes | Callback fired when the index changes | +| isOpen | bool | yes | Whether the component is open | +| index | number | yes | Index of the first image to display | +| loadingIcon | node | | Placeholder when image is loading | +| onClick | func | | Callback fired when user clicks gallery | +| onKeyPress | func | | Callback fired when user press down any key | +| onSingleTap | func | | Callback fired when user taps gallery | +| imageRenderer | func | | Render prop to custom image element | diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..a519a11 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,13 @@ +// babel.config.js +module.exports = { + presets: [ + [ + '@babel/env', + { + targets: { node: 'current' }, + }, + ], + '@babel/preset-react', + '@babel/preset-typescript', + ], +}; diff --git a/coverage/clover.xml b/coverage/clover.xml deleted file mode 100644 index b50c2b3..0000000 --- a/coverage/clover.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/coverage/coverage-final.json b/coverage/coverage-final.json deleted file mode 100644 index 8d1f4cf..0000000 --- a/coverage/coverage-final.json +++ /dev/null @@ -1,6 +0,0 @@ -{"/Users/loading/mycode/react-image-viewer/src/ImageControllerCreator/index.js": {"path":"/Users/loading/mycode/react-image-viewer/src/ImageControllerCreator/index.js","statementMap":{"0":{"start":{"line":12,"column":4},"end":{"line":12,"column":26}},"1":{"start":{"line":13,"column":4},"end":{"line":13,"column":45}},"2":{"start":{"line":14,"column":4},"end":{"line":14,"column":46}},"3":{"start":{"line":15,"column":4},"end":{"line":15,"column":48}},"4":{"start":{"line":16,"column":4},"end":{"line":16,"column":44}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":46}},"6":{"start":{"line":21,"column":4},"end":{"line":21,"column":25}},"7":{"start":{"line":22,"column":4},"end":{"line":22,"column":44}},"8":{"start":{"line":26,"column":4},"end":{"line":26,"column":30}},"9":{"start":{"line":27,"column":22},"end":{"line":27,"column":33}},"10":{"start":{"line":34,"column":8},"end":{"line":34,"column":18}},"11":{"start":{"line":35,"column":4},"end":{"line":37,"column":58}},"12":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},"13":{"start":{"line":39,"column":6},"end":{"line":39,"column":32}},"14":{"start":{"line":41,"column":4},"end":{"line":41,"column":51}},"15":{"start":{"line":42,"column":4},"end":{"line":42,"column":51}},"16":{"start":{"line":46,"column":4},"end":{"line":49,"column":6}},"17":{"start":{"line":50,"column":4},"end":{"line":50,"column":49}},"18":{"start":{"line":51,"column":42},"end":{"line":51,"column":53}},"19":{"start":{"line":52,"column":57},"end":{"line":52,"column":67}},"20":{"start":{"line":53,"column":4},"end":{"line":55,"column":5}},"21":{"start":{"line":54,"column":6},"end":{"line":54,"column":19}},"22":{"start":{"line":56,"column":4},"end":{"line":59,"column":6}},"23":{"start":{"line":63,"column":20},"end":{"line":63,"column":24}},"24":{"start":{"line":64,"column":19},"end":{"line":64,"column":21}},"25":{"start":{"line":65,"column":59},"end":{"line":65,"column":69}},"26":{"start":{"line":66,"column":4},"end":{"line":73,"column":5}},"27":{"start":{"line":70,"column":6},"end":{"line":70,"column":25}},"28":{"start":{"line":71,"column":6},"end":{"line":71,"column":39}},"29":{"start":{"line":72,"column":6},"end":{"line":72,"column":24}},"30":{"start":{"line":74,"column":4},"end":{"line":80,"column":5}},"31":{"start":{"line":78,"column":6},"end":{"line":78,"column":25}},"32":{"start":{"line":79,"column":6},"end":{"line":79,"column":39}},"33":{"start":{"line":81,"column":4},"end":{"line":86,"column":5}},"34":{"start":{"line":82,"column":6},"end":{"line":82,"column":26}},"35":{"start":{"line":83,"column":6},"end":{"line":83,"column":27}},"36":{"start":{"line":85,"column":6},"end":{"line":85,"column":26}},"37":{"start":{"line":87,"column":4},"end":{"line":90,"column":6}},"38":{"start":{"line":94,"column":4},"end":{"line":94,"column":52}},"39":{"start":{"line":95,"column":4},"end":{"line":102,"column":7}},"40":{"start":{"line":103,"column":4},"end":{"line":103,"column":52}},"41":{"start":{"line":107,"column":30},"end":{"line":107,"column":40}},"42":{"start":{"line":108,"column":21},"end":{"line":108,"column":38}},"43":{"start":{"line":109,"column":4},"end":{"line":113,"column":5}},"44":{"start":{"line":110,"column":6},"end":{"line":110,"column":36}},"45":{"start":{"line":111,"column":11},"end":{"line":113,"column":5}},"46":{"start":{"line":112,"column":6},"end":{"line":112,"column":29}},"47":{"start":{"line":117,"column":4},"end":{"line":119,"column":7}},"48":{"start":{"line":123,"column":4},"end":{"line":126,"column":7}},"49":{"start":{"line":130,"column":4},"end":{"line":135,"column":7}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":2},"end":{"line":11,"column":3}},"loc":{"start":{"line":11,"column":36},"end":{"line":18,"column":3}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":20,"column":2},"end":{"line":20,"column":3}},"loc":{"start":{"line":20,"column":23},"end":{"line":23,"column":3}},"line":20},"2":{"name":"(anonymous_2)","decl":{"start":{"line":25,"column":2},"end":{"line":25,"column":3}},"loc":{"start":{"line":25,"column":16},"end":{"line":43,"column":3}},"line":25},"3":{"name":"(anonymous_3)","decl":{"start":{"line":45,"column":2},"end":{"line":45,"column":3}},"loc":{"start":{"line":45,"column":23},"end":{"line":60,"column":3}},"line":45},"4":{"name":"(anonymous_4)","decl":{"start":{"line":62,"column":2},"end":{"line":62,"column":3}},"loc":{"start":{"line":62,"column":35},"end":{"line":91,"column":3}},"line":62},"5":{"name":"(anonymous_5)","decl":{"start":{"line":93,"column":2},"end":{"line":93,"column":3}},"loc":{"start":{"line":93,"column":10},"end":{"line":104,"column":3}},"line":93},"6":{"name":"(anonymous_6)","decl":{"start":{"line":106,"column":2},"end":{"line":106,"column":3}},"loc":{"start":{"line":106,"column":24},"end":{"line":114,"column":3}},"line":106},"7":{"name":"(anonymous_7)","decl":{"start":{"line":116,"column":2},"end":{"line":116,"column":3}},"loc":{"start":{"line":116,"column":16},"end":{"line":120,"column":3}},"line":116},"8":{"name":"(anonymous_8)","decl":{"start":{"line":122,"column":2},"end":{"line":122,"column":3}},"loc":{"start":{"line":122,"column":15},"end":{"line":127,"column":3}},"line":122},"9":{"name":"(anonymous_9)","decl":{"start":{"line":129,"column":2},"end":{"line":129,"column":3}},"loc":{"start":{"line":129,"column":17},"end":{"line":136,"column":3}},"line":129}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":34}},"type":"default-arg","locations":[{"start":{"line":11,"column":32},"end":{"line":11,"column":34}}],"line":11},"1":{"loc":{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":40,"column":5}},{"start":{"line":38,"column":4},"end":{"line":40,"column":5}}],"line":38},"2":{"loc":{"start":{"line":53,"column":4},"end":{"line":55,"column":5}},"type":"if","locations":[{"start":{"line":53,"column":4},"end":{"line":55,"column":5}},{"start":{"line":53,"column":4},"end":{"line":55,"column":5}}],"line":53},"3":{"loc":{"start":{"line":53,"column":8},"end":{"line":53,"column":59}},"type":"binary-expr","locations":[{"start":{"line":53,"column":8},"end":{"line":53,"column":27}},{"start":{"line":53,"column":32},"end":{"line":53,"column":43}},{"start":{"line":53,"column":47},"end":{"line":53,"column":58}}],"line":53},"4":{"loc":{"start":{"line":66,"column":4},"end":{"line":73,"column":5}},"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":73,"column":5}},{"start":{"line":66,"column":4},"end":{"line":73,"column":5}}],"line":66},"5":{"loc":{"start":{"line":67,"column":6},"end":{"line":68,"column":61}},"type":"binary-expr","locations":[{"start":{"line":67,"column":6},"end":{"line":67,"column":46}},{"start":{"line":68,"column":6},"end":{"line":68,"column":61}}],"line":67},"6":{"loc":{"start":{"line":74,"column":4},"end":{"line":80,"column":5}},"type":"if","locations":[{"start":{"line":74,"column":4},"end":{"line":80,"column":5}},{"start":{"line":74,"column":4},"end":{"line":80,"column":5}}],"line":74},"7":{"loc":{"start":{"line":75,"column":6},"end":{"line":76,"column":61}},"type":"binary-expr","locations":[{"start":{"line":75,"column":6},"end":{"line":75,"column":46}},{"start":{"line":76,"column":6},"end":{"line":76,"column":61}}],"line":75},"8":{"loc":{"start":{"line":81,"column":4},"end":{"line":86,"column":5}},"type":"if","locations":[{"start":{"line":81,"column":4},"end":{"line":86,"column":5}},{"start":{"line":81,"column":4},"end":{"line":86,"column":5}}],"line":81},"9":{"loc":{"start":{"line":81,"column":8},"end":{"line":81,"column":65}},"type":"binary-expr","locations":[{"start":{"line":81,"column":8},"end":{"line":81,"column":18}},{"start":{"line":81,"column":22},"end":{"line":81,"column":40}},{"start":{"line":81,"column":44},"end":{"line":81,"column":65}}],"line":81},"10":{"loc":{"start":{"line":107,"column":12},"end":{"line":107,"column":25}},"type":"default-arg","locations":[{"start":{"line":107,"column":24},"end":{"line":107,"column":25}}],"line":107},"11":{"loc":{"start":{"line":109,"column":4},"end":{"line":113,"column":5}},"type":"if","locations":[{"start":{"line":109,"column":4},"end":{"line":113,"column":5}},{"start":{"line":109,"column":4},"end":{"line":113,"column":5}}],"line":109},"12":{"loc":{"start":{"line":109,"column":8},"end":{"line":109,"column":38}},"type":"binary-expr","locations":[{"start":{"line":109,"column":8},"end":{"line":109,"column":22}},{"start":{"line":109,"column":26},"end":{"line":109,"column":38}}],"line":109},"13":{"loc":{"start":{"line":111,"column":11},"end":{"line":113,"column":5}},"type":"if","locations":[{"start":{"line":111,"column":11},"end":{"line":113,"column":5}},{"start":{"line":111,"column":11},"end":{"line":113,"column":5}}],"line":111}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0},"b":{"0":[0],"1":[0,0],"2":[0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0,0],"10":[0],"11":[0,0],"12":[0,0],"13":[0,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"ccc7e5f62c31e4bc4fd03603ce3ea3b5c0682a0d"} -,"/Users/loading/mycode/react-image-viewer/src/ImageSlides/index.jsx": {"path":"/Users/loading/mycode/react-image-viewer/src/ImageSlides/index.jsx","statementMap":{"0":{"start":{"line":9,"column":21},"end":{"line":9,"column":23}},"1":{"start":{"line":27,"column":38},"end":{"line":27,"column":48}},"2":{"start":{"line":28,"column":4},"end":{"line":31,"column":7}},"3":{"start":{"line":32,"column":4},"end":{"line":32,"column":52}},"4":{"start":{"line":36,"column":30},"end":{"line":36,"column":40}},"5":{"start":{"line":37,"column":51},"end":{"line":37,"column":59}},"6":{"start":{"line":38,"column":4},"end":{"line":42,"column":5}},"7":{"start":{"line":39,"column":6},"end":{"line":41,"column":9}},"8":{"start":{"line":43,"column":4},"end":{"line":47,"column":5}},"9":{"start":{"line":44,"column":6},"end":{"line":46,"column":9}},"10":{"start":{"line":51,"column":4},"end":{"line":89,"column":5}},"11":{"start":{"line":52,"column":35},"end":{"line":52,"column":45}},"12":{"start":{"line":53,"column":30},"end":{"line":53,"column":53}},"13":{"start":{"line":54,"column":6},"end":{"line":54,"column":28}},"14":{"start":{"line":55,"column":6},"end":{"line":55,"column":49}},"15":{"start":{"line":56,"column":20},"end":{"line":56,"column":42}},"16":{"start":{"line":57,"column":6},"end":{"line":59,"column":7}},"17":{"start":{"line":58,"column":8},"end":{"line":58,"column":26}},"18":{"start":{"line":60,"column":6},"end":{"line":62,"column":9}},"19":{"start":{"line":61,"column":8},"end":{"line":61,"column":30}},"20":{"start":{"line":63,"column":6},"end":{"line":63,"column":60}},"21":{"start":{"line":64,"column":6},"end":{"line":88,"column":9}},"22":{"start":{"line":65,"column":29},"end":{"line":65,"column":62}},"23":{"start":{"line":66,"column":8},"end":{"line":81,"column":9}},"24":{"start":{"line":67,"column":10},"end":{"line":73,"column":11}},"25":{"start":{"line":68,"column":12},"end":{"line":69,"column":74}},"26":{"start":{"line":70,"column":17},"end":{"line":73,"column":11}},"27":{"start":{"line":71,"column":12},"end":{"line":72,"column":70}},"28":{"start":{"line":74,"column":10},"end":{"line":74,"column":22}},"29":{"start":{"line":75,"column":15},"end":{"line":81,"column":9}},"30":{"start":{"line":76,"column":10},"end":{"line":76,"column":80}},"31":{"start":{"line":77,"column":10},"end":{"line":79,"column":11}},"32":{"start":{"line":78,"column":12},"end":{"line":78,"column":42}},"33":{"start":{"line":80,"column":10},"end":{"line":80,"column":22}},"34":{"start":{"line":82,"column":8},"end":{"line":82,"column":38}},"35":{"start":{"line":83,"column":8},"end":{"line":85,"column":45}},"36":{"start":{"line":86,"column":8},"end":{"line":86,"column":38}},"37":{"start":{"line":87,"column":8},"end":{"line":87,"column":30}},"38":{"start":{"line":93,"column":4},"end":{"line":95,"column":5}},"39":{"start":{"line":94,"column":6},"end":{"line":94,"column":31}},"40":{"start":{"line":99,"column":4},"end":{"line":99,"column":25}},"41":{"start":{"line":103,"column":22},"end":{"line":103,"column":32}},"42":{"start":{"line":104,"column":23},"end":{"line":104,"column":33}},"43":{"start":{"line":105,"column":23},"end":{"line":105,"column":76}},"44":{"start":{"line":106,"column":23},"end":{"line":106,"column":52}},"45":{"start":{"line":107,"column":17},"end":{"line":107,"column":60}},"46":{"start":{"line":108,"column":4},"end":{"line":112,"column":5}},"47":{"start":{"line":109,"column":6},"end":{"line":109,"column":21}},"48":{"start":{"line":110,"column":11},"end":{"line":112,"column":5}},"49":{"start":{"line":111,"column":6},"end":{"line":111,"column":37}},"50":{"start":{"line":113,"column":4},"end":{"line":113,"column":18}},"51":{"start":{"line":117,"column":4},"end":{"line":117,"column":25}},"52":{"start":{"line":118,"column":19},"end":{"line":118,"column":46}},"53":{"start":{"line":119,"column":18},"end":{"line":119,"column":64}},"54":{"start":{"line":120,"column":4},"end":{"line":120,"column":67}},"55":{"start":{"line":122,"column":6},"end":{"line":123,"column":74}},"56":{"start":{"line":124,"column":4},"end":{"line":124,"column":56}},"57":{"start":{"line":128,"column":33},"end":{"line":128,"column":43}},"58":{"start":{"line":129,"column":4},"end":{"line":131,"column":5}},"59":{"start":{"line":130,"column":6},"end":{"line":130,"column":38}},"60":{"start":{"line":132,"column":28},"end":{"line":145,"column":6}},"61":{"start":{"line":136,"column":8},"end":{"line":138,"column":9}},"62":{"start":{"line":137,"column":10},"end":{"line":137,"column":74}},"63":{"start":{"line":141,"column":8},"end":{"line":143,"column":9}},"64":{"start":{"line":142,"column":10},"end":{"line":142,"column":73}},"65":{"start":{"line":146,"column":28},"end":{"line":146,"column":65}},"66":{"start":{"line":147,"column":4},"end":{"line":149,"column":7}},"67":{"start":{"line":148,"column":6},"end":{"line":148,"column":35}},"68":{"start":{"line":150,"column":4},"end":{"line":152,"column":7}},"69":{"start":{"line":151,"column":6},"end":{"line":151,"column":49}},"70":{"start":{"line":153,"column":4},"end":{"line":160,"column":7}},"71":{"start":{"line":154,"column":6},"end":{"line":159,"column":7}},"72":{"start":{"line":155,"column":8},"end":{"line":155,"column":32}},"73":{"start":{"line":157,"column":8},"end":{"line":157,"column":44}},"74":{"start":{"line":158,"column":8},"end":{"line":158,"column":38}},"75":{"start":{"line":161,"column":4},"end":{"line":163,"column":7}},"76":{"start":{"line":162,"column":6},"end":{"line":162,"column":36}},"77":{"start":{"line":167,"column":22},"end":{"line":167,"column":32}},"78":{"start":{"line":168,"column":23},"end":{"line":168,"column":33}},"79":{"start":{"line":169,"column":4},"end":{"line":177,"column":5}},"80":{"start":{"line":170,"column":6},"end":{"line":175,"column":8}},"81":{"start":{"line":176,"column":6},"end":{"line":176,"column":38}},"82":{"start":{"line":181,"column":22},"end":{"line":181,"column":32}},"83":{"start":{"line":182,"column":23},"end":{"line":182,"column":33}},"84":{"start":{"line":183,"column":4},"end":{"line":191,"column":5}},"85":{"start":{"line":184,"column":6},"end":{"line":189,"column":8}},"86":{"start":{"line":190,"column":6},"end":{"line":190,"column":38}},"87":{"start":{"line":195,"column":4},"end":{"line":198,"column":5}},"88":{"start":{"line":196,"column":6},"end":{"line":196,"column":70}},"89":{"start":{"line":197,"column":6},"end":{"line":197,"column":69}},"90":{"start":{"line":202,"column":4},"end":{"line":217,"column":5}},"91":{"start":{"line":203,"column":21},"end":{"line":203,"column":32}},"92":{"start":{"line":204,"column":6},"end":{"line":216,"column":9}},"93":{"start":{"line":205,"column":8},"end":{"line":205,"column":32}},"94":{"start":{"line":206,"column":8},"end":{"line":206,"column":32}},"95":{"start":{"line":207,"column":8},"end":{"line":207,"column":25}},"96":{"start":{"line":209,"column":8},"end":{"line":209,"column":74}},"97":{"start":{"line":210,"column":8},"end":{"line":215,"column":11}},"98":{"start":{"line":221,"column":22},"end":{"line":221,"column":32}},"99":{"start":{"line":222,"column":24},"end":{"line":222,"column":34}},"100":{"start":{"line":223,"column":4},"end":{"line":225,"column":7}},"101":{"start":{"line":226,"column":4},"end":{"line":226,"column":39}},"102":{"start":{"line":226,"column":17},"end":{"line":226,"column":39}},"103":{"start":{"line":230,"column":38},"end":{"line":230,"column":48}},"104":{"start":{"line":231,"column":23},"end":{"line":231,"column":33}},"105":{"start":{"line":232,"column":23},"end":{"line":232,"column":76}},"106":{"start":{"line":233,"column":23},"end":{"line":233,"column":52}},"107":{"start":{"line":235,"column":6},"end":{"line":241,"column":12}},"108":{"start":{"line":243,"column":4},"end":{"line":285,"column":13}},"109":{"start":{"line":265,"column":14},"end":{"line":280,"column":20}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":26,"column":2},"end":{"line":26,"column":3}},"loc":{"start":{"line":26,"column":23},"end":{"line":33,"column":3}},"line":26},"1":{"name":"(anonymous_1)","decl":{"start":{"line":35,"column":2},"end":{"line":35,"column":3}},"loc":{"start":{"line":35,"column":38},"end":{"line":48,"column":3}},"line":35},"2":{"name":"(anonymous_2)","decl":{"start":{"line":50,"column":17},"end":{"line":50,"column":18}},"loc":{"start":{"line":50,"column":23},"end":{"line":90,"column":3}},"line":50},"3":{"name":"(anonymous_3)","decl":{"start":{"line":60,"column":39},"end":{"line":60,"column":40}},"loc":{"start":{"line":60,"column":45},"end":{"line":62,"column":7}},"line":60},"4":{"name":"(anonymous_4)","decl":{"start":{"line":64,"column":37},"end":{"line":64,"column":38}},"loc":{"start":{"line":64,"column":43},"end":{"line":88,"column":7}},"line":64},"5":{"name":"(anonymous_5)","decl":{"start":{"line":92,"column":15},"end":{"line":92,"column":16}},"loc":{"start":{"line":92,"column":21},"end":{"line":96,"column":3}},"line":92},"6":{"name":"(anonymous_6)","decl":{"start":{"line":98,"column":16},"end":{"line":98,"column":17}},"loc":{"start":{"line":98,"column":22},"end":{"line":100,"column":3}},"line":98},"7":{"name":"(anonymous_7)","decl":{"start":{"line":102,"column":2},"end":{"line":102,"column":3}},"loc":{"start":{"line":102,"column":19},"end":{"line":114,"column":3}},"line":102},"8":{"name":"(anonymous_8)","decl":{"start":{"line":116,"column":20},"end":{"line":116,"column":21}},"loc":{"start":{"line":116,"column":30},"end":{"line":125,"column":3}},"line":116},"9":{"name":"(anonymous_9)","decl":{"start":{"line":127,"column":2},"end":{"line":127,"column":3}},"loc":{"start":{"line":127,"column":22},"end":{"line":164,"column":3}},"line":127},"10":{"name":"(anonymous_10)","decl":{"start":{"line":135,"column":20},"end":{"line":135,"column":21}},"loc":{"start":{"line":135,"column":26},"end":{"line":139,"column":7}},"line":135},"11":{"name":"(anonymous_11)","decl":{"start":{"line":140,"column":21},"end":{"line":140,"column":22}},"loc":{"start":{"line":140,"column":27},"end":{"line":144,"column":7}},"line":140},"12":{"name":"(anonymous_12)","decl":{"start":{"line":147,"column":36},"end":{"line":147,"column":37}},"loc":{"start":{"line":147,"column":46},"end":{"line":149,"column":5}},"line":147},"13":{"name":"(anonymous_13)","decl":{"start":{"line":150,"column":32},"end":{"line":150,"column":33}},"loc":{"start":{"line":150,"column":41},"end":{"line":152,"column":5}},"line":150},"14":{"name":"(anonymous_14)","decl":{"start":{"line":153,"column":36},"end":{"line":153,"column":37}},"loc":{"start":{"line":153,"column":42},"end":{"line":160,"column":5}},"line":153},"15":{"name":"(anonymous_15)","decl":{"start":{"line":161,"column":35},"end":{"line":161,"column":36}},"loc":{"start":{"line":161,"column":41},"end":{"line":163,"column":5}},"line":161},"16":{"name":"(anonymous_16)","decl":{"start":{"line":166,"column":9},"end":{"line":166,"column":10}},"loc":{"start":{"line":166,"column":15},"end":{"line":178,"column":3}},"line":166},"17":{"name":"(anonymous_17)","decl":{"start":{"line":180,"column":9},"end":{"line":180,"column":10}},"loc":{"start":{"line":180,"column":15},"end":{"line":192,"column":3}},"line":180},"18":{"name":"(anonymous_18)","decl":{"start":{"line":194,"column":11},"end":{"line":194,"column":12}},"loc":{"start":{"line":194,"column":17},"end":{"line":199,"column":3}},"line":194},"19":{"name":"(anonymous_19)","decl":{"start":{"line":201,"column":2},"end":{"line":201,"column":3}},"loc":{"start":{"line":201,"column":15},"end":{"line":218,"column":3}},"line":201},"20":{"name":"(anonymous_20)","decl":{"start":{"line":204,"column":18},"end":{"line":204,"column":19}},"loc":{"start":{"line":204,"column":39},"end":{"line":208,"column":7}},"line":204},"21":{"name":"(anonymous_21)","decl":{"start":{"line":208,"column":14},"end":{"line":208,"column":15}},"loc":{"start":{"line":208,"column":20},"end":{"line":216,"column":7}},"line":208},"22":{"name":"(anonymous_22)","decl":{"start":{"line":220,"column":18},"end":{"line":220,"column":19}},"loc":{"start":{"line":220,"column":27},"end":{"line":227,"column":3}},"line":220},"23":{"name":"(anonymous_23)","decl":{"start":{"line":229,"column":2},"end":{"line":229,"column":3}},"loc":{"start":{"line":229,"column":11},"end":{"line":286,"column":3}},"line":229},"24":{"name":"(anonymous_24)","decl":{"start":{"line":264,"column":54},"end":{"line":264,"column":55}},"loc":{"start":{"line":265,"column":14},"end":{"line":280,"column":20}},"line":265}},"branchMap":{"0":{"loc":{"start":{"line":29,"column":13},"end":{"line":29,"column":38}},"type":"binary-expr","locations":[{"start":{"line":29,"column":13},"end":{"line":29,"column":18}},{"start":{"line":29,"column":22},"end":{"line":29,"column":38}}],"line":29},"1":{"loc":{"start":{"line":32,"column":24},"end":{"line":32,"column":49}},"type":"binary-expr","locations":[{"start":{"line":32,"column":24},"end":{"line":32,"column":29}},{"start":{"line":32,"column":33},"end":{"line":32,"column":49}}],"line":32},"2":{"loc":{"start":{"line":38,"column":4},"end":{"line":42,"column":5}},"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":42,"column":5}},{"start":{"line":38,"column":4},"end":{"line":42,"column":5}}],"line":38},"3":{"loc":{"start":{"line":43,"column":4},"end":{"line":47,"column":5}},"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":47,"column":5}},{"start":{"line":43,"column":4},"end":{"line":47,"column":5}}],"line":43},"4":{"loc":{"start":{"line":43,"column":8},"end":{"line":43,"column":38}},"type":"binary-expr","locations":[{"start":{"line":43,"column":8},"end":{"line":43,"column":16}},{"start":{"line":43,"column":20},"end":{"line":43,"column":38}}],"line":43},"5":{"loc":{"start":{"line":51,"column":4},"end":{"line":89,"column":5}},"type":"if","locations":[{"start":{"line":51,"column":4},"end":{"line":89,"column":5}},{"start":{"line":51,"column":4},"end":{"line":89,"column":5}}],"line":51},"6":{"loc":{"start":{"line":57,"column":6},"end":{"line":59,"column":7}},"type":"if","locations":[{"start":{"line":57,"column":6},"end":{"line":59,"column":7}},{"start":{"line":57,"column":6},"end":{"line":59,"column":7}}],"line":57},"7":{"loc":{"start":{"line":66,"column":8},"end":{"line":81,"column":9}},"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":81,"column":9}},{"start":{"line":66,"column":8},"end":{"line":81,"column":9}}],"line":66},"8":{"loc":{"start":{"line":67,"column":10},"end":{"line":73,"column":11}},"type":"if","locations":[{"start":{"line":67,"column":10},"end":{"line":73,"column":11}},{"start":{"line":67,"column":10},"end":{"line":73,"column":11}}],"line":67},"9":{"loc":{"start":{"line":67,"column":14},"end":{"line":67,"column":65}},"type":"binary-expr","locations":[{"start":{"line":67,"column":14},"end":{"line":67,"column":39}},{"start":{"line":67,"column":43},"end":{"line":67,"column":65}}],"line":67},"10":{"loc":{"start":{"line":70,"column":17},"end":{"line":73,"column":11}},"type":"if","locations":[{"start":{"line":70,"column":17},"end":{"line":73,"column":11}},{"start":{"line":70,"column":17},"end":{"line":73,"column":11}}],"line":70},"11":{"loc":{"start":{"line":75,"column":15},"end":{"line":81,"column":9}},"type":"if","locations":[{"start":{"line":75,"column":15},"end":{"line":81,"column":9}},{"start":{"line":75,"column":15},"end":{"line":81,"column":9}}],"line":75},"12":{"loc":{"start":{"line":77,"column":10},"end":{"line":79,"column":11}},"type":"if","locations":[{"start":{"line":77,"column":10},"end":{"line":79,"column":11}},{"start":{"line":77,"column":10},"end":{"line":79,"column":11}}],"line":77},"13":{"loc":{"start":{"line":93,"column":4},"end":{"line":95,"column":5}},"type":"if","locations":[{"start":{"line":93,"column":4},"end":{"line":95,"column":5}},{"start":{"line":93,"column":4},"end":{"line":95,"column":5}}],"line":93},"14":{"loc":{"start":{"line":105,"column":23},"end":{"line":105,"column":76}},"type":"cond-expr","locations":[{"start":{"line":105,"column":51},"end":{"line":105,"column":64}},{"start":{"line":105,"column":67},"end":{"line":105,"column":76}}],"line":105},"15":{"loc":{"start":{"line":106,"column":23},"end":{"line":106,"column":52}},"type":"cond-expr","locations":[{"start":{"line":106,"column":39},"end":{"line":106,"column":40}},{"start":{"line":106,"column":43},"end":{"line":106,"column":52}}],"line":106},"16":{"loc":{"start":{"line":108,"column":4},"end":{"line":112,"column":5}},"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":112,"column":5}},{"start":{"line":108,"column":4},"end":{"line":112,"column":5}}],"line":108},"17":{"loc":{"start":{"line":110,"column":11},"end":{"line":112,"column":5}},"type":"if","locations":[{"start":{"line":110,"column":11},"end":{"line":112,"column":5}},{"start":{"line":110,"column":11},"end":{"line":112,"column":5}}],"line":110},"18":{"loc":{"start":{"line":119,"column":18},"end":{"line":119,"column":64}},"type":"cond-expr","locations":[{"start":{"line":119,"column":37},"end":{"line":119,"column":59}},{"start":{"line":119,"column":62},"end":{"line":119,"column":64}}],"line":119},"19":{"loc":{"start":{"line":129,"column":4},"end":{"line":131,"column":5}},"type":"if","locations":[{"start":{"line":129,"column":4},"end":{"line":131,"column":5}},{"start":{"line":129,"column":4},"end":{"line":131,"column":5}}],"line":129},"20":{"loc":{"start":{"line":136,"column":8},"end":{"line":138,"column":9}},"type":"if","locations":[{"start":{"line":136,"column":8},"end":{"line":138,"column":9}},{"start":{"line":136,"column":8},"end":{"line":138,"column":9}}],"line":136},"21":{"loc":{"start":{"line":136,"column":12},"end":{"line":136,"column":54}},"type":"binary-expr","locations":[{"start":{"line":136,"column":12},"end":{"line":136,"column":36}},{"start":{"line":136,"column":40},"end":{"line":136,"column":54}}],"line":136},"22":{"loc":{"start":{"line":141,"column":8},"end":{"line":143,"column":9}},"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":143,"column":9}},{"start":{"line":141,"column":8},"end":{"line":143,"column":9}}],"line":141},"23":{"loc":{"start":{"line":141,"column":12},"end":{"line":141,"column":54}},"type":"binary-expr","locations":[{"start":{"line":141,"column":12},"end":{"line":141,"column":36}},{"start":{"line":141,"column":40},"end":{"line":141,"column":54}}],"line":141},"24":{"loc":{"start":{"line":154,"column":6},"end":{"line":159,"column":7}},"type":"if","locations":[{"start":{"line":154,"column":6},"end":{"line":159,"column":7}},{"start":{"line":154,"column":6},"end":{"line":159,"column":7}}],"line":154},"25":{"loc":{"start":{"line":169,"column":4},"end":{"line":177,"column":5}},"type":"if","locations":[{"start":{"line":169,"column":4},"end":{"line":177,"column":5}},{"start":{"line":169,"column":4},"end":{"line":177,"column":5}}],"line":169},"26":{"loc":{"start":{"line":183,"column":4},"end":{"line":191,"column":5}},"type":"if","locations":[{"start":{"line":183,"column":4},"end":{"line":191,"column":5}},{"start":{"line":183,"column":4},"end":{"line":191,"column":5}}],"line":183},"27":{"loc":{"start":{"line":195,"column":4},"end":{"line":198,"column":5}},"type":"if","locations":[{"start":{"line":195,"column":4},"end":{"line":198,"column":5}},{"start":{"line":195,"column":4},"end":{"line":198,"column":5}}],"line":195},"28":{"loc":{"start":{"line":202,"column":4},"end":{"line":217,"column":5}},"type":"if","locations":[{"start":{"line":202,"column":4},"end":{"line":217,"column":5}},{"start":{"line":202,"column":4},"end":{"line":217,"column":5}}],"line":202},"29":{"loc":{"start":{"line":202,"column":8},"end":{"line":202,"column":38}},"type":"binary-expr","locations":[{"start":{"line":202,"column":8},"end":{"line":202,"column":11}},{"start":{"line":202,"column":15},"end":{"line":202,"column":38}}],"line":202},"30":{"loc":{"start":{"line":226,"column":4},"end":{"line":226,"column":39}},"type":"if","locations":[{"start":{"line":226,"column":4},"end":{"line":226,"column":39}},{"start":{"line":226,"column":4},"end":{"line":226,"column":39}}],"line":226},"31":{"loc":{"start":{"line":232,"column":23},"end":{"line":232,"column":76}},"type":"cond-expr","locations":[{"start":{"line":232,"column":51},"end":{"line":232,"column":64}},{"start":{"line":232,"column":67},"end":{"line":232,"column":76}}],"line":232},"32":{"loc":{"start":{"line":233,"column":23},"end":{"line":233,"column":52}},"type":"cond-expr","locations":[{"start":{"line":233,"column":39},"end":{"line":233,"column":40}},{"start":{"line":233,"column":43},"end":{"line":233,"column":52}}],"line":233},"33":{"loc":{"start":{"line":243,"column":11},"end":{"line":285,"column":12}},"type":"cond-expr","locations":[{"start":{"line":244,"column":6},"end":{"line":284,"column":16}},{"start":{"line":285,"column":8},"end":{"line":285,"column":12}}],"line":243},"34":{"loc":{"start":{"line":250,"column":11},"end":{"line":255,"column":11}},"type":"binary-expr","locations":[{"start":{"line":250,"column":11},"end":{"line":250,"column":28}},{"start":{"line":251,"column":12},"end":{"line":254,"column":18}}],"line":250},"35":{"loc":{"start":{"line":261,"column":18},"end":{"line":261,"column":67}},"type":"cond-expr","locations":[{"start":{"line":261,"column":36},"end":{"line":261,"column":63}},{"start":{"line":261,"column":66},"end":{"line":261,"column":67}}],"line":261},"36":{"loc":{"start":{"line":270,"column":17},"end":{"line":279,"column":27}},"type":"cond-expr","locations":[{"start":{"line":271,"column":18},"end":{"line":278,"column":25}},{"start":{"line":279,"column":20},"end":{"line":279,"column":27}}],"line":270}},"s":{"0":1,"1":3,"2":3,"3":3,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":4,"42":4,"43":4,"44":4,"45":4,"46":4,"47":2,"48":2,"49":0,"50":4,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":3,"91":1,"92":1,"93":1,"94":1,"95":1,"96":1,"97":1,"98":0,"99":0,"100":0,"101":0,"102":0,"103":4,"104":4,"105":4,"106":4,"107":4,"108":4,"109":10},"f":{"0":3,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":4,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":3,"20":1,"21":1,"22":0,"23":4,"24":10},"b":{"0":[3,2],"1":[3,2],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,4],"15":[2,2],"16":[2,2],"17":[0,2],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[1,2],"29":[3,1],"30":[0,0],"31":[0,4],"32":[2,2],"33":[4,0],"34":[4,4],"35":[0,4],"36":[1,9]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"c23f3e3584f7987ff958d8a2be52d521e46077c7"} -,"/Users/loading/mycode/react-image-viewer/src/Overlay/index.jsx": {"path":"/Users/loading/mycode/react-image-viewer/src/Overlay/index.jsx","statementMap":{"0":{"start":{"line":5,"column":27},"end":{"line":5,"column":31}},"1":{"start":{"line":6,"column":21},"end":{"line":6,"column":22}},"2":{"start":{"line":12,"column":6},"end":{"line":12,"column":27}},"3":{"start":{"line":18,"column":4},"end":{"line":20,"column":5}},"4":{"start":{"line":19,"column":6},"end":{"line":19,"column":30}},"5":{"start":{"line":21,"column":19},"end":{"line":21,"column":46}},"6":{"start":{"line":22,"column":4},"end":{"line":22,"column":34}},"7":{"start":{"line":26,"column":4},"end":{"line":32,"column":5}},"8":{"start":{"line":27,"column":6},"end":{"line":31,"column":7}},"9":{"start":{"line":28,"column":8},"end":{"line":28,"column":32}},"10":{"start":{"line":30,"column":8},"end":{"line":30,"column":30}},"11":{"start":{"line":33,"column":26},"end":{"line":33,"column":53}},"12":{"start":{"line":34,"column":22},"end":{"line":34,"column":47}},"13":{"start":{"line":36,"column":4},"end":{"line":39,"column":5}},"14":{"start":{"line":37,"column":6},"end":{"line":37,"column":43}},"15":{"start":{"line":38,"column":6},"end":{"line":38,"column":39}},"16":{"start":{"line":43,"column":19},"end":{"line":43,"column":46}},"17":{"start":{"line":44,"column":4},"end":{"line":44,"column":44}},"18":{"start":{"line":44,"column":37},"end":{"line":44,"column":44}},"19":{"start":{"line":45,"column":4},"end":{"line":45,"column":34}},"20":{"start":{"line":46,"column":4},"end":{"line":46,"column":26}},"21":{"start":{"line":50,"column":4},"end":{"line":52,"column":5}},"22":{"start":{"line":51,"column":6},"end":{"line":51,"column":13}},"23":{"start":{"line":53,"column":4},"end":{"line":53,"column":24}},"24":{"start":{"line":54,"column":4},"end":{"line":58,"column":5}},"25":{"start":{"line":55,"column":19},"end":{"line":55,"column":32}},"26":{"start":{"line":56,"column":6},"end":{"line":56,"column":49}},"27":{"start":{"line":57,"column":6},"end":{"line":57,"column":37}},"28":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"29":{"start":{"line":63,"column":6},"end":{"line":63,"column":26}},"30":{"start":{"line":64,"column":6},"end":{"line":64,"column":26}},"31":{"start":{"line":67,"column":4},"end":{"line":71,"column":5}},"32":{"start":{"line":68,"column":19},"end":{"line":68,"column":32}},"33":{"start":{"line":69,"column":6},"end":{"line":69,"column":55}},"34":{"start":{"line":70,"column":6},"end":{"line":70,"column":34}},"35":{"start":{"line":77,"column":8},"end":{"line":77,"column":18}},"36":{"start":{"line":78,"column":4},"end":{"line":96,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":17,"column":2},"end":{"line":17,"column":3}},"loc":{"start":{"line":17,"column":22},"end":{"line":23,"column":3}},"line":17},"1":{"name":"(anonymous_1)","decl":{"start":{"line":25,"column":2},"end":{"line":25,"column":3}},"loc":{"start":{"line":25,"column":38},"end":{"line":40,"column":3}},"line":25},"2":{"name":"(anonymous_2)","decl":{"start":{"line":42,"column":2},"end":{"line":42,"column":3}},"loc":{"start":{"line":42,"column":25},"end":{"line":47,"column":3}},"line":42},"3":{"name":"(anonymous_3)","decl":{"start":{"line":49,"column":2},"end":{"line":49,"column":3}},"loc":{"start":{"line":49,"column":21},"end":{"line":59,"column":3}},"line":49},"4":{"name":"(anonymous_4)","decl":{"start":{"line":61,"column":2},"end":{"line":61,"column":3}},"loc":{"start":{"line":61,"column":19},"end":{"line":72,"column":3}},"line":61},"5":{"name":"(anonymous_5)","decl":{"start":{"line":74,"column":2},"end":{"line":74,"column":3}},"loc":{"start":{"line":74,"column":11},"end":{"line":97,"column":3}},"line":74}},"branchMap":{"0":{"loc":{"start":{"line":18,"column":4},"end":{"line":20,"column":5}},"type":"if","locations":[{"start":{"line":18,"column":4},"end":{"line":20,"column":5}},{"start":{"line":18,"column":4},"end":{"line":20,"column":5}}],"line":18},"1":{"loc":{"start":{"line":26,"column":4},"end":{"line":32,"column":5}},"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":32,"column":5}},{"start":{"line":26,"column":4},"end":{"line":32,"column":5}}],"line":26},"2":{"loc":{"start":{"line":27,"column":6},"end":{"line":31,"column":7}},"type":"if","locations":[{"start":{"line":27,"column":6},"end":{"line":31,"column":7}},{"start":{"line":27,"column":6},"end":{"line":31,"column":7}}],"line":27},"3":{"loc":{"start":{"line":36,"column":4},"end":{"line":39,"column":5}},"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":39,"column":5}},{"start":{"line":36,"column":4},"end":{"line":39,"column":5}}],"line":36},"4":{"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":44}},"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":44,"column":44}},{"start":{"line":44,"column":4},"end":{"line":44,"column":44}}],"line":44},"5":{"loc":{"start":{"line":44,"column":8},"end":{"line":44,"column":35}},"type":"binary-expr","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":18}},{"start":{"line":44,"column":22},"end":{"line":44,"column":35}}],"line":44},"6":{"loc":{"start":{"line":50,"column":4},"end":{"line":52,"column":5}},"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":52,"column":5}},{"start":{"line":50,"column":4},"end":{"line":52,"column":5}}],"line":50},"7":{"loc":{"start":{"line":54,"column":4},"end":{"line":58,"column":5}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":58,"column":5}},{"start":{"line":54,"column":4},"end":{"line":58,"column":5}}],"line":54},"8":{"loc":{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":65,"column":5}},{"start":{"line":62,"column":4},"end":{"line":65,"column":5}}],"line":62},"9":{"loc":{"start":{"line":67,"column":4},"end":{"line":71,"column":5}},"type":"if","locations":[{"start":{"line":67,"column":4},"end":{"line":71,"column":5}},{"start":{"line":67,"column":4},"end":{"line":71,"column":5}}],"line":67},"10":{"loc":{"start":{"line":67,"column":8},"end":{"line":67,"column":61}},"type":"binary-expr","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":28}},{"start":{"line":67,"column":32},"end":{"line":67,"column":61}}],"line":67},"11":{"loc":{"start":{"line":69,"column":28},"end":{"line":69,"column":54}},"type":"binary-expr","locations":[{"start":{"line":69,"column":28},"end":{"line":69,"column":48}},{"start":{"line":69,"column":52},"end":{"line":69,"column":54}}],"line":69}},"s":{"0":1,"1":1,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0},"f":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"b6f525515b9a2368f2bef5259953612123fd809b"} -,"/Users/loading/mycode/react-image-viewer/src/utils/resizeImage.js": {"path":"/Users/loading/mycode/react-image-viewer/src/utils/resizeImage.js","statementMap":{"0":{"start":{"line":2,"column":22},"end":{"line":2,"column":39}},"1":{"start":{"line":3,"column":23},"end":{"line":3,"column":41}},"2":{"start":{"line":4,"column":22},"end":{"line":4,"column":48}},"3":{"start":{"line":5,"column":21},"end":{"line":5,"column":45}},"4":{"start":{"line":6,"column":2},"end":{"line":11,"column":3}},"5":{"start":{"line":7,"column":4},"end":{"line":10,"column":6}},"6":{"start":{"line":12,"column":2},"end":{"line":15,"column":4}}},"fnMap":{"0":{"name":"resizeImage","decl":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}},"loc":{"start":{"line":1,"column":61},"end":{"line":16,"column":1}},"line":1}},"branchMap":{"0":{"loc":{"start":{"line":6,"column":2},"end":{"line":11,"column":3}},"type":"if","locations":[{"start":{"line":6,"column":2},"end":{"line":11,"column":3}},{"start":{"line":6,"column":2},"end":{"line":11,"column":3}}],"line":6},"1":{"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":66}},"type":"cond-expr","locations":[{"start":{"line":8,"column":40},"end":{"line":8,"column":46}},{"start":{"line":8,"column":49},"end":{"line":8,"column":66}}],"line":8},"2":{"loc":{"start":{"line":14,"column":12},"end":{"line":14,"column":67}},"type":"cond-expr","locations":[{"start":{"line":14,"column":41},"end":{"line":14,"column":47}},{"start":{"line":14,"column":50},"end":{"line":14,"column":67}}],"line":14}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":1},"f":{"0":1},"b":{"0":[0,1],"1":[0,0],"2":[0,1]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"a3790e71821ca120c8d58431a243231259bd9a01"} -,"/Users/loading/mycode/react-image-viewer/src/utils/touchEmulator.js": {"path":"/Users/loading/mycode/react-image-viewer/src/utils/touchEmulator.js","statementMap":{"0":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}},"1":{"start":{"line":4,"column":4},"end":{"line":4,"column":27}},"2":{"start":{"line":5,"column":4},"end":{"line":5,"column":28}},"3":{"start":{"line":8,"column":4},"end":{"line":24,"column":7}},"4":{"start":{"line":9,"column":6},"end":{"line":20,"column":7}},"5":{"start":{"line":10,"column":22},"end":{"line":14,"column":9}},"6":{"start":{"line":15,"column":25},"end":{"line":15,"column":52}},"7":{"start":{"line":16,"column":8},"end":{"line":16,"column":35}},"8":{"start":{"line":17,"column":8},"end":{"line":17,"column":42}},"9":{"start":{"line":18,"column":8},"end":{"line":18,"column":31}},"10":{"start":{"line":19,"column":8},"end":{"line":19,"column":35}},"11":{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},"12":{"start":{"line":22,"column":8},"end":{"line":22,"column":25}},"13":{"start":{"line":26,"column":2},"end":{"line":26,"column":43}},"14":{"start":{"line":27,"column":2},"end":{"line":27,"column":42}},"15":{"start":{"line":28,"column":2},"end":{"line":28,"column":40}},"16":{"start":{"line":29,"column":2},"end":{"line":29,"column":41}},"17":{"start":{"line":30,"column":2},"end":{"line":30,"column":43}},"18":{"start":{"line":31,"column":2},"end":{"line":31,"column":62}},"19":{"start":{"line":32,"column":2},"end":{"line":32,"column":62}},"20":{"start":{"line":33,"column":2},"end":{"line":33,"column":60}},"21":{"start":{"line":34,"column":2},"end":{"line":34,"column":61}}},"fnMap":{"0":{"name":"touchEmulator","decl":{"start":{"line":1,"column":24},"end":{"line":1,"column":37}},"loc":{"start":{"line":1,"column":42},"end":{"line":35,"column":1}},"line":1},"1":{"name":"preventMouseEvents","decl":{"start":{"line":3,"column":11},"end":{"line":3,"column":29}},"loc":{"start":{"line":3,"column":37},"end":{"line":6,"column":3}},"line":3},"2":{"name":"trigger","decl":{"start":{"line":7,"column":11},"end":{"line":7,"column":18}},"loc":{"start":{"line":7,"column":54},"end":{"line":25,"column":3}},"line":7},"3":{"name":"(anonymous_3)","decl":{"start":{"line":8,"column":36},"end":{"line":8,"column":37}},"loc":{"start":{"line":8,"column":45},"end":{"line":24,"column":5}},"line":8}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":6},"end":{"line":20,"column":7}},"type":"if","locations":[{"start":{"line":9,"column":6},"end":{"line":20,"column":7}},{"start":{"line":9,"column":6},"end":{"line":20,"column":7}}],"line":9},"1":{"loc":{"start":{"line":9,"column":10},"end":{"line":9,"column":45}},"type":"binary-expr","locations":[{"start":{"line":9,"column":10},"end":{"line":9,"column":37}},{"start":{"line":9,"column":41},"end":{"line":9,"column":45}}],"line":9},"2":{"loc":{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},"type":"if","locations":[{"start":{"line":21,"column":6},"end":{"line":23,"column":7}},{"start":{"line":21,"column":6},"end":{"line":23,"column":7}}],"line":21}},"s":{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0},"f":{"0":0,"1":0,"2":0,"3":0},"b":{"0":[0,0],"1":[0,0],"2":[0,0]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"5f3e20e211c8fa2c503ae45f2d02e00179ad6049"} -} diff --git a/coverage/lcov-report/ImageControllerCreator/index.html b/coverage/lcov-report/ImageControllerCreator/index.html deleted file mode 100644 index daa41e6..0000000 --- a/coverage/lcov-report/ImageControllerCreator/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for ImageControllerCreator - - - - - - - -
-
-

- All files ImageControllerCreator -

-
-
- 0% - Statements - 0/50 -
-
- 0% - Branches - 0/28 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/50 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.js
0%0/500%0/280%0/100%0/50
-
-
- - - - - - - diff --git a/coverage/lcov-report/ImageControllerCreator/index.js.html b/coverage/lcov-report/ImageControllerCreator/index.js.html deleted file mode 100644 index 9c29e65..0000000 --- a/coverage/lcov-report/ImageControllerCreator/index.js.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - Code coverage report for ImageControllerCreator/index.js - - - - - - - -
-
-

- All files / ImageControllerCreator index.js -

-
-
- 0% - Statements - 0/50 -
-
- 0% - Branches - 0/28 -
-
- 0% - Functions - 0/10 -
-
- 0% - Lines - 0/50 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
export default class ImageControllerCreator {
-  state = {
-    scale: 1,
-    lastScale: 1,
-    offsetX: 0,
-    offsetY: 0,
-    lastOffsetX: 0,
-    lastOffsetY: 0,
-  };
- 
-  constructor(element, option = {}) {
-    this.target = element;
-    this.originalWidth = element.clientWidth;
-    this.viewPortWidth = option.viewPortWidth;
-    this.viewPortHeight = option.viewPortHeight;
-    this.onGetControl = option.onGetControl;
-    this.onLoseControl = option.onLoseControl;
-  }
- 
-  changeTarget(newEle) {
-    this.target = newEle;
-    this.originalWidth = newEle.clientWidth;
-  }
- 
-  set(newState) {
-    this.preProcess(newState);
-    const { style } = this.target;
-    const {
-      offsetX,
-      offsetY,
-      lastOffsetX,
-      lastOffsetY,
-      scaleMultiples,
-    } = this.state;
-    style.transform = `translate3d(calc(${offsetX +
-      lastOffsetX}px - 50%), calc(${offsetY +
-      lastOffsetY}px - 50%), 0) scale(${scaleMultiples})`;
-    if (this.onChange) {
-      this.onChange(this.state);
-    }
-    this.state.lastOffsetX = offsetX + lastOffsetX;
-    this.state.lastOffsetY = offsetY + lastOffsetY;
-  }
- 
-  preProcess(newState) {
-    this.state = {
-      ...this.state,
-      ...newState,
-    };
-    this.state.scaleMultiples = this.state.scale;
-    const { clientWidth, clientHeight } = this.target;
-    const { lastOffsetX, lastOffsetY, scaleMultiples } = this.state;
-    if (scaleMultiples <= 1 && (lastOffsetX || lastOffsetY)) {
-      this.reset();
-    }
-    this.restrictMovement(
-      (clientWidth * scaleMultiples - this.viewPortWidth) / 2,
-      (clientHeight * scaleMultiples - this.viewPortHeight) / 2,
-    );
-  }
- 
-  restrictMovement(xRange, yRange) {
-    let isInLimit = true;
-    const result = {};
-    const { offsetX, offsetY, lastOffsetX, lastOffsetY } = this.state;
-    if (
-      Math.abs(lastOffsetX + offsetX) > xRange &&
-      Math.abs(lastOffsetX + offsetX) > Math.abs(lastOffsetX)
-    ) {
-      result.offsetX = 0;
-      result.lastOffsetX = lastOffsetX;
-      isInLimit = false;
-    }
-    if (
-      Math.abs(lastOffsetY + offsetY) > yRange &&
-      Math.abs(lastOffsetY + offsetY) > Math.abs(lastOffsetY)
-    ) {
-      result.offsetY = 0;
-      result.lastOffsetY = lastOffsetY;
-    }
-    if (!isInLimit && this.onLoseControl && Math.abs(offsetY) < 5) {
-      this.onGetControl();
-      this.onLoseControl();
-    } else {
-      this.onGetControl();
-    }
-    this.state = {
-      ...this.state,
-      ...result,
-    };
-  }
- 
-  reset() {
-    this.target.style.transition = 'transform 0.1s';
-    this.set({
-      scale: 1,
-      offsetX: 0,
-      offsetY: 0,
-      lastOffsetX: 0,
-      lastOffsetY: 0,
-      lastScale: 1,
-    });
-    this.target.style.transition = 'transform 0.1s';
-  }
- 
-  enlargeBytimes(times) {
-    const { lastScale = 1 } = this.state;
-    const newScale = times * lastScale;
-    if (newScale < 3.5 && newScale > 1) {
-      this.set({ scale: newScale });
-    } else if (newScale <= 1) {
-      this.set({ scale: 1 });
-    }
-  }
- 
-  recordScale() {
-    this.set({
-      lastScale: this.state.scale,
-    });
-  }
- 
-  move(offset) {
-    this.set({
-      offsetX: parseInt(offset.deltaX, 10),
-      offsetY: parseInt(offset.deltaY, 10),
-    });
-  }
- 
-  record(offset) {
-    this.set({
-      lastOffsetX: offset.deltaX + this.state.lastOffsetX,
-      lastOffsetY: offset.deltaY + this.state.lastOffsetY,
-      offsetX: 0,
-      offsetY: 0,
-    });
-  }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/ImageSlides/index.html b/coverage/lcov-report/ImageSlides/index.html deleted file mode 100644 index e388df1..0000000 --- a/coverage/lcov-report/ImageSlides/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for ImageSlides - - - - - - - -
-
-

- All files ImageSlides -

-
-
- 25.45% - Statements - 28/110 -
-
- 31.08% - Branches - 23/74 -
-
- 28% - Functions - 7/25 -
-
- 25.69% - Lines - 28/109 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.jsx
25.45%28/11031.08%23/7428%7/2525.69%28/109
-
-
- - - - - - - diff --git a/coverage/lcov-report/ImageSlides/index.jsx.html b/coverage/lcov-report/ImageSlides/index.jsx.html deleted file mode 100644 index 496eaf5..0000000 --- a/coverage/lcov-report/ImageSlides/index.jsx.html +++ /dev/null @@ -1,926 +0,0 @@ - - - - Code coverage report for ImageSlides/index.jsx - - - - - - - -
-
-

- All files / ImageSlides index.jsx -

-
-
- 25.45% - Statements - 28/110 -
-
- 31.08% - Branches - 23/74 -
-
- 28% - Functions - 7/25 -
-
- 25.69% - Lines - 28/109 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176 -177 -178 -179 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222 -223 -224 -225 -226 -227 -228 -229 -230 -231 -232 -233 -234 -235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288  -  -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -3x -3x -  -  -  -3x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -4x -4x -4x -4x -4x -4x -2x -2x -  -  -4x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -3x -1x -1x -1x -1x -1x -  -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -4x -4x -4x -4x -  -4x -  -  -  -  -  -  -  -4x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -10x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import React, { PureComponent } from 'react';
-import AlloyFinger from 'alloyfinger';
-import ImageControllerCreator from '../ImageControllerCreator';
-import touchEmulator from '../utils/touchEmulator';
-import resizeImage from '../utils/resizeImage';
-import Overlay from '../Overlay';
-import './style.css';
- 
-const GUTTER_WIDTH = 10;
-export default class ImageSlides extends PureComponent {
-  static defaultProps = {
-    images: [],
-    index: 0,
-    isOpen: false,
-  };
-  state = {
-    index: 0,
-    loaded: {},
-    isOpen: false,
-  };
- 
-  lastContainerOffsetX = 0;
-  initialStyle = {};
-  imageController = {};
- 
-  componentWillMount() {
-    const { index, images, isOpen } = this.props;
-    this.setState({
-      index: index || this.state.index,
-      isOpen,
-    });
-    this.preload(images[index || this.state.index]);
-  }
- 
-  componentWillReceiveProps(newProps) {
-    const { index, isOpen } = this.props;
-    const { index: newIndex, isOpen: newIsOpen } = newProps;
-    if (isOpen !== newIsOpen) {
-      this.setState({
-        isOpen: newIsOpen,
-      });
-    }
-    if (newIndex && index !== newIndex) {
-      this.setState({
-        index: newIndex,
-      });
-    }
-  }
- 
-  getContainer = el => {
-    if (el) {
-      const { useTouchEmulator } = this.props;
-      const gesturesManager = new AlloyFinger(el, {});
-      this.containerEl = el;
-      this.containerController = gesturesManager;
-      const style = this.containerEl.style;
-      if (useTouchEmulator) {
-        touchEmulator(el);
-      }
-      gesturesManager.on('touchStart', () => {
-        style.transition = '';
-      });
-      gesturesManager.on('pressMove', this.containerOnMove);
-      gesturesManager.on('touchEnd', () => {
-        const swipeTrigger = this.viewPortEl.clientWidth * 0.2;
-        if (this.lastContainerOffsetX > swipeTrigger) {
-          if (this.getMedianIndex() > 0 && this.state.index !== 1) {
-            style.transform = `translate3d(${this.lastContainerOffsetX -
-              (GUTTER_WIDTH + this.viewPortEl.clientWidth) * 2}px, 0, 0)`;
-          } else if (this.state.index === 1) {
-            style.transform = `translate3d(${this.lastContainerOffsetX -
-              (GUTTER_WIDTH + this.viewPortEl.clientWidth)}px, 0, 0)`;
-          }
-          this.last();
-        } else if (this.lastContainerOffsetX < -swipeTrigger) {
-          style.transform = `translate3d(${this.lastContainerOffsetX}px, 0, 0)`;
-          if (this.state.index === 0) {
-            style.transition = 'all 0.3s';
-          }
-          this.next();
-        }
-        style.transition = 'all 0.3s';
-        style.transform = `translate3d(${-(
-          GUTTER_WIDTH + this.viewPortEl.clientWidth
-        ) * this.getMedianIndex()}px, 0, 0)`;
-        this.lastContainerOffsetX = 0;
-        this.isMoving = false;
-      });
-    }
-  };
- 
-  getImageEl = el => {
-    if (el) {
-      this.gesturesHandler(el);
-    }
-  };
- 
-  getViewPort = el => {
-    this.viewPortEl = el;
-  };
- 
-  getMedianIndex() {
-    const { index } = this.state;
-    const { images } = this.props;
-    const displayMax = index + 2 > images.length ? images.length : index + 2;
-    const displayMin = index - 1 < 0 ? 0 : index - 1;
-    let center = parseInt((displayMax - displayMin) / 2, 10);
-    if (index < 1) {
-      center = index;
-    } else Iif (index > images.length - 2) {
-      center = images.length - index;
-    }
-    return center;
-  }
- 
-  containerOnMove = offset => {
-    this.isMoving = true;
-    const deltaX = parseInt(offset.deltaX, 10);
-    const style = this.containerEl ? this.containerEl.style : {};
-    this.lastContainerOffsetX = deltaX + this.lastContainerOffsetX;
-    const offsetX =
-      this.lastContainerOffsetX -
-      (GUTTER_WIDTH + this.viewPortEl.clientWidth) * this.getMedianIndex();
-    style.transform = `translate3d(${offsetX}px, 0, 0)`;
-  };
- 
-  gesturesHandler(el) {
-    const { useTouchEmulator } = this.props;
-    if (useTouchEmulator) {
-      touchEmulator(el.parentElement);
-    }
-    const imageController = new ImageControllerCreator(el, {
-      viewPortWidth: this.viewPortEl.clientWidth,
-      viewPortHeight: this.viewPortEl.clientHeight,
-      onGetControl: () => {
-        if (this.containerController && !this.isMoving) {
-          this.containerController.off('pressMove', this.containerOnMove);
-        }
-      },
-      onLoseControl: () => {
-        if (this.containerController && !this.isMoving) {
-          this.containerController.on('pressMove', this.containerOnMove);
-        }
-      },
-    });
-    const gesturesManager = new AlloyFinger(el.parentElement, {});
-    gesturesManager.on('pressMove', offset => {
-      imageController.move(offset);
-    });
-    gesturesManager.on('pinch', event => {
-      imageController.enlargeBytimes(event.zoom);
-    });
-    gesturesManager.on('doubleTap', () => {
-      if (imageController.state.scale > 1) {
-        imageController.reset();
-      } else {
-        imageController.enlargeBytimes(1.8);
-        imageController.recordScale();
-      }
-    });
-    gesturesManager.on('touchEnd', () => {
-      imageController.recordScale();
-    });
-  }
- 
-  next = () => {
-    const { index } = this.state;
-    const { images } = this.props;
-    if (index < images.length - 1) {
-      this.setState(
-        {
-          index: index + 1,
-        },
-        this.ignore,
-      );
-      this.preload(images[index + 1]);
-    }
-  };
- 
-  last = () => {
-    const { index } = this.state;
-    const { images } = this.props;
-    if (index > 0) {
-      this.setState(
-        {
-          index: index - 1,
-        },
-        this.ignore,
-      );
-      this.preload(images[index - 1]);
-    }
-  };
- 
-  ignore = () => {
-    if (this.containerController) {
-      this.containerController.off('pressMove', this.containerOnMove);
-      this.containerController.on('pressMove', this.containerOnMove);
-    }
-  };
- 
-  preload(url) {
-    if (url && !this.state.loaded[url]) {
-      const loader = new Image();
-      new Promise((resolve, reject) => {
-        loader.onload = resolve;
-        loader.onerror = reject;
-        loader.src = url;
-      }).then(() => {
-        this.initialStyle[url] = resizeImage(loader.width, loader.height);
-        this.setState({
-          loaded: {
-            ...this.state.loaded,
-            [url]: true,
-          },
-        });
-      });
-    }
-  }
- 
-  onCloseViewer = event => {
-    const { index } = this.state;
-    const { onClose } = this.props;
-    this.setState({
-      isOpen: false,
-    });
-    if (onClose) onClose(event, index);
-  };
- 
-  render() {
-    const { loaded, index, isOpen } = this.state;
-    const { images } = this.props;
-    const displayMax = index + 2 > images.length ? images.length : index + 2;
-    const displayMin = index - 1 < 0 ? 0 : index - 1;
-    const Loading = (
-      <div className="image-slides-loading" key="loading">
-        <div />
-        <div />
-        <div />
-        <div />
-        <div />
-      </div>
-    );
-    return isOpen ? (
-      <Overlay
-        lock
-        onClose={this.onCloseViewer}>
-        <div
-          className="image-slides-view-port"
-          ref={this.getViewPort} >
-          {images.length > 0 && (
-            <div
-              className="image-slides-index" >
-              {`${index + 1} / ${images.length}`}
-            </div>
-          )}
-          <div
-            className="image-slides-container"
-            ref={this.getContainer}
-            style={{
-              transform: `translate3d(${-this.getMedianIndex() *
-                ((this.viewPortEl ? this.viewPortEl.clientWidth : 0) +
-                  GUTTER_WIDTH)}px, 0, 0)`,
-            }} >
-            {images.slice(displayMin, displayMax).map((url, ind) => (
-              <div
-                /* eslint-disable */
-                key={url + (ind + index - (index - displayMin))}
-                /* eslint-enable */
-                className="image-slides-blackboard">
-                {loaded[url] ? (
-                  <img
-                    className="image-slides-content"
-                    src={url}
-                    alt="图片"
-                    ref={this.getImageEl}
-                    style={{
-                      ...this.initialStyle[url],
-                    }} />
-                ) : Loading}
-              </div>
-            ))}
-          </div>
-        </div>
-      </Overlay>
-    ) : null;
-  }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/Overlay/index.html b/coverage/lcov-report/Overlay/index.html deleted file mode 100644 index 88af6bf..0000000 --- a/coverage/lcov-report/Overlay/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for Overlay - - - - - - - -
-
-

- All files Overlay -

-
-
- 5.41% - Statements - 2/37 -
-
- 0% - Branches - 0/24 -
-
- 0% - Functions - 0/6 -
-
- 5.56% - Lines - 2/36 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.jsx
5.41%2/370%0/240%0/65.56%2/36
-
-
- - - - - - - diff --git a/coverage/lcov-report/Overlay/index.jsx.html b/coverage/lcov-report/Overlay/index.jsx.html deleted file mode 100644 index ab68a89..0000000 --- a/coverage/lcov-report/Overlay/index.jsx.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - Code coverage report for Overlay/index.jsx - - - - - - - -
-
-

- All files / Overlay index.jsx -

-
-
- 5.41% - Statements - 2/37 -
-
- 0% - Branches - 0/24 -
-
- 0% - Functions - 0/6 -
-
- 5.56% - Lines - 2/36 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99  -  -  -  -1x -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import React, { PureComponent } from 'react';
-import ReactDOM from 'react-dom';
-import './style.css';
- 
-let originalBodyOverflow = null;
-let lockingCounter = 0;
- 
-export default class Overlay extends PureComponent {
-  static defaultProps = {
-    lock: false,
-    parentSelector() {
-      return document.body;
-    },
-  };
-  locked = false;
-  node = document.createElement('div');
-  componentDidMount() {
-    if (this.props.lock === true) {
-      this.preventScrolling();
-    }
-    const parent = this.props.parentSelector();
-    parent.appendChild(this.node);
-  }
- 
-  componentWillReceiveProps(newProps) {
-    if (this.props.lock !== newProps.lock) {
-      if (newProps.lock) {
-        this.preventScrolling();
-      } else {
-        this.allowScrolling();
-      }
-    }
-    const currentParent = this.props.parentSelector();
-    const newParent = newProps.parentSelector();
- 
-    if (newParent !== currentParent) {
-      currentParent.removeChild(this.node);
-      newParent.appendChild(this.node);
-    }
-  }
- 
-  componentWillUnmount() {
-    const parent = this.props.parentSelector();
-    if (!this.node || !this.content) return;
-    parent.removeChild(this.node);
-    this.allowScrolling();
-  }
- 
-  preventScrolling() {
-    if (this.locked === true) {
-      return;
-    }
-    lockingCounter += 1;
-    if (lockingCounter === 1) {
-      const body = document.body;
-      originalBodyOverflow = body.style.overflow;
-      body.style.overflow = 'hidden';
-    }
-  }
- 
-  allowScrolling() {
-    if (this.locked === true) {
-      lockingCounter -= 1;
-      this.locked = false;
-    }
- 
-    if (lockingCounter === 0 && originalBodyOverflow !== null) {
-      const body = document.body;
-      body.style.overflow = originalBodyOverflow || '';
-      originalBodyOverflow = null;
-    }
-  }
- 
-  render() {
-    const {
-      onClose,
-    } = this.props;
-    return ReactDOM.createPortal(
-      <div className="image-slides-overlay">
-        <button
-          className="image-slides-close"
-          onClick={onClose} >
-          <svg
-            fill="#fff"
-            height="24"
-            viewBox="0 0 24 24"
-            width="24"
-            transform="scale(1.5)">
-            <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
-            <path d="M0 0h24v24H0z" fill="none" />
-          </svg>
-        </button>
-        {this.props.children}
-      </div>,
-      this.node,
-    );
-  }
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css deleted file mode 100644 index 417c7ad..0000000 --- a/coverage/lcov-report/base.css +++ /dev/null @@ -1,212 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } - - -.medium .chart { border:1px solid #666; } -.medium .cover-fill { background: #666; } - -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } -.medium { background: #eaeaea; } - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html deleted file mode 100644 index 96d63b0..0000000 --- a/coverage/lcov-report/index.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- All files -

-
-
- 15.93% - Statements - 36/226 -
-
- 18.12% - Branches - 25/138 -
-
- 17.39% - Functions - 8/46 -
-
- 16.07% - Lines - 36/224 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
ImageControllerCreator
0%0/500%0/280%0/100%0/50
ImageSlides
25.45%28/11031.08%23/7428%7/2525.69%28/109
Overlay
5.41%2/370%0/240%0/65.56%2/36
utils
20.69%6/2916.67%2/1220%1/520.69%6/29
-
-
- - - - - - - diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e03..0000000 --- a/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a..0000000 Binary files a/coverage/lcov-report/sort-arrow-sprite.png and /dev/null differ diff --git a/coverage/lcov-report/sorter.js b/coverage/lcov-report/sorter.js deleted file mode 100644 index 6c5034e..0000000 --- a/coverage/lcov-report/sorter.js +++ /dev/null @@ -1,158 +0,0 @@ -var addSorting = (function () { - "use strict"; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { return document.querySelector('.coverage-summary'); } - // returns the thead element of the summary table - function getTableHeader() { return getTable().querySelector('thead tr'); } - // returns the tbody element of the summary table - function getTableBody() { return getTable().querySelector('tbody'); } - // returns the th element for nth column - function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/lcov-report/utils/index.html b/coverage/lcov-report/utils/index.html deleted file mode 100644 index 0197fd6..0000000 --- a/coverage/lcov-report/utils/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - Code coverage report for utils - - - - - - - -
-
-

- All files utils -

-
-
- 20.69% - Statements - 6/29 -
-
- 16.67% - Branches - 2/12 -
-
- 20% - Functions - 1/5 -
-
- 20.69% - Lines - 6/29 -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
resizeImage.js
85.71%6/733.33%2/6100%1/185.71%6/7
touchEmulator.js
0%0/220%0/60%0/40%0/22
-
-
- - - - - - - diff --git a/coverage/lcov-report/utils/resizeImage.js.html b/coverage/lcov-report/utils/resizeImage.js.html deleted file mode 100644 index fa0e8e5..0000000 --- a/coverage/lcov-report/utils/resizeImage.js.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - Code coverage report for utils/resizeImage.js - - - - - - - -
-
-

- All files / utils resizeImage.js -

-
-
- 85.71% - Statements - 6/7 -
-
- 33.33% - Branches - 2/6 -
-
- 100% - Functions - 1/1 -
-
- 85.71% - Lines - 6/7 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17  -1x -1x -1x -1x -1x -  -  -  -  -  -1x -  -  -  -  - 
export default function resizeImage(imageWidth, imageHeight) {
-  const screenWidth = window.innerWidth;
-  const screenHeight = window.innerHeight;
-  const screenRadio = screenWidth / screenHeight;
-  const imageRadio = imageWidth / imageHeight;
-  Iif (imageRadio > screenRadio) {
-    return {
-      width: screenWidth < imageWidth ? '100%' : `${imageWidth}px`,
-      height: 'auto',
-    };
-  }
-  return {
-    width: 'auto',
-    height: screenHeight < imageHeight ? '100%' : `${imageWidth}px`,
-  };
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov-report/utils/touchEmulator.js.html b/coverage/lcov-report/utils/touchEmulator.js.html deleted file mode 100644 index ffc6601..0000000 --- a/coverage/lcov-report/utils/touchEmulator.js.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - Code coverage report for utils/touchEmulator.js - - - - - - - -
-
-

- All files / utils touchEmulator.js -

-
-
- 0% - Statements - 0/22 -
-
- 0% - Branches - 0/6 -
-
- 0% - Functions - 0/4 -
-
- 0% - Lines - 0/22 -
-
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
export default function touchEmulator(el) {
-  let down = false;
-  function preventMouseEvents(event) {
-    event.preventDefault();
-    event.stopPropagation();
-  }
-  function trigger(mouseEvent, touchEvent, downState) {
-    el.addEventListener(mouseEvent, event => {
-      if (touchEvent === 'touchstart' || down) {
-        const touch = {
-          pageX: event.pageX,
-          pageY: event.pageY,
-          type: touchEvent,
-        };
-        const newEvent = new CustomEvent(touchEvent);
-        newEvent.touches = [touch];
-        newEvent.changedTouches = [touch];
-        event.preventDefault();
-        el.dispatchEvent(newEvent);
-      }
-      if (touchEvent !== 'touchmove') {
-        down = downState;
-      }
-    });
-  }
-  trigger('mousedown', 'touchstart', true);
-  trigger('mousemove', 'touchmove', true);
-  trigger('mouseup', 'touchend', false);
-  trigger('mouseout', 'touchend', false);
-  trigger('mouseleave', 'touchend', false);
-  el.addEventListener('mouseenter', preventMouseEvents, true);
-  el.addEventListener('mouseleave', preventMouseEvents, true);
-  el.addEventListener('mouseout', preventMouseEvents, true);
-  el.addEventListener('mouseover', preventMouseEvents, true);
-}
- 
-
-
- - - - - - - diff --git a/coverage/lcov.info b/coverage/lcov.info deleted file mode 100644 index d3881c2..0000000 --- a/coverage/lcov.info +++ /dev/null @@ -1,499 +0,0 @@ -TN: -SF:/Users/loading/mycode/react-image-viewer/src/ImageControllerCreator/index.js -FN:11,(anonymous_0) -FN:20,(anonymous_1) -FN:25,(anonymous_2) -FN:45,(anonymous_3) -FN:62,(anonymous_4) -FN:93,(anonymous_5) -FN:106,(anonymous_6) -FN:116,(anonymous_7) -FN:122,(anonymous_8) -FN:129,(anonymous_9) -FNF:10 -FNH:0 -FNDA:0,(anonymous_0) -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:0,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:17,0 -DA:21,0 -DA:22,0 -DA:26,0 -DA:27,0 -DA:34,0 -DA:35,0 -DA:38,0 -DA:39,0 -DA:41,0 -DA:42,0 -DA:46,0 -DA:50,0 -DA:51,0 -DA:52,0 -DA:53,0 -DA:54,0 -DA:56,0 -DA:63,0 -DA:64,0 -DA:65,0 -DA:66,0 -DA:70,0 -DA:71,0 -DA:72,0 -DA:74,0 -DA:78,0 -DA:79,0 -DA:81,0 -DA:82,0 -DA:83,0 -DA:85,0 -DA:87,0 -DA:94,0 -DA:95,0 -DA:103,0 -DA:107,0 -DA:108,0 -DA:109,0 -DA:110,0 -DA:111,0 -DA:112,0 -DA:117,0 -DA:123,0 -DA:130,0 -LF:50 -LH:0 -BRDA:11,0,0,0 -BRDA:38,1,0,0 -BRDA:38,1,1,0 -BRDA:53,2,0,0 -BRDA:53,2,1,0 -BRDA:53,3,0,0 -BRDA:53,3,1,0 -BRDA:53,3,2,0 -BRDA:66,4,0,0 -BRDA:66,4,1,0 -BRDA:67,5,0,0 -BRDA:67,5,1,0 -BRDA:74,6,0,0 -BRDA:74,6,1,0 -BRDA:75,7,0,0 -BRDA:75,7,1,0 -BRDA:81,8,0,0 -BRDA:81,8,1,0 -BRDA:81,9,0,0 -BRDA:81,9,1,0 -BRDA:81,9,2,0 -BRDA:107,10,0,0 -BRDA:109,11,0,0 -BRDA:109,11,1,0 -BRDA:109,12,0,0 -BRDA:109,12,1,0 -BRDA:111,13,0,0 -BRDA:111,13,1,0 -BRF:28 -BRH:0 -end_of_record -TN: -SF:/Users/loading/mycode/react-image-viewer/src/ImageSlides/index.jsx -FN:26,(anonymous_0) -FN:35,(anonymous_1) -FN:50,(anonymous_2) -FN:60,(anonymous_3) -FN:64,(anonymous_4) -FN:92,(anonymous_5) -FN:98,(anonymous_6) -FN:102,(anonymous_7) -FN:116,(anonymous_8) -FN:127,(anonymous_9) -FN:135,(anonymous_10) -FN:140,(anonymous_11) -FN:147,(anonymous_12) -FN:150,(anonymous_13) -FN:153,(anonymous_14) -FN:161,(anonymous_15) -FN:166,(anonymous_16) -FN:180,(anonymous_17) -FN:194,(anonymous_18) -FN:201,(anonymous_19) -FN:204,(anonymous_20) -FN:208,(anonymous_21) -FN:220,(anonymous_22) -FN:229,(anonymous_23) -FN:264,(anonymous_24) -FNF:25 -FNH:7 -FNDA:3,(anonymous_0) -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -FNDA:0,(anonymous_6) -FNDA:4,(anonymous_7) -FNDA:0,(anonymous_8) -FNDA:0,(anonymous_9) -FNDA:0,(anonymous_10) -FNDA:0,(anonymous_11) -FNDA:0,(anonymous_12) -FNDA:0,(anonymous_13) -FNDA:0,(anonymous_14) -FNDA:0,(anonymous_15) -FNDA:0,(anonymous_16) -FNDA:0,(anonymous_17) -FNDA:0,(anonymous_18) -FNDA:3,(anonymous_19) -FNDA:1,(anonymous_20) -FNDA:1,(anonymous_21) -FNDA:0,(anonymous_22) -FNDA:4,(anonymous_23) -FNDA:10,(anonymous_24) -DA:9,1 -DA:27,3 -DA:28,3 -DA:32,3 -DA:36,0 -DA:37,0 -DA:38,0 -DA:39,0 -DA:43,0 -DA:44,0 -DA:51,0 -DA:52,0 -DA:53,0 -DA:54,0 -DA:55,0 -DA:56,0 -DA:57,0 -DA:58,0 -DA:60,0 -DA:61,0 -DA:63,0 -DA:64,0 -DA:65,0 -DA:66,0 -DA:67,0 -DA:68,0 -DA:70,0 -DA:71,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:77,0 -DA:78,0 -DA:80,0 -DA:82,0 -DA:83,0 -DA:86,0 -DA:87,0 -DA:93,0 -DA:94,0 -DA:99,0 -DA:103,4 -DA:104,4 -DA:105,4 -DA:106,4 -DA:107,4 -DA:108,4 -DA:109,2 -DA:110,2 -DA:111,0 -DA:113,4 -DA:117,0 -DA:118,0 -DA:119,0 -DA:120,0 -DA:122,0 -DA:124,0 -DA:128,0 -DA:129,0 -DA:130,0 -DA:132,0 -DA:136,0 -DA:137,0 -DA:141,0 -DA:142,0 -DA:146,0 -DA:147,0 -DA:148,0 -DA:150,0 -DA:151,0 -DA:153,0 -DA:154,0 -DA:155,0 -DA:157,0 -DA:158,0 -DA:161,0 -DA:162,0 -DA:167,0 -DA:168,0 -DA:169,0 -DA:170,0 -DA:176,0 -DA:181,0 -DA:182,0 -DA:183,0 -DA:184,0 -DA:190,0 -DA:195,0 -DA:196,0 -DA:197,0 -DA:202,3 -DA:203,1 -DA:204,1 -DA:205,1 -DA:206,1 -DA:207,1 -DA:209,1 -DA:210,1 -DA:221,0 -DA:222,0 -DA:223,0 -DA:226,0 -DA:230,4 -DA:231,4 -DA:232,4 -DA:233,4 -DA:235,4 -DA:243,4 -DA:265,10 -LF:109 -LH:28 -BRDA:29,0,0,3 -BRDA:29,0,1,2 -BRDA:32,1,0,3 -BRDA:32,1,1,2 -BRDA:38,2,0,0 -BRDA:38,2,1,0 -BRDA:43,3,0,0 -BRDA:43,3,1,0 -BRDA:43,4,0,0 -BRDA:43,4,1,0 -BRDA:51,5,0,0 -BRDA:51,5,1,0 -BRDA:57,6,0,0 -BRDA:57,6,1,0 -BRDA:66,7,0,0 -BRDA:66,7,1,0 -BRDA:67,8,0,0 -BRDA:67,8,1,0 -BRDA:67,9,0,0 -BRDA:67,9,1,0 -BRDA:70,10,0,0 -BRDA:70,10,1,0 -BRDA:75,11,0,0 -BRDA:75,11,1,0 -BRDA:77,12,0,0 -BRDA:77,12,1,0 -BRDA:93,13,0,0 -BRDA:93,13,1,0 -BRDA:105,14,0,0 -BRDA:105,14,1,4 -BRDA:106,15,0,2 -BRDA:106,15,1,2 -BRDA:108,16,0,2 -BRDA:108,16,1,2 -BRDA:110,17,0,0 -BRDA:110,17,1,2 -BRDA:119,18,0,0 -BRDA:119,18,1,0 -BRDA:129,19,0,0 -BRDA:129,19,1,0 -BRDA:136,20,0,0 -BRDA:136,20,1,0 -BRDA:136,21,0,0 -BRDA:136,21,1,0 -BRDA:141,22,0,0 -BRDA:141,22,1,0 -BRDA:141,23,0,0 -BRDA:141,23,1,0 -BRDA:154,24,0,0 -BRDA:154,24,1,0 -BRDA:169,25,0,0 -BRDA:169,25,1,0 -BRDA:183,26,0,0 -BRDA:183,26,1,0 -BRDA:195,27,0,0 -BRDA:195,27,1,0 -BRDA:202,28,0,1 -BRDA:202,28,1,2 -BRDA:202,29,0,3 -BRDA:202,29,1,1 -BRDA:226,30,0,0 -BRDA:226,30,1,0 -BRDA:232,31,0,0 -BRDA:232,31,1,4 -BRDA:233,32,0,2 -BRDA:233,32,1,2 -BRDA:243,33,0,4 -BRDA:243,33,1,0 -BRDA:250,34,0,4 -BRDA:250,34,1,4 -BRDA:261,35,0,0 -BRDA:261,35,1,4 -BRDA:270,36,0,1 -BRDA:270,36,1,9 -BRF:74 -BRH:23 -end_of_record -TN: -SF:/Users/loading/mycode/react-image-viewer/src/Overlay/index.jsx -FN:17,(anonymous_0) -FN:25,(anonymous_1) -FN:42,(anonymous_2) -FN:49,(anonymous_3) -FN:61,(anonymous_4) -FN:74,(anonymous_5) -FNF:6 -FNH:0 -FNDA:0,(anonymous_0) -FNDA:0,(anonymous_1) -FNDA:0,(anonymous_2) -FNDA:0,(anonymous_3) -FNDA:0,(anonymous_4) -FNDA:0,(anonymous_5) -DA:5,1 -DA:6,1 -DA:12,0 -DA:18,0 -DA:19,0 -DA:21,0 -DA:22,0 -DA:26,0 -DA:27,0 -DA:28,0 -DA:30,0 -DA:33,0 -DA:34,0 -DA:36,0 -DA:37,0 -DA:38,0 -DA:43,0 -DA:44,0 -DA:45,0 -DA:46,0 -DA:50,0 -DA:51,0 -DA:53,0 -DA:54,0 -DA:55,0 -DA:56,0 -DA:57,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:67,0 -DA:68,0 -DA:69,0 -DA:70,0 -DA:77,0 -DA:78,0 -LF:36 -LH:2 -BRDA:18,0,0,0 -BRDA:18,0,1,0 -BRDA:26,1,0,0 -BRDA:26,1,1,0 -BRDA:27,2,0,0 -BRDA:27,2,1,0 -BRDA:36,3,0,0 -BRDA:36,3,1,0 -BRDA:44,4,0,0 -BRDA:44,4,1,0 -BRDA:44,5,0,0 -BRDA:44,5,1,0 -BRDA:50,6,0,0 -BRDA:50,6,1,0 -BRDA:54,7,0,0 -BRDA:54,7,1,0 -BRDA:62,8,0,0 -BRDA:62,8,1,0 -BRDA:67,9,0,0 -BRDA:67,9,1,0 -BRDA:67,10,0,0 -BRDA:67,10,1,0 -BRDA:69,11,0,0 -BRDA:69,11,1,0 -BRF:24 -BRH:0 -end_of_record -TN: -SF:/Users/loading/mycode/react-image-viewer/src/utils/resizeImage.js -FN:1,resizeImage -FNF:1 -FNH:1 -FNDA:1,resizeImage -DA:2,1 -DA:3,1 -DA:4,1 -DA:5,1 -DA:6,1 -DA:7,0 -DA:12,1 -LF:7 -LH:6 -BRDA:6,0,0,0 -BRDA:6,0,1,1 -BRDA:8,1,0,0 -BRDA:8,1,1,0 -BRDA:14,2,0,0 -BRDA:14,2,1,1 -BRF:6 -BRH:2 -end_of_record -TN: -SF:/Users/loading/mycode/react-image-viewer/src/utils/touchEmulator.js -FN:1,touchEmulator -FN:3,preventMouseEvents -FN:7,trigger -FN:8,(anonymous_3) -FNF:4 -FNH:0 -FNDA:0,touchEmulator -FNDA:0,preventMouseEvents -FNDA:0,trigger -FNDA:0,(anonymous_3) -DA:2,0 -DA:4,0 -DA:5,0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:15,0 -DA:16,0 -DA:17,0 -DA:18,0 -DA:19,0 -DA:21,0 -DA:22,0 -DA:26,0 -DA:27,0 -DA:28,0 -DA:29,0 -DA:30,0 -DA:31,0 -DA:32,0 -DA:33,0 -DA:34,0 -LF:22 -LH:0 -BRDA:9,0,0,0 -BRDA:9,0,1,0 -BRDA:9,1,0,0 -BRDA:9,1,1,0 -BRDA:21,2,0,0 -BRDA:21,2,1,0 -BRF:6 -BRH:0 -end_of_record diff --git a/demo/demo.gif b/demo/demo.gif index 11c90d1..1673950 100644 Binary files a/demo/demo.gif and b/demo/demo.gif differ diff --git a/demo/demo.tsx b/demo/demo.tsx new file mode 100644 index 0000000..ab64910 --- /dev/null +++ b/demo/demo.tsx @@ -0,0 +1,38 @@ +import React, { Component } from 'react'; +import ReactDOM from 'react-dom'; +import ImageSlides from '../src'; + +const images = [ + 'http://dingyue.nosdn.127.net/lXMRCRbP9PYbv2gMBmHGXRnjspn6pT1PM5DrIGcEZSUTu1531904526913compressflag.jpeg', + 'http://dingyue.nosdn.127.net/9sFTTWDQoHjxyIkU9wzm8CiDNVbq48Mwf2hyhgRghxA5O1527909480497compressflag.jpeg', + 'http://img.zcool.cn/community/0101f856cfff206ac7252ce6214470.jpg', + 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1503235534249&di=4c198d5a305627d12e5dae4c581c9e57&imgtype=0&src=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fimg2.niutuku.com%2Fdesk%2Fanime%2F0529%2F0529-17277.jpg', +]; + +class Demo extends Component { + state = { + isOpen: false, + }; + + handleOpen = () => { + this.setState({ + isOpen: true, + }); + }; + + handleClose = () => { + this.setState({ + isOpen: false, + }); + }; + + render() { + return ( +
+ + +
+ ); + } +} +ReactDOM.render(, document.getElementById('root')); diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..80bb598 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,17 @@ + + + + + + + Mobile Demo + + + +
+ + + diff --git a/demo/mobile/demo.js b/demo/mobile/demo.js deleted file mode 100644 index 622f011..0000000 --- a/demo/mobile/demo.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import ImageSlides from '../../src/ImageSlides'; - -const images = [ - '', - 'http://img.zcool.cn/community/0101f856cfff206ac7252ce6214470.jpg', - 'http://a4.att.hudong.com/05/55/01200000033533115855502090905.jpg', - 'http://img.zcool.cn/community/0101f856cfff206ac7252ce6214470.jpg', - 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1503235534249&di=4c198d5a305627d12e5dae4c581c9e57&imgtype=0&src=https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fimg2.niutuku.com%2Fdesk%2Fanime%2F0529%2F0529-17277.jpg', -]; -ReactDOM.render( - , - document.getElementById('root'), -); diff --git a/demo/mobile/index.html b/demo/mobile/index.html deleted file mode 100644 index 9927cc7..0000000 --- a/demo/mobile/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Mobile Demo - - -
- - - diff --git a/demo/mobile/start.js b/demo/mobile/start.js deleted file mode 100644 index 340f47b..0000000 --- a/demo/mobile/start.js +++ /dev/null @@ -1,28 +0,0 @@ -const webpack = require('webpack'); -const config = require('../../webpack.config'); -const os = require('os'); -const superstatic = require('superstatic').server; - - -webpack(config, (err, stats) => { - if (err || stats.hasErrors()) { - console.log('Error!'); - } - const ifaces = os.networkInterfaces(); - let lookupIpAddress = null; - - Object.values(ifaces).forEach(item => { - item.forEach(details => { - if (details.family === 'IPv4') { - lookupIpAddress = details.address; - } - }); - }); - const app = superstatic({ - host: lookupIpAddress, - port: 8080, - }); - app.listen(() => { - console.log(`Demo started on => http://${lookupIpAddress}:8080/demo/mobile`); - }); -}); diff --git a/dist/bundle.js b/dist/bundle.js deleted file mode 100644 index 6b3007c..0000000 --- a/dist/bundle.js +++ /dev/null @@ -1,23003 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["react-imageslides"] = factory(); - else - root["react-imageslides"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 18); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var validateFormat = function validateFormat(format) {}; - -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -if (process.env.NODE_ENV === 'production') { - module.exports = __webpack_require__(20); -} else { - module.exports = __webpack_require__(21); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyFunction = __webpack_require__(2); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyObject = {}; - -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -/** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ -var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen, - - isInWorker: !canUseDOM // For now, this is true - might change in the future. - -}; - -module.exports = ExecutionEnvironment; - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -function checkDCE() { - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ - if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' - ) { - return; - } - if (process.env.NODE_ENV !== 'production') { - // This branch is unreachable because this function is only called - // in production, but the condition is true only in development. - // Therefore if the branch is still here, dead code elimination wasn't - // properly applied. - // Don't change the message. React DevTools relies on it. Also make sure - // this message doesn't occur elsewhere in this function, or it will cause - // a false positive. - throw new Error('^_^'); - } - try { - // Verify that the code above has been dead code eliminated (DCE'd). - __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); - } catch (err) { - // DevTools shouldn't crash React, no matter what. - // We should still report in case we break this code. - console.error(err); - } -} - -if (process.env.NODE_ENV === 'production') { - // DCE check should happen before ReactDOM bundle executes so that - // DevTools can report bad minification during injection. - checkDCE(); - module.exports = __webpack_require__(24); -} else { - module.exports = __webpack_require__(27); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var emptyFunction = __webpack_require__(2); - -/** - * Upstream version of event listener. Does not take into account specific - * nature of platform. - */ -var EventListener = { - /** - * Listen to DOM events during the bubble phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - listen: function listen(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, false); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, false); - } - }; - } else if (target.attachEvent) { - target.attachEvent('on' + eventType, callback); - return { - remove: function remove() { - target.detachEvent('on' + eventType, callback); - } - }; - } - }, - - /** - * Listen to DOM events during the capture phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - capture: function capture(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, true); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, true); - } - }; - } else { - if (process.env.NODE_ENV !== 'production') { - console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); - } - return { - remove: emptyFunction - }; - } - }, - - registerDefault: function registerDefault() {} -}; - -module.exports = EventListener; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - * - */ - -/*eslint-disable no-self-compare */ - - - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} - -/** - * Performs equality by iterating through keys on an object and returning false - * when any key has values which are not strictly equal between the arguments. - * Returns true when the values of all keys are strictly equal. - */ -function shallowEqual(objA, objB) { - if (is(objA, objB)) { - return true; - } - - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); - - if (keysA.length !== keysB.length) { - return false; - } - - // Test for A's keys different from B. - for (var i = 0; i < keysA.length; i++) { - if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - - return true; -} - -module.exports = shallowEqual; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -var isTextNode = __webpack_require__(25); - -/*eslint-disable no-bitwise */ - -/** - * Checks if a given DOM node contains or is another DOM node. - */ -function containsNode(outerNode, innerNode) { - if (!outerNode || !innerNode) { - return false; - } else if (outerNode === innerNode) { - return true; - } else if (isTextNode(outerNode)) { - return false; - } else if (isTextNode(innerNode)) { - return containsNode(outerNode, innerNode.parentNode); - } else if ('contains' in outerNode) { - return outerNode.contains(innerNode); - } else if (outerNode.compareDocumentPosition) { - return !!(outerNode.compareDocumentPosition(innerNode) & 16); - } else { - return false; - } -} - -module.exports = containsNode; - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * @param {DOMElement} node input/textarea to focus - */ - -function focusNode(node) { - // IE8 can throw "Can't move focus to the control because it is invisible, - // not enabled, or of a type that does not accept the focus." for all kinds of - // reasons that are too expensive and fragile to test. - try { - node.focus(); - } catch (e) {} -} - -module.exports = focusNode; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/* eslint-disable fb-www/typeof-undefined */ - -/** - * Same as document.activeElement but wraps in a try-catch block. In IE it is - * not safe to call document.activeElement if there is nothing focused. - * - * The activeElement will be null only if the document or document body is not - * yet defined. - * - * @param {?DOMDocument} doc Defaults to current document. - * @return {?DOMElement} - */ -function getActiveElement(doc) /*?DOMElement*/{ - doc = doc || (typeof document !== 'undefined' ? document : undefined); - if (typeof doc === 'undefined') { - return null; - } - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } -} - -module.exports = getActiveElement; - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -if (process.env.NODE_ENV !== 'production') { - var invariant = __webpack_require__(1); - var warning = __webpack_require__(5); - var ReactPropTypesSecret = __webpack_require__(8); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (process.env.NODE_ENV !== 'production') { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 16 */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function(useSourceMap) { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - if(item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' - }); - - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} - -// Adapted from convert-source-map (MIT) -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - - return '/*# ' + data + ' */'; -} - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -var stylesInDom = {}; - -var memoize = function (fn) { - var memo; - - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; -}; - -var isOldIE = memoize(function () { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; -}); - -var getElement = (function (fn) { - var memo = {}; - - return function(selector) { - if (typeof memo[selector] === "undefined") { - var styleTarget = fn.call(this, selector); - // Special case to return head of iframe instead of iframe itself - if (styleTarget instanceof window.HTMLIFrameElement) { - try { - // This will throw an exception if access to iframe is blocked - // due to cross-origin restrictions - styleTarget = styleTarget.contentDocument.head; - } catch(e) { - styleTarget = null; - } - } - memo[selector] = styleTarget; - } - return memo[selector] - }; -})(function (target) { - return document.querySelector(target) -}); - -var singleton = null; -var singletonCounter = 0; -var stylesInsertedAtTop = []; - -var fixUrls = __webpack_require__(45); - -module.exports = function(list, options) { - if (typeof DEBUG !== "undefined" && DEBUG) { - if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - // Force single-tag solution on IE6-9, which has a hard limit on the # of