├── .travis.yml ├── src ├── .noderequirer.json ├── index.js ├── themes │ ├── index.js │ └── inspector.js ├── utils │ ├── isIterable.js │ ├── getType.js │ ├── getInspectedState.js │ └── createStylingFromTheme.js ├── types.js ├── RightSlider.jsx ├── tabs │ ├── getJsonTreeTheme.js │ ├── DiffTab.jsx │ ├── StateTab.jsx │ ├── ActionTab.jsx │ ├── getItemString.js │ └── JSONDiff.jsx ├── redux.js ├── createDiffPatcher.js ├── ActionListHeader.jsx ├── ActionPreviewHeader.jsx ├── ActionPreview.jsx ├── ActionList.jsx ├── ActionListRow.jsx └── DevtoolsInspector.js ├── demo └── src │ ├── .noderequirer.json │ ├── js │ ├── getOptions.js │ ├── index.js │ ├── reducers.js │ └── DemoApp.jsx │ └── index.html ├── demo.gif ├── .gitignore ├── .npmignore ├── 2016-02-23.at.16.16.png ├── flow-typed └── npm │ ├── flow-bin_v0.x.x.js │ ├── raw-loader_vx.x.x.js │ ├── json-loader_vx.x.x.js │ ├── eslint-loader_vx.x.x.js │ ├── imports-loader_vx.x.x.js │ ├── lodash.shuffle_vx.x.x.js │ ├── lodash.debounce_vx.x.x.js │ ├── babel-preset-react_vx.x.x.js │ ├── babel-preset-es2015_vx.x.x.js │ ├── babel-preset-stage-0_vx.x.x.js │ ├── clean-webpack-plugin_vx.x.x.js │ ├── javascript-stringify_vx.x.x.js │ ├── babel_vx.x.x.js │ ├── export-files-webpack-plugin_vx.x.x.js │ ├── hex-rgba_vx.x.x.js │ ├── babel-plugin-transform-flow-strip-types_vx.x.x.js │ ├── react-transform-hmr_vx.x.x.js │ ├── nyan-progress-webpack-plugin_vx.x.x.js │ ├── babel-plugin-transform-runtime_vx.x.x.js │ ├── chokidar_vx.x.x.js │ ├── git-directory-deploy_vx.x.x.js │ ├── pre-commit_vx.x.x.js │ ├── redux-devtools-themes_vx.x.x.js │ ├── babel-loader_vx.x.x.js │ ├── react-pure-render_vx.x.x.js │ ├── html-webpack-plugin_vx.x.x.js │ ├── dateformat_vx.x.x.js │ ├── redux-devtools_vx.x.x.js │ ├── redux_v3.x.x.js │ ├── babel-eslint_vx.x.x.js │ ├── jss-vendor-prefixer_vx.x.x.js │ ├── react-redux_v4.x.x.js │ ├── jss-nested_vx.x.x.js │ ├── webpack-dev-server_vx.x.x.js │ ├── redux-logger_vx.x.x.js │ ├── redux-devtools-dock-monitor_vx.x.x.js │ ├── babel-cli_vx.x.x.js │ ├── react-router-redux_vx.x.x.js │ ├── react-json-tree_vx.x.x.js │ ├── jss_vx.x.x.js │ ├── eslint-plugin-babel_vx.x.x.js │ ├── babel-core_vx.x.x.js │ ├── react-input-enhancements_vx.x.x.js │ ├── react-base16-styling_vx.x.x.js │ └── jsondiffpatch_vx.x.x.js ├── .flowconfig ├── .babelrc ├── LICENSE ├── .eslintrc ├── webpack.config.js ├── README.md └── package.json /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 6 -------------------------------------------------------------------------------- /src/.noderequirer.json: -------------------------------------------------------------------------------- 1 | { 2 | "import": true 3 | } 4 | -------------------------------------------------------------------------------- /demo/src/.noderequirer.json: -------------------------------------------------------------------------------- 1 | { 2 | "import": true 3 | } 4 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | export { default } from './DevtoolsInspector'; 3 | -------------------------------------------------------------------------------- /src/themes/index.js: -------------------------------------------------------------------------------- 1 | export { default as inspector } from './inspector'; 2 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexkuz/redux-devtools-inspector/HEAD/demo.gif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .DS_Store 4 | lib 5 | yarn.lock 6 | demo/dist -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | static 2 | src 3 | demo 4 | .* 5 | webpack.config.js 6 | index.html 7 | *.gif 8 | *.png 9 | -------------------------------------------------------------------------------- /2016-02-23.at.16.16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexkuz/redux-devtools-inspector/HEAD/2016-02-23.at.16.16.png -------------------------------------------------------------------------------- /src/utils/isIterable.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | export default function isIterable(obj: any): boolean { 3 | return obj !== null && typeof obj === 'object' && !Array.isArray(obj) && 4 | typeof obj[window.Symbol.iterator] === 'function'; 5 | } 6 | -------------------------------------------------------------------------------- /flow-typed/npm/flow-bin_v0.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583 2 | // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x 3 | 4 | declare module "flow-bin" { 5 | declare module.exports: string; 6 | } 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [options] 2 | module.file_ext=.js 3 | module.file_ext=.jsx 4 | module.file_ext=.json 5 | esproposal.export_star_as=enable 6 | 7 | [ignore] 8 | .*/node_modules/fbjs/.* 9 | .*/node_modules/jss/.* 10 | .*/build/.* 11 | 12 | [libs] 13 | decls/ -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-0", "react"], 3 | "plugins": ["transform-runtime"], 4 | "env": { 5 | "development": { 6 | "plugins": [["react-transform", { 7 | "transforms": [{ 8 | "transform": "react-transform-hmr", 9 | "imports": ["react"], 10 | "locals": ["module"] 11 | }] 12 | }]] 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo/src/js/getOptions.js: -------------------------------------------------------------------------------- 1 | export default function getOptions() { 2 | return { 3 | useExtension: window.location.search.indexOf('ext') !== -1, 4 | supportImmutable: window.location.search.indexOf('immutable') !== -1, 5 | theme: do { 6 | const match = window.location.search.match(/theme=([^&]+)/); 7 | match ? match[1] : 'inspector' 8 | }, 9 | dark: window.location.search.indexOf('dark') !== -1 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /src/types.js: -------------------------------------------------------------------------------- 1 | export type Action = { 2 | timestamp: Date, 3 | error: ?string 4 | }; 5 | 6 | export type TabName = 'Action' | 'Diff' | 'State'; 7 | export type Tab = { 8 | name: TabName, 9 | component: React$Component 10 | }; 11 | 12 | export type ReduxState = { 13 | selectedActionId: null | number, 14 | startActionId: null | number, 15 | inspectedActionPath: string[], 16 | inspectedStatePath: string[], 17 | tabName: TabName 18 | }; 19 | 20 | export type MonitorState = { 21 | initialScrollTop: number 22 | }; 23 | -------------------------------------------------------------------------------- /src/themes/inspector.js: -------------------------------------------------------------------------------- 1 | export default { 2 | scheme: 'inspector', 3 | author: 'Alexander Kuznetsov (alexkuz@gmail.com)', 4 | base00: '#181818', 5 | base01: '#282828', 6 | base02: '#383838', 7 | base03: '#585858', 8 | base04: '#b8b8b8', 9 | base05: '#d8d8d8', 10 | base06: '#e8e8e8', 11 | base07: '#FFFFFF', 12 | base08: '#E92F28', 13 | base09: '#dc9656', 14 | base0A: '#f7ca88', 15 | base0B: '#65AD00', 16 | base0C: '#86c1b9', 17 | base0D: '#347BD9', 18 | base0E: '#EC31C0', 19 | base0F: '#a16946' 20 | }; 21 | -------------------------------------------------------------------------------- /src/RightSlider.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | 4 | import type { StylingFunction } from 'react-base16-styling'; 5 | 6 | type Props = { 7 | styling: StylingFunction, 8 | shown: boolean, 9 | children?: any, 10 | rotate?: boolean 11 | }; 12 | 13 | const RightSlider = ({ styling, shown, children, rotate }: Props) => 14 |
20 | {children} 21 |
; 22 | 23 | export default RightSlider; 24 | -------------------------------------------------------------------------------- /src/tabs/getJsonTreeTheme.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import type { Base16Theme, StylingConfig } from 'react-base16-styling'; 3 | 4 | export default function getJsonTreeTheme(base16Theme: string | Base16Theme): StylingConfig { 5 | return { 6 | extend: base16Theme, 7 | nestedNode: ({ style }, keyPath, nodeType, expanded) => ({ 8 | style: { 9 | ...style, 10 | whiteSpace: expanded ? 'inherit' : 'nowrap' 11 | } 12 | }), 13 | nestedNodeItemString: ({ style }, keyPath, nodeType, expanded) => ({ 14 | style: { 15 | ...style, 16 | display: expanded ? 'none' : 'inline' 17 | } 18 | }) 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /src/tabs/DiffTab.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | import JSONDiff from './JSONDiff'; 4 | 5 | import type { LabelRenderer } from 'react-json-tree'; 6 | import type { Delta } from 'jsondiffpatch'; 7 | import type { StylingFunction, Base16Theme } from 'react-base16-styling'; 8 | 9 | type Props = { 10 | delta: Delta, 11 | styling: StylingFunction, 12 | base16Theme: Base16Theme, 13 | invertTheme: boolean, 14 | labelRenderer: LabelRenderer, 15 | isWideLayout: boolean 16 | }; 17 | 18 | const DiffTab = ( 19 | { delta, styling, base16Theme, invertTheme, labelRenderer, isWideLayout }: Props 20 | ): React$Element<*> => 21 | ; 24 | 25 | export default DiffTab; 26 | -------------------------------------------------------------------------------- /src/redux.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import { ReduxState, MonitorState } from './types'; 3 | 4 | type Action = { 5 | type: string, 6 | [key: string]: any 7 | }; 8 | 9 | const UPDATE_MONITOR_STATE = '@@redux-devtools-inspector/UPDATE_MONITOR_STATE'; 10 | 11 | const DEFAULT_STATE: ReduxState = { 12 | selectedActionId: null, 13 | startActionId: null, 14 | inspectedActionPath: [], 15 | inspectedStatePath: [], 16 | tabName: 'Diff' 17 | }; 18 | 19 | export function updateMonitorState(monitorState: MonitorState) { 20 | return { type: UPDATE_MONITOR_STATE, monitorState }; 21 | } 22 | 23 | function reduceUpdateState(state, action) { 24 | return (action.type === UPDATE_MONITOR_STATE) ? { 25 | ...state, 26 | ...action.monitorState 27 | } : state; 28 | } 29 | 30 | export function reducer(props: Object, state: ReduxState=DEFAULT_STATE, action: Action) { 31 | return { 32 | ...reduceUpdateState(state, action) 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /flow-typed/npm/raw-loader_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ad91bda389b4a78d2db286ae512d8b82 2 | // flow-typed version: <>/raw-loader_v^0.5.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'raw-loader' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'raw-loader' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'raw-loader/index' { 29 | declare module.exports: $Exports<'raw-loader'>; 30 | } 31 | declare module 'raw-loader/index.js' { 32 | declare module.exports: $Exports<'raw-loader'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/json-loader_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: e3baa315cc326b6970ff976b78a213c4 2 | // flow-typed version: <>/json-loader_v^0.5.4/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'json-loader' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'json-loader' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'json-loader/index' { 29 | declare module.exports: $Exports<'json-loader'>; 30 | } 31 | declare module 'json-loader/index.js' { 32 | declare module.exports: $Exports<'json-loader'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-loader_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: d472d1fe21c8f562410fdb2ec02d4181 2 | // flow-typed version: <>/eslint-loader_v^1.2.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-loader' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-loader' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'eslint-loader/index' { 29 | declare module.exports: $Exports<'eslint-loader'>; 30 | } 31 | declare module 'eslint-loader/index.js' { 32 | declare module.exports: $Exports<'eslint-loader'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/imports-loader_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b9ed299033add534481e2c100105817f 2 | // flow-typed version: <>/imports-loader_v^0.6.5/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'imports-loader' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'imports-loader' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'imports-loader/index' { 29 | declare module.exports: $Exports<'imports-loader'>; 30 | } 31 | declare module 'imports-loader/index.js' { 32 | declare module.exports: $Exports<'imports-loader'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/lodash.shuffle_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 1008f2ef17afcb362a7c1c2d677cf70e 2 | // flow-typed version: <>/lodash.shuffle_v^4.2.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'lodash.shuffle' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'lodash.shuffle' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'lodash.shuffle/index' { 29 | declare module.exports: $Exports<'lodash.shuffle'>; 30 | } 31 | declare module 'lodash.shuffle/index.js' { 32 | declare module.exports: $Exports<'lodash.shuffle'>; 33 | } 34 | -------------------------------------------------------------------------------- /src/utils/getType.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import { List, Map as ImMap, Set as ImSet, OrderedMap, OrderedSet, Stack, Seq } from 'immutable'; 3 | import objType from 'react-json-tree/lib/objType'; 4 | 5 | type Type = 6 | string | 7 | 'Immutable List' | 8 | 'Immutable Map' | 9 | 'Immutable Set' | 10 | 'Immutable OrderedMap' | 11 | 'Immutable OrderedSet' | 12 | 'Immutable Stack' | 13 | 'Immutable Seq'; 14 | 15 | export default function getType(value: any): Type { 16 | if (List.isList(value)) { 17 | return 'Immutable List'; 18 | } else if (ImMap.isMap(value)) { 19 | return 'Immutable Map'; 20 | } else if (ImSet.isSet(value)) { 21 | return 'Immutable Set'; 22 | } else if (OrderedMap.isOrderedMap(value)) { 23 | return 'Immutable OrderedMap'; 24 | } else if (OrderedSet.isOrderedSet(value)) { 25 | return 'Immutable OrderedSet'; 26 | } else if (Stack.isStack(value)) { 27 | return 'Immutable Stack'; 28 | } else if (Seq.isSeq(value)) { 29 | return 'Immutable Seq'; 30 | } 31 | 32 | return objType(value); 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/lodash.debounce_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 15e5f9c338066ba6b689d1c6beec3c2f 2 | // flow-typed version: <>/lodash.debounce_v^4.0.3/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'lodash.debounce' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'lodash.debounce' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'lodash.debounce/index' { 29 | declare module.exports: $Exports<'lodash.debounce'>; 30 | } 31 | declare module 'lodash.debounce/index.js' { 32 | declare module.exports: $Exports<'lodash.debounce'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-react_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 7703d6161a7a405ec30f3756eaa3e3d6 2 | // flow-typed version: <>/babel-preset-react_v^6.3.13/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-react' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-react' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-react/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-react/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-react/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-es2015_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 5fced182cede4fb3fe5af8c6eb431042 2 | // flow-typed version: <>/babel-preset-es2015_v^6.3.13/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-es2015' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-es2015' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-es2015/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-es2015/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-es2015/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-preset-stage-0_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: a2adfce86c7d7e67b7ae170bce5e2165 2 | // flow-typed version: <>/babel-preset-stage-0_v^6.3.13/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-preset-stage-0' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-preset-stage-0' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-preset-stage-0/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-preset-stage-0/lib/index.js' { 31 | declare module.exports: $Exports<'babel-preset-stage-0/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <%= htmlWebpackPlugin.options.package.name %> 6 | 7 | 8 | 9 | 10 | 11 | Fork me on GitHub 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /flow-typed/npm/clean-webpack-plugin_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 70b754b90629d8806d098a8baab4f460 2 | // flow-typed version: <>/clean-webpack-plugin_v^0.1.8/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'clean-webpack-plugin' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'clean-webpack-plugin' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'clean-webpack-plugin/index' { 29 | declare module.exports: $Exports<'clean-webpack-plugin'>; 30 | } 31 | declare module 'clean-webpack-plugin/index.js' { 32 | declare module.exports: $Exports<'clean-webpack-plugin'>; 33 | } 34 | -------------------------------------------------------------------------------- /flow-typed/npm/javascript-stringify_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: bd581ef5152539f48f4be82ce9351b6f 2 | // flow-typed version: <>/javascript-stringify_v^1.1.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'javascript-stringify' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'javascript-stringify' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'javascript-stringify/javascript-stringify' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'javascript-stringify/javascript-stringify.js' { 31 | declare module.exports: $Exports<'javascript-stringify/javascript-stringify'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/babel_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 48887025514a62a4834dac05dd8d370a 2 | // flow-typed version: <>/babel_v^6.3.26/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel/cli' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel/cli.js' { 31 | declare module.exports: $Exports<'babel/cli'>; 32 | } 33 | declare module 'babel/index' { 34 | declare module.exports: $Exports<'babel'>; 35 | } 36 | declare module 'babel/index.js' { 37 | declare module.exports: $Exports<'babel'>; 38 | } 39 | -------------------------------------------------------------------------------- /flow-typed/npm/export-files-webpack-plugin_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c807472b6041027d3c6a9f99819b8804 2 | // flow-typed version: <>/export-files-webpack-plugin_v0.0.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'export-files-webpack-plugin' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'export-files-webpack-plugin' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | 26 | 27 | // Filename aliases 28 | declare module 'export-files-webpack-plugin/index' { 29 | declare module.exports: $Exports<'export-files-webpack-plugin'>; 30 | } 31 | declare module 'export-files-webpack-plugin/index.js' { 32 | declare module.exports: $Exports<'export-files-webpack-plugin'>; 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015 Alexander Kuznetsov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /flow-typed/npm/hex-rgba_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 71bc99f66895413978a791b4174ddb8a 2 | // flow-typed version: <>/hex-rgba_v^1.0.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'hex-rgba' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'hex-rgba' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'hex-rgba/test' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'hex-rgba/index' { 31 | declare module.exports: $Exports<'hex-rgba'>; 32 | } 33 | declare module 'hex-rgba/index.js' { 34 | declare module.exports: $Exports<'hex-rgba'>; 35 | } 36 | declare module 'hex-rgba/test.js' { 37 | declare module.exports: $Exports<'hex-rgba/test'>; 38 | } 39 | -------------------------------------------------------------------------------- /src/createDiffPatcher.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import diffPatcher from 'jsondiffpatch'; 3 | 4 | import type { ObjectHash, PropertyFilter, JsonDiffPatcher } from 'jsondiffpatch'; 5 | 6 | const defaultObjectHash = (o, idx) => 7 | o === null && '$$null' || 8 | o && (o.id || o.id === 0) && `$$id:${JSON.stringify(o.id)}` || 9 | o && (o._id ||o._id === 0) && `$$_id:${JSON.stringify(o._id)}` || 10 | '$$index:' + idx.toString(); 11 | 12 | const defaultPropertyFilter = (name, context) => 13 | typeof context.left[name] !== 'function' && 14 | typeof context.right[name] !== 'function'; 15 | 16 | const defaultDiffPatcher = diffPatcher.create({ 17 | arrays: { detectMove: false }, 18 | objectHash: defaultObjectHash, 19 | propertyFilter: defaultPropertyFilter 20 | }); 21 | 22 | export default function createDiffPatcher( 23 | objectHash: ObjectHash, propertyFilter: PropertyFilter 24 | ): JsonDiffPatcher { 25 | if (!objectHash && !propertyFilter) { 26 | return defaultDiffPatcher; 27 | } 28 | 29 | return diffPatcher.create({ 30 | arrays: { detectMove: false }, 31 | objectHash: objectHash || defaultObjectHash, 32 | propertyFilter: propertyFilter || defaultPropertyFilter 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-transform-flow-strip-types_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 147af63ef1970e66fe8225d36f3df862 2 | // flow-typed version: <>/babel-plugin-transform-flow-strip-types_v^6.22.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-transform-flow-strip-types' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-transform-flow-strip-types' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-transform-flow-strip-types/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'babel-plugin-transform-flow-strip-types/lib/index.js' { 31 | declare module.exports: $Exports<'babel-plugin-transform-flow-strip-types/lib/index'>; 32 | } 33 | -------------------------------------------------------------------------------- /flow-typed/npm/react-transform-hmr_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 87f9312e4ee9ab91605389c4dc52735a 2 | // flow-typed version: <>/react-transform-hmr_v^1.0.2/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-transform-hmr' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-transform-hmr' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'react-transform-hmr/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'react-transform-hmr/src/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'react-transform-hmr/lib/index.js' { 35 | declare module.exports: $Exports<'react-transform-hmr/lib/index'>; 36 | } 37 | declare module 'react-transform-hmr/src/index.js' { 38 | declare module.exports: $Exports<'react-transform-hmr/src/index'>; 39 | } 40 | -------------------------------------------------------------------------------- /flow-typed/npm/nyan-progress-webpack-plugin_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 624022de2b8cb22698414c9875ff0bcc 2 | // flow-typed version: <>/nyan-progress-webpack-plugin_v^1.1.4/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'nyan-progress-webpack-plugin' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'nyan-progress-webpack-plugin' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'nyan-progress-webpack-plugin/test/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | // Filename aliases 30 | declare module 'nyan-progress-webpack-plugin/index' { 31 | declare module.exports: $Exports<'nyan-progress-webpack-plugin'>; 32 | } 33 | declare module 'nyan-progress-webpack-plugin/index.js' { 34 | declare module.exports: $Exports<'nyan-progress-webpack-plugin'>; 35 | } 36 | declare module 'nyan-progress-webpack-plugin/test/index.js' { 37 | declare module.exports: $Exports<'nyan-progress-webpack-plugin/test/index'>; 38 | } 39 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-plugin-transform-runtime_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b5a9cd747a85568d146e5ad32ce77ac7 2 | // flow-typed version: <>/babel-plugin-transform-runtime_v^6.4.3/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-plugin-transform-runtime' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-plugin-transform-runtime' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-plugin-transform-runtime/lib/definitions' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-plugin-transform-runtime/lib/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'babel-plugin-transform-runtime/lib/definitions.js' { 35 | declare module.exports: $Exports<'babel-plugin-transform-runtime/lib/definitions'>; 36 | } 37 | declare module 'babel-plugin-transform-runtime/lib/index.js' { 38 | declare module.exports: $Exports<'babel-plugin-transform-runtime/lib/index'>; 39 | } 40 | -------------------------------------------------------------------------------- /flow-typed/npm/chokidar_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: b6b1d4625c5f9cc4ed815ade48107b75 2 | // flow-typed version: <>/chokidar_v^1.6.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'chokidar' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'chokidar' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'chokidar/lib/fsevents-handler' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'chokidar/lib/nodefs-handler' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'chokidar/index' { 35 | declare module.exports: $Exports<'chokidar'>; 36 | } 37 | declare module 'chokidar/index.js' { 38 | declare module.exports: $Exports<'chokidar'>; 39 | } 40 | declare module 'chokidar/lib/fsevents-handler.js' { 41 | declare module.exports: $Exports<'chokidar/lib/fsevents-handler'>; 42 | } 43 | declare module 'chokidar/lib/nodefs-handler.js' { 44 | declare module.exports: $Exports<'chokidar/lib/nodefs-handler'>; 45 | } 46 | -------------------------------------------------------------------------------- /src/utils/getInspectedState.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import { Iterable, fromJS } from 'immutable'; 3 | import isIterable from './isIterable'; 4 | import getType from './getType'; 5 | 6 | function iterateToKey(obj, key) { // maybe there's a better way, dunno 7 | let idx = 0; 8 | for (let entry of obj) { 9 | if (idx === key) return entry; 10 | idx++; 11 | } 12 | } 13 | 14 | const entryRegex = /\[entry (\d+)\]/; 15 | 16 | export default function getInspectedState( 17 | state: Object, path: ?string[], convertImmutable: boolean 18 | ): Object { 19 | state = path && path.length ? { 20 | [path[path.length - 1]]: path.reduce( 21 | (s, key) => { 22 | if (!s) { 23 | return s; 24 | } 25 | if (Iterable.isAssociative(s) || getType(s) === 'Map') { 26 | if (!s.has(key) && entryRegex.test(key)) { 27 | const match = key.match(entryRegex); 28 | const entry = iterateToKey(s, parseInt(match && match[1], 10)); 29 | return entry && { 30 | '[key]': entry[0], 31 | '[value]': entry[1] 32 | }; 33 | } 34 | return s.get(key); 35 | } else if (isIterable(s)) { 36 | return iterateToKey(s, parseInt(key, 10)); 37 | } 38 | 39 | return s[key]; 40 | }, 41 | state 42 | ) 43 | } : state; 44 | 45 | if (convertImmutable) { 46 | try { 47 | state = fromJS(state).toJS(); 48 | } catch(e) {} 49 | } 50 | 51 | return state; 52 | } 53 | -------------------------------------------------------------------------------- /flow-typed/npm/git-directory-deploy_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: d85e1f068e3a1b3fe19183ed065deaa3 2 | // flow-typed version: <>/git-directory-deploy_v^1.5.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'git-directory-deploy' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'git-directory-deploy' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'git-directory-deploy/cliArgs' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'git-directory-deploy/test/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | // Filename aliases 34 | declare module 'git-directory-deploy/cliArgs.js' { 35 | declare module.exports: $Exports<'git-directory-deploy/cliArgs'>; 36 | } 37 | declare module 'git-directory-deploy/index' { 38 | declare module.exports: $Exports<'git-directory-deploy'>; 39 | } 40 | declare module 'git-directory-deploy/index.js' { 41 | declare module.exports: $Exports<'git-directory-deploy'>; 42 | } 43 | declare module 'git-directory-deploy/test/index.js' { 44 | declare module.exports: $Exports<'git-directory-deploy/test/index'>; 45 | } 46 | -------------------------------------------------------------------------------- /flow-typed/npm/pre-commit_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 3c244f059ec06d1c210225d4b923ba57 2 | // flow-typed version: <>/pre-commit_v^1.1.3/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'pre-commit' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'pre-commit' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'pre-commit/install' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'pre-commit/test' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'pre-commit/uninstall' { 34 | declare module.exports: any; 35 | } 36 | 37 | // Filename aliases 38 | declare module 'pre-commit/index' { 39 | declare module.exports: $Exports<'pre-commit'>; 40 | } 41 | declare module 'pre-commit/index.js' { 42 | declare module.exports: $Exports<'pre-commit'>; 43 | } 44 | declare module 'pre-commit/install.js' { 45 | declare module.exports: $Exports<'pre-commit/install'>; 46 | } 47 | declare module 'pre-commit/test.js' { 48 | declare module.exports: $Exports<'pre-commit/test'>; 49 | } 50 | declare module 'pre-commit/uninstall.js' { 51 | declare module.exports: $Exports<'pre-commit/uninstall'>; 52 | } 53 | -------------------------------------------------------------------------------- /src/ActionListHeader.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | import RightSlider from './RightSlider'; 4 | 5 | import type { StylingFunction } from 'react-base16-styling'; 6 | 7 | type Props = { 8 | styling: StylingFunction, 9 | onSearch: (searchStr: string) => void, 10 | onCommit: () => void, 11 | onSweep: () => void, 12 | hasSkippedActions: boolean, 13 | hasStagedActions: boolean 14 | }; 15 | 16 | const getActiveButtons = (hasSkippedActions): Array<'Sweep' | 'Commit'> => [ 17 | hasSkippedActions ? 'Sweep' : null, 18 | 'Commit' 19 | ].filter(Boolean); 20 | 21 | const ActionListHeader = 22 | ({ styling, onSearch, hasSkippedActions, hasStagedActions, onCommit, onSweep }: Props) => 23 |
24 | onSearch(e.target.value)} 27 | placeholder='filter...' 28 | /> 29 |
30 | 31 |
32 | {getActiveButtons(hasSkippedActions).map(btn => 33 |
({ 36 | Commit: onCommit, 37 | Sweep: onSweep 38 | })[btn]()} 39 | {...styling([ 40 | 'selectorButton', 41 | 'selectorButtonSmall'], false, true)} 42 | > 43 | {btn} 44 |
45 | )} 46 |
47 |
48 |
49 |
; 50 | 51 | export default ActionListHeader; 52 | -------------------------------------------------------------------------------- /src/tabs/StateTab.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import JSONTree from 'react-json-tree'; 4 | import getItemString from './getItemString'; 5 | import getJsonTreeTheme from './getJsonTreeTheme'; 6 | 7 | import type { LabelRenderer } from 'react-json-tree'; 8 | import type { StylingFunction, Base16Theme, StylingConfig } from 'react-base16-styling'; 9 | 10 | type Props = { 11 | styling: StylingFunction, 12 | base16Theme: Base16Theme, 13 | invertTheme: boolean, 14 | labelRenderer: LabelRenderer, 15 | isWideLayout: boolean, 16 | nextState: Object 17 | }; 18 | 19 | type State = { 20 | theme: StylingConfig 21 | }; 22 | 23 | const getStateFromProps = props => ({ 24 | theme: getJsonTreeTheme(props.base16Theme) 25 | }); 26 | 27 | export default class StateTab extends PureComponent { 28 | state: State; 29 | 30 | constructor(props: Props) { 31 | super(props); 32 | this.state = getStateFromProps(props); 33 | } 34 | 35 | componentWillReceiveProps(nextProps: Props) { 36 | if (nextProps.base16Theme !== this.props.base16Theme) { 37 | this.setState(getStateFromProps(nextProps)); 38 | } 39 | } 40 | 41 | render() { 42 | const { labelRenderer, nextState, invertTheme } = this.props; 43 | return ( 44 | 52 | ); 53 | } 54 | 55 | getItemString = (type: string, data: any) => { 56 | return getItemString(this.props.styling, type, data, this.props.isWideLayout); 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /src/tabs/ActionTab.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import JSONTree from 'react-json-tree'; 4 | import getItemString from './getItemString'; 5 | import getJsonTreeTheme from './getJsonTreeTheme'; 6 | 7 | import type { LabelRenderer } from 'react-json-tree'; 8 | import type { Action } from '../types'; 9 | import type { StylingFunction, Base16Theme, StylingConfig } from 'react-base16-styling'; 10 | 11 | type Props = { 12 | action: Action, 13 | styling: StylingFunction, 14 | base16Theme: Base16Theme, 15 | invertTheme: boolean, 16 | labelRenderer: LabelRenderer, 17 | isWideLayout: boolean 18 | }; 19 | 20 | type State = { 21 | theme: StylingConfig 22 | }; 23 | 24 | const getStateFromProps = props => ({ 25 | theme: getJsonTreeTheme(props.base16Theme) 26 | }); 27 | 28 | export default class ActionTab extends PureComponent { 29 | state: State; 30 | 31 | constructor(props: Props) { 32 | super(props); 33 | this.state = getStateFromProps(props); 34 | } 35 | 36 | componentWillReceiveProps(nextProps: Props) { 37 | if (nextProps.base16Theme !== this.props.base16Theme) { 38 | this.setState(getStateFromProps(nextProps)); 39 | } 40 | } 41 | 42 | render() { 43 | const { labelRenderer, action, invertTheme } = this.props; 44 | return ( 45 | 53 | ); 54 | } 55 | 56 | getItemString = (type: string, data: any) => { 57 | return getItemString(this.props.styling, type, data, this.props.isWideLayout); 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /src/ActionPreviewHeader.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | 4 | import type { StylingFunction } from 'react-base16-styling'; 5 | import type { Tab, TabName } from './types'; 6 | 7 | type Props = { 8 | styling: StylingFunction, 9 | inspectedPath: string[], 10 | onInspectPath: (path: string[]) => void, 11 | tabName: TabName, 12 | onSelectTab: (tabName: TabName) => void, 13 | tabs: Tab[] 14 | }; 15 | 16 | const ActionPreviewHeader = 17 | ({ styling, inspectedPath, onInspectPath, tabName, onSelectTab, tabs }: Props) => 18 |
19 |
20 | {tabs.map(tab => 21 |
onSelectTab(tab.name)} 22 | key={tab.name} 23 | {...styling([ 24 | 'selectorButton', 25 | tab.name === tabName ? 'selectorButtonSelected' : null 26 | ], tab.name === tabName)}> 27 | {tab.name} 28 |
29 | )} 30 |
31 |
32 | {inspectedPath.length ? 33 | 34 | onInspectPath([])} 35 | {...styling('inspectedPathKeyLink')}> 36 | {tabName} 37 | 38 | : tabName 39 | } 40 | {inspectedPath.map((key, idx) => 41 | idx === inspectedPath.length - 1 ? {key} : 42 | 44 | onInspectPath(inspectedPath.slice(0, idx + 1))} 45 | {...styling('inspectedPathKeyLink')}> 46 | {key} 47 | 48 | 49 | )} 50 |
51 |
; 52 | 53 | export default ActionPreviewHeader; 54 | -------------------------------------------------------------------------------- /flow-typed/npm/redux-devtools-themes_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: db8399d20300f4347ca424bce2d3cc9f 2 | // flow-typed version: <>/redux-devtools-themes_v^1.0.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'redux-devtools-themes' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'redux-devtools-themes' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'redux-devtools-themes/lib/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'redux-devtools-themes/lib/nicinabox' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'redux-devtools-themes/src/index' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'redux-devtools-themes/src/nicinabox' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'redux-devtools-themes/lib/index.js' { 43 | declare module.exports: $Exports<'redux-devtools-themes/lib/index'>; 44 | } 45 | declare module 'redux-devtools-themes/lib/nicinabox.js' { 46 | declare module.exports: $Exports<'redux-devtools-themes/lib/nicinabox'>; 47 | } 48 | declare module 'redux-devtools-themes/src/index.js' { 49 | declare module.exports: $Exports<'redux-devtools-themes/src/index'>; 50 | } 51 | declare module 'redux-devtools-themes/src/nicinabox.js' { 52 | declare module.exports: $Exports<'redux-devtools-themes/src/nicinabox'>; 53 | } 54 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "rules": { 4 | "no-undef": ["error"], 5 | "no-trailing-spaces": ["warn"], 6 | "space-before-blocks": ["warn", "always"], 7 | "no-unused-expressions": ["off"], 8 | "no-underscore-dangle": ["off"], 9 | "quote-props": ["warn", "as-needed"], 10 | "no-multi-spaces": ["off"], 11 | "no-unused-vars": ["warn"], 12 | "no-loop-func": ["off"], 13 | "key-spacing": ["off"], 14 | "max-len": ["warn", 100], 15 | "strict": ["off"], 16 | "eol-last": ["warn"], 17 | "no-console": ["warn"], 18 | "indent": ["warn", 2], 19 | "quotes": ["warn", "single", "avoid-escape"], 20 | "curly": ["off"], 21 | "jsx-quotes": ["warn", "prefer-single"], 22 | 23 | "react/jsx-boolean-value": "warn", 24 | "react/jsx-no-undef": "error", 25 | "react/jsx-uses-react": "warn", 26 | "react/jsx-uses-vars": "warn", 27 | "react/no-did-mount-set-state": "warn", 28 | "react/no-did-update-set-state": "warn", 29 | "react/no-multi-comp": "off", 30 | "react/no-unknown-property": "error", 31 | "react/react-in-jsx-scope": "error", 32 | "react/self-closing-comp": "warn", 33 | "react/jsx-wrap-multilines": "warn", 34 | 35 | "generator-star-spacing": "off", 36 | "new-cap": "off", 37 | "object-curly-spacing": "off", 38 | "object-shorthand": "off", 39 | 40 | "babel/generator-star-spacing": "warn", 41 | "babel/new-cap": "warn", 42 | "babel/object-curly-spacing": ["warn", "always"], 43 | "babel/object-shorthand": "warn" 44 | }, 45 | "extends": [ 46 | "plugin:flowtype/recommended" 47 | ], 48 | "plugins": [ 49 | "react", 50 | "babel", 51 | "flowtype" 52 | ], 53 | "settings": { 54 | "ecmascript": 6, 55 | "jsx": true 56 | }, 57 | "env": { 58 | "browser": true, 59 | "node": true, 60 | "es6": true 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-loader_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: e4ee8e671de79f0a18a007b1cd7daeb1 2 | // flow-typed version: <>/babel-loader_v^6.2.2/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-loader' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-loader' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-loader/lib/fs-cache' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-loader/lib/helpers/exists' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-loader/lib/helpers/read' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-loader/lib/resolve-rc' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'babel-loader/index' { 43 | declare module.exports: $Exports<'babel-loader'>; 44 | } 45 | declare module 'babel-loader/index.js' { 46 | declare module.exports: $Exports<'babel-loader'>; 47 | } 48 | declare module 'babel-loader/lib/fs-cache.js' { 49 | declare module.exports: $Exports<'babel-loader/lib/fs-cache'>; 50 | } 51 | declare module 'babel-loader/lib/helpers/exists.js' { 52 | declare module.exports: $Exports<'babel-loader/lib/helpers/exists'>; 53 | } 54 | declare module 'babel-loader/lib/helpers/read.js' { 55 | declare module.exports: $Exports<'babel-loader/lib/helpers/read'>; 56 | } 57 | declare module 'babel-loader/lib/resolve-rc.js' { 58 | declare module.exports: $Exports<'babel-loader/lib/resolve-rc'>; 59 | } 60 | -------------------------------------------------------------------------------- /flow-typed/npm/react-pure-render_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 4d09aab94faa17d119fa0ee1a243a4d2 2 | // flow-typed version: <>/react-pure-render_v^1.0.2/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-pure-render' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-pure-render' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'react-pure-render/component' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'react-pure-render/function' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'react-pure-render/mixin' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'react-pure-render/shallowEqual' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'react-pure-render/component.js' { 43 | declare module.exports: $Exports<'react-pure-render/component'>; 44 | } 45 | declare module 'react-pure-render/function.js' { 46 | declare module.exports: $Exports<'react-pure-render/function'>; 47 | } 48 | declare module 'react-pure-render/index' { 49 | declare module.exports: $Exports<'react-pure-render'>; 50 | } 51 | declare module 'react-pure-render/index.js' { 52 | declare module.exports: $Exports<'react-pure-render'>; 53 | } 54 | declare module 'react-pure-render/mixin.js' { 55 | declare module.exports: $Exports<'react-pure-render/mixin'>; 56 | } 57 | declare module 'react-pure-render/shallowEqual.js' { 58 | declare module.exports: $Exports<'react-pure-render/shallowEqual'>; 59 | } 60 | -------------------------------------------------------------------------------- /flow-typed/npm/html-webpack-plugin_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: df71db7c32c26d3c313ac8af48eaff58 2 | // flow-typed version: <>/html-webpack-plugin_v^2.8.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'html-webpack-plugin' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'html-webpack-plugin' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'html-webpack-plugin/lib/chunksorter' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'html-webpack-plugin/lib/compiler' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'html-webpack-plugin/lib/errors' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'html-webpack-plugin/lib/loader' { 38 | declare module.exports: any; 39 | } 40 | 41 | // Filename aliases 42 | declare module 'html-webpack-plugin/index' { 43 | declare module.exports: $Exports<'html-webpack-plugin'>; 44 | } 45 | declare module 'html-webpack-plugin/index.js' { 46 | declare module.exports: $Exports<'html-webpack-plugin'>; 47 | } 48 | declare module 'html-webpack-plugin/lib/chunksorter.js' { 49 | declare module.exports: $Exports<'html-webpack-plugin/lib/chunksorter'>; 50 | } 51 | declare module 'html-webpack-plugin/lib/compiler.js' { 52 | declare module.exports: $Exports<'html-webpack-plugin/lib/compiler'>; 53 | } 54 | declare module 'html-webpack-plugin/lib/errors.js' { 55 | declare module.exports: $Exports<'html-webpack-plugin/lib/errors'>; 56 | } 57 | declare module 'html-webpack-plugin/lib/loader.js' { 58 | declare module.exports: $Exports<'html-webpack-plugin/lib/loader'>; 59 | } 60 | -------------------------------------------------------------------------------- /flow-typed/npm/dateformat_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: aedb785a7da9e1f2ecdf25aa3c75cdda 2 | // flow-typed version: <>/dateformat_v^1.0.12/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'dateformat' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'dateformat' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'dateformat/bin/cli' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'dateformat/lib/dateformat' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'dateformat/test/test_dayofweek' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'dateformat/test/test_formats' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'dateformat/test/test_isoutcdatetime' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'dateformat/test/weekofyear/test_weekofyear' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'dateformat/bin/cli.js' { 51 | declare module.exports: $Exports<'dateformat/bin/cli'>; 52 | } 53 | declare module 'dateformat/lib/dateformat.js' { 54 | declare module.exports: $Exports<'dateformat/lib/dateformat'>; 55 | } 56 | declare module 'dateformat/test/test_dayofweek.js' { 57 | declare module.exports: $Exports<'dateformat/test/test_dayofweek'>; 58 | } 59 | declare module 'dateformat/test/test_formats.js' { 60 | declare module.exports: $Exports<'dateformat/test/test_formats'>; 61 | } 62 | declare module 'dateformat/test/test_isoutcdatetime.js' { 63 | declare module.exports: $Exports<'dateformat/test/test_isoutcdatetime'>; 64 | } 65 | declare module 'dateformat/test/weekofyear/test_weekofyear.js' { 66 | declare module.exports: $Exports<'dateformat/test/weekofyear/test_weekofyear'>; 67 | } 68 | -------------------------------------------------------------------------------- /flow-typed/npm/redux-devtools_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: a113186854719290c867dd7de9406cb0 2 | // flow-typed version: <>/redux-devtools_v^3.1.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'redux-devtools' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'redux-devtools' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'redux-devtools/lib/createDevTools' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'redux-devtools/lib/index' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'redux-devtools/lib/persistState' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'redux-devtools/src/createDevTools' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'redux-devtools/src/index' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'redux-devtools/src/persistState' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'redux-devtools/lib/createDevTools.js' { 51 | declare module.exports: $Exports<'redux-devtools/lib/createDevTools'>; 52 | } 53 | declare module 'redux-devtools/lib/index.js' { 54 | declare module.exports: $Exports<'redux-devtools/lib/index'>; 55 | } 56 | declare module 'redux-devtools/lib/persistState.js' { 57 | declare module.exports: $Exports<'redux-devtools/lib/persistState'>; 58 | } 59 | declare module 'redux-devtools/src/createDevTools.js' { 60 | declare module.exports: $Exports<'redux-devtools/src/createDevTools'>; 61 | } 62 | declare module 'redux-devtools/src/index.js' { 63 | declare module.exports: $Exports<'redux-devtools/src/index'>; 64 | } 65 | declare module 'redux-devtools/src/persistState.js' { 66 | declare module.exports: $Exports<'redux-devtools/src/persistState'>; 67 | } 68 | -------------------------------------------------------------------------------- /flow-typed/npm/redux_v3.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: ba132c96664f1a05288f3eb2272a3c35 2 | // flow-typed version: c4bbd91cfc/redux_v3.x.x/flow_>=v0.33.x 3 | 4 | declare module 'redux' { 5 | 6 | /* 7 | 8 | S = State 9 | A = Action 10 | 11 | */ 12 | 13 | declare type Dispatch }> = (action: A) => A; 14 | 15 | declare type MiddlewareAPI = { 16 | dispatch: Dispatch; 17 | getState(): S; 18 | }; 19 | 20 | declare type Store = { 21 | // rewrite MiddlewareAPI members in order to get nicer error messages (intersections produce long messages) 22 | dispatch: Dispatch; 23 | getState(): S; 24 | subscribe(listener: () => void): () => void; 25 | replaceReducer(nextReducer: Reducer): void 26 | }; 27 | 28 | declare type Reducer = (state: S, action: A) => S; 29 | 30 | declare type Middleware = 31 | (api: MiddlewareAPI) => 32 | (next: Dispatch) => Dispatch; 33 | 34 | declare type StoreCreator = { 35 | (reducer: Reducer, enhancer?: StoreEnhancer): Store; 36 | (reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; 37 | }; 38 | 39 | declare type StoreEnhancer = (next: StoreCreator) => StoreCreator; 40 | 41 | declare function createStore(reducer: Reducer, enhancer?: StoreEnhancer): Store; 42 | declare function createStore(reducer: Reducer, preloadedState: S, enhancer?: StoreEnhancer): Store; 43 | 44 | declare function applyMiddleware(...middlewares: Array>): StoreEnhancer; 45 | 46 | declare type ActionCreator = (...args: Array) => A; 47 | declare type ActionCreators = { [key: K]: ActionCreator }; 48 | 49 | declare function bindActionCreators>(actionCreator: C, dispatch: Dispatch): C; 50 | declare function bindActionCreators>(actionCreators: C, dispatch: Dispatch): C; 51 | 52 | declare function combineReducers(reducers: O): Reducer<$ObjMap(r: Reducer) => S>, A>; 53 | 54 | declare function compose(...fns: Array>): Function; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var webpack = require('webpack'); 3 | var HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | var CleanWebpackPlugin = require('clean-webpack-plugin'); 5 | var ExportFilesWebpackPlugin = require('export-files-webpack-plugin'); 6 | var NyanProgressWebpackPlugin = require('nyan-progress-webpack-plugin'); 7 | 8 | var pkg = require('./package.json'); 9 | 10 | var isProduction = process.env.NODE_ENV === 'production'; 11 | 12 | module.exports = { 13 | devtool: 'eval', 14 | entry: isProduction ? 15 | [ './demo/src/js/index' ] : [ 16 | 'webpack-dev-server/client?http://localhost:3000', 17 | 'webpack/hot/only-dev-server', 18 | './demo/src/js/index' 19 | ], 20 | output: { 21 | path: path.join(__dirname, 'demo/dist'), 22 | filename: 'js/bundle.js' 23 | }, 24 | plugins: [ 25 | new CleanWebpackPlugin(isProduction ? ['demo/dist'] : []), 26 | new HtmlWebpackPlugin({ 27 | inject: true, 28 | template: 'demo/src/index.html', 29 | filename: 'index.html', 30 | package: pkg 31 | }), 32 | new webpack.DefinePlugin({ 33 | 'process.env': { 34 | NODE_ENV: JSON.stringify(process.env.NODE_ENV) 35 | }, 36 | }), 37 | new webpack.NoEmitOnErrorsPlugin(), 38 | new NyanProgressWebpackPlugin() 39 | ].concat(isProduction ? [ 40 | new webpack.optimize.UglifyJsPlugin({ 41 | compress: { warnings: false }, 42 | output: { comments: false } 43 | }) 44 | ] : [ 45 | new ExportFilesWebpackPlugin('demo/dist/index.html'), 46 | new webpack.HotModuleReplacementPlugin() 47 | ]), 48 | resolve: { 49 | extensions: ['.js', '.jsx'] 50 | }, 51 | module: { 52 | exprContextCritical: false, 53 | loaders: [{ 54 | test: /\.jsx?$/, 55 | loaders: ['babel-loader'], 56 | include: [ 57 | path.join(__dirname, 'src'), 58 | path.join(__dirname, 'demo/src/js') 59 | ] 60 | }, { 61 | test: /\.json$/, 62 | loader: 'json-loader' 63 | }] 64 | }, 65 | devServer: isProduction ? undefined : { 66 | quiet: false, 67 | port: 3000, 68 | hot: true, 69 | stats: { 70 | chunkModules: false, 71 | colors: true 72 | }, 73 | historyApiFallback: true 74 | } 75 | }; 76 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-eslint_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 14eab3c4303bac56166cc6b81956e7c2 2 | // flow-typed version: <>/babel-eslint_v^7.1.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-eslint' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-eslint' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-eslint/babylon-to-espree/attachComments' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-eslint/babylon-to-espree/convertTemplateType' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-eslint/babylon-to-espree/index' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-eslint/babylon-to-espree/toAST' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-eslint/babylon-to-espree/toToken' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-eslint/babylon-to-espree/toTokens' { 46 | declare module.exports: any; 47 | } 48 | 49 | // Filename aliases 50 | declare module 'babel-eslint/babylon-to-espree/attachComments.js' { 51 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/attachComments'>; 52 | } 53 | declare module 'babel-eslint/babylon-to-espree/convertTemplateType.js' { 54 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/convertTemplateType'>; 55 | } 56 | declare module 'babel-eslint/babylon-to-espree/index.js' { 57 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/index'>; 58 | } 59 | declare module 'babel-eslint/babylon-to-espree/toAST.js' { 60 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toAST'>; 61 | } 62 | declare module 'babel-eslint/babylon-to-espree/toToken.js' { 63 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toToken'>; 64 | } 65 | declare module 'babel-eslint/babylon-to-espree/toTokens.js' { 66 | declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toTokens'>; 67 | } 68 | declare module 'babel-eslint/index' { 69 | declare module.exports: $Exports<'babel-eslint'>; 70 | } 71 | declare module 'babel-eslint/index.js' { 72 | declare module.exports: $Exports<'babel-eslint'>; 73 | } 74 | -------------------------------------------------------------------------------- /flow-typed/npm/jss-vendor-prefixer_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 2771909add299d14d44623381b3b1abc 2 | // flow-typed version: <>/jss-vendor-prefixer_v^4.0.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jss-vendor-prefixer' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jss-vendor-prefixer' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'jss-vendor-prefixer/dist/jss-vendor-prefixer' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'jss-vendor-prefixer/dist/jss-vendor-prefixer.min' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'jss-vendor-prefixer/karma.conf' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'jss-vendor-prefixer/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'jss-vendor-prefixer/lib/index.test' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'jss-vendor-prefixer/tests.webpack' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'jss-vendor-prefixer/tests/index' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'jss-vendor-prefixer/tests/index.test' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'jss-vendor-prefixer/webpack.config' { 58 | declare module.exports: any; 59 | } 60 | 61 | // Filename aliases 62 | declare module 'jss-vendor-prefixer/dist/jss-vendor-prefixer.js' { 63 | declare module.exports: $Exports<'jss-vendor-prefixer/dist/jss-vendor-prefixer'>; 64 | } 65 | declare module 'jss-vendor-prefixer/dist/jss-vendor-prefixer.min.js' { 66 | declare module.exports: $Exports<'jss-vendor-prefixer/dist/jss-vendor-prefixer.min'>; 67 | } 68 | declare module 'jss-vendor-prefixer/karma.conf.js' { 69 | declare module.exports: $Exports<'jss-vendor-prefixer/karma.conf'>; 70 | } 71 | declare module 'jss-vendor-prefixer/lib/index.js' { 72 | declare module.exports: $Exports<'jss-vendor-prefixer/lib/index'>; 73 | } 74 | declare module 'jss-vendor-prefixer/lib/index.test.js' { 75 | declare module.exports: $Exports<'jss-vendor-prefixer/lib/index.test'>; 76 | } 77 | declare module 'jss-vendor-prefixer/tests.webpack.js' { 78 | declare module.exports: $Exports<'jss-vendor-prefixer/tests.webpack'>; 79 | } 80 | declare module 'jss-vendor-prefixer/tests/index.js' { 81 | declare module.exports: $Exports<'jss-vendor-prefixer/tests/index'>; 82 | } 83 | declare module 'jss-vendor-prefixer/tests/index.test.js' { 84 | declare module.exports: $Exports<'jss-vendor-prefixer/tests/index.test'>; 85 | } 86 | declare module 'jss-vendor-prefixer/webpack.config.js' { 87 | declare module.exports: $Exports<'jss-vendor-prefixer/webpack.config'>; 88 | } 89 | -------------------------------------------------------------------------------- /flow-typed/npm/react-redux_v4.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: e0de1bae8e4653952fd0d24ea3610669 2 | // flow-typed version: c4bbd91cfc/react-redux_v4.x.x/flow_>=v0.30.x 3 | 4 | import type { Dispatch, Store } from 'redux' 5 | 6 | declare module 'react-redux' { 7 | 8 | /* 9 | 10 | S = State 11 | A = Action 12 | OP = OwnProps 13 | SP = StateProps 14 | DP = DispatchProps 15 | 16 | */ 17 | 18 | declare type MapStateToProps = (state: S, ownProps: OP) => SP | MapStateToProps; 19 | 20 | declare type MapDispatchToProps = ((dispatch: Dispatch, ownProps: OP) => DP) | DP; 21 | 22 | declare type MergeProps = (stateProps: SP, dispatchProps: DP, ownProps: OP) => P; 23 | 24 | declare type StatelessComponent

= (props: P) => ?React$Element; 25 | 26 | declare class ConnectedComponent extends React$Component { 27 | static WrappedComponent: Class>; 28 | getWrappedInstance(): React$Component; 29 | static defaultProps: void; 30 | props: OP; 31 | state: void; 32 | } 33 | 34 | declare type ConnectedComponentClass = Class>; 35 | 36 | declare type Connector = { 37 | (component: StatelessComponent

): ConnectedComponentClass; 38 | (component: Class>): ConnectedComponentClass; 39 | }; 40 | 41 | declare class Provider extends React$Component, children?: any }, void> { } 42 | 43 | declare type ConnectOptions = { 44 | pure?: boolean, 45 | withRef?: boolean 46 | }; 47 | 48 | declare type Null = null | void; 49 | 50 | declare function connect( 51 | ...rest: Array // <= workaround for https://github.com/facebook/flow/issues/2360 52 | ): Connector } & OP>>; 53 | 54 | declare function connect( 55 | mapStateToProps: Null, 56 | mapDispatchToProps: Null, 57 | mergeProps: Null, 58 | options: ConnectOptions 59 | ): Connector } & OP>>; 60 | 61 | declare function connect( 62 | mapStateToProps: MapStateToProps, 63 | mapDispatchToProps: Null, 64 | mergeProps: Null, 65 | options?: ConnectOptions 66 | ): Connector } & OP>>; 67 | 68 | declare function connect( 69 | mapStateToProps: Null, 70 | mapDispatchToProps: MapDispatchToProps, 71 | mergeProps: Null, 72 | options?: ConnectOptions 73 | ): Connector>; 74 | 75 | declare function connect( 76 | mapStateToProps: MapStateToProps, 77 | mapDispatchToProps: MapDispatchToProps, 78 | mergeProps: Null, 79 | options?: ConnectOptions 80 | ): Connector>; 81 | 82 | declare function connect( 83 | mapStateToProps: MapStateToProps, 84 | mapDispatchToProps: MapDispatchToProps, 85 | mergeProps: MergeProps, 86 | options?: ConnectOptions 87 | ): Connector; 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/ActionPreview.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { Component } from 'react'; 3 | import ActionPreviewHeader from './ActionPreviewHeader'; 4 | import DiffTab from './tabs/DiffTab'; 5 | import StateTab from './tabs/StateTab'; 6 | import ActionTab from './tabs/ActionTab'; 7 | 8 | import type { LabelRenderer } from 'react-json-tree'; 9 | import type { Tab, TabName } from './types'; 10 | 11 | type DefaultProps = { 12 | tabName: TabName 13 | }; 14 | 15 | type Props = DefaultProps & { 16 | tabs: ((defaultTabs: Tab[]) => Tab[]) | Tab[] 17 | }; 18 | 19 | const DEFAULT_TABS: Tab[] = [{ 20 | name: 'Action', 21 | component: ActionTab 22 | }, { 23 | name: 'Diff', 24 | component: DiffTab 25 | }, { 26 | name: 'State', 27 | component: StateTab 28 | }] 29 | 30 | class ActionPreview extends Component { 31 | static defaultProps: DefaultProps = { 32 | tabName: 'Diff' 33 | } 34 | 35 | render() { 36 | const { 37 | styling, delta, error, nextState, onInspectPath, inspectedPath, tabName, 38 | isWideLayout, onSelectTab, action, actions, selectedActionId, startActionId, 39 | computedStates, base16Theme, invertTheme, tabs 40 | } = this.props; 41 | 42 | const renderedTabs = (typeof tabs === 'function') ? 43 | tabs(DEFAULT_TABS) : 44 | (tabs ? tabs : DEFAULT_TABS); 45 | 46 | const tab = renderedTabs.find(tab => tab.name === tabName); 47 | 48 | let TabComponent; 49 | if (tab) { 50 | TabComponent = tab.component; 51 | } 52 | 53 | return ( 54 |

55 | 59 | {!error && 60 |
61 | {TabComponent && 62 | 78 | } 79 |
80 | } 81 | {error && 82 |
{error}
83 | } 84 |
85 | ); 86 | } 87 | 88 | labelRenderer: LabelRenderer = ([key, ...rest], nodeType, expanded) => { 89 | const { styling, onInspectPath, inspectedPath } = this.props; 90 | 91 | return ( 92 | 93 | 94 | {key} 95 | 96 | onInspectPath([ 98 | ...inspectedPath.slice(0, inspectedPath.length - 1), 99 | ...[key, ...rest].reverse() 100 | ])}> 101 | {'(pin)'} 102 | 103 | {!expanded && ': '} 104 | 105 | ); 106 | } 107 | } 108 | 109 | export default ActionPreview; 110 | -------------------------------------------------------------------------------- /flow-typed/npm/jss-nested_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: c8b77decaf8bba7bd49d833fc7edc0ec 2 | // flow-typed version: <>/jss-nested_v^3.0.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jss-nested' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jss-nested' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'jss-nested/benchmark/tests/bootstrap' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'jss-nested/benchmark/tests/deep-nesting' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'jss-nested/dist/jss-nested' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'jss-nested/dist/jss-nested.min' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'jss-nested/karma.conf' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'jss-nested/lib/index' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'jss-nested/lib/index.test' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'jss-nested/tests.webpack' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'jss-nested/tests/index' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'jss-nested/tests/index.test' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'jss-nested/webpack.config' { 66 | declare module.exports: any; 67 | } 68 | 69 | // Filename aliases 70 | declare module 'jss-nested/benchmark/tests/bootstrap.js' { 71 | declare module.exports: $Exports<'jss-nested/benchmark/tests/bootstrap'>; 72 | } 73 | declare module 'jss-nested/benchmark/tests/deep-nesting.js' { 74 | declare module.exports: $Exports<'jss-nested/benchmark/tests/deep-nesting'>; 75 | } 76 | declare module 'jss-nested/dist/jss-nested.js' { 77 | declare module.exports: $Exports<'jss-nested/dist/jss-nested'>; 78 | } 79 | declare module 'jss-nested/dist/jss-nested.min.js' { 80 | declare module.exports: $Exports<'jss-nested/dist/jss-nested.min'>; 81 | } 82 | declare module 'jss-nested/karma.conf.js' { 83 | declare module.exports: $Exports<'jss-nested/karma.conf'>; 84 | } 85 | declare module 'jss-nested/lib/index.js' { 86 | declare module.exports: $Exports<'jss-nested/lib/index'>; 87 | } 88 | declare module 'jss-nested/lib/index.test.js' { 89 | declare module.exports: $Exports<'jss-nested/lib/index.test'>; 90 | } 91 | declare module 'jss-nested/tests.webpack.js' { 92 | declare module.exports: $Exports<'jss-nested/tests.webpack'>; 93 | } 94 | declare module 'jss-nested/tests/index.js' { 95 | declare module.exports: $Exports<'jss-nested/tests/index'>; 96 | } 97 | declare module 'jss-nested/tests/index.test.js' { 98 | declare module.exports: $Exports<'jss-nested/tests/index.test'>; 99 | } 100 | declare module 'jss-nested/webpack.config.js' { 101 | declare module.exports: $Exports<'jss-nested/webpack.config'>; 102 | } 103 | -------------------------------------------------------------------------------- /flow-typed/npm/webpack-dev-server_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 8c0b83aca19a428cc7f05a4120f0c609 2 | // flow-typed version: <>/webpack-dev-server_v^1.14.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'webpack-dev-server' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'webpack-dev-server' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'webpack-dev-server/bin/webpack-dev-server' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'webpack-dev-server/client/index.bundle' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'webpack-dev-server/client/index' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'webpack-dev-server/client/live.bundle' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'webpack-dev-server/client/live' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'webpack-dev-server/client/socket' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'webpack-dev-server/client/web_modules/jquery/index' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'webpack-dev-server/client/web_modules/jquery/jquery-1.8.1' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'webpack-dev-server/client/webpack.config' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'webpack-dev-server/lib/Server' { 62 | declare module.exports: any; 63 | } 64 | 65 | // Filename aliases 66 | declare module 'webpack-dev-server/bin/webpack-dev-server.js' { 67 | declare module.exports: $Exports<'webpack-dev-server/bin/webpack-dev-server'>; 68 | } 69 | declare module 'webpack-dev-server/client/index.bundle.js' { 70 | declare module.exports: $Exports<'webpack-dev-server/client/index.bundle'>; 71 | } 72 | declare module 'webpack-dev-server/client/index.js' { 73 | declare module.exports: $Exports<'webpack-dev-server/client/index'>; 74 | } 75 | declare module 'webpack-dev-server/client/live.bundle.js' { 76 | declare module.exports: $Exports<'webpack-dev-server/client/live.bundle'>; 77 | } 78 | declare module 'webpack-dev-server/client/live.js' { 79 | declare module.exports: $Exports<'webpack-dev-server/client/live'>; 80 | } 81 | declare module 'webpack-dev-server/client/socket.js' { 82 | declare module.exports: $Exports<'webpack-dev-server/client/socket'>; 83 | } 84 | declare module 'webpack-dev-server/client/web_modules/jquery/index.js' { 85 | declare module.exports: $Exports<'webpack-dev-server/client/web_modules/jquery/index'>; 86 | } 87 | declare module 'webpack-dev-server/client/web_modules/jquery/jquery-1.8.1.js' { 88 | declare module.exports: $Exports<'webpack-dev-server/client/web_modules/jquery/jquery-1.8.1'>; 89 | } 90 | declare module 'webpack-dev-server/client/webpack.config.js' { 91 | declare module.exports: $Exports<'webpack-dev-server/client/webpack.config'>; 92 | } 93 | declare module 'webpack-dev-server/lib/Server.js' { 94 | declare module.exports: $Exports<'webpack-dev-server/lib/Server'>; 95 | } 96 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # redux-devtools-inspector 2 | 3 | [![npm version](https://badge.fury.io/js/redux-devtools-inspector.svg)](https://badge.fury.io/js/redux-devtools-inspector) 4 | 5 | >This package was merged into [`redux-devtools` monorepo](https://github.com/reduxjs/redux-devtools). Please refer to that repository for the latest updates, issues and pull requests. 6 | 7 | A state monitor for [Redux DevTools](https://github.com/gaearon/redux-devtools) that provides a convenient way to inspect "real world" app states that could be complicated and deeply nested. 8 | 9 | ![](https://raw.githubusercontent.com/alexkuz/redux-devtools-inspector/master/demo.gif) 10 | 11 | ### Installation 12 | 13 | ``` 14 | npm install --save-dev redux-devtools-inspector 15 | ``` 16 | 17 | ### Usage 18 | 19 | You can use `Inspector` as the only monitor in your app: 20 | 21 | ##### `containers/DevTools.js` 22 | 23 | ```js 24 | import React from 'react'; 25 | import { createDevTools } from 'redux-devtools'; 26 | import Inspector from 'redux-devtools-inspector'; 27 | 28 | export default createDevTools( 29 | 30 | ); 31 | ``` 32 | 33 | Then you can render `` to any place inside app or even into a separate popup window. 34 | 35 | Alternative, you can use it together with [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) to make it dockable. 36 | Consult the [`DockMonitor` README](https://github.com/gaearon/redux-devtools-dock-monitor) for details of this approach. 37 | 38 | [Read how to start using Redux DevTools.](https://github.com/gaearon/redux-devtools) 39 | 40 | ### Features 41 | 42 | The inspector displays a list of actions and a preview panel which shows the state after the selected action and a diff with the previous state. If no actions are selected, the last state is shown. 43 | 44 | You may pin a certain part of the state to only track its changes. 45 | 46 | ### Props 47 | 48 | Name | Type | Description 49 | ------------------ | ---------------- | ------------- 50 | `theme` | Object or string | Contains either [base16](https://github.com/chriskempson/base16) theme name or object, that can be `base16` colors map or object containing classnames or styles. 51 | `invertTheme` | Boolean | Inverts theme color luminance, making light theme out of dark theme and vice versa. 52 | `supportImmutable` | Boolean | Better `Immutable` rendering in `Diff` (can affect performance if state has huge objects/arrays). `false` by default. 53 | `tabs` | Array or function | Overrides list of tabs (see below) 54 | `diffObjectHash` | Function | Optional callback for better array handling in diffs (see [jsondiffpatch docs](https://github.com/benjamine/jsondiffpatch/blob/master/docs/arrays.md)) 55 | `diffPropertyFilter` | Function | Optional callback for ignoring particular props in diff (see [jsondiffpatch docs](https://github.com/benjamine/jsondiffpatch#options)) 56 | 57 | 58 | If `tabs` is a function, it receives a list of default tabs and should return updated list, for example: 59 | ``` 60 | defaultTabs => [...defaultTabs, { name: 'My Tab', component: MyTab }] 61 | ``` 62 | If `tabs` is an array, only provided tabs are rendered. 63 | 64 | `component` is provided with `action` and other props, see [`ActionPreview.jsx`](src/ActionPreview.jsx#L42) for reference. 65 | 66 | Usage example: [`redux-devtools-test-generator`](https://github.com/zalmoxisus/redux-devtools-test-generator#containersdevtoolsjs). 67 | 68 | ### License 69 | 70 | MIT 71 | -------------------------------------------------------------------------------- /flow-typed/npm/redux-logger_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: f72ea2758110e4f017490d69f0ef9af4 2 | // flow-typed version: <>/redux-logger_v^2.5.2/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'redux-logger' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'redux-logger' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'redux-logger/dist/index' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'redux-logger/dist/index.min' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'redux-logger/lib/core' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'redux-logger/lib/defaults' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'redux-logger/lib/diff' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'redux-logger/lib/helpers' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'redux-logger/lib/index' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'redux-logger/src/core' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'redux-logger/src/defaults' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'redux-logger/src/diff' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'redux-logger/src/helpers' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'redux-logger/src/index' { 70 | declare module.exports: any; 71 | } 72 | 73 | // Filename aliases 74 | declare module 'redux-logger/dist/index.js' { 75 | declare module.exports: $Exports<'redux-logger/dist/index'>; 76 | } 77 | declare module 'redux-logger/dist/index.min.js' { 78 | declare module.exports: $Exports<'redux-logger/dist/index.min'>; 79 | } 80 | declare module 'redux-logger/lib/core.js' { 81 | declare module.exports: $Exports<'redux-logger/lib/core'>; 82 | } 83 | declare module 'redux-logger/lib/defaults.js' { 84 | declare module.exports: $Exports<'redux-logger/lib/defaults'>; 85 | } 86 | declare module 'redux-logger/lib/diff.js' { 87 | declare module.exports: $Exports<'redux-logger/lib/diff'>; 88 | } 89 | declare module 'redux-logger/lib/helpers.js' { 90 | declare module.exports: $Exports<'redux-logger/lib/helpers'>; 91 | } 92 | declare module 'redux-logger/lib/index.js' { 93 | declare module.exports: $Exports<'redux-logger/lib/index'>; 94 | } 95 | declare module 'redux-logger/src/core.js' { 96 | declare module.exports: $Exports<'redux-logger/src/core'>; 97 | } 98 | declare module 'redux-logger/src/defaults.js' { 99 | declare module.exports: $Exports<'redux-logger/src/defaults'>; 100 | } 101 | declare module 'redux-logger/src/diff.js' { 102 | declare module.exports: $Exports<'redux-logger/src/diff'>; 103 | } 104 | declare module 'redux-logger/src/helpers.js' { 105 | declare module.exports: $Exports<'redux-logger/src/helpers'>; 106 | } 107 | declare module 'redux-logger/src/index.js' { 108 | declare module.exports: $Exports<'redux-logger/src/index'>; 109 | } 110 | -------------------------------------------------------------------------------- /flow-typed/npm/redux-devtools-dock-monitor_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 78efe6d756dca7a6c6e36f6af84aadc3 2 | // flow-typed version: <>/redux-devtools-dock-monitor_v^1.0.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'redux-devtools-dock-monitor' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'redux-devtools-dock-monitor' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'redux-devtools-dock-monitor/lib/actions' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'redux-devtools-dock-monitor/lib/constants' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'redux-devtools-dock-monitor/lib/DockMonitor' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'redux-devtools-dock-monitor/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'redux-devtools-dock-monitor/lib/reducers' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'redux-devtools-dock-monitor/src/actions' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'redux-devtools-dock-monitor/src/constants' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'redux-devtools-dock-monitor/src/DockMonitor' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'redux-devtools-dock-monitor/src/index' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'redux-devtools-dock-monitor/src/reducers' { 62 | declare module.exports: any; 63 | } 64 | 65 | // Filename aliases 66 | declare module 'redux-devtools-dock-monitor/lib/actions.js' { 67 | declare module.exports: $Exports<'redux-devtools-dock-monitor/lib/actions'>; 68 | } 69 | declare module 'redux-devtools-dock-monitor/lib/constants.js' { 70 | declare module.exports: $Exports<'redux-devtools-dock-monitor/lib/constants'>; 71 | } 72 | declare module 'redux-devtools-dock-monitor/lib/DockMonitor.js' { 73 | declare module.exports: $Exports<'redux-devtools-dock-monitor/lib/DockMonitor'>; 74 | } 75 | declare module 'redux-devtools-dock-monitor/lib/index.js' { 76 | declare module.exports: $Exports<'redux-devtools-dock-monitor/lib/index'>; 77 | } 78 | declare module 'redux-devtools-dock-monitor/lib/reducers.js' { 79 | declare module.exports: $Exports<'redux-devtools-dock-monitor/lib/reducers'>; 80 | } 81 | declare module 'redux-devtools-dock-monitor/src/actions.js' { 82 | declare module.exports: $Exports<'redux-devtools-dock-monitor/src/actions'>; 83 | } 84 | declare module 'redux-devtools-dock-monitor/src/constants.js' { 85 | declare module.exports: $Exports<'redux-devtools-dock-monitor/src/constants'>; 86 | } 87 | declare module 'redux-devtools-dock-monitor/src/DockMonitor.js' { 88 | declare module.exports: $Exports<'redux-devtools-dock-monitor/src/DockMonitor'>; 89 | } 90 | declare module 'redux-devtools-dock-monitor/src/index.js' { 91 | declare module.exports: $Exports<'redux-devtools-dock-monitor/src/index'>; 92 | } 93 | declare module 'redux-devtools-dock-monitor/src/reducers.js' { 94 | declare module.exports: $Exports<'redux-devtools-dock-monitor/src/reducers'>; 95 | } 96 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-cli_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 72f169d172178f62883bd2993d61b94b 2 | // flow-typed version: <>/babel-cli_v^6.4.5/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-cli' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-cli' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-cli/bin/babel-doctor' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-cli/bin/babel-external-helpers' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-cli/bin/babel-node' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-cli/bin/babel' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-cli/lib/_babel-node' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-cli/lib/babel-external-helpers' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-cli/lib/babel-node' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-cli/lib/babel/dir' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-cli/lib/babel/file' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-cli/lib/babel/index' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-cli/lib/babel/util' { 66 | declare module.exports: any; 67 | } 68 | 69 | // Filename aliases 70 | declare module 'babel-cli/bin/babel-doctor.js' { 71 | declare module.exports: $Exports<'babel-cli/bin/babel-doctor'>; 72 | } 73 | declare module 'babel-cli/bin/babel-external-helpers.js' { 74 | declare module.exports: $Exports<'babel-cli/bin/babel-external-helpers'>; 75 | } 76 | declare module 'babel-cli/bin/babel-node.js' { 77 | declare module.exports: $Exports<'babel-cli/bin/babel-node'>; 78 | } 79 | declare module 'babel-cli/bin/babel.js' { 80 | declare module.exports: $Exports<'babel-cli/bin/babel'>; 81 | } 82 | declare module 'babel-cli/index' { 83 | declare module.exports: $Exports<'babel-cli'>; 84 | } 85 | declare module 'babel-cli/index.js' { 86 | declare module.exports: $Exports<'babel-cli'>; 87 | } 88 | declare module 'babel-cli/lib/_babel-node.js' { 89 | declare module.exports: $Exports<'babel-cli/lib/_babel-node'>; 90 | } 91 | declare module 'babel-cli/lib/babel-external-helpers.js' { 92 | declare module.exports: $Exports<'babel-cli/lib/babel-external-helpers'>; 93 | } 94 | declare module 'babel-cli/lib/babel-node.js' { 95 | declare module.exports: $Exports<'babel-cli/lib/babel-node'>; 96 | } 97 | declare module 'babel-cli/lib/babel/dir.js' { 98 | declare module.exports: $Exports<'babel-cli/lib/babel/dir'>; 99 | } 100 | declare module 'babel-cli/lib/babel/file.js' { 101 | declare module.exports: $Exports<'babel-cli/lib/babel/file'>; 102 | } 103 | declare module 'babel-cli/lib/babel/index.js' { 104 | declare module.exports: $Exports<'babel-cli/lib/babel/index'>; 105 | } 106 | declare module 'babel-cli/lib/babel/util.js' { 107 | declare module.exports: $Exports<'babel-cli/lib/babel/util'>; 108 | } 109 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "redux-devtools-inspector", 3 | "version": "0.11.3", 4 | "description": "Redux DevTools Diff Monitor", 5 | "scripts": { 6 | "build:lib": "NODE_ENV=production babel src --out-dir lib", 7 | "build:demo": "NODE_ENV=production webpack -p", 8 | "stats": "webpack --profile --json > stats.json", 9 | "start": "webpack-dev-server", 10 | "lint": "eslint --ext .jsx,.js --max-warnings 0 src", 11 | "preversion": "npm -s run lint & npm -s run flow", 12 | "version": "npm -s run build:demo && git add -A .", 13 | "postversion": "git push", 14 | "prepublish": "npm run build:lib", 15 | "gh": "git-directory-deploy --directory demo/dist --branch gh-pages", 16 | "flow": "flow", 17 | "test": "npm -s run lint && npm -s run flow" 18 | }, 19 | "main": "lib/index.js", 20 | "repository": { 21 | "url": "https://github.com/alexkuz/redux-devtools-inspector" 22 | }, 23 | "keywords": [ 24 | "react", 25 | "reactjs" 26 | ], 27 | "devDependencies": { 28 | "babel": "^6.3.26", 29 | "babel-cli": "^6.4.5", 30 | "babel-core": "^6.4.5", 31 | "babel-eslint": "^7.1.0", 32 | "babel-loader": "^6.2.2", 33 | "babel-plugin-react-transform": "^2.0.0", 34 | "babel-plugin-transform-flow-strip-types": "^6.22.0", 35 | "babel-plugin-transform-runtime": "^6.4.3", 36 | "babel-preset-es2015": "^6.3.13", 37 | "babel-preset-react": "^6.3.13", 38 | "babel-preset-stage-0": "^6.3.13", 39 | "base16": "^1.0.0", 40 | "chokidar": "^1.6.1", 41 | "clean-webpack-plugin": "^0.1.8", 42 | "eslint": "^3.9.1", 43 | "eslint-loader": "^1.2.1", 44 | "eslint-plugin-babel": "^4.1.0", 45 | "eslint-plugin-flowtype": "^2.30.0", 46 | "eslint-plugin-react": "^6.6.0", 47 | "export-files-webpack-plugin": "0.0.1", 48 | "flow-bin": "^0.40.0", 49 | "git-directory-deploy": "^1.5.1", 50 | "html-webpack-plugin": "^2.8.1", 51 | "imports-loader": "^0.7.1", 52 | "json-loader": "^0.5.4", 53 | "lodash.shuffle": "^4.2.0", 54 | "nyan-progress-webpack-plugin": "^1.1.4", 55 | "pre-commit": "^1.1.3", 56 | "raw-loader": "^0.5.1", 57 | "react": "^15.3.2", 58 | "react-bootstrap": "^0.30.6", 59 | "react-dom": "^15.3.2", 60 | "react-input-enhancements": "^1.0.0-beta2", 61 | "react-redux": "^5.0.3", 62 | "react-router": "^3.0.0", 63 | "react-router-redux": "^4.0.2", 64 | "react-transform-hmr": "^1.0.2", 65 | "redux": "^3.3.1", 66 | "redux-devtools": "^3.1.0", 67 | "redux-devtools-dock-monitor": "^1.0.1", 68 | "redux-logger": "^2.5.2", 69 | "webpack": "^2.2.1", 70 | "webpack-dev-server": "^2.4.1" 71 | }, 72 | "peerDependencies": { 73 | "react": ">=15.0.0", 74 | "react-dom": ">=15.0.0" 75 | }, 76 | "author": "Alexander (http://kuzya.org/)", 77 | "contributors": [ 78 | "Mihail Diordiev (https://github.com/zalmoxisus)" 79 | ], 80 | "license": "MIT", 81 | "dependencies": { 82 | "babel-runtime": "^6.3.19", 83 | "dateformat": "^2.0.0", 84 | "hex-rgba": "^1.0.0", 85 | "immutable": "^3.7.6", 86 | "javascript-stringify": "^1.1.0", 87 | "jsondiffpatch": "^0.2.4", 88 | "jss": "^6.0.0", 89 | "jss-nested": "^3.0.0", 90 | "jss-vendor-prefixer": "^4.0.0", 91 | "lodash.debounce": "^4.0.3", 92 | "react-base16-styling": "^0.4.1", 93 | "react-json-tree": "^0.10.5", 94 | "redux-devtools-themes": "^1.0.0" 95 | }, 96 | "pre-commit": [ 97 | "lint" 98 | ] 99 | } 100 | -------------------------------------------------------------------------------- /demo/src/js/index.js: -------------------------------------------------------------------------------- 1 | import 'babel-polyfill'; 2 | import React from 'react'; 3 | import { render } from 'react-dom'; 4 | import DemoApp from './DemoApp'; 5 | import { Provider } from 'react-redux'; 6 | import reducers from './reducers'; 7 | import { createStore, applyMiddleware, compose, combineReducers } from 'redux'; 8 | import createLogger from 'redux-logger'; 9 | import { Router, Route, browserHistory } from 'react-router'; 10 | import { syncHistoryWithStore, routerReducer, routerMiddleware } from 'react-router-redux'; 11 | import { createDevTools, persistState } from 'redux-devtools'; 12 | import DevtoolsInspector from '../../../src/DevtoolsInspector'; 13 | import DockMonitor from 'redux-devtools-dock-monitor'; 14 | import getOptions from './getOptions'; 15 | 16 | function getDebugSessionKey() { 17 | const matches = window.location.href.match(/[?&]debug_session=([^&#]+)\b/); 18 | return (matches && matches.length > 0)? matches[1] : null; 19 | } 20 | 21 | const CustomComponent = () => 22 |
30 |
Custom Tab Content
31 |
; 32 | 33 | const getDevTools = options => 34 | createDevTools( 35 | 39 | [{ 44 | name: 'Custom Tab', 45 | component: CustomComponent 46 | }, ...defaultTabs]} /> 47 | 48 | ); 49 | 50 | const ROOT = process.env.NODE_ENV === 'production' ? '/redux-devtools-inspector/' : '/'; 51 | 52 | let DevTools = getDevTools(getOptions()); 53 | 54 | const reduxRouterMiddleware = routerMiddleware(browserHistory); 55 | 56 | const enhancer = compose( 57 | applyMiddleware(createLogger(), reduxRouterMiddleware), 58 | (...args) => { 59 | const useDevtoolsExtension = !!window.__REDUX_DEVTOOLS_EXTENSION__ && getOptions().useExtension; 60 | const instrument = useDevtoolsExtension ? 61 | window.__REDUX_DEVTOOLS_EXTENSION__() : DevTools.instrument(); 62 | return instrument(...args); 63 | }, 64 | persistState(getDebugSessionKey()) 65 | ); 66 | 67 | const store = createStore(combineReducers({ 68 | ...reducers, 69 | routing: routerReducer 70 | }), {}, enhancer); 71 | 72 | const history = syncHistoryWithStore(browserHistory, store); 73 | 74 | const handleRouterUpdate = () => { 75 | renderApp(getOptions()); 76 | }; 77 | 78 | const router = ( 79 | 80 | 82 | 83 | ); 84 | 85 | const renderApp = options => { 86 | DevTools = getDevTools(options); 87 | const useDevtoolsExtension = !!window.__REDUX_DEVTOOLS_EXTENSION__ && options.useExtension; 88 | 89 | return render( 90 | 91 |
92 | {router} 93 | {!useDevtoolsExtension && } 94 |
95 |
, 96 | document.getElementById('root') 97 | ); 98 | } 99 | 100 | renderApp(getOptions()); 101 | -------------------------------------------------------------------------------- /flow-typed/npm/react-router-redux_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 3247a7d9b2d62406acf41f466079d2ac 2 | // flow-typed version: <>/react-router-redux_v^4.0.2/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-router-redux' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-router-redux' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'react-router-redux/dist/ReactRouterRedux' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'react-router-redux/dist/ReactRouterRedux.min' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'react-router-redux/lib/actions' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'react-router-redux/lib/index' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'react-router-redux/lib/middleware' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'react-router-redux/lib/reducer' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'react-router-redux/lib/sync' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'react-router-redux/src/actions' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'react-router-redux/src/index' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'react-router-redux/src/middleware' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'react-router-redux/src/reducer' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'react-router-redux/src/sync' { 70 | declare module.exports: any; 71 | } 72 | 73 | // Filename aliases 74 | declare module 'react-router-redux/dist/ReactRouterRedux.js' { 75 | declare module.exports: $Exports<'react-router-redux/dist/ReactRouterRedux'>; 76 | } 77 | declare module 'react-router-redux/dist/ReactRouterRedux.min.js' { 78 | declare module.exports: $Exports<'react-router-redux/dist/ReactRouterRedux.min'>; 79 | } 80 | declare module 'react-router-redux/lib/actions.js' { 81 | declare module.exports: $Exports<'react-router-redux/lib/actions'>; 82 | } 83 | declare module 'react-router-redux/lib/index.js' { 84 | declare module.exports: $Exports<'react-router-redux/lib/index'>; 85 | } 86 | declare module 'react-router-redux/lib/middleware.js' { 87 | declare module.exports: $Exports<'react-router-redux/lib/middleware'>; 88 | } 89 | declare module 'react-router-redux/lib/reducer.js' { 90 | declare module.exports: $Exports<'react-router-redux/lib/reducer'>; 91 | } 92 | declare module 'react-router-redux/lib/sync.js' { 93 | declare module.exports: $Exports<'react-router-redux/lib/sync'>; 94 | } 95 | declare module 'react-router-redux/src/actions.js' { 96 | declare module.exports: $Exports<'react-router-redux/src/actions'>; 97 | } 98 | declare module 'react-router-redux/src/index.js' { 99 | declare module.exports: $Exports<'react-router-redux/src/index'>; 100 | } 101 | declare module 'react-router-redux/src/middleware.js' { 102 | declare module.exports: $Exports<'react-router-redux/src/middleware'>; 103 | } 104 | declare module 'react-router-redux/src/reducer.js' { 105 | declare module.exports: $Exports<'react-router-redux/src/reducer'>; 106 | } 107 | declare module 'react-router-redux/src/sync.js' { 108 | declare module.exports: $Exports<'react-router-redux/src/sync'>; 109 | } 110 | -------------------------------------------------------------------------------- /src/tabs/getItemString.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React from 'react'; 3 | import getType from '../utils/getType'; 4 | 5 | import type { StylingFunction } from 'react-base16-styling'; 6 | 7 | function getShortTypeString(val: any, diff?: boolean): string { 8 | const type = getType(val); 9 | 10 | if (diff && Array.isArray(val)) { 11 | val = val[val.length === 2 ? 1 : 0]; 12 | } 13 | 14 | switch (type) { 15 | case 'Immutable List': 16 | case 'Immutable Stack': 17 | case 'Immutable Seq': 18 | return '' + val.size ? '[…]' : '[]'; 19 | case 'Map': 20 | return val.size ? '{…}' : '{}'; 21 | case 'WeakMap': 22 | return '{…}'; 23 | case 'Set': 24 | return val.size ? '(…)' : '()'; 25 | case 'WeakSet': 26 | return '(…)'; 27 | case 'Immutable Map': 28 | case 'Immutable OrderedMap': 29 | return '' + val.size ? '{…}' : '{}'; 30 | case 'Immutable Set': 31 | case 'Immutable OrderedSet': 32 | return '' + val.size ? '(…)' : '()'; 33 | case 'Iterable': 34 | return '(…)'; 35 | case 'Array': 36 | return val.length > 0 ? '[…]' : '[]'; 37 | case 'Null': 38 | return 'null'; 39 | case 'Undefined': 40 | return 'undef'; 41 | case 'Error': 42 | return `Error(${getShortTypeString(val.message)}`; 43 | case 'Object': 44 | return Object.keys(val).length > 0 ? '{…}' : '{}'; 45 | case 'Function': 46 | return 'fn'; 47 | case 'String': 48 | return `"${val.substr(0, 10) + (val.length > 10 ? '…' : '')}"` 49 | case 'Symbol': 50 | return 'symbol'; 51 | default: 52 | return val.toString(); 53 | } 54 | } 55 | 56 | function getFirstEntries(data, limit, getEntryString): string { 57 | let idx = 0, arr = []; 58 | 59 | for (let entry of data) { 60 | if (idx === 3) { 61 | arr.push('…'); 62 | break; 63 | }; 64 | arr.push(getEntryString(entry)); 65 | idx++; 66 | } 67 | 68 | return arr.join(', '); 69 | } 70 | 71 | function getText(type, data, isWideLayout, isDiff): string { 72 | let str; 73 | type = getType(data); 74 | 75 | switch(type) { 76 | case 'Immutable List': 77 | case 'Immutable Stack': 78 | case 'Immutable Seq': 79 | str = getFirstEntries(data, 3, entry => getShortTypeString(entry)); 80 | return `[ ${str} ]`; 81 | case 'Map': 82 | str = getFirstEntries(data, 3, entry => 83 | `${getShortTypeString(entry[0])} => ${getShortTypeString(entry[1])}` 84 | ); 85 | return `{ ${str} }`; 86 | case 'WeakMap': 87 | return '{…}'; 88 | case 'Set': 89 | str = getFirstEntries(data, 3, entry => getShortTypeString(entry)); 90 | return `( ${str} )`; 91 | case 'WeakSet': 92 | return '(…)'; 93 | case 'Immutable Map': 94 | case 'Immutable OrderedMap': 95 | str = getFirstEntries(data, 3, entry => 96 | `${getShortTypeString(entry[0])} => ${getShortTypeString(entry[1])}` 97 | ); 98 | return `{ ${str} }`; 99 | case 'Immutable Set': 100 | case 'Immutable OrderedSet': 101 | str = getFirstEntries(data, 3, entry => getShortTypeString(entry)); 102 | return `( ${str} )`; 103 | case 'Object': 104 | const keys = Object.keys(data); 105 | if (!isWideLayout) return keys.length ? '{…}' : '{}'; 106 | 107 | str = keys 108 | .slice(0, 3) 109 | .map(key => `${key}: ${getShortTypeString(data[key], isDiff)}`) 110 | .concat(keys.length > 3 ? ['…'] : []) 111 | .join(', '); 112 | 113 | return `{ ${str} }`; 114 | case 'Array': 115 | if (!isWideLayout) return data.length ? '[…]' : '[]'; 116 | 117 | str = data 118 | .slice(0, 4) 119 | .map(val => getShortTypeString(val, isDiff)) 120 | .concat(data.length > 4 ? ['…'] : []).join(', '); 121 | 122 | return `[${str}]`; 123 | default: 124 | return type; 125 | } 126 | } 127 | 128 | const getItemString = ( 129 | styling: StylingFunction, 130 | type: string, 131 | data: Object, 132 | isWideLayout: boolean, 133 | isDiff: boolean = false 134 | ): React$Element<*> => 135 | 136 | {getText(type, data, isWideLayout, isDiff)} 137 | ; 138 | 139 | export default getItemString; 140 | -------------------------------------------------------------------------------- /demo/src/js/reducers.js: -------------------------------------------------------------------------------- 1 | import Immutable from 'immutable'; 2 | import shuffle from 'lodash.shuffle'; 3 | 4 | const NESTED = { 5 | long: { 6 | nested: [{ 7 | path: { 8 | to: { 9 | a: 'key' 10 | } 11 | } 12 | }] 13 | } 14 | }; 15 | 16 | const IMMUTABLE_NESTED = Immutable.fromJS(NESTED); 17 | 18 | /* eslint-disable babel/new-cap */ 19 | 20 | const IMMUTABLE_MAP = Immutable.Map({ 21 | map: Immutable.Map({ a:1, b: 2, c: 3 }), 22 | list: Immutable.List(['a', 'b', 'c']), 23 | set: Immutable.Set(['a', 'b', 'c']), 24 | stack: Immutable.Stack(['a', 'b', 'c']), 25 | seq: Immutable.Seq.of(1, 2, 3, 4, 5, 6, 7, 8) 26 | }); 27 | 28 | const NATIVE_MAP = new window.Map([ 29 | ['map', new window.Map([ 30 | [{ first: true }, 1], 31 | ['second', 2] 32 | ])], 33 | ['weakMap', new window.WeakMap([ 34 | [{ first: true }, 1], 35 | [{ second: 1 }, 2] 36 | ])], 37 | ['set', new window.Set([ 38 | { first: true }, 39 | 'second' 40 | ])], 41 | ['weakSet', new window.WeakSet([ 42 | { first: true }, 43 | { second: 1 } 44 | ])] 45 | ]); 46 | 47 | /* eslint-enable babel/new-cap */ 48 | 49 | const HUGE_ARRAY = Array.from({ length: 5000 }) 50 | .map((_, key) => ({ str: 'key ' + key })); 51 | 52 | const HUGE_OBJECT = Array.from({ length: 5000 }) 53 | .reduce((o, _, key) => (o['key ' + key] = 'item ' + key, o), {}); 54 | 55 | const FUNC = function (a, b, c) { return a + b + c; }; 56 | 57 | const RECURSIVE = {}; 58 | RECURSIVE.obj = RECURSIVE; 59 | 60 | function createIterator() { 61 | const iterable = {}; 62 | iterable[window.Symbol.iterator] = function *iterator() { 63 | for (var i = 0; i < 333; i++) { 64 | yield 'item ' + i; 65 | } 66 | } 67 | 68 | return iterable; 69 | } 70 | 71 | const DEFAULT_SHUFFLE_ARRAY = [0, 1, null, { id: 1 }, { id: 2 }, 'string']; 72 | 73 | export default { 74 | timeoutUpdateEnabled: (state=false, action) => action.type === 'TOGGLE_TIMEOUT_UPDATE' ? 75 | action.timeoutUpdateEnabled : state, 76 | store: (state=0, action) => action.type === 'INCREMENT' ? state + 1 : state, 77 | undefined: (state={ val: undefined }) => state, 78 | null: (state=null) => state, 79 | func: (state=() => {}) => state, 80 | array: (state=[], action) => action.type === 'PUSH' ? 81 | [...state, Math.random()] : ( 82 | action.type === 'POP' ? state.slice(0, state.length - 1) : ( 83 | action.type === 'REPLACE' ? [Math.random(), ...state.slice(1)] : state 84 | ) 85 | ), 86 | hugeArrays: (state=[], action) => action.type === 'PUSH_HUGE_ARRAY' ? 87 | [ ...state, ...HUGE_ARRAY ] : state, 88 | hugeObjects: (state=[], action) => action.type === 'ADD_HUGE_OBJECT' ? 89 | [ ...state, HUGE_OBJECT ] : state, 90 | iterators: (state=[], action) => action.type === 'ADD_ITERATOR' ? 91 | [...state, createIterator()] : state, 92 | nested: (state=NESTED, action) => 93 | action.type === 'CHANGE_NESTED' ? { 94 | ...state, 95 | long: { 96 | nested: [{ 97 | path: { 98 | to: { 99 | a: state.long.nested[0].path.to.a + '!' 100 | } 101 | } 102 | }] 103 | } 104 | } : state, 105 | recursive: (state=[], action) => action.type === 'ADD_RECURSIVE' ? 106 | [...state, { ...RECURSIVE }] : state, 107 | immutables: (state=[], action) => action.type === 'ADD_IMMUTABLE_MAP' ? 108 | [...state, IMMUTABLE_MAP] : state, 109 | maps: (state=[], action) => action.type === 'ADD_NATIVE_MAP' ? 110 | [...state, NATIVE_MAP] : state, 111 | immutableNested: (state=IMMUTABLE_NESTED, action) => action.type === 'CHANGE_IMMUTABLE_NESTED' ? 112 | state.updateIn( 113 | ['long', 'nested', 0, 'path', 'to', 'a'], 114 | str => str + '!' 115 | ) : state, 116 | addFunction: (state=null, action) => action.type === 'ADD_FUNCTION' ? 117 | { f: FUNC } : state, 118 | addSymbol: (state=null, action) => action.type === 'ADD_SYMBOL' ? 119 | { s: window.Symbol('symbol'), error: new Error('TEST') } : state, 120 | shuffleArray: (state=DEFAULT_SHUFFLE_ARRAY, action) => 121 | action.type === 'SHUFFLE_ARRAY' ? 122 | shuffle(state) : state 123 | }; 124 | -------------------------------------------------------------------------------- /src/ActionList.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import ActionListRow from './ActionListRow'; 5 | import ActionListHeader from './ActionListHeader'; 6 | 7 | import type { StylingFunction } from 'react-base16-styling'; 8 | import type { Action } from './types'; 9 | 10 | type Props = { 11 | styling: StylingFunction, 12 | actions: { 13 | [id: number]: Action 14 | }, 15 | actionIds: number[], 16 | lastActionId: number, 17 | isWideLayout: boolean, 18 | onToggleAction: (actionId: number) => void; 19 | skippedActionIds: number[], 20 | selectedActionId: number, 21 | startActionId: null | number, 22 | onSelect: (e: SyntheticMouseEvent, actionId: number) => void, 23 | onSearch: (searchStr: string) => void, 24 | searchValue: string, 25 | currentActionId: number, 26 | onCommit: () => void, 27 | onSweep: () => void, 28 | onJumpToState: (actionId: number) => void 29 | }; 30 | 31 | function getTimestamps(actions, actionIds, actionId) { 32 | const idx = actionIds.indexOf(actionId); 33 | const prevActionId = actionIds[idx - 1]; 34 | 35 | return { 36 | current: actions[actionId].timestamp, 37 | previous: idx ? actions[prevActionId].timestamp : 0 38 | }; 39 | } 40 | 41 | export default class ActionList extends PureComponent { 42 | componentDidMount() { 43 | this.scrollToBottom(true); 44 | } 45 | 46 | componentDidUpdate(prevProps: Props) { 47 | if (this.props.lastActionId !== prevProps.lastActionId) { 48 | this.scrollToBottom(); 49 | } 50 | } 51 | 52 | scrollToBottom(force?: boolean) { 53 | const el = ReactDOM.findDOMNode(this.refs.rows); 54 | const scrollHeight = el.scrollHeight; 55 | if (force || Math.abs(scrollHeight - (el.scrollTop + el.offsetHeight)) < 50) { 56 | el.scrollTop = scrollHeight; 57 | } 58 | } 59 | 60 | render() { 61 | const { styling, actions, actionIds, isWideLayout, onToggleAction, skippedActionIds, 62 | selectedActionId, startActionId, onSelect, onSearch, searchValue, currentActionId, 63 | onCommit, onSweep, onJumpToState } = this.props; 64 | const lowerSearchValue = searchValue && searchValue.toLowerCase(); 65 | const filteredActionIds = searchValue ? actionIds.filter( 66 | id => actions[id].action.type.toLowerCase().indexOf(lowerSearchValue) !== -1 67 | ) : actionIds; 68 | 69 | return ( 70 |
76 | 0} 81 | hasStagedActions={actionIds.length > 1} /> 82 |
83 | {filteredActionIds.map(actionId => 84 | = startActionId && actionId <= selectedActionId || 90 | actionId === selectedActionId 91 | } 92 | isInFuture={actionId > currentActionId} 93 | onSelect={(e) => onSelect(e, actionId)} 94 | timestamps={getTimestamps(actions, actionIds, actionId)} 95 | action={actions[actionId].action} 96 | onToggleClick={() => onToggleAction(actionId)} 97 | onJumpClick={() => onJumpToState(actionId)} 98 | onCommitClick={() => onCommit(actionId)} 99 | isSkipped={skippedActionIds.indexOf(actionId) !== -1} /> 100 | )} 101 |
102 |
103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /flow-typed/npm/react-json-tree_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 40f32d6954f69959fba085e7b8c4f273 2 | // flow-typed version: <>/react-json-tree_v^0.10.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-json-tree' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-json-tree' { 17 | declare type LabelRenderer = (keyPath: string[], nodeType: string, expanded: boolean, expandable: boolean) => any; 18 | declare type ItemStringRenderer = (nodeType: string, data: any, itemType: React$Element<*>, itemString: string) => any; 19 | 20 | declare module.exports: any; 21 | } 22 | 23 | /** 24 | * We include stubs for each file inside this npm package in case you need to 25 | * require those files directly. Feel free to delete any files that aren't 26 | * needed. 27 | */ 28 | declare module 'react-json-tree/lib/createStylingFromTheme' { 29 | declare module.exports: any; 30 | } 31 | 32 | declare module 'react-json-tree/lib/getCollectionEntries' { 33 | declare module.exports: any; 34 | } 35 | 36 | declare module 'react-json-tree/lib/index' { 37 | declare module.exports: any; 38 | } 39 | 40 | declare module 'react-json-tree/lib/ItemRange' { 41 | declare module.exports: any; 42 | } 43 | 44 | declare module 'react-json-tree/lib/JSONArrayNode' { 45 | declare module.exports: any; 46 | } 47 | 48 | declare module 'react-json-tree/lib/JSONArrow' { 49 | declare module.exports: any; 50 | } 51 | 52 | declare module 'react-json-tree/lib/JSONIterableNode' { 53 | declare module.exports: any; 54 | } 55 | 56 | declare module 'react-json-tree/lib/JSONNestedNode' { 57 | declare module.exports: any; 58 | } 59 | 60 | declare module 'react-json-tree/lib/JSONNode' { 61 | declare module.exports: any; 62 | } 63 | 64 | declare module 'react-json-tree/lib/JSONObjectNode' { 65 | declare module.exports: any; 66 | } 67 | 68 | declare module 'react-json-tree/lib/JSONValueNode' { 69 | declare module.exports: any; 70 | } 71 | 72 | declare module 'react-json-tree/lib/objType' { 73 | declare module.exports: any; 74 | } 75 | 76 | declare module 'react-json-tree/lib/themes/solarized' { 77 | declare module.exports: any; 78 | } 79 | 80 | declare module 'react-json-tree/lib/utils/hexToRgb' { 81 | declare module.exports: any; 82 | } 83 | 84 | // Filename aliases 85 | declare module 'react-json-tree/lib/createStylingFromTheme.js' { 86 | declare module.exports: $Exports<'react-json-tree/lib/createStylingFromTheme'>; 87 | } 88 | declare module 'react-json-tree/lib/getCollectionEntries.js' { 89 | declare module.exports: $Exports<'react-json-tree/lib/getCollectionEntries'>; 90 | } 91 | declare module 'react-json-tree/lib/index.js' { 92 | declare module.exports: $Exports<'react-json-tree/lib/index'>; 93 | } 94 | declare module 'react-json-tree/lib/ItemRange.js' { 95 | declare module.exports: $Exports<'react-json-tree/lib/ItemRange'>; 96 | } 97 | declare module 'react-json-tree/lib/JSONArrayNode.js' { 98 | declare module.exports: $Exports<'react-json-tree/lib/JSONArrayNode'>; 99 | } 100 | declare module 'react-json-tree/lib/JSONArrow.js' { 101 | declare module.exports: $Exports<'react-json-tree/lib/JSONArrow'>; 102 | } 103 | declare module 'react-json-tree/lib/JSONIterableNode.js' { 104 | declare module.exports: $Exports<'react-json-tree/lib/JSONIterableNode'>; 105 | } 106 | declare module 'react-json-tree/lib/JSONNestedNode.js' { 107 | declare module.exports: $Exports<'react-json-tree/lib/JSONNestedNode'>; 108 | } 109 | declare module 'react-json-tree/lib/JSONNode.js' { 110 | declare module.exports: $Exports<'react-json-tree/lib/JSONNode'>; 111 | } 112 | declare module 'react-json-tree/lib/JSONObjectNode.js' { 113 | declare module.exports: $Exports<'react-json-tree/lib/JSONObjectNode'>; 114 | } 115 | declare module 'react-json-tree/lib/JSONValueNode.js' { 116 | declare module.exports: $Exports<'react-json-tree/lib/JSONValueNode'>; 117 | } 118 | declare module 'react-json-tree/lib/objType.js' { 119 | declare module.exports: $Exports<'react-json-tree/lib/objType'>; 120 | } 121 | declare module 'react-json-tree/lib/themes/solarized.js' { 122 | declare module.exports: $Exports<'react-json-tree/lib/themes/solarized'>; 123 | } 124 | declare module 'react-json-tree/lib/utils/hexToRgb.js' { 125 | declare module.exports: $Exports<'react-json-tree/lib/utils/hexToRgb'>; 126 | } 127 | -------------------------------------------------------------------------------- /src/tabs/JSONDiff.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import JSONTree from 'react-json-tree'; 4 | import stringify from 'javascript-stringify'; 5 | import getItemString from './getItemString'; 6 | import getJsonTreeTheme from './getJsonTreeTheme'; 7 | 8 | import type { LabelRenderer } from 'react-json-tree'; 9 | import type { Delta, ArrayDelta } from 'jsondiffpatch'; 10 | import type { StylingFunction, Base16Theme, StylingConfig } from 'react-base16-styling'; 11 | 12 | type Props = { 13 | delta: Delta, 14 | styling: StylingFunction, 15 | base16Theme: Base16Theme, 16 | invertTheme: boolean, 17 | labelRenderer: LabelRenderer, 18 | isWideLayout: boolean 19 | }; 20 | 21 | type State = { 22 | theme: StylingConfig 23 | }; 24 | 25 | function stringifyAndShrink(val: any, isWideLayout: boolean): string { 26 | if (val === null) { return 'null'; } 27 | 28 | const str = stringify(val); 29 | if (typeof str === 'undefined') { return 'undefined'; } 30 | 31 | if (isWideLayout) return str.length > 42 ? str.substr(0, 30) + '…' + str.substr(-10) : str; 32 | return str.length > 22 ? `${str.substr(0, 15)}…${str.substr(-5)}` : str; 33 | } 34 | 35 | const expandFirstLevel = (keyName: string, data: Object, level: number): boolean => level <= 1; 36 | 37 | function prepareDelta(value: Delta): Delta { 38 | if (value && value._t === 'a') { 39 | const arrayDelta: ArrayDelta = (value: any); 40 | const res = {}; 41 | for (let key in arrayDelta) { 42 | if (key !== '_t') { 43 | if (key[0] === '_' && !arrayDelta[key.substr(1)]) { 44 | res[key.substr(1)] = arrayDelta[key]; 45 | } else if (arrayDelta['_' + key]) { 46 | res[key] = [arrayDelta['_' + key][0], arrayDelta[key][0]]; 47 | } else if (!arrayDelta['_' + key] && key[0] !== '_') { 48 | res[key] = arrayDelta[key]; 49 | } 50 | } 51 | } 52 | return res; 53 | } 54 | 55 | return value; 56 | } 57 | 58 | const getStateFromProps = props => ({ 59 | theme: getJsonTreeTheme(props.base16Theme) 60 | }); 61 | 62 | export default class JSONDiff extends PureComponent { 63 | state: State; 64 | 65 | constructor(props: Props) { 66 | super(props); 67 | this.state = getStateFromProps(props); 68 | } 69 | 70 | componentWillReceiveProps(nextProps: Props) { 71 | if (nextProps.base16Theme !== this.props.base16Theme) { 72 | this.setState(getStateFromProps(nextProps)) 73 | } 74 | } 75 | 76 | render() { 77 | const { styling, labelRenderer, invertTheme, delta } = this.props; 78 | 79 | if (!delta) { 80 | return ( 81 |
82 | (states are equal) 83 |
84 | ); 85 | } 86 | 87 | return ( 88 | 100 | ); 101 | } 102 | 103 | valueRenderer = (raw: React$Element<*>, value: any): React$Element<*> => { 104 | const { styling, isWideLayout } = this.props; 105 | 106 | function renderSpan(name, body) { 107 | return ( 108 | {body} 109 | ); 110 | } 111 | 112 | if (Array.isArray(value)) { 113 | switch(value.length) { 114 | case 1: 115 | return ( 116 | 117 | {renderSpan('diffAdd', stringifyAndShrink(value[0], isWideLayout))} 118 | 119 | ); 120 | case 2: 121 | return ( 122 | 123 | {renderSpan('diffUpdateFrom', stringifyAndShrink(value[0], isWideLayout))} 124 | {renderSpan('diffUpdateArrow', ' => ')} 125 | {renderSpan('diffUpdateTo', stringifyAndShrink(value[1], isWideLayout))} 126 | 127 | ); 128 | case 3: 129 | return ( 130 | 131 | {renderSpan('diffRemove', stringifyAndShrink(value[0], isWideLayout))} 132 | 133 | ); 134 | } 135 | } 136 | 137 | return raw; 138 | } 139 | 140 | getItemString = (type: string, data: any) => { 141 | return getItemString(this.props.styling, type, data, this.props.isWideLayout, true); 142 | }; 143 | } 144 | -------------------------------------------------------------------------------- /src/ActionListRow.jsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import dateformat from 'dateformat'; 4 | import debounce from 'lodash.debounce'; 5 | import RightSlider from './RightSlider'; 6 | 7 | import type { StylingFunction } from 'react-base16-styling'; 8 | import type { Action } from './types'; 9 | 10 | type Button = 'Skip' | 'Jump'; 11 | 12 | const BUTTON_SKIP = 'Skip'; 13 | const BUTTON_JUMP = 'Jump'; 14 | 15 | type Props = { 16 | styling: StylingFunction, 17 | isSelected: boolean, 18 | action: Action, 19 | isInFuture: boolean, 20 | isInitAction: boolean, 21 | onSelect: (e: SyntheticMouseEvent) => void, 22 | timestamps: { 23 | current: number, 24 | previous: number 25 | }, 26 | isSkipped: boolean, 27 | onToggleClick: () => void, 28 | onJumpClick: () => void 29 | }; 30 | 31 | type State = { 32 | hover: boolean 33 | }; 34 | 35 | export default class ActionListRow extends PureComponent { 36 | state: State = { hover: false }; 37 | 38 | render() { 39 | const { styling, isSelected, action, isInitAction, onSelect, 40 | timestamps, isSkipped, isInFuture } = this.props; 41 | const { hover } = this.state; 42 | const timeDelta = timestamps.current - timestamps.previous; 43 | const showButtons = hover && !isInitAction || isSkipped; 44 | 45 | const isButtonSelected = btn => 46 | btn === BUTTON_SKIP && isSkipped; 47 | 48 | let actionType = action.type; 49 | if (typeof actionType === 'undefined') actionType = ''; 50 | else if (actionType === null) actionType = ''; 51 | else actionType = actionType.toString() || ''; 52 | 53 | return ( 54 |
65 |
71 | {actionType} 72 |
73 |
74 | 75 |
76 | {timeDelta === 0 ? '+00:00:00' : 77 | dateformat(timeDelta, timestamps.previous ? '+MM:ss.L' : 'h:MM:ss.L')} 78 |
79 |
80 | 81 |
82 | {[BUTTON_JUMP, BUTTON_SKIP].map(btn => (!isInitAction || btn !== BUTTON_SKIP) && 83 |
92 | {btn} 93 |
94 | )} 95 |
96 |
97 |
98 |
99 | ); 100 | } 101 | 102 | handleButtonClick(btn: Button, e: SyntheticMouseEvent) { 103 | e.stopPropagation(); 104 | 105 | switch(btn) { 106 | case BUTTON_SKIP: 107 | this.props.onToggleClick(); 108 | break; 109 | case BUTTON_JUMP: 110 | this.props.onJumpClick(); 111 | break; 112 | } 113 | } 114 | 115 | handleMouseEnter = (e: SyntheticMouseEvent) => { 116 | if (this.hover) return; 117 | this.handleMouseEnterDebounced(e.buttons); 118 | } 119 | 120 | handleMouseEnterDebounced = debounce((buttons) => { 121 | if (buttons) return; 122 | this.setState({ hover: true }); 123 | }, 300) 124 | 125 | handleMouseLeave = () => { 126 | this.handleMouseEnterDebounced.cancel(); 127 | if (this.state.hover) this.setState({ hover: false }); 128 | } 129 | 130 | handleMouseDown = (e: SyntheticMouseEvent) => { 131 | if (e.target instanceof Element && e.target.className.indexOf('selectorButton') === 0) return; 132 | if (this.handleMouseEnterDebounced) this.handleMouseEnterDebounced.cancel(); 133 | if (this.state.hover) this.setState({ hover: false }); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /flow-typed/npm/jss_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: a8525dbe8469d67a9bd98b7611d61384 2 | // flow-typed version: <>/jss_v^6.0.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jss' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jss' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'jss/dist/jss' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'jss/dist/jss.min' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'jss/karma.conf' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'jss/lib/backends/DomRenderer' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'jss/lib/backends/VirtualRenderer' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'jss/lib/createRule' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'jss/lib/findRenderer' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'jss/lib/index' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'jss/lib/Jss' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'jss/lib/PluginsRegistry' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'jss/lib/rules/ConditionalRule' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'jss/lib/rules/FontFaceRule' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'jss/lib/rules/KeyframeRule' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'jss/lib/rules/Rule' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'jss/lib/rules/SimpleRule' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'jss/lib/RulesContainer' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'jss/lib/SheetsRegistry' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'jss/lib/StyleSheet' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'jss/lib/utils' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'jss/tests.webpack' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'jss/webpack.config' { 106 | declare module.exports: any; 107 | } 108 | 109 | // Filename aliases 110 | declare module 'jss/dist/jss.js' { 111 | declare module.exports: $Exports<'jss/dist/jss'>; 112 | } 113 | declare module 'jss/dist/jss.min.js' { 114 | declare module.exports: $Exports<'jss/dist/jss.min'>; 115 | } 116 | declare module 'jss/karma.conf.js' { 117 | declare module.exports: $Exports<'jss/karma.conf'>; 118 | } 119 | declare module 'jss/lib/backends/DomRenderer.js' { 120 | declare module.exports: $Exports<'jss/lib/backends/DomRenderer'>; 121 | } 122 | declare module 'jss/lib/backends/VirtualRenderer.js' { 123 | declare module.exports: $Exports<'jss/lib/backends/VirtualRenderer'>; 124 | } 125 | declare module 'jss/lib/createRule.js' { 126 | declare module.exports: $Exports<'jss/lib/createRule'>; 127 | } 128 | declare module 'jss/lib/findRenderer.js' { 129 | declare module.exports: $Exports<'jss/lib/findRenderer'>; 130 | } 131 | declare module 'jss/lib/index.js' { 132 | declare module.exports: $Exports<'jss/lib/index'>; 133 | } 134 | declare module 'jss/lib/Jss.js' { 135 | declare module.exports: $Exports<'jss/lib/Jss'>; 136 | } 137 | declare module 'jss/lib/PluginsRegistry.js' { 138 | declare module.exports: $Exports<'jss/lib/PluginsRegistry'>; 139 | } 140 | declare module 'jss/lib/rules/ConditionalRule.js' { 141 | declare module.exports: $Exports<'jss/lib/rules/ConditionalRule'>; 142 | } 143 | declare module 'jss/lib/rules/FontFaceRule.js' { 144 | declare module.exports: $Exports<'jss/lib/rules/FontFaceRule'>; 145 | } 146 | declare module 'jss/lib/rules/KeyframeRule.js' { 147 | declare module.exports: $Exports<'jss/lib/rules/KeyframeRule'>; 148 | } 149 | declare module 'jss/lib/rules/Rule.js' { 150 | declare module.exports: $Exports<'jss/lib/rules/Rule'>; 151 | } 152 | declare module 'jss/lib/rules/SimpleRule.js' { 153 | declare module.exports: $Exports<'jss/lib/rules/SimpleRule'>; 154 | } 155 | declare module 'jss/lib/RulesContainer.js' { 156 | declare module.exports: $Exports<'jss/lib/RulesContainer'>; 157 | } 158 | declare module 'jss/lib/SheetsRegistry.js' { 159 | declare module.exports: $Exports<'jss/lib/SheetsRegistry'>; 160 | } 161 | declare module 'jss/lib/StyleSheet.js' { 162 | declare module.exports: $Exports<'jss/lib/StyleSheet'>; 163 | } 164 | declare module 'jss/lib/utils.js' { 165 | declare module.exports: $Exports<'jss/lib/utils'>; 166 | } 167 | declare module 'jss/tests.webpack.js' { 168 | declare module.exports: $Exports<'jss/tests.webpack'>; 169 | } 170 | declare module 'jss/webpack.config.js' { 171 | declare module.exports: $Exports<'jss/webpack.config'>; 172 | } 173 | -------------------------------------------------------------------------------- /flow-typed/npm/eslint-plugin-babel_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 48f814d05906a266f2fea11cb5ca341a 2 | // flow-typed version: <>/eslint-plugin-babel_v^3.1.0/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'eslint-plugin-babel' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'eslint-plugin-babel' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'eslint-plugin-babel/rules/array-bracket-spacing' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'eslint-plugin-babel/rules/arrow-parens' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'eslint-plugin-babel/rules/flow-object-type' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'eslint-plugin-babel/rules/func-params-comma-dangle' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'eslint-plugin-babel/rules/generator-star-spacing' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'eslint-plugin-babel/rules/new-cap' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'eslint-plugin-babel/rules/no-await-in-loop' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'eslint-plugin-babel/rules/object-curly-spacing' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'eslint-plugin-babel/rules/object-shorthand' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'eslint-plugin-babel/tests/array-bracket-spacing' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'eslint-plugin-babel/tests/arrow-parens' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'eslint-plugin-babel/tests/flow-object-type' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'eslint-plugin-babel/tests/func-params-comma-dangle' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'eslint-plugin-babel/tests/generator-star-spacing' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'eslint-plugin-babel/tests/new-cap' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'eslint-plugin-babel/tests/no-await-in-loop' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'eslint-plugin-babel/tests/object-curly-spacing' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'eslint-plugin-babel/tests/object-shorthand' { 94 | declare module.exports: any; 95 | } 96 | 97 | // Filename aliases 98 | declare module 'eslint-plugin-babel/index' { 99 | declare module.exports: $Exports<'eslint-plugin-babel'>; 100 | } 101 | declare module 'eslint-plugin-babel/index.js' { 102 | declare module.exports: $Exports<'eslint-plugin-babel'>; 103 | } 104 | declare module 'eslint-plugin-babel/rules/array-bracket-spacing.js' { 105 | declare module.exports: $Exports<'eslint-plugin-babel/rules/array-bracket-spacing'>; 106 | } 107 | declare module 'eslint-plugin-babel/rules/arrow-parens.js' { 108 | declare module.exports: $Exports<'eslint-plugin-babel/rules/arrow-parens'>; 109 | } 110 | declare module 'eslint-plugin-babel/rules/flow-object-type.js' { 111 | declare module.exports: $Exports<'eslint-plugin-babel/rules/flow-object-type'>; 112 | } 113 | declare module 'eslint-plugin-babel/rules/func-params-comma-dangle.js' { 114 | declare module.exports: $Exports<'eslint-plugin-babel/rules/func-params-comma-dangle'>; 115 | } 116 | declare module 'eslint-plugin-babel/rules/generator-star-spacing.js' { 117 | declare module.exports: $Exports<'eslint-plugin-babel/rules/generator-star-spacing'>; 118 | } 119 | declare module 'eslint-plugin-babel/rules/new-cap.js' { 120 | declare module.exports: $Exports<'eslint-plugin-babel/rules/new-cap'>; 121 | } 122 | declare module 'eslint-plugin-babel/rules/no-await-in-loop.js' { 123 | declare module.exports: $Exports<'eslint-plugin-babel/rules/no-await-in-loop'>; 124 | } 125 | declare module 'eslint-plugin-babel/rules/object-curly-spacing.js' { 126 | declare module.exports: $Exports<'eslint-plugin-babel/rules/object-curly-spacing'>; 127 | } 128 | declare module 'eslint-plugin-babel/rules/object-shorthand.js' { 129 | declare module.exports: $Exports<'eslint-plugin-babel/rules/object-shorthand'>; 130 | } 131 | declare module 'eslint-plugin-babel/tests/array-bracket-spacing.js' { 132 | declare module.exports: $Exports<'eslint-plugin-babel/tests/array-bracket-spacing'>; 133 | } 134 | declare module 'eslint-plugin-babel/tests/arrow-parens.js' { 135 | declare module.exports: $Exports<'eslint-plugin-babel/tests/arrow-parens'>; 136 | } 137 | declare module 'eslint-plugin-babel/tests/flow-object-type.js' { 138 | declare module.exports: $Exports<'eslint-plugin-babel/tests/flow-object-type'>; 139 | } 140 | declare module 'eslint-plugin-babel/tests/func-params-comma-dangle.js' { 141 | declare module.exports: $Exports<'eslint-plugin-babel/tests/func-params-comma-dangle'>; 142 | } 143 | declare module 'eslint-plugin-babel/tests/generator-star-spacing.js' { 144 | declare module.exports: $Exports<'eslint-plugin-babel/tests/generator-star-spacing'>; 145 | } 146 | declare module 'eslint-plugin-babel/tests/new-cap.js' { 147 | declare module.exports: $Exports<'eslint-plugin-babel/tests/new-cap'>; 148 | } 149 | declare module 'eslint-plugin-babel/tests/no-await-in-loop.js' { 150 | declare module.exports: $Exports<'eslint-plugin-babel/tests/no-await-in-loop'>; 151 | } 152 | declare module 'eslint-plugin-babel/tests/object-curly-spacing.js' { 153 | declare module.exports: $Exports<'eslint-plugin-babel/tests/object-curly-spacing'>; 154 | } 155 | declare module 'eslint-plugin-babel/tests/object-shorthand.js' { 156 | declare module.exports: $Exports<'eslint-plugin-babel/tests/object-shorthand'>; 157 | } 158 | -------------------------------------------------------------------------------- /flow-typed/npm/babel-core_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: eaf9bb14a8f363d6d83dc8edc23b973f 2 | // flow-typed version: <>/babel-core_v^6.4.5/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'babel-core' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'babel-core' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'babel-core/lib/api/browser' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'babel-core/lib/api/node' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'babel-core/lib/helpers/merge' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'babel-core/lib/helpers/normalize-ast' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'babel-core/lib/helpers/resolve' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'babel-core/lib/store' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'babel-core/lib/tools/build-external-helpers' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'babel-core/lib/transformation/file/index' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'babel-core/lib/transformation/file/logger' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'babel-core/lib/transformation/file/metadata' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'babel-core/lib/transformation/file/options/build-config-chain' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'babel-core/lib/transformation/file/options/config' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'babel-core/lib/transformation/file/options/index' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'babel-core/lib/transformation/file/options/option-manager' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'babel-core/lib/transformation/file/options/parsers' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'babel-core/lib/transformation/file/options/removed' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'babel-core/lib/transformation/pipeline' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'babel-core/lib/transformation/plugin-pass' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'babel-core/lib/transformation/plugin' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'babel-core/lib/util' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'babel-core/register' { 114 | declare module.exports: any; 115 | } 116 | 117 | // Filename aliases 118 | declare module 'babel-core/index' { 119 | declare module.exports: $Exports<'babel-core'>; 120 | } 121 | declare module 'babel-core/index.js' { 122 | declare module.exports: $Exports<'babel-core'>; 123 | } 124 | declare module 'babel-core/lib/api/browser.js' { 125 | declare module.exports: $Exports<'babel-core/lib/api/browser'>; 126 | } 127 | declare module 'babel-core/lib/api/node.js' { 128 | declare module.exports: $Exports<'babel-core/lib/api/node'>; 129 | } 130 | declare module 'babel-core/lib/helpers/merge.js' { 131 | declare module.exports: $Exports<'babel-core/lib/helpers/merge'>; 132 | } 133 | declare module 'babel-core/lib/helpers/normalize-ast.js' { 134 | declare module.exports: $Exports<'babel-core/lib/helpers/normalize-ast'>; 135 | } 136 | declare module 'babel-core/lib/helpers/resolve.js' { 137 | declare module.exports: $Exports<'babel-core/lib/helpers/resolve'>; 138 | } 139 | declare module 'babel-core/lib/store.js' { 140 | declare module.exports: $Exports<'babel-core/lib/store'>; 141 | } 142 | declare module 'babel-core/lib/tools/build-external-helpers.js' { 143 | declare module.exports: $Exports<'babel-core/lib/tools/build-external-helpers'>; 144 | } 145 | declare module 'babel-core/lib/transformation/file/index.js' { 146 | declare module.exports: $Exports<'babel-core/lib/transformation/file/index'>; 147 | } 148 | declare module 'babel-core/lib/transformation/file/logger.js' { 149 | declare module.exports: $Exports<'babel-core/lib/transformation/file/logger'>; 150 | } 151 | declare module 'babel-core/lib/transformation/file/metadata.js' { 152 | declare module.exports: $Exports<'babel-core/lib/transformation/file/metadata'>; 153 | } 154 | declare module 'babel-core/lib/transformation/file/options/build-config-chain.js' { 155 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/build-config-chain'>; 156 | } 157 | declare module 'babel-core/lib/transformation/file/options/config.js' { 158 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/config'>; 159 | } 160 | declare module 'babel-core/lib/transformation/file/options/index.js' { 161 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/index'>; 162 | } 163 | declare module 'babel-core/lib/transformation/file/options/option-manager.js' { 164 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/option-manager'>; 165 | } 166 | declare module 'babel-core/lib/transformation/file/options/parsers.js' { 167 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/parsers'>; 168 | } 169 | declare module 'babel-core/lib/transformation/file/options/removed.js' { 170 | declare module.exports: $Exports<'babel-core/lib/transformation/file/options/removed'>; 171 | } 172 | declare module 'babel-core/lib/transformation/internal-plugins/block-hoist.js' { 173 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/block-hoist'>; 174 | } 175 | declare module 'babel-core/lib/transformation/internal-plugins/shadow-functions.js' { 176 | declare module.exports: $Exports<'babel-core/lib/transformation/internal-plugins/shadow-functions'>; 177 | } 178 | declare module 'babel-core/lib/transformation/pipeline.js' { 179 | declare module.exports: $Exports<'babel-core/lib/transformation/pipeline'>; 180 | } 181 | declare module 'babel-core/lib/transformation/plugin-pass.js' { 182 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin-pass'>; 183 | } 184 | declare module 'babel-core/lib/transformation/plugin.js' { 185 | declare module.exports: $Exports<'babel-core/lib/transformation/plugin'>; 186 | } 187 | declare module 'babel-core/lib/util.js' { 188 | declare module.exports: $Exports<'babel-core/lib/util'>; 189 | } 190 | declare module 'babel-core/register.js' { 191 | declare module.exports: $Exports<'babel-core/register'>; 192 | } 193 | -------------------------------------------------------------------------------- /flow-typed/npm/react-input-enhancements_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: 69c958e92ef7ea20d332a6eafc9be1ba 2 | // flow-typed version: <>/react-input-enhancements_v^0.5.3/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-input-enhancements' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-input-enhancements' { 17 | declare module.exports: any; 18 | } 19 | 20 | /** 21 | * We include stubs for each file inside this npm package in case you need to 22 | * require those files directly. Feel free to delete any files that aren't 23 | * needed. 24 | */ 25 | declare module 'react-input-enhancements/lib/applyMaskToString' { 26 | declare module.exports: any; 27 | } 28 | 29 | declare module 'react-input-enhancements/lib/Autocomplete' { 30 | declare module.exports: any; 31 | } 32 | 33 | declare module 'react-input-enhancements/lib/Autosize' { 34 | declare module.exports: any; 35 | } 36 | 37 | declare module 'react-input-enhancements/lib/Combobox' { 38 | declare module.exports: any; 39 | } 40 | 41 | declare module 'react-input-enhancements/lib/createStyling' { 42 | declare module.exports: any; 43 | } 44 | 45 | declare module 'react-input-enhancements/lib/DatePicker' { 46 | declare module.exports: any; 47 | } 48 | 49 | declare module 'react-input-enhancements/lib/Dropdown' { 50 | declare module.exports: any; 51 | } 52 | 53 | declare module 'react-input-enhancements/lib/DropdownOption' { 54 | declare module.exports: any; 55 | } 56 | 57 | declare module 'react-input-enhancements/lib/filters/filterByMatchingTextWithThreshold' { 58 | declare module.exports: any; 59 | } 60 | 61 | declare module 'react-input-enhancements/lib/filters/filterRedudantSeparators' { 62 | declare module.exports: any; 63 | } 64 | 65 | declare module 'react-input-enhancements/lib/filters/index' { 66 | declare module.exports: any; 67 | } 68 | 69 | declare module 'react-input-enhancements/lib/filters/limitBy' { 70 | declare module.exports: any; 71 | } 72 | 73 | declare module 'react-input-enhancements/lib/filters/notFoundMessage' { 74 | declare module.exports: any; 75 | } 76 | 77 | declare module 'react-input-enhancements/lib/filters/sortByMatchingText' { 78 | declare module.exports: any; 79 | } 80 | 81 | declare module 'react-input-enhancements/lib/index' { 82 | declare module.exports: any; 83 | } 84 | 85 | declare module 'react-input-enhancements/lib/InputPopup' { 86 | declare module.exports: any; 87 | } 88 | 89 | declare module 'react-input-enhancements/lib/Mask' { 90 | declare module.exports: any; 91 | } 92 | 93 | declare module 'react-input-enhancements/lib/shapes' { 94 | declare module.exports: any; 95 | } 96 | 97 | declare module 'react-input-enhancements/lib/themes/default' { 98 | declare module.exports: any; 99 | } 100 | 101 | declare module 'react-input-enhancements/lib/utils/deprecated' { 102 | declare module.exports: any; 103 | } 104 | 105 | declare module 'react-input-enhancements/lib/utils/findMatchingTextIndex' { 106 | declare module.exports: any; 107 | } 108 | 109 | declare module 'react-input-enhancements/lib/utils/getComputedStyle' { 110 | declare module.exports: any; 111 | } 112 | 113 | declare module 'react-input-enhancements/lib/utils/getInput' { 114 | declare module.exports: any; 115 | } 116 | 117 | declare module 'react-input-enhancements/lib/utils/getOptionLabel' { 118 | declare module.exports: any; 119 | } 120 | 121 | declare module 'react-input-enhancements/lib/utils/getOptionText' { 122 | declare module.exports: any; 123 | } 124 | 125 | declare module 'react-input-enhancements/lib/utils/getOptionValue' { 126 | declare module.exports: any; 127 | } 128 | 129 | declare module 'react-input-enhancements/lib/utils/isStatic' { 130 | declare module.exports: any; 131 | } 132 | 133 | declare module 'react-input-enhancements/lib/utils/registerInput' { 134 | declare module.exports: any; 135 | } 136 | 137 | declare module 'react-input-enhancements/lib/utils/renderChild' { 138 | declare module.exports: any; 139 | } 140 | 141 | // Filename aliases 142 | declare module 'react-input-enhancements/lib/applyMaskToString.js' { 143 | declare module.exports: $Exports<'react-input-enhancements/lib/applyMaskToString'>; 144 | } 145 | declare module 'react-input-enhancements/lib/Autocomplete.js' { 146 | declare module.exports: $Exports<'react-input-enhancements/lib/Autocomplete'>; 147 | } 148 | declare module 'react-input-enhancements/lib/Autosize.js' { 149 | declare module.exports: $Exports<'react-input-enhancements/lib/Autosize'>; 150 | } 151 | declare module 'react-input-enhancements/lib/Combobox.js' { 152 | declare module.exports: $Exports<'react-input-enhancements/lib/Combobox'>; 153 | } 154 | declare module 'react-input-enhancements/lib/createStyling.js' { 155 | declare module.exports: $Exports<'react-input-enhancements/lib/createStyling'>; 156 | } 157 | declare module 'react-input-enhancements/lib/DatePicker.js' { 158 | declare module.exports: $Exports<'react-input-enhancements/lib/DatePicker'>; 159 | } 160 | declare module 'react-input-enhancements/lib/Dropdown.js' { 161 | declare module.exports: $Exports<'react-input-enhancements/lib/Dropdown'>; 162 | } 163 | declare module 'react-input-enhancements/lib/DropdownOption.js' { 164 | declare module.exports: $Exports<'react-input-enhancements/lib/DropdownOption'>; 165 | } 166 | declare module 'react-input-enhancements/lib/filters/filterByMatchingTextWithThreshold.js' { 167 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/filterByMatchingTextWithThreshold'>; 168 | } 169 | declare module 'react-input-enhancements/lib/filters/filterRedudantSeparators.js' { 170 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/filterRedudantSeparators'>; 171 | } 172 | declare module 'react-input-enhancements/lib/filters/index.js' { 173 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/index'>; 174 | } 175 | declare module 'react-input-enhancements/lib/filters/limitBy.js' { 176 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/limitBy'>; 177 | } 178 | declare module 'react-input-enhancements/lib/filters/notFoundMessage.js' { 179 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/notFoundMessage'>; 180 | } 181 | declare module 'react-input-enhancements/lib/filters/sortByMatchingText.js' { 182 | declare module.exports: $Exports<'react-input-enhancements/lib/filters/sortByMatchingText'>; 183 | } 184 | declare module 'react-input-enhancements/lib/index.js' { 185 | declare module.exports: $Exports<'react-input-enhancements/lib/index'>; 186 | } 187 | declare module 'react-input-enhancements/lib/InputPopup.js' { 188 | declare module.exports: $Exports<'react-input-enhancements/lib/InputPopup'>; 189 | } 190 | declare module 'react-input-enhancements/lib/Mask.js' { 191 | declare module.exports: $Exports<'react-input-enhancements/lib/Mask'>; 192 | } 193 | declare module 'react-input-enhancements/lib/shapes.js' { 194 | declare module.exports: $Exports<'react-input-enhancements/lib/shapes'>; 195 | } 196 | declare module 'react-input-enhancements/lib/themes/default.js' { 197 | declare module.exports: $Exports<'react-input-enhancements/lib/themes/default'>; 198 | } 199 | declare module 'react-input-enhancements/lib/utils/deprecated.js' { 200 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/deprecated'>; 201 | } 202 | declare module 'react-input-enhancements/lib/utils/findMatchingTextIndex.js' { 203 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/findMatchingTextIndex'>; 204 | } 205 | declare module 'react-input-enhancements/lib/utils/getComputedStyle.js' { 206 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/getComputedStyle'>; 207 | } 208 | declare module 'react-input-enhancements/lib/utils/getInput.js' { 209 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/getInput'>; 210 | } 211 | declare module 'react-input-enhancements/lib/utils/getOptionLabel.js' { 212 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/getOptionLabel'>; 213 | } 214 | declare module 'react-input-enhancements/lib/utils/getOptionText.js' { 215 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/getOptionText'>; 216 | } 217 | declare module 'react-input-enhancements/lib/utils/getOptionValue.js' { 218 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/getOptionValue'>; 219 | } 220 | declare module 'react-input-enhancements/lib/utils/isStatic.js' { 221 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/isStatic'>; 222 | } 223 | declare module 'react-input-enhancements/lib/utils/registerInput.js' { 224 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/registerInput'>; 225 | } 226 | declare module 'react-input-enhancements/lib/utils/renderChild.js' { 227 | declare module.exports: $Exports<'react-input-enhancements/lib/utils/renderChild'>; 228 | } 229 | -------------------------------------------------------------------------------- /demo/src/js/DemoApp.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PageHeader from 'react-bootstrap/lib/PageHeader'; 3 | import { connect } from 'react-redux'; 4 | import pkg from '../../../package.json'; 5 | import Button from 'react-bootstrap/lib/Button'; 6 | import FormGroup from 'react-bootstrap/lib/FormGroup'; 7 | import FormControl from 'react-bootstrap/lib/FormControl'; 8 | import ControlLabel from 'react-bootstrap/lib/ControlLabel'; 9 | import Form from 'react-bootstrap/lib/Form'; 10 | import Col from 'react-bootstrap/lib/Col'; 11 | import InputGroup from 'react-bootstrap/lib/InputGroup'; 12 | import Combobox from 'react-input-enhancements/lib/Combobox'; 13 | import * as base16 from 'base16'; 14 | import * as inspectorThemes from '../../../src/themes'; 15 | import getOptions from './getOptions'; 16 | import { push as pushRoute } from 'react-router-redux'; 17 | 18 | const styles = { 19 | wrapper: { 20 | height: '100vh', 21 | width: '80%', 22 | margin: '0 auto', 23 | paddingTop: '1px' 24 | }, 25 | header: { 26 | }, 27 | content: { 28 | display: 'flex', 29 | alignItems: 'center', 30 | justifyContent: 'center', 31 | height: '50%' 32 | }, 33 | buttons: { 34 | display: 'flex', 35 | width: '40rem', 36 | justifyContent: 'center', 37 | flexWrap: 'wrap' 38 | }, 39 | muted: { 40 | color: '#CCCCCC' 41 | }, 42 | button: { 43 | margin: '0.5rem' 44 | }, 45 | links: { 46 | textAlign: 'center' 47 | }, 48 | link: { 49 | margin: '0 0.5rem', 50 | cursor: 'pointer', 51 | display: 'block' 52 | }, 53 | input: { 54 | display: 'inline-block', 55 | textAlign: 'left', 56 | width: '30rem' 57 | } 58 | }; 59 | 60 | const themeOptions = [ 61 | ...Object.keys(inspectorThemes) 62 | .map(value => ({ value, label: inspectorThemes[value].scheme })), 63 | null, 64 | ...Object.keys(base16) 65 | .map(value => ({ value, label: base16[value].scheme })) 66 | .filter(opt => opt.label) 67 | ]; 68 | 69 | const ROOT = process.env.NODE_ENV === 'production' ? '/redux-devtools-inspector/' : '/'; 70 | 71 | function buildUrl(options) { 72 | return `${ROOT}?` + [ 73 | options.useExtension ? 'ext' : '', 74 | options.supportImmutable ? 'immutable' : '', 75 | options.theme ? 'theme=' + options.theme : '', 76 | options.dark ? 'dark' : '' 77 | ].filter(s => s).join('&'); 78 | } 79 | 80 | class DemoApp extends React.Component { 81 | render() { 82 | const options = getOptions(); 83 | 84 | return ( 85 |
183 | ); 184 | } 185 | 186 | toggleExtension = () => { 187 | const options = getOptions(); 188 | 189 | this.props.pushRoute(buildUrl({ ...options, useExtension: !options.useExtension })); 190 | }; 191 | 192 | toggleImmutableSupport = () => { 193 | const options = getOptions(); 194 | 195 | this.props.pushRoute(buildUrl({ ...options, supportImmutable: !options.supportImmutable })); 196 | }; 197 | 198 | toggleTheme = () => { 199 | const options = getOptions(); 200 | 201 | this.props.pushRoute(buildUrl({ ...options, dark: !options.dark })); 202 | }; 203 | 204 | setTheme = (options, theme) => { 205 | this.props.pushRoute(buildUrl({ ...options, theme })); 206 | }; 207 | 208 | toggleTimeoutUpdate = () => { 209 | const enabled = !this.props.timeoutUpdateEnabled; 210 | this.props.toggleTimeoutUpdate(enabled); 211 | 212 | if (enabled) { 213 | this.timeout = setInterval(this.props.timeoutUpdate, 1000); 214 | } else { 215 | clearTimeout(this.timeout); 216 | } 217 | } 218 | } 219 | 220 | export default connect( 221 | state => state, 222 | { 223 | toggleTimeoutUpdate: timeoutUpdateEnabled => ({ 224 | type: 'TOGGLE_TIMEOUT_UPDATE', timeoutUpdateEnabled 225 | }), 226 | timeoutUpdate: () => ({ type: 'TIMEOUT_UPDATE' }), 227 | increment: () => ({ type: 'INCREMENT' }), 228 | push: () => ({ type: 'PUSH' }), 229 | pop: () => ({ type: 'POP' }), 230 | replace: () => ({ type: 'REPLACE' }), 231 | changeNested: () => ({ type: 'CHANGE_NESTED' }), 232 | pushHugeArray: () => ({ type: 'PUSH_HUGE_ARRAY' }), 233 | addIterator: () => ({ type: 'ADD_ITERATOR' }), 234 | addHugeObect: () => ({ type: 'ADD_HUGE_OBJECT' }), 235 | addRecursive: () => ({ type: 'ADD_RECURSIVE' }), 236 | addNativeMap: () => ({ type: 'ADD_NATIVE_MAP' }), 237 | addImmutableMap: () => ({ type: 'ADD_IMMUTABLE_MAP' }), 238 | changeImmutableNested: () => ({ type: 'CHANGE_IMMUTABLE_NESTED' }), 239 | hugePayload: () => ({ 240 | type: 'HUGE_PAYLOAD', 241 | payload: Array.from({ length: 10000 }).map((_, i) => i) 242 | }), 243 | addFunction: () => ({ type: 'ADD_FUNCTION' }), 244 | addSymbol: () => ({ type: 'ADD_SYMBOL' }), 245 | shuffleArray: () => ({ type: 'SHUFFLE_ARRAY' }), 246 | pushRoute 247 | } 248 | )(DemoApp); 249 | -------------------------------------------------------------------------------- /src/utils/createStylingFromTheme.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import jss from 'jss'; 3 | import jssVendorPrefixer from 'jss-vendor-prefixer'; 4 | import jssNested from 'jss-nested'; 5 | import { createStyling } from 'react-base16-styling'; 6 | import rgba from 'hex-rgba'; 7 | import inspector from '../themes/inspector'; 8 | import * as reduxThemes from 'redux-devtools-themes'; 9 | import * as inspectorThemes from '../themes'; 10 | 11 | jss.use(jssVendorPrefixer()); 12 | jss.use(jssNested()); 13 | 14 | 15 | const colorMap = theme => ({ 16 | TEXT_COLOR: theme.base06, 17 | TEXT_PLACEHOLDER_COLOR: rgba(theme.base06, 60), 18 | BACKGROUND_COLOR: theme.base00, 19 | SELECTED_BACKGROUND_COLOR: rgba(theme.base03, 20), 20 | SKIPPED_BACKGROUND_COLOR: rgba(theme.base03, 10), 21 | HEADER_BACKGROUND_COLOR: rgba(theme.base03, 30), 22 | HEADER_BORDER_COLOR: rgba(theme.base03, 20), 23 | BORDER_COLOR: rgba(theme.base03, 50), 24 | LIST_BORDER_COLOR: rgba(theme.base03, 50), 25 | ACTION_TIME_BACK_COLOR: rgba(theme.base03, 20), 26 | ACTION_TIME_COLOR: theme.base04, 27 | PIN_COLOR: theme.base04, 28 | ITEM_HINT_COLOR: rgba(theme.base0F, 90), 29 | TAB_BACK_SELECTED_COLOR: rgba(theme.base03, 20), 30 | TAB_BACK_COLOR: rgba(theme.base00, 70), 31 | TAB_BACK_HOVER_COLOR: rgba(theme.base03, 40), 32 | TAB_BORDER_COLOR: rgba(theme.base03, 50), 33 | DIFF_ADD_COLOR: rgba(theme.base0B, 40), 34 | DIFF_REMOVE_COLOR: rgba(theme.base08, 40), 35 | DIFF_ARROW_COLOR: theme.base0E, 36 | LINK_COLOR: rgba(theme.base0E, 90), 37 | LINK_HOVER_COLOR: theme.base0E, 38 | ERROR_COLOR: theme.base08, 39 | }); 40 | 41 | const getSheetFromColorMap = map => ({ 42 | inspector: { 43 | display: 'flex', 44 | 'flex-direction': 'column', 45 | width: '100%', 46 | height: '100%', 47 | 'font-family': 'monaco, Consolas, "Lucida Console", monospace', 48 | 'font-size': '12px', 49 | 'font-smoothing': 'antialiased', 50 | 'line-height': '1.5em', 51 | 52 | 'background-color': map.BACKGROUND_COLOR, 53 | color: map.TEXT_COLOR 54 | }, 55 | 56 | inspectorWide: { 57 | 'flex-direction': 'row' 58 | }, 59 | 60 | actionList: { 61 | 'flex-basis': '40%', 62 | 'flex-shrink': 0, 63 | 'overflow-x': 'hidden', 64 | 'overflow-y': 'auto', 65 | 'border-bottom-width': '3px', 66 | 'border-bottom-style': 'double', 67 | display: 'flex', 68 | 'flex-direction': 'column', 69 | 70 | 'background-color': map.BACKGROUND_COLOR, 71 | 'border-color': map.LIST_BORDER_COLOR 72 | }, 73 | 74 | actionListHeader: { 75 | display: 'flex', 76 | flex: '0 0 auto', 77 | 'align-items': 'center', 78 | 'border-bottom-width': '1px', 79 | 'border-bottom-style': 'solid', 80 | 81 | 'border-color': map.LIST_BORDER_COLOR 82 | }, 83 | 84 | actionListRows: { 85 | overflow: 'auto' 86 | }, 87 | 88 | actionListHeaderSelector: { 89 | display: 'inline-flex', 90 | 'margin-right': '10px' 91 | }, 92 | 93 | actionListWide: { 94 | 'flex-basis': '40%', 95 | 'border-bottom': 'none', 96 | 'border-right-width': '3px', 97 | 'border-right-style': 'double' 98 | }, 99 | 100 | actionListItem: { 101 | 'border-bottom-width': '1px', 102 | 'border-bottom-style': 'solid', 103 | display: 'flex', 104 | 'justify-content': 'space-between', 105 | padding: '5px 10px', 106 | cursor: 'pointer', 107 | 'user-select': 'none', 108 | 109 | '&:last-child': { 110 | 'border-bottom-width': 0 111 | }, 112 | 113 | 'border-bottom-color': map.BORDER_COLOR 114 | }, 115 | 116 | actionListItemSelected: { 117 | 'background-color': map.SELECTED_BACKGROUND_COLOR 118 | }, 119 | 120 | actionListItemSkipped: { 121 | 'background-color': map.SKIPPED_BACKGROUND_COLOR 122 | }, 123 | 124 | actionListFromFuture: { 125 | opacity: '0.6' 126 | }, 127 | 128 | actionListItemButtons: { 129 | position: 'relative', 130 | height: '20px', 131 | display: 'flex' 132 | }, 133 | 134 | actionListItemTime: { 135 | display: 'inline', 136 | padding: '4px 6px', 137 | 'border-radius': '3px', 138 | 'font-size': '0.8em', 139 | 'line-height': '1em', 140 | 'flex-shrink': 0, 141 | 142 | 'background-color': map.ACTION_TIME_BACK_COLOR, 143 | color: map.ACTION_TIME_COLOR 144 | }, 145 | 146 | actionListItemSelector: { 147 | display: 'inline-flex' 148 | }, 149 | 150 | actionListItemName: { 151 | overflow: 'hidden', 152 | 'text-overflow': 'ellipsis', 153 | 'line-height': '20px' 154 | }, 155 | 156 | actionListItemNameSkipped: { 157 | 'text-decoration': 'line-through', 158 | opacity: 0.3 159 | }, 160 | 161 | actionListHeaderSearch: { 162 | outline: 'none', 163 | border: 'none', 164 | width: '100%', 165 | padding: '5px 10px', 166 | 'font-size': '1em', 167 | 'font-family': 'monaco, Consolas, "Lucida Console", monospace', 168 | 169 | 'background-color': map.BACKGROUND_COLOR, 170 | color: map.TEXT_COLOR, 171 | 172 | '&::-webkit-input-placeholder': { 173 | color: map.TEXT_PLACEHOLDER_COLOR 174 | }, 175 | 176 | '&::-moz-placeholder': { 177 | color: map.TEXT_PLACEHOLDER_COLOR 178 | } 179 | }, 180 | 181 | actionListHeaderWrapper: { 182 | position: 'relative', 183 | height: '20px' 184 | }, 185 | 186 | actionPreview: { 187 | flex: 1, 188 | display: 'flex', 189 | 'flex-direction': 'column', 190 | 'flex-grow': 1, 191 | 'overflow-y': 'hidden', 192 | 193 | '& pre': { 194 | border: 'inherit', 195 | 'border-radius': '3px', 196 | 'line-height': 'inherit', 197 | color: 'inherit' 198 | }, 199 | 200 | 'background-color': map.BACKGROUND_COLOR, 201 | }, 202 | 203 | actionPreviewContent: { 204 | flex: 1, 205 | 'overflow-y': 'auto' 206 | }, 207 | 208 | stateDiff: { 209 | padding: '5px 0' 210 | }, 211 | 212 | stateDiffEmpty: { 213 | padding: '10px', 214 | 215 | color: map.TEXT_PLACEHOLDER_COLOR 216 | }, 217 | 218 | stateError: { 219 | padding: '10px', 220 | 'margin-left': '14px', 221 | 'font-weight': 'bold', 222 | 223 | color: map.ERROR_COLOR 224 | }, 225 | 226 | inspectedPath: { 227 | padding: '6px 0' 228 | }, 229 | 230 | inspectedPathKey: { 231 | '&:not(:last-child):after': { 232 | content: '" > "' 233 | } 234 | }, 235 | 236 | inspectedPathKeyLink: { 237 | cursor: 'pointer', 238 | '&:hover': { 239 | 'text-decoration': 'underline' 240 | }, 241 | 242 | color: map.LINK_COLOR, 243 | '&:hover': { 244 | color: map.LINK_HOVER_COLOR 245 | } 246 | }, 247 | 248 | treeItemPin: { 249 | 'font-size': '0.7em', 250 | 'padding-left': '5px', 251 | cursor: 'pointer', 252 | '&:hover': { 253 | 'text-decoration': 'underline' 254 | }, 255 | 256 | color: map.PIN_COLOR 257 | }, 258 | 259 | treeItemHint: { 260 | color: map.ITEM_HINT_COLOR 261 | }, 262 | 263 | previewHeader: { 264 | flex: '0 0 30px', 265 | padding: '5px 10px', 266 | 'align-items': 'center', 267 | 'border-bottom-width': '1px', 268 | 'border-bottom-style': 'solid', 269 | 270 | 'background-color': map.HEADER_BACKGROUND_COLOR, 271 | 'border-bottom-color': map.HEADER_BORDER_COLOR 272 | }, 273 | 274 | tabSelector: { 275 | position: 'relative', 276 | 'z-index': 1, 277 | display: 'inline-flex', 278 | float: 'right' 279 | }, 280 | 281 | selectorButton: { 282 | cursor: 'pointer', 283 | position: 'relative', 284 | padding: '5px 10px', 285 | 'border-style': 'solid', 286 | 'border-width': '1px', 287 | 'border-left-width': 0, 288 | 289 | '&:first-child': { 290 | 'border-left-width': '1px', 291 | 'border-top-left-radius': '3px', 292 | 'border-bottom-left-radius': '3px' 293 | }, 294 | 295 | '&:last-child': { 296 | 'border-top-right-radius': '3px', 297 | 'border-bottom-right-radius': '3px' 298 | }, 299 | 300 | 'background-color': map.TAB_BACK_COLOR, 301 | 302 | '&:hover': { 303 | 'background-color': map.TAB_BACK_HOVER_COLOR 304 | }, 305 | 306 | 'border-color': map.TAB_BORDER_COLOR 307 | }, 308 | 309 | selectorButtonSmall: { 310 | padding: '0px 8px', 311 | 'font-size': '0.8em' 312 | }, 313 | 314 | selectorButtonSelected: { 315 | 'background-color': map.TAB_BACK_SELECTED_COLOR 316 | }, 317 | 318 | diff: { 319 | padding: '2px 3px', 320 | 'border-radius': '3px', 321 | position: 'relative', 322 | 323 | color: map.TEXT_COLOR 324 | }, 325 | 326 | diffWrap: { 327 | position: 'relative', 328 | 'z-index': 1 329 | }, 330 | 331 | diffAdd: { 332 | 'background-color': map.DIFF_ADD_COLOR 333 | }, 334 | 335 | diffRemove: { 336 | 'text-decoration': 'line-through', 337 | 'background-color': map.DIFF_REMOVE_COLOR 338 | }, 339 | 340 | diffUpdateFrom: { 341 | 'text-decoration': 'line-through', 342 | 'background-color': map.DIFF_REMOVE_COLOR 343 | }, 344 | 345 | diffUpdateTo: { 346 | 'background-color': map.DIFF_ADD_COLOR 347 | }, 348 | 349 | diffUpdateArrow: { 350 | color: map.DIFF_ARROW_COLOR 351 | }, 352 | 353 | rightSlider: { 354 | 'font-smoothing': 'subpixel-antialiased', // http://stackoverflow.com/a/21136111/4218591 355 | position: 'absolute', 356 | right: 0, 357 | transform: 'translateX(150%)', 358 | transition: 'transform 0.2s ease-in-out' 359 | }, 360 | 361 | rightSliderRotate: { 362 | transform: 'rotateX(90deg)', 363 | transition: 'transform 0.2s ease-in-out 0.08s' 364 | }, 365 | 366 | rightSliderShown: { 367 | position: 'static', 368 | transform: 'translateX(0)', 369 | }, 370 | 371 | rightSliderRotateShown: { 372 | transform: 'rotateX(0)', 373 | transition: 'transform 0.2s ease-in-out 0.18s' 374 | } 375 | }); 376 | 377 | let themeSheet; 378 | 379 | const getDefaultThemeStyling = theme => { 380 | if (themeSheet) { 381 | themeSheet.detach(); 382 | } 383 | 384 | themeSheet = jss.createStyleSheet( 385 | getSheetFromColorMap(colorMap(theme)) 386 | ).attach(); 387 | 388 | return themeSheet.classes; 389 | }; 390 | 391 | export const base16Themes = { ...reduxThemes, ...inspectorThemes }; 392 | 393 | export const createStylingFromTheme = createStyling(getDefaultThemeStyling, { 394 | defaultBase16: inspector, 395 | base16Themes 396 | }); 397 | -------------------------------------------------------------------------------- /src/DevtoolsInspector.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import React, { PureComponent } from 'react'; 3 | import { createStylingFromTheme, base16Themes } from './utils/createStylingFromTheme'; 4 | import ActionList from './ActionList'; 5 | import ActionPreview from './ActionPreview'; 6 | import getInspectedState from './utils/getInspectedState'; 7 | import createDiffPatcher from './createDiffPatcher'; 8 | import { getBase16Theme } from 'react-base16-styling'; 9 | import { reducer, updateMonitorState } from './redux'; 10 | import { ActionCreators } from 'redux-devtools'; 11 | 12 | import type { Base16Theme, StylingFunction, Theme } from 'react-base16-styling'; 13 | import type { Dispatch } from 'redux'; 14 | import type { Action, MonitorState, TabName } from './types'; 15 | import type { ObjectHash, PropertyFilter, Delta } from 'jsondiffpatch'; 16 | 17 | type DefaultProps = { 18 | supportImmutable: boolean, 19 | theme: Theme, 20 | invertTheme: boolean 21 | }; 22 | 23 | type AppState = Object; 24 | 25 | type Props = DefaultProps & { 26 | dispatch: Dispatch<*>, 27 | computedStates: AppState[], 28 | stagedActionIds: number[], 29 | actionsById: { 30 | [id: number]: Action 31 | }, 32 | currentStateIndex: number, 33 | monitorState: MonitorState, 34 | preserveScrollTop: boolean, 35 | stagedActions: number[], 36 | // select: PropTypes.func.isRequired, 37 | diffObjectHash: ObjectHash, 38 | diffPropertyFilter: PropertyFilter 39 | }; 40 | 41 | type State = { 42 | isWideLayout: boolean, 43 | themeState: { 44 | base16Theme: Base16Theme, 45 | styling: StylingFunction 46 | }, 47 | action: Action, 48 | nextState: Object, 49 | delta: ?Delta, 50 | error: ?string 51 | }; 52 | 53 | const { commit, sweep, toggleAction, jumpToAction, jumpToState } = ActionCreators; 54 | 55 | function getLastActionId(props) { 56 | return props.stagedActionIds[props.stagedActionIds.length - 1]; 57 | } 58 | 59 | function getCurrentActionId(props, monitorState) { 60 | return monitorState.selectedActionId === null ? 61 | props.stagedActionIds[props.currentStateIndex] : monitorState.selectedActionId; 62 | } 63 | 64 | function getFromState(actionIndex, stagedActionIds, computedStates, monitorState) { 65 | const { startActionId } = monitorState; 66 | if (startActionId === null) { 67 | return actionIndex > 0 ? computedStates[actionIndex - 1] : null; 68 | } 69 | let fromStateIdx = stagedActionIds.indexOf(startActionId - 1); 70 | if (fromStateIdx === -1) fromStateIdx = 0; 71 | return computedStates[fromStateIdx]; 72 | } 73 | 74 | function createIntermediateState(props, monitorState) { 75 | const { supportImmutable, computedStates, stagedActionIds, 76 | actionsById: actions, diffObjectHash, diffPropertyFilter } = props; 77 | const { inspectedStatePath, inspectedActionPath } = monitorState; 78 | const currentActionId = getCurrentActionId(props, monitorState); 79 | const currentAction = actions[currentActionId] && actions[currentActionId].action; 80 | 81 | const actionIndex = stagedActionIds.indexOf(currentActionId); 82 | const fromState = getFromState(actionIndex, stagedActionIds, computedStates, monitorState); 83 | const toState = computedStates[actionIndex]; 84 | const error = toState ? toState.error : null; 85 | 86 | const fromInspectedState = !error && fromState ? 87 | getInspectedState(fromState.state, inspectedStatePath, supportImmutable) : null; 88 | const toInspectedState = !error && toState ? 89 | getInspectedState(toState.state, inspectedStatePath, supportImmutable) : null; 90 | const delta = fromInspectedState && toInspectedState ? 91 | createDiffPatcher(diffObjectHash, diffPropertyFilter).diff( 92 | fromInspectedState, 93 | toInspectedState 94 | ) : null; 95 | 96 | return { 97 | delta, 98 | nextState: toState && getInspectedState(toState.state, inspectedStatePath, false), 99 | action: getInspectedState(currentAction, inspectedActionPath, false), 100 | error 101 | }; 102 | } 103 | 104 | function createThemeState(props) { 105 | const base16Theme = getBase16Theme(props.theme, base16Themes); 106 | const styling = createStylingFromTheme(props.theme, props.invertTheme); 107 | 108 | return { base16Theme, styling }; 109 | } 110 | 111 | export default class DevtoolsInspector extends PureComponent { 112 | state: State; 113 | updateSizeTimeout: ?number; 114 | 115 | constructor(props: Props) { 116 | super(props); 117 | this.state = { 118 | ...createIntermediateState(props, props.monitorState), 119 | isWideLayout: false, 120 | themeState: createThemeState(props) 121 | }; 122 | } 123 | 124 | static update = reducer; 125 | 126 | static defaultProps = { 127 | select: (state) => state, 128 | supportImmutable: false, 129 | theme: 'inspector', 130 | invertTheme: true 131 | }; 132 | 133 | componentDidMount() { 134 | this.updateSizeMode(); 135 | this.updateSizeTimeout = setInterval(this.updateSizeMode.bind(this), 150); 136 | } 137 | 138 | componentWillUnmount() { 139 | clearTimeout(this.updateSizeTimeout); 140 | } 141 | 142 | updateMonitorState(monitorState: MonitorState) { 143 | this.props.dispatch(updateMonitorState(monitorState)); 144 | } 145 | 146 | updateSizeMode() { 147 | const isWideLayout = this.refs.inspector.offsetWidth > 500; 148 | 149 | if (isWideLayout !== this.state.isWideLayout) { 150 | this.setState({ isWideLayout }); 151 | } 152 | } 153 | 154 | componentWillReceiveProps(nextProps: Props) { 155 | let nextMonitorState = nextProps.monitorState; 156 | const monitorState = this.props.monitorState; 157 | 158 | if ( 159 | getCurrentActionId(this.props, monitorState) !== 160 | getCurrentActionId(nextProps, nextMonitorState) || 161 | monitorState.startActionId !== nextMonitorState.startActionId || 162 | monitorState.inspectedStatePath !== nextMonitorState.inspectedStatePath || 163 | monitorState.inspectedActionPath !== nextMonitorState.inspectedActionPath 164 | ) { 165 | this.setState(createIntermediateState(nextProps, nextMonitorState)); 166 | } 167 | 168 | if (this.props.theme !== nextProps.theme || 169 | this.props.invertTheme !== nextProps.invertTheme) { 170 | this.setState({ themeState: createThemeState(nextProps) }); 171 | } 172 | } 173 | 174 | render() { 175 | const { stagedActionIds: actionIds, actionsById: actions, computedStates, 176 | tabs, invertTheme, skippedActionIds, currentStateIndex, monitorState } = this.props; 177 | const { selectedActionId, startActionId, searchValue, tabName } = monitorState; 178 | const inspectedPathType = tabName === 'Action' ? 'inspectedActionPath' : 'inspectedStatePath'; 179 | const { 180 | themeState, isWideLayout, action, nextState, delta, error 181 | } = this.state; 182 | const { base16Theme, styling } = themeState; 183 | 184 | return ( 185 |
188 | 201 | 209 |
210 | ); 211 | } 212 | 213 | handleToggleAction = (actionId: number) => { 214 | this.props.dispatch(toggleAction(actionId)); 215 | }; 216 | 217 | handleJumpToState = (actionId: number) => { 218 | if (jumpToAction) { 219 | this.props.dispatch(jumpToAction(actionId)); 220 | } else { // Fallback for redux-devtools-instrument < 1.5 221 | const index = this.props.stagedActionIds.indexOf(actionId); 222 | if (index !== -1) this.props.dispatch(jumpToState(index)); 223 | } 224 | }; 225 | 226 | handleCommit = () => { 227 | this.props.dispatch(commit()); 228 | }; 229 | 230 | handleSweep = () => { 231 | this.props.dispatch(sweep()); 232 | }; 233 | 234 | handleSearch = (val: string) => { 235 | this.updateMonitorState({ searchValue: val }); 236 | }; 237 | 238 | handleSelectAction = (e: SyntheticMouseEvent, actionId: number) => { 239 | const { monitorState } = this.props; 240 | let startActionId; 241 | let selectedActionId; 242 | 243 | if (e.shiftKey && monitorState.selectedActionId !== null) { 244 | if (monitorState.startActionId !== null) { 245 | if (actionId >= monitorState.startActionId) { 246 | startActionId = Math.min(monitorState.startActionId, monitorState.selectedActionId); 247 | selectedActionId = actionId; 248 | } else { 249 | selectedActionId = Math.max(monitorState.startActionId, monitorState.selectedActionId); 250 | startActionId = actionId; 251 | } 252 | } else { 253 | startActionId = Math.min(actionId, monitorState.selectedActionId); 254 | selectedActionId = Math.max(actionId, monitorState.selectedActionId); 255 | } 256 | } else { 257 | startActionId = null; 258 | if (actionId === monitorState.selectedActionId || monitorState.startActionId !== null) { 259 | selectedActionId = null; 260 | } else { 261 | selectedActionId = actionId; 262 | } 263 | } 264 | 265 | this.updateMonitorState({ startActionId, selectedActionId }); 266 | }; 267 | 268 | handleInspectPath = (pathType: string, path: string[]) => { 269 | this.updateMonitorState({ [pathType]: path }); 270 | }; 271 | 272 | handleSelectTab = (tabName: TabName) => { 273 | this.updateMonitorState({ tabName }); 274 | }; 275 | } 276 | -------------------------------------------------------------------------------- /flow-typed/npm/react-base16-styling_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: bd08bde662b8371729bea6195ac549b1 2 | // flow-typed version: <>/react-base16-styling_v^0.4.1/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'react-base16-styling' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'react-base16-styling' { 17 | // based on https://github.com/facebook/flow/blob/v0.35.0/lib/cssom.js 18 | declare type Style = { 19 | alignContent?: string, 20 | alignItems?: string, 21 | alignSelf?: string, 22 | all?: string, 23 | animation?: string, 24 | animationDelay?: string, 25 | animationDirection?: string, 26 | animationDuration?: string, 27 | animationFillMode?: string, 28 | animationIterationCount?: string, 29 | animationName?: string, 30 | animationPlayState?: string, 31 | animationTimingFunction?: string, 32 | backfaceVisibility?: string, 33 | background?: string, 34 | backgroundAttachment?: string, 35 | backgroundBlendMode?: string, 36 | backgroundClip?: string, 37 | backgroundColor?: string, 38 | backgroundImage?: string, 39 | backgroundOrigin?: string, 40 | backgroundPosition?: string, 41 | backgroundRepeat?: string, 42 | backgroundSize?: string, 43 | blockSize?: string, 44 | border?: string, 45 | borderBlockEnd?: string, 46 | borderBlockEndColor?: string, 47 | borderBlockEndStyle?: string, 48 | borderBlockEndWidth?: string, 49 | borderBlockStart?: string, 50 | borderBlockStartColor?: string, 51 | borderBlockStartStyle?: string, 52 | borderBlockStartWidth?: string, 53 | borderBottom?: string, 54 | borderBottomColor?: string, 55 | borderBottomLeftRadius?: string, 56 | borderBottomRightRadius?: string, 57 | borderBottomStyle?: string, 58 | borderBottomWidth?: string, 59 | borderCollapse?: string, 60 | borderColor?: string, 61 | borderImage?: string, 62 | borderImageOutset?: string, 63 | borderImageRepeat?: string, 64 | borderImageSlice?: string, 65 | borderImageSource?: string, 66 | borderImageWidth?: string, 67 | borderInlineEnd?: string, 68 | borderInlineEndColor?: string, 69 | borderInlineEndStyle?: string, 70 | borderInlineEndWidth?: string, 71 | borderInlineStart?: string, 72 | borderInlineStartColor?: string, 73 | borderInlineStartStyle?: string, 74 | borderInlineStartWidth?: string, 75 | borderLeft?: string, 76 | borderLeftColor?: string, 77 | borderLeftStyle?: string, 78 | borderLeftWidth?: string, 79 | borderRadius?: string, 80 | borderRight?: string, 81 | borderRightColor?: string, 82 | borderRightStyle?: string, 83 | borderRightWidth?: string, 84 | borderSpacing?: string, 85 | borderStyle?: string, 86 | borderTop?: string, 87 | borderTopColor?: string, 88 | borderTopLeftRadius?: string, 89 | borderTopRightRadius?: string, 90 | borderTopStyle?: string, 91 | borderTopWidth?: string, 92 | borderWidth?: string, 93 | bottom?: string, 94 | boxDecorationBreak?: string, 95 | boxShadow?: string, 96 | boxSizing?: string, 97 | breakAfter?: string, 98 | breakBefore?: string, 99 | breakInside?: string, 100 | captionSide?: string, 101 | clear?: string, 102 | clip?: string, 103 | clipPath?: string, 104 | color?: string, 105 | columns?: string, 106 | columnCount?: string, 107 | columnFill?: string, 108 | columnGap?: string, 109 | columnRule?: string, 110 | columnRuleColor?: string, 111 | columnRuleStyle?: string, 112 | columnRuleWidth?: string, 113 | columnSpan?: string, 114 | columnWidth?: string, 115 | content?: string, 116 | counterIncrement?: string, 117 | counterReset?: string, 118 | cursor?: string, 119 | direction?: string, 120 | display?: string, 121 | emptyCells?: string, 122 | filter?: string, 123 | flex?: string, 124 | flexBasis?: string, 125 | flexDirection?: string, 126 | flexFlow?: string, 127 | flexGrow?: string, 128 | flexShrink?: string, 129 | flexWrap?: string, 130 | float?: string, 131 | font?: string, 132 | fontFamily?: string, 133 | fontFeatureSettings?: string, 134 | fontKerning?: string, 135 | fontLanguageOverride?: string, 136 | fontSize?: string, 137 | fontSizeAdjust?: string, 138 | fontStretch?: string, 139 | fontStyle?: string, 140 | fontSynthesis?: string, 141 | fontVariant?: string, 142 | fontVariantAlternates?: string, 143 | fontVariantCaps?: string, 144 | fontVariantEastAsian?: string, 145 | fontVariantLigatures?: string, 146 | fontVariantNumeric?: string, 147 | fontVariantPosition?: string, 148 | fontWeight?: string, 149 | grad?: string, 150 | grid?: string, 151 | gridArea?: string, 152 | gridAutoColumns?: string, 153 | gridAutoFlow?: string, 154 | gridAutoPosition?: string, 155 | gridAutoRows?: string, 156 | gridColumn?: string, 157 | gridColumnStart?: string, 158 | gridColumnEnd?: string, 159 | gridRow?: string, 160 | gridRowStart?: string, 161 | gridRowEnd?: string, 162 | gridTemplate?: string, 163 | gridTemplateAreas?: string, 164 | gridTemplateRows?: string, 165 | gridTemplateColumns?: string, 166 | height?: string, 167 | hyphens?: string, 168 | imageRendering?: string, 169 | imageResolution?: string, 170 | imageOrientation?: string, 171 | imeMode?: string, 172 | inherit?: string, 173 | initial?: string, 174 | inlineSize?: string, 175 | isolation?: string, 176 | justifyContent?: string, 177 | left?: string, 178 | letterSpacing?: string, 179 | lineBreak?: string, 180 | lineHeight?: string, 181 | listStyle?: string, 182 | listStyleImage?: string, 183 | listStylePosition?: string, 184 | listStyleType?: string, 185 | margin?: string, 186 | marginBlockEnd?: string, 187 | marginBlockStart?: string, 188 | marginBottom?: string, 189 | marginInlineEnd?: string, 190 | marginInlineStart?: string, 191 | marginLeft?: string, 192 | marginRight?: string, 193 | marginTop?: string, 194 | marks?: string, 195 | mask?: string, 196 | maskType?: string, 197 | maxBlockSize?: string, 198 | maxHeight?: string, 199 | maxInlineSize?: string, 200 | maxWidth?: string, 201 | minBlockSize?: string, 202 | minHeight?: string, 203 | minInlineSize?: string, 204 | minWidth?: string, 205 | mixBlendMode?: string, 206 | objectFit?: string, 207 | objectPosition?: string, 208 | offsetBlockEnd?: string, 209 | offsetBlockStart?: string, 210 | offsetInlineEnd?: string, 211 | offsetInlineStart?: string, 212 | opacity?: string, 213 | order?: string, 214 | orphans?: string, 215 | outline?: string, 216 | outlineColor?: string, 217 | outlineOffset?: string, 218 | outlineStyle?: string, 219 | outlineWidth?: string, 220 | overflow?: string, 221 | overflowWrap?: string, 222 | overflowX?: string, 223 | overflowY?: string, 224 | padding?: string, 225 | paddingBlockEnd?: string, 226 | paddingBlockStart?: string, 227 | paddingBottom?: string, 228 | paddingInlineEnd?: string, 229 | paddingInlineStart?: string, 230 | paddingLeft?: string, 231 | paddingRight?: string, 232 | paddingTop?: string, 233 | pageBreakAfter?: string, 234 | pageBreakBefore?: string, 235 | pageBreakInside?: string, 236 | perspective?: string, 237 | perspectiveOrigin?: string, 238 | pointerEvents?: string, 239 | position?: string, 240 | quotes?: string, 241 | rad?: string, 242 | resize?: string, 243 | right?: string, 244 | rubyAlign?: string, 245 | rubyMerge?: string, 246 | rubyPosition?: string, 247 | scrollBehavior?: string, 248 | scrollSnapCoordinate?: string, 249 | scrollSnapDestination?: string, 250 | scrollSnapPointsX?: string, 251 | scrollSnapPointsY?: string, 252 | scrollSnapType?: string, 253 | shapeImageThreshold?: string, 254 | shapeMargin?: string, 255 | shapeOutside?: string, 256 | tableLayout?: string, 257 | tabSize?: string, 258 | textAlign?: string, 259 | textAlignLast?: string, 260 | textCombineUpright?: string, 261 | textDecoration?: string, 262 | textDecorationColor?: string, 263 | textDecorationLine?: string, 264 | textDecorationStyle?: string, 265 | textIndent?: string, 266 | textOrientation?: string, 267 | textOverflow?: string, 268 | textRendering?: string, 269 | textShadow?: string, 270 | textTransform?: string, 271 | textUnderlinePosition?: string, 272 | top?: string, 273 | touchAction?: string, 274 | transform?: string, 275 | transformOrigin?: string, 276 | transformStyle?: string, 277 | transition?: string, 278 | transitionDelay?: string, 279 | transitionDuration?: string, 280 | transitionProperty?: string, 281 | transitionTimingFunction?: string, 282 | turn?: string, 283 | unicodeBidi?: string, 284 | unicodeRange?: string, 285 | verticalAlign?: string, 286 | visibility?: string, 287 | webkitTransform?: string, 288 | whiteSpace?: string, 289 | widows?: string, 290 | width?: string, 291 | willChange?: string, 292 | wordBreak?: string, 293 | wordSpacing?: string, 294 | wordWrap?: string, 295 | writingMode?: string, 296 | zIndex?: string 297 | }; 298 | 299 | declare type Styling = { 300 | style?: Style, 301 | className?: string 302 | }; 303 | 304 | declare type Base16Theme = { 305 | base00: string, 306 | base01: string, 307 | base02: string, 308 | base03: string, 309 | base04: string, 310 | base05: string, 311 | base06: string, 312 | base07: string, 313 | base08: string, 314 | base09: string, 315 | base0A: string, 316 | base0B: string, 317 | base0C: string, 318 | base0D: string, 319 | base0E: string, 320 | base0F: string 321 | }; 322 | 323 | declare type StylingValue = 324 | string | Style | ((styling: Styling, ...rest: Array) => Styling); 325 | 326 | declare type StylingConfig = { 327 | extend?: string | Base16Theme, 328 | [name: string]: StylingValue 329 | }; 330 | 331 | declare type Theme = string | Base16Theme | StylingConfig; 332 | 333 | declare type StylingFunction = ( 334 | keys: string | Array, ...rest: Array 335 | ) => Styling; 336 | 337 | declare function createStyling( 338 | getDefaultStyling: (base16Theme: Base16Theme) => StylingConfig, 339 | options?: { 340 | defaultBase16?: Theme, 341 | base16Themes: Theme[] 342 | } 343 | ): ((theme: Theme, invertTheme: boolean) => StylingFunction); 344 | 345 | declare function createStyling( 346 | getDefaultStyling: (base16Theme: Base16Theme) => StylingConfig, 347 | options?: { 348 | defaultBase16?: Theme, 349 | base16Themes: Theme[] 350 | }, 351 | theme: Theme, 352 | invertTheme: boolean 353 | ): StylingFunction; 354 | 355 | declare function getBase16Theme(theme: Theme, base16Themes: Base16Theme[]): Base16Theme; 356 | } 357 | -------------------------------------------------------------------------------- /flow-typed/npm/jsondiffpatch_vx.x.x.js: -------------------------------------------------------------------------------- 1 | // flow-typed signature: f27846699bffa89d33727ebee9c58ab4 2 | // flow-typed version: <>/jsondiffpatch_v^0.2.4/flow_v0.38.0 3 | 4 | /** 5 | * This is an autogenerated libdef stub for: 6 | * 7 | * 'jsondiffpatch' 8 | * 9 | * Fill this stub out by replacing all the `any` types. 10 | * 11 | * Once filled out, we encourage you to share your work with the 12 | * community by sending a pull request to: 13 | * https://github.com/flowtype/flow-typed 14 | */ 15 | 16 | declare module 'jsondiffpatch' { 17 | declare type Diff = [any] | [any, any] | [any, number, number]; 18 | 19 | declare type ObjectDelta = { 20 | [key: string]: Diff 21 | }; 22 | 23 | declare type ArrayDelta = { 24 | _t: 'a', 25 | [key: string]: Diff 26 | }; 27 | 28 | declare type Delta = { 29 | [key: string]: Delta 30 | } | ObjectDelta | ArrayDelta; 31 | 32 | declare type JsonDiffPatcher = { 33 | dateReviver: any, 34 | diff: (left: Object, right: Object) => Delta, 35 | patch: (obj: Object, delta: Delta) => Object, 36 | reverse: (delta: Delta) => Delta 37 | }; 38 | 39 | declare type DiffContext = { 40 | left: Object, 41 | right: Object 42 | }; 43 | 44 | declare type ObjectHash = (obj: Object, idx: number) => any; 45 | 46 | declare type PropertyFilter = (name: string, context: DiffContext) => boolean; 47 | 48 | declare type Options = { 49 | objectHash?: ObjectHash, 50 | arrays?: { 51 | detectMove?: boolean, 52 | includeValueOnMove?: boolean 53 | }, 54 | textDiff?: { 55 | minLength: number 56 | }, 57 | propertyFilter?: PropertyFilter, 58 | cloneDiffValues?: boolean 59 | }; 60 | 61 | declare module.exports: { 62 | create: (options: Options) => JsonDiffPatcher 63 | }; 64 | } 65 | 66 | /** 67 | * We include stubs for each file inside this npm package in case you need to 68 | * require those files directly. Feel free to delete any files that aren't 69 | * needed. 70 | */ 71 | declare module 'jsondiffpatch/gulp-tasks/fiberglass' { 72 | declare module.exports: any; 73 | } 74 | 75 | declare module 'jsondiffpatch/gulpfile' { 76 | declare module.exports: any; 77 | } 78 | 79 | declare module 'jsondiffpatch/karma.conf' { 80 | declare module.exports: any; 81 | } 82 | 83 | declare module 'jsondiffpatch/public/build/jsondiffpatch-formatters' { 84 | declare module.exports: any; 85 | } 86 | 87 | declare module 'jsondiffpatch/public/build/jsondiffpatch-formatters.min' { 88 | declare module.exports: any; 89 | } 90 | 91 | declare module 'jsondiffpatch/public/build/jsondiffpatch-full' { 92 | declare module.exports: any; 93 | } 94 | 95 | declare module 'jsondiffpatch/public/build/jsondiffpatch-full.min' { 96 | declare module.exports: any; 97 | } 98 | 99 | declare module 'jsondiffpatch/public/build/jsondiffpatch' { 100 | declare module.exports: any; 101 | } 102 | 103 | declare module 'jsondiffpatch/public/build/jsondiffpatch.min' { 104 | declare module.exports: any; 105 | } 106 | 107 | declare module 'jsondiffpatch/public/build/test-bundle' { 108 | declare module.exports: any; 109 | } 110 | 111 | declare module 'jsondiffpatch/public/demo/consoledemo' { 112 | declare module.exports: any; 113 | } 114 | 115 | declare module 'jsondiffpatch/public/demo/demo' { 116 | declare module.exports: any; 117 | } 118 | 119 | declare module 'jsondiffpatch/public/demo/numeric-plugin' { 120 | declare module.exports: any; 121 | } 122 | 123 | declare module 'jsondiffpatch/public/external/diff_match_patch_uncompressed' { 124 | declare module.exports: any; 125 | } 126 | 127 | declare module 'jsondiffpatch/src/clone' { 128 | declare module.exports: any; 129 | } 130 | 131 | declare module 'jsondiffpatch/src/contexts/context' { 132 | declare module.exports: any; 133 | } 134 | 135 | declare module 'jsondiffpatch/src/contexts/diff' { 136 | declare module.exports: any; 137 | } 138 | 139 | declare module 'jsondiffpatch/src/contexts/patch' { 140 | declare module.exports: any; 141 | } 142 | 143 | declare module 'jsondiffpatch/src/contexts/reverse' { 144 | declare module.exports: any; 145 | } 146 | 147 | declare module 'jsondiffpatch/src/date-reviver' { 148 | declare module.exports: any; 149 | } 150 | 151 | declare module 'jsondiffpatch/src/diffpatcher' { 152 | declare module.exports: any; 153 | } 154 | 155 | declare module 'jsondiffpatch/src/environment' { 156 | declare module.exports: any; 157 | } 158 | 159 | declare module 'jsondiffpatch/src/filters/arrays' { 160 | declare module.exports: any; 161 | } 162 | 163 | declare module 'jsondiffpatch/src/filters/dates' { 164 | declare module.exports: any; 165 | } 166 | 167 | declare module 'jsondiffpatch/src/filters/lcs' { 168 | declare module.exports: any; 169 | } 170 | 171 | declare module 'jsondiffpatch/src/filters/nested' { 172 | declare module.exports: any; 173 | } 174 | 175 | declare module 'jsondiffpatch/src/filters/texts' { 176 | declare module.exports: any; 177 | } 178 | 179 | declare module 'jsondiffpatch/src/filters/trivial' { 180 | declare module.exports: any; 181 | } 182 | 183 | declare module 'jsondiffpatch/src/formatters/annotated' { 184 | declare module.exports: any; 185 | } 186 | 187 | declare module 'jsondiffpatch/src/formatters/base' { 188 | declare module.exports: any; 189 | } 190 | 191 | declare module 'jsondiffpatch/src/formatters/console' { 192 | declare module.exports: any; 193 | } 194 | 195 | declare module 'jsondiffpatch/src/formatters/html' { 196 | declare module.exports: any; 197 | } 198 | 199 | declare module 'jsondiffpatch/src/formatters/index' { 200 | declare module.exports: any; 201 | } 202 | 203 | declare module 'jsondiffpatch/src/formatters/jsonpatch' { 204 | declare module.exports: any; 205 | } 206 | 207 | declare module 'jsondiffpatch/src/main-formatters' { 208 | declare module.exports: any; 209 | } 210 | 211 | declare module 'jsondiffpatch/src/main-full' { 212 | declare module.exports: any; 213 | } 214 | 215 | declare module 'jsondiffpatch/src/main' { 216 | declare module.exports: any; 217 | } 218 | 219 | declare module 'jsondiffpatch/src/pipe' { 220 | declare module.exports: any; 221 | } 222 | 223 | declare module 'jsondiffpatch/src/processor' { 224 | declare module.exports: any; 225 | } 226 | 227 | declare module 'jsondiffpatch/test/examples/diffpatch' { 228 | declare module.exports: any; 229 | } 230 | 231 | declare module 'jsondiffpatch/test/index' { 232 | declare module.exports: any; 233 | } 234 | 235 | declare module 'jsondiffpatch/test/util/globals' { 236 | declare module.exports: any; 237 | } 238 | 239 | // Filename aliases 240 | declare module 'jsondiffpatch/gulp-tasks/fiberglass.js' { 241 | declare module.exports: $Exports<'jsondiffpatch/gulp-tasks/fiberglass'>; 242 | } 243 | declare module 'jsondiffpatch/gulpfile.js' { 244 | declare module.exports: $Exports<'jsondiffpatch/gulpfile'>; 245 | } 246 | declare module 'jsondiffpatch/karma.conf.js' { 247 | declare module.exports: $Exports<'jsondiffpatch/karma.conf'>; 248 | } 249 | declare module 'jsondiffpatch/public/build/jsondiffpatch-formatters.js' { 250 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch-formatters'>; 251 | } 252 | declare module 'jsondiffpatch/public/build/jsondiffpatch-formatters.min.js' { 253 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch-formatters.min'>; 254 | } 255 | declare module 'jsondiffpatch/public/build/jsondiffpatch-full.js' { 256 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch-full'>; 257 | } 258 | declare module 'jsondiffpatch/public/build/jsondiffpatch-full.min.js' { 259 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch-full.min'>; 260 | } 261 | declare module 'jsondiffpatch/public/build/jsondiffpatch.js' { 262 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch'>; 263 | } 264 | declare module 'jsondiffpatch/public/build/jsondiffpatch.min.js' { 265 | declare module.exports: $Exports<'jsondiffpatch/public/build/jsondiffpatch.min'>; 266 | } 267 | declare module 'jsondiffpatch/public/build/test-bundle.js' { 268 | declare module.exports: $Exports<'jsondiffpatch/public/build/test-bundle'>; 269 | } 270 | declare module 'jsondiffpatch/public/demo/consoledemo.js' { 271 | declare module.exports: $Exports<'jsondiffpatch/public/demo/consoledemo'>; 272 | } 273 | declare module 'jsondiffpatch/public/demo/demo.js' { 274 | declare module.exports: $Exports<'jsondiffpatch/public/demo/demo'>; 275 | } 276 | declare module 'jsondiffpatch/public/demo/numeric-plugin.js' { 277 | declare module.exports: $Exports<'jsondiffpatch/public/demo/numeric-plugin'>; 278 | } 279 | declare module 'jsondiffpatch/public/external/diff_match_patch_uncompressed.js' { 280 | declare module.exports: $Exports<'jsondiffpatch/public/external/diff_match_patch_uncompressed'>; 281 | } 282 | declare module 'jsondiffpatch/src/clone.js' { 283 | declare module.exports: $Exports<'jsondiffpatch/src/clone'>; 284 | } 285 | declare module 'jsondiffpatch/src/contexts/context.js' { 286 | declare module.exports: $Exports<'jsondiffpatch/src/contexts/context'>; 287 | } 288 | declare module 'jsondiffpatch/src/contexts/diff.js' { 289 | declare module.exports: $Exports<'jsondiffpatch/src/contexts/diff'>; 290 | } 291 | declare module 'jsondiffpatch/src/contexts/patch.js' { 292 | declare module.exports: $Exports<'jsondiffpatch/src/contexts/patch'>; 293 | } 294 | declare module 'jsondiffpatch/src/contexts/reverse.js' { 295 | declare module.exports: $Exports<'jsondiffpatch/src/contexts/reverse'>; 296 | } 297 | declare module 'jsondiffpatch/src/date-reviver.js' { 298 | declare module.exports: $Exports<'jsondiffpatch/src/date-reviver'>; 299 | } 300 | declare module 'jsondiffpatch/src/diffpatcher.js' { 301 | declare module.exports: $Exports<'jsondiffpatch/src/diffpatcher'>; 302 | } 303 | declare module 'jsondiffpatch/src/environment.js' { 304 | declare module.exports: $Exports<'jsondiffpatch/src/environment'>; 305 | } 306 | declare module 'jsondiffpatch/src/filters/arrays.js' { 307 | declare module.exports: $Exports<'jsondiffpatch/src/filters/arrays'>; 308 | } 309 | declare module 'jsondiffpatch/src/filters/dates.js' { 310 | declare module.exports: $Exports<'jsondiffpatch/src/filters/dates'>; 311 | } 312 | declare module 'jsondiffpatch/src/filters/lcs.js' { 313 | declare module.exports: $Exports<'jsondiffpatch/src/filters/lcs'>; 314 | } 315 | declare module 'jsondiffpatch/src/filters/nested.js' { 316 | declare module.exports: $Exports<'jsondiffpatch/src/filters/nested'>; 317 | } 318 | declare module 'jsondiffpatch/src/filters/texts.js' { 319 | declare module.exports: $Exports<'jsondiffpatch/src/filters/texts'>; 320 | } 321 | declare module 'jsondiffpatch/src/filters/trivial.js' { 322 | declare module.exports: $Exports<'jsondiffpatch/src/filters/trivial'>; 323 | } 324 | declare module 'jsondiffpatch/src/formatters/annotated.js' { 325 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/annotated'>; 326 | } 327 | declare module 'jsondiffpatch/src/formatters/base.js' { 328 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/base'>; 329 | } 330 | declare module 'jsondiffpatch/src/formatters/console.js' { 331 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/console'>; 332 | } 333 | declare module 'jsondiffpatch/src/formatters/html.js' { 334 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/html'>; 335 | } 336 | declare module 'jsondiffpatch/src/formatters/index.js' { 337 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/index'>; 338 | } 339 | declare module 'jsondiffpatch/src/formatters/jsonpatch.js' { 340 | declare module.exports: $Exports<'jsondiffpatch/src/formatters/jsonpatch'>; 341 | } 342 | declare module 'jsondiffpatch/src/main-formatters.js' { 343 | declare module.exports: $Exports<'jsondiffpatch/src/main-formatters'>; 344 | } 345 | declare module 'jsondiffpatch/src/main-full.js' { 346 | declare module.exports: $Exports<'jsondiffpatch/src/main-full'>; 347 | } 348 | declare module 'jsondiffpatch/src/main.js' { 349 | declare module.exports: $Exports<'jsondiffpatch/src/main'>; 350 | } 351 | declare module 'jsondiffpatch/src/pipe.js' { 352 | declare module.exports: $Exports<'jsondiffpatch/src/pipe'>; 353 | } 354 | declare module 'jsondiffpatch/src/processor.js' { 355 | declare module.exports: $Exports<'jsondiffpatch/src/processor'>; 356 | } 357 | declare module 'jsondiffpatch/test/examples/diffpatch.js' { 358 | declare module.exports: $Exports<'jsondiffpatch/test/examples/diffpatch'>; 359 | } 360 | declare module 'jsondiffpatch/test/index.js' { 361 | declare module.exports: $Exports<'jsondiffpatch/test/index'>; 362 | } 363 | declare module 'jsondiffpatch/test/util/globals.js' { 364 | declare module.exports: $Exports<'jsondiffpatch/test/util/globals'>; 365 | } 366 | --------------------------------------------------------------------------------
86 | 87 | {pkg.name || Package Name} 88 | 89 |
{pkg.description || Package Description}
90 |
117 |
118 |
119 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 161 | 164 | 167 | 170 |
171 |
172 | 182 |