@parca/profile 0.19.142 → 0.19.144
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 +8 -0
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
- package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +22 -28
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +72 -73
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
- package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.d.ts.map +1 -1
- package/dist/ProfileFlameChart/index.js +20 -24
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +13 -14
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +6 -5
- package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
- package/dist/ProfileFlameGraph/index.js +8 -7
- package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
- package/dist/ProfileMetricsGraph/index.js +6 -8
- package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
- package/dist/ProfileSelector/MetricsGraphSection.js +48 -55
- package/dist/ProfileSelector/index.d.ts +1 -1
- package/dist/ProfileSelector/index.d.ts.map +1 -1
- package/dist/ProfileSelector/index.js +216 -210
- package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
- package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
- package/dist/ProfileSelector/useAutoQuerySelector.js +133 -104
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +24 -25
- package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
- package/dist/ProfileView/components/ColorStackLegend.js +3 -5
- package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
- package/dist/ProfileView/components/InvertCallStack/index.js +47 -47
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +1 -2
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
- package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +37 -34
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +282 -294
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
- package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +7 -8
- 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 +1 -1
- package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
- package/dist/ProfileView/components/ViewSelector/index.js +53 -75
- package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
- package/dist/ProfileView/context/DashboardContext.js +36 -44
- package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetFlameGraphState.js +8 -7
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +59 -59
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
- package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +37 -22
- 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 +116 -147
- package/dist/ProfileViewWithData.d.ts.map +1 -1
- package/dist/ProfileViewWithData.js +35 -45
- package/dist/Sandwich/index.d.ts.map +1 -1
- package/dist/Sandwich/index.js +6 -5
- package/dist/SourceView/index.d.ts.map +1 -1
- package/dist/SourceView/index.js +6 -4
- package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
- package/dist/SourceView/useSelectedLineRange.js +52 -76
- package/dist/Table/MoreDropdown.d.ts.map +1 -1
- package/dist/Table/MoreDropdown.js +42 -53
- package/dist/Table/TableContextMenu.d.ts.map +1 -1
- package/dist/Table/TableContextMenu.js +15 -19
- package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
- package/dist/Table/hooks/useTableConfiguration.js +107 -115
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +16 -16
- package/dist/TopTable/index.d.ts.map +1 -1
- package/dist/TopTable/index.js +112 -127
- package/dist/hooks/urlParsers.d.ts +18 -0
- package/dist/hooks/urlParsers.d.ts.map +1 -0
- package/dist/hooks/urlParsers.js +44 -0
- package/dist/hooks/useColorBy.d.ts +5 -0
- package/dist/hooks/useColorBy.d.ts.map +1 -0
- package/dist/hooks/useColorBy.js +63 -0
- package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
- package/dist/hooks/useCompareModeMeta.js +94 -138
- package/dist/hooks/useDashboardItems.d.ts +5 -0
- package/dist/hooks/useDashboardItems.d.ts.map +1 -0
- package/dist/hooks/useDashboardItems.js +68 -0
- package/dist/hooks/useQueryState.d.ts +4 -4
- package/dist/hooks/useQueryState.d.ts.map +1 -1
- package/dist/hooks/useQueryState.js +127 -122
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -12
- package/dist/useQuery.js +2 -1
- package/dist/useSumBy.d.ts +1 -1
- package/dist/useSumBy.d.ts.map +1 -1
- package/dist/useSumBy.js +2 -2
- package/package.json +4 -3
- package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +11 -13
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +11 -9
- package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
- package/src/ProfileFlameChart/index.tsx +21 -28
- package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +10 -9
- package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +5 -3
- package/src/ProfileFlameGraph/index.tsx +6 -9
- package/src/ProfileMetricsGraph/index.tsx +6 -8
- package/src/ProfileSelector/MetricsGraphSection.tsx +5 -10
- package/src/ProfileSelector/index.tsx +33 -33
- package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
- package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +10 -6
- package/src/ProfileView/components/ColorStackLegend.tsx +2 -4
- package/src/ProfileView/components/InvertCallStack/index.tsx +5 -4
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +94 -192
- package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
- package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +24 -25
- package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +4 -5
- package/src/ProfileView/components/Toolbars/index.tsx +3 -3
- package/src/ProfileView/components/ViewSelector/index.tsx +9 -16
- package/src/ProfileView/context/DashboardContext.tsx +6 -6
- package/src/ProfileView/hooks/useResetFlameGraphState.ts +6 -4
- package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +24 -26
- package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +16 -8
- package/src/ProfileView/hooks/useVisualizationState.ts +61 -69
- package/src/ProfileViewWithData.tsx +29 -35
- package/src/Sandwich/index.tsx +4 -3
- package/src/SourceView/index.tsx +4 -2
- package/src/SourceView/useSelectedLineRange.ts +34 -19
- package/src/Table/MoreDropdown.tsx +9 -11
- package/src/Table/TableContextMenu.tsx +10 -13
- package/src/Table/hooks/useTableConfiguration.tsx +3 -4
- package/src/Table/index.tsx +12 -21
- package/src/TopTable/index.tsx +3 -4
- package/src/hooks/urlParsers.ts +38 -0
- package/src/hooks/useColorBy.ts +42 -0
- package/src/hooks/useCompareModeMeta.ts +61 -91
- package/src/hooks/useDashboardItems.ts +46 -0
- package/src/hooks/useQueryState.test.tsx +275 -345
- package/src/hooks/useQueryState.ts +153 -120
- package/src/index.tsx +16 -15
- package/src/useQuery.tsx +1 -1
- package/src/useSumBy.ts +3 -3
|
@@ -1,3 +1,9 @@
|
|
|
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); }
|
|
1
7
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
2
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."); }
|
|
3
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; } }
|
|
@@ -19,158 +25,108 @@ import { c as _c } from "react-compiler-runtime";
|
|
|
19
25
|
// limitations under the License.
|
|
20
26
|
|
|
21
27
|
import { useCallback } from 'react';
|
|
22
|
-
import {
|
|
28
|
+
import { useQueryStates } from 'nuqs';
|
|
29
|
+
import { boolParam, stringParam } from './urlParsers';
|
|
23
30
|
|
|
24
31
|
/**
|
|
25
32
|
* Hook to manage compare mode state and operations
|
|
26
33
|
* Returns compare mode flags and a function to close compare mode
|
|
27
34
|
*/
|
|
28
35
|
export var useCompareModeMeta = function useCompareModeMeta() {
|
|
29
|
-
var $ = _c(
|
|
30
|
-
var batchUpdates = useURLStateBatch();
|
|
31
|
-
var _useURLState = useURLState("expression_a"),
|
|
32
|
-
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
33
|
-
setExpressionA = _useURLState2[1];
|
|
34
|
-
var _useURLState3 = useURLState("from_a"),
|
|
35
|
-
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
36
|
-
setFromA = _useURLState4[1];
|
|
37
|
-
var _useURLState5 = useURLState("to_a"),
|
|
38
|
-
_useURLState6 = _slicedToArray(_useURLState5, 2),
|
|
39
|
-
setToA = _useURLState6[1];
|
|
40
|
-
var _useURLState7 = useURLState("time_selection_a"),
|
|
41
|
-
_useURLState8 = _slicedToArray(_useURLState7, 2),
|
|
42
|
-
setTimeSelectionA = _useURLState8[1];
|
|
43
|
-
var _useURLState9 = useURLState("sum_by_a"),
|
|
44
|
-
_useURLState0 = _slicedToArray(_useURLState9, 2),
|
|
45
|
-
setSumByA = _useURLState0[1];
|
|
46
|
-
var _useURLState1 = useURLState("merge_from_a"),
|
|
47
|
-
_useURLState10 = _slicedToArray(_useURLState1, 2),
|
|
48
|
-
setMergeFromA = _useURLState10[1];
|
|
49
|
-
var _useURLState11 = useURLState("merge_to_a"),
|
|
50
|
-
_useURLState12 = _slicedToArray(_useURLState11, 2),
|
|
51
|
-
setMergeToA = _useURLState12[1];
|
|
52
|
-
var _useURLState13 = useURLState("selection_a"),
|
|
53
|
-
_useURLState14 = _slicedToArray(_useURLState13, 2),
|
|
54
|
-
setSelectionA = _useURLState14[1];
|
|
55
|
-
var _useURLState15 = useURLState("expression_b"),
|
|
56
|
-
_useURLState16 = _slicedToArray(_useURLState15, 2),
|
|
57
|
-
expressionB = _useURLState16[0],
|
|
58
|
-
setExpressionB = _useURLState16[1];
|
|
59
|
-
var _useURLState17 = useURLState("from_b"),
|
|
60
|
-
_useURLState18 = _slicedToArray(_useURLState17, 2),
|
|
61
|
-
fromB = _useURLState18[0],
|
|
62
|
-
setFromB = _useURLState18[1];
|
|
63
|
-
var _useURLState19 = useURLState("to_b"),
|
|
64
|
-
_useURLState20 = _slicedToArray(_useURLState19, 2),
|
|
65
|
-
toB = _useURLState20[0],
|
|
66
|
-
setToB = _useURLState20[1];
|
|
67
|
-
var _useURLState21 = useURLState("time_selection_b"),
|
|
68
|
-
_useURLState22 = _slicedToArray(_useURLState21, 2),
|
|
69
|
-
timeSelectionB = _useURLState22[0],
|
|
70
|
-
setTimeSelectionB = _useURLState22[1];
|
|
71
|
-
var _useURLState23 = useURLState("sum_by_b"),
|
|
72
|
-
_useURLState24 = _slicedToArray(_useURLState23, 2),
|
|
73
|
-
sumByB = _useURLState24[0],
|
|
74
|
-
setSumByB = _useURLState24[1];
|
|
75
|
-
var _useURLState25 = useURLState("merge_from_b"),
|
|
76
|
-
_useURLState26 = _slicedToArray(_useURLState25, 2),
|
|
77
|
-
mergeFromB = _useURLState26[0],
|
|
78
|
-
setMergeFromB = _useURLState26[1];
|
|
79
|
-
var _useURLState27 = useURLState("merge_to_b"),
|
|
80
|
-
_useURLState28 = _slicedToArray(_useURLState27, 2),
|
|
81
|
-
mergeToB = _useURLState28[0],
|
|
82
|
-
setMergeToB = _useURLState28[1];
|
|
83
|
-
var _useURLState29 = useURLState("selection_b"),
|
|
84
|
-
_useURLState30 = _slicedToArray(_useURLState29, 2),
|
|
85
|
-
selectionB = _useURLState30[0],
|
|
86
|
-
setSelectionB = _useURLState30[1];
|
|
87
|
-
var _useURLState31 = useURLState("compare_a"),
|
|
88
|
-
_useURLState32 = _slicedToArray(_useURLState31, 2),
|
|
89
|
-
compareA = _useURLState32[0],
|
|
90
|
-
setCompareA = _useURLState32[1];
|
|
91
|
-
var _useURLState33 = useURLState("compare_b"),
|
|
92
|
-
_useURLState34 = _slicedToArray(_useURLState33, 2),
|
|
93
|
-
compareB = _useURLState34[0],
|
|
94
|
-
setCompareB = _useURLState34[1];
|
|
95
|
-
var _useURLState35 = useURLState("compare_absolute"),
|
|
96
|
-
_useURLState36 = _slicedToArray(_useURLState35, 2),
|
|
97
|
-
compareAbsolute = _useURLState36[0],
|
|
98
|
-
setCompareAbsolute = _useURLState36[1];
|
|
36
|
+
var $ = _c(16);
|
|
99
37
|
var t0;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
38
|
+
var t1;
|
|
39
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
40
|
+
t0 = {
|
|
41
|
+
expression_a: stringParam,
|
|
42
|
+
from_a: stringParam,
|
|
43
|
+
to_a: stringParam,
|
|
44
|
+
time_selection_a: stringParam,
|
|
45
|
+
sum_by_a: stringParam,
|
|
46
|
+
merge_from_a: stringParam,
|
|
47
|
+
merge_to_a: stringParam,
|
|
48
|
+
selection_a: stringParam,
|
|
49
|
+
expression_b: stringParam,
|
|
50
|
+
from_b: stringParam,
|
|
51
|
+
to_b: stringParam,
|
|
52
|
+
time_selection_b: stringParam,
|
|
53
|
+
sum_by_b: stringParam,
|
|
54
|
+
merge_from_b: stringParam,
|
|
55
|
+
merge_to_b: stringParam,
|
|
56
|
+
selection_b: stringParam,
|
|
57
|
+
compare_a: boolParam,
|
|
58
|
+
compare_b: boolParam,
|
|
59
|
+
compare_absolute: boolParam
|
|
60
|
+
};
|
|
61
|
+
t1 = {
|
|
62
|
+
history: "replace"
|
|
125
63
|
};
|
|
126
|
-
$[0] =
|
|
127
|
-
$[1] =
|
|
128
|
-
$[2] = fromB;
|
|
129
|
-
$[3] = mergeFromB;
|
|
130
|
-
$[4] = mergeToB;
|
|
131
|
-
$[5] = selectionB;
|
|
132
|
-
$[6] = setCompareA;
|
|
133
|
-
$[7] = setCompareAbsolute;
|
|
134
|
-
$[8] = setCompareB;
|
|
135
|
-
$[9] = setExpressionA;
|
|
136
|
-
$[10] = setExpressionB;
|
|
137
|
-
$[11] = setFromA;
|
|
138
|
-
$[12] = setFromB;
|
|
139
|
-
$[13] = setMergeFromA;
|
|
140
|
-
$[14] = setMergeFromB;
|
|
141
|
-
$[15] = setMergeToA;
|
|
142
|
-
$[16] = setMergeToB;
|
|
143
|
-
$[17] = setSelectionA;
|
|
144
|
-
$[18] = setSelectionB;
|
|
145
|
-
$[19] = setSumByA;
|
|
146
|
-
$[20] = setSumByB;
|
|
147
|
-
$[21] = setTimeSelectionA;
|
|
148
|
-
$[22] = setTimeSelectionB;
|
|
149
|
-
$[23] = setToA;
|
|
150
|
-
$[24] = setToB;
|
|
151
|
-
$[25] = sumByB;
|
|
152
|
-
$[26] = timeSelectionB;
|
|
153
|
-
$[27] = toB;
|
|
154
|
-
$[28] = t0;
|
|
64
|
+
$[0] = t0;
|
|
65
|
+
$[1] = t1;
|
|
155
66
|
} else {
|
|
156
|
-
t0 = $[
|
|
67
|
+
t0 = $[0];
|
|
68
|
+
t1 = $[1];
|
|
157
69
|
}
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
70
|
+
var _useQueryStates = useQueryStates(t0, t1),
|
|
71
|
+
_useQueryStates2 = _slicedToArray(_useQueryStates, 2),
|
|
72
|
+
state = _useQueryStates2[0],
|
|
73
|
+
setState = _useQueryStates2[1];
|
|
74
|
+
var t2;
|
|
75
|
+
if ($[2] !== setState || $[3] !== state.expression_b || $[4] !== state.from_b || $[5] !== state.merge_from_b || $[6] !== state.merge_to_b || $[7] !== state.selection_b || $[8] !== state.sum_by_b || $[9] !== state.time_selection_b || $[10] !== state.to_b) {
|
|
76
|
+
t2 = function t2(side) {
|
|
77
|
+
var swapAFromB = side === "A" ? {
|
|
78
|
+
expression_a: state.expression_b,
|
|
79
|
+
from_a: state.from_b,
|
|
80
|
+
to_a: state.to_b,
|
|
81
|
+
time_selection_a: state.time_selection_b,
|
|
82
|
+
sum_by_a: state.sum_by_b,
|
|
83
|
+
merge_from_a: state.merge_from_b,
|
|
84
|
+
merge_to_a: state.merge_to_b,
|
|
85
|
+
selection_a: state.selection_b
|
|
86
|
+
} : {};
|
|
87
|
+
setState(_objectSpread(_objectSpread({}, swapAFromB), {}, {
|
|
88
|
+
expression_b: null,
|
|
89
|
+
from_b: null,
|
|
90
|
+
to_b: null,
|
|
91
|
+
time_selection_b: null,
|
|
92
|
+
sum_by_b: null,
|
|
93
|
+
merge_from_b: null,
|
|
94
|
+
merge_to_b: null,
|
|
95
|
+
selection_b: null,
|
|
96
|
+
compare_a: null,
|
|
97
|
+
compare_b: null,
|
|
98
|
+
compare_absolute: null
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
$[2] = setState;
|
|
102
|
+
$[3] = state.expression_b;
|
|
103
|
+
$[4] = state.from_b;
|
|
104
|
+
$[5] = state.merge_from_b;
|
|
105
|
+
$[6] = state.merge_to_b;
|
|
106
|
+
$[7] = state.selection_b;
|
|
107
|
+
$[8] = state.sum_by_b;
|
|
108
|
+
$[9] = state.time_selection_b;
|
|
109
|
+
$[10] = state.to_b;
|
|
110
|
+
$[11] = t2;
|
|
111
|
+
} else {
|
|
112
|
+
t2 = $[11];
|
|
113
|
+
}
|
|
114
|
+
var closeCompareMode = t2;
|
|
115
|
+
var isCompareMode = state.compare_a === true || state.compare_b === true;
|
|
116
|
+
var isCompareAbsolute = state.compare_absolute === true;
|
|
117
|
+
var t3;
|
|
118
|
+
if ($[12] !== closeCompareMode || $[13] !== isCompareAbsolute || $[14] !== isCompareMode) {
|
|
119
|
+
t3 = {
|
|
164
120
|
isCompareMode: isCompareMode,
|
|
165
121
|
isCompareAbsolute: isCompareAbsolute,
|
|
166
122
|
closeCompareMode: closeCompareMode
|
|
167
123
|
};
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
124
|
+
$[12] = closeCompareMode;
|
|
125
|
+
$[13] = isCompareAbsolute;
|
|
126
|
+
$[14] = isCompareMode;
|
|
127
|
+
$[15] = t3;
|
|
172
128
|
} else {
|
|
173
|
-
|
|
129
|
+
t3 = $[15];
|
|
174
130
|
}
|
|
175
|
-
return
|
|
131
|
+
return t3;
|
|
176
132
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDashboardItems.d.ts","sourceRoot":"","sources":["../../src/hooks/useDashboardItems.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,iBAAiB,QAAO;IACnC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAsB9C,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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, useMemo } from 'react';
|
|
22
|
+
import { parseAsArrayOf, parseAsString, useQueryState } from 'nuqs';
|
|
23
|
+
import { useParcaContext } from '@parca/components';
|
|
24
|
+
var opts = {
|
|
25
|
+
history: 'replace'
|
|
26
|
+
};
|
|
27
|
+
export var useDashboardItems = function useDashboardItems() {
|
|
28
|
+
var $ = _c(7);
|
|
29
|
+
var _useParcaContext = useParcaContext(),
|
|
30
|
+
defaultDashboardItems = _useParcaContext.defaultDashboardItems;
|
|
31
|
+
var t0;
|
|
32
|
+
if ($[0] !== defaultDashboardItems) {
|
|
33
|
+
t0 = parseAsArrayOf(parseAsString, ",").withDefault(defaultDashboardItems !== null && defaultDashboardItems !== void 0 ? defaultDashboardItems : ["flamegraph"]).withOptions(opts);
|
|
34
|
+
$[0] = defaultDashboardItems;
|
|
35
|
+
$[1] = t0;
|
|
36
|
+
} else {
|
|
37
|
+
t0 = $[1];
|
|
38
|
+
}
|
|
39
|
+
var parser = t0;
|
|
40
|
+
var _useQueryState = useQueryState("dashboard_items", parser),
|
|
41
|
+
_useQueryState2 = _slicedToArray(_useQueryState, 2),
|
|
42
|
+
dashboardItems = _useQueryState2[0],
|
|
43
|
+
setRawDashboardItems = _useQueryState2[1];
|
|
44
|
+
var t1;
|
|
45
|
+
if ($[2] !== setRawDashboardItems) {
|
|
46
|
+
t1 = function t1(items) {
|
|
47
|
+
setRawDashboardItems(items);
|
|
48
|
+
};
|
|
49
|
+
$[2] = setRawDashboardItems;
|
|
50
|
+
$[3] = t1;
|
|
51
|
+
} else {
|
|
52
|
+
t1 = $[3];
|
|
53
|
+
}
|
|
54
|
+
var setDashboardItems = t1;
|
|
55
|
+
var t2;
|
|
56
|
+
if ($[4] !== dashboardItems || $[5] !== setDashboardItems) {
|
|
57
|
+
t2 = {
|
|
58
|
+
dashboardItems: dashboardItems,
|
|
59
|
+
setDashboardItems: setDashboardItems
|
|
60
|
+
};
|
|
61
|
+
$[4] = dashboardItems;
|
|
62
|
+
$[5] = setDashboardItems;
|
|
63
|
+
$[6] = t2;
|
|
64
|
+
} else {
|
|
65
|
+
t2 = $[6];
|
|
66
|
+
}
|
|
67
|
+
return t2;
|
|
68
|
+
};
|
|
@@ -22,16 +22,16 @@ interface UseQueryStateReturn {
|
|
|
22
22
|
from: number;
|
|
23
23
|
to: number;
|
|
24
24
|
timeSelection: string;
|
|
25
|
-
}) => void;
|
|
25
|
+
}, expression?: string) => void;
|
|
26
26
|
profileSelection: ProfileSelection | null;
|
|
27
27
|
profileSource: ProfileSource | null;
|
|
28
28
|
setProfileSelection: (mergeFrom: bigint, mergeTo: bigint, query: Query) => void;
|
|
29
29
|
sumByLoading: boolean;
|
|
30
30
|
draftParsedQuery: Query | null;
|
|
31
31
|
parsedQuery: Query | null;
|
|
32
|
-
setExpressionParam: (value: string |
|
|
33
|
-
setSumByParam: (value: string |
|
|
34
|
-
setGroupByParam: (value: string[] |
|
|
32
|
+
setExpressionParam: (value: string | null) => void;
|
|
33
|
+
setSumByParam: (value: string | null) => void;
|
|
34
|
+
setGroupByParam: (value: string[] | null) => void;
|
|
35
35
|
}
|
|
36
36
|
export declare const useQueryState: (options?: UseQueryStateOptions) => UseQueryStateReturn;
|
|
37
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQueryState.d.ts","sourceRoot":"","sources":["../../src/hooks/useQueryState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useQueryState.d.ts","sourceRoot":"","sources":["../../src/hooks/useQueryState.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,gBAAgB,EAA8B,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAM7F,UAAU,oBAAoB;IAC5B,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,UAAU,mBAAmB;IAE3B,cAAc,EAAE,cAAc,CAAC;IAG/B,cAAc,EAAE,cAAc,CAAC;IAG/B,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAG7C,WAAW,EAAE,CACX,kBAAkB,CAAC,EAAE;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAC,EACtE,UAAU,CAAC,EAAE,MAAM,KAChB,IAAI,CAAC;IAGV,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAG1C,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAGpC,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAGhF,YAAY,EAAE,OAAO,CAAC;IAGtB,gBAAgB,EAAE,KAAK,GAAG,IAAI,CAAC;IAG/B,WAAW,EAAE,KAAK,GAAG,IAAI,CAAC;IAE1B,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACnD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,aAAa,GAAI,UAAS,oBAAyB,KAAG,mBAsclE,CAAC"}
|