@har-analyzer/components 0.0.5 → 0.0.9
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 +68 -17
- 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/vertical-gap.js +5 -32
- package/dist/har-analyzer-preferences.d.ts +18 -0
- package/dist/har-analyzer-preferences.js +97 -0
- package/dist/har-analyzer.d.ts +4 -4
- package/dist/har-analyzer.js +94 -5980
- package/dist/har-content-viewer.d.ts +14 -0
- package/dist/har-content-viewer.js +150 -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 +2117 -5
- 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 +49 -17
- package/dist/index.js +19 -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/index2.js +0 -2059
- 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,22 +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 |
|
|
35
|
-
|
|
34
|
+
| appName | string | No | The name of the application. |
|
|
36
35
|
|
|
37
36
|
---
|
|
38
37
|
|
|
39
|
-
###
|
|
38
|
+
### HARContentViewer
|
|
40
39
|
|
|
41
40
|
```jsx
|
|
42
|
-
import
|
|
41
|
+
import HARContentViewer from '@har-analyzer/components/har-content-viewer';
|
|
43
42
|
|
|
44
43
|
function App() {
|
|
45
44
|
return (
|
|
46
|
-
<
|
|
45
|
+
<HARContentViewer
|
|
47
46
|
harFileName="example.har"
|
|
48
47
|
harContent={yourHarContent}
|
|
49
|
-
onChange={(selectedEntry) => console.log(selectedEntry)}
|
|
50
48
|
/>
|
|
51
49
|
);
|
|
52
50
|
}
|
|
@@ -58,7 +56,6 @@ function App() {
|
|
|
58
56
|
|---------------|-------------------------------|----------|--------------------------------------------------|
|
|
59
57
|
| harFileName | string | No | The name of the HAR file being viewed. |
|
|
60
58
|
| harContent | HarContent | No | The HAR file content object. |
|
|
61
|
-
| onChange | (entry: HAREntry) => void | Yes | Callback when a HAR entry is selected. |
|
|
62
59
|
|
|
63
60
|
---
|
|
64
61
|
|
|
@@ -88,7 +85,7 @@ import HARFileUploader from '@har-analyzer/components/har-file-uploader';
|
|
|
88
85
|
function App() {
|
|
89
86
|
return (
|
|
90
87
|
<HARFileUploader
|
|
91
|
-
onChange={(harContent,
|
|
88
|
+
onChange={({ harContent, harFileName }) => console.log(harContent, harFileName)}
|
|
92
89
|
/>
|
|
93
90
|
);
|
|
94
91
|
}
|
|
@@ -96,9 +93,63 @@ function App() {
|
|
|
96
93
|
|
|
97
94
|
**Props:**
|
|
98
95
|
|
|
99
|
-
| Name | Type
|
|
100
|
-
|
|
101
|
-
| 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
|
+
### HARAnalyzerPreferencesProvider
|
|
118
|
+
|
|
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
|
+
|
|
121
|
+
```jsx
|
|
122
|
+
import HARAnalyzerPreferencesProvider from '@har-analyzer/components/har-analyzer-preferences';
|
|
123
|
+
|
|
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
|
+
};
|
|
129
|
+
|
|
130
|
+
function App() {
|
|
131
|
+
return (
|
|
132
|
+
<HARAnalyzerPreferencesProvider store={customStore}>
|
|
133
|
+
<HARAnalyzer appName="HAR Analyzer" />;
|
|
134
|
+
</HARAnalyzerPreferencesProvider>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### HAR Utilities
|
|
143
|
+
|
|
144
|
+
Various types and utilities for working with HTTP Archive (.har) files are directly exported.
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
import {
|
|
148
|
+
getHARContentFromFile,
|
|
149
|
+
type HARContent,
|
|
150
|
+
type HAREntry
|
|
151
|
+
} from '@har-analyzer/components';
|
|
152
|
+
```
|
|
102
153
|
|
|
103
154
|
---
|
|
104
155
|
|
|
@@ -113,4 +164,4 @@ Contributions are welcome! Please open issues or pull requests on [GitHub](https
|
|
|
113
164
|
|
|
114
165
|
## License
|
|
115
166
|
|
|
116
|
-
MIT
|
|
167
|
+
[MIT](https://github.com/theallanjoshua/har-analyzer/blob/main/LICENSE)
|