@parca/profile 0.19.142 → 0.19.143

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 (135) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
  3. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +22 -28
  4. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  5. package/dist/ProfileExplorer/ProfileExplorerCompare.js +72 -73
  6. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
  7. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
  8. package/dist/ProfileFlameChart/index.d.ts.map +1 -1
  9. package/dist/ProfileFlameChart/index.js +20 -24
  10. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
  11. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +13 -14
  12. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  13. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +6 -5
  14. package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
  15. package/dist/ProfileFlameGraph/index.js +8 -7
  16. package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
  17. package/dist/ProfileMetricsGraph/index.js +6 -8
  18. package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
  19. package/dist/ProfileSelector/MetricsGraphSection.js +48 -55
  20. package/dist/ProfileSelector/index.d.ts +1 -1
  21. package/dist/ProfileSelector/index.d.ts.map +1 -1
  22. package/dist/ProfileSelector/index.js +216 -210
  23. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  24. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  25. package/dist/ProfileSelector/useAutoQuerySelector.js +133 -104
  26. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
  27. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +24 -25
  28. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  29. package/dist/ProfileView/components/ColorStackLegend.js +3 -5
  30. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
  31. package/dist/ProfileView/components/InvertCallStack/index.js +47 -47
  32. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +1 -2
  33. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
  34. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +37 -34
  35. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  36. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +282 -294
  37. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  38. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +7 -8
  39. package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
  40. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  41. package/dist/ProfileView/components/Toolbars/index.js +1 -1
  42. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  43. package/dist/ProfileView/components/ViewSelector/index.js +53 -75
  44. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
  45. package/dist/ProfileView/context/DashboardContext.js +36 -44
  46. package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
  47. package/dist/ProfileView/hooks/useResetFlameGraphState.js +8 -7
  48. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
  49. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +59 -59
  50. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
  51. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +37 -22
  52. package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
  53. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  54. package/dist/ProfileView/hooks/useVisualizationState.js +116 -147
  55. package/dist/ProfileViewWithData.d.ts.map +1 -1
  56. package/dist/ProfileViewWithData.js +35 -45
  57. package/dist/Sandwich/index.d.ts.map +1 -1
  58. package/dist/Sandwich/index.js +6 -5
  59. package/dist/SourceView/index.d.ts.map +1 -1
  60. package/dist/SourceView/index.js +6 -4
  61. package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
  62. package/dist/SourceView/useSelectedLineRange.js +52 -76
  63. package/dist/Table/MoreDropdown.d.ts.map +1 -1
  64. package/dist/Table/MoreDropdown.js +42 -53
  65. package/dist/Table/TableContextMenu.d.ts.map +1 -1
  66. package/dist/Table/TableContextMenu.js +15 -19
  67. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  68. package/dist/Table/hooks/useTableConfiguration.js +107 -115
  69. package/dist/Table/index.d.ts.map +1 -1
  70. package/dist/Table/index.js +16 -16
  71. package/dist/TopTable/index.d.ts.map +1 -1
  72. package/dist/TopTable/index.js +112 -127
  73. package/dist/hooks/urlParsers.d.ts +18 -0
  74. package/dist/hooks/urlParsers.d.ts.map +1 -0
  75. package/dist/hooks/urlParsers.js +44 -0
  76. package/dist/hooks/useColorBy.d.ts +5 -0
  77. package/dist/hooks/useColorBy.d.ts.map +1 -0
  78. package/dist/hooks/useColorBy.js +63 -0
  79. package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
  80. package/dist/hooks/useCompareModeMeta.js +94 -138
  81. package/dist/hooks/useDashboardItems.d.ts +5 -0
  82. package/dist/hooks/useDashboardItems.d.ts.map +1 -0
  83. package/dist/hooks/useDashboardItems.js +68 -0
  84. package/dist/hooks/useQueryState.d.ts +4 -4
  85. package/dist/hooks/useQueryState.d.ts.map +1 -1
  86. package/dist/hooks/useQueryState.js +127 -122
  87. package/dist/index.d.ts +3 -2
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +3 -12
  90. package/dist/useSumBy.d.ts +1 -1
  91. package/dist/useSumBy.d.ts.map +1 -1
  92. package/dist/useSumBy.js +2 -2
  93. package/package.json +4 -3
  94. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +11 -13
  95. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +11 -9
  96. package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
  97. package/src/ProfileFlameChart/index.tsx +21 -28
  98. package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +10 -9
  99. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +5 -3
  100. package/src/ProfileFlameGraph/index.tsx +6 -9
  101. package/src/ProfileMetricsGraph/index.tsx +6 -8
  102. package/src/ProfileSelector/MetricsGraphSection.tsx +5 -10
  103. package/src/ProfileSelector/index.tsx +33 -33
  104. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  105. package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +10 -6
  106. package/src/ProfileView/components/ColorStackLegend.tsx +2 -4
  107. package/src/ProfileView/components/InvertCallStack/index.tsx +5 -4
  108. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +94 -192
  109. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
  110. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +24 -25
  111. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +4 -5
  112. package/src/ProfileView/components/Toolbars/index.tsx +3 -3
  113. package/src/ProfileView/components/ViewSelector/index.tsx +9 -16
  114. package/src/ProfileView/context/DashboardContext.tsx +6 -6
  115. package/src/ProfileView/hooks/useResetFlameGraphState.ts +6 -4
  116. package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +24 -26
  117. package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +16 -8
  118. package/src/ProfileView/hooks/useVisualizationState.ts +61 -69
  119. package/src/ProfileViewWithData.tsx +29 -35
  120. package/src/Sandwich/index.tsx +4 -3
  121. package/src/SourceView/index.tsx +4 -2
  122. package/src/SourceView/useSelectedLineRange.ts +34 -19
  123. package/src/Table/MoreDropdown.tsx +9 -11
  124. package/src/Table/TableContextMenu.tsx +10 -13
  125. package/src/Table/hooks/useTableConfiguration.tsx +3 -4
  126. package/src/Table/index.tsx +12 -21
  127. package/src/TopTable/index.tsx +3 -4
  128. package/src/hooks/urlParsers.ts +38 -0
  129. package/src/hooks/useColorBy.ts +42 -0
  130. package/src/hooks/useCompareModeMeta.ts +61 -91
  131. package/src/hooks/useDashboardItems.ts +46 -0
  132. package/src/hooks/useQueryState.test.tsx +275 -345
  133. package/src/hooks/useQueryState.ts +153 -120
  134. package/src/index.tsx +16 -15
  135. package/src/useSumBy.ts +3 -3
@@ -4,12 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
8
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
13
7
  import { c as _c } from "react-compiler-runtime";
14
8
  // Copyright 2022 The Parca Authors
15
9
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,9 +20,10 @@ import { c as _c } from "react-compiler-runtime";
26
20
 
27
21
  import React, { useCallback, useEffect, useMemo } from 'react';
28
22
  import { createColumnHelper } from '@tanstack/react-table';
29
- import { Button, Table, useURLState } from '@parca/components';
23
+ import { Button, Table } from '@parca/components';
30
24
  import { getLastItem, isSearchMatch, parseParams, valueFormatter } from '@parca/utilities';
31
25
  import { useProfileViewContext } from '../ProfileView/context/ProfileViewContext';
26
+ import { useDashboardItems } from '../hooks/useDashboardItems';
32
27
  import { hexifyAddress } from '../utils';
33
28
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
34
29
  export var RowLabel = function RowLabel(meta) {
@@ -48,7 +43,7 @@ var addPlusSign = function addPlusSign(num) {
48
43
  return "+".concat(num);
49
44
  };
50
45
  export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
51
- var $ = _c(46);
46
+ var $ = _c(45);
52
47
  var top = t0.data,
53
48
  unit = t0.sampleUnit,
54
49
  navigateTo = t0.navigateTo,
@@ -64,34 +59,24 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
64
59
  t1 = $[0];
65
60
  }
66
61
  var router = t1;
67
- var t2;
68
- if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
69
- t2 = {
70
- alwaysReturnArray: true
71
- };
72
- $[1] = t2;
73
- } else {
74
- t2 = $[1];
75
- }
76
- var _useURLState = useURLState("dashboard_items", t2),
77
- _useURLState2 = _slicedToArray(_useURLState, 1),
78
- dashboardItems = _useURLState2[0];
62
+ var _useDashboardItems = useDashboardItems(),
63
+ dashboardItems = _useDashboardItems.dashboardItems;
79
64
  var _useProfileViewContex = useProfileViewContext(),
80
65
  compareMode = _useProfileViewContex.compareMode;
81
- var t3;
82
- if ($[2] === Symbol["for"]("react.memo_cache_sentinel")) {
83
- t3 = columnHelper.accessor("meta", {
66
+ var t2;
67
+ if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
68
+ t2 = columnHelper.accessor("meta", {
84
69
  header: _temp,
85
70
  cell: _temp2,
86
71
  sortingFn: _temp3
87
72
  });
88
- $[2] = t3;
73
+ $[1] = t2;
89
74
  } else {
90
- t3 = $[2];
75
+ t2 = $[1];
91
76
  }
92
- var t4;
93
- if ($[3] !== unit) {
94
- t4 = columnHelper.accessor("flat", {
77
+ var t3;
78
+ if ($[2] !== unit) {
79
+ t3 = columnHelper.accessor("flat", {
95
80
  header: _temp4,
96
81
  cell: function cell(info_0) {
97
82
  return valueFormatter(info_0.getValue(), unit, 2);
@@ -102,14 +87,14 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
102
87
  },
103
88
  sortDescFirst: true
104
89
  });
105
- $[3] = unit;
106
- $[4] = t4;
90
+ $[2] = unit;
91
+ $[3] = t3;
107
92
  } else {
108
- t4 = $[4];
93
+ t3 = $[3];
109
94
  }
110
- var t5;
111
- if ($[5] !== unit) {
112
- t5 = columnHelper.accessor("cumulative", {
95
+ var t4;
96
+ if ($[4] !== unit) {
97
+ t4 = columnHelper.accessor("cumulative", {
113
98
  header: _temp5,
114
99
  cell: function cell(info_1) {
115
100
  return valueFormatter(info_1.getValue(), unit, 2);
@@ -120,17 +105,17 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
120
105
  },
121
106
  sortDescFirst: true
122
107
  });
123
- $[5] = unit;
124
- $[6] = t5;
108
+ $[4] = unit;
109
+ $[5] = t4;
125
110
  } else {
126
- t5 = $[6];
111
+ t4 = $[5];
127
112
  }
128
113
  var cols;
129
- if ($[7] !== compareMode || $[8] !== t4 || $[9] !== t5 || $[10] !== unit) {
130
- cols = [t3, t4, t5];
114
+ if ($[6] !== compareMode || $[7] !== t3 || $[8] !== t4 || $[9] !== unit) {
115
+ cols = [t2, t3, t4];
131
116
  if (compareMode) {
132
117
  var _t;
133
- if ($[12] !== unit) {
118
+ if ($[11] !== unit) {
134
119
  _t = columnHelper.accessor("diff", {
135
120
  header: _temp6,
136
121
  cell: function cell(info_2) {
@@ -142,25 +127,25 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
142
127
  },
143
128
  sortDescFirst: true
144
129
  });
145
- $[12] = unit;
146
- $[13] = _t;
130
+ $[11] = unit;
131
+ $[12] = _t;
147
132
  } else {
148
- _t = $[13];
133
+ _t = $[12];
149
134
  }
150
135
  cols.push(_t);
151
136
  }
152
- $[7] = compareMode;
137
+ $[6] = compareMode;
138
+ $[7] = t3;
153
139
  $[8] = t4;
154
- $[9] = t5;
155
- $[10] = unit;
156
- $[11] = cols;
140
+ $[9] = unit;
141
+ $[10] = cols;
157
142
  } else {
158
- cols = $[11];
143
+ cols = $[10];
159
144
  }
160
145
  var columns = cols;
161
- var t6;
162
- if ($[14] !== navigateTo) {
163
- t6 = function t6(span) {
146
+ var t5;
147
+ if ($[13] !== navigateTo) {
148
+ t5 = function t5(span) {
164
149
  if (navigateTo != null) {
165
150
  navigateTo("/", _objectSpread(_objectSpread({}, router), {
166
151
  search_string: span.trim()
@@ -169,15 +154,15 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
169
154
  });
170
155
  }
171
156
  };
172
- $[14] = navigateTo;
173
- $[15] = t6;
157
+ $[13] = navigateTo;
158
+ $[14] = t5;
174
159
  } else {
175
- t6 = $[15];
160
+ t5 = $[14];
176
161
  }
177
- var selectSpan = t6;
178
- var t7;
179
- if ($[16] !== dashboardItems.length || $[17] !== selectSpan) {
180
- t7 = function t7(row) {
162
+ var selectSpan = t5;
163
+ var t6;
164
+ if ($[15] !== dashboardItems.length || $[16] !== selectSpan) {
165
+ t6 = function t6(row) {
181
166
  if (dashboardItems.length <= 1) {
182
167
  return;
183
168
  }
@@ -188,16 +173,16 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
188
173
  var name_0 = RowLabel(meta_0);
189
174
  selectSpan(name_0);
190
175
  };
191
- $[16] = dashboardItems.length;
192
- $[17] = selectSpan;
193
- $[18] = t7;
176
+ $[15] = dashboardItems.length;
177
+ $[16] = selectSpan;
178
+ $[17] = t6;
194
179
  } else {
195
- t7 = $[18];
180
+ t6 = $[17];
196
181
  }
197
- var onRowClick = t7;
198
- var t8;
199
- if ($[19] !== currentSearchString) {
200
- t8 = function t8(row_0) {
182
+ var onRowClick = t6;
183
+ var t7;
184
+ if ($[18] !== currentSearchString) {
185
+ t7 = function t7(row_0) {
201
186
  var meta_1 = row_0.meta;
202
187
  if (meta_1 === undefined) {
203
188
  return false;
@@ -205,16 +190,16 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
205
190
  var name_1 = RowLabel(meta_1);
206
191
  return isSearchMatch(currentSearchString, name_1);
207
192
  };
208
- $[19] = currentSearchString;
209
- $[20] = t8;
193
+ $[18] = currentSearchString;
194
+ $[19] = t7;
210
195
  } else {
211
- t8 = $[20];
196
+ t7 = $[19];
212
197
  }
213
- var shouldHighlightRow = t8;
198
+ var shouldHighlightRow = t7;
214
199
  var enableHighlighting = currentSearchString != null && (currentSearchString === null || currentSearchString === void 0 ? void 0 : currentSearchString.length) > 0;
215
- var t9;
216
- if ($[21] !== navigateTo) {
217
- t9 = function t9() {
200
+ var t8;
201
+ if ($[20] !== navigateTo) {
202
+ t8 = function t8() {
218
203
  if (navigateTo != null) {
219
204
  navigateTo("/", _objectSpread(_objectSpread({}, router), {
220
205
  search_string: ""
@@ -223,15 +208,15 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
223
208
  });
224
209
  }
225
210
  };
226
- $[21] = navigateTo;
227
- $[22] = t9;
211
+ $[20] = navigateTo;
212
+ $[21] = t8;
228
213
  } else {
229
- t9 = $[22];
214
+ t8 = $[21];
230
215
  }
231
- var clearSelection = t9;
232
- var t10;
233
- if ($[23] !== clearSelection || $[24] !== currentSearchString || $[25] !== dashboardItems.length || $[26] !== setActionButtons) {
234
- t10 = function t10() {
216
+ var clearSelection = t8;
217
+ var t9;
218
+ if ($[22] !== clearSelection || $[23] !== currentSearchString || $[24] !== dashboardItems.length || $[25] !== setActionButtons) {
219
+ t9 = function t9() {
235
220
  if (setActionButtons === undefined) {
236
221
  return;
237
222
  }
@@ -247,92 +232,92 @@ export var TopTable = /*#__PURE__*/React.memo(function TopTable(t0) {
247
232
  })
248
233
  }) : /*#__PURE__*/_jsx(_Fragment, {}));
249
234
  };
250
- $[23] = clearSelection;
251
- $[24] = currentSearchString;
252
- $[25] = dashboardItems.length;
253
- $[26] = setActionButtons;
254
- $[27] = t10;
235
+ $[22] = clearSelection;
236
+ $[23] = currentSearchString;
237
+ $[24] = dashboardItems.length;
238
+ $[25] = setActionButtons;
239
+ $[26] = t9;
255
240
  } else {
256
- t10 = $[27];
241
+ t9 = $[26];
257
242
  }
258
- var t11;
259
- if ($[28] !== clearSelection || $[29] !== currentSearchString || $[30] !== dashboardItems || $[31] !== setActionButtons) {
260
- t11 = [dashboardItems, clearSelection, currentSearchString, setActionButtons];
261
- $[28] = clearSelection;
262
- $[29] = currentSearchString;
263
- $[30] = dashboardItems;
264
- $[31] = setActionButtons;
265
- $[32] = t11;
243
+ var t10;
244
+ if ($[27] !== clearSelection || $[28] !== currentSearchString || $[29] !== dashboardItems || $[30] !== setActionButtons) {
245
+ t10 = [dashboardItems, clearSelection, currentSearchString, setActionButtons];
246
+ $[27] = clearSelection;
247
+ $[28] = currentSearchString;
248
+ $[29] = dashboardItems;
249
+ $[30] = setActionButtons;
250
+ $[31] = t10;
266
251
  } else {
267
- t11 = $[32];
252
+ t10 = $[31];
268
253
  }
269
- useEffect(t10, t11);
270
- var t12 = compareMode ? "diff" : "cumulative";
271
- var t13;
272
- if ($[33] !== t12) {
273
- t13 = [{
274
- id: t12,
254
+ useEffect(t9, t10);
255
+ var t11 = compareMode ? "diff" : "cumulative";
256
+ var t12;
257
+ if ($[32] !== t11) {
258
+ t12 = [{
259
+ id: t11,
275
260
  desc: true
276
261
  }];
262
+ $[32] = t11;
277
263
  $[33] = t12;
278
- $[34] = t13;
279
264
  } else {
280
- t13 = $[34];
265
+ t12 = $[33];
281
266
  }
282
- var initialSorting = t13;
267
+ var initialSorting = t12;
283
268
  var total = top != null ? top.list.length : 0;
284
269
  if (total === 0 && !loading) {
285
270
  var _t2;
286
- if ($[35] === Symbol["for"]("react.memo_cache_sentinel")) {
271
+ if ($[34] === Symbol["for"]("react.memo_cache_sentinel")) {
287
272
  _t2 = /*#__PURE__*/_jsx("div", {
288
273
  className: "mx-auto text-center",
289
274
  children: "Profile has no samples"
290
275
  });
291
- $[35] = _t2;
276
+ $[34] = _t2;
292
277
  } else {
293
- _t2 = $[35];
278
+ _t2 = $[34];
294
279
  }
295
280
  return _t2;
296
281
  }
297
- var t14;
298
- if ($[36] !== (top === null || top === void 0 ? void 0 : top.list)) {
282
+ var t13;
283
+ if ($[35] !== (top === null || top === void 0 ? void 0 : top.list)) {
299
284
  var _top$list;
300
- t14 = (_top$list = top === null || top === void 0 ? void 0 : top.list) !== null && _top$list !== void 0 ? _top$list : [];
301
- $[36] = top === null || top === void 0 ? void 0 : top.list;
302
- $[37] = t14;
285
+ t13 = (_top$list = top === null || top === void 0 ? void 0 : top.list) !== null && _top$list !== void 0 ? _top$list : [];
286
+ $[35] = top === null || top === void 0 ? void 0 : top.list;
287
+ $[36] = t13;
303
288
  } else {
304
- t14 = $[37];
289
+ t13 = $[36];
305
290
  }
306
- var t15 = dashboardItems.length > 1;
307
- var t16;
308
- if ($[38] !== columns || $[39] !== enableHighlighting || $[40] !== initialSorting || $[41] !== onRowClick || $[42] !== shouldHighlightRow || $[43] !== t14 || $[44] !== t15) {
309
- t16 = /*#__PURE__*/_jsx("div", {
291
+ var t14 = dashboardItems.length > 1;
292
+ var t15;
293
+ if ($[37] !== columns || $[38] !== enableHighlighting || $[39] !== initialSorting || $[40] !== onRowClick || $[41] !== shouldHighlightRow || $[42] !== t13 || $[43] !== t14) {
294
+ t15 = /*#__PURE__*/_jsx("div", {
310
295
  className: "relative",
311
296
  children: /*#__PURE__*/_jsx("div", {
312
297
  className: "font-robotoMono h-[80vh] w-full overflow-scroll",
313
298
  children: /*#__PURE__*/_jsx(Table, {
314
- data: t14,
299
+ data: t13,
315
300
  columns: columns,
316
301
  initialSorting: initialSorting,
317
302
  onRowClick: onRowClick,
318
303
  enableHighlighting: enableHighlighting,
319
304
  shouldHighlightRow: shouldHighlightRow,
320
- usePointerCursor: t15
305
+ usePointerCursor: t14
321
306
  })
322
307
  })
323
308
  });
324
- $[38] = columns;
325
- $[39] = enableHighlighting;
326
- $[40] = initialSorting;
327
- $[41] = onRowClick;
328
- $[42] = shouldHighlightRow;
309
+ $[37] = columns;
310
+ $[38] = enableHighlighting;
311
+ $[39] = initialSorting;
312
+ $[40] = onRowClick;
313
+ $[41] = shouldHighlightRow;
314
+ $[42] = t13;
329
315
  $[43] = t14;
330
316
  $[44] = t15;
331
- $[45] = t16;
332
317
  } else {
333
- t16 = $[45];
318
+ t15 = $[44];
334
319
  }
335
- return t16;
320
+ return t15;
336
321
  });
337
322
  export default TopTable;
338
323
  function _temp() {
@@ -0,0 +1,18 @@
1
+ import { createParser } from 'nuqs';
2
+ export declare const stringParam: import("nuqs").SingleParserBuilder<string>;
3
+ export declare const boolParam: import("nuqs").SingleParserBuilder<boolean>;
4
+ export declare const intParam: import("nuqs").SingleParserBuilder<number>;
5
+ export declare const commaArrayParam: import("nuqs").SingleParserBuilder<string[]>;
6
+ export declare const invertCallStackParser: Omit<import("nuqs").SingleParserBuilder<boolean>, "parseServerSide"> & {
7
+ readonly defaultValue: boolean;
8
+ parseServerSide(value: string | string[] | undefined): boolean;
9
+ };
10
+ export declare const groupByParser: import("nuqs").SingleParserBuilder<string[]>;
11
+ export declare const flamechartDimensionParser: import("nuqs").SingleParserBuilder<string[]>;
12
+ export declare const tableColumnsParser: import("nuqs").SingleParserBuilder<string[]>;
13
+ export declare const hiddenBinariesParser: Omit<import("nuqs").SingleParserBuilder<string[]>, "parseServerSide"> & {
14
+ readonly defaultValue: string[];
15
+ parseServerSide(value: string | string[] | undefined): string[];
16
+ };
17
+ export declare function jsonParser<T>(): ReturnType<typeof createParser<T>>;
18
+ //# sourceMappingURL=urlParsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlParsers.d.ts","sourceRoot":"","sources":["../../src/hooks/urlParsers.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,YAAY,EAAgE,MAAM,MAAM,CAAC;AAKjG,eAAO,MAAM,WAAW,4CAAkC,CAAC;AAC3D,eAAO,MAAM,SAAS,6CAAmC,CAAC;AAC1D,eAAO,MAAM,QAAQ,4CAAmC,CAAC;AACzD,eAAO,MAAM,eAAe,8CAAuD,CAAC;AAGpF,eAAO,MAAM,qBAAqB;;;CAA+B,CAAC;AAClE,eAAO,MAAM,aAAa,8CAAkB,CAAC;AAC7C,eAAO,MAAM,yBAAyB,8CAAkB,CAAC;AACzD,eAAO,MAAM,kBAAkB,8CAAkB,CAAC;AAClD,eAAO,MAAM,oBAAoB;;;CAAkC,CAAC;AAGpE,wBAAgB,UAAU,CAAC,CAAC,KAAK,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAMlE"}
@@ -0,0 +1,44 @@
1
+ // Copyright 2022 The Parca Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ import { createParser, parseAsArrayOf, parseAsBoolean, parseAsInteger, parseAsString } from 'nuqs';
15
+ var opts = {
16
+ history: 'replace'
17
+ };
18
+
19
+ // === Base parsers with common options ===
20
+ export var stringParam = parseAsString.withOptions(opts);
21
+ export var boolParam = parseAsBoolean.withOptions(opts);
22
+ export var intParam = parseAsInteger.withOptions(opts);
23
+ export var commaArrayParam = parseAsArrayOf(parseAsString, ',').withOptions(opts);
24
+
25
+ // === Param-specific parsers with defaults ===
26
+ export var invertCallStackParser = boolParam.withDefault(false);
27
+ export var groupByParser = commaArrayParam;
28
+ export var flamechartDimensionParser = commaArrayParam;
29
+ export var tableColumnsParser = commaArrayParam;
30
+ export var hiddenBinariesParser = commaArrayParam.withDefault([]);
31
+
32
+ // === JSON parser with BigInt support ===
33
+ export function jsonParser() {
34
+ return createParser({
35
+ parse: function parse(value) {
36
+ return JSON.parse(value);
37
+ },
38
+ serialize: function serialize(value) {
39
+ return JSON.stringify(value, function (_, v) {
40
+ return typeof v === 'bigint' ? v.toString() : v;
41
+ });
42
+ }
43
+ }).withOptions(opts);
44
+ }
@@ -0,0 +1,5 @@
1
+ export declare const useColorBy: () => {
2
+ colorBy: string;
3
+ setColorBy: (value: string) => void;
4
+ };
5
+ //# sourceMappingURL=useColorBy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useColorBy.d.ts","sourceRoot":"","sources":["../../src/hooks/useColorBy.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,UAAU,QAAO;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAkBrC,CAAC"}
@@ -0,0 +1,63 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import { c as _c } from "react-compiler-runtime";
8
+ // Copyright 2022 The Parca Authors
9
+ // Licensed under the Apache License, Version 2.0 (the "License");
10
+ // you may not use this file except in compliance with the License.
11
+ // You may obtain a copy of the License at
12
+ //
13
+ // http://www.apache.org/licenses/LICENSE-2.0
14
+ //
15
+ // Unless required by applicable law or agreed to in writing, software
16
+ // distributed under the License is distributed on an "AS IS" BASIS,
17
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ // See the License for the specific language governing permissions and
19
+ // limitations under the License.
20
+
21
+ import { useCallback } from 'react';
22
+ import { useQueryState } from 'nuqs';
23
+ import { USER_PREFERENCES, useUserPreference } from '@parca/hooks';
24
+ import { stringParam } from './urlParsers';
25
+ export var useColorBy = function useColorBy() {
26
+ var _ref;
27
+ var $ = _c(6);
28
+ var _useUserPreference = useUserPreference(USER_PREFERENCES.COLOR_BY.key),
29
+ _useUserPreference2 = _slicedToArray(_useUserPreference, 2),
30
+ colorByPreference = _useUserPreference2[0],
31
+ setColorByPreference = _useUserPreference2[1];
32
+ var _useQueryState = useQueryState("color_by", stringParam),
33
+ _useQueryState2 = _slicedToArray(_useQueryState, 2),
34
+ colorByRaw = _useQueryState2[0],
35
+ setRawColorBy = _useQueryState2[1];
36
+ var colorBy = (_ref = colorByRaw !== null && colorByRaw !== void 0 ? colorByRaw : colorByPreference) !== null && _ref !== void 0 ? _ref : "binary";
37
+ var t0;
38
+ if ($[0] !== setColorByPreference || $[1] !== setRawColorBy) {
39
+ t0 = function t0(value) {
40
+ setRawColorBy(value);
41
+ setColorByPreference(value);
42
+ };
43
+ $[0] = setColorByPreference;
44
+ $[1] = setRawColorBy;
45
+ $[2] = t0;
46
+ } else {
47
+ t0 = $[2];
48
+ }
49
+ var setColorBy = t0;
50
+ var t1;
51
+ if ($[3] !== colorBy || $[4] !== setColorBy) {
52
+ t1 = {
53
+ colorBy: colorBy,
54
+ setColorBy: setColorBy
55
+ };
56
+ $[3] = colorBy;
57
+ $[4] = setColorBy;
58
+ $[5] = t1;
59
+ } else {
60
+ t1 = $[5];
61
+ }
62
+ return t1;
63
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"useCompareModeMeta.d.ts","sourceRoot":"","sources":["../../src/hooks/useCompareModeMeta.ts"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,KAAK,IAAI,CAAC;CA0G7C,CAAC"}
1
+ {"version":3,"file":"useCompareModeMeta.d.ts","sourceRoot":"","sources":["../../src/hooks/useCompareModeMeta.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,KAAK,IAAI,CAAC;CA0E7C,CAAC"}