@har-analyzer/components 0.0.19 → 0.0.21

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 (65) hide show
  1. package/dist/chunks/collapsible-key-value-list.js +41 -10
  2. package/dist/chunks/collapsible-section.js +1 -1
  3. package/dist/chunks/common.js +10 -0
  4. package/dist/chunks/content-type.js +15 -21
  5. package/dist/chunks/har-entry-response-status.js +14 -0
  6. package/dist/chunks/har.js +47 -20
  7. package/dist/chunks/horizontal-padding.js +8 -0
  8. package/dist/chunks/index.js +589 -891
  9. package/dist/chunks/index2.js +271 -49
  10. package/dist/chunks/list-har-entries.js +30 -0
  11. package/dist/chunks/request-headers.js +34 -0
  12. package/dist/chunks/request-payload.js +25 -0
  13. package/dist/chunks/response-headers.js +19 -0
  14. package/dist/chunks/response-payload.js +10 -0
  15. package/dist/components/collapsible-key-value-list.d.ts +7 -2
  16. package/dist/components/collapsible-section.d.ts +2 -1
  17. package/dist/components/enhanced-board/i18n.d.ts +26 -0
  18. package/dist/components/enhanced-board/index.d.ts +15 -0
  19. package/dist/components/{enhanced-table.d.ts → enhanced-table/index.d.ts} +9 -15
  20. package/dist/components/enhanced-table/preferences.d.ts +13 -0
  21. package/dist/components/har-entry-response-status.d.ts +4 -0
  22. package/dist/components/space-between.d.ts +2 -0
  23. package/dist/features/har-analyzer/components/app-layout.d.ts +3 -2
  24. package/dist/features/har-analyzer/components/top-navigation.d.ts +3 -2
  25. package/dist/features/har-analyzer/index.d.ts +2 -1
  26. package/dist/features/har-entries-viewer/components/har-entries-viewer-action-stripe/har-entry-header-picker.d.ts +6 -0
  27. package/dist/features/har-entries-viewer/components/har-entries-viewer-action-stripe/index.d.ts +8 -0
  28. package/dist/features/har-entries-viewer/components/har-entries-viewer-provider.d.ts +2 -0
  29. package/dist/features/har-entries-viewer/components/view-har-entry-header.d.ts +7 -0
  30. package/dist/features/har-entries-viewer/context/preferences.d.ts +2 -0
  31. package/dist/features/har-entries-viewer/index.d.ts +1 -1
  32. package/dist/features/list-har-entries/components/list-har-entries-provider.d.ts +2 -0
  33. package/dist/features/list-har-entries/components/list-har-entries-table-header/index.d.ts +6 -0
  34. package/dist/features/list-har-entries/components/list-har-entries-table.d.ts +8 -0
  35. package/dist/features/list-har-entries/components/list-har-entries.d.ts +5 -0
  36. package/dist/features/list-har-entries/context/preferences.d.ts +1 -3
  37. package/dist/features/list-har-entries/hooks/filter-har-entries.d.ts +2 -0
  38. package/dist/features/list-har-entries/index.d.ts +8 -4
  39. package/dist/features/view-har-entry/components/request-headers.d.ts +4 -0
  40. package/dist/features/view-har-entry/components/request-payload.d.ts +6 -0
  41. package/dist/features/view-har-entry/components/response-headers.d.ts +4 -0
  42. package/dist/features/view-har-entry/components/response-payload.d.ts +6 -0
  43. package/dist/features/view-har-entry/index.d.ts +1 -1
  44. package/dist/har-analyzer.js +16 -15
  45. package/dist/har-entries-viewer.js +271 -630
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +25 -17
  48. package/dist/list-har-entries.js +6 -3
  49. package/dist/utils/array.d.ts +7 -0
  50. package/dist/utils/har.d.ts +12 -1
  51. package/dist/view-har-entry.js +58 -6
  52. package/package.json +2 -2
  53. package/dist/assets/har-entries-viewer.css +0 -1
  54. package/dist/chunks/headers-viewer.js +0 -32
  55. package/dist/chunks/payload-viewer.js +0 -15
  56. package/dist/chunks/response-viewer.js +0 -10
  57. package/dist/components/r2-layout/fgl.d.ts +0 -10
  58. package/dist/components/r2-layout/index.d.ts +0 -22
  59. package/dist/features/list-har-entries/components/har-entries-table.d.ts +0 -8
  60. package/dist/features/view-har-entry/components/headers-viewer.d.ts +0 -6
  61. package/dist/features/view-har-entry/components/payload-viewer.d.ts +0 -6
  62. package/dist/features/view-har-entry/components/response-viewer.d.ts +0 -6
  63. /package/dist/features/{list-har-entries/components → har-entries-viewer/components/har-entries-viewer-action-stripe}/compare-mode-switcher.d.ts +0 -0
  64. /package/dist/features/list-har-entries/components/{content-type-filter.d.ts → list-har-entries-table-header/content-type-filter.d.ts} +0 -0
  65. /package/dist/features/list-har-entries/components/{errors-filter.d.ts → list-har-entries-table-header/errors-filter.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { default as HAREntriesViewer } from './features/har-entries-viewer';
6
6
  export type * from './features/har-entries-viewer';
7
7
  export { default as HARFileUploader } from './features/har-file-uploader';
8
8
  export type * from './features/har-file-uploader';
9
- export { default as ListHAREntries } from './features/list-har-entries';
9
+ export * from './features/list-har-entries';
10
10
  export type * from './features/list-har-entries';
11
11
  export { default as ViewHAREntry } from './features/view-har-entry';
12
12
  export type * from './features/view-har-entry';
package/dist/index.js CHANGED
@@ -1,21 +1,29 @@
1
1
  import { default as t } from "./har-analyzer.js";
2
- import { U as o } from "./chunks/provider.js";
3
- import { default as n } from "./har-entries-viewer.js";
4
- import { default as A } from "./har-file-uploader.js";
5
- import { L as f } from "./chunks/index.js";
6
- import { V as H } from "./chunks/index2.js";
7
- import { g as m, a as d, b as E, d as x, c as g, i as y } from "./chunks/har.js";
2
+ import { U as a } from "./chunks/provider.js";
3
+ import { default as A } from "./har-entries-viewer.js";
4
+ import { default as H } from "./har-file-uploader.js";
5
+ import { L as n } from "./chunks/list-har-entries.js";
6
+ import { L as f, a as l, b as p } from "./chunks/index.js";
7
+ import { default as T } from "./view-har-entry.js";
8
+ import { D as g, H as u, g as x, a as y, b as L, e as _, d as U, f as b, c as F, i as V } from "./chunks/har.js";
8
9
  export {
10
+ g as DEFAULT_HAR_ENTRY_ATTRIBUTES_TO_VALUE_MAP,
9
11
  t as HARAnalyzer,
10
- o as HARAnalyzerPreferencesStore,
11
- n as HAREntriesViewer,
12
- A as HARFileUploader,
13
- f as ListHAREntries,
14
- H as ViewHAREntry,
15
- m as getHARContentFromFile,
16
- d as getHAREntriesFilteredByContentType,
17
- E as getHAREntriesWithErrorResponse,
18
- x as getHAREntryId,
19
- g as getUniqueHeaderNames,
20
- y as isErrorResponse
12
+ a as HARAnalyzerPreferencesStore,
13
+ A as HAREntriesViewer,
14
+ H as HARFileUploader,
15
+ u as HAR_HEADER_TYPES,
16
+ n as ListHAREntries,
17
+ f as ListHAREntriesProvider,
18
+ l as ListHAREntriesTable,
19
+ p as ListHAREntriesTableHeader,
20
+ T as ViewHAREntry,
21
+ x as getHARContentFromFile,
22
+ y as getHAREntriesFilteredByContentType,
23
+ L as getHAREntriesWithErrorResponse,
24
+ _ as getHAREntryAttributesToValuesMap,
25
+ U as getHAREntryHeadersToValuesMap,
26
+ b as getHAREntryId,
27
+ F as getUniqueHeaderNames,
28
+ V as isErrorResponse
21
29
  };
@@ -1,5 +1,8 @@
1
- import "react/jsx-runtime";
2
- import { L as a } from "./chunks/index.js";
1
+ import { L as r } from "./chunks/list-har-entries.js";
2
+ import { L as i, a, b as L } from "./chunks/index.js";
3
3
  export {
4
- a as default
4
+ r as ListHAREntries,
5
+ i as ListHAREntriesProvider,
6
+ a as ListHAREntriesTable,
7
+ L as ListHAREntriesTableHeader
5
8
  };
@@ -0,0 +1,7 @@
1
+ interface SplitByResult<T> {
2
+ satisfies: T[];
3
+ misses: T[];
4
+ }
5
+ export declare function splitBy<T>(array: ReadonlyArray<T>, predicate: (item: T) => boolean): SplitByResult<T>;
6
+ export declare function removeUndefined<T>(array: ReadonlyArray<T | undefined>): T[];
7
+ export {};
@@ -13,5 +13,16 @@ export type HAREntry = Omit<HAREntryWithoutError, 'response'> & {
13
13
  export declare function getHAREntriesFilteredByContentType(harEntries: HAREntry[], contentTypeFilters: ContentTypeGroup[]): HAREntry[];
14
14
  export declare function isErrorResponse(harEntry: HAREntry): boolean;
15
15
  export declare function getHAREntriesWithErrorResponse(harEntries: HAREntry[]): HAREntry[];
16
- export declare function getUniqueHeaderNames(harEntries: HAREntry[], type: 'request' | 'response'): string[];
16
+ export declare const HAR_HEADER_TYPES: readonly ["request", "response"];
17
+ export declare function getUniqueHeaderNames(harEntries: HAREntry[], type: (typeof HAR_HEADER_TYPES)[number]): string[];
18
+ type HAREntryAttributesToValueMap = Record<string, (harEntry: HAREntry) => string | number | string[]>;
19
+ export declare const DEFAULT_HAR_ENTRY_ATTRIBUTES_TO_VALUE_MAP: {
20
+ 'request.shortUrl': (harEntry: HAREntry) => string;
21
+ 'request.url': (harEntry: HAREntry) => string;
22
+ 'request.method': (harEntry: HAREntry) => string;
23
+ 'response.status': (harEntry: HAREntry) => number;
24
+ };
25
+ type HAREntryHeadersToValueMap = Record<string, (harEntry: HAREntry) => string[]>;
26
+ export declare function getHAREntryHeadersToValuesMap(harEntries: HAREntry[]): HAREntryHeadersToValueMap;
27
+ export declare function getHAREntryAttributesToValuesMap(harEntries: HAREntry[]): HAREntryAttributesToValueMap;
17
28
  export declare function getHAREntryId(harEntry: HAREntry): string;
@@ -1,8 +1,60 @@
1
- import "react/jsx-runtime";
2
- import "@cloudscape-design/components/tabs";
3
- import "react";
4
- import { D, V as E } from "./chunks/index2.js";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import m from "@cloudscape-design/components/tabs";
3
+ import { Suspense as u, lazy as a, useState as y, useMemo as T } from "react";
4
+ import h from "@cloudscape-design/components/spinner";
5
+ function f({ children: n }) {
6
+ return /* @__PURE__ */ e(u, { fallback: /* @__PURE__ */ e(h, { size: "large" }), children: n });
7
+ }
8
+ const R = a(() => import("./chunks/request-headers.js")), I = a(() => import("./chunks/request-payload.js")), A = a(() => import("./chunks/response-headers.js")), E = a(() => import("./chunks/response-payload.js")), g = a(() => import("./chunks/content-viewer.js"));
9
+ function o({ children: n }) {
10
+ return /* @__PURE__ */ e(f, { children: n });
11
+ }
12
+ const i = "request-headers";
13
+ function L(n) {
14
+ const {
15
+ harEntry: t,
16
+ initialSelectedTabId: d = i,
17
+ onSelectedTabIdChange: s
18
+ } = n, [c, l] = y(d), p = T(() => JSON.stringify(t), [t]);
19
+ return /* @__PURE__ */ e(
20
+ m,
21
+ {
22
+ activeTabId: c,
23
+ onChange: ({ detail: b }) => {
24
+ const { activeTabId: r } = b;
25
+ l(r), s && s(r);
26
+ },
27
+ tabs: [
28
+ {
29
+ label: "Request Headers",
30
+ id: i,
31
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(R, { harEntry: t }) })
32
+ },
33
+ {
34
+ label: "Request Payload",
35
+ id: "request-payload",
36
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(I, { harEntry: t }) })
37
+ },
38
+ {
39
+ label: "Response Headers",
40
+ id: "response-headers",
41
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(A, { harEntry: t }) })
42
+ },
43
+ {
44
+ label: "Response Payload",
45
+ id: "response-payload",
46
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(E, { harEntry: t }) })
47
+ },
48
+ {
49
+ label: "HAR Entry",
50
+ id: "har-entry",
51
+ content: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(g, { content: p, mimeType: "json" }) })
52
+ }
53
+ ]
54
+ }
55
+ );
56
+ }
5
57
  export {
6
- D as DEFAULT_SELECTED_TAB_ID,
7
- E as default
58
+ i as DEFAULT_SELECTED_TAB_ID,
59
+ L as default
8
60
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@har-analyzer/components",
3
3
  "type": "module",
4
- "version": "0.0.19",
4
+ "version": "0.0.21",
5
5
  "description": "Reusable React components for HAR Analyzer",
6
6
  "author": "Allan Joshua",
7
7
  "license": "MIT",
@@ -49,6 +49,7 @@
49
49
  "prepublishOnly": "pnpm validate"
50
50
  },
51
51
  "peerDependencies": {
52
+ "@cloudscape-design/board-components": "^3.0.150",
52
53
  "@cloudscape-design/code-view": "^3.0.66",
53
54
  "@cloudscape-design/collection-hooks": "^1.0.73",
54
55
  "@cloudscape-design/components": "^3.0.1022",
@@ -62,7 +63,6 @@
62
63
  "buffer": "^6.0.3",
63
64
  "date-fns": "^4.1.0",
64
65
  "date-fns-tz": "^3.2.0",
65
- "fast-grid-layout": "^0.1.0",
66
66
  "pretty-bytes": "^7.0.0",
67
67
  "react-error-boundary": "^6.0.0"
68
68
  }
@@ -1 +0,0 @@
1
- :root{--fast-grid-layout-outline: 3px solid rgba(30, 120, 255, .55)}.fast-grid-layout{position:relative;transition:height .18s ease-out;-webkit-touch-callout:none;touch-action:manipulation}.fast-grid-layout>.item{position:absolute;transition:width .18s ease,height .18s ease,transform .18s ease,outline .1s ease-out}.fast-grid-layout>.item.-selected{outline:var(--fast-grid-layout-outline);z-index:1;-webkit-user-select:none;user-select:none;touch-action:none}.fast-grid-layout>.item img{-webkit-user-select:none;user-select:none}.fast-grid-layout>.item .content{cursor:auto}.fast-grid-layout.-editable>.item.-dynamic{cursor:pointer}.fast-grid-layout.-moving>.item,.fast-grid-layout.-resizing>.item{will-change:width,height,transform}.fast-grid-layout.-moving>.item.-selected,.fast-grid-layout.-resizing>.item.-selected{opacity:.67}._hide-selection *::selection{all:inherit}._force-cursor *{cursor:var(--force-cursor)!important}
@@ -1,32 +0,0 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { C as t } from "./collapsible-key-value-list.js";
3
- import { V as i } from "./vertical-gap.js";
4
- function u({ harEntry: e }) {
5
- return /* @__PURE__ */ a(i, { size: "xxxs", children: [
6
- /* @__PURE__ */ s(
7
- t,
8
- {
9
- title: "General",
10
- items: [
11
- {
12
- name: "URL",
13
- value: e.request.url
14
- },
15
- {
16
- name: "Method",
17
- value: e.request.method
18
- },
19
- {
20
- name: "Status",
21
- value: `${e.response.status}`
22
- }
23
- ]
24
- }
25
- ),
26
- /* @__PURE__ */ s(t, { title: "Request Headers", items: e.request.headers }),
27
- /* @__PURE__ */ s(t, { title: "Response Headers", items: e.response.headers })
28
- ] });
29
- }
30
- export {
31
- u as default
32
- };
@@ -1,15 +0,0 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { C as s } from "./collapsible-key-value-list.js";
3
- import { C as a } from "./collapsible-section.js";
4
- import { V as m } from "./vertical-gap.js";
5
- import l from "./content-viewer.js";
6
- function d({ harEntry: e }) {
7
- const o = e.request.postData?.text ?? "", r = e.request.postData?.mimeType;
8
- return /* @__PURE__ */ i(m, { children: [
9
- /* @__PURE__ */ t(s, { title: "Query Parameters", items: e.request.queryString }),
10
- /* @__PURE__ */ t(a, { title: "Request Payload", children: /* @__PURE__ */ t(l, { content: o, mimeType: r }) })
11
- ] });
12
- }
13
- export {
14
- d as default
15
- };
@@ -1,10 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { C as i } from "./collapsible-section.js";
3
- import c from "./content-viewer.js";
4
- function l({ harEntry: e }) {
5
- const o = e.response.content.text ?? "", t = e.response.content.encoding, s = e.response.content.mimeType;
6
- return /* @__PURE__ */ n(i, { title: "Response", children: /* @__PURE__ */ n(c, { content: o, encoding: t, mimeType: s }) });
7
- }
8
- export {
9
- l as default
10
- };
@@ -1,10 +0,0 @@
1
- import { GridLayoutItem } from 'fast-grid-layout';
2
- import { PropsWithChildren } from 'react';
3
- export type FGLProps = PropsWithChildren<{
4
- layout: GridLayoutItem[];
5
- onChange: (newLayout: GridLayoutItem[]) => void;
6
- totalColumns?: number;
7
- gap?: number;
8
- rowHeight?: number;
9
- }>;
10
- export default function FGL(props: FGLProps): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +0,0 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- interface CellDefinition<T> {
3
- id: string;
4
- w: number;
5
- h: number;
6
- x: number;
7
- y: number;
8
- props: T;
9
- }
10
- export interface R2LayoutProps<T> {
11
- layoutDefinitions: CellDefinition<T>[];
12
- onRender: (id: string, props: T) => ReactNode;
13
- onChange: (newLayoutDefinitions: CellDefinition<T>[]) => void;
14
- layoutItemStyle?: CSSProperties;
15
- totalColumns?: number;
16
- gap?: number;
17
- }
18
- /**
19
- * Provides a re-arrangeable & re-sizeable layout
20
- */
21
- export default function R2Layout<T>(props: R2LayoutProps<T>): import("react/jsx-runtime").JSX.Element;
22
- export {};
@@ -1,8 +0,0 @@
1
- import { HAREntry } from '../../../utils/har';
2
- export interface HAREntriesTableProps {
3
- title?: string;
4
- harEntries: HAREntry[];
5
- selectedHAREntries: HAREntry[];
6
- onSelectionChange: (selectedHAREntries: HAREntry[]) => void;
7
- }
8
- export default function HAREntriesTable({ title, harEntries, selectedHAREntries, onSelectionChange, }: HAREntriesTableProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { HAREntry } from '../../../utils/har';
2
- interface HeadersViewerProps {
3
- harEntry: HAREntry;
4
- }
5
- export default function HeadersViewer({ harEntry }: HeadersViewerProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { HAREntry } from '../../../utils/har';
2
- interface PayloadViewerProps {
3
- harEntry: HAREntry;
4
- }
5
- export default function PayloadViewer({ harEntry }: PayloadViewerProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,6 +0,0 @@
1
- import { HAREntry } from '../../../utils/har';
2
- interface ResponseViewerProps {
3
- harEntry: HAREntry;
4
- }
5
- export default function ResponseViewer({ harEntry }: ResponseViewerProps): import("react/jsx-runtime").JSX.Element;
6
- export {};