redux-connected-devtools 0.0.15 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.depcheck +20 -0
- 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 +58 -63
- package/src/__tests__/sum.ts +9 -0
- package/src/components/DevInspector/DevInspector.scss +2 -0
- package/src/components/DevInspector/DevInspector.style.tsx +7 -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 +65 -0
- package/src/components/DevMenu/DevMenu.scss +2 -0
- package/src/components/DevMenu/DevMenu.style.tsx +53 -0
- package/src/components/DevMenu/DevMenu.tsx +77 -0
- package/src/components/DevPanel/DevPanel.scss +2 -0
- package/src/components/DevPanel/DevPanel.style.tsx +25 -0
- package/src/components/DevPanel/DevPanel.tsx +58 -0
- package/src/components/DevtoolsApp/DevtoolsApp.scss +2 -0
- package/src/components/DevtoolsApp/DevtoolsApp.style.tsx +12 -0
- package/src/components/DevtoolsApp/DevtoolsApp.tsx +45 -0
- package/src/components/Icon/AllIcons.tsx +66 -0
- package/src/components/Icon/Icon.scss +2 -0
- package/src/components/Icon/Icon.style.tsx +11 -0
- package/src/components/Icon/Icon.tsx +28 -0
- package/src/components/JourneyRow/JourneyRow.scss +2 -0
- package/src/components/JourneyRow/JourneyRow.style.tsx +46 -0
- package/src/components/JourneyRow/JourneyRow.tsx +60 -0
- package/src/components/JsonViewer/JsonViewer.scss +2 -0
- package/src/components/JsonViewer/JsonViewer.style.tsx +31 -0
- package/src/components/JsonViewer/JsonViewer.tsx +23 -0
- package/src/components/Lifecycle/Lifecycle.scss +2 -0
- package/src/components/Lifecycle/Lifecycle.style.tsx +6 -0
- package/src/components/Lifecycle/Lifecycle.tsx +36 -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 +27 -0
- package/src/components/RequestJourney/RequestJourney.tsx +33 -0
- package/src/components/RequestRow/RequestRow.scss +2 -0
- package/src/components/RequestRow/RequestRow.style.tsx +32 -0
- package/src/components/RequestRow/RequestRow.tsx +37 -0
- package/src/components/Size/Size.scss +2 -0
- package/src/components/Size/Size.style.tsx +6 -0
- package/src/components/Size/Size.tsx +21 -0
- package/src/components/StateViewer/StateViewer.scss +2 -0
- package/src/components/StateViewer/StateViewer.style.tsx +5 -0
- package/src/components/StateViewer/StateViewer.tsx +17 -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 +12 -0
- package/src/containers/DevtoolsAppContainer.tsx +42 -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/JsonViewerContainer.tsx +8 -0
- package/src/containers/LifecycleApiErrorContainer.tsx +11 -0
- package/src/containers/LifecycleContainer.tsx +12 -0
- package/src/containers/LifecycleFailedContainer.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/containers/LogsViewerContainer.tsx +8 -0
- package/src/containers/StateViewerContainer.tsx +8 -0
- package/src/data/devComponents.tsx +27 -0
- package/src/data/devRouter.ts +107 -0
- package/src/data/devRoutes.ts +90 -0
- package/src/hooks/useStoreSize.ts +27 -0
- package/src/index.ts +1 -0
- package/src/store/initialState.ts +42 -0
- package/src/store/selectors.ts +220 -0
- package/src/types.ts +1 -0
- package/src/utils/date.ts +11 -0
- package/src/utils/download.ts +17 -0
- package/tsconfig.json +18 -0
- package/vite.config.ts +27 -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/DevToolsLocal/DevToolsLocal.d.ts +0 -4
- package/esm/components/DevToolsLocal/DevToolsLocal.js +0 -12
- package/esm/components/Dispatcher/Dispatcher.d.ts +0 -8
- package/esm/components/Dispatcher/Dispatcher.js +0 -61
- 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 -54
- 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 -18
- 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/Timeline/Timeline.d.ts +0 -6
- package/esm/components/Timeline/Timeline.js +0 -13
- package/esm/components/TimelineEvent/TimelineEvent.d.ts +0 -7
- package/esm/components/TimelineEvent/TimelineEvent.js +0 -13
- package/esm/components/TimelineHeader/TimelineHeader.d.ts +0 -4
- package/esm/components/TimelineHeader/TimelineHeader.js +0 -5
- package/esm/components/TimelineRow/TimelineRow.d.ts +0 -7
- package/esm/components/TimelineRow/TimelineRow.js +0 -13
- package/esm/components/TimelineRowHeader/TimelineRowHeader.d.ts +0 -7
- package/esm/components/TimelineRowHeader/TimelineRowHeader.js +0 -10
- package/esm/components/Toggle/Toggle.d.ts +0 -8
- 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/layoutDefault.d.ts +0 -2
- package/esm/data/layoutDefault.js +0 -46
- package/esm/data/panels.d.ts +0 -2
- package/esm/data/panels.js +0 -14
- package/esm/data/panelsArrangements.d.ts +0 -19
- package/esm/data/panelsArrangements.js +0 -19
- package/esm/data/panelsLocal.d.ts +0 -2
- package/esm/data/panelsLocal.js +0 -7
- 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 -154
- package/esm/data/widgetsLocal.d.ts +0 -2
- package/esm/data/widgetsLocal.js +0 -19
- 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 -45
- 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 -4
- package/esm/index.js +0 -4
- 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/types.d.ts +0 -21
- package/esm/types.js +0 -1
- 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/esm/utils/sockets.d.ts +0 -7
- package/esm/utils/sockets.js +0 -27
- 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 -11
- 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/DevToolsLocal/DevToolsLocal.css +0 -11
- package/lib/components/DevToolsLocal/DevToolsLocal.css.map +0 -1
- package/lib/components/DevToolsLocal/DevToolsLocal.d.ts +0 -4
- package/lib/components/DevToolsLocal/DevToolsLocal.js +0 -17
- 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 -65
- 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 -5
- 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 -5
- 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 -5
- 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 -59
- 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 -18
- 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/Timeline/Timeline.css +0 -5
- package/lib/components/Timeline/Timeline.css.map +0 -1
- package/lib/components/Timeline/Timeline.d.ts +0 -6
- package/lib/components/Timeline/Timeline.js +0 -18
- package/lib/components/TimelineEvent/TimelineEvent.css +0 -20
- package/lib/components/TimelineEvent/TimelineEvent.css.map +0 -1
- package/lib/components/TimelineEvent/TimelineEvent.d.ts +0 -7
- package/lib/components/TimelineEvent/TimelineEvent.js +0 -18
- package/lib/components/TimelineHeader/TimelineHeader.css +0 -6
- package/lib/components/TimelineHeader/TimelineHeader.css.map +0 -1
- package/lib/components/TimelineHeader/TimelineHeader.d.ts +0 -4
- package/lib/components/TimelineHeader/TimelineHeader.js +0 -10
- package/lib/components/TimelineRow/TimelineRow.css +0 -14
- package/lib/components/TimelineRow/TimelineRow.css.map +0 -1
- package/lib/components/TimelineRow/TimelineRow.d.ts +0 -7
- package/lib/components/TimelineRow/TimelineRow.js +0 -18
- package/lib/components/TimelineRowHeader/TimelineRowHeader.css +0 -45
- package/lib/components/TimelineRowHeader/TimelineRowHeader.css.map +0 -1
- package/lib/components/TimelineRowHeader/TimelineRowHeader.d.ts +0 -7
- package/lib/components/TimelineRowHeader/TimelineRowHeader.js +0 -15
- 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 -8
- 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 -57
- 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/layoutDefault.d.ts +0 -2
- package/lib/data/layoutDefault.js +0 -49
- package/lib/data/panels.d.ts +0 -2
- package/lib/data/panels.js +0 -17
- package/lib/data/panelsArrangements.d.ts +0 -19
- package/lib/data/panelsArrangements.js +0 -22
- package/lib/data/panelsLocal.d.ts +0 -2
- package/lib/data/panelsLocal.js +0 -10
- 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 -157
- package/lib/data/widgetsLocal.d.ts +0 -2
- package/lib/data/widgetsLocal.js +0 -22
- 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 -49
- 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 -605
- package/lib/index.css.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -11
- 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/types.d.ts +0 -21
- package/lib/types.js +0 -2
- 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
- package/lib/utils/sockets.d.ts +0 -7
- package/lib/utils/sockets.js +0 -34
@@ -0,0 +1,58 @@
|
|
1
|
+
import DevMenu from '../../containers/DevMenuContainer';
|
2
|
+
import React, { useState } from 'react';
|
3
|
+
import { Actions, Container, Content } from './DevPanel.style';
|
4
|
+
import { devComponents } from '../../data/devComponents';
|
5
|
+
import { devRoutes, IDevRoute } from '../../data/devRoutes';
|
6
|
+
|
7
|
+
export type DevPanelProps = {
|
8
|
+
children: JSX.Element | JSX.Element[];
|
9
|
+
};
|
10
|
+
|
11
|
+
export function DevPanel(props: DevPanelProps) {
|
12
|
+
const [route, setRoute] = useState<IDevRoute>(devRoutes[0]);
|
13
|
+
|
14
|
+
function renderRoute() {
|
15
|
+
const Cmp = devComponents[route.componentId];
|
16
|
+
return <Cmp key={route.id} />;
|
17
|
+
}
|
18
|
+
|
19
|
+
return (
|
20
|
+
<Container
|
21
|
+
className='DevPanel-container'
|
22
|
+
data-testid='DevPanel-container'
|
23
|
+
>
|
24
|
+
<DevMenu
|
25
|
+
selectedId={route.id}
|
26
|
+
onClick={(item: IDevRoute) => setRoute(item)}
|
27
|
+
/>
|
28
|
+
<Actions>{props.children}</Actions>
|
29
|
+
<Content>{renderRoute()}</Content>
|
30
|
+
</Container>
|
31
|
+
);
|
32
|
+
}
|
33
|
+
|
34
|
+
/*
|
35
|
+
for the chrome extension devtools panel
|
36
|
+
TODO: find another way to encapsulate this
|
37
|
+
|
38
|
+
let bgConnection;
|
39
|
+
|
40
|
+
function init(id: string) {
|
41
|
+
bgConnection = chrome.runtime?.connect({
|
42
|
+
name: id,
|
43
|
+
});
|
44
|
+
|
45
|
+
if (bgConnection) {
|
46
|
+
bgConnection.onMessage.addListener((message: Json) => {
|
47
|
+
console.log('message ->', message);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
if (chrome) {
|
53
|
+
const tabId = String(chrome.devtools?.inspectedWindow.tabId ?? '');
|
54
|
+
init(tabId);
|
55
|
+
}
|
56
|
+
*/
|
57
|
+
|
58
|
+
export default DevPanel;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import Icon from '../Icon/Icon';
|
2
|
+
import React, { useRef } from 'react';
|
3
|
+
import { Container } from './DevtoolsApp.style';
|
4
|
+
import { DevPanelContainer } from '../../containers/DevPanelContainer';
|
5
|
+
import { Provider } from 'react-redux';
|
6
|
+
import Size from '../Size/Size';
|
7
|
+
import classnames from 'classnames';
|
8
|
+
|
9
|
+
export type DevtoolsAppProps = {
|
10
|
+
connectedStore: any;
|
11
|
+
clearRequests: () => void;
|
12
|
+
downloadState: () => void;
|
13
|
+
storeSizeInBytes?: number;
|
14
|
+
isDarkMode?: boolean;
|
15
|
+
};
|
16
|
+
|
17
|
+
export function DevtoolsApp(props: DevtoolsAppProps) {
|
18
|
+
const { connectedStore, storeSizeInBytes, isDarkMode } = props;
|
19
|
+
const ref = useRef(null);
|
20
|
+
|
21
|
+
const className = classnames('DevtoolsApp-container', {
|
22
|
+
darkMode: isDarkMode,
|
23
|
+
});
|
24
|
+
|
25
|
+
return (
|
26
|
+
<Container
|
27
|
+
ref={ref}
|
28
|
+
className={className}
|
29
|
+
data-testid='DevtoolsApp-container'
|
30
|
+
>
|
31
|
+
<Provider store={connectedStore}>
|
32
|
+
<DevPanelContainer>
|
33
|
+
<Size size={storeSizeInBytes} />
|
34
|
+
<Icon
|
35
|
+
name='clearAll'
|
36
|
+
onClick={() => props.clearRequests()}
|
37
|
+
/>
|
38
|
+
<Icon name='download' onClick={props.downloadState} />
|
39
|
+
</DevPanelContainer>
|
40
|
+
</Provider>
|
41
|
+
</Container>
|
42
|
+
);
|
43
|
+
}
|
44
|
+
|
45
|
+
export default DevtoolsApp;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
export type IconName = 'download' | 'close' | 'clearAll';
|
4
|
+
|
5
|
+
type IconProps = {
|
6
|
+
size?: number;
|
7
|
+
};
|
8
|
+
|
9
|
+
const Download = (props: IconProps) => {
|
10
|
+
const { size = 24 } = props;
|
11
|
+
|
12
|
+
return (
|
13
|
+
<svg
|
14
|
+
xmlns='http://www.w3.org/2000/svg'
|
15
|
+
viewBox='0 0 24 24'
|
16
|
+
width={`${size}px`}
|
17
|
+
height={`${size}px`}
|
18
|
+
fill='currentColor'
|
19
|
+
>
|
20
|
+
<path d='M0 0h24v24H0z' fill='none' />
|
21
|
+
<path d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z' />
|
22
|
+
</svg>
|
23
|
+
);
|
24
|
+
};
|
25
|
+
|
26
|
+
const Close = (props: IconProps) => {
|
27
|
+
const { size = 24 } = props;
|
28
|
+
|
29
|
+
return (
|
30
|
+
<svg
|
31
|
+
xmlns='http://www.w3.org/2000/svg'
|
32
|
+
viewBox='0 0 24 24'
|
33
|
+
width={`${size}px`}
|
34
|
+
height={`${size}px`}
|
35
|
+
fill='currentColor'
|
36
|
+
>
|
37
|
+
<path d='M0 0h24v24H0z' fill='none' />
|
38
|
+
<path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z' />
|
39
|
+
</svg>
|
40
|
+
);
|
41
|
+
};
|
42
|
+
|
43
|
+
const ClearAll = (props: IconProps) => {
|
44
|
+
const { size = 24 } = props;
|
45
|
+
|
46
|
+
return (
|
47
|
+
<svg
|
48
|
+
xmlns='http://www.w3.org/2000/svg'
|
49
|
+
viewBox='0 0 24 24'
|
50
|
+
width={`${size}px`}
|
51
|
+
height={`${size}px`}
|
52
|
+
fill='currentColor'
|
53
|
+
>
|
54
|
+
<path d='M0 0h24v24H0z' fill='none' />
|
55
|
+
<path d='M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z' />
|
56
|
+
</svg>
|
57
|
+
);
|
58
|
+
};
|
59
|
+
|
60
|
+
type Icons = Record<IconName, React.FC<IconProps>>;
|
61
|
+
|
62
|
+
export const allIcons: Icons = {
|
63
|
+
close: Close,
|
64
|
+
clearAll: ClearAll,
|
65
|
+
download: Download,
|
66
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { allIcons, IconName } from './AllIcons';
|
3
|
+
import { Container } from './Icon.style';
|
4
|
+
|
5
|
+
export type IconProps = {
|
6
|
+
name: IconName;
|
7
|
+
color?: string;
|
8
|
+
size?: number;
|
9
|
+
onClick?: () => void;
|
10
|
+
};
|
11
|
+
|
12
|
+
export function Icon(props: IconProps) {
|
13
|
+
const { name, size = 20, color } = props;
|
14
|
+
const Cmp = allIcons[name];
|
15
|
+
|
16
|
+
return (
|
17
|
+
<Container
|
18
|
+
className='Icon-container'
|
19
|
+
data-testid='Icon-container'
|
20
|
+
color={color}
|
21
|
+
onClick={props.onClick}
|
22
|
+
>
|
23
|
+
<Cmp size={size} />
|
24
|
+
</Container>
|
25
|
+
);
|
26
|
+
}
|
27
|
+
|
28
|
+
export default Icon;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
export const Container = styled.div`
|
4
|
+
flex: 1;
|
5
|
+
display: flex;
|
6
|
+
flex-direction: row;
|
7
|
+
align-items: center;
|
8
|
+
padding: 10px 20px;
|
9
|
+
|
10
|
+
&:nth-child(2n-1) {
|
11
|
+
background-color: rgba(0, 0, 0, 0.2);
|
12
|
+
}
|
13
|
+
|
14
|
+
&:hover {
|
15
|
+
background-color: rgba(0, 0, 0, 0.3);
|
16
|
+
cursor: pointer;
|
17
|
+
}
|
18
|
+
`;
|
19
|
+
|
20
|
+
export const Status = styled.div`
|
21
|
+
color: #aaa;
|
22
|
+
`;
|
23
|
+
|
24
|
+
export const DataIcon = styled.div`
|
25
|
+
background-color: #000;
|
26
|
+
padding: 3px 7px;
|
27
|
+
font-size: 13px;
|
28
|
+
font-weight: bold;
|
29
|
+
color: purple;
|
30
|
+
border-radius: 5px;
|
31
|
+
${(props) => props.theme.marginLeft('10px')}
|
32
|
+
`;
|
33
|
+
|
34
|
+
export const Delta = styled.div`
|
35
|
+
font-size: 13px;
|
36
|
+
width: 60px;
|
37
|
+
font-weight: bold;
|
38
|
+
color: olive;
|
39
|
+
${(props) => props.theme.marginRight('10px')}
|
40
|
+
text-align: center;
|
41
|
+
font-family: monospace;
|
42
|
+
`;
|
43
|
+
|
44
|
+
export const Flex = styled.div`
|
45
|
+
flex: 1;
|
46
|
+
`;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import Time from '../Time/Time';
|
3
|
+
import { Container, Status, DataIcon, Delta, Flex } from './JourneyRow.style';
|
4
|
+
import { JourneyPoint, LifecycleStatus } from 'redux-connected';
|
5
|
+
|
6
|
+
export type JourneyRowProps = {
|
7
|
+
point: JourneyPoint;
|
8
|
+
};
|
9
|
+
|
10
|
+
const statusMap: Record<LifecycleStatus, string> = {
|
11
|
+
[LifecycleStatus.RECEIVED]: 'Received',
|
12
|
+
[LifecycleStatus.POST_ACTION_OPTIMISTIC]: 'Post action (optimistic)',
|
13
|
+
[LifecycleStatus.IN_QUEUE]: 'In queue',
|
14
|
+
[LifecycleStatus.GENERAL_ERROR]: 'General error',
|
15
|
+
[LifecycleStatus.PENDING_API_RESPONSE]: 'Pending API',
|
16
|
+
[LifecycleStatus.API_ERROR]: 'API error',
|
17
|
+
[LifecycleStatus.POST_ACTION]: 'Post action',
|
18
|
+
[LifecycleStatus.FAILED]: 'Failed',
|
19
|
+
};
|
20
|
+
|
21
|
+
export function JourneyRow(props: JourneyRowProps) {
|
22
|
+
const { point } = props;
|
23
|
+
const { status, timestamp, data, delta = '' } = point;
|
24
|
+
|
25
|
+
function printPoint() {
|
26
|
+
console.log(data);
|
27
|
+
}
|
28
|
+
|
29
|
+
function renderDataIcon() {
|
30
|
+
if (!data) {
|
31
|
+
return null;
|
32
|
+
}
|
33
|
+
|
34
|
+
return <DataIcon>D</DataIcon>;
|
35
|
+
}
|
36
|
+
|
37
|
+
function renderDelta() {
|
38
|
+
if (!delta) {
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
|
42
|
+
return <Delta>+{delta.toLocaleString()}</Delta>;
|
43
|
+
}
|
44
|
+
|
45
|
+
return (
|
46
|
+
<Container
|
47
|
+
className='JourneyRow-container'
|
48
|
+
data-testid='JourneyRow-container'
|
49
|
+
onClick={printPoint}
|
50
|
+
>
|
51
|
+
<Status>{statusMap[status]}</Status>
|
52
|
+
{renderDataIcon()}
|
53
|
+
<Flex />
|
54
|
+
{renderDelta()}
|
55
|
+
<Time value={timestamp} />
|
56
|
+
</Container>
|
57
|
+
);
|
58
|
+
}
|
59
|
+
|
60
|
+
export default JourneyRow;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
export const Container = styled.div<{ width?: number }>`
|
4
|
+
flex: 1;
|
5
|
+
max-height: 850px;
|
6
|
+
overflow: auto;
|
7
|
+
padding: 0 25px;
|
8
|
+
max-width: ${(props) => (props.width ? props.width + 'px' : '680px')};
|
9
|
+
color: #ccc;
|
10
|
+
line-height: 26px;
|
11
|
+
|
12
|
+
&::-webkit-scrollbar {
|
13
|
+
width: 8px;
|
14
|
+
height: 7px;
|
15
|
+
}
|
16
|
+
|
17
|
+
/* Track */
|
18
|
+
&::-webkit-scrollbar-track {
|
19
|
+
background: #333;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Handle */
|
23
|
+
&::-webkit-scrollbar-thumb {
|
24
|
+
background: #555;
|
25
|
+
}
|
26
|
+
|
27
|
+
/* Handle on hover */
|
28
|
+
&::-webkit-scrollbar-thumb:hover {
|
29
|
+
background: #666;
|
30
|
+
}
|
31
|
+
`;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Container } from './JsonViewer.style';
|
3
|
+
|
4
|
+
export type JsonViewerProps = {
|
5
|
+
json: Json | undefined;
|
6
|
+
width?: number;
|
7
|
+
};
|
8
|
+
|
9
|
+
export function JsonViewer(props: JsonViewerProps) {
|
10
|
+
const { json, width } = props;
|
11
|
+
|
12
|
+
return (
|
13
|
+
<Container
|
14
|
+
className='JsonViewer-container'
|
15
|
+
data-testid='JsonViewer-container'
|
16
|
+
width={width}
|
17
|
+
>
|
18
|
+
<pre>{JSON.stringify(json, null, 4)}</pre>
|
19
|
+
</Container>
|
20
|
+
);
|
21
|
+
}
|
22
|
+
|
23
|
+
export default JsonViewer;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import DevInspector from '../DevInspector/DevInspector';
|
2
|
+
import DevList from '../DevList/DevList';
|
3
|
+
import React, { useState } from 'react';
|
4
|
+
import RequestRow from '../RequestRow/RequestRow';
|
5
|
+
import { ApiRequest } from 'redux-connected';
|
6
|
+
import { Container } from './Lifecycle.style';
|
7
|
+
|
8
|
+
export type LifecycleProps = {
|
9
|
+
requests: ApiRequest[];
|
10
|
+
};
|
11
|
+
|
12
|
+
export function Lifecycle(props: LifecycleProps) {
|
13
|
+
const { requests } = props;
|
14
|
+
const [item, setItem] = useState<ApiRequest>();
|
15
|
+
|
16
|
+
function onClick(newItem: ApiRequest) {
|
17
|
+
setItem(newItem);
|
18
|
+
}
|
19
|
+
|
20
|
+
return (
|
21
|
+
<Container
|
22
|
+
className='Lifecycle-container'
|
23
|
+
data-testid='Lifecycle-container'
|
24
|
+
>
|
25
|
+
<DevList
|
26
|
+
items={requests}
|
27
|
+
row={RequestRow}
|
28
|
+
onClick={onClick}
|
29
|
+
selectedRow={item}
|
30
|
+
/>
|
31
|
+
<DevInspector item={item} />
|
32
|
+
</Container>
|
33
|
+
);
|
34
|
+
}
|
35
|
+
|
36
|
+
export default Lifecycle;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Container } from './LogsViewer.style';
|
3
|
+
|
4
|
+
export type LogsViewerProps = {};
|
5
|
+
|
6
|
+
export function LogsViewer(_props: LogsViewerProps) {
|
7
|
+
return (
|
8
|
+
<Container className="LogsViewer-container" data-testid="LogsViewer-container">
|
9
|
+
LogsViewer
|
10
|
+
</Container>
|
11
|
+
);
|
12
|
+
}
|
13
|
+
|
14
|
+
export default LogsViewer;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
export const Container = styled.div`
|
4
|
+
flex: 1;
|
5
|
+
padding: 20px;
|
6
|
+
`;
|
7
|
+
|
8
|
+
export const Table = styled.table``;
|
9
|
+
|
10
|
+
export const Tr = styled.tr``;
|
11
|
+
|
12
|
+
export const Td = styled.td`
|
13
|
+
color: goldenrod;
|
14
|
+
|
15
|
+
&:first-child {
|
16
|
+
color: #778;
|
17
|
+
text-align: right;
|
18
|
+
${(props) => props.theme.paddingRight('10px')}
|
19
|
+
}
|
20
|
+
`;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Container, Table, Tr, Td } from './RequestDetails.style';
|
3
|
+
import { ApiRequest } from 'redux-connected';
|
4
|
+
import JsonViewer from '../JsonViewer/JsonViewer';
|
5
|
+
import bytes from 'bytes';
|
6
|
+
|
7
|
+
export type RequestDetailsProps = {
|
8
|
+
item: ApiRequest;
|
9
|
+
};
|
10
|
+
|
11
|
+
export function RequestDetails(props: RequestDetailsProps) {
|
12
|
+
const { item } = props;
|
13
|
+
|
14
|
+
return (
|
15
|
+
<Container
|
16
|
+
className='RequestDetails-container'
|
17
|
+
data-testid='RequestDetails-container'
|
18
|
+
>
|
19
|
+
<Table>
|
20
|
+
<tbody>
|
21
|
+
<Tr>
|
22
|
+
<Td>sequence</Td>
|
23
|
+
<Td>{item.sequence}</Td>
|
24
|
+
</Tr>
|
25
|
+
<Tr>
|
26
|
+
<Td>id</Td>
|
27
|
+
<Td>{item.shortId}</Td>
|
28
|
+
</Tr>
|
29
|
+
<Tr>
|
30
|
+
<Td>apiVerb</Td>
|
31
|
+
<Td>{item.argsApiVerb}</Td>
|
32
|
+
</Tr>
|
33
|
+
<Tr>
|
34
|
+
<Td>connection</Td>
|
35
|
+
<Td>{item.argsConnectionType}</Td>
|
36
|
+
</Tr>
|
37
|
+
<Tr>
|
38
|
+
<Td>duration</Td>
|
39
|
+
<Td>{item.apiDuration}</Td>
|
40
|
+
</Tr>
|
41
|
+
<Tr>
|
42
|
+
<Td>nodeName</Td>
|
43
|
+
<Td>{item.argsNodeName}</Td>
|
44
|
+
</Tr>
|
45
|
+
<Tr>
|
46
|
+
<Td>responseSize</Td>
|
47
|
+
<Td>
|
48
|
+
{item.apiResponseSize &&
|
49
|
+
bytes(item.apiResponseSize)}
|
50
|
+
</Td>
|
51
|
+
</Tr>
|
52
|
+
</tbody>
|
53
|
+
</Table>
|
54
|
+
|
55
|
+
<JsonViewer width={290} json={item.originalAction} />
|
56
|
+
</Container>
|
57
|
+
);
|
58
|
+
}
|
59
|
+
|
60
|
+
export default RequestDetails;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
export const Container = styled.div`
|
4
|
+
flex: 1;
|
5
|
+
border-top: 1px solid #333;
|
6
|
+
max-height: 380px;
|
7
|
+
overflow-y: scroll;
|
8
|
+
|
9
|
+
&::-webkit-scrollbar {
|
10
|
+
width: 8px;
|
11
|
+
}
|
12
|
+
|
13
|
+
/* Track */
|
14
|
+
&::-webkit-scrollbar-track {
|
15
|
+
background: #333;
|
16
|
+
}
|
17
|
+
|
18
|
+
/* Handle */
|
19
|
+
&::-webkit-scrollbar-thumb {
|
20
|
+
background: #555;
|
21
|
+
}
|
22
|
+
|
23
|
+
/* Handle on hover */
|
24
|
+
&::-webkit-scrollbar-thumb:hover {
|
25
|
+
background: #666;
|
26
|
+
}
|
27
|
+
`;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Container } from './RequestJourney.style';
|
3
|
+
import { ApiRequest, JourneyPoint } from 'redux-connected';
|
4
|
+
import JourneyRow from '../JourneyRow/JourneyRow';
|
5
|
+
|
6
|
+
export type RequestJourneyProps = {
|
7
|
+
item: ApiRequest;
|
8
|
+
};
|
9
|
+
|
10
|
+
export function RequestJourney(props: RequestJourneyProps) {
|
11
|
+
const { item } = props;
|
12
|
+
|
13
|
+
function renderItem(point: JourneyPoint, index: number) {
|
14
|
+
return <JourneyRow key={index} point={point} />;
|
15
|
+
}
|
16
|
+
|
17
|
+
function renderItems() {
|
18
|
+
return item.items.map((point: JourneyPoint, index: number) =>
|
19
|
+
renderItem(point, index)
|
20
|
+
);
|
21
|
+
}
|
22
|
+
|
23
|
+
return (
|
24
|
+
<Container
|
25
|
+
className='RequestJourney-container'
|
26
|
+
data-testid='RequestJourney-container'
|
27
|
+
>
|
28
|
+
{renderItems()}
|
29
|
+
</Container>
|
30
|
+
);
|
31
|
+
}
|
32
|
+
|
33
|
+
export default RequestJourney;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
|
3
|
+
export const Container = styled.div<{ index: number }>`
|
4
|
+
flex: 1;
|
5
|
+
display: flex;
|
6
|
+
flex-direction: row;
|
7
|
+
align-items: center;
|
8
|
+
padding: 10px;
|
9
|
+
max-width: 90%;
|
10
|
+
background-color: ${(props) =>
|
11
|
+
props.index % 2 === 1 ? 'rgba(0, 0, 0, 0.2)' : 'transparent'};
|
12
|
+
|
13
|
+
&:hover {
|
14
|
+
background-color: rgba(0, 0, 0, 0.7);
|
15
|
+
cursor: pointer;
|
16
|
+
}
|
17
|
+
`;
|
18
|
+
|
19
|
+
export const Col = styled.div`
|
20
|
+
&:first-child {
|
21
|
+
flex: 1;
|
22
|
+
}
|
23
|
+
`;
|
24
|
+
|
25
|
+
export const Id = styled.div`
|
26
|
+
color: goldenrod;
|
27
|
+
font-size: 16px;
|
28
|
+
`;
|
29
|
+
|
30
|
+
export const Type = styled.div`
|
31
|
+
color: brown;
|
32
|
+
`;
|