@har-analyzer/components 0.0.16 → 0.0.17
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 +50 -25
- package/dist/chunks/collapsible-key-value-list.js +5 -5
- package/dist/chunks/content-viewer.js +146 -140
- package/dist/chunks/context.js +5 -0
- package/dist/chunks/index.js +588 -521
- package/dist/chunks/provider.js +11 -0
- package/dist/components/collapsible-section.d.ts +1 -1
- package/dist/components/enhanced-table.d.ts +10 -2
- package/dist/context/user-preferences/index.d.ts +6 -0
- package/dist/context/user-preferences/provider.d.ts +9 -0
- package/dist/context/user-preferences-store/context.d.ts +5 -0
- package/dist/context/user-preferences-store/hooks.d.ts +1 -0
- package/dist/context/user-preferences-store/provider.d.ts +5 -0
- package/dist/features/har-analyzer/components/app-layout.d.ts +7 -0
- package/dist/features/har-analyzer/components/preferences/index.d.ts +1 -0
- package/dist/features/har-analyzer/components/top-navigation.d.ts +8 -0
- package/dist/features/har-analyzer/context/preferences.d.ts +2 -0
- package/dist/features/har-analyzer-preferences-store/index.d.ts +2 -0
- package/dist/features/har-entries-viewer/index.d.ts +0 -1
- package/dist/features/list-har-entries/components/compare-mode-switcher.d.ts +1 -6
- package/dist/features/list-har-entries/components/content-type-filter.d.ts +1 -7
- package/dist/features/list-har-entries/components/errors-filter.d.ts +1 -6
- package/dist/features/list-har-entries/components/har-entries-table.d.ts +8 -0
- package/dist/features/list-har-entries/context/preferences.d.ts +5 -0
- package/dist/features/list-har-entries/index.d.ts +3 -9
- package/dist/har-analyzer-preferences-store.js +4 -0
- package/dist/har-analyzer.js +93 -87
- package/dist/har-entries-viewer.js +80 -79
- package/dist/index.d.ts +7 -1
- package/dist/index.js +9 -9
- package/dist/list-har-entries.js +2 -6
- package/dist/utils/har.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/json.js +0 -10
- package/dist/components/enhanced-top-navigation.d.ts +0 -7
- package/dist/components/simple-app-layout.d.ts +0 -6
- package/dist/components/simple-app-preferences/index.d.ts +0 -1
- package/dist/features/har-analyzer-preferences/index.d.ts +0 -7
- package/dist/features/list-har-entries/hooks/preferences.d.ts +0 -2
- package/dist/har-analyzer-preferences.js +0 -25
- package/dist/hooks/app-preferences.d.ts +0 -2
- package/dist/hooks/compare-mode-preference.d.ts +0 -1
- package/dist/hooks/table-preferences.d.ts +0 -12
- /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/content-width-switcher.d.ts +0 -0
- /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/theme-switcher.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useEffect as T, useCallback as _ } from "react";
|
|
3
3
|
import z from "@cloudscape-design/board-components/board";
|
|
4
4
|
import N from "@cloudscape-design/board-components/board-item";
|
|
5
5
|
import B from "@cloudscape-design/components/button";
|
|
@@ -12,153 +12,154 @@ const P = {
|
|
|
12
12
|
resizeHandleAriaLabel: "Resize handle",
|
|
13
13
|
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."
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
return [n,
|
|
15
|
+
function p(n, t, r) {
|
|
16
|
+
const a = t.length > 0 ? `Conflicts with ${t.map((d) => d.id).join(", ")}.` : "", m = r.length > 0 ? `Disturbed ${r.length} items.` : "";
|
|
17
|
+
return [n, a, m].filter(Boolean).join(" ");
|
|
18
18
|
}
|
|
19
19
|
const M = {
|
|
20
20
|
liveAnnouncementDndStarted: (n) => n === "resize" ? "Resizing" : "Dragging",
|
|
21
21
|
liveAnnouncementDndItemReordered: (n) => {
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
`Item moved to ${n.direction === "horizontal" ?
|
|
22
|
+
const t = `column ${n.placement.x + 1}`, r = `row ${n.placement.y + 1}`;
|
|
23
|
+
return p(
|
|
24
|
+
`Item moved to ${n.direction === "horizontal" ? t : r}.`,
|
|
25
25
|
n.conflicts,
|
|
26
26
|
n.disturbed
|
|
27
27
|
);
|
|
28
28
|
},
|
|
29
29
|
liveAnnouncementDndItemResized: (n) => {
|
|
30
|
-
const
|
|
31
|
-
return
|
|
30
|
+
const t = n.isMinimalColumnsReached ? " (minimal)" : "", r = n.isMinimalRowsReached ? " (minimal)" : "", a = n.direction === "horizontal" ? `columns ${n.placement.width}${t}` : `rows ${n.placement.height}${r}`;
|
|
31
|
+
return p(`Item resized to ${a}.`, n.conflicts, n.disturbed);
|
|
32
32
|
},
|
|
33
33
|
liveAnnouncementDndItemInserted: (n) => {
|
|
34
|
-
const
|
|
35
|
-
return
|
|
34
|
+
const t = `column ${n.placement.x + 1}`, r = `row ${n.placement.y + 1}`;
|
|
35
|
+
return p(`Item inserted to ${t}, ${r}.`, n.conflicts, n.disturbed);
|
|
36
36
|
},
|
|
37
37
|
liveAnnouncementDndCommitted: (n) => `${n} committed`,
|
|
38
38
|
liveAnnouncementDndDiscarded: (n) => `${n} discarded`,
|
|
39
|
-
liveAnnouncementItemRemoved: (n) =>
|
|
39
|
+
liveAnnouncementItemRemoved: (n) => p(`Removed item ${n.item.id}.`, [], n.disturbed),
|
|
40
40
|
navigationAriaLabel: "Board navigation",
|
|
41
41
|
navigationAriaDescription: "Click on non-empty item to move focus over",
|
|
42
42
|
navigationItemAriaLabel: (n) => n ? n.id : "Empty"
|
|
43
43
|
};
|
|
44
44
|
function V(n) {
|
|
45
45
|
const {
|
|
46
|
-
components:
|
|
47
|
-
definitions:
|
|
48
|
-
onDefinitionsChange:
|
|
49
|
-
empty:
|
|
46
|
+
components: t,
|
|
47
|
+
definitions: r,
|
|
48
|
+
onDefinitionsChange: a,
|
|
49
|
+
empty: m
|
|
50
50
|
} = n;
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ l(
|
|
52
52
|
z,
|
|
53
53
|
{
|
|
54
54
|
i18nStrings: M,
|
|
55
|
-
items:
|
|
56
|
-
renderItem: ({ data:
|
|
57
|
-
const { componentKey:
|
|
58
|
-
let h,
|
|
59
|
-
const
|
|
60
|
-
if (typeof
|
|
61
|
-
const
|
|
62
|
-
h =
|
|
55
|
+
items: r,
|
|
56
|
+
renderItem: ({ data: d }) => {
|
|
57
|
+
const { componentKey: f, instanceId: I } = d;
|
|
58
|
+
let h, o;
|
|
59
|
+
const e = t[f];
|
|
60
|
+
if (typeof e == "function") {
|
|
61
|
+
const i = e(I);
|
|
62
|
+
h = i.content, o = i.onRemove;
|
|
63
63
|
} else
|
|
64
|
-
h =
|
|
65
|
-
return /* @__PURE__ */
|
|
64
|
+
h = e?.content, o = e?.onRemove;
|
|
65
|
+
return /* @__PURE__ */ l(
|
|
66
66
|
N,
|
|
67
67
|
{
|
|
68
68
|
disableContentPaddings: !0,
|
|
69
69
|
i18nStrings: P,
|
|
70
|
-
settings:
|
|
70
|
+
settings: o && /* @__PURE__ */ l(B, { variant: "icon", iconName: "close", onClick: o }),
|
|
71
71
|
children: h
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
},
|
|
75
|
-
onItemsChange: ({ detail: { items:
|
|
76
|
-
|
|
75
|
+
onItemsChange: ({ detail: { items: d } }) => {
|
|
76
|
+
a(d);
|
|
77
77
|
},
|
|
78
|
-
empty:
|
|
78
|
+
empty: m
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const E = {
|
|
83
83
|
rowSpan: 4,
|
|
84
84
|
columnSpan: 12
|
|
85
|
-
},
|
|
85
|
+
}, u = "har-entries-viewer", S = "view-har-entry", x = [
|
|
86
86
|
{
|
|
87
|
-
...
|
|
88
|
-
id:
|
|
87
|
+
...E,
|
|
88
|
+
id: u,
|
|
89
89
|
data: {
|
|
90
|
-
componentKey:
|
|
91
|
-
instanceId:
|
|
90
|
+
componentKey: u,
|
|
91
|
+
instanceId: u
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
];
|
|
95
95
|
function Q(n) {
|
|
96
96
|
const {
|
|
97
|
-
harEntries:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
} = n, [l, a] = S([]), [A, f] = S(x);
|
|
97
|
+
harEntries: t,
|
|
98
|
+
tableTitle: r
|
|
99
|
+
} = n, [a, m] = w([]), [d, f] = w(x);
|
|
101
100
|
T(() => {
|
|
102
|
-
const o = new Set(
|
|
103
|
-
|
|
104
|
-
if (!
|
|
105
|
-
return
|
|
106
|
-
const
|
|
101
|
+
const o = new Set(t.map(g));
|
|
102
|
+
m((e) => {
|
|
103
|
+
if (!e.length)
|
|
104
|
+
return e;
|
|
105
|
+
const i = e.filter(
|
|
107
106
|
(c) => o.has(g(c))
|
|
108
107
|
);
|
|
109
|
-
return
|
|
108
|
+
return i.length !== e.length ? i : e;
|
|
110
109
|
});
|
|
111
|
-
}, [
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const
|
|
110
|
+
}, [t]);
|
|
111
|
+
const I = _((o) => {
|
|
112
|
+
m(o);
|
|
113
|
+
const e = o.map(g), i = new Set(e);
|
|
115
114
|
f((c) => {
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
return
|
|
119
|
-
const
|
|
120
|
-
rowSpan:
|
|
121
|
-
columnSpan:
|
|
115
|
+
const A = c.filter(({ data: { instanceId: s } }) => i.has(s) || s === u), R = new Set(A.map(({ data: { instanceId: s } }) => s)), v = e.filter((s) => !R.has(s));
|
|
116
|
+
if (!v.length)
|
|
117
|
+
return A;
|
|
118
|
+
const y = c.at(-1), D = y?.rowSpan ?? E.rowSpan, b = y?.columnSpan ?? E.columnSpan, $ = v.map((s) => ({
|
|
119
|
+
rowSpan: D,
|
|
120
|
+
columnSpan: b,
|
|
122
121
|
data: {
|
|
123
|
-
componentKey:
|
|
122
|
+
componentKey: S,
|
|
124
123
|
instanceId: s
|
|
125
124
|
}
|
|
126
125
|
}));
|
|
127
|
-
return [...
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
return [...A, ...$].map((s, C) => {
|
|
127
|
+
const { data: { instanceId: H } } = s;
|
|
128
|
+
return {
|
|
129
|
+
...s,
|
|
130
|
+
id: H === u ? u : String(C)
|
|
131
|
+
};
|
|
132
|
+
});
|
|
131
133
|
});
|
|
132
|
-
}, []),
|
|
133
|
-
[
|
|
134
|
-
content: /* @__PURE__ */
|
|
134
|
+
}, []), h = {
|
|
135
|
+
[u]: {
|
|
136
|
+
content: /* @__PURE__ */ l(O, { children: /* @__PURE__ */ l(
|
|
135
137
|
k,
|
|
136
138
|
{
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
onSelectionChange: h
|
|
139
|
+
title: r,
|
|
140
|
+
harEntries: t,
|
|
141
|
+
selectedHAREntries: a,
|
|
142
|
+
onSelectionChange: I
|
|
142
143
|
}
|
|
143
144
|
) })
|
|
144
145
|
},
|
|
145
|
-
[
|
|
146
|
-
const
|
|
146
|
+
[S]: (o) => {
|
|
147
|
+
const e = a.find((i) => g(i) === o);
|
|
147
148
|
return {
|
|
148
|
-
content:
|
|
149
|
+
content: e ? /* @__PURE__ */ l(L, { harEntry: e }) : void 0,
|
|
149
150
|
onRemove: () => {
|
|
150
|
-
f((
|
|
151
|
-
(
|
|
151
|
+
f((i) => i.filter((c) => c.data.instanceId !== o)), m(
|
|
152
|
+
(i) => i.filter((c) => g(c) !== o)
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
157
|
};
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ l(
|
|
158
159
|
V,
|
|
159
160
|
{
|
|
160
|
-
components:
|
|
161
|
-
definitions:
|
|
161
|
+
components: h,
|
|
162
|
+
definitions: d,
|
|
162
163
|
onDefinitionsChange: f
|
|
163
164
|
}
|
|
164
165
|
);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export { default as HARAnalyzer } from './features/har-analyzer';
|
|
2
|
-
export
|
|
2
|
+
export type * from './features/har-analyzer';
|
|
3
|
+
export { default as HARAnalyzerPreferencesStore } from './features/har-analyzer-preferences-store';
|
|
4
|
+
export type * from './features/har-analyzer-preferences-store';
|
|
3
5
|
export { default as HAREntriesViewer } from './features/har-entries-viewer';
|
|
6
|
+
export type * from './features/har-entries-viewer';
|
|
4
7
|
export { default as HARFileUploader } from './features/har-file-uploader';
|
|
8
|
+
export type * from './features/har-file-uploader';
|
|
5
9
|
export { default as ListHAREntries } from './features/list-har-entries';
|
|
10
|
+
export type * from './features/list-har-entries';
|
|
6
11
|
export { default as ViewHAREntry } from './features/view-har-entry';
|
|
12
|
+
export type * from './features/view-har-entry';
|
|
7
13
|
export * from './utils/har';
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { default as t } from "./har-analyzer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { U as o } from "./chunks/provider.js";
|
|
3
3
|
import { default as n } from "./har-entries-viewer.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import { L as
|
|
4
|
+
import { default as A } from "./har-file-uploader.js";
|
|
5
|
+
import { L as f } from "./chunks/index.js";
|
|
6
6
|
import { V as H } from "./chunks/index2.js";
|
|
7
|
-
import { g as
|
|
7
|
+
import { g as m, a as d, b as E, d as x, c as g, i as y } from "./chunks/har.js";
|
|
8
8
|
export {
|
|
9
9
|
t as HARAnalyzer,
|
|
10
|
-
o as
|
|
10
|
+
o as HARAnalyzerPreferencesStore,
|
|
11
11
|
n as HAREntriesViewer,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
A as HARFileUploader,
|
|
13
|
+
f as ListHAREntries,
|
|
14
14
|
H as ViewHAREntry,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
m as getHARContentFromFile,
|
|
16
|
+
d as getHAREntriesFilteredByContentType,
|
|
17
17
|
E as getHAREntriesWithErrorResponse,
|
|
18
18
|
x as getHAREntryId,
|
|
19
19
|
g as getUniqueHeaderNames,
|
package/dist/list-har-entries.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "
|
|
3
|
-
import "@cloudscape-design/components/status-indicator";
|
|
4
|
-
import { L as e } from "./chunks/index.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import "./chunks/har.js";
|
|
2
|
+
import { L as a } from "./chunks/index.js";
|
|
7
3
|
export {
|
|
8
|
-
|
|
4
|
+
a as default
|
|
9
5
|
};
|
package/dist/utils/har.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Har } from 'har-format';
|
|
2
2
|
import { ContentTypeGroup } from './content-type';
|
|
3
|
+
export type { ContentTypeGroup };
|
|
3
4
|
export type HARContent = Har;
|
|
4
5
|
export declare function getHARContentFromFile(fileContent: unknown): HARContent;
|
|
5
6
|
type HAREntryWithoutError = HARContent['log']['entries'][number];
|
|
@@ -14,4 +15,3 @@ export declare function isErrorResponse(harEntry: HAREntry): boolean;
|
|
|
14
15
|
export declare function getHAREntriesWithErrorResponse(harEntries: HAREntry[]): HAREntry[];
|
|
15
16
|
export declare function getUniqueHeaderNames(harEntries: HAREntry[], type: 'request' | 'response'): string[];
|
|
16
17
|
export declare function getHAREntryId(harEntry: HAREntry): string;
|
|
17
|
-
export {};
|
package/package.json
CHANGED
package/dist/chunks/json.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const ENHANCED_TOP_NAVIGATION_ID = "top-navigation";
|
|
2
|
-
export interface EnhancedTopNavigationProps {
|
|
3
|
-
logo?: React.ReactNode;
|
|
4
|
-
appName: string;
|
|
5
|
-
utilities?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export default function EnhancedTopNavigation({ logo, appName, utilities, }: EnhancedTopNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function SimpleAppPreferences(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
type UsePreferenceStore = (key: string) => readonly [string | undefined, (preference: string) => void];
|
|
3
|
-
export default function HARAnalyzerPreferencesProvider({ usePreferenceStore, children }: PropsWithChildren<{
|
|
4
|
-
usePreferenceStore: UsePreferenceStore;
|
|
5
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare function useHARAnalyzerPreferences<T>(preferenceKey: string, defaultValue: T): readonly [T, (newPreference: T) => void];
|
|
7
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare function useErrorsFilterPreference(): readonly [boolean, (newPreference: boolean) => void];
|
|
2
|
-
export declare function useContentTypeFiltersPreference(): readonly [("JSON" | "XML" | "JS" | "CSS" | "HTML" | "Doc" | "Img" | "Font" | "Media" | "Other")[], (newPreference: ("JSON" | "XML" | "JS" | "CSS" | "HTML" | "Doc" | "Img" | "Font" | "Media" | "Other")[]) => void];
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as i, use as a, useMemo as u } from "react";
|
|
3
|
-
import { s as P } from "./chunks/json.js";
|
|
4
|
-
const o = i(void 0);
|
|
5
|
-
function z({ usePreferenceStore: e, children: r }) {
|
|
6
|
-
return /* @__PURE__ */ c(o, { value: e, children: r });
|
|
7
|
-
}
|
|
8
|
-
function y(e, r) {
|
|
9
|
-
const s = a(o);
|
|
10
|
-
if (!s)
|
|
11
|
-
throw new Error("useHARAnalyzerPreferences must be used within a HARAnalyzerPreferencesProvider");
|
|
12
|
-
const [n, f] = s(e);
|
|
13
|
-
return [u(() => {
|
|
14
|
-
if (!n)
|
|
15
|
-
return;
|
|
16
|
-
const [t] = P(n);
|
|
17
|
-
return t;
|
|
18
|
-
}, [n]) ?? r, (t) => {
|
|
19
|
-
f(JSON.stringify(t));
|
|
20
|
-
}];
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
z as default,
|
|
24
|
-
y as useHARAnalyzerPreferences
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useCompareModePreference(): readonly [boolean, (newPreference: boolean) => void];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CollectionPreferencesProps } from '@cloudscape-design/components/collection-preferences';
|
|
2
|
-
export declare function useTablePreferences(tableId: string, defaultPreferences: CollectionPreferencesProps.Preferences): readonly [CollectionPreferencesProps.Preferences<any>, (newPreference: CollectionPreferencesProps.Preferences<any>) => void];
|
|
3
|
-
export declare function useTablePreferredColumnWidths(tableId: string, defaultWidths?: {
|
|
4
|
-
id: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
}[]): readonly [{
|
|
7
|
-
id: string;
|
|
8
|
-
width?: number;
|
|
9
|
-
}[], (newPreference: {
|
|
10
|
-
id: string;
|
|
11
|
-
width?: number;
|
|
12
|
-
}[]) => void];
|
|
File without changes
|