redux-connected-devtools 0.0.13 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +2 -0
- package/.prettierrc.js +10 -0
- package/.vscode/settings.json +12 -0
- package/.vscode/tasks.json +33 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/index.html +58 -0
- package/jest.config.js +8 -0
- package/package.json +47 -62
- package/public/devtools.html +8 -0
- package/public/icon.png +0 -0
- package/public/manifest.json +29 -0
- package/public/options.html +12 -0
- package/public/panel.html +39 -0
- package/public/popup.html +12 -0
- package/src/__tests__/sum.ts +9 -0
- package/src/background.ts +49 -0
- package/src/components/DevInspector/DevInspector.scss +2 -0
- package/src/components/DevInspector/DevInspector.style.tsx +8 -0
- package/src/components/DevInspector/DevInspector.tsx +34 -0
- package/src/components/DevList/DevList.scss +2 -0
- package/src/components/DevList/DevList.style.tsx +34 -0
- package/src/components/DevList/DevList.tsx +62 -0
- package/src/components/DevMenu/DevMenu.scss +2 -0
- package/src/components/DevMenu/DevMenu.style.tsx +53 -0
- package/src/components/DevMenu/DevMenu.tsx +76 -0
- package/src/components/DevPanel/DevPanel.scss +2 -0
- package/src/components/DevPanel/DevPanel.style.tsx +16 -0
- package/src/components/DevPanel/DevPanel.tsx +51 -0
- package/src/components/JourneyRow/JourneyRow.scss +2 -0
- package/src/components/JourneyRow/JourneyRow.style.tsx +46 -0
- package/src/components/JourneyRow/JourneyRow.tsx +58 -0
- package/src/components/JsonViewer/JsonViewer.scss +2 -0
- package/src/components/JsonViewer/JsonViewer.style.tsx +31 -0
- package/src/components/JsonViewer/JsonViewer.tsx +24 -0
- package/src/components/Lifecycle/Lifecycle.scss +2 -0
- package/src/components/Lifecycle/Lifecycle.style.tsx +6 -0
- package/src/components/Lifecycle/Lifecycle.tsx +31 -0
- package/src/components/LogsViewer/LogsViewer.scss +2 -0
- package/src/components/LogsViewer/LogsViewer.style.tsx +5 -0
- package/src/components/LogsViewer/LogsViewer.tsx +14 -0
- package/src/components/RequestDetails/RequestDetails.scss +2 -0
- package/src/components/RequestDetails/RequestDetails.style.tsx +20 -0
- package/src/components/RequestDetails/RequestDetails.tsx +60 -0
- package/src/components/RequestJourney/RequestJourney.scss +2 -0
- package/src/components/RequestJourney/RequestJourney.style.tsx +6 -0
- package/src/components/RequestJourney/RequestJourney.tsx +33 -0
- package/src/components/RequestRow/RequestRow.scss +2 -0
- package/src/components/RequestRow/RequestRow.style.tsx +31 -0
- package/src/components/RequestRow/RequestRow.tsx +37 -0
- package/src/components/Time/Time.scss +2 -0
- package/src/components/Time/Time.style.tsx +17 -0
- package/src/components/Time/Time.tsx +25 -0
- package/src/containers/DevMenuContainer.tsx +28 -0
- package/src/containers/DevPanelContainer.tsx +10 -0
- package/src/containers/EndpointConfigsContainer.tsx +12 -0
- package/src/containers/EndpointStatusContainer.tsx +12 -0
- package/src/containers/GlobalSettingsContainer.tsx +12 -0
- package/src/containers/GlobalStatsContainer.tsx +12 -0
- package/src/containers/LifecycleApiErrorContainer.tsx +11 -0
- package/src/containers/LifecycleGeneralErrorContainer.tsx +11 -0
- package/src/containers/LifecycleInQueueContainer.tsx +11 -0
- package/src/containers/LifecyclePendingApiContainer.tsx +11 -0
- package/src/containers/LifecyclePostActionContainer.tsx +11 -0
- package/src/containers/LifecycleReceivedContainer.tsx +11 -0
- package/src/content_script.ts +19 -0
- package/src/data/devComponents.tsx +25 -0
- package/src/data/devRoutes.ts +83 -0
- package/src/devtools.tsx +29 -0
- package/src/index.ts +1 -0
- package/src/injected_script.ts +9 -0
- package/src/options.tsx +77 -0
- package/src/panel.tsx +30 -0
- package/src/popup.tsx +63 -0
- package/src/store/initialState.ts +42 -0
- package/src/store/selectors.ts +205 -0
- package/src/sum.ts +3 -0
- package/src/types.ts +1 -0
- package/src/utils/date.ts +3 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +45 -0
- package/webpack/webpack.common.js +46 -0
- package/webpack/webpack.dev.js +7 -0
- package/webpack/webpack.prod.js +6 -0
- package/esm/components/Config/Config.d.ts +0 -6
- package/esm/components/Config/Config.js +0 -15
- package/esm/components/DevTools/DevTools.d.ts +0 -4
- package/esm/components/DevTools/DevTools.js +0 -19
- package/esm/components/Dispatcher/Dispatcher.d.ts +0 -8
- package/esm/components/Dispatcher/Dispatcher.js +0 -62
- package/esm/components/GlobalSettings/GlobalSettings.d.ts +0 -6
- package/esm/components/GlobalSettings/GlobalSettings.js +0 -16
- package/esm/components/Group/Group.d.ts +0 -9
- package/esm/components/Group/Group.js +0 -14
- package/esm/components/Json/Json.d.ts +0 -7
- package/esm/components/Json/Json.js +0 -9
- package/esm/components/Logs/Logs.d.ts +0 -6
- package/esm/components/Logs/Logs.js +0 -49
- package/esm/components/Monitor/Monitor.d.ts +0 -6
- package/esm/components/Monitor/Monitor.js +0 -52
- package/esm/components/OverlayManager/OverlayManager.d.ts +0 -6
- package/esm/components/OverlayManager/OverlayManager.js +0 -17
- package/esm/components/Panel/Panel.d.ts +0 -14
- package/esm/components/Panel/Panel.js +0 -46
- package/esm/components/Preview/Preview.d.ts +0 -19
- package/esm/components/Preview/Preview.js +0 -58
- package/esm/components/Redux/Redux.d.ts +0 -6
- package/esm/components/Redux/Redux.js +0 -72
- package/esm/components/ReduxSettings/ReduxSettings.d.ts +0 -9
- package/esm/components/ReduxSettings/ReduxSettings.js +0 -60
- package/esm/components/Requests/Requests.d.ts +0 -6
- package/esm/components/Requests/Requests.js +0 -61
- package/esm/components/Status/Status.d.ts +0 -6
- package/esm/components/Status/Status.js +0 -16
- package/esm/components/TaskManager/TaskManager.d.ts +0 -9
- package/esm/components/TaskManager/TaskManager.js +0 -22
- package/esm/components/Toggle/Toggle.d.ts +0 -9
- package/esm/components/Toggle/Toggle.js +0 -8
- package/esm/components/VirtualList/VirtualList.d.ts +0 -19
- package/esm/components/VirtualList/VirtualList.js +0 -30
- package/esm/components/Visual/Visual.d.ts +0 -6
- package/esm/components/Visual/Visual.js +0 -38
- package/esm/components/prefix.d.ts +0 -2
- package/esm/components/prefix.js +0 -2
- package/esm/data/boxSizes.d.ts +0 -2
- package/esm/data/boxSizes.js +0 -10
- package/esm/data/dispatcherActions.d.ts +0 -5
- package/esm/data/dispatcherActions.js +0 -35
- package/esm/data/panels.d.ts +0 -2
- package/esm/data/panels.js +0 -74
- package/esm/data/panelsArrangements.d.ts +0 -19
- package/esm/data/panelsArrangements.js +0 -19
- package/esm/data/reduxFilterOptions.d.ts +0 -20
- package/esm/data/reduxFilterOptions.js +0 -223
- package/esm/data/widgets.d.ts +0 -2
- package/esm/data/widgets.js +0 -85
- package/esm/hooks/index.d.ts +0 -7
- package/esm/hooks/index.js +0 -7
- package/esm/hooks/misc/hookState.d.ts +0 -8
- package/esm/hooks/misc/hookState.js +0 -6
- package/esm/hooks/misc/util.d.ts +0 -5
- package/esm/hooks/misc/util.js +0 -21
- package/esm/hooks/useBoolean.d.ts +0 -3
- package/esm/hooks/useBoolean.js +0 -3
- package/esm/hooks/useClickAway.d.ts +0 -3
- package/esm/hooks/useClickAway.js +0 -27
- package/esm/hooks/useEvent.d.ts +0 -13
- package/esm/hooks/useEvent.js +0 -35
- package/esm/hooks/useKey.d.ts +0 -12
- package/esm/hooks/useKey.js +0 -29
- package/esm/hooks/useList.d.ts +0 -57
- package/esm/hooks/useList.js +0 -74
- package/esm/hooks/useLocalstorage.d.ts +0 -10
- package/esm/hooks/useLocalstorage.js +0 -75
- package/esm/hooks/usePanels.d.ts +0 -10
- package/esm/hooks/usePanels.js +0 -43
- package/esm/hooks/useSetState.d.ts +0 -2
- package/esm/hooks/useSetState.js +0 -10
- package/esm/hooks/useToggle.d.ts +0 -2
- package/esm/hooks/useToggle.js +0 -6
- package/esm/hooks/useUpdate.d.ts +0 -1
- package/esm/hooks/useUpdate.js +0 -6
- package/esm/index.d.ts +0 -3
- package/esm/index.js +0 -3
- package/esm/selectors/selectors.d.ts +0 -21
- package/esm/selectors/selectors.js +0 -20
- package/esm/theme/devtoolsTheme.d.ts +0 -2
- package/esm/theme/devtoolsTheme.js +0 -95
- package/esm/utils/filter.d.ts +0 -3
- package/esm/utils/filter.js +0 -25
- package/esm/utils/localStorage.d.ts +0 -2
- package/esm/utils/localStorage.js +0 -21
- package/lib/components/Colors copy.css +0 -3
- package/lib/components/Colors copy.css.map +0 -1
- package/lib/components/Colors.css +0 -3
- package/lib/components/Colors.css.map +0 -1
- package/lib/components/ColorsDark.css +0 -3
- package/lib/components/ColorsDark.css.map +0 -1
- package/lib/components/Config/Config.css +0 -15
- package/lib/components/Config/Config.css.map +0 -1
- package/lib/components/Config/Config.d.ts +0 -6
- package/lib/components/Config/Config.js +0 -20
- package/lib/components/DevTools/DevTools.css +0 -3
- package/lib/components/DevTools/DevTools.css.map +0 -1
- package/lib/components/DevTools/DevTools.d.ts +0 -4
- package/lib/components/DevTools/DevTools.js +0 -24
- package/lib/components/Dispatcher/Dispatcher.css +0 -15
- package/lib/components/Dispatcher/Dispatcher.css.map +0 -1
- package/lib/components/Dispatcher/Dispatcher.d.ts +0 -8
- package/lib/components/Dispatcher/Dispatcher.js +0 -66
- package/lib/components/GlobalSettings/GlobalSettings.css +0 -3
- package/lib/components/GlobalSettings/GlobalSettings.css.map +0 -1
- package/lib/components/GlobalSettings/GlobalSettings.d.ts +0 -6
- package/lib/components/GlobalSettings/GlobalSettings.js +0 -21
- package/lib/components/Group/Group.css +0 -41
- package/lib/components/Group/Group.css.map +0 -1
- package/lib/components/Group/Group.d.ts +0 -9
- package/lib/components/Group/Group.js +0 -19
- package/lib/components/Json/Json.css +0 -3
- package/lib/components/Json/Json.css.map +0 -1
- package/lib/components/Json/Json.d.ts +0 -7
- package/lib/components/Json/Json.js +0 -14
- package/lib/components/Logs/Logs.css +0 -3
- package/lib/components/Logs/Logs.css.map +0 -1
- package/lib/components/Logs/Logs.d.ts +0 -6
- package/lib/components/Logs/Logs.js +0 -54
- package/lib/components/Monitor/Monitor.css +0 -3
- package/lib/components/Monitor/Monitor.css.map +0 -1
- package/lib/components/Monitor/Monitor.d.ts +0 -6
- package/lib/components/Monitor/Monitor.js +0 -57
- package/lib/components/OverlayManager/OverlayManager.css +0 -72
- package/lib/components/OverlayManager/OverlayManager.css.map +0 -1
- package/lib/components/OverlayManager/OverlayManager.d.ts +0 -6
- package/lib/components/OverlayManager/OverlayManager.js +0 -22
- package/lib/components/Panel/Panel.css +0 -35
- package/lib/components/Panel/Panel.css.map +0 -1
- package/lib/components/Panel/Panel.d.ts +0 -14
- package/lib/components/Panel/Panel.js +0 -51
- package/lib/components/Prefix copy.css +0 -3
- package/lib/components/Prefix copy.css.map +0 -1
- package/lib/components/Prefix.css +0 -3
- package/lib/components/Prefix.css.map +0 -1
- package/lib/components/Preview/Preview.css +0 -29
- package/lib/components/Preview/Preview.css.map +0 -1
- package/lib/components/Preview/Preview.d.ts +0 -19
- package/lib/components/Preview/Preview.js +0 -64
- package/lib/components/Reading.css +0 -107
- package/lib/components/Reading.css.map +0 -1
- package/lib/components/Redux/Redux.css +0 -86
- package/lib/components/Redux/Redux.css.map +0 -1
- package/lib/components/Redux/Redux.d.ts +0 -6
- package/lib/components/Redux/Redux.js +0 -77
- package/lib/components/ReduxSettings/ReduxSettings.css +0 -10
- package/lib/components/ReduxSettings/ReduxSettings.css.map +0 -1
- package/lib/components/ReduxSettings/ReduxSettings.d.ts +0 -9
- package/lib/components/ReduxSettings/ReduxSettings.js +0 -64
- package/lib/components/Requests/Requests.css +0 -8
- package/lib/components/Requests/Requests.css.map +0 -1
- package/lib/components/Requests/Requests.d.ts +0 -6
- package/lib/components/Requests/Requests.js +0 -66
- package/lib/components/Status/Status.css +0 -15
- package/lib/components/Status/Status.css.map +0 -1
- package/lib/components/Status/Status.d.ts +0 -6
- package/lib/components/Status/Status.js +0 -21
- package/lib/components/TaskManager/TaskManager.css +0 -9
- package/lib/components/TaskManager/TaskManager.css.map +0 -1
- package/lib/components/TaskManager/TaskManager.d.ts +0 -9
- package/lib/components/TaskManager/TaskManager.js +0 -28
- package/lib/components/Toggle/Toggle.css +0 -3
- package/lib/components/Toggle/Toggle.css.map +0 -1
- package/lib/components/Toggle/Toggle.d.ts +0 -9
- package/lib/components/Toggle/Toggle.js +0 -13
- package/lib/components/Variables.css +0 -3
- package/lib/components/Variables.css.map +0 -1
- package/lib/components/VirtualList/VirtualList.css +0 -13
- package/lib/components/VirtualList/VirtualList.css.map +0 -1
- package/lib/components/VirtualList/VirtualList.d.ts +0 -19
- package/lib/components/VirtualList/VirtualList.js +0 -35
- package/lib/components/Visual/Visual.css +0 -56
- package/lib/components/Visual/Visual.css.map +0 -1
- package/lib/components/Visual/Visual.d.ts +0 -6
- package/lib/components/Visual/Visual.js +0 -43
- package/lib/components/prefix.d.ts +0 -2
- package/lib/components/prefix.js +0 -5
- package/lib/data/boxSizes.d.ts +0 -2
- package/lib/data/boxSizes.js +0 -13
- package/lib/data/dispatcherActions.d.ts +0 -5
- package/lib/data/dispatcherActions.js +0 -38
- package/lib/data/panels.d.ts +0 -2
- package/lib/data/panels.js +0 -77
- package/lib/data/panelsArrangements.d.ts +0 -19
- package/lib/data/panelsArrangements.js +0 -22
- package/lib/data/reduxFilterOptions.d.ts +0 -20
- package/lib/data/reduxFilterOptions.js +0 -227
- package/lib/data/widgets.d.ts +0 -2
- package/lib/data/widgets.js +0 -89
- package/lib/hooks/index.d.ts +0 -7
- package/lib/hooks/index.js +0 -17
- package/lib/hooks/misc/hookState.d.ts +0 -8
- package/lib/hooks/misc/hookState.js +0 -10
- package/lib/hooks/misc/util.d.ts +0 -5
- package/lib/hooks/misc/util.js +0 -27
- package/lib/hooks/useBoolean.d.ts +0 -3
- package/lib/hooks/useBoolean.js +0 -7
- package/lib/hooks/useClickAway.d.ts +0 -3
- package/lib/hooks/useClickAway.js +0 -31
- package/lib/hooks/useEvent.d.ts +0 -13
- package/lib/hooks/useEvent.js +0 -37
- package/lib/hooks/useKey.d.ts +0 -12
- package/lib/hooks/useKey.js +0 -34
- package/lib/hooks/useList.d.ts +0 -57
- package/lib/hooks/useList.js +0 -79
- package/lib/hooks/useLocalstorage.d.ts +0 -10
- package/lib/hooks/useLocalstorage.js +0 -79
- package/lib/hooks/usePanels.d.ts +0 -10
- package/lib/hooks/usePanels.js +0 -47
- package/lib/hooks/useSetState.d.ts +0 -2
- package/lib/hooks/useSetState.js +0 -14
- package/lib/hooks/useToggle.d.ts +0 -2
- package/lib/hooks/useToggle.js +0 -10
- package/lib/hooks/useUpdate.d.ts +0 -1
- package/lib/hooks/useUpdate.js +0 -9
- package/lib/index.css +0 -488
- package/lib/index.css.map +0 -1
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -9
- package/lib/selectors/selectors.d.ts +0 -21
- package/lib/selectors/selectors.js +0 -24
- package/lib/theme/devtoolsTheme.d.ts +0 -2
- package/lib/theme/devtoolsTheme.js +0 -97
- package/lib/utils/filter.d.ts +0 -3
- package/lib/utils/filter.js +0 -29
- package/lib/utils/localStorage.d.ts +0 -2
- package/lib/utils/localStorage.js +0 -26
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import JsonViewer from '../components/JsonViewer/JsonViewer';
|
|
3
|
+
import { connectedSelectors } from 'redux-connected';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
|
|
6
|
+
export function EndpointConfigsContainer() {
|
|
7
|
+
const json = useSelector(connectedSelectors.$endpointsConfigRaw);
|
|
8
|
+
|
|
9
|
+
return <JsonViewer json={json} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default EndpointConfigsContainer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import JsonViewer from '../components/JsonViewer/JsonViewer';
|
|
3
|
+
import { connectedSelectors } from 'redux-connected';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
|
|
6
|
+
export function EndpointStatusContainer() {
|
|
7
|
+
const json = useSelector(connectedSelectors.$endpointsStateRaw);
|
|
8
|
+
|
|
9
|
+
return <JsonViewer json={json} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default EndpointStatusContainer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import JsonViewer from '../components/JsonViewer/JsonViewer';
|
|
4
|
+
import { connectedSelectors } from 'redux-connected';
|
|
5
|
+
|
|
6
|
+
export function GlobalSettingsContainer() {
|
|
7
|
+
const json = useSelector(connectedSelectors.$apiGlobalSettingsRaw);
|
|
8
|
+
|
|
9
|
+
return <JsonViewer json={json} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default GlobalSettingsContainer;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import JsonViewer from '../components/JsonViewer/JsonViewer';
|
|
4
|
+
import { connectedSelectors } from 'redux-connected';
|
|
5
|
+
|
|
6
|
+
export function GlobalStatsContainer() {
|
|
7
|
+
const json = useSelector(connectedSelectors.$apiGlobalStatsRaw);
|
|
8
|
+
|
|
9
|
+
return <JsonViewer json={json} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default GlobalStatsContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsApiErrorPast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecycleApiErrorContainer() {
|
|
7
|
+
const requests = useSelector($requestsApiErrorPast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecycleApiErrorContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsGeneralErrorPast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecycleGeneralErrorContainer() {
|
|
7
|
+
const requests = useSelector($requestsGeneralErrorPast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecycleGeneralErrorContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsInQueuePast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecycleInQueueContainer() {
|
|
7
|
+
const requests = useSelector($requestsInQueuePast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecycleInQueueContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsPendingApiPast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecyclePendingApiContainer() {
|
|
7
|
+
const requests = useSelector($requestsPendingApiPast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecyclePendingApiContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsPostActionPast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecyclePostActionContainer() {
|
|
7
|
+
const requests = useSelector($requestsPostActionPast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecyclePostActionContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
|
+
import Lifecycle from '../components/Lifecycle/Lifecycle';
|
|
4
|
+
import { $requestsReceivedPast } from '../store/selectors';
|
|
5
|
+
|
|
6
|
+
export function LifecycleReceivedContainer() {
|
|
7
|
+
const requests = useSelector($requestsReceivedPast);
|
|
8
|
+
return <Lifecycle requests={requests} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default LifecycleReceivedContainer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
window.addEventListener('message', function (event) {
|
|
2
|
+
// Only accept messages from the same frame
|
|
3
|
+
if (event.source !== window) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const message = event.data as any;
|
|
8
|
+
|
|
9
|
+
// Only accept messages that we know are ours
|
|
10
|
+
if (
|
|
11
|
+
typeof message !== 'object' ||
|
|
12
|
+
message === null ||
|
|
13
|
+
message.source !== 'devtools-page'
|
|
14
|
+
) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
chrome.runtime.sendMessage(message);
|
|
19
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import LifecycleReceivedContainer from '../containers/LifecycleReceivedContainer';
|
|
2
|
+
import GlobalStatsContainer from '../containers/GlobalStatsContainer';
|
|
3
|
+
import EndpointConfigsContainer from '../containers/EndpointConfigsContainer';
|
|
4
|
+
import GlobalSettingsContainer from '../containers/GlobalSettingsContainer';
|
|
5
|
+
import EndpointStatusContainer from '../containers/EndpointStatusContainer';
|
|
6
|
+
import LifecycleInQueueContainer from '../containers/LifecycleInQueueContainer';
|
|
7
|
+
import LifecycleGeneralErrorContainer from '../containers/LifecycleGeneralErrorContainer';
|
|
8
|
+
import LifecyclePendingApiContainer from '../containers/LifecyclePendingApiContainer';
|
|
9
|
+
import LifecycleApiErrorContainer from '../containers/LifecycleApiErrorContainer';
|
|
10
|
+
import LifecyclePostActionContainer from '../containers/LifecyclePostActionContainer';
|
|
11
|
+
|
|
12
|
+
type DevComponents = Record<string, React.FC<any>>;
|
|
13
|
+
|
|
14
|
+
export const devComponents: DevComponents = {
|
|
15
|
+
LifecycleReceived: LifecycleReceivedContainer,
|
|
16
|
+
LifecycleInQueue: LifecycleInQueueContainer,
|
|
17
|
+
LifecycleGeneralError: LifecycleGeneralErrorContainer,
|
|
18
|
+
LifecyclePendingApi: LifecyclePendingApiContainer,
|
|
19
|
+
LifecycleApiError: LifecycleApiErrorContainer,
|
|
20
|
+
LifecyclePostAction: LifecyclePostActionContainer,
|
|
21
|
+
GlobalSettings: GlobalSettingsContainer,
|
|
22
|
+
GlobalStats: GlobalStatsContainer,
|
|
23
|
+
EndpointConfigs: EndpointConfigsContainer,
|
|
24
|
+
EndpointStatus: EndpointStatusContainer,
|
|
25
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export type IDevRoute = {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
group: string;
|
|
5
|
+
componentId: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const devRoutes: IDevRoute[] = [
|
|
9
|
+
{
|
|
10
|
+
id: 'lifecycleReceived',
|
|
11
|
+
title: '1. Received',
|
|
12
|
+
group: 'lifecycle',
|
|
13
|
+
componentId: 'LifecycleReceived',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'lifecycleInQueue',
|
|
17
|
+
title: '2. In queue',
|
|
18
|
+
group: 'lifecycle',
|
|
19
|
+
componentId: 'LifecycleInQueue',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'lifecycleGeneralError',
|
|
23
|
+
title: '3. General error',
|
|
24
|
+
group: 'lifecycle',
|
|
25
|
+
componentId: 'LifecycleGeneralError',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'lifecyclePendingApi',
|
|
29
|
+
title: '4. Pending API',
|
|
30
|
+
group: 'lifecycle',
|
|
31
|
+
componentId: 'LifecyclePendingApi',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'lifecycleApiError',
|
|
35
|
+
title: '5. API error',
|
|
36
|
+
group: 'lifecycle',
|
|
37
|
+
componentId: 'LifecycleApiError',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'lifecyclePostAction',
|
|
41
|
+
title: '6. Post action',
|
|
42
|
+
group: 'lifecycle',
|
|
43
|
+
componentId: 'LifecyclePostAction',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'endpointStatus',
|
|
47
|
+
title: 'Endpoint status',
|
|
48
|
+
group: 'state',
|
|
49
|
+
componentId: 'EndpointStatus',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'settingsGlobal',
|
|
53
|
+
title: 'Global settings',
|
|
54
|
+
group: 'settings & stats',
|
|
55
|
+
componentId: 'GlobalSettings',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'settingsEndpoints',
|
|
59
|
+
title: 'Endpoints configs',
|
|
60
|
+
group: 'settings & stats',
|
|
61
|
+
componentId: 'EndpointConfigs',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'statsGlobal',
|
|
65
|
+
title: 'Global stats',
|
|
66
|
+
group: 'settings & stats',
|
|
67
|
+
componentId: 'GlobalStats',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const getGroups = (): string[] => {
|
|
72
|
+
const output: string[] = [];
|
|
73
|
+
|
|
74
|
+
devRoutes.forEach((group) => {
|
|
75
|
+
if (!output.includes(group.group)) {
|
|
76
|
+
output.push(group.group);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return output;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const devGroups: string[] = getGroups();
|
package/src/devtools.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// devtools.js
|
|
2
|
+
const backgroundPageConnection = chrome.runtime.connect({
|
|
3
|
+
name: 'devtools-page',
|
|
4
|
+
});
|
|
5
|
+
|
|
6
|
+
let panel: any;
|
|
7
|
+
|
|
8
|
+
chrome.devtools.panels.create(
|
|
9
|
+
'Redux connected',
|
|
10
|
+
'',
|
|
11
|
+
'panel.html',
|
|
12
|
+
function (_panel) {
|
|
13
|
+
panel = _panel;
|
|
14
|
+
|
|
15
|
+
backgroundPageConnection.postMessage({
|
|
16
|
+
name: 'init',
|
|
17
|
+
tabId: chrome.devtools.inspectedWindow.tabId,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
backgroundPageConnection.postMessage({
|
|
21
|
+
tabId: chrome.devtools.inspectedWindow.tabId,
|
|
22
|
+
scriptToInject: 'injected_script.js',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
backgroundPageConnection.onMessage.addListener(function (message: any) {
|
|
26
|
+
// Handle responses from the background page, if any
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
);
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DevPanelContainer } from './containers/DevPanelContainer';
|
package/src/options.tsx
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
|
|
4
|
+
const Options = () => {
|
|
5
|
+
const [color, setColor] = useState<string>('');
|
|
6
|
+
const [status, setStatus] = useState<string>('');
|
|
7
|
+
const [like, setLike] = useState<boolean>(false);
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
// Restores select box and checkbox state using the preferences
|
|
11
|
+
// stored in chrome.storage.
|
|
12
|
+
chrome.storage.sync.get(
|
|
13
|
+
{
|
|
14
|
+
favoriteColor: 'red',
|
|
15
|
+
likesColor: true,
|
|
16
|
+
},
|
|
17
|
+
(items) => {
|
|
18
|
+
setColor(items.favoriteColor);
|
|
19
|
+
setLike(items.likesColor);
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
const saveOptions = () => {
|
|
25
|
+
// Saves options to chrome.storage.sync.
|
|
26
|
+
chrome.storage.sync.set(
|
|
27
|
+
{
|
|
28
|
+
favoriteColor: color,
|
|
29
|
+
likesColor: like,
|
|
30
|
+
},
|
|
31
|
+
() => {
|
|
32
|
+
// Update status to let user know options were saved.
|
|
33
|
+
setStatus('Options saved.');
|
|
34
|
+
const id = setTimeout(() => {
|
|
35
|
+
setStatus('');
|
|
36
|
+
}, 1000);
|
|
37
|
+
return () => clearTimeout(id);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<div>
|
|
45
|
+
Favorite color:{' '}
|
|
46
|
+
<select
|
|
47
|
+
value={color}
|
|
48
|
+
onChange={(event) => setColor(event.target.value)}
|
|
49
|
+
>
|
|
50
|
+
<option value='red'>red</option>
|
|
51
|
+
<option value='green'>green</option>
|
|
52
|
+
<option value='blue'>blue</option>
|
|
53
|
+
<option value='yellow'>yellow</option>
|
|
54
|
+
</select>
|
|
55
|
+
</div>
|
|
56
|
+
<div>
|
|
57
|
+
<label>
|
|
58
|
+
<input
|
|
59
|
+
type='checkbox'
|
|
60
|
+
checked={like}
|
|
61
|
+
onChange={(event) => setLike(event.target.checked)}
|
|
62
|
+
/>
|
|
63
|
+
I like colors.
|
|
64
|
+
</label>
|
|
65
|
+
</div>
|
|
66
|
+
<div>{status}</div>
|
|
67
|
+
<button onClick={saveOptions}>Save</button>
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
ReactDOM.render(
|
|
73
|
+
<React.StrictMode>
|
|
74
|
+
<Options />
|
|
75
|
+
</React.StrictMode>,
|
|
76
|
+
document.getElementById('root')
|
|
77
|
+
);
|
package/src/panel.tsx
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import DevPanel from './containers/DevPanelContainer';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import { Provider } from 'react-redux';
|
|
5
|
+
import { store } from './store/initialState';
|
|
6
|
+
|
|
7
|
+
ReactDOM.render(
|
|
8
|
+
<React.StrictMode>
|
|
9
|
+
<Provider store={store}>
|
|
10
|
+
<DevPanel />
|
|
11
|
+
</Provider>
|
|
12
|
+
</React.StrictMode>,
|
|
13
|
+
document.getElementById('root')
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
|
|
17
|
+
if (sender.origin?.indexOf('http://localhost') === 0) {
|
|
18
|
+
const store = (window as any).store;
|
|
19
|
+
|
|
20
|
+
switch (request.type) {
|
|
21
|
+
case 'CONNECTED_STATE':
|
|
22
|
+
break;
|
|
23
|
+
case 'CONNECTED_ACTION':
|
|
24
|
+
const { payload } = request;
|
|
25
|
+
const { action } = payload;
|
|
26
|
+
store.dispatch(action);
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
package/src/popup.tsx
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
|
|
4
|
+
const Popup = () => {
|
|
5
|
+
const [count, setCount] = useState(0);
|
|
6
|
+
const [currentURL, setCurrentURL] = useState<string>();
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
chrome.action.setBadgeText({ text: count.toString() });
|
|
10
|
+
}, [count]);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
chrome.tabs.query(
|
|
14
|
+
{ active: true, currentWindow: true },
|
|
15
|
+
function (tabs) {
|
|
16
|
+
setCurrentURL(tabs[0].url);
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const changeBackground = () => {
|
|
22
|
+
chrome.tabs.query(
|
|
23
|
+
{ active: true, currentWindow: true },
|
|
24
|
+
function (tabs) {
|
|
25
|
+
const tab = tabs[0];
|
|
26
|
+
if (tab.id) {
|
|
27
|
+
chrome.tabs.sendMessage(
|
|
28
|
+
tab.id,
|
|
29
|
+
{
|
|
30
|
+
color: '#555555',
|
|
31
|
+
},
|
|
32
|
+
(msg) => {
|
|
33
|
+
console.log('result message:', msg);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
<ul style={{ minWidth: '700px' }}>
|
|
44
|
+
<li>Current URL: {currentURL}</li>
|
|
45
|
+
<li>Current Time: {new Date().toLocaleTimeString()}</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<button
|
|
48
|
+
onClick={() => setCount(count + 1)}
|
|
49
|
+
style={{ marginRight: '5px' }}
|
|
50
|
+
>
|
|
51
|
+
count up
|
|
52
|
+
</button>
|
|
53
|
+
<button onClick={changeBackground}>change background</button>
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
ReactDOM.render(
|
|
59
|
+
<React.StrictMode>
|
|
60
|
+
<Popup />
|
|
61
|
+
</React.StrictMode>,
|
|
62
|
+
document.getElementById('root')
|
|
63
|
+
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateConnectedStoreEmpty,
|
|
3
|
+
IReduxConnectedConfig,
|
|
4
|
+
ConnectionType,
|
|
5
|
+
RetryStrategy,
|
|
6
|
+
} from 'redux-connected';
|
|
7
|
+
|
|
8
|
+
type IAppState = {
|
|
9
|
+
name: string;
|
|
10
|
+
email: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type MyStore = {
|
|
14
|
+
appState: IAppState;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const initialState: MyStore = {
|
|
18
|
+
appState: {
|
|
19
|
+
name: 'User2',
|
|
20
|
+
email: 'user@example.com',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const config: IReduxConnectedConfig = {
|
|
25
|
+
defaultEndpointsConfig: {
|
|
26
|
+
id: 'default',
|
|
27
|
+
connectionType: ConnectionType.REST,
|
|
28
|
+
retryStrategy: RetryStrategy.X2_TIMES,
|
|
29
|
+
},
|
|
30
|
+
endpointsConfigOverrides: {
|
|
31
|
+
appState: {
|
|
32
|
+
connectionType: ConnectionType.NONE,
|
|
33
|
+
},
|
|
34
|
+
logs: {
|
|
35
|
+
connectionType: ConnectionType.NONE,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
adapters: {},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const store = generateConnectedStoreEmpty(initialState, config);
|
|
42
|
+
(window as any).store = store;
|