@har-analyzer/components 0.0.15 → 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.
Files changed (59) hide show
  1. package/README.md +59 -28
  2. package/dist/chunks/collapsible-key-value-list.js +24 -0
  3. package/dist/chunks/collapsible-section.js +22 -0
  4. package/dist/chunks/content-viewer.js +3056 -0
  5. package/dist/chunks/context.js +5 -0
  6. package/dist/chunks/headers-viewer.js +32 -0
  7. package/dist/chunks/index.js +2265 -174
  8. package/dist/chunks/index2.js +49 -0
  9. package/dist/chunks/payload-viewer.js +15 -0
  10. package/dist/chunks/provider.js +11 -0
  11. package/dist/chunks/response-viewer.js +10 -0
  12. package/dist/chunks/vertical-gap.js +1 -1
  13. package/dist/components/collapsible-section.d.ts +2 -1
  14. package/dist/components/enhanced-board/constants/i18n.d.ts +11 -6
  15. package/dist/components/enhanced-board/index.d.ts +7 -9
  16. package/dist/components/enhanced-table.d.ts +14 -2
  17. package/dist/components/horizontal-padding.d.ts +2 -0
  18. package/dist/components/inline-copy-to-clipboard.d.ts +6 -0
  19. package/dist/components/lazy-load.d.ts +2 -0
  20. package/dist/context/user-preferences/index.d.ts +6 -0
  21. package/dist/context/user-preferences/provider.d.ts +9 -0
  22. package/dist/context/user-preferences-store/context.d.ts +5 -0
  23. package/dist/context/user-preferences-store/hooks.d.ts +1 -0
  24. package/dist/context/user-preferences-store/provider.d.ts +5 -0
  25. package/dist/features/har-analyzer/components/app-layout.d.ts +7 -0
  26. package/dist/features/har-analyzer/components/preferences/index.d.ts +1 -0
  27. package/dist/features/har-analyzer/components/top-navigation.d.ts +8 -0
  28. package/dist/features/har-analyzer/context/preferences.d.ts +2 -0
  29. package/dist/features/har-analyzer-preferences-store/index.d.ts +2 -0
  30. package/dist/features/har-entries-viewer/index.d.ts +1 -1
  31. package/dist/features/list-har-entries/components/compare-mode-switcher.d.ts +1 -0
  32. package/dist/features/list-har-entries/components/content-type-filter.d.ts +1 -0
  33. package/dist/features/list-har-entries/components/errors-filter.d.ts +1 -0
  34. package/dist/features/list-har-entries/components/har-entries-table.d.ts +8 -0
  35. package/dist/features/list-har-entries/context/preferences.d.ts +5 -0
  36. package/dist/features/list-har-entries/index.d.ts +3 -7
  37. package/dist/har-analyzer-preferences-store.js +4 -0
  38. package/dist/har-analyzer.js +94 -81
  39. package/dist/har-entries-viewer.js +167 -7
  40. package/dist/index.d.ts +7 -2
  41. package/dist/index.js +12 -13
  42. package/dist/list-har-entries.js +3 -2126
  43. package/dist/utils/har.d.ts +1 -1
  44. package/dist/view-har-entry.js +5 -3128
  45. package/package.json +1 -1
  46. package/dist/chunks/json.js +0 -10
  47. package/dist/components/enhanced-top-navigation.d.ts +0 -7
  48. package/dist/components/simple-app-layout.d.ts +0 -6
  49. package/dist/components/simple-app-preferences/index.d.ts +0 -1
  50. package/dist/features/har-analyzer-preferences/index.d.ts +0 -7
  51. package/dist/features/har-entries-viewer/components/har-entries-filters/components/content-type-filter.d.ts +0 -7
  52. package/dist/features/har-entries-viewer/components/har-entries-filters/components/errors-filter.d.ts +0 -6
  53. package/dist/features/har-entries-viewer/components/har-entries-filters/index.d.ts +0 -1
  54. package/dist/features/har-entries-viewer/hooks/preferences.d.ts +0 -2
  55. package/dist/har-analyzer-preferences.js +0 -25
  56. package/dist/hooks/app-preferences.d.ts +0 -2
  57. package/dist/hooks/table-preferences.d.ts +0 -12
  58. /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/content-width-switcher.d.ts +0 -0
  59. /package/dist/{components/simple-app-preferences → features/har-analyzer/components/preferences/components}/theme-switcher.d.ts +0 -0
@@ -1,9 +1,169 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { H as e } from "./chunks/index.js";
4
- import "./list-har-entries.js";
5
- import "./view-har-entry.js";
6
- import "./chunks/har.js";
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useState as w, useEffect as T, useCallback as _ } from "react";
3
+ import z from "@cloudscape-design/board-components/board";
4
+ import N from "@cloudscape-design/board-components/board-item";
5
+ import B from "@cloudscape-design/components/button";
6
+ import { V as L, H as O } from "./chunks/index2.js";
7
+ import { L as k } from "./chunks/index.js";
8
+ import { d as g } from "./chunks/har.js";
9
+ const P = {
10
+ dragHandleAriaLabel: "Drag handle",
11
+ 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.",
12
+ resizeHandleAriaLabel: "Resize handle",
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
+ };
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
+ }
19
+ const M = {
20
+ liveAnnouncementDndStarted: (n) => n === "resize" ? "Resizing" : "Dragging",
21
+ liveAnnouncementDndItemReordered: (n) => {
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
+ n.conflicts,
26
+ n.disturbed
27
+ );
28
+ },
29
+ liveAnnouncementDndItemResized: (n) => {
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
+ },
33
+ liveAnnouncementDndItemInserted: (n) => {
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
+ },
37
+ liveAnnouncementDndCommitted: (n) => `${n} committed`,
38
+ liveAnnouncementDndDiscarded: (n) => `${n} discarded`,
39
+ liveAnnouncementItemRemoved: (n) => p(`Removed item ${n.item.id}.`, [], n.disturbed),
40
+ navigationAriaLabel: "Board navigation",
41
+ navigationAriaDescription: "Click on non-empty item to move focus over",
42
+ navigationItemAriaLabel: (n) => n ? n.id : "Empty"
43
+ };
44
+ function V(n) {
45
+ const {
46
+ components: t,
47
+ definitions: r,
48
+ onDefinitionsChange: a,
49
+ empty: m
50
+ } = n;
51
+ return /* @__PURE__ */ l(
52
+ z,
53
+ {
54
+ i18nStrings: M,
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
+ } else
64
+ h = e?.content, o = e?.onRemove;
65
+ return /* @__PURE__ */ l(
66
+ N,
67
+ {
68
+ disableContentPaddings: !0,
69
+ i18nStrings: P,
70
+ settings: o && /* @__PURE__ */ l(B, { variant: "icon", iconName: "close", onClick: o }),
71
+ children: h
72
+ }
73
+ );
74
+ },
75
+ onItemsChange: ({ detail: { items: d } }) => {
76
+ a(d);
77
+ },
78
+ empty: m
79
+ }
80
+ );
81
+ }
82
+ const E = {
83
+ rowSpan: 4,
84
+ columnSpan: 12
85
+ }, u = "har-entries-viewer", S = "view-har-entry", x = [
86
+ {
87
+ ...E,
88
+ id: u,
89
+ data: {
90
+ componentKey: u,
91
+ instanceId: u
92
+ }
93
+ }
94
+ ];
95
+ function Q(n) {
96
+ const {
97
+ harEntries: t,
98
+ tableTitle: r
99
+ } = n, [a, m] = w([]), [d, f] = w(x);
100
+ T(() => {
101
+ const o = new Set(t.map(g));
102
+ m((e) => {
103
+ if (!e.length)
104
+ return e;
105
+ const i = e.filter(
106
+ (c) => o.has(g(c))
107
+ );
108
+ return i.length !== e.length ? i : e;
109
+ });
110
+ }, [t]);
111
+ const I = _((o) => {
112
+ m(o);
113
+ const e = o.map(g), i = new Set(e);
114
+ f((c) => {
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,
121
+ data: {
122
+ componentKey: S,
123
+ instanceId: s
124
+ }
125
+ }));
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
+ });
133
+ });
134
+ }, []), h = {
135
+ [u]: {
136
+ content: /* @__PURE__ */ l(O, { children: /* @__PURE__ */ l(
137
+ k,
138
+ {
139
+ title: r,
140
+ harEntries: t,
141
+ selectedHAREntries: a,
142
+ onSelectionChange: I
143
+ }
144
+ ) })
145
+ },
146
+ [S]: (o) => {
147
+ const e = a.find((i) => g(i) === o);
148
+ return {
149
+ content: e ? /* @__PURE__ */ l(L, { harEntry: e }) : void 0,
150
+ onRemove: () => {
151
+ f((i) => i.filter((c) => c.data.instanceId !== o)), m(
152
+ (i) => i.filter((c) => g(c) !== o)
153
+ );
154
+ }
155
+ };
156
+ }
157
+ };
158
+ return /* @__PURE__ */ l(
159
+ V,
160
+ {
161
+ components: h,
162
+ definitions: d,
163
+ onDefinitionsChange: f
164
+ }
165
+ );
166
+ }
7
167
  export {
8
- e as default
168
+ Q as default
9
169
  };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  export { default as HARAnalyzer } from './features/har-analyzer';
2
- export { default as HARAnalyzerPreferencesProvider } from './features/har-analyzer-preferences';
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';
4
- export { default as useHAREntriesFilters } from './features/har-entries-viewer/components/har-entries-filters';
6
+ export type * from './features/har-entries-viewer';
5
7
  export { default as HARFileUploader } from './features/har-file-uploader';
8
+ export type * from './features/har-file-uploader';
6
9
  export { default as ListHAREntries } from './features/list-har-entries';
10
+ export type * from './features/list-har-entries';
7
11
  export { default as ViewHAREntry } from './features/view-har-entry';
12
+ export type * from './features/view-har-entry';
8
13
  export * from './utils/har';
package/dist/index.js CHANGED
@@ -1,22 +1,21 @@
1
1
  import { default as t } from "./har-analyzer.js";
2
- import { default as a } from "./har-analyzer-preferences.js";
3
- import { H as i, a as n } from "./chunks/index.js";
2
+ import { U as o } from "./chunks/provider.js";
3
+ import { default as n } from "./har-entries-viewer.js";
4
4
  import { default as A } from "./har-file-uploader.js";
5
- import { default as R } from "./list-har-entries.js";
6
- import { default as d } from "./view-har-entry.js";
7
- import { g as m, a as E, b as u, d as x, c as g, i as y } from "./chunks/har.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";
8
8
  export {
9
9
  t as HARAnalyzer,
10
- a as HARAnalyzerPreferencesProvider,
11
- i as HAREntriesViewer,
10
+ o as HARAnalyzerPreferencesStore,
11
+ n as HAREntriesViewer,
12
12
  A as HARFileUploader,
13
- R as ListHAREntries,
14
- d as ViewHAREntry,
13
+ f as ListHAREntries,
14
+ H as ViewHAREntry,
15
15
  m as getHARContentFromFile,
16
- E as getHAREntriesFilteredByContentType,
17
- u as getHAREntriesWithErrorResponse,
16
+ d as getHAREntriesFilteredByContentType,
17
+ E as getHAREntriesWithErrorResponse,
18
18
  x as getHAREntryId,
19
19
  g as getUniqueHeaderNames,
20
- y as isErrorResponse,
21
- n as useHAREntriesFilters
20
+ y as isErrorResponse
22
21
  };