@har-analyzer/components 0.0.10 → 0.0.12

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