@parca/profile 0.19.140 → 0.19.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/dist/GraphTooltipArrow/Content.js +224 -30
- package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
- package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
- package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/index.js +86 -56
- package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +104 -72
- package/dist/MatchersInput/SuggestionItem.js +91 -12
- package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
- package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
- package/dist/MatchersInput/SuggestionsList.js +371 -157
- package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
- package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
- package/dist/MatchersInput/index.js +308 -115
- package/dist/MetricsCircle/index.js +39 -3
- package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
- package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
- package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
- package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
- package/dist/MetricsGraph/index.js +552 -203
- package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
- package/dist/MetricsGraph/utils/colorMapping.js +24 -17
- package/dist/MetricsSeries/index.js +70 -7
- package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
- package/dist/PreSelectedMatchers/index.js +249 -102
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +241 -45
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
- package/dist/ProfileExplorer/index.js +183 -32
- package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
- package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
- package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +267 -129
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +288 -89
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
- package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
- package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +72 -47
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
- package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
- package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
- package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
- package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
- package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
- package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
- package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
- package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +324 -150
- package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +519 -258
- package/dist/ProfileSelector/CompareButton.js +132 -12
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +236 -64
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +727 -141
- package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
- package/dist/ProfileSource.js +230 -163
- package/dist/ProfileTypeSelector/index.js +214 -125
- package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +141 -35
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +185 -55
- package/dist/ProfileView/components/DashboardItems/index.js +87 -28
- package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
- package/dist/ProfileView/components/DiffLegend.js +172 -29
- package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +100 -12
- package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
- package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
- package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +2 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -118
- package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
- package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
- package/dist/ProfileView/components/ShareButton/index.js +352 -62
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +678 -194
- package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +199 -157
- package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
- package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/index.js +441 -21
- package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +212 -86
- package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
- package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
- package/dist/ProfileView/components/VisualizationPanel.js +185 -8
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +85 -29
- package/dist/ProfileView/context/ProfileViewContext.js +56 -15
- package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
- package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
- package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +32 -12
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +40 -19
- package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
- package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useVisualizationState.js +258 -67
- package/dist/ProfileView/index.js +383 -45
- package/dist/ProfileView/types/visualization.js +1 -13
- package/dist/ProfileView/utils/colorUtils.js +8 -7
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +332 -228
- package/dist/QueryControls/index.js +418 -47
- package/dist/Sandwich/components/CalleesSection.js +54 -4
- package/dist/Sandwich/components/CallersSection.js +97 -27
- package/dist/Sandwich/components/TableSection.js +77 -4
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +126 -14
- package/dist/Sandwich/utils/processRowData.js +48 -39
- package/dist/SelectWithRefresh/index.js +102 -28
- package/dist/SimpleMatchers/Select.js +520 -187
- package/dist/SimpleMatchers/index.js +590 -288
- package/dist/SourceView/Highlighter.js +230 -70
- package/dist/SourceView/LineNo.js +72 -17
- package/dist/SourceView/index.d.ts.map +1 -1
- package/dist/SourceView/index.js +178 -104
- package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
- package/dist/SourceView/lang-detector/index.js +28 -14
- package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
- package/dist/SourceView/useSelectedLineRange.js +99 -23
- package/dist/Table/ColorCell.js +42 -1
- package/dist/Table/ColumnsVisibility.js +114 -6
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +122 -25
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.js +151 -137
- package/dist/Table/TableContextMenuWrapper.js +59 -14
- package/dist/Table/hooks/useColorManagement.js +58 -16
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +333 -169
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +222 -128
- package/dist/Table/utils/functions.js +169 -144
- package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
- package/dist/TimelineGuide/index.js +209 -16
- package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +342 -123
- package/dist/contexts/LabelsQueryProvider.js +94 -32
- package/dist/contexts/UnifiedLabelsContext.js +114 -49
- package/dist/contexts/utils.js +37 -15
- package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
- package/dist/hooks/useCompareModeMeta.js +158 -64
- package/dist/hooks/useLabels.js +295 -52
- package/dist/hooks/useQueryState.d.ts +3 -3
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +373 -332
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -8
- package/dist/testdata/fg-diff.json +3750 -0
- package/dist/testdata/fg-simple.json +1879 -0
- package/dist/testdata/link_data.json +56 -0
- package/dist/testdata/tabular.json +30 -0
- package/dist/testdata/test_flamegraph.json +26846 -0
- package/dist/testdata/test_graph.json +53 -0
- package/dist/useDelayedLoader.js +32 -18
- package/dist/useGrpcQuery/index.js +71 -11
- package/dist/useHasProfileData.js +90 -12
- package/dist/useQuery.js +205 -64
- package/dist/useSumBy.d.ts +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +294 -138
- package/dist/utils.js +62 -30
- package/package.json +9 -10
- package/src/GraphTooltipArrow/index.tsx +3 -0
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +13 -11
- package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
- package/src/MatchersInput/SuggestionsList.tsx +11 -10
- package/src/MatchersInput/index.tsx +1 -1
- package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
- package/src/PreSelectedMatchers/index.tsx +3 -0
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -4
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
- package/src/ProfileFlameChart/index.tsx +28 -21
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +9 -10
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +6 -5
- package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
- package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
- package/src/ProfileFlameGraph/index.tsx +9 -6
- package/src/ProfileMetricsGraph/index.tsx +8 -6
- package/src/ProfileSelector/MetricsGraphSection.tsx +10 -5
- package/src/ProfileSelector/index.tsx +61 -39
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +6 -10
- package/src/ProfileView/components/ColorStackLegend.tsx +4 -2
- package/src/ProfileView/components/InvertCallStack/index.tsx +4 -5
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +192 -94
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +28 -24
- package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +5 -4
- package/src/ProfileView/components/Toolbars/index.tsx +3 -3
- package/src/ProfileView/components/ViewSelector/index.tsx +16 -9
- package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
- package/src/ProfileView/context/DashboardContext.tsx +6 -6
- package/src/ProfileView/hooks/useResetFlameGraphState.ts +4 -6
- package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +26 -24
- package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +8 -16
- package/src/ProfileView/hooks/useVisualizationState.ts +69 -61
- package/src/ProfileViewWithData.tsx +35 -29
- package/src/Sandwich/index.tsx +3 -4
- package/src/SourceView/index.tsx +2 -4
- package/src/SourceView/useSelectedLineRange.ts +19 -34
- package/src/Table/MoreDropdown.tsx +11 -9
- package/src/Table/TableContextMenu.tsx +13 -10
- package/src/Table/hooks/useTableConfiguration.tsx +11 -16
- package/src/Table/index.tsx +21 -12
- package/src/TopTable/index.tsx +4 -3
- package/src/hooks/useCompareModeMeta.ts +91 -61
- package/src/hooks/useQueryState.test.tsx +345 -275
- package/src/hooks/useQueryState.ts +118 -136
- package/src/index.tsx +15 -16
- package/src/useDelayedLoader.ts +10 -10
- package/src/useSumBy.ts +15 -21
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
- package/dist/hooks/urlParsers.d.ts +0 -18
- package/dist/hooks/urlParsers.d.ts.map +0 -1
- package/dist/hooks/urlParsers.js +0 -32
- package/dist/hooks/useColorBy.d.ts +0 -5
- package/dist/hooks/useColorBy.d.ts.map +0 -1
- package/dist/hooks/useColorBy.js +0 -26
- package/dist/hooks/useDashboardItems.d.ts +0 -5
- package/dist/hooks/useDashboardItems.d.ts.map +0 -1
- package/dist/hooks/useDashboardItems.js +0 -27
- package/dist/hooks/useQueryState.test.js +0 -868
- package/src/hooks/urlParsers.ts +0 -38
- package/src/hooks/useColorBy.ts +0 -42
- package/src/hooks/useDashboardItems.ts +0 -46
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
14
|
// Copyright 2022 The Parca Authors
|
|
3
15
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
16
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,132 +23,313 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
23
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
24
|
// See the License for the specific language governing permissions and
|
|
13
25
|
// limitations under the License.
|
|
14
|
-
|
|
26
|
+
|
|
27
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
15
28
|
import cx from 'classnames';
|
|
16
29
|
import TextareaAutosize from 'react-textarea-autosize';
|
|
17
30
|
import { Query } from '@parca/parser';
|
|
18
31
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
19
32
|
import { useUnifiedLabels } from '../contexts/UnifiedLabelsContext';
|
|
20
33
|
import SuggestionsList, { Suggestion, Suggestions } from './SuggestionsList';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
34
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
35
|
+
var MatchersInput = function MatchersInput(t0) {
|
|
36
|
+
var $ = _c(49);
|
|
37
|
+
var setDraftMatchers = t0.setDraftMatchers,
|
|
38
|
+
draftParsedQuery = t0.draftParsedQuery,
|
|
39
|
+
commitDraft = t0.commitDraft;
|
|
40
|
+
var inputRef = useRef(null);
|
|
41
|
+
var _useState = useState(false),
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
focusedInput = _useState2[0],
|
|
44
|
+
setFocusedInput = _useState2[1];
|
|
45
|
+
var t1;
|
|
46
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
47
|
+
t1 = new Suggestion("", "", "");
|
|
48
|
+
$[0] = t1;
|
|
49
|
+
} else {
|
|
50
|
+
t1 = $[0];
|
|
51
|
+
}
|
|
52
|
+
var _useState3 = useState(t1),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
lastCompleted = _useState4[0],
|
|
55
|
+
setLastCompleted = _useState4[1];
|
|
56
|
+
var _useUnifiedLabels = useUnifiedLabels(),
|
|
57
|
+
labelNames = _useUnifiedLabels.labelNames,
|
|
58
|
+
labelValues = _useUnifiedLabels.labelValues,
|
|
59
|
+
labelNameMappings = _useUnifiedLabels.labelNameMappingsForMatchersInput,
|
|
60
|
+
isLabelNamesLoading = _useUnifiedLabels.isLabelNamesLoading,
|
|
61
|
+
isLabelValuesLoading = _useUnifiedLabels.isLabelValuesLoading,
|
|
62
|
+
currentLabelName = _useUnifiedLabels.currentLabelName,
|
|
63
|
+
setCurrentLabelName = _useUnifiedLabels.setCurrentLabelName,
|
|
64
|
+
shouldHandlePrefixes = _useUnifiedLabels.shouldHandlePrefixes,
|
|
65
|
+
refetchLabelValues = _useUnifiedLabels.refetchLabelValues,
|
|
66
|
+
refetchLabelNames = _useUnifiedLabels.refetchLabelNames;
|
|
67
|
+
var t2;
|
|
68
|
+
if ($[1] !== draftParsedQuery) {
|
|
69
|
+
t2 = draftParsedQuery != null ? draftParsedQuery.matchersString() : "";
|
|
70
|
+
$[1] = draftParsedQuery;
|
|
71
|
+
$[2] = t2;
|
|
72
|
+
} else {
|
|
73
|
+
t2 = $[2];
|
|
74
|
+
}
|
|
75
|
+
var value = t2;
|
|
76
|
+
var suggestionSections;
|
|
77
|
+
if ($[3] !== currentLabelName || $[4] !== draftParsedQuery || $[5] !== labelNameMappings || $[6] !== labelNames || $[7] !== labelValues || $[8] !== lastCompleted || $[9] !== setCurrentLabelName || $[10] !== shouldHandlePrefixes || $[11] !== value) {
|
|
78
|
+
suggestionSections = new Suggestions();
|
|
79
|
+
Query.suggest("".concat(draftParsedQuery === null || draftParsedQuery === void 0 ? void 0 : draftParsedQuery.profileName(), "{").concat(value)).forEach(function (s) {
|
|
80
|
+
if (lastCompleted !== null && lastCompleted.type === s.type) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (s.type === "literal" && s.value !== "}") {
|
|
84
|
+
suggestionSections.literals.push({
|
|
85
|
+
type: s.type,
|
|
86
|
+
typeahead: s.typeahead,
|
|
87
|
+
value: s.value
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (s.type === "labelName") {
|
|
91
|
+
var inputValue = s.typeahead.trim().toLowerCase();
|
|
92
|
+
var inputLength = inputValue.length;
|
|
93
|
+
var matches = labelNames.filter(function (label) {
|
|
94
|
+
return label.toLowerCase().slice(0, inputLength) === inputValue;
|
|
95
|
+
});
|
|
96
|
+
matches.forEach(function (m) {
|
|
97
|
+
var suggestion = {
|
|
98
|
+
type: s.type,
|
|
99
|
+
typeahead: s.typeahead,
|
|
100
|
+
value: m
|
|
101
|
+
};
|
|
102
|
+
if (shouldHandlePrefixes) {
|
|
103
|
+
var mapping = labelNameMappings.find(function (l) {
|
|
104
|
+
return l.displayName === m;
|
|
105
|
+
});
|
|
106
|
+
if (mapping != null) {
|
|
107
|
+
suggestion.fullName = mapping.fullName;
|
|
88
108
|
}
|
|
109
|
+
}
|
|
110
|
+
suggestionSections.labelNames.push(suggestion);
|
|
89
111
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
setCurrentLabelName,
|
|
101
|
-
]);
|
|
102
|
-
const resetLastCompleted = () => setLastCompleted(new Suggestion('', '', ''));
|
|
103
|
-
const onChange = (e) => {
|
|
104
|
-
const newValue = e.target.value;
|
|
105
|
-
setDraftMatchers(newValue);
|
|
106
|
-
resetLastCompleted();
|
|
107
|
-
};
|
|
108
|
-
const complete = (suggestion) => {
|
|
109
|
-
let newValue = value.slice(0, value.length - suggestion.typeahead.length) + suggestion.value;
|
|
110
|
-
// Add a starting quote if we're completing a operator literal
|
|
111
|
-
if (suggestion.type === 'literal' && suggestion.value !== ',') {
|
|
112
|
-
newValue += '"';
|
|
112
|
+
}
|
|
113
|
+
if (s.type === "labelValue") {
|
|
114
|
+
var labelNameForQuery = s.labelName;
|
|
115
|
+
if (shouldHandlePrefixes) {
|
|
116
|
+
var mapping_0 = labelNameMappings.find(function (l_0) {
|
|
117
|
+
return l_0.displayName === s.labelName;
|
|
118
|
+
});
|
|
119
|
+
if (mapping_0 != null) {
|
|
120
|
+
labelNameForQuery = mapping_0.fullName;
|
|
121
|
+
}
|
|
113
122
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
if (currentLabelName === null || labelNameForQuery !== currentLabelName) {
|
|
124
|
+
setCurrentLabelName(labelNameForQuery);
|
|
125
|
+
return;
|
|
117
126
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
if (labelValues !== null) {
|
|
128
|
+
labelValues.filter(function (v) {
|
|
129
|
+
return v.slice(0, s.typeahead.length) === s.typeahead;
|
|
130
|
+
}).forEach(function (v_0) {
|
|
131
|
+
return suggestionSections.labelValues.push({
|
|
132
|
+
type: s.type,
|
|
133
|
+
typeahead: s.typeahead,
|
|
134
|
+
value: v_0
|
|
135
|
+
});
|
|
136
|
+
});
|
|
127
137
|
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
$[3] = currentLabelName;
|
|
141
|
+
$[4] = draftParsedQuery;
|
|
142
|
+
$[5] = labelNameMappings;
|
|
143
|
+
$[6] = labelNames;
|
|
144
|
+
$[7] = labelValues;
|
|
145
|
+
$[8] = lastCompleted;
|
|
146
|
+
$[9] = setCurrentLabelName;
|
|
147
|
+
$[10] = shouldHandlePrefixes;
|
|
148
|
+
$[11] = value;
|
|
149
|
+
$[12] = suggestionSections;
|
|
150
|
+
} else {
|
|
151
|
+
suggestionSections = $[12];
|
|
152
|
+
}
|
|
153
|
+
var suggestionSections_0 = suggestionSections;
|
|
154
|
+
var t3;
|
|
155
|
+
if ($[13] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
156
|
+
t3 = function t3() {
|
|
157
|
+
return setLastCompleted(new Suggestion("", "", ""));
|
|
158
|
+
};
|
|
159
|
+
$[13] = t3;
|
|
160
|
+
} else {
|
|
161
|
+
t3 = $[13];
|
|
162
|
+
}
|
|
163
|
+
var resetLastCompleted = t3;
|
|
164
|
+
var t4;
|
|
165
|
+
if ($[14] !== setDraftMatchers) {
|
|
166
|
+
t4 = function t4(e) {
|
|
167
|
+
var newValue = e.target.value;
|
|
168
|
+
setDraftMatchers(newValue);
|
|
169
|
+
resetLastCompleted();
|
|
170
|
+
};
|
|
171
|
+
$[14] = setDraftMatchers;
|
|
172
|
+
$[15] = t4;
|
|
173
|
+
} else {
|
|
174
|
+
t4 = $[15];
|
|
175
|
+
}
|
|
176
|
+
var onChange = t4;
|
|
177
|
+
var t5;
|
|
178
|
+
if ($[16] !== value) {
|
|
179
|
+
t5 = function t5(suggestion_0) {
|
|
180
|
+
var newValue_0 = value.slice(0, value.length - suggestion_0.typeahead.length) + suggestion_0.value;
|
|
181
|
+
if (suggestion_0.type === "literal" && suggestion_0.value !== ",") {
|
|
182
|
+
newValue_0 = newValue_0 + "\"";
|
|
183
|
+
}
|
|
184
|
+
if (suggestion_0.type === "labelValue") {
|
|
185
|
+
newValue_0 = newValue_0 + "\"";
|
|
186
|
+
}
|
|
187
|
+
return newValue_0;
|
|
188
|
+
};
|
|
189
|
+
$[16] = value;
|
|
190
|
+
$[17] = t5;
|
|
191
|
+
} else {
|
|
192
|
+
t5 = $[17];
|
|
193
|
+
}
|
|
194
|
+
var complete = t5;
|
|
195
|
+
var t6;
|
|
196
|
+
if ($[18] !== complete || $[19] !== setDraftMatchers) {
|
|
197
|
+
t6 = function t6(suggestion_1) {
|
|
198
|
+
var newValue_1 = complete(suggestion_1);
|
|
199
|
+
setLastCompleted(suggestion_1);
|
|
200
|
+
setDraftMatchers(newValue_1);
|
|
201
|
+
if (inputRef.current !== null) {
|
|
202
|
+
inputRef.current.value = newValue_1;
|
|
203
|
+
inputRef.current.focus();
|
|
204
|
+
}
|
|
128
205
|
};
|
|
129
|
-
|
|
130
|
-
|
|
206
|
+
$[18] = complete;
|
|
207
|
+
$[19] = setDraftMatchers;
|
|
208
|
+
$[20] = t6;
|
|
209
|
+
} else {
|
|
210
|
+
t6 = $[20];
|
|
211
|
+
}
|
|
212
|
+
var applySuggestion = t6;
|
|
213
|
+
var t7;
|
|
214
|
+
if ($[21] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
215
|
+
t7 = function t7() {
|
|
216
|
+
setFocusedInput(true);
|
|
131
217
|
};
|
|
132
|
-
|
|
133
|
-
|
|
218
|
+
$[21] = t7;
|
|
219
|
+
} else {
|
|
220
|
+
t7 = $[21];
|
|
221
|
+
}
|
|
222
|
+
var focus = t7;
|
|
223
|
+
var t8;
|
|
224
|
+
if ($[22] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
225
|
+
t8 = function t8() {
|
|
226
|
+
setFocusedInput(false);
|
|
134
227
|
};
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
228
|
+
$[22] = t8;
|
|
229
|
+
} else {
|
|
230
|
+
t8 = $[22];
|
|
231
|
+
}
|
|
232
|
+
var unfocus = t8;
|
|
233
|
+
var t9;
|
|
234
|
+
if ($[23] !== draftParsedQuery) {
|
|
235
|
+
t9 = draftParsedQuery === null || draftParsedQuery === void 0 ? void 0 : draftParsedQuery.profileName();
|
|
236
|
+
$[23] = draftParsedQuery;
|
|
237
|
+
$[24] = t9;
|
|
238
|
+
} else {
|
|
239
|
+
t9 = $[24];
|
|
240
|
+
}
|
|
241
|
+
var profileSelected = t9 === "";
|
|
242
|
+
var t10;
|
|
243
|
+
if ($[25] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
244
|
+
t10 = testId(TEST_IDS.MATCHERS_INPUT_CONTAINER);
|
|
245
|
+
$[25] = t10;
|
|
246
|
+
} else {
|
|
247
|
+
t10 = $[25];
|
|
248
|
+
}
|
|
249
|
+
var t11 = profileSelected && "cursor-not-allowed";
|
|
250
|
+
var t12;
|
|
251
|
+
if ($[26] !== t11) {
|
|
252
|
+
t12 = cx("block h-[38px] w-full flex-1 rounded-md border bg-white px-2 py-2 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", t11);
|
|
253
|
+
$[26] = t11;
|
|
254
|
+
$[27] = t12;
|
|
255
|
+
} else {
|
|
256
|
+
t12 = $[27];
|
|
257
|
+
}
|
|
258
|
+
var t13 = profileSelected ? "Select a profile first to enter a filter..." : "filter profiles... eg. node=\"test\"";
|
|
259
|
+
var t14;
|
|
260
|
+
if ($[28] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
261
|
+
t14 = testId(TEST_IDS.MATCHERS_TEXTAREA);
|
|
262
|
+
$[28] = t14;
|
|
263
|
+
} else {
|
|
264
|
+
t14 = $[28];
|
|
265
|
+
}
|
|
266
|
+
var t15 = profileSelected ? "Select a profile first to enter a filter..." : "filter profiles... eg. node=\"test\"";
|
|
267
|
+
var t16;
|
|
268
|
+
if ($[29] !== onChange || $[30] !== profileSelected || $[31] !== t12 || $[32] !== t13 || $[33] !== t15 || $[34] !== value) {
|
|
269
|
+
t16 = /*#__PURE__*/_jsx(TextareaAutosize, _objectSpread(_objectSpread({
|
|
270
|
+
ref: inputRef,
|
|
271
|
+
className: t12,
|
|
272
|
+
placeholder: t13,
|
|
273
|
+
onChange: onChange,
|
|
274
|
+
value: value,
|
|
275
|
+
onBlur: unfocus
|
|
276
|
+
}, t14), {}, {
|
|
277
|
+
onFocus: focus,
|
|
278
|
+
disabled: profileSelected,
|
|
279
|
+
title: t15,
|
|
280
|
+
id: "matchers-input"
|
|
281
|
+
}));
|
|
282
|
+
$[29] = onChange;
|
|
283
|
+
$[30] = profileSelected;
|
|
284
|
+
$[31] = t12;
|
|
285
|
+
$[32] = t13;
|
|
286
|
+
$[33] = t15;
|
|
287
|
+
$[34] = value;
|
|
288
|
+
$[35] = t16;
|
|
289
|
+
} else {
|
|
290
|
+
t16 = $[35];
|
|
291
|
+
}
|
|
292
|
+
var t17 = isLabelValuesLoading && lastCompleted.type === "literal" && lastCompleted.value !== ",";
|
|
293
|
+
var t18;
|
|
294
|
+
if ($[36] !== applySuggestion || $[37] !== commitDraft || $[38] !== focusedInput || $[39] !== isLabelNamesLoading || $[40] !== refetchLabelNames || $[41] !== refetchLabelValues || $[42] !== shouldHandlePrefixes || $[43] !== suggestionSections_0 || $[44] !== t17) {
|
|
295
|
+
t18 = /*#__PURE__*/_jsx(SuggestionsList, {
|
|
296
|
+
isLabelNamesLoading: isLabelNamesLoading,
|
|
297
|
+
suggestions: suggestionSections_0,
|
|
298
|
+
applySuggestion: applySuggestion,
|
|
299
|
+
inputRef: inputRef,
|
|
300
|
+
runQuery: commitDraft,
|
|
301
|
+
focusedInput: focusedInput,
|
|
302
|
+
isLabelValuesLoading: t17,
|
|
303
|
+
shouldTrimPrefix: shouldHandlePrefixes,
|
|
304
|
+
refetchLabelValues: refetchLabelValues,
|
|
305
|
+
refetchLabelNames: refetchLabelNames
|
|
306
|
+
});
|
|
307
|
+
$[36] = applySuggestion;
|
|
308
|
+
$[37] = commitDraft;
|
|
309
|
+
$[38] = focusedInput;
|
|
310
|
+
$[39] = isLabelNamesLoading;
|
|
311
|
+
$[40] = refetchLabelNames;
|
|
312
|
+
$[41] = refetchLabelValues;
|
|
313
|
+
$[42] = shouldHandlePrefixes;
|
|
314
|
+
$[43] = suggestionSections_0;
|
|
315
|
+
$[44] = t17;
|
|
316
|
+
$[45] = t18;
|
|
317
|
+
} else {
|
|
318
|
+
t18 = $[45];
|
|
319
|
+
}
|
|
320
|
+
var t19;
|
|
321
|
+
if ($[46] !== t16 || $[47] !== t18) {
|
|
322
|
+
t19 = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
323
|
+
className: "w-full min-w-[300px] flex-1 font-mono relative"
|
|
324
|
+
}, t10), {}, {
|
|
325
|
+
children: [t16, t18]
|
|
326
|
+
}));
|
|
327
|
+
$[46] = t16;
|
|
328
|
+
$[47] = t18;
|
|
329
|
+
$[48] = t19;
|
|
330
|
+
} else {
|
|
331
|
+
t19 = $[48];
|
|
332
|
+
}
|
|
333
|
+
return t19;
|
|
141
334
|
};
|
|
142
|
-
export default MatchersInput;
|
|
335
|
+
export default MatchersInput;
|
|
@@ -1,4 +1,40 @@
|
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
14
|
+
var defaultRadius = 3;
|
|
15
|
+
var MetricsCircle = function MetricsCircle(t0) {
|
|
16
|
+
var $ = _c(4);
|
|
17
|
+
var cx = t0.cx,
|
|
18
|
+
cy = t0.cy,
|
|
19
|
+
radius = t0.radius;
|
|
20
|
+
var t1 = radius !== undefined ? radius : defaultRadius;
|
|
21
|
+
var t2;
|
|
22
|
+
if ($[0] !== cx || $[1] !== cy || $[2] !== t1) {
|
|
23
|
+
t2 = /*#__PURE__*/_jsx("g", {
|
|
24
|
+
className: "circle",
|
|
25
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
26
|
+
cx: cx,
|
|
27
|
+
cy: cy,
|
|
28
|
+
r: t1
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
$[0] = cx;
|
|
32
|
+
$[1] = cy;
|
|
33
|
+
$[2] = t1;
|
|
34
|
+
$[3] = t2;
|
|
35
|
+
} else {
|
|
36
|
+
t2 = $[3];
|
|
37
|
+
}
|
|
38
|
+
return t2;
|
|
39
|
+
};
|
|
40
|
+
export default MetricsCircle;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
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
|
+
import { c as _c } from "react-compiler-runtime";
|
|
2
8
|
// Copyright 2022 The Parca Authors
|
|
3
9
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
10
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,27 +17,121 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
17
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
18
|
// See the License for the specific language governing permissions and
|
|
13
19
|
// limitations under the License.
|
|
20
|
+
|
|
14
21
|
import { Icon } from '@iconify/react';
|
|
15
22
|
import { Item, Menu, Submenu } from 'react-contexify';
|
|
16
23
|
import { useParcaContext } from '@parca/components';
|
|
17
24
|
import { TEST_IDS, testId } from '@parca/test-utils';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
var MetricsContextMenu = function MetricsContextMenu(t0) {
|
|
27
|
+
var $ = _c(12);
|
|
28
|
+
var menuId = t0.menuId,
|
|
29
|
+
closestPoint = t0.closestPoint,
|
|
30
|
+
series = t0.series,
|
|
31
|
+
trackVisibility = t0.trackVisibility,
|
|
32
|
+
menuItems = t0.menuItems;
|
|
33
|
+
var _useParcaContext = useParcaContext(),
|
|
34
|
+
isDarkMode = _useParcaContext.isDarkMode;
|
|
35
|
+
var t1;
|
|
36
|
+
if ($[0] !== closestPoint || $[1] !== series) {
|
|
37
|
+
t1 = function t1(item) {
|
|
38
|
+
if ("items" in item || "createDynamicItems" in item) {
|
|
39
|
+
var _submenu$items;
|
|
40
|
+
var submenu = item;
|
|
41
|
+
var items = submenu.createDynamicItems != null ? submenu.createDynamicItems(closestPoint, series) : (_submenu$items = submenu.items) !== null && _submenu$items !== void 0 ? _submenu$items : [];
|
|
42
|
+
return /*#__PURE__*/_jsx(Submenu, {
|
|
43
|
+
label: /*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: "flex w-full items-center gap-2",
|
|
45
|
+
children: [submenu.icon != null && submenu.icon !== "" && /*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
icon: submenu.icon
|
|
47
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
48
|
+
children: submenu.label
|
|
49
|
+
})]
|
|
50
|
+
}),
|
|
51
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
52
|
+
className: "max-h-[300px] overflow-auto",
|
|
53
|
+
children: items.map(function (subItem) {
|
|
54
|
+
var _subItem$disabled, _subItem$disabled2;
|
|
55
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
56
|
+
id: subItem.id,
|
|
57
|
+
onClick: function onClick() {
|
|
58
|
+
return subItem.onClick(closestPoint, series);
|
|
59
|
+
},
|
|
60
|
+
disabled: (_subItem$disabled = (_subItem$disabled2 = subItem.disabled) === null || _subItem$disabled2 === void 0 ? void 0 : _subItem$disabled2.call(subItem, closestPoint, series)) !== null && _subItem$disabled !== void 0 ? _subItem$disabled : false,
|
|
61
|
+
className: "max-w-[400px] overflow-hidden",
|
|
62
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
63
|
+
className: "flex w-full items-center gap-2",
|
|
64
|
+
children: [subItem.icon != null && subItem.icon !== "" && /*#__PURE__*/_jsx(Icon, {
|
|
65
|
+
icon: subItem.icon
|
|
66
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
67
|
+
children: subItem.label
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
}, subItem.id);
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
}, submenu.id);
|
|
74
|
+
} else {
|
|
75
|
+
var _menuItem$disabled, _menuItem$disabled2;
|
|
76
|
+
var menuItem = item;
|
|
77
|
+
return /*#__PURE__*/_jsx(Item, {
|
|
78
|
+
id: menuItem.id,
|
|
79
|
+
onClick: function onClick() {
|
|
80
|
+
return menuItem.onClick(closestPoint, series);
|
|
81
|
+
},
|
|
82
|
+
disabled: (_menuItem$disabled = (_menuItem$disabled2 = menuItem.disabled) === null || _menuItem$disabled2 === void 0 ? void 0 : _menuItem$disabled2.call(menuItem, closestPoint, series)) !== null && _menuItem$disabled !== void 0 ? _menuItem$disabled : false,
|
|
83
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
84
|
+
className: "flex w-full items-center gap-2",
|
|
85
|
+
children: [menuItem.icon != null && menuItem.icon !== "" && /*#__PURE__*/_jsx(Icon, {
|
|
86
|
+
icon: menuItem.icon
|
|
87
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
88
|
+
children: menuItem.label
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
}, menuItem.id);
|
|
92
|
+
}
|
|
34
93
|
};
|
|
35
|
-
|
|
94
|
+
$[0] = closestPoint;
|
|
95
|
+
$[1] = series;
|
|
96
|
+
$[2] = t1;
|
|
97
|
+
} else {
|
|
98
|
+
t1 = $[2];
|
|
99
|
+
}
|
|
100
|
+
var renderMenuItem = t1;
|
|
101
|
+
var t2 = isDarkMode ? "dark" : "";
|
|
102
|
+
var t3;
|
|
103
|
+
if ($[3] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
104
|
+
t3 = testId(TEST_IDS.METRICS_GRAPH_CONTEXT_MENU);
|
|
105
|
+
$[3] = t3;
|
|
106
|
+
} else {
|
|
107
|
+
t3 = $[3];
|
|
108
|
+
}
|
|
109
|
+
var t4;
|
|
110
|
+
if ($[4] !== menuItems || $[5] !== renderMenuItem) {
|
|
111
|
+
t4 = menuItems.map(renderMenuItem);
|
|
112
|
+
$[4] = menuItems;
|
|
113
|
+
$[5] = renderMenuItem;
|
|
114
|
+
$[6] = t4;
|
|
115
|
+
} else {
|
|
116
|
+
t4 = $[6];
|
|
117
|
+
}
|
|
118
|
+
var t5;
|
|
119
|
+
if ($[7] !== menuId || $[8] !== t2 || $[9] !== t4 || $[10] !== trackVisibility) {
|
|
120
|
+
t5 = /*#__PURE__*/_jsx(Menu, _objectSpread(_objectSpread({
|
|
121
|
+
id: menuId,
|
|
122
|
+
onVisibilityChange: trackVisibility,
|
|
123
|
+
theme: t2
|
|
124
|
+
}, t3), {}, {
|
|
125
|
+
children: t4
|
|
126
|
+
}));
|
|
127
|
+
$[7] = menuId;
|
|
128
|
+
$[8] = t2;
|
|
129
|
+
$[9] = t4;
|
|
130
|
+
$[10] = trackVisibility;
|
|
131
|
+
$[11] = t5;
|
|
132
|
+
} else {
|
|
133
|
+
t5 = $[11];
|
|
134
|
+
}
|
|
135
|
+
return t5;
|
|
36
136
|
};
|
|
37
|
-
export default MetricsContextMenu;
|
|
137
|
+
export default MetricsContextMenu;
|