@har-analyzer/components 0.0.4 → 0.0.8
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 +43 -16
- package/dist/chunks/content-type.js +31 -6594
- package/dist/chunks/har.js +43 -0
- package/dist/chunks/index.js +50 -13548
- package/dist/chunks/index2.js +2157 -2011
- package/dist/chunks/vertical-gap.js +5 -32
- package/dist/har-analyzer.d.ts +4 -4
- package/dist/har-analyzer.js +91 -5977
- package/dist/har-content-viewer.d.ts +14 -0
- package/dist/har-content-viewer.js +149 -0
- package/dist/har-entries-filters.d.ts +23 -0
- package/dist/har-entries-filters.js +7 -0
- package/dist/har-entries-viewer.d.ts +10 -11
- package/dist/har-entries-viewer.js +6 -4
- package/dist/har-entry-viewer.d.ts +7 -6
- package/dist/har-entry-viewer.js +1143 -3
- package/dist/har-file-uploader.d.ts +6 -3
- package/dist/har-file-uploader.js +73 -6
- package/dist/index.d.ts +39 -17
- package/dist/index.js +17 -8
- package/package.json +31 -26
- package/dist/assets/content-type.css +0 -1
- package/dist/assets/har-analyzer.css +0 -1
- package/dist/assets/index.css +0 -1
- package/dist/assets/index2.css +0 -1
- package/dist/assets/index3.css +0 -1
- package/dist/assets/index4.css +0 -1
- package/dist/assets/internal.css +0 -1
- package/dist/chunks/index3.js +0 -1149
- package/dist/chunks/index4.js +0 -82
- package/dist/chunks/internal.js +0 -996
package/README.md
CHANGED
|
@@ -12,17 +12,17 @@ yarn add @har-analyzer/components
|
|
|
12
12
|
pnpm add @har-analyzer/components
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
## Components
|
|
15
|
+
## Components & Hooks
|
|
16
16
|
|
|
17
|
-
Below are the available
|
|
17
|
+
Below are the available exports and their usage examples:
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### HARAnalyzer ([Demo](https://theallanjoshua.github.io/har-analyzer/))
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
22
|
-
import
|
|
22
|
+
import HARAnalyzer from '@har-analyzer/components/har-analyzer';
|
|
23
23
|
|
|
24
24
|
function App() {
|
|
25
|
-
return <
|
|
25
|
+
return <HARAnalyzer appName="HAR Analyzer" />;
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -31,21 +31,20 @@ function App() {
|
|
|
31
31
|
| Name | Type | Required | Description |
|
|
32
32
|
|-----------|-----------------|----------|--------------------------------------|
|
|
33
33
|
| logo | React.ReactNode | No | A logo to display in the header. |
|
|
34
|
-
| appName | string |
|
|
34
|
+
| appName | string | No | The name of the application. |
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
-
###
|
|
38
|
+
### HARContentViewer
|
|
39
39
|
|
|
40
40
|
```jsx
|
|
41
|
-
import
|
|
41
|
+
import HARContentViewer from '@har-analyzer/components/har-content-viewer';
|
|
42
42
|
|
|
43
43
|
function App() {
|
|
44
44
|
return (
|
|
45
|
-
<
|
|
45
|
+
<HARContentViewer
|
|
46
46
|
harFileName="example.har"
|
|
47
47
|
harContent={yourHarContent}
|
|
48
|
-
onChange={(selectedEntry) => console.log(selectedEntry)}
|
|
49
48
|
/>
|
|
50
49
|
);
|
|
51
50
|
}
|
|
@@ -57,7 +56,6 @@ function App() {
|
|
|
57
56
|
|---------------|-------------------------------|----------|--------------------------------------------------|
|
|
58
57
|
| harFileName | string | No | The name of the HAR file being viewed. |
|
|
59
58
|
| harContent | HarContent | No | The HAR file content object. |
|
|
60
|
-
| onChange | (entry: HAREntry) => void | Yes | Callback when a HAR entry is selected. |
|
|
61
59
|
|
|
62
60
|
---
|
|
63
61
|
|
|
@@ -87,7 +85,7 @@ import HARFileUploader from '@har-analyzer/components/har-file-uploader';
|
|
|
87
85
|
function App() {
|
|
88
86
|
return (
|
|
89
87
|
<HARFileUploader
|
|
90
|
-
onChange={(harContent,
|
|
88
|
+
onChange={({ harContent, harFileName }) => console.log(harContent, harFileName)}
|
|
91
89
|
/>
|
|
92
90
|
);
|
|
93
91
|
}
|
|
@@ -95,9 +93,38 @@ function App() {
|
|
|
95
93
|
|
|
96
94
|
**Props:**
|
|
97
95
|
|
|
98
|
-
| Name | Type
|
|
99
|
-
|
|
100
|
-
| onChange | (harContent:
|
|
96
|
+
| Name | Type | Required | Description |
|
|
97
|
+
|-----------|--------------------------------------------------------------------|----------|--------------------------------------------------|
|
|
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
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### HAR Utilities
|
|
118
|
+
|
|
119
|
+
Various types and utilities for working with HTTP Archive (.har) files are directly exported.
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import {
|
|
123
|
+
getHARContentFromFile,
|
|
124
|
+
type HARContent,
|
|
125
|
+
type HAREntry
|
|
126
|
+
} from '@har-analyzer/components';
|
|
127
|
+
```
|
|
101
128
|
|
|
102
129
|
---
|
|
103
130
|
|
|
@@ -112,4 +139,4 @@ Contributions are welcome! Please open issues or pull requests on [GitHub](https
|
|
|
112
139
|
|
|
113
140
|
## License
|
|
114
141
|
|
|
115
|
-
MIT
|
|
142
|
+
[MIT](https://github.com/theallanjoshua/har-analyzer/blob/main/LICENSE)
|