@parca/profile 0.19.140 → 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 (182) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +94 -68
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
  29. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  30. package/dist/ProfileExplorer/index.js +183 -32
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  33. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  34. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  35. package/dist/ProfileFlameChart/index.js +260 -126
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  56. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  57. package/dist/ProfileFlameGraph/index.js +322 -147
  58. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  59. package/dist/ProfileMetricsGraph/index.js +515 -256
  60. package/dist/ProfileSelector/CompareButton.js +132 -12
  61. package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
  62. package/dist/ProfileSelector/index.d.ts +1 -1
  63. package/dist/ProfileSelector/index.d.ts.map +1 -1
  64. package/dist/ProfileSelector/index.js +734 -142
  65. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  66. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  67. package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
  68. package/dist/ProfileSource.js +230 -163
  69. package/dist/ProfileTypeSelector/index.js +214 -125
  70. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  71. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
  72. package/dist/ProfileView/components/ColorStackLegend.js +182 -54
  73. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  74. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  75. package/dist/ProfileView/components/DiffLegend.js +172 -29
  76. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  77. package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
  78. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  79. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  80. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  81. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
  82. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  83. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  84. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  85. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  86. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
  87. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  88. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
  89. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  90. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  91. package/dist/ProfileView/components/ViewSelector/index.js +186 -82
  92. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  93. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  94. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  95. package/dist/ProfileView/context/DashboardContext.js +74 -26
  96. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  97. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  98. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  99. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  100. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  101. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
  102. package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
  103. package/dist/ProfileView/index.js +383 -45
  104. package/dist/ProfileView/types/visualization.js +1 -13
  105. package/dist/ProfileView/utils/colorUtils.js +8 -7
  106. package/dist/ProfileViewWithData.js +319 -225
  107. package/dist/QueryControls/index.js +418 -47
  108. package/dist/Sandwich/components/CalleesSection.js +54 -4
  109. package/dist/Sandwich/components/CallersSection.js +97 -27
  110. package/dist/Sandwich/components/TableSection.js +77 -4
  111. package/dist/Sandwich/index.js +125 -12
  112. package/dist/Sandwich/utils/processRowData.js +48 -39
  113. package/dist/SelectWithRefresh/index.js +102 -28
  114. package/dist/SimpleMatchers/Select.js +520 -187
  115. package/dist/SimpleMatchers/index.js +590 -288
  116. package/dist/SourceView/Highlighter.js +230 -70
  117. package/dist/SourceView/LineNo.js +72 -17
  118. package/dist/SourceView/index.js +177 -101
  119. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  120. package/dist/SourceView/lang-detector/index.js +28 -14
  121. package/dist/SourceView/useSelectedLineRange.js +72 -20
  122. package/dist/Table/ColorCell.js +42 -1
  123. package/dist/Table/ColumnsVisibility.js +114 -6
  124. package/dist/Table/MoreDropdown.js +107 -21
  125. package/dist/Table/TableContextMenu.js +144 -134
  126. package/dist/Table/TableContextMenuWrapper.js +59 -14
  127. package/dist/Table/hooks/useColorManagement.js +58 -16
  128. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  129. package/dist/Table/hooks/useTableConfiguration.js +323 -167
  130. package/dist/Table/index.js +217 -123
  131. package/dist/Table/utils/functions.js +169 -144
  132. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  133. package/dist/TimelineGuide/index.js +209 -16
  134. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  135. package/dist/TopTable/index.js +325 -121
  136. package/dist/contexts/LabelsQueryProvider.js +94 -32
  137. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  138. package/dist/contexts/utils.js +37 -15
  139. package/dist/hooks/urlParsers.js +27 -15
  140. package/dist/hooks/useColorBy.js +47 -10
  141. package/dist/hooks/useCompareModeMeta.js +112 -62
  142. package/dist/hooks/useDashboardItems.js +52 -11
  143. package/dist/hooks/useLabels.js +295 -52
  144. package/dist/hooks/useQueryState.d.ts +1 -1
  145. package/dist/hooks/useQueryState.d.ts.map +1 -1
  146. package/dist/hooks/useQueryState.js +375 -329
  147. package/dist/index.js +11 -6
  148. package/dist/testdata/fg-diff.json +3750 -0
  149. package/dist/testdata/fg-simple.json +1879 -0
  150. package/dist/testdata/link_data.json +56 -0
  151. package/dist/testdata/tabular.json +30 -0
  152. package/dist/testdata/test_flamegraph.json +26846 -0
  153. package/dist/testdata/test_graph.json +53 -0
  154. package/dist/useDelayedLoader.js +32 -18
  155. package/dist/useGrpcQuery/index.js +71 -11
  156. package/dist/useHasProfileData.js +90 -12
  157. package/dist/useQuery.js +205 -64
  158. package/dist/useSumBy.d.ts.map +1 -1
  159. package/dist/useSumBy.js +294 -138
  160. package/dist/utils.js +62 -30
  161. package/package.json +9 -9
  162. package/src/GraphTooltipArrow/index.tsx +3 -0
  163. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  164. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  165. package/src/MatchersInput/index.tsx +1 -1
  166. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  167. package/src/PreSelectedMatchers/index.tsx +3 -0
  168. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
  169. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  170. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  171. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  172. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  173. package/src/ProfileSelector/index.tsx +31 -9
  174. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  175. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  176. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  177. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  178. package/src/hooks/useQueryState.ts +18 -3
  179. package/src/useDelayedLoader.ts +10 -10
  180. package/src/useSumBy.ts +12 -18
  181. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  182. package/dist/hooks/useQueryState.test.js +0 -868
@@ -1,3 +1,6 @@
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
2
+ 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; } }
3
+ 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; }
1
4
  // Copyright 2022 The Parca Authors
2
5
  // Licensed under the Apache License, Version 2.0 (the "License");
3
6
  // you may not use this file except in compliance with the License.
@@ -10,20 +13,31 @@
10
13
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
14
  // See the License for the specific language governing permissions and
12
15
  // limitations under the License.
16
+
13
17
  import * as hljsLangs from 'react-syntax-highlighter/dist/cjs/languages/hljs';
14
18
  import _extLangMap from './ext-to-lang.json';
15
- const extLangMap = _extLangMap;
16
- export const langaugeFromFile = (file) => {
17
- const extension = file.split('.').pop() ?? '';
18
- if (extLangMap[extension] == null) {
19
- return 'text';
20
- }
21
- const langs = extLangMap[extension];
22
- for (const lang of langs) {
23
- // eslint-disable-next-line import/namespace
24
- if (hljsLangs[lang] != null) {
25
- return lang;
26
- }
27
- }
19
+ var extLangMap = _extLangMap;
20
+ export var langaugeFromFile = function langaugeFromFile(file) {
21
+ var _file$split$pop;
22
+ var extension = (_file$split$pop = file.split('.').pop()) !== null && _file$split$pop !== void 0 ? _file$split$pop : '';
23
+ if (extLangMap[extension] == null) {
28
24
  return 'text';
29
- };
25
+ }
26
+ var langs = extLangMap[extension];
27
+ var _iterator = _createForOfIteratorHelper(langs),
28
+ _step;
29
+ try {
30
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
31
+ var lang = _step.value;
32
+ // eslint-disable-next-line import/namespace
33
+ if (hljsLangs[lang] != null) {
34
+ return lang;
35
+ }
36
+ }
37
+ } catch (err) {
38
+ _iterator.e(err);
39
+ } finally {
40
+ _iterator.f();
41
+ }
42
+ return 'text';
43
+ };
@@ -1,3 +1,10 @@
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";
1
8
  // Copyright 2022 The Parca Authors
2
9
  // Licensed under the Apache License, Version 2.0 (the "License");
3
10
  // you may not use this file except in compliance with the License.
@@ -10,28 +17,73 @@
10
17
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
18
  // See the License for the specific language governing permissions and
12
19
  // limitations under the License.
20
+
13
21
  import { useCallback } from 'react';
14
22
  import { createParser, useQueryState } from 'nuqs';
15
- const lineRangeParser = createParser({
16
- parse: (value) => {
17
- const [start, end] = value.split('-');
18
- const startNum = parseInt(start, 10);
19
- if (isNaN(startNum))
20
- return null;
21
- const endNum = end !== undefined ? parseInt(end, 10) : startNum;
22
- return { start: startNum, end: isNaN(endNum) ? startNum : endNum };
23
- },
24
- serialize: (value) => `${value.start}-${value.end}`,
25
- }).withOptions({ history: 'replace' });
26
- const useLineRange = () => {
27
- const [lineRange, setRawLineRange] = useQueryState('source_line', lineRangeParser.withDefault({ start: -1, end: -1 }));
28
- const setLineRange = useCallback((start, end) => {
29
- void setRawLineRange({ start, end });
30
- }, [setRawLineRange]);
23
+ var lineRangeParser = createParser({
24
+ parse: function parse(value) {
25
+ var _value$split = value.split('-'),
26
+ _value$split2 = _slicedToArray(_value$split, 2),
27
+ start = _value$split2[0],
28
+ end = _value$split2[1];
29
+ var startNum = parseInt(start, 10);
30
+ if (isNaN(startNum)) return null;
31
+ var endNum = end !== undefined ? parseInt(end, 10) : startNum;
31
32
  return {
32
- startLine: lineRange.start,
33
- endLine: lineRange.end,
34
- setLineRange,
33
+ start: startNum,
34
+ end: isNaN(endNum) ? startNum : endNum
35
35
  };
36
+ },
37
+ serialize: function serialize(value) {
38
+ return "".concat(value.start, "-").concat(value.end);
39
+ }
40
+ }).withOptions({
41
+ history: 'replace'
42
+ });
43
+ var useLineRange = function useLineRange() {
44
+ var $ = _c(7);
45
+ var t0;
46
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
47
+ t0 = lineRangeParser.withDefault({
48
+ start: -1,
49
+ end: -1
50
+ });
51
+ $[0] = t0;
52
+ } else {
53
+ t0 = $[0];
54
+ }
55
+ var _useQueryState = useQueryState("source_line", t0),
56
+ _useQueryState2 = _slicedToArray(_useQueryState, 2),
57
+ lineRange = _useQueryState2[0],
58
+ setRawLineRange = _useQueryState2[1];
59
+ var t1;
60
+ if ($[1] !== setRawLineRange) {
61
+ t1 = function t1(start, end) {
62
+ setRawLineRange({
63
+ start: start,
64
+ end: end
65
+ });
66
+ };
67
+ $[1] = setRawLineRange;
68
+ $[2] = t1;
69
+ } else {
70
+ t1 = $[2];
71
+ }
72
+ var setLineRange = t1;
73
+ var t2;
74
+ if ($[3] !== lineRange.end || $[4] !== lineRange.start || $[5] !== setLineRange) {
75
+ t2 = {
76
+ startLine: lineRange.start,
77
+ endLine: lineRange.end,
78
+ setLineRange: setLineRange
79
+ };
80
+ $[3] = lineRange.end;
81
+ $[4] = lineRange.start;
82
+ $[5] = setLineRange;
83
+ $[6] = t2;
84
+ } else {
85
+ t2 = $[6];
86
+ }
87
+ return t2;
36
88
  };
37
- export default useLineRange;
89
+ export default useLineRange;
@@ -1,2 +1,43 @@
1
+ import { c as _c } from "react-compiler-runtime"; // 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.
1
13
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export const ColorCell = ({ color, mappingFile }) => (_jsx("div", { className: "w-4 h-4 rounded-[4px]", style: { backgroundColor: color }, "data-tooltip-id": "table-color-tooltip", "data-tooltip-content": mappingFile }));
14
+ export var ColorCell = function ColorCell(t0) {
15
+ var $ = _c(5);
16
+ var color = t0.color,
17
+ mappingFile = t0.mappingFile;
18
+ var t1;
19
+ if ($[0] !== color) {
20
+ t1 = {
21
+ backgroundColor: color
22
+ };
23
+ $[0] = color;
24
+ $[1] = t1;
25
+ } else {
26
+ t1 = $[1];
27
+ }
28
+ var t2;
29
+ if ($[2] !== mappingFile || $[3] !== t1) {
30
+ t2 = /*#__PURE__*/_jsx("div", {
31
+ className: "w-4 h-4 rounded-[4px]",
32
+ style: t1,
33
+ "data-tooltip-id": "table-color-tooltip",
34
+ "data-tooltip-content": mappingFile
35
+ });
36
+ $[2] = mappingFile;
37
+ $[3] = t1;
38
+ $[4] = t2;
39
+ } else {
40
+ t2 = $[4];
41
+ }
42
+ return t2;
43
+ };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { c as _c } from "react-compiler-runtime";
2
2
  // Copyright 2022 The Parca Authors
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -11,12 +11,120 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
+
14
15
  import { Fragment } from 'react';
15
16
  import { Menu, Transition } from '@headlessui/react';
16
17
  import { Icon } from '@iconify/react';
17
- const ColumnsVisibility = ({ columns, visibility, setVisibility, }) => {
18
- return (_jsx("div", { children: _jsxs(Menu, { as: "div", className: "relative text-left", children: [_jsx("div", { children: _jsxs(Menu.Button, { className: "relative w-full cursor-default rounded-md border bg-white py-2 pl-3 pr-10 text-left text-sm shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900 sm:text-sm", children: [_jsx("span", { className: "block overflow-x-hidden text-ellipsis", children: "Multiple" }), _jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2 text-gray-400", children: _jsx(Icon, { icon: "heroicons:chevron-down-20-solid", "aria-hidden": "true" }) })] }) }), _jsx(Transition, { as: Fragment, leave: "transition ease-in duration-100", leaveFrom: "opacity-100", leaveTo: "opacity-0", children: _jsx(Menu.Items, { className: "absolute left-0 z-10 mt-1 min-w-[400px] overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:border-gray-600 dark:bg-gray-900 dark:ring-white dark:ring-opacity-20 sm:text-sm", children: _jsx("div", { className: "p-4", children: _jsx("fieldset", { children: _jsx("div", { className: "space-y-5", children: columns.map(col => (_jsxs("div", { className: "relative flex items-start", children: [_jsx("div", { className: "flex h-6 items-center", children: _jsx("input", { id: col.id, name: col.id, type: "checkbox", className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", checked: visibility[col.id ?? ''] ?? false, onChange: () => {
19
- setVisibility(col.id ?? '', !visibility[col.id ?? '']);
20
- } }) }), _jsx("div", { className: "ml-3 text-sm leading-6", children: _jsx("label", { htmlFor: col.id, className: "font-medium text-gray-900 dark:text-gray-200", children: col.header }) })] }, col.id))) }) }) }) }) })] }) }));
18
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
+ var ColumnsVisibility = function ColumnsVisibility(t0) {
20
+ var $ = _c(11);
21
+ var columns = t0.columns,
22
+ visibility = t0.visibility,
23
+ setVisibility = t0.setVisibility;
24
+ var t1;
25
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
26
+ t1 = /*#__PURE__*/_jsx("span", {
27
+ className: "block overflow-x-hidden text-ellipsis",
28
+ children: "Multiple"
29
+ });
30
+ $[0] = t1;
31
+ } else {
32
+ t1 = $[0];
33
+ }
34
+ var t2;
35
+ if ($[1] === Symbol["for"]("react.memo_cache_sentinel")) {
36
+ t2 = /*#__PURE__*/_jsx("div", {
37
+ children: /*#__PURE__*/_jsxs(Menu.Button, {
38
+ className: "relative w-full cursor-default rounded-md border bg-white py-2 pl-3 pr-10 text-left text-sm shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-900 sm:text-sm",
39
+ children: [t1, /*#__PURE__*/_jsx("span", {
40
+ className: "pointer-events-none absolute inset-y-0 right-0 ml-3 flex items-center pr-2 text-gray-400",
41
+ children: /*#__PURE__*/_jsx(Icon, {
42
+ icon: "heroicons:chevron-down-20-solid",
43
+ "aria-hidden": "true"
44
+ })
45
+ })]
46
+ })
47
+ });
48
+ $[1] = t2;
49
+ } else {
50
+ t2 = $[1];
51
+ }
52
+ var t3;
53
+ if ($[2] !== columns || $[3] !== setVisibility || $[4] !== visibility) {
54
+ var _t;
55
+ if ($[6] !== setVisibility || $[7] !== visibility) {
56
+ _t = function _t(col) {
57
+ var _visibility, _col$id;
58
+ return /*#__PURE__*/_jsxs("div", {
59
+ className: "relative flex items-start",
60
+ children: [/*#__PURE__*/_jsx("div", {
61
+ className: "flex h-6 items-center",
62
+ children: /*#__PURE__*/_jsx("input", {
63
+ id: col.id,
64
+ name: col.id,
65
+ type: "checkbox",
66
+ className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",
67
+ checked: (_visibility = visibility[(_col$id = col.id) !== null && _col$id !== void 0 ? _col$id : ""]) !== null && _visibility !== void 0 ? _visibility : false,
68
+ onChange: function onChange() {
69
+ var _col$id2, _col$id3;
70
+ setVisibility((_col$id2 = col.id) !== null && _col$id2 !== void 0 ? _col$id2 : "", !visibility[(_col$id3 = col.id) !== null && _col$id3 !== void 0 ? _col$id3 : ""]);
71
+ }
72
+ })
73
+ }), /*#__PURE__*/_jsx("div", {
74
+ className: "ml-3 text-sm leading-6",
75
+ children: /*#__PURE__*/_jsx("label", {
76
+ htmlFor: col.id,
77
+ className: "font-medium text-gray-900 dark:text-gray-200",
78
+ children: col.header
79
+ })
80
+ })]
81
+ }, col.id);
82
+ };
83
+ $[6] = setVisibility;
84
+ $[7] = visibility;
85
+ $[8] = _t;
86
+ } else {
87
+ _t = $[8];
88
+ }
89
+ t3 = columns.map(_t);
90
+ $[2] = columns;
91
+ $[3] = setVisibility;
92
+ $[4] = visibility;
93
+ $[5] = t3;
94
+ } else {
95
+ t3 = $[5];
96
+ }
97
+ var t4;
98
+ if ($[9] !== t3) {
99
+ t4 = /*#__PURE__*/_jsx("div", {
100
+ children: /*#__PURE__*/_jsxs(Menu, {
101
+ as: "div",
102
+ className: "relative text-left",
103
+ children: [t2, /*#__PURE__*/_jsx(Transition, {
104
+ as: Fragment,
105
+ leave: "transition ease-in duration-100",
106
+ leaveFrom: "opacity-100",
107
+ leaveTo: "opacity-0",
108
+ children: /*#__PURE__*/_jsx(Menu.Items, {
109
+ className: "absolute left-0 z-10 mt-1 min-w-[400px] overflow-auto rounded-md bg-gray-50 py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:border-gray-600 dark:bg-gray-900 dark:ring-white dark:ring-opacity-20 sm:text-sm",
110
+ children: /*#__PURE__*/_jsx("div", {
111
+ className: "p-4",
112
+ children: /*#__PURE__*/_jsx("fieldset", {
113
+ children: /*#__PURE__*/_jsx("div", {
114
+ className: "space-y-5",
115
+ children: t3
116
+ })
117
+ })
118
+ })
119
+ })
120
+ })]
121
+ })
122
+ });
123
+ $[9] = t3;
124
+ $[10] = t4;
125
+ } else {
126
+ t4 = $[10];
127
+ }
128
+ return t4;
21
129
  };
22
- export default ColumnsVisibility;
130
+ export default ColumnsVisibility;
@@ -1,4 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
4
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
5
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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; } }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
11
+ import { c as _c } from "react-compiler-runtime";
2
12
  // Copyright 2022 The Parca Authors
3
13
  // Licensed under the Apache License, Version 2.0 (the "License");
4
14
  // you may not use this file except in compliance with the License.
@@ -11,34 +21,110 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
21
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
22
  // See the License for the specific language governing permissions and
13
23
  // limitations under the License.
24
+
14
25
  import { Menu } from '@headlessui/react';
15
26
  import { Icon } from '@iconify/react';
16
27
  import { useQueryState } from 'nuqs';
17
28
  import { useParcaContext } from '@parca/components';
18
29
  import { stringParam } from '../hooks/urlParsers';
19
30
  import { useDashboardItems } from '../hooks/useDashboardItems';
20
- const MoreDropdown = ({ functionName }) => {
21
- const [_, setSandwichFunctionName] = useQueryState('sandwich_function_name', stringParam);
22
- const { dashboardItems, setDashboardItems } = useDashboardItems();
23
- const { enableSandwichView } = useParcaContext();
24
- const onSandwichViewSelect = () => {
25
- void setSandwichFunctionName(functionName.trim());
26
- setDashboardItems([...dashboardItems, 'sandwich']);
31
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
32
+ var MoreDropdown = function MoreDropdown(t0) {
33
+ var $ = _c(12);
34
+ var functionName = t0.functionName;
35
+ var _useQueryState = useQueryState("sandwich_function_name", stringParam),
36
+ _useQueryState2 = _slicedToArray(_useQueryState, 2),
37
+ setSandwichFunctionName = _useQueryState2[1];
38
+ var _useDashboardItems = useDashboardItems(),
39
+ dashboardItems = _useDashboardItems.dashboardItems,
40
+ setDashboardItems = _useDashboardItems.setDashboardItems;
41
+ var _useParcaContext = useParcaContext(),
42
+ enableSandwichView = _useParcaContext.enableSandwichView;
43
+ var t1;
44
+ if ($[0] !== dashboardItems || $[1] !== functionName || $[2] !== setDashboardItems || $[3] !== setSandwichFunctionName) {
45
+ t1 = function t1() {
46
+ setSandwichFunctionName(functionName.trim());
47
+ setDashboardItems([].concat(_toConsumableArray(dashboardItems), ["sandwich"]));
27
48
  };
28
- const menuItems = [];
49
+ $[0] = dashboardItems;
50
+ $[1] = functionName;
51
+ $[2] = setDashboardItems;
52
+ $[3] = setSandwichFunctionName;
53
+ $[4] = t1;
54
+ } else {
55
+ t1 = $[4];
56
+ }
57
+ var onSandwichViewSelect = t1;
58
+ var menuItems;
59
+ if ($[5] !== enableSandwichView || $[6] !== onSandwichViewSelect) {
60
+ menuItems = [];
29
61
  if (enableSandwichView === true) {
30
- menuItems.push({
31
- label: 'Show in Sandwich view',
32
- action: () => onSandwichViewSelect(),
33
- });
34
- }
35
- if (menuItems.length === 0) {
36
- return null;
62
+ var _t;
63
+ if ($[8] !== onSandwichViewSelect) {
64
+ _t = {
65
+ label: "Show in Sandwich view",
66
+ action: function action() {
67
+ return onSandwichViewSelect();
68
+ }
69
+ };
70
+ $[8] = onSandwichViewSelect;
71
+ $[9] = _t;
72
+ } else {
73
+ _t = $[9];
74
+ }
75
+ menuItems.push(_t);
37
76
  }
38
- return (_jsx("div", { className: "relative", children: _jsx(Menu, { children: ({ open, close }) => (_jsxs(_Fragment, { children: [_jsx(Menu.Button, { onClick: () => {
39
- if (open) {
40
- close();
41
- }
42
- }, className: "inline-flex font-sans dark:bg-gray-900 dark:border-gray-600 justify-center w-full text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75", children: _jsx(Icon, { icon: "mdi:dots-horizontal" }) }), open && (_jsxs(Menu.Items, { className: "font-sans absolute z-30 left-0 w-56 mt-2 py-2 origin-top-right bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600", children: [_jsx("span", { className: "text-xs text-gray-400 capitalize px-4 py-3", children: "actions" }), menuItems.map(item => (_jsx(Menu.Button, { className: "group mb-px flex w-full items-center rounded-md px-4 py-2 text-sm text-gray-900 dark:text-white hover:bg-indigo-500 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500", onClick: item.action, children: item.label }, item.label)))] }))] })) }) }));
77
+ $[5] = enableSandwichView;
78
+ $[6] = onSandwichViewSelect;
79
+ $[7] = menuItems;
80
+ } else {
81
+ menuItems = $[7];
82
+ }
83
+ if (menuItems.length === 0) {
84
+ return null;
85
+ }
86
+ var t2;
87
+ if ($[10] !== menuItems) {
88
+ t2 = /*#__PURE__*/_jsx("div", {
89
+ className: "relative",
90
+ children: /*#__PURE__*/_jsx(Menu, {
91
+ children: function children(t3) {
92
+ var open = t3.open,
93
+ close = t3.close;
94
+ return /*#__PURE__*/_jsxs(_Fragment, {
95
+ children: [/*#__PURE__*/_jsx(Menu.Button, {
96
+ onClick: function onClick() {
97
+ if (open) {
98
+ close();
99
+ }
100
+ },
101
+ className: "inline-flex font-sans dark:bg-gray-900 dark:border-gray-600 justify-center w-full text-sm font-normal text-gray-600 dark:text-gray-200 bg-white rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75",
102
+ children: /*#__PURE__*/_jsx(Icon, {
103
+ icon: "mdi:dots-horizontal"
104
+ })
105
+ }), open && /*#__PURE__*/_jsxs(Menu.Items, {
106
+ className: "font-sans absolute z-30 left-0 w-56 mt-2 py-2 origin-top-right bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none border dark:bg-gray-900 dark:border-gray-600",
107
+ children: [/*#__PURE__*/_jsx("span", {
108
+ className: "text-xs text-gray-400 capitalize px-4 py-3",
109
+ children: "actions"
110
+ }), menuItems.map(_temp)]
111
+ })]
112
+ });
113
+ }
114
+ })
115
+ });
116
+ $[10] = menuItems;
117
+ $[11] = t2;
118
+ } else {
119
+ t2 = $[11];
120
+ }
121
+ return t2;
43
122
  };
44
123
  export default MoreDropdown;
124
+ function _temp(item) {
125
+ return /*#__PURE__*/_jsx(Menu.Button, {
126
+ className: "group mb-px flex w-full items-center rounded-md px-4 py-2 text-sm text-gray-900 dark:text-white hover:bg-indigo-500 hover:text-white focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",
127
+ onClick: item.action,
128
+ children: item.label
129
+ }, item.label);
130
+ }