@har-analyzer/components 0.0.9 → 0.0.11
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/README.md +125 -43
- package/dist/chunks/har.js +27 -27
- package/dist/chunks/index.js +186 -44
- package/dist/chunks/json.js +10 -0
- package/dist/components/collapsible-key-value-list.d.ts +9 -0
- package/dist/components/collapsible-section.d.ts +5 -0
- package/dist/components/enhanced-board/constants/i18n.d.ts +21 -0
- package/dist/components/enhanced-board/index.d.ts +15 -0
- package/dist/components/enhanced-table.d.ts +47 -0
- package/dist/components/enhanced-top-navigation.d.ts +7 -0
- package/dist/components/error-boundary.d.ts +1 -0
- package/dist/components/horizontal-gap.d.ts +6 -0
- package/dist/components/json-viewer.d.ts +3 -0
- package/dist/components/simple-app-layout.d.ts +6 -0
- package/dist/components/simple-app-preferences/content-width-switcher.d.ts +1 -0
- package/dist/components/simple-app-preferences/index.d.ts +1 -0
- package/dist/components/simple-app-preferences/theme-switcher.d.ts +1 -0
- package/dist/components/vertical-gap.d.ts +6 -0
- package/dist/features/har-analyzer/index.d.ts +5 -0
- package/dist/features/har-analyzer-preferences/index.d.ts +7 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/components/content-type-filter.d.ts +7 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/components/errors-filter.d.ts +6 -0
- package/dist/features/har-entries-viewer/components/har-entries-filters/index.d.ts +1 -0
- package/dist/features/har-entries-viewer/hooks/preferences.d.ts +2 -0
- package/dist/features/har-entries-viewer/index.d.ts +7 -0
- package/dist/features/har-file-uploader/file-upload-error.d.ts +5 -0
- package/dist/features/har-file-uploader/index.d.ts +8 -0
- package/dist/features/list-har-entries/index.d.ts +8 -0
- package/dist/features/view-har-entry/components/content-viewer.d.ts +7 -0
- package/dist/features/view-har-entry/components/headers-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/components/payload-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/components/response-viewer.d.ts +6 -0
- package/dist/features/view-har-entry/index.d.ts +5 -0
- package/dist/har-analyzer-preferences.js +21 -93
- package/dist/har-analyzer.js +72 -75
- package/dist/har-entries-viewer.js +7 -2117
- package/dist/har-file-uploader.js +18 -18
- package/dist/hooks/app-preferences.d.ts +2 -0
- package/dist/hooks/board-preferences.d.ts +2 -0
- package/dist/hooks/table-preferences.d.ts +12 -0
- package/dist/index.d.ts +8 -77
- package/dist/index.js +17 -16
- package/dist/list-har-entries.js +2131 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/content-type.d.ts +4 -0
- package/dist/utils/date.d.ts +2 -0
- package/dist/utils/file-upload.d.ts +3 -0
- package/dist/utils/har.d.ts +17 -0
- package/dist/utils/json.d.ts +1 -0
- package/dist/view-har-entry.js +3130 -0
- package/package.json +3 -3
- package/dist/har-analyzer-preferences.d.ts +0 -18
- package/dist/har-analyzer.d.ts +0 -11
- package/dist/har-content-viewer.d.ts +0 -14
- package/dist/har-content-viewer.js +0 -150
- package/dist/har-entries-filters.d.ts +0 -23
- package/dist/har-entries-filters.js +0 -7
- package/dist/har-entries-viewer.d.ts +0 -26
- package/dist/har-entry-viewer.d.ts +0 -24
- package/dist/har-entry-viewer.js +0 -1145
- package/dist/har-file-uploader.d.ts +0 -16
package/README.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Reusable React components for HAR Analyzer.
|
|
4
4
|
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 📦 **Drop-in Dashboard**: Use the full `<HARAnalyzer />` component for a complete, ready-to-run HTTP Archive visualization tool, or compose individual panels.
|
|
8
|
+
- 🔍 **Advanced Filtering**: Filter network entries quickly by content types (JSON, HTML, JS, CSS, etc.) or error statuses via `<HAREntriesFilters />`.
|
|
9
|
+
- 🕵️ **Deep Inspection**: Inspect detailed request/response headers, decoded payloads, and syntax-highlighted response bodies with `<ViewHAREntry />`.
|
|
10
|
+
- 🛠️ **Persistent Preferences**: Context providers remember user preferences like themes (dark/light mode), table column layouts, and dashboard layouts effortlessly via the `<HARAnalyzerPreferencesProvider />`.
|
|
11
|
+
- 🎨 **Modern UI**: Built on top of the [Cloudscape Design System](https://cloudscape.design/).
|
|
12
|
+
- ⌨️ **Type Safe**: Fully written in TypeScript with exported utility types (`HARContent`, `HAREntry`) for standard HTTP Archive structures.
|
|
13
|
+
|
|
5
14
|
## Installation
|
|
6
15
|
|
|
7
16
|
```sh
|
|
@@ -12,7 +21,75 @@ yarn add @har-analyzer/components
|
|
|
12
21
|
pnpm add @har-analyzer/components
|
|
13
22
|
```
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
### Peer Dependencies
|
|
25
|
+
|
|
26
|
+
This library relies heavily on [Cloudscape Design System](https://cloudscape.design/) and React. Consumers MUST install the following peer dependencies in their own workspace:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install react react-dom \
|
|
30
|
+
@cloudscape-design/components \
|
|
31
|
+
@cloudscape-design/board-components \
|
|
32
|
+
@cloudscape-design/code-view \
|
|
33
|
+
@cloudscape-design/collection-hooks \
|
|
34
|
+
@cloudscape-design/design-tokens \
|
|
35
|
+
@cloudscape-design/global-styles
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage & Setup
|
|
39
|
+
|
|
40
|
+
Clients **must** wrap the components with `HARAnalyzerPreferencesProvider` (to handle user preferences like themes and table settings) and Cloudscape's `<I18nProvider>` (for localization).
|
|
41
|
+
|
|
42
|
+
```jsx
|
|
43
|
+
import enMessages from '@cloudscape-design/components/i18n/messages/all.en.js';
|
|
44
|
+
import { I18nProvider } from '@cloudscape-design/components/i18n';
|
|
45
|
+
import useLocalStorageState from 'use-local-storage-state';
|
|
46
|
+
import HAREntriesViewer from '@har-analyzer/components/har-entries-viewer';
|
|
47
|
+
import HARAnalyzerPreferencesProvider from '@har-analyzer/components/har-analyzer-preferences';
|
|
48
|
+
|
|
49
|
+
// Provide a custom usePreference hook conforming to:
|
|
50
|
+
// (key: string) => readonly [string | undefined, (preference: string) => void]
|
|
51
|
+
const useWebStorage = (key) => useLocalStorageState(key);
|
|
52
|
+
|
|
53
|
+
function App() {
|
|
54
|
+
return (
|
|
55
|
+
<I18nProvider locale="en" messages={[enMessages]}>
|
|
56
|
+
<HARAnalyzerPreferencesProvider usePreferenceStore={useWebStorage}>
|
|
57
|
+
<HAREntriesViewer harEntries={yourHarEntriesArray} />
|
|
58
|
+
</HARAnalyzerPreferencesProvider>
|
|
59
|
+
</I18nProvider>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Imports
|
|
65
|
+
|
|
66
|
+
The library supports both **top-level** imports and **component-level** imports.
|
|
67
|
+
|
|
68
|
+
**Top-level:**
|
|
69
|
+
```javascript
|
|
70
|
+
import {
|
|
71
|
+
HARAnalyzer,
|
|
72
|
+
HARAnalyzerPreferencesProvider,
|
|
73
|
+
HAREntriesViewer,
|
|
74
|
+
HARFileUploader,
|
|
75
|
+
ViewHAREntry,
|
|
76
|
+
ListHAREntries,
|
|
77
|
+
useHAREntriesFilters
|
|
78
|
+
} from '@har-analyzer/components';
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Component-level:**
|
|
82
|
+
```javascript
|
|
83
|
+
import HARAnalyzer from '@har-analyzer/components/har-analyzer';
|
|
84
|
+
import HARAnalyzerPreferencesProvider from '@har-analyzer/components/har-analyzer-preferences';
|
|
85
|
+
import HAREntriesViewer from '@har-analyzer/components/har-entries-viewer';
|
|
86
|
+
import HARFileUploader from '@har-analyzer/components/har-file-uploader';
|
|
87
|
+
import ViewHAREntry from '@har-analyzer/components/view-har-entry';
|
|
88
|
+
import ListHAREntries from '@har-analyzer/components/list-har-entries';
|
|
89
|
+
import useHAREntriesFilters from '@har-analyzer/components/har-entries-filters';
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Components
|
|
16
93
|
|
|
17
94
|
Below are the available exports and their usage examples:
|
|
18
95
|
|
|
@@ -30,22 +107,19 @@ function App() {
|
|
|
30
107
|
|
|
31
108
|
| Name | Type | Required | Description |
|
|
32
109
|
|-----------|-----------------|----------|--------------------------------------|
|
|
33
|
-
| logo | React.ReactNode | No | A logo to display in the header.
|
|
34
|
-
| appName | string | No | The name of the application.
|
|
110
|
+
| logo | React.ReactNode | No | A logo to display in the header. |
|
|
111
|
+
| appName | string | No | The name of the application. |
|
|
35
112
|
|
|
36
113
|
---
|
|
37
114
|
|
|
38
|
-
###
|
|
115
|
+
### HAREntriesViewer
|
|
39
116
|
|
|
40
117
|
```jsx
|
|
41
|
-
import
|
|
118
|
+
import HAREntriesViewer from '@har-analyzer/components/har-entries-viewer';
|
|
42
119
|
|
|
43
120
|
function App() {
|
|
44
121
|
return (
|
|
45
|
-
<
|
|
46
|
-
harFileName="example.har"
|
|
47
|
-
harContent={yourHarContent}
|
|
48
|
-
/>
|
|
122
|
+
<HAREntriesViewer harEntries={yourHarEntriesArray} />
|
|
49
123
|
);
|
|
50
124
|
}
|
|
51
125
|
```
|
|
@@ -54,18 +128,25 @@ function App() {
|
|
|
54
128
|
|
|
55
129
|
| Name | Type | Required | Description |
|
|
56
130
|
|---------------|-------------------------------|----------|--------------------------------------------------|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
131
|
+
| title | string | no | Title of the table displaying the HAR entries |
|
|
132
|
+
| harEntries | HAREntry[] | Yes | An array of HAR entries. |
|
|
59
133
|
|
|
60
134
|
---
|
|
61
135
|
|
|
62
|
-
###
|
|
136
|
+
### ListHAREntries
|
|
137
|
+
|
|
138
|
+
Displays an enhanced table representing a list of HAR entries.
|
|
63
139
|
|
|
64
140
|
```jsx
|
|
65
|
-
import
|
|
141
|
+
import ListHAREntries from '@har-analyzer/components/list-har-entries';
|
|
66
142
|
|
|
67
143
|
function App() {
|
|
68
|
-
return
|
|
144
|
+
return (
|
|
145
|
+
<ListHAREntries
|
|
146
|
+
harEntries={yourHarEntriesArray}
|
|
147
|
+
onChange={(entry) => console.log('Selected:', entry)}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
69
150
|
}
|
|
70
151
|
```
|
|
71
152
|
|
|
@@ -73,73 +154,74 @@ function App() {
|
|
|
73
154
|
|
|
74
155
|
| Name | Type | Required | Description |
|
|
75
156
|
|-----------|-----------|----------|--------------------------------------|
|
|
76
|
-
|
|
|
157
|
+
| harEntries| HAREntry[]| Yes | The entries to display in the table. |
|
|
158
|
+
| onChange | function | Yes | Callback when an entry is selected. |
|
|
77
159
|
|
|
78
160
|
---
|
|
79
161
|
|
|
80
|
-
###
|
|
162
|
+
### ViewHAREntry
|
|
163
|
+
|
|
164
|
+
Displays details for a single selected network entry.
|
|
81
165
|
|
|
82
166
|
```jsx
|
|
83
|
-
import
|
|
167
|
+
import ViewHAREntry from '@har-analyzer/components/view-har-entry';
|
|
84
168
|
|
|
85
169
|
function App() {
|
|
86
|
-
return
|
|
87
|
-
<HARFileUploader
|
|
88
|
-
onChange={({ harContent, harFileName }) => console.log(harContent, harFileName)}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
170
|
+
return <ViewHAREntry harEntry={yourHarEntry} />;
|
|
91
171
|
}
|
|
92
172
|
```
|
|
93
173
|
|
|
94
174
|
**Props:**
|
|
95
175
|
|
|
96
|
-
| Name | Type
|
|
97
|
-
|
|
98
|
-
|
|
|
176
|
+
| Name | Type | Required | Description |
|
|
177
|
+
|-----------|-----------|----------|--------------------------------------|
|
|
178
|
+
| harEntry | HAREntry | Yes | The HAR entry to display details for.|
|
|
99
179
|
|
|
100
|
-
---
|
|
101
180
|
|
|
102
|
-
|
|
181
|
+
---
|
|
103
182
|
|
|
104
|
-
|
|
183
|
+
### HARFileUploader
|
|
105
184
|
|
|
106
185
|
```jsx
|
|
107
|
-
import
|
|
186
|
+
import HARFileUploader from '@har-analyzer/components/har-file-uploader';
|
|
108
187
|
|
|
109
188
|
function App() {
|
|
110
|
-
|
|
111
|
-
|
|
189
|
+
return (
|
|
190
|
+
<HARFileUploader
|
|
191
|
+
onChange={({ harEntries, harFileName }) => console.log(harEntries, harFileName)}
|
|
192
|
+
/>
|
|
193
|
+
);
|
|
112
194
|
}
|
|
113
195
|
```
|
|
114
196
|
|
|
197
|
+
**Props:**
|
|
198
|
+
|
|
199
|
+
| Name | Type | Required | Description |
|
|
200
|
+
|-----------|--------------------------------------------------------------------|----------|--------------------------------------------------|
|
|
201
|
+
| onChange | `(args: { harEntries: HAREntry[]; harFileName?: string }) => void` | Yes | Callback when a HAR file is uploaded. |
|
|
202
|
+
|
|
115
203
|
---
|
|
116
204
|
|
|
117
205
|
### HARAnalyzerPreferencesProvider
|
|
118
206
|
|
|
119
|
-
Provides a persistent context for managing user preferences (like theme, content width, table preferences and board layouts).
|
|
120
|
-
|
|
207
|
+
Provides a persistent context for managing user preferences (like theme, content width, table preferences and board layouts). You must wrap your application in `HARAnalyzerPreferencesProvider` and provide a `usePreferenceStore` hook that bridges external storage (like browser storage or Chrome Extensions API) into the library.
|
|
121
208
|
```jsx
|
|
122
209
|
import HARAnalyzerPreferencesProvider from '@har-analyzer/components/har-analyzer-preferences';
|
|
123
210
|
|
|
124
|
-
|
|
125
|
-
const customStore = {
|
|
126
|
-
getPreference: async (key) => fetch(`/api/prefs/${key}`).then(res => res.text()),
|
|
127
|
-
setPreference: async (key, value) => { await fetch(`/api/prefs/${key}`, { method: 'POST', body: value }) }
|
|
128
|
-
};
|
|
211
|
+
const useWebStorage = (key) => useLocalStorageState(key);
|
|
129
212
|
|
|
130
213
|
function App() {
|
|
131
214
|
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
215
|
+
<HARAnalyzerPreferencesProvider usePreferenceStore={useWebStorage}>
|
|
216
|
+
...your HAR Analyzer components
|
|
217
|
+
</HARAnalyzerPreferencesProvider>
|
|
135
218
|
);
|
|
136
219
|
}
|
|
137
|
-
|
|
138
220
|
```
|
|
139
221
|
|
|
140
222
|
---
|
|
141
223
|
|
|
142
|
-
|
|
224
|
+
## HAR Utilities
|
|
143
225
|
|
|
144
226
|
Various types and utilities for working with HTTP Archive (.har) files are directly exported.
|
|
145
227
|
|
package/dist/chunks/har.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
function
|
|
1
|
+
import { g as a } from "./content-type.js";
|
|
2
|
+
function u(e) {
|
|
3
3
|
if (typeof e != "string")
|
|
4
4
|
throw new TypeError("File contents are invalid. Expected contents to be a stringified JSON.");
|
|
5
5
|
try {
|
|
6
6
|
return JSON.parse(e);
|
|
7
|
-
} catch (
|
|
8
|
-
const
|
|
9
|
-
throw
|
|
7
|
+
} catch (t) {
|
|
8
|
+
const r = "Failed to JSON parse file content";
|
|
9
|
+
throw new Error(r, { cause: t });
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return e
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return r.length ? e.filter((n) => {
|
|
17
|
-
const s = n.response.content.mimeType, o = i(s);
|
|
18
|
-
return r.includes(o);
|
|
12
|
+
function d(e, t) {
|
|
13
|
+
return t.length ? e.filter((n) => {
|
|
14
|
+
const s = n.response.content.mimeType, o = a(s);
|
|
15
|
+
return t.includes(o);
|
|
19
16
|
}) : e;
|
|
20
17
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
return
|
|
18
|
+
function i(e) {
|
|
19
|
+
const t = e.response.status;
|
|
20
|
+
return t < 200 || t >= 400;
|
|
24
21
|
}
|
|
25
|
-
function
|
|
26
|
-
return e.filter((
|
|
22
|
+
function p(e) {
|
|
23
|
+
return e.filter((t) => i(t));
|
|
27
24
|
}
|
|
28
|
-
function
|
|
29
|
-
const
|
|
25
|
+
function f(e, t) {
|
|
26
|
+
const r = /* @__PURE__ */ new Set();
|
|
30
27
|
return e.forEach((n) => {
|
|
31
|
-
n[
|
|
32
|
-
|
|
28
|
+
n[t].headers.forEach((o) => {
|
|
29
|
+
r.add(o.name);
|
|
33
30
|
});
|
|
34
|
-
}), Array.from(
|
|
31
|
+
}), Array.from(r);
|
|
32
|
+
}
|
|
33
|
+
function m(e) {
|
|
34
|
+
return `${e.startedDateTime}_${e.time}_${e.request.url}`;
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
d as a,
|
|
38
|
+
p as b,
|
|
39
39
|
f as c,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
m as d,
|
|
41
|
+
u as g,
|
|
42
|
+
i
|
|
43
43
|
};
|
package/dist/chunks/index.js
CHANGED
|
@@ -1,67 +1,209 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useEffect as L, useCallback as $, useMemo as p } from "react";
|
|
3
|
+
import O from "@cloudscape-design/board-components/board";
|
|
4
|
+
import z from "@cloudscape-design/board-components/board-item";
|
|
5
|
+
import N from "@cloudscape-design/components/button";
|
|
6
|
+
import B from "@cloudscape-design/components/header";
|
|
7
|
+
import P from "../list-har-entries.js";
|
|
8
|
+
import k from "../view-har-entry.js";
|
|
9
|
+
import { useHARAnalyzerPreferences as y } from "../har-analyzer-preferences.js";
|
|
10
|
+
import { d as v, b as x, a as U } from "./har.js";
|
|
11
|
+
import j from "@cloudscape-design/components/space-between";
|
|
12
|
+
import M from "@cloudscape-design/components/multiselect";
|
|
13
|
+
import { C as V } from "./content-type.js";
|
|
14
|
+
import W from "@cloudscape-design/components/segmented-control";
|
|
15
|
+
function Y({ children: e, ...n }) {
|
|
16
|
+
return /* @__PURE__ */ o(j, { direction: "horizontal", size: "s", ...n, children: e });
|
|
10
17
|
}
|
|
11
|
-
const
|
|
18
|
+
const G = {
|
|
19
|
+
dragHandleAriaLabel: "Drag handle",
|
|
20
|
+
dragHandleAriaDescription: "Use Space or Enter to activate drag, arrow keys to move, Space or Enter to submit, or Escape to discard. Be sure to temporarily disable any screen reader navigation feature that may interfere with the functionality of the arrow keys.",
|
|
21
|
+
resizeHandleAriaLabel: "Resize handle",
|
|
22
|
+
resizeHandleAriaDescription: "Use Space or Enter to activate resize, arrow keys to move, Space or Enter to submit, or Escape to discard. Be sure to temporarily disable any screen reader navigation feature that may interfere with the functionality of the arrow keys."
|
|
23
|
+
};
|
|
24
|
+
function u(e, n, t) {
|
|
25
|
+
const r = n.length > 0 ? `Conflicts with ${n.map((s) => s.id).join(", ")}.` : "", i = t.length > 0 ? `Disturbed ${t.length} items.` : "";
|
|
26
|
+
return [e, r, i].filter(Boolean).join(" ");
|
|
27
|
+
}
|
|
28
|
+
const q = {
|
|
29
|
+
liveAnnouncementDndStarted: (e) => e === "resize" ? "Resizing" : "Dragging",
|
|
30
|
+
liveAnnouncementDndItemReordered: (e) => {
|
|
31
|
+
const n = `column ${e.placement.x + 1}`, t = `row ${e.placement.y + 1}`;
|
|
32
|
+
return u(
|
|
33
|
+
`Item moved to ${e.direction === "horizontal" ? n : t}.`,
|
|
34
|
+
e.conflicts,
|
|
35
|
+
e.disturbed
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
liveAnnouncementDndItemResized: (e) => {
|
|
39
|
+
const n = e.isMinimalColumnsReached ? " (minimal)" : "", t = e.isMinimalRowsReached ? " (minimal)" : "", r = e.direction === "horizontal" ? `columns ${e.placement.width}${n}` : `rows ${e.placement.height}${t}`;
|
|
40
|
+
return u(`Item resized to ${r}.`, e.conflicts, e.disturbed);
|
|
41
|
+
},
|
|
42
|
+
liveAnnouncementDndItemInserted: (e) => {
|
|
43
|
+
const n = `column ${e.placement.x + 1}`, t = `row ${e.placement.y + 1}`;
|
|
44
|
+
return u(`Item inserted to ${n}, ${t}.`, e.conflicts, e.disturbed);
|
|
45
|
+
},
|
|
46
|
+
liveAnnouncementDndCommitted: (e) => `${e} committed`,
|
|
47
|
+
liveAnnouncementDndDiscarded: (e) => `${e} discarded`,
|
|
48
|
+
liveAnnouncementItemRemoved: (e) => u(`Removed item ${e.item.id}.`, [], e.disturbed),
|
|
49
|
+
navigationAriaLabel: "Board navigation",
|
|
50
|
+
navigationAriaDescription: "Click on non-empty item to move focus over",
|
|
51
|
+
navigationItemAriaLabel: (e) => e ? e.id : "Empty"
|
|
52
|
+
};
|
|
53
|
+
function J(e) {
|
|
54
|
+
const {
|
|
55
|
+
components: n,
|
|
56
|
+
definitions: t,
|
|
57
|
+
onDefinitionsChange: r,
|
|
58
|
+
empty: i
|
|
59
|
+
} = e;
|
|
60
|
+
return /* @__PURE__ */ o(
|
|
61
|
+
O,
|
|
62
|
+
{
|
|
63
|
+
i18nStrings: q,
|
|
64
|
+
items: t,
|
|
65
|
+
renderItem: ({ id: s }, { removeItem: a }) => {
|
|
66
|
+
const {
|
|
67
|
+
title: l,
|
|
68
|
+
content: E,
|
|
69
|
+
actions: f,
|
|
70
|
+
counter: d,
|
|
71
|
+
canRemove: m
|
|
72
|
+
} = n[s] ?? {};
|
|
73
|
+
return /* @__PURE__ */ o(
|
|
74
|
+
z,
|
|
75
|
+
{
|
|
76
|
+
header: /* @__PURE__ */ o(B, { counter: d, actions: f, children: l }),
|
|
77
|
+
i18nStrings: G,
|
|
78
|
+
settings: m && /* @__PURE__ */ o(N, { variant: "icon", iconName: "close", onClick: a }),
|
|
79
|
+
children: E
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
onItemsChange: ({ detail: { items: s } }) => {
|
|
84
|
+
r(s);
|
|
85
|
+
},
|
|
86
|
+
empty: i
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function K(e, n) {
|
|
91
|
+
return y(`boardDefinitionsPreference_${e}`, n);
|
|
92
|
+
}
|
|
93
|
+
function S() {
|
|
94
|
+
return y("shouldFilterErrors", !1);
|
|
95
|
+
}
|
|
96
|
+
const Q = [];
|
|
97
|
+
function T() {
|
|
98
|
+
return y("contentTypeFilters", Q);
|
|
99
|
+
}
|
|
100
|
+
const D = V.map((e) => ({
|
|
12
101
|
value: e,
|
|
13
102
|
label: e
|
|
14
103
|
}));
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
({ value:
|
|
18
|
-
),
|
|
19
|
-
const
|
|
20
|
-
|
|
104
|
+
function X({ contentTypeFilters: e, onChange: n }) {
|
|
105
|
+
const t = D.filter(
|
|
106
|
+
({ value: i }) => e.includes(i)
|
|
107
|
+
), r = (i) => {
|
|
108
|
+
const s = i.map(({ value: a }) => a);
|
|
109
|
+
n(s);
|
|
21
110
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
111
|
+
return /* @__PURE__ */ o(
|
|
112
|
+
M,
|
|
24
113
|
{
|
|
25
114
|
placeholder: "Filter by content type",
|
|
26
|
-
selectedOptions:
|
|
27
|
-
onChange: ({ detail:
|
|
28
|
-
|
|
115
|
+
selectedOptions: t,
|
|
116
|
+
onChange: ({ detail: i }) => {
|
|
117
|
+
r(i.selectedOptions);
|
|
29
118
|
},
|
|
30
|
-
options:
|
|
119
|
+
options: D
|
|
31
120
|
}
|
|
32
121
|
);
|
|
33
122
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
123
|
+
const A = "ERRORS", Z = "ALL";
|
|
124
|
+
function ee({ shouldFilterErrors: e, onChange: n }) {
|
|
125
|
+
return /* @__PURE__ */ o(
|
|
126
|
+
W,
|
|
38
127
|
{
|
|
39
128
|
options: [
|
|
40
129
|
{ text: "All", id: "ALL" },
|
|
41
|
-
{ text: "Errors", id:
|
|
130
|
+
{ text: "Errors", id: A }
|
|
42
131
|
],
|
|
43
|
-
selectedId: e ?
|
|
44
|
-
onChange: ({ detail:
|
|
45
|
-
const
|
|
46
|
-
|
|
132
|
+
selectedId: e ? A : Z,
|
|
133
|
+
onChange: ({ detail: t }) => {
|
|
134
|
+
const r = t.selectedId === A;
|
|
135
|
+
n(r);
|
|
47
136
|
}
|
|
48
137
|
}
|
|
49
138
|
);
|
|
50
139
|
}
|
|
51
|
-
function
|
|
52
|
-
const [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
140
|
+
function te() {
|
|
141
|
+
const [e, n] = T(), [t, r] = S();
|
|
142
|
+
return /* @__PURE__ */ w(Y, { children: [
|
|
143
|
+
/* @__PURE__ */ o(X, { contentTypeFilters: e, onChange: n }),
|
|
144
|
+
/* @__PURE__ */ o(ee, { shouldFilterErrors: t, onChange: r })
|
|
145
|
+
] });
|
|
146
|
+
}
|
|
147
|
+
const C = 4, F = "har-entries-viewer", H = "selected-har-entry-viewer", _ = [
|
|
148
|
+
{
|
|
149
|
+
id: F,
|
|
150
|
+
rowSpan: C,
|
|
151
|
+
columnSpan: 12
|
|
152
|
+
}
|
|
153
|
+
], ne = [
|
|
154
|
+
..._,
|
|
155
|
+
{
|
|
156
|
+
id: H,
|
|
157
|
+
rowSpan: C,
|
|
158
|
+
columnSpan: 12
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
function Ae(e) {
|
|
162
|
+
const { title: n = "HAR Entries", harEntries: t } = e, [r, i] = I(), [s, a] = I(_);
|
|
163
|
+
L(() => {
|
|
164
|
+
r && (t.map(v).includes(v(r)) || i(void 0));
|
|
165
|
+
}, [t, r]);
|
|
166
|
+
const [l, E] = K(
|
|
167
|
+
"har-contents-viewer",
|
|
168
|
+
ne
|
|
169
|
+
), f = (c) => {
|
|
170
|
+
a(c), c.length > 1 && E(c);
|
|
171
|
+
}, d = $((c) => {
|
|
172
|
+
i(c), s.length === 1 && a(l);
|
|
173
|
+
}, [l, s]), m = p(() => x(t), [t]), [R] = T(), [g] = S(), h = p(() => U(g ? m : t, R), [g, m, t, R]), b = p(() => ({
|
|
174
|
+
[F]: {
|
|
175
|
+
title: n,
|
|
176
|
+
counter: `(${h.length}/${t.length})`,
|
|
177
|
+
actions: /* @__PURE__ */ o(te, {}),
|
|
178
|
+
content: /* @__PURE__ */ o(
|
|
179
|
+
P,
|
|
180
|
+
{
|
|
181
|
+
harEntries: h,
|
|
182
|
+
onChange: d
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
},
|
|
186
|
+
[H]: r ? {
|
|
187
|
+
title: "Details",
|
|
188
|
+
content: /* @__PURE__ */ o(k, { harEntry: r }),
|
|
189
|
+
canRemove: !0
|
|
190
|
+
} : {
|
|
191
|
+
title: "Select an entry to see details",
|
|
192
|
+
content: null,
|
|
193
|
+
canRemove: !0
|
|
194
|
+
}
|
|
195
|
+
}), [h, t, d, r, n]);
|
|
196
|
+
return /* @__PURE__ */ o(
|
|
197
|
+
J,
|
|
198
|
+
{
|
|
199
|
+
components: b,
|
|
200
|
+
definitions: s,
|
|
201
|
+
onDefinitionsChange: f
|
|
202
|
+
}
|
|
58
203
|
);
|
|
59
|
-
return {
|
|
60
|
-
filteredHAREntries: l,
|
|
61
|
-
HAREntriesFilters: E
|
|
62
|
-
};
|
|
63
204
|
}
|
|
64
205
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
206
|
+
Ae as H,
|
|
207
|
+
te as a,
|
|
208
|
+
Y as b
|
|
67
209
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface CollapsibleKeyValueListProps {
|
|
2
|
+
title: string;
|
|
3
|
+
items: {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}[];
|
|
7
|
+
}
|
|
8
|
+
export default function CollapsibleKeyValueList({ title, items }: CollapsibleKeyValueListProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BoardProps } from '@cloudscape-design/board-components';
|
|
2
|
+
export type EnhancedBoardDefinition = Omit<BoardProps.Item, 'data'>;
|
|
3
|
+
export type EnhancedBoardDefinitions = ReadonlyArray<EnhancedBoardDefinition>;
|
|
4
|
+
export declare const boardItemI18nStrings: {
|
|
5
|
+
dragHandleAriaLabel: string;
|
|
6
|
+
dragHandleAriaDescription: string;
|
|
7
|
+
resizeHandleAriaLabel: string;
|
|
8
|
+
resizeHandleAriaDescription: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const boardI18nStrings: {
|
|
11
|
+
liveAnnouncementDndStarted: (operationType: BoardProps.DndOperationType) => "Resizing" | "Dragging";
|
|
12
|
+
liveAnnouncementDndItemReordered: (operation: BoardProps.DndReorderState<undefined>) => string;
|
|
13
|
+
liveAnnouncementDndItemResized: (operation: BoardProps.DndResizeState<undefined>) => string;
|
|
14
|
+
liveAnnouncementDndItemInserted: (operation: BoardProps.DndInsertState<undefined>) => string;
|
|
15
|
+
liveAnnouncementDndCommitted: (operationType: BoardProps.DndOperationType) => string;
|
|
16
|
+
liveAnnouncementDndDiscarded: (operationType: BoardProps.DndOperationType) => string;
|
|
17
|
+
liveAnnouncementItemRemoved: (op: BoardProps.ItemRemovedState<undefined>) => string;
|
|
18
|
+
navigationAriaLabel: string;
|
|
19
|
+
navigationAriaDescription: string;
|
|
20
|
+
navigationItemAriaLabel: (item: BoardProps.Item<undefined> | null) => string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeaderProps } from '@cloudscape-design/components/header';
|
|
2
|
+
import { EnhancedBoardDefinitions } from './constants/i18n';
|
|
3
|
+
export interface EnhancedBoardProps {
|
|
4
|
+
components: Record<string, {
|
|
5
|
+
title: string;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
counter?: string;
|
|
8
|
+
actions?: HeaderProps['actions'];
|
|
9
|
+
canRemove?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
definitions: EnhancedBoardDefinitions;
|
|
12
|
+
onDefinitionsChange: (definitions: EnhancedBoardDefinitions) => void;
|
|
13
|
+
empty?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export default function EnhancedBoard(props: EnhancedBoardProps): import("react/jsx-runtime").JSX.Element;
|