app-devtools 0.1.0 → 0.3.0
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/dist/main.d.ts +62 -0
- package/dist/main.js +2396 -0
- package/dist/main.umd.cjs +753 -0
- package/package.json +21 -16
- package/.eslintignore +0 -3
- package/.eslintrc.cjs +0 -112
- package/.gitattributes +0 -22
- package/.prettierrc +0 -10
- package/.quokka.ts +0 -115
- package/.vscode/settings.json +0 -7
- package/.vscode/snippets.code-snippets +0 -75
- package/.vscode/tasks.json +0 -17
- package/index.html +0 -46
- package/pnpm-lock.yaml +0 -5313
- package/scripts/check-if-is-sync.sh +0 -6
- package/scripts/filterFetchRequests.ts +0 -60
- package/src/Root.tsx +0 -11
- package/src/assets/icons/caret-down.svg +0 -11
- package/src/assets/icons/network.svg +0 -6
- package/src/assets/icons/search.svg +0 -3
- package/src/assets/icons/send.svg +0 -3
- package/src/assets/icons/settings.svg +0 -3
- package/src/components/ButtonElement.tsx +0 -18
- package/src/components/Icon.tsx +0 -44
- package/src/components/Section.tsx +0 -57
- package/src/components/Select.tsx +0 -101
- package/src/components/ValueVisualizer.tsx +0 -397
- package/src/config/icons.tsx +0 -23
- package/src/initializeApp.tsx +0 -28
- package/src/initializeDevTools.ts +0 -33
- package/src/main.ts +0 -42
- package/src/mocks/mockedRequests.json +0 -28391
- package/src/pages/api-explorer/ApiExplorerMenu.tsx +0 -136
- package/src/pages/api-explorer/ApiExplorerMenuItem.tsx +0 -208
- package/src/pages/api-explorer/Diff.tsx +0 -223
- package/src/pages/api-explorer/RequestDetails.tsx +0 -264
- package/src/pages/api-explorer/Timeline.tsx +0 -174
- package/src/pages/api-explorer/api-explorer.tsx +0 -21
- package/src/pages/api-explorer/getRequestPayload.tsx +0 -15
- package/src/pages/app/App.tsx +0 -79
- package/src/stores/callsStore.ts +0 -267
- package/src/stores/uiStore.ts +0 -15
- package/src/style/globalStyle.ts +0 -54
- package/src/style/helpers/allowTextSelection.ts +0 -7
- package/src/style/helpers/anchorColor.ts +0 -9
- package/src/style/helpers/centerContent.ts +0 -5
- package/src/style/helpers/circle.ts +0 -7
- package/src/style/helpers/ellipsis.ts +0 -8
- package/src/style/helpers/fillContainer.ts +0 -7
- package/src/style/helpers/gradientBorder.ts +0 -28
- package/src/style/helpers/gradientText.ts +0 -8
- package/src/style/helpers/inline.ts +0 -34
- package/src/style/helpers/mountAnim.ts +0 -26
- package/src/style/helpers/multilineEllipsis.ts +0 -8
- package/src/style/helpers/outline.ts +0 -5
- package/src/style/helpers/responsiveSize.ts +0 -27
- package/src/style/helpers/stack.ts +0 -36
- package/src/style/helpers/transition.ts +0 -63
- package/src/style/mediaQueries.ts +0 -6
- package/src/style/reset.ts +0 -75
- package/src/style/scrollBar.ts +0 -37
- package/src/style/theme.ts +0 -35
- package/src/types/global.d.ts +0 -8
- package/src/utils/initializeScreenLogger.ts +0 -12
- package/tsconfig.json +0 -36
- package/tsconfig.prod.json +0 -10
- package/tsup.config.ts +0 -7
- package/utils/arrayUtils.ts +0 -29
- package/utils/assertions.ts +0 -7
- package/utils/autoIncrementId.ts +0 -5
- package/utils/createThemev2.ts +0 -64
- package/utils/cx.ts +0 -27
- package/utils/getDiff.ts +0 -15
- package/utils/hexToRgb.ts +0 -14
- package/utils/objectUtils.ts +0 -3
- package/utils/parseUnit.ts +0 -10
- package/utils/solid.ts +0 -76
- package/utils/truncateText.ts +0 -7
- package/utils/tryExpression.ts +0 -14
- package/utils/typed.ts +0 -23
- package/utils/typings.ts +0 -40
- package/utils/urlPattern.ts +0 -25
- package/vite.config.ts +0 -46
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import ButtonElement from '@src/components/ButtonElement'
|
|
2
|
-
import { Section } from '@src/components/Section'
|
|
3
|
-
import { ValueVisualizer } from '@src/components/ValueVisualizer'
|
|
4
|
-
import { Diff } from '@src/pages/api-explorer/Diff'
|
|
5
|
-
import { ApiCall, callsStore } from '@src/stores/callsStore'
|
|
6
|
-
import { setUiStore, uiStore } from '@src/stores/uiStore'
|
|
7
|
-
import { ellipsis } from '@src/style/helpers/ellipsis'
|
|
8
|
-
import { inline } from '@src/style/helpers/inline'
|
|
9
|
-
import { stack } from '@src/style/helpers/stack'
|
|
10
|
-
import { colors, fonts } from '@src/style/theme'
|
|
11
|
-
import dayjs from 'dayjs'
|
|
12
|
-
import { createMemo } from 'solid-js'
|
|
13
|
-
import { css } from 'solid-styled-components'
|
|
14
|
-
|
|
15
|
-
const containerStyle = css`
|
|
16
|
-
&&& {
|
|
17
|
-
${stack()};
|
|
18
|
-
padding-left: 10px;
|
|
19
|
-
|
|
20
|
-
> h1 {
|
|
21
|
-
margin-top: 12px;
|
|
22
|
-
font-family: ${fonts.decorative};
|
|
23
|
-
${ellipsis};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
> h2 {
|
|
27
|
-
margin-top: 4px;
|
|
28
|
-
font-family: ${fonts.decorative};
|
|
29
|
-
font-size: 12px;
|
|
30
|
-
opacity: 0.5;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.tags {
|
|
34
|
-
${inline({ gap: 8 })};
|
|
35
|
-
margin-top: 8px;
|
|
36
|
-
|
|
37
|
-
.method {
|
|
38
|
-
color: ${colors.primary.var};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.code {
|
|
42
|
-
color: ${colors.success.var};
|
|
43
|
-
|
|
44
|
-
&.error {
|
|
45
|
-
color: ${colors.error.var};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.tag {
|
|
50
|
-
font-size: 11px;
|
|
51
|
-
color: ${colors.warning.var};
|
|
52
|
-
padding: 1px 3px;
|
|
53
|
-
border-radius: 4px;
|
|
54
|
-
border: 1px solid ${colors.warning.alpha(0.6)};
|
|
55
|
-
|
|
56
|
-
&.error {
|
|
57
|
-
color: ${colors.error.var};
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
border-color: ${colors.error.alpha(0.6)};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
> .details {
|
|
65
|
-
margin-top: 14px;
|
|
66
|
-
padding-right: 10px;
|
|
67
|
-
${stack({ gap: 8 })};
|
|
68
|
-
flex: 1 1;
|
|
69
|
-
overflow-y: auto;
|
|
70
|
-
padding-bottom: 20px;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`
|
|
74
|
-
|
|
75
|
-
const tabsStyle = css`
|
|
76
|
-
&&& {
|
|
77
|
-
${inline({ gap: 20 })};
|
|
78
|
-
color: ${colors.secondary.var};
|
|
79
|
-
margin-top: 20px;
|
|
80
|
-
|
|
81
|
-
> button {
|
|
82
|
-
opacity: 0.74;
|
|
83
|
-
padding-bottom: 2px;
|
|
84
|
-
|
|
85
|
-
&.selected {
|
|
86
|
-
border-bottom: 2px solid currentColor;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&.selected,
|
|
90
|
-
&:hover {
|
|
91
|
-
opacity: 1;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
`
|
|
96
|
-
|
|
97
|
-
export const RequestDetails = () => {
|
|
98
|
-
const selectedCallId = $(uiStore.selectedCall)
|
|
99
|
-
const selectedRequestId = $(uiStore.selectedRequest)
|
|
100
|
-
const selectedTab = $(uiStore.selectedTab || 'summary')
|
|
101
|
-
|
|
102
|
-
const selectedRequest = createMemo(() => {
|
|
103
|
-
let selectedCall: ApiCall | undefined
|
|
104
|
-
|
|
105
|
-
if (selectedCallId) {
|
|
106
|
-
selectedCall = callsStore.calls[selectedCallId]
|
|
107
|
-
} else {
|
|
108
|
-
selectedCall = Object.values(callsStore.calls).at(-1)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const selectedRequest =
|
|
112
|
-
(selectedRequestId &&
|
|
113
|
-
selectedCall?.requests.find(
|
|
114
|
-
(request) => request.id === selectedRequestId,
|
|
115
|
-
)) ||
|
|
116
|
-
selectedCall?.requests.at(-1)
|
|
117
|
-
|
|
118
|
-
if (selectedRequest && selectedCall) {
|
|
119
|
-
return {
|
|
120
|
-
...selectedRequest,
|
|
121
|
-
callName: selectedCall.name,
|
|
122
|
-
callPath: selectedCall.path,
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return null
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
function getTab(tabId: string, label: string) {
|
|
130
|
-
return (
|
|
131
|
-
<ButtonElement
|
|
132
|
-
classList={{
|
|
133
|
-
selected: selectedTab === tabId,
|
|
134
|
-
}}
|
|
135
|
-
onClick={() => {
|
|
136
|
-
setUiStore('selectedTab', tabId)
|
|
137
|
-
}}
|
|
138
|
-
>
|
|
139
|
-
{label}
|
|
140
|
-
</ButtonElement>
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<div class={containerStyle}>
|
|
146
|
-
<Show
|
|
147
|
-
when={selectedRequest()}
|
|
148
|
-
keyed
|
|
149
|
-
>
|
|
150
|
-
{(request) => (
|
|
151
|
-
<>
|
|
152
|
-
<h1>
|
|
153
|
-
{request.callName}
|
|
154
|
-
{request.alias && ` | ${request.alias}`}
|
|
155
|
-
</h1>
|
|
156
|
-
|
|
157
|
-
{request.callPath !== request.callName && (
|
|
158
|
-
<h2>{request.callPath}</h2>
|
|
159
|
-
)}
|
|
160
|
-
|
|
161
|
-
<div class="tags">
|
|
162
|
-
{request.method && <div class="method">{request.method}</div>}
|
|
163
|
-
|
|
164
|
-
{request.code && (
|
|
165
|
-
<div
|
|
166
|
-
class="code"
|
|
167
|
-
classList={{
|
|
168
|
-
error: request.code >= 400,
|
|
169
|
-
}}
|
|
170
|
-
>
|
|
171
|
-
{request.code}
|
|
172
|
-
</div>
|
|
173
|
-
)}
|
|
174
|
-
|
|
175
|
-
{request.isError && <div class="tag error">Has Error</div>}
|
|
176
|
-
|
|
177
|
-
<For each={request.tags}>
|
|
178
|
-
{(tag) => <div class="tag">{tag}</div>}
|
|
179
|
-
</For>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<div class={tabsStyle}>
|
|
183
|
-
{getTab('summary', 'Summary')}
|
|
184
|
-
{!!request.payload && getTab('payload', 'Payload')}
|
|
185
|
-
{!!request.searchParams && getTab('urlParams', 'URL Params')}
|
|
186
|
-
{getTab('response', 'Response')}
|
|
187
|
-
{getTab('diff', 'Diff')}
|
|
188
|
-
</div>
|
|
189
|
-
|
|
190
|
-
<div class="details">
|
|
191
|
-
<Switch>
|
|
192
|
-
<Match when={selectedTab === 'summary'}>
|
|
193
|
-
{!!request.payload && (
|
|
194
|
-
<Section title="Payload">
|
|
195
|
-
<ValueVisualizer
|
|
196
|
-
value={request.payload}
|
|
197
|
-
compact
|
|
198
|
-
/>
|
|
199
|
-
</Section>
|
|
200
|
-
)}
|
|
201
|
-
|
|
202
|
-
{!!request.searchParams && (
|
|
203
|
-
<Section title="URL Params">
|
|
204
|
-
<ValueVisualizer
|
|
205
|
-
value={request.searchParams}
|
|
206
|
-
compact
|
|
207
|
-
/>
|
|
208
|
-
</Section>
|
|
209
|
-
)}
|
|
210
|
-
|
|
211
|
-
{!!request.response && (
|
|
212
|
-
<Section title="Response">
|
|
213
|
-
<ValueVisualizer
|
|
214
|
-
value={request.response}
|
|
215
|
-
compact
|
|
216
|
-
/>
|
|
217
|
-
</Section>
|
|
218
|
-
)}
|
|
219
|
-
|
|
220
|
-
<Section title="Stats">
|
|
221
|
-
<ValueVisualizer
|
|
222
|
-
value={{
|
|
223
|
-
'Duration (ms)': Math.round(request.duration),
|
|
224
|
-
'Start Time': `${dayjs(request.startTime).format(
|
|
225
|
-
'HH:mm:ss',
|
|
226
|
-
)} (${dayjs(request.startTime).fromNow()})`,
|
|
227
|
-
}}
|
|
228
|
-
/>
|
|
229
|
-
</Section>
|
|
230
|
-
|
|
231
|
-
<Section title="Metadata">
|
|
232
|
-
<ValueVisualizer value={request.metadata} />
|
|
233
|
-
</Section>
|
|
234
|
-
</Match>
|
|
235
|
-
|
|
236
|
-
<Match when={selectedTab === 'payload'}>
|
|
237
|
-
<Section title={null}>
|
|
238
|
-
<ValueVisualizer value={request.payload} />
|
|
239
|
-
</Section>
|
|
240
|
-
</Match>
|
|
241
|
-
|
|
242
|
-
<Match when={selectedTab === 'response'}>
|
|
243
|
-
<Section title={null}>
|
|
244
|
-
<ValueVisualizer value={request.response} />
|
|
245
|
-
</Section>
|
|
246
|
-
</Match>
|
|
247
|
-
|
|
248
|
-
<Match when={selectedTab === 'urlParams'}>
|
|
249
|
-
<Section title={null}>
|
|
250
|
-
<ValueVisualizer value={request.searchParams} />
|
|
251
|
-
</Section>
|
|
252
|
-
</Match>
|
|
253
|
-
|
|
254
|
-
<Match when={selectedTab === 'diff'}>
|
|
255
|
-
<Diff />
|
|
256
|
-
</Match>
|
|
257
|
-
</Switch>
|
|
258
|
-
</div>
|
|
259
|
-
</>
|
|
260
|
-
)}
|
|
261
|
-
</Show>
|
|
262
|
-
</div>
|
|
263
|
-
)
|
|
264
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import ButtonElement from '@src/components/ButtonElement'
|
|
2
|
-
import { callsStore } from '@src/stores/callsStore'
|
|
3
|
-
import { setUiStore, uiStore } from '@src/stores/uiStore'
|
|
4
|
-
import { ellipsis } from '@src/style/helpers/ellipsis'
|
|
5
|
-
import { inline } from '@src/style/helpers/inline'
|
|
6
|
-
import { stack } from '@src/style/helpers/stack'
|
|
7
|
-
import { colors, fonts } from '@src/style/theme'
|
|
8
|
-
import { reverseCopy } from '@utils/arrayUtils'
|
|
9
|
-
import dayjs from 'dayjs'
|
|
10
|
-
import { createMemo } from 'solid-js'
|
|
11
|
-
import { css } from 'solid-styled-components'
|
|
12
|
-
import { getRequestPayload } from './getRequestPayload'
|
|
13
|
-
|
|
14
|
-
const containerStyle = css`
|
|
15
|
-
&&& {
|
|
16
|
-
${stack()};
|
|
17
|
-
border-right: 1px solid ${colors.white.alpha(0.1)};
|
|
18
|
-
|
|
19
|
-
> h1 {
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
padding-left: 12px;
|
|
22
|
-
padding-top: 10px;
|
|
23
|
-
font-family: ${fonts.decorative};
|
|
24
|
-
color: ${colors.secondary.var};
|
|
25
|
-
padding-bottom: 16px;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`
|
|
29
|
-
|
|
30
|
-
const itemsContainerStyle = css`
|
|
31
|
-
&&& {
|
|
32
|
-
${stack()};
|
|
33
|
-
flex: 1 1;
|
|
34
|
-
overflow-y: auto;
|
|
35
|
-
}
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
const requestItemStyle = css`
|
|
39
|
-
&&& {
|
|
40
|
-
font-size: 13px;
|
|
41
|
-
${stack()};
|
|
42
|
-
|
|
43
|
-
&.error {
|
|
44
|
-
color: ${colors.error.var};
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
> button {
|
|
49
|
-
padding: 4px 12px;
|
|
50
|
-
${inline({ gap: 8 })};
|
|
51
|
-
opacity: 0.8;
|
|
52
|
-
|
|
53
|
-
&.selected {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
background-color: ${colors.secondary.alpha(0.16)};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
> .start-time {
|
|
59
|
-
font-family: ${fonts.decorative};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
> .separator {
|
|
63
|
-
opacity: 0.5;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
> .payload {
|
|
67
|
-
${ellipsis};
|
|
68
|
-
flex-shrink: 1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`
|
|
73
|
-
|
|
74
|
-
const emptyStateStyle = css`
|
|
75
|
-
&&& {
|
|
76
|
-
opacity: 0.4;
|
|
77
|
-
font-size: 14px;
|
|
78
|
-
padding: 12px;
|
|
79
|
-
padding-top: 0;
|
|
80
|
-
}
|
|
81
|
-
`
|
|
82
|
-
|
|
83
|
-
export const Timeline = () => {
|
|
84
|
-
const selectedCall = createMemo(() => {
|
|
85
|
-
const selectedCallId = uiStore.selectedCall
|
|
86
|
-
|
|
87
|
-
if (!selectedCallId) {
|
|
88
|
-
const callsEntries = Object.values(callsStore.calls).at(-1)
|
|
89
|
-
|
|
90
|
-
return callsEntries || null
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (selectedCallId) {
|
|
94
|
-
return callsStore.calls[selectedCallId]
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return null
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
const requests = createMemo(() => {
|
|
101
|
-
const reversed = reverseCopy(selectedCall()?.requests)
|
|
102
|
-
return reversed.length === 0 ? null : reversed
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
const filteredRequests = createMemo(() => {
|
|
106
|
-
if (uiStore.selectedSubitem) {
|
|
107
|
-
return requests()?.filter((request) => {
|
|
108
|
-
return request.alias === uiStore.selectedSubitem
|
|
109
|
-
})
|
|
110
|
-
} else {
|
|
111
|
-
return requests()
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
|
|
115
|
-
const selectedRequestId = $(
|
|
116
|
-
uiStore.selectedRequest || filteredRequests()?.[0]?.id,
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<div class={containerStyle}>
|
|
121
|
-
<h1>timeline</h1>
|
|
122
|
-
|
|
123
|
-
<div class={itemsContainerStyle}>
|
|
124
|
-
<For
|
|
125
|
-
each={filteredRequests()}
|
|
126
|
-
fallback={<div class={emptyStateStyle}>no requests found</div>}
|
|
127
|
-
>
|
|
128
|
-
{(request) => {
|
|
129
|
-
const startTime = dayjs(request.startTime)
|
|
130
|
-
const formattedStartTime = startTime.format('HH:mm:ss')
|
|
131
|
-
const relativeStartTime = startTime.fromNow()
|
|
132
|
-
|
|
133
|
-
const payload = getRequestPayload(request)
|
|
134
|
-
|
|
135
|
-
return (
|
|
136
|
-
<div
|
|
137
|
-
class={requestItemStyle}
|
|
138
|
-
classList={{ error: request.isError }}
|
|
139
|
-
>
|
|
140
|
-
<ButtonElement
|
|
141
|
-
onClick={() => {
|
|
142
|
-
setUiStore('selectedRequest', request.id)
|
|
143
|
-
}}
|
|
144
|
-
classList={{
|
|
145
|
-
selected: request.id === selectedRequestId,
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<span
|
|
149
|
-
class="start-time"
|
|
150
|
-
title={relativeStartTime}
|
|
151
|
-
>
|
|
152
|
-
{formattedStartTime}
|
|
153
|
-
</span>
|
|
154
|
-
|
|
155
|
-
{!!payload && (
|
|
156
|
-
<>
|
|
157
|
-
<span class="separator">|</span>
|
|
158
|
-
<span
|
|
159
|
-
class="payload"
|
|
160
|
-
title={payload}
|
|
161
|
-
>
|
|
162
|
-
{payload}
|
|
163
|
-
</span>
|
|
164
|
-
</>
|
|
165
|
-
)}
|
|
166
|
-
</ButtonElement>
|
|
167
|
-
</div>
|
|
168
|
-
)
|
|
169
|
-
}}
|
|
170
|
-
</For>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
)
|
|
174
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ApiExplorerMenu } from '@src/pages/api-explorer/ApiExplorerMenu'
|
|
2
|
-
import { RequestDetails } from '@src/pages/api-explorer/RequestDetails'
|
|
3
|
-
import { Timeline } from '@src/pages/api-explorer/Timeline'
|
|
4
|
-
import { css } from 'solid-styled-components'
|
|
5
|
-
|
|
6
|
-
const containerStyle = css`
|
|
7
|
-
&&& {
|
|
8
|
-
display: grid;
|
|
9
|
-
grid-template-columns: 1.5fr 1fr 3fr;
|
|
10
|
-
}
|
|
11
|
-
`
|
|
12
|
-
|
|
13
|
-
export const ApiExplorerPage = () => {
|
|
14
|
-
return (
|
|
15
|
-
<div class={containerStyle}>
|
|
16
|
-
<ApiExplorerMenu />
|
|
17
|
-
<Timeline />
|
|
18
|
-
<RequestDetails />
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ApiRequest } from '@src/stores/callsStore';
|
|
2
|
-
|
|
3
|
-
export function getRequestPayload(request: ApiRequest) {
|
|
4
|
-
const payload = request.alias || request.payload || request.searchParams;
|
|
5
|
-
|
|
6
|
-
if (!payload || Object.keys(payload).length === 0) {
|
|
7
|
-
return '';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (typeof payload === 'string' || typeof payload === 'number') {
|
|
11
|
-
return String(payload);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return JSON.stringify(payload);
|
|
15
|
-
}
|
package/src/pages/app/App.tsx
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import ButtonElement from '@src/components/ButtonElement'
|
|
2
|
-
import Icon from '@src/components/Icon'
|
|
3
|
-
import { unmountApp } from '@src/initializeApp'
|
|
4
|
-
import { ApiExplorerPage } from '@src/pages/api-explorer/api-explorer'
|
|
5
|
-
import { globalStyle } from '@src/style/globalStyle'
|
|
6
|
-
import { centerContent } from '@src/style/helpers/centerContent'
|
|
7
|
-
import { fillContainer } from '@src/style/helpers/fillContainer'
|
|
8
|
-
import { stack } from '@src/style/helpers/stack'
|
|
9
|
-
import { resetStyle } from '@src/style/reset'
|
|
10
|
-
import { colors } from '@src/style/theme'
|
|
11
|
-
import { css } from 'goober'
|
|
12
|
-
|
|
13
|
-
const containerStyle = css`
|
|
14
|
-
${resetStyle};
|
|
15
|
-
${globalStyle};
|
|
16
|
-
|
|
17
|
-
position: fixed;
|
|
18
|
-
inset: 32px;
|
|
19
|
-
border-radius: 4px;
|
|
20
|
-
background: ${colors.bgPrimary.var};
|
|
21
|
-
display: grid;
|
|
22
|
-
grid-template-columns: 51px 1fr;
|
|
23
|
-
|
|
24
|
-
nav {
|
|
25
|
-
${stack()};
|
|
26
|
-
border-right: 1px solid ${colors.white.alpha(0.1)};
|
|
27
|
-
|
|
28
|
-
button {
|
|
29
|
-
${centerContent};
|
|
30
|
-
width: 100%;
|
|
31
|
-
aspect-ratio: 1 / 1;
|
|
32
|
-
color: ${colors.bgPrimary.var};
|
|
33
|
-
--icon-size: 30px;
|
|
34
|
-
|
|
35
|
-
&::before {
|
|
36
|
-
content: '';
|
|
37
|
-
inset: 6px;
|
|
38
|
-
border-radius: 3px;
|
|
39
|
-
position: absolute;
|
|
40
|
-
background: ${colors.primary.var};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
> main > * {
|
|
46
|
-
${fillContainer};
|
|
47
|
-
}
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
const backdropStyle = css`
|
|
51
|
-
${fillContainer};
|
|
52
|
-
position: fixed;
|
|
53
|
-
inset: 0;
|
|
54
|
-
`
|
|
55
|
-
|
|
56
|
-
export const App = () => {
|
|
57
|
-
return (
|
|
58
|
-
<>
|
|
59
|
-
<div
|
|
60
|
-
class={backdropStyle}
|
|
61
|
-
onClick={unmountApp}
|
|
62
|
-
/>
|
|
63
|
-
<div
|
|
64
|
-
class={containerStyle}
|
|
65
|
-
id="dev-tools-root-element"
|
|
66
|
-
>
|
|
67
|
-
<nav>
|
|
68
|
-
<ButtonElement title="API Explorer">
|
|
69
|
-
<Icon name="network" />
|
|
70
|
-
</ButtonElement>
|
|
71
|
-
</nav>
|
|
72
|
-
|
|
73
|
-
<main>
|
|
74
|
-
<ApiExplorerPage />
|
|
75
|
-
</main>
|
|
76
|
-
</div>
|
|
77
|
-
</>
|
|
78
|
-
)
|
|
79
|
-
}
|