@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@har-analyzer/components",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.12",
5
5
  "description": "Reusable React components for HAR Analyzer",
6
6
  "author": "Allan Joshua",
7
7
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "import": "./dist/index.js"
30
30
  },
31
31
  "./*": {
32
- "types": "./dist/*.d.ts",
32
+ "types": "./dist/features/*/index.d.ts",
33
33
  "import": "./dist/*.js"
34
34
  }
35
35
  },
@@ -59,10 +59,10 @@
59
59
  "react-dom": "^19.1.0"
60
60
  },
61
61
  "dependencies": {
62
+ "@uiw/react-json-view": "2.0.0-alpha.41",
62
63
  "buffer": "^6.0.3",
63
64
  "date-fns": "^4.1.0",
64
65
  "date-fns-tz": "^3.2.0",
65
- "local-db-storage": "^2.0.0",
66
66
  "pretty-bytes": "^7.0.0",
67
67
  "react-error-boundary": "^6.0.0"
68
68
  }
@@ -1,18 +0,0 @@
1
- import { Dispatch } from 'react';
2
- import { JSX } from 'react/jsx-runtime';
3
- import { PropsWithChildren } from 'react';
4
- import { SetStateAction } from 'react';
5
-
6
- declare function HARAnalyzerPreferencesProvider({ store, children }: PropsWithChildren<{
7
- store: PreferencesStore;
8
- }>): JSX.Element;
9
- export default HARAnalyzerPreferencesProvider;
10
-
11
- declare interface PreferencesStore {
12
- getPreference: (key: string) => Promise<string | undefined>;
13
- setPreference: (key: string, value: string) => Promise<void>;
14
- }
15
-
16
- export declare function useHARAnalyzerPreferences<T>(preferenceKey: string, defaultValue: T): readonly [T, Dispatch<SetStateAction<T>>];
17
-
18
- export { }
@@ -1,11 +0,0 @@
1
- import { JSX } from 'react/jsx-runtime';
2
-
3
- declare function HARAnalyzer({ logo, appName }: HARAnalyzerProps): JSX.Element;
4
- export default HARAnalyzer;
5
-
6
- declare interface HARAnalyzerProps {
7
- logo?: React.ReactNode;
8
- appName?: string;
9
- }
10
-
11
- export { }
@@ -1,14 +0,0 @@
1
- import { Har } from 'har-format';
2
- import { JSX } from 'react/jsx-runtime';
3
-
4
- declare type HARContent = Har;
5
-
6
- declare function HARContentViewer(props: HARContentViewerProps): JSX.Element;
7
- export default HARContentViewer;
8
-
9
- declare interface HARContentViewerProps {
10
- harFileName: string;
11
- harContent: HARContent;
12
- }
13
-
14
- export { }
@@ -1,150 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { useMemo as I, useState as g, useEffect as S } from "react";
3
- import w from "@cloudscape-design/board-components/board";
4
- import $ from "@cloudscape-design/board-components/board-item";
5
- import b from "@cloudscape-design/components/button";
6
- import H from "@cloudscape-design/components/header";
7
- import { u as C } from "./chunks/index.js";
8
- import z from "./har-entries-viewer.js";
9
- import B from "./har-entry-viewer.js";
10
- import { useHARAnalyzerPreferences as _ } from "./har-analyzer-preferences.js";
11
- import { a as L } from "./chunks/har.js";
12
- const F = {
13
- dragHandleAriaLabel: "Drag handle",
14
- 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.",
15
- resizeHandleAriaLabel: "Resize handle",
16
- 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."
17
- };
18
- function d(e, n, t) {
19
- const r = n.length > 0 ? `Conflicts with ${n.map((i) => i.id).join(", ")}.` : "", s = t.length > 0 ? `Disturbed ${t.length} items.` : "";
20
- return [e, r, s].filter(Boolean).join(" ");
21
- }
22
- const N = {
23
- liveAnnouncementDndStarted: (e) => e === "resize" ? "Resizing" : "Dragging",
24
- liveAnnouncementDndItemReordered: (e) => {
25
- const n = `column ${e.placement.x + 1}`, t = `row ${e.placement.y + 1}`;
26
- return d(
27
- `Item moved to ${e.direction === "horizontal" ? n : t}.`,
28
- e.conflicts,
29
- e.disturbed
30
- );
31
- },
32
- liveAnnouncementDndItemResized: (e) => {
33
- const n = e.isMinimalColumnsReached ? " (minimal)" : "", t = e.isMinimalRowsReached ? " (minimal)" : "", r = e.direction === "horizontal" ? `columns ${e.placement.width}${n}` : `rows ${e.placement.height}${t}`;
34
- return d(`Item resized to ${r}.`, e.conflicts, e.disturbed);
35
- },
36
- liveAnnouncementDndItemInserted: (e) => {
37
- const n = `column ${e.placement.x + 1}`, t = `row ${e.placement.y + 1}`;
38
- return d(`Item inserted to ${n}, ${t}.`, e.conflicts, e.disturbed);
39
- },
40
- liveAnnouncementDndCommitted: (e) => `${e} committed`,
41
- liveAnnouncementDndDiscarded: (e) => `${e} discarded`,
42
- liveAnnouncementItemRemoved: (e) => d(`Removed item ${e.item.id}.`, [], e.disturbed),
43
- navigationAriaLabel: "Board navigation",
44
- navigationAriaDescription: "Click on non-empty item to move focus over",
45
- navigationItemAriaLabel: (e) => e ? e.id : "Empty"
46
- };
47
- function T(e) {
48
- const {
49
- components: n,
50
- definitions: t,
51
- onDefinitionsChange: r,
52
- empty: s
53
- } = e;
54
- return /* @__PURE__ */ o(
55
- w,
56
- {
57
- i18nStrings: N,
58
- items: t,
59
- renderItem: ({ id: i }, { removeItem: c }) => {
60
- const {
61
- title: m,
62
- content: l,
63
- actions: u,
64
- counter: f,
65
- canRemove: h
66
- } = n[i] ?? {};
67
- return /* @__PURE__ */ o(
68
- $,
69
- {
70
- header: /* @__PURE__ */ o(H, { counter: f, actions: u, children: m }),
71
- i18nStrings: F,
72
- settings: h && /* @__PURE__ */ o(b, { variant: "icon", iconName: "close", onClick: c }),
73
- children: l
74
- }
75
- );
76
- },
77
- onItemsChange: ({ detail: { items: i } }) => {
78
- r(i);
79
- },
80
- empty: s
81
- }
82
- );
83
- }
84
- function k(e, n) {
85
- return _(`boardDefinitionsPreference_${e}`, n);
86
- }
87
- const v = 6, D = "har-entries-viewer", E = "selected-har-entry-viewer", R = [
88
- {
89
- id: D,
90
- rowSpan: v,
91
- columnSpan: 12
92
- }
93
- ], O = [
94
- ...R,
95
- {
96
- id: E,
97
- rowSpan: v,
98
- columnSpan: 12
99
- }
100
- ];
101
- function Q(e) {
102
- const { harFileName: n, harContent: t } = e, r = I(() => L(t), [t]), [s, i] = g(), [c, m] = g(R);
103
- S(() => {
104
- i(void 0);
105
- }, [r]);
106
- const [l, u] = k(
107
- "har-contents-viewer",
108
- O
109
- ), f = (a) => {
110
- m(a), a.length > 1 && u(a);
111
- }, h = (a) => {
112
- i(a), c.length === 1 && m(l);
113
- }, {
114
- HAREntriesFilters: p,
115
- filteredHAREntries: A
116
- } = C(r), y = {
117
- [D]: {
118
- title: n,
119
- counter: `(${A.length} / ${r.length})`,
120
- actions: /* @__PURE__ */ o(p, {}),
121
- content: /* @__PURE__ */ o(
122
- z,
123
- {
124
- harEntries: A,
125
- onChange: h
126
- }
127
- )
128
- },
129
- [E]: s ? {
130
- title: "Details",
131
- content: /* @__PURE__ */ o(B, { harEntry: s }),
132
- canRemove: !0
133
- } : {
134
- title: "Select an entry to see details",
135
- content: null,
136
- canRemove: !0
137
- }
138
- };
139
- return /* @__PURE__ */ o(
140
- T,
141
- {
142
- components: y,
143
- definitions: c,
144
- onDefinitionsChange: f
145
- }
146
- );
147
- }
148
- export {
149
- Q as default
150
- };
@@ -1,23 +0,0 @@
1
- import { Entry } from 'har-format';
2
- import { Har } from 'har-format';
3
- import { JSX } from 'react/jsx-runtime';
4
-
5
- declare function getEntriesFromHAR(harContent?: Har): Entry[];
6
-
7
- declare type HAREntry = Omit<HAREntryWithoutError, 'response'> & {
8
- response: HARResponseWithError;
9
- };
10
-
11
- declare type HAREntryWithoutError = ReturnType<typeof getEntriesFromHAR>[number];
12
-
13
- declare type HARResponseWithError = HAREntryWithoutError['response'] & {
14
- _error?: string;
15
- };
16
-
17
- declare function useHAREntriesFilters(harEntries: HAREntry[]): {
18
- filteredHAREntries: HAREntry[];
19
- HAREntriesFilters: () => JSX.Element;
20
- };
21
- export default useHAREntriesFilters;
22
-
23
- export { }
@@ -1,7 +0,0 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { u as i } from "./chunks/index.js";
4
- import "./chunks/har.js";
5
- export {
6
- i as default
7
- };
@@ -1,26 +0,0 @@
1
- import { Entry } from 'har-format';
2
- import { Har } from 'har-format';
3
- import { JSX } from 'react/jsx-runtime';
4
-
5
- declare function getEntriesFromHAR(harContent?: Har): Entry[];
6
-
7
- declare function HAREntriesViewer({ id, harEntries, onChange, }: HAREntriesViewerProps): JSX.Element;
8
- export default HAREntriesViewer;
9
-
10
- declare interface HAREntriesViewerProps {
11
- id?: string;
12
- harEntries: HAREntry[];
13
- onChange: (selectedHAREntry: HAREntry) => void;
14
- }
15
-
16
- declare type HAREntry = Omit<HAREntryWithoutError, 'response'> & {
17
- response: HARResponseWithError;
18
- };
19
-
20
- declare type HAREntryWithoutError = ReturnType<typeof getEntriesFromHAR>[number];
21
-
22
- declare type HARResponseWithError = HAREntryWithoutError['response'] & {
23
- _error?: string;
24
- };
25
-
26
- export { }
@@ -1,24 +0,0 @@
1
- import { Entry } from 'har-format';
2
- import { Har } from 'har-format';
3
- import { JSX } from 'react/jsx-runtime';
4
-
5
- declare function getEntriesFromHAR(harContent?: Har): Entry[];
6
-
7
- declare type HAREntry = Omit<HAREntryWithoutError, 'response'> & {
8
- response: HARResponseWithError;
9
- };
10
-
11
- declare function HAREntryViewer({ harEntry }: HAREntryViewerProps): JSX.Element;
12
- export default HAREntryViewer;
13
-
14
- declare interface HAREntryViewerProps {
15
- harEntry: HAREntry;
16
- }
17
-
18
- declare type HAREntryWithoutError = ReturnType<typeof getEntriesFromHAR>[number];
19
-
20
- declare type HARResponseWithError = HAREntryWithoutError['response'] & {
21
- _error?: string;
22
- };
23
-
24
- export { }