redux-connected-devtools 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/DevInspector/DevInspector.js +12 -0
- package/{src/components/DevInspector/DevInspector.style.tsx → dist/components/DevInspector/DevInspector.style.js} +1 -3
- package/dist/components/DevList/DevList.js +24 -0
- package/{src/components/DevList/DevList.style.tsx → dist/components/DevList/DevList.style.js} +2 -4
- package/dist/components/DevMenu/DevMenu.js +25 -0
- package/{src/components/DevMenu/DevMenu.style.tsx → dist/components/DevMenu/DevMenu.style.js} +15 -19
- package/dist/components/DevPanel/DevPanel.js +38 -0
- package/dist/components/DevPanel/DevPanel.style.js +22 -0
- package/dist/components/DevtoolsApp/DevtoolsApp.js +17 -0
- package/dist/components/DevtoolsApp/DevtoolsApp.style.js +11 -0
- package/dist/components/Icon/AllIcons.js +18 -0
- package/dist/components/Icon/Icon.js +9 -0
- package/dist/components/Icon/Icon.style.js +10 -0
- package/{src/components/JourneyRow/JourneyRow.tsx → dist/components/JourneyRow/JourneyRow.js} +9 -32
- package/{src/components/JourneyRow/JourneyRow.style.tsx → dist/components/JourneyRow/JourneyRow.style.js} +7 -12
- package/dist/components/JsonViewer/JsonViewer.js +7 -0
- package/{src/components/JsonViewer/JsonViewer.style.tsx → dist/components/JsonViewer/JsonViewer.style.js} +1 -2
- package/dist/components/Lifecycle/Lifecycle.js +15 -0
- package/{src/components/Lifecycle/Lifecycle.style.tsx → dist/components/Lifecycle/Lifecycle.style.js} +1 -2
- package/dist/components/RequestDetails/RequestDetails.js +10 -0
- package/dist/components/RequestDetails/RequestDetails.style.js +16 -0
- package/dist/components/RequestJourney/RequestJourney.js +14 -0
- package/dist/components/RequestJourney/RequestJourney.style.js +26 -0
- package/dist/components/RequestRow/RequestRow.js +9 -0
- package/{src/components/RequestRow/RequestRow.style.tsx → dist/components/RequestRow/RequestRow.style.js} +6 -10
- package/dist/components/Size/Size.js +10 -0
- package/dist/components/Size/Size.style.js +5 -0
- package/{src/components/Time/Time.tsx → dist/components/Time/Time.js} +3 -17
- package/{src/components/Time/Time.style.tsx → dist/components/Time/Time.style.js} +4 -7
- package/dist/containers/DevMenuContainer.js +11 -0
- package/dist/containers/DevPanelContainer.js +6 -0
- package/dist/containers/DevtoolsAppContainer.js +24 -0
- package/{src/containers/EndpointConfigsContainer.tsx → dist/containers/EndpointConfigsContainer.js} +2 -5
- package/{src/containers/EndpointStatusContainer.tsx → dist/containers/EndpointStatusContainer.js} +2 -5
- package/{src/containers/GlobalSettingsContainer.tsx → dist/containers/GlobalSettingsContainer.js} +2 -5
- package/{src/containers/GlobalStatsContainer.tsx → dist/containers/GlobalStatsContainer.js} +2 -5
- package/{src/containers/LifecycleApiErrorContainer.tsx → dist/containers/LifecycleApiErrorContainer.js} +2 -4
- package/dist/containers/LifecycleFailedContainer.js +9 -0
- package/{src/containers/LifecycleGeneralErrorContainer.tsx → dist/containers/LifecycleGeneralErrorContainer.js} +2 -4
- package/{src/containers/LifecycleInQueueContainer.tsx → dist/containers/LifecycleInQueueContainer.js} +2 -4
- package/{src/containers/LifecyclePendingApiContainer.tsx → dist/containers/LifecyclePendingApiContainer.js} +2 -4
- package/{src/containers/LifecyclePostActionContainer.tsx → dist/containers/LifecyclePostActionContainer.js} +2 -4
- package/{src/containers/LifecycleReceivedContainer.tsx → dist/containers/LifecycleReceivedContainer.js} +2 -4
- package/{src/data/devComponents.tsx → dist/data/devComponents.js} +3 -4
- package/{src/data/devRoutes.ts → dist/data/devRoutes.js} +23 -28
- package/dist/dts/components/DevInspector/DevInspector.d.ts +7 -0
- package/dist/dts/components/DevInspector/DevInspector.style.d.ts +1 -0
- package/dist/dts/components/DevList/DevList.d.ts +9 -0
- package/dist/dts/components/DevList/DevList.style.d.ts +2 -0
- package/dist/dts/components/DevMenu/DevMenu.d.ts +12 -0
- package/dist/dts/components/DevMenu/DevMenu.style.d.ts +7 -0
- package/dist/dts/components/DevPanel/DevPanel.d.ts +6 -0
- package/dist/dts/components/DevPanel/DevPanel.style.d.ts +3 -0
- package/dist/dts/components/DevtoolsApp/DevtoolsApp.d.ts +10 -0
- package/dist/dts/components/DevtoolsApp/DevtoolsApp.style.d.ts +1 -0
- package/dist/dts/components/Icon/AllIcons.d.ts +8 -0
- package/dist/dts/components/Icon/Icon.d.ts +10 -0
- package/dist/dts/components/Icon/Icon.style.d.ts +3 -0
- package/dist/dts/components/JourneyRow/JourneyRow.d.ts +7 -0
- package/dist/dts/components/JourneyRow/JourneyRow.style.d.ts +5 -0
- package/dist/dts/components/JsonViewer/JsonViewer.d.ts +7 -0
- package/dist/dts/components/JsonViewer/JsonViewer.style.d.ts +3 -0
- package/dist/dts/components/Lifecycle/Lifecycle.d.ts +7 -0
- package/dist/dts/components/Lifecycle/Lifecycle.style.d.ts +1 -0
- package/dist/dts/components/RequestDetails/RequestDetails.d.ts +7 -0
- package/dist/dts/components/RequestDetails/RequestDetails.style.d.ts +4 -0
- package/dist/dts/components/RequestJourney/RequestJourney.d.ts +7 -0
- package/dist/dts/components/RequestJourney/RequestJourney.style.d.ts +1 -0
- package/dist/dts/components/RequestRow/RequestRow.d.ts +11 -0
- package/dist/dts/components/RequestRow/RequestRow.style.d.ts +6 -0
- package/dist/dts/components/Size/Size.d.ts +6 -0
- package/dist/dts/components/Size/Size.style.d.ts +1 -0
- package/dist/dts/components/Time/Time.d.ts +6 -0
- package/dist/dts/components/Time/Time.style.d.ts +3 -0
- package/dist/dts/containers/DevMenuContainer.d.ts +8 -0
- package/dist/dts/containers/DevPanelContainer.d.ts +6 -0
- package/dist/dts/containers/DevtoolsAppContainer.d.ts +7 -0
- package/dist/dts/containers/EndpointConfigsContainer.d.ts +3 -0
- package/dist/dts/containers/EndpointStatusContainer.d.ts +3 -0
- package/dist/dts/containers/GlobalSettingsContainer.d.ts +3 -0
- package/dist/dts/containers/GlobalStatsContainer.d.ts +3 -0
- package/dist/dts/containers/LifecycleApiErrorContainer.d.ts +3 -0
- package/dist/dts/containers/LifecycleFailedContainer.d.ts +3 -0
- package/dist/dts/containers/LifecycleGeneralErrorContainer.d.ts +3 -0
- package/dist/dts/containers/LifecycleInQueueContainer.d.ts +3 -0
- package/dist/dts/containers/LifecyclePendingApiContainer.d.ts +3 -0
- package/dist/dts/containers/LifecyclePostActionContainer.d.ts +3 -0
- package/dist/dts/containers/LifecycleReceivedContainer.d.ts +3 -0
- package/dist/dts/data/devComponents.d.ts +4 -0
- package/dist/dts/data/devRoutes.d.ts +8 -0
- package/dist/dts/hooks/useStoreSize.d.ts +7 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/store/selectors.d.ts +2235 -0
- package/dist/dts/types.d.ts +0 -0
- package/dist/dts/utils/date.d.ts +4 -0
- package/dist/dts/utils/download.d.ts +1 -0
- package/dist/hooks/useStoreSize.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/redux-connected-devtools.es.js +992 -0
- package/dist/redux-connected-devtools.es.js.map +1 -0
- package/dist/redux-connected-devtools.umd.js +247 -0
- package/dist/redux-connected-devtools.umd.js.map +1 -0
- package/dist/store/selectors.js +143 -0
- package/dist/types.js +1 -0
- package/dist/utils/date.js +8 -0
- package/dist/utils/download.js +17 -0
- package/package.json +29 -13
- package/.env +0 -2
- package/.prettierrc.js +0 -10
- package/.vscode/settings.json +0 -12
- package/.vscode/tasks.json +0 -33
- package/index.html +0 -58
- package/jest.config.js +0 -8
- package/public/devtools.html +0 -8
- package/public/icon.png +0 -0
- package/public/manifest.json +0 -29
- package/public/options.html +0 -12
- package/public/panel.html +0 -39
- package/public/popup.html +0 -12
- package/src/__tests__/sum.ts +0 -9
- package/src/background.ts +0 -49
- package/src/components/DevInspector/DevInspector.scss +0 -2
- package/src/components/DevInspector/DevInspector.tsx +0 -34
- package/src/components/DevList/DevList.scss +0 -2
- package/src/components/DevList/DevList.tsx +0 -62
- package/src/components/DevMenu/DevMenu.scss +0 -2
- package/src/components/DevMenu/DevMenu.tsx +0 -76
- package/src/components/DevPanel/DevPanel.scss +0 -2
- package/src/components/DevPanel/DevPanel.style.tsx +0 -16
- package/src/components/DevPanel/DevPanel.tsx +0 -51
- package/src/components/JourneyRow/JourneyRow.scss +0 -2
- package/src/components/JsonViewer/JsonViewer.scss +0 -2
- package/src/components/JsonViewer/JsonViewer.tsx +0 -24
- package/src/components/Lifecycle/Lifecycle.scss +0 -2
- package/src/components/Lifecycle/Lifecycle.tsx +0 -31
- package/src/components/LogsViewer/LogsViewer.scss +0 -2
- package/src/components/LogsViewer/LogsViewer.style.tsx +0 -5
- package/src/components/LogsViewer/LogsViewer.tsx +0 -14
- package/src/components/RequestDetails/RequestDetails.scss +0 -2
- package/src/components/RequestDetails/RequestDetails.style.tsx +0 -20
- package/src/components/RequestDetails/RequestDetails.tsx +0 -60
- package/src/components/RequestJourney/RequestJourney.scss +0 -2
- package/src/components/RequestJourney/RequestJourney.style.tsx +0 -6
- package/src/components/RequestJourney/RequestJourney.tsx +0 -33
- package/src/components/RequestRow/RequestRow.scss +0 -2
- package/src/components/RequestRow/RequestRow.tsx +0 -37
- package/src/components/Time/Time.scss +0 -2
- package/src/containers/DevMenuContainer.tsx +0 -28
- package/src/containers/DevPanelContainer.tsx +0 -10
- package/src/content_script.ts +0 -19
- package/src/devtools.tsx +0 -29
- package/src/index.ts +0 -1
- package/src/injected_script.ts +0 -9
- package/src/options.tsx +0 -77
- package/src/panel.tsx +0 -30
- package/src/popup.tsx +0 -63
- package/src/store/initialState.ts +0 -42
- package/src/store/selectors.ts +0 -205
- package/src/sum.ts +0 -3
- package/src/types.ts +0 -1
- package/src/utils/date.ts +0 -3
- package/tsconfig.json +0 -24
- package/vite.config.ts +0 -45
- package/webpack/webpack.common.js +0 -46
- package/webpack/webpack.dev.js +0 -7
- package/webpack/webpack.prod.js +0 -6
@@ -0,0 +1,12 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Container } from './DevInspector.style';
|
3
|
+
import RequestJourney from '../RequestJourney/RequestJourney';
|
4
|
+
import RequestDetails from '../RequestDetails/RequestDetails';
|
5
|
+
export function DevInspector(props) {
|
6
|
+
const { item } = props;
|
7
|
+
if (!item) {
|
8
|
+
return (_jsx(Container, { className: 'DevInspector-container', "data-testid": 'DevInspector-container' }));
|
9
|
+
}
|
10
|
+
return (_jsxs(Container, { className: 'DevInspector-container', "data-testid": 'DevInspector-container', children: [_jsx(RequestDetails, { item: item }), _jsx(RequestJourney, { item: item })] }));
|
11
|
+
}
|
12
|
+
export default DevInspector;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Container, Empty } from './DevList.style';
|
3
|
+
import { FixedSizeList as List } from 'react-window';
|
4
|
+
import classnames from 'classnames';
|
5
|
+
export function DevList(props) {
|
6
|
+
const { row: Cmp, items, selectedRow } = props;
|
7
|
+
const Item = (rowInfo) => {
|
8
|
+
const { index, style } = rowInfo;
|
9
|
+
const item = items[index];
|
10
|
+
const className = classnames({ selected: item.id === selectedRow?.id });
|
11
|
+
return (_jsx(Cmp, { onClick: props.onClick, className: className, index: index, style: style, item: item }));
|
12
|
+
};
|
13
|
+
function renderEmpty() {
|
14
|
+
return _jsx(Empty, { children: "Empty list" });
|
15
|
+
}
|
16
|
+
function renderList() {
|
17
|
+
if (items.length === 0) {
|
18
|
+
return renderEmpty();
|
19
|
+
}
|
20
|
+
return (_jsx(List, { height: 850, itemCount: items.length, itemSize: 68, width: 350, className: 'list', children: Item }));
|
21
|
+
}
|
22
|
+
return (_jsx(Container, { className: 'DevList-container', "data-testid": 'DevList-container', children: renderList() }));
|
23
|
+
}
|
24
|
+
export default DevList;
|
package/{src/components/DevList/DevList.style.tsx → dist/components/DevList/DevList.style.js}
RENAMED
@@ -1,6 +1,5 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
|
3
|
-
export const Container = styled.div`
|
2
|
+
export const Container = styled.div `
|
4
3
|
flex: 1;
|
5
4
|
|
6
5
|
.list {
|
@@ -24,8 +23,7 @@ export const Container = styled.div`
|
|
24
23
|
}
|
25
24
|
}
|
26
25
|
`;
|
27
|
-
|
28
|
-
export const Empty = styled.div`
|
26
|
+
export const Empty = styled.div `
|
29
27
|
color: #456;
|
30
28
|
margin: 30px;
|
31
29
|
font-size: 17px;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Container, MenuGroup, MenuGroupTitle, MenuItem, Title, Badge, BadgeTotal, } from './DevMenu.style';
|
3
|
+
import classnames from 'classnames';
|
4
|
+
export function DevMenu(props) {
|
5
|
+
const { groups, items, selectedId, badges, badgesTotal } = props;
|
6
|
+
function renderItem(item) {
|
7
|
+
const { title, id } = item;
|
8
|
+
const selected = id === selectedId;
|
9
|
+
const badge = badges[id];
|
10
|
+
const badgeTotal = badgesTotal[id];
|
11
|
+
return (_jsxs(MenuItem, { className: classnames({ selected }), onClick: () => props.onClick(item), children: [_jsx(Title, { children: title }), badgeTotal > 0 && badgeTotal !== badge && (_jsx(BadgeTotal, { children: badgeTotal })), badge > 0 && _jsx(Badge, { children: badge })] }, item.id));
|
12
|
+
}
|
13
|
+
function renderItems(groupItems) {
|
14
|
+
return groupItems.map((item) => renderItem(item));
|
15
|
+
}
|
16
|
+
function renderGroup(group) {
|
17
|
+
const groupItems = items.filter((item) => item.group === group);
|
18
|
+
return (_jsxs(MenuGroup, { children: [_jsx(MenuGroupTitle, { children: group }), renderItems(groupItems)] }, group));
|
19
|
+
}
|
20
|
+
function renderGroups() {
|
21
|
+
return groups.map((group) => renderGroup(group));
|
22
|
+
}
|
23
|
+
return (_jsx(Container, { className: 'DevMenu-container', "data-testid": 'DevMenu-container', children: renderGroups() }));
|
24
|
+
}
|
25
|
+
export default DevMenu;
|
package/{src/components/DevMenu/DevMenu.style.tsx → dist/components/DevMenu/DevMenu.style.js}
RENAMED
@@ -1,45 +1,42 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
|
3
|
-
export const Container = styled.div`
|
2
|
+
export const Container = styled.div `
|
4
3
|
width: 190px;
|
5
|
-
|
4
|
+
${(props) => props.theme.borderRight('1px solid rgba(255, 255, 255, 0.2)')}
|
6
5
|
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
7
6
|
`;
|
8
|
-
|
9
|
-
export const MenuGroup = styled.div`
|
7
|
+
export const MenuGroup = styled.div `
|
10
8
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
11
9
|
`;
|
12
|
-
|
13
|
-
export const MenuGroupTitle = styled.div`
|
10
|
+
export const MenuGroupTitle = styled.div `
|
14
11
|
font-size: 13px;
|
15
12
|
padding: 5px 10px;
|
16
13
|
color: rgba(255, 255, 255, 0.5);
|
17
14
|
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
18
15
|
background-color: rgba(0, 0, 0, 0.1);
|
19
16
|
`;
|
20
|
-
|
21
|
-
export const MenuItem = styled.div<{ selected: boolean }>`
|
17
|
+
export const MenuItem = styled.div `
|
22
18
|
display: flex;
|
23
19
|
flex-direction: row;
|
24
20
|
align-items: center;
|
25
21
|
padding: 6px 10px;
|
26
22
|
font-size: 14px;
|
27
|
-
color:
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
color: rgba(255, 255, 255, 0.89);
|
24
|
+
background-color: transparent;
|
25
|
+
|
26
|
+
&.selected {
|
27
|
+
color: gold;
|
28
|
+
background-color: rgba(255, 255, 255, 0.05);
|
29
|
+
}
|
31
30
|
|
32
31
|
&:hover {
|
33
32
|
background-color: rgba(255, 255, 255, 0.1);
|
34
33
|
cursor: pointer;
|
35
34
|
}
|
36
35
|
`;
|
37
|
-
|
38
|
-
export const Title = styled.div`
|
36
|
+
export const Title = styled.div `
|
39
37
|
flex: 1;
|
40
38
|
`;
|
41
|
-
|
42
|
-
export const Badge = styled.div`
|
39
|
+
export const Badge = styled.div `
|
43
40
|
background-color: rgba(0, 0, 80, 0.3);
|
44
41
|
padding: 0 4px;
|
45
42
|
font-size: 12px;
|
@@ -47,7 +44,6 @@ export const Badge = styled.div`
|
|
47
44
|
border: 1px solid #334;
|
48
45
|
color: cyan;
|
49
46
|
`;
|
50
|
-
|
51
|
-
export const BadgeTotal = styled(Badge)`
|
47
|
+
export const BadgeTotal = styled(Badge) `
|
52
48
|
color: #555;
|
53
49
|
`;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import DevMenu from '../../containers/DevMenuContainer';
|
3
|
+
import { useState } from 'react';
|
4
|
+
import { Actions, Container, Content } from './DevPanel.style';
|
5
|
+
import { devComponents } from '../../data/devComponents';
|
6
|
+
import { devRoutes } from '../../data/devRoutes';
|
7
|
+
export function DevPanel(props) {
|
8
|
+
const [route, setRoute] = useState(devRoutes[0]);
|
9
|
+
function renderRoute() {
|
10
|
+
const Cmp = devComponents[route.componentId];
|
11
|
+
return _jsx(Cmp, {}, route.id);
|
12
|
+
}
|
13
|
+
return (_jsxs(Container, { className: 'DevPanel-container', "data-testid": 'DevPanel-container', children: [_jsx(DevMenu, { selectedId: route.id, onClick: (item) => setRoute(item) }), _jsx(Actions, { children: props.children }), _jsx(Content, { children: renderRoute() })] }));
|
14
|
+
}
|
15
|
+
/*
|
16
|
+
for the chrome extension devtools panel
|
17
|
+
TODO: find another way to encapsulate this
|
18
|
+
|
19
|
+
let bgConnection;
|
20
|
+
|
21
|
+
function init(id: string) {
|
22
|
+
bgConnection = chrome.runtime?.connect({
|
23
|
+
name: id,
|
24
|
+
});
|
25
|
+
|
26
|
+
if (bgConnection) {
|
27
|
+
bgConnection.onMessage.addListener((message: Json) => {
|
28
|
+
console.log('message ->', message);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
if (chrome) {
|
34
|
+
const tabId = String(chrome.devtools?.inspectedWindow.tabId ?? '');
|
35
|
+
init(tabId);
|
36
|
+
}
|
37
|
+
*/
|
38
|
+
export default DevPanel;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
export const Container = styled.div `
|
3
|
+
flex: 1;
|
4
|
+
color: #eee;
|
5
|
+
background-color: #232332;
|
6
|
+
display: flex;
|
7
|
+
flex-direction: row;
|
8
|
+
`;
|
9
|
+
export const Content = styled.div `
|
10
|
+
flex: 1;
|
11
|
+
background-color: rgba(0, 0, 0, 0.15);
|
12
|
+
display: flex;
|
13
|
+
flex-direction: column;
|
14
|
+
`;
|
15
|
+
export const Actions = styled.div `
|
16
|
+
position: absolute;
|
17
|
+
bottom: 5px;
|
18
|
+
${(props) => props.theme.left('10px')}
|
19
|
+
display: flex;
|
20
|
+
flex-direction: row;
|
21
|
+
align-items: center;
|
22
|
+
`;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import Icon from '../Icon/Icon';
|
3
|
+
import { useRef } from 'react';
|
4
|
+
import { Container } from './DevtoolsApp.style';
|
5
|
+
import { DevPanelContainer } from '../../containers/DevPanelContainer';
|
6
|
+
import { Provider } from 'react-redux';
|
7
|
+
import Size from '../Size/Size';
|
8
|
+
import classnames from 'classnames';
|
9
|
+
export function DevtoolsApp(props) {
|
10
|
+
const { connectedStore, storeSizeInBytes, isDarkMode } = props;
|
11
|
+
const ref = useRef(null);
|
12
|
+
const className = classnames('DevtoolsApp-container', {
|
13
|
+
darkMode: isDarkMode,
|
14
|
+
});
|
15
|
+
return (_jsx(Container, { ref: ref, className: className, "data-testid": 'DevtoolsApp-container', children: _jsx(Provider, { store: connectedStore, children: _jsxs(DevPanelContainer, { children: [_jsx(Size, { size: storeSizeInBytes }), _jsx(Icon, { name: 'clearAll', onClick: () => props.clearRequests() }), _jsx(Icon, { name: 'download', onClick: props.downloadState })] }) }) }));
|
16
|
+
}
|
17
|
+
export default DevtoolsApp;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
const Download = (props) => {
|
3
|
+
const { size = 24 } = props;
|
4
|
+
return (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', width: `${size}px`, height: `${size}px`, fill: 'currentColor', children: [_jsx("path", { d: 'M0 0h24v24H0z', fill: 'none' }), _jsx("path", { d: 'M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z' })] }));
|
5
|
+
};
|
6
|
+
const Close = (props) => {
|
7
|
+
const { size = 24 } = props;
|
8
|
+
return (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', width: `${size}px`, height: `${size}px`, fill: 'currentColor', children: [_jsx("path", { d: 'M0 0h24v24H0z', fill: 'none' }), _jsx("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' })] }));
|
9
|
+
};
|
10
|
+
const ClearAll = (props) => {
|
11
|
+
const { size = 24 } = props;
|
12
|
+
return (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', viewBox: '0 0 24 24', width: `${size}px`, height: `${size}px`, fill: 'currentColor', children: [_jsx("path", { d: 'M0 0h24v24H0z', fill: 'none' }), _jsx("path", { d: 'M5 13h14v-2H5v2zm-2 4h14v-2H3v2zM7 7v2h14V7H7z' })] }));
|
13
|
+
};
|
14
|
+
export const allIcons = {
|
15
|
+
close: Close,
|
16
|
+
clearAll: ClearAll,
|
17
|
+
download: Download,
|
18
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { allIcons } from './AllIcons';
|
3
|
+
import { Container } from './Icon.style';
|
4
|
+
export function Icon(props) {
|
5
|
+
const { name, size = 20, color } = props;
|
6
|
+
const Cmp = allIcons[name];
|
7
|
+
return (_jsx(Container, { className: 'Icon-container', "data-testid": 'Icon-container', color: color, onClick: props.onClick, children: _jsx(Cmp, { size: size }) }));
|
8
|
+
}
|
9
|
+
export default Icon;
|
package/{src/components/JourneyRow/JourneyRow.tsx → dist/components/JourneyRow/JourneyRow.js}
RENAMED
@@ -1,58 +1,35 @@
|
|
1
|
-
import
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import Time from '../Time/Time';
|
3
3
|
import { Container, Status, DataIcon, Delta, Flex } from './JourneyRow.style';
|
4
|
-
import {
|
5
|
-
|
6
|
-
export type JourneyRowProps = {
|
7
|
-
point: JourneyPoint;
|
8
|
-
};
|
9
|
-
|
10
|
-
const statusMap: Record<LifecycleStatus, string> = {
|
4
|
+
import { LifecycleStatus } from 'redux-connected';
|
5
|
+
const statusMap = {
|
11
6
|
[LifecycleStatus.RECEIVED]: 'Received',
|
7
|
+
[LifecycleStatus.POST_ACTION_OPTIMISTIC]: 'Post action (optimistic)',
|
12
8
|
[LifecycleStatus.IN_QUEUE]: 'In queue',
|
13
9
|
[LifecycleStatus.GENERAL_ERROR]: 'General error',
|
14
10
|
[LifecycleStatus.PENDING_API_RESPONSE]: 'Pending API',
|
15
11
|
[LifecycleStatus.API_ERROR]: 'API error',
|
16
12
|
[LifecycleStatus.POST_ACTION]: 'Post action',
|
13
|
+
[LifecycleStatus.FAILED]: 'Failed',
|
17
14
|
};
|
18
|
-
|
19
|
-
export function JourneyRow(props: JourneyRowProps) {
|
15
|
+
export function JourneyRow(props) {
|
20
16
|
const { point } = props;
|
21
17
|
const { status, timestamp, data, delta = '' } = point;
|
22
|
-
|
23
18
|
function printPoint() {
|
24
19
|
console.log(data);
|
25
20
|
}
|
26
|
-
|
27
21
|
function renderDataIcon() {
|
28
22
|
if (!data) {
|
29
23
|
return null;
|
30
24
|
}
|
31
|
-
|
32
|
-
return <DataIcon>D</DataIcon>;
|
25
|
+
return _jsx(DataIcon, { children: "D" });
|
33
26
|
}
|
34
|
-
|
35
27
|
function renderDelta() {
|
36
28
|
if (!delta) {
|
37
29
|
return null;
|
38
30
|
}
|
39
|
-
|
40
|
-
return <Delta>+{delta.toLocaleString()}</Delta>;
|
31
|
+
return _jsxs(Delta, { children: ["+", delta.toLocaleString()] });
|
41
32
|
}
|
42
|
-
|
43
|
-
return (
|
44
|
-
<Container
|
45
|
-
className='JourneyRow-container'
|
46
|
-
data-testid='JourneyRow-container'
|
47
|
-
onClick={printPoint}
|
48
|
-
>
|
49
|
-
<Status>{statusMap[status]}</Status>
|
50
|
-
{renderDataIcon()}
|
51
|
-
<Flex />
|
52
|
-
{renderDelta()}
|
53
|
-
<Time value={timestamp} />
|
54
|
-
</Container>
|
55
|
-
);
|
33
|
+
return (_jsxs(Container, { className: 'JourneyRow-container', "data-testid": 'JourneyRow-container', onClick: printPoint, children: [_jsx(Status, { children: statusMap[status] }), renderDataIcon(), _jsx(Flex, {}), renderDelta(), _jsx(Time, { value: timestamp })] }));
|
56
34
|
}
|
57
|
-
|
58
35
|
export default JourneyRow;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
|
3
|
-
export const Container = styled.div`
|
2
|
+
export const Container = styled.div `
|
4
3
|
flex: 1;
|
5
4
|
display: flex;
|
6
5
|
flex-direction: row;
|
@@ -16,31 +15,27 @@ export const Container = styled.div`
|
|
16
15
|
cursor: pointer;
|
17
16
|
}
|
18
17
|
`;
|
19
|
-
|
20
|
-
export const Status = styled.div`
|
18
|
+
export const Status = styled.div `
|
21
19
|
color: #aaa;
|
22
20
|
`;
|
23
|
-
|
24
|
-
export const DataIcon = styled.div`
|
21
|
+
export const DataIcon = styled.div `
|
25
22
|
background-color: #000;
|
26
23
|
padding: 3px 7px;
|
27
24
|
font-size: 13px;
|
28
25
|
font-weight: bold;
|
29
26
|
color: purple;
|
30
27
|
border-radius: 5px;
|
31
|
-
|
28
|
+
${(props) => props.theme.marginLeft('10px')}
|
32
29
|
`;
|
33
|
-
|
34
|
-
export const Delta = styled.div`
|
30
|
+
export const Delta = styled.div `
|
35
31
|
font-size: 13px;
|
36
32
|
width: 60px;
|
37
33
|
font-weight: bold;
|
38
34
|
color: olive;
|
39
|
-
|
35
|
+
${(props) => props.theme.marginRight('10px')}
|
40
36
|
text-align: center;
|
41
37
|
font-family: monospace;
|
42
38
|
`;
|
43
|
-
|
44
|
-
export const Flex = styled.div`
|
39
|
+
export const Flex = styled.div `
|
45
40
|
flex: 1;
|
46
41
|
`;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Container } from './JsonViewer.style';
|
3
|
+
export function JsonViewer(props) {
|
4
|
+
const { json, width } = props;
|
5
|
+
return (_jsx(Container, { className: 'JsonViewer-container', "data-testid": 'JsonViewer-container', width: width, children: _jsx("pre", { children: JSON.stringify(json, null, 4) }) }));
|
6
|
+
}
|
7
|
+
export default JsonViewer;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import DevInspector from '../DevInspector/DevInspector';
|
3
|
+
import DevList from '../DevList/DevList';
|
4
|
+
import { useState } from 'react';
|
5
|
+
import RequestRow from '../RequestRow/RequestRow';
|
6
|
+
import { Container } from './Lifecycle.style';
|
7
|
+
export function Lifecycle(props) {
|
8
|
+
const { requests } = props;
|
9
|
+
const [item, setItem] = useState();
|
10
|
+
function onClick(newItem) {
|
11
|
+
setItem(newItem);
|
12
|
+
}
|
13
|
+
return (_jsxs(Container, { className: 'Lifecycle-container', "data-testid": 'Lifecycle-container', children: [_jsx(DevList, { items: requests, row: RequestRow, onClick: onClick, selectedRow: item }), _jsx(DevInspector, { item: item })] }));
|
14
|
+
}
|
15
|
+
export default Lifecycle;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Container, Table, Tr, Td } from './RequestDetails.style';
|
3
|
+
import JsonViewer from '../JsonViewer/JsonViewer';
|
4
|
+
import bytes from 'bytes';
|
5
|
+
export function RequestDetails(props) {
|
6
|
+
const { item } = props;
|
7
|
+
return (_jsxs(Container, { className: 'RequestDetails-container', "data-testid": 'RequestDetails-container', children: [_jsx(Table, { children: _jsxs("tbody", { children: [_jsxs(Tr, { children: [_jsx(Td, { children: "sequence" }), _jsx(Td, { children: item.sequence })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "id" }), _jsx(Td, { children: item.shortId })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "apiVerb" }), _jsx(Td, { children: item.argsApiVerb })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "connection" }), _jsx(Td, { children: item.argsConnectionType })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "duration" }), _jsx(Td, { children: item.apiDuration })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "nodeName" }), _jsx(Td, { children: item.argsNodeName })] }), _jsxs(Tr, { children: [_jsx(Td, { children: "responseSize" }), _jsx(Td, { children: item.apiResponseSize &&
|
8
|
+
bytes(item.apiResponseSize) })] })] }) }), _jsx(JsonViewer, { width: 290, json: item.originalAction })] }));
|
9
|
+
}
|
10
|
+
export default RequestDetails;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
export const Container = styled.div `
|
3
|
+
flex: 1;
|
4
|
+
padding: 20px;
|
5
|
+
`;
|
6
|
+
export const Table = styled.table ``;
|
7
|
+
export const Tr = styled.tr ``;
|
8
|
+
export const Td = styled.td `
|
9
|
+
color: goldenrod;
|
10
|
+
|
11
|
+
&:first-child {
|
12
|
+
color: #778;
|
13
|
+
text-align: right;
|
14
|
+
${(props) => props.theme.paddingRight('10px')}
|
15
|
+
}
|
16
|
+
`;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Container } from './RequestJourney.style';
|
3
|
+
import JourneyRow from '../JourneyRow/JourneyRow';
|
4
|
+
export function RequestJourney(props) {
|
5
|
+
const { item } = props;
|
6
|
+
function renderItem(point, index) {
|
7
|
+
return _jsx(JourneyRow, { point: point }, index);
|
8
|
+
}
|
9
|
+
function renderItems() {
|
10
|
+
return item.items.map((point, index) => renderItem(point, index));
|
11
|
+
}
|
12
|
+
return (_jsx(Container, { className: 'RequestJourney-container', "data-testid": 'RequestJourney-container', children: renderItems() }));
|
13
|
+
}
|
14
|
+
export default RequestJourney;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
export const Container = styled.div `
|
3
|
+
flex: 1;
|
4
|
+
border-top: 1px solid #333;
|
5
|
+
max-height: 380px;
|
6
|
+
overflow-y: scroll;
|
7
|
+
|
8
|
+
&::-webkit-scrollbar {
|
9
|
+
width: 8px;
|
10
|
+
}
|
11
|
+
|
12
|
+
/* Track */
|
13
|
+
&::-webkit-scrollbar-track {
|
14
|
+
background: #333;
|
15
|
+
}
|
16
|
+
|
17
|
+
/* Handle */
|
18
|
+
&::-webkit-scrollbar-thumb {
|
19
|
+
background: #555;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Handle on hover */
|
23
|
+
&::-webkit-scrollbar-thumb:hover {
|
24
|
+
background: #666;
|
25
|
+
}
|
26
|
+
`;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { Container, Col, Id, Type } from './RequestRow.style';
|
3
|
+
import Time from '../Time/Time';
|
4
|
+
export function RequestRow(props) {
|
5
|
+
const { index, style, item, className } = props;
|
6
|
+
const { sequence, createdTS } = item;
|
7
|
+
return (_jsxs(Container, { className: `DevListRow-container ${className}`, "data-testid": 'DevListRow-container', style: style, index: index, onClick: () => props.onClick(item), children: [_jsxs(Col, { children: [_jsx(Id, { children: sequence }), _jsx(Type, { children: item.originalAction?.type })] }), _jsx(Col, { children: _jsx(Time, { value: createdTS }) })] }));
|
8
|
+
}
|
9
|
+
export default RequestRow;
|
@@ -1,31 +1,27 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
|
3
|
-
export const Container = styled.div<{ index: number }>`
|
2
|
+
export const Container = styled.div `
|
4
3
|
flex: 1;
|
5
4
|
display: flex;
|
6
5
|
flex-direction: row;
|
7
6
|
align-items: center;
|
8
7
|
padding: 10px;
|
9
|
-
|
10
|
-
|
8
|
+
max-width: 90%;
|
9
|
+
background-color: ${(props) => props.index % 2 === 1 ? 'rgba(0, 0, 0, 0.2)' : 'transparent'};
|
11
10
|
|
12
11
|
&:hover {
|
13
12
|
background-color: rgba(0, 0, 0, 0.7);
|
14
13
|
cursor: pointer;
|
15
14
|
}
|
16
15
|
`;
|
17
|
-
|
18
|
-
export const Col = styled.div`
|
16
|
+
export const Col = styled.div `
|
19
17
|
&:first-child {
|
20
18
|
flex: 1;
|
21
19
|
}
|
22
20
|
`;
|
23
|
-
|
24
|
-
export const Id = styled.div`
|
21
|
+
export const Id = styled.div `
|
25
22
|
color: goldenrod;
|
26
23
|
font-size: 16px;
|
27
24
|
`;
|
28
|
-
|
29
|
-
export const Type = styled.div`
|
25
|
+
export const Type = styled.div `
|
30
26
|
color: brown;
|
31
27
|
`;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { Container } from './Size.style';
|
3
|
+
import bytes from 'bytes';
|
4
|
+
import { useMemo } from 'react';
|
5
|
+
export function Size(props) {
|
6
|
+
const { size = 0 } = props;
|
7
|
+
const sizeText = useMemo(() => bytes(size), [size]);
|
8
|
+
return (_jsx(Container, { className: 'Size-container', "data-testid": 'Size-container', children: !size ? '-' : sizeText }));
|
9
|
+
}
|
10
|
+
export default Size;
|
@@ -1,25 +1,11 @@
|
|
1
|
-
import
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import { startOfTime } from '../../utils/date';
|
3
3
|
import { Container, Full, Fraction } from './Time.style';
|
4
|
-
|
5
|
-
export type TimeProps = {
|
6
|
-
value: number;
|
7
|
-
};
|
8
|
-
|
9
|
-
export function Time(props: TimeProps) {
|
4
|
+
export function Time(props) {
|
10
5
|
const { value } = props;
|
11
|
-
|
12
6
|
const relativeValue = (value - startOfTime) / 1000;
|
13
|
-
|
14
7
|
const full = Math.floor(relativeValue);
|
15
8
|
const fraction = (relativeValue - full).toFixed(3).split('.').pop();
|
16
|
-
|
17
|
-
return (
|
18
|
-
<Container className='Time-container' data-testid='Time-container'>
|
19
|
-
<Full>{full}</Full>
|
20
|
-
<Fraction>{fraction}</Fraction>
|
21
|
-
</Container>
|
22
|
-
);
|
9
|
+
return (_jsxs(Container, { className: 'Time-container', "data-testid": 'Time-container', children: [_jsx(Full, { children: full }), _jsx(Fraction, { children: fraction })] }));
|
23
10
|
}
|
24
|
-
|
25
11
|
export default Time;
|
@@ -1,17 +1,14 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
|
3
|
-
export const Container = styled.div`
|
4
|
-
color: yellowgreen;
|
2
|
+
export const Container = styled.div `
|
5
3
|
display: flex;
|
6
4
|
flex-direction: row;
|
7
5
|
align-items: flex-start;
|
8
6
|
font-family: monospace;
|
7
|
+
color: #99a;
|
9
8
|
`;
|
10
|
-
|
11
|
-
export const Full = styled.div`
|
9
|
+
export const Full = styled.div `
|
12
10
|
font-size: 24px;
|
13
11
|
`;
|
14
|
-
|
15
|
-
export const Fraction = styled.div`
|
12
|
+
export const Fraction = styled.div `
|
16
13
|
font-size: 12px;
|
17
14
|
`;
|