@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableColumnsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TableColumnsDropdown.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAS1C,UAAU,KAAK;IACb,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,oBAAoB,GAAI,kCAAgC,KAAK,KAAG,GAAG,CAAC,OA6KzE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -25,10 +25,11 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
25
25
|
|
|
26
26
|
import { useEffect, useMemo, useState } from 'react';
|
|
27
27
|
import { createColumnHelper } from '@tanstack/table-core';
|
|
28
|
-
import {
|
|
28
|
+
import { useQueryState } from 'nuqs';
|
|
29
29
|
import { valueFormatter } from '@parca/utilities';
|
|
30
30
|
import ColumnsVisibility from '../../../Table/ColumnsVisibility';
|
|
31
31
|
import { addPlusSign, getRatioString } from '../../../Table/utils/functions';
|
|
32
|
+
import { tableColumnsParser } from '../../../hooks/urlParsers';
|
|
32
33
|
import { useProfileViewContext } from '../../context/ProfileViewContext';
|
|
33
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
35
|
var TableColumnsDropdown = function TableColumnsDropdown(_ref) {
|
|
@@ -37,12 +38,10 @@ var TableColumnsDropdown = function TableColumnsDropdown(_ref) {
|
|
|
37
38
|
filtered = _ref.filtered;
|
|
38
39
|
var _useProfileViewContex = useProfileViewContext(),
|
|
39
40
|
compareMode = _useProfileViewContex.compareMode;
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
tableColumns = _useURLState2[0],
|
|
45
|
-
setTableColumns = _useURLState2[1];
|
|
41
|
+
var _useQueryState = useQueryState('table_columns', tableColumnsParser),
|
|
42
|
+
_useQueryState2 = _slicedToArray(_useQueryState, 2),
|
|
43
|
+
tableColumns = _useQueryState2[0],
|
|
44
|
+
setTableColumns = _useQueryState2[1];
|
|
46
45
|
var columnHelper = createColumnHelper();
|
|
47
46
|
var unit = useMemo(function () {
|
|
48
47
|
var _profileType$sampleUn;
|
|
@@ -200,7 +199,7 @@ var TableColumnsDropdown = function TableColumnsDropdown(_ref) {
|
|
|
200
199
|
var newTableColumns = Object.keys(updatedColumns).filter(function (col) {
|
|
201
200
|
return updatedColumns[col];
|
|
202
201
|
});
|
|
203
|
-
setTableColumns(newTableColumns);
|
|
202
|
+
void setTableColumns(newTableColumns);
|
|
204
203
|
};
|
|
205
204
|
return /*#__PURE__*/_jsxs("div", {
|
|
206
205
|
className: "flex flex-col gap-1",
|
|
@@ -22,7 +22,7 @@ export interface VisualisationToolbarProps {
|
|
|
22
22
|
flamechartDimension: string[];
|
|
23
23
|
setFlamechartDimension: (labels: string[]) => void;
|
|
24
24
|
showVisualizationSelector?: boolean;
|
|
25
|
-
sandwichFunctionName
|
|
25
|
+
sandwichFunctionName: string | null;
|
|
26
26
|
alignFunctionName: string;
|
|
27
27
|
setAlignFunctionName: (align: string) => void;
|
|
28
28
|
colorBy: string;
|
|
@@ -44,7 +44,7 @@ export interface FlameGraphToolbarProps {
|
|
|
44
44
|
}
|
|
45
45
|
export interface SandwichFlameGraphToolbarProps {
|
|
46
46
|
resetSandwichFunctionName: () => void;
|
|
47
|
-
sandwichFunctionName
|
|
47
|
+
sandwichFunctionName: string | null;
|
|
48
48
|
}
|
|
49
49
|
export declare const TableToolbar: FC<TableToolbarProps>;
|
|
50
50
|
export declare const FlameGraphToolbar: FC<FlameGraphToolbarProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/Toolbars/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAC,MAAM,OAAO,CAAC;AAIzB,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,kDAAkD,CAAC;AAClF,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAUrD,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6BAA6B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChD,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,8BAA8B;IAC7C,yBAAyB,EAAE,MAAM,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAQ9C,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkBxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAmBxE,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAoH9D,CAAC"}
|
|
@@ -124,7 +124,7 @@ export var SandwichFlameGraphToolbar = function SandwichFlameGraphToolbar(t0) {
|
|
|
124
124
|
} else {
|
|
125
125
|
t1 = $[1];
|
|
126
126
|
}
|
|
127
|
-
var t2 = sandwichFunctionName
|
|
127
|
+
var t2 = sandwichFunctionName == null || sandwichFunctionName.length === 0;
|
|
128
128
|
var t3;
|
|
129
129
|
if ($[2] !== t1 || $[3] !== t2) {
|
|
130
130
|
t3 = /*#__PURE__*/_jsx(_Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ProfileView/components/ViewSelector/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAKrD,UAAU,KAAK;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,QAAA,MAAM,YAAY,GAAI,mBAAiB,KAAK,KAAG,GAAG,CAAC,OAoJlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -20,56 +20,39 @@ import { c as _c } from "react-compiler-runtime"; // Copyright 2022 The Parca Au
|
|
|
20
20
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
21
|
// See the License for the specific language governing permissions and
|
|
22
22
|
// limitations under the License.
|
|
23
|
-
import {
|
|
23
|
+
import { useQueryState } from 'nuqs';
|
|
24
|
+
import { useParcaContext } from '@parca/components';
|
|
25
|
+
import { stringParam } from '../../../hooks/urlParsers';
|
|
26
|
+
import { useDashboardItems } from '../../../hooks/useDashboardItems';
|
|
24
27
|
import Dropdown from './Dropdown';
|
|
25
28
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
29
|
var ViewSelector = function ViewSelector(t0) {
|
|
27
|
-
var $ = _c(
|
|
30
|
+
var $ = _c(17);
|
|
28
31
|
var profileSource = t0.profileSource;
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} else {
|
|
36
|
-
t1 = $[0];
|
|
37
|
-
}
|
|
38
|
-
var _useURLState = useURLState("dashboard_items", t1),
|
|
39
|
-
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
40
|
-
t2 = _useURLState2[0],
|
|
41
|
-
setDashboardItems = _useURLState2[1];
|
|
42
|
-
var t3;
|
|
43
|
-
if ($[1] !== t2) {
|
|
44
|
-
t3 = t2 === undefined ? ["flamegraph"] : t2;
|
|
45
|
-
$[1] = t2;
|
|
46
|
-
$[2] = t3;
|
|
47
|
-
} else {
|
|
48
|
-
t3 = $[2];
|
|
49
|
-
}
|
|
50
|
-
var dashboardItems = t3;
|
|
51
|
-
var _useURLState3 = useURLState("sandwich_function_name"),
|
|
52
|
-
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
53
|
-
setSandwichFunctionName = _useURLState4[1];
|
|
32
|
+
var _useDashboardItems = useDashboardItems(),
|
|
33
|
+
dashboardItems = _useDashboardItems.dashboardItems,
|
|
34
|
+
setDashboardItems = _useDashboardItems.setDashboardItems;
|
|
35
|
+
var _useQueryState = useQueryState("sandwich_function_name", stringParam),
|
|
36
|
+
_useQueryState2 = _slicedToArray(_useQueryState, 2),
|
|
37
|
+
setSandwichFunctionName = _useQueryState2[1];
|
|
54
38
|
var _useParcaContext = useParcaContext(),
|
|
55
39
|
enableSourcesView = _useParcaContext.enableSourcesView,
|
|
56
40
|
enableSandwichView = _useParcaContext.enableSandwichView;
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
$[
|
|
62
|
-
$[4] = t4;
|
|
41
|
+
var t1;
|
|
42
|
+
if ($[0] !== dashboardItems) {
|
|
43
|
+
t1 = dashboardItems.includes("flamegraph");
|
|
44
|
+
$[0] = dashboardItems;
|
|
45
|
+
$[1] = t1;
|
|
63
46
|
} else {
|
|
64
|
-
|
|
47
|
+
t1 = $[1];
|
|
65
48
|
}
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
if ($[
|
|
49
|
+
var t2 = !t1;
|
|
50
|
+
var t3;
|
|
51
|
+
if ($[2] !== dashboardItems || $[3] !== enableSandwichView || $[4] !== enableSourcesView || $[5] !== profileSource || $[6] !== setDashboardItems || $[7] !== setSandwichFunctionName || $[8] !== t2) {
|
|
69
52
|
var allItems = [{
|
|
70
53
|
key: "flamegraph",
|
|
71
54
|
label: "Flame Graph",
|
|
72
|
-
canBeSelected:
|
|
55
|
+
canBeSelected: t2
|
|
73
56
|
}, {
|
|
74
57
|
key: "table",
|
|
75
58
|
label: "Table",
|
|
@@ -123,20 +106,16 @@ var ViewSelector = function ViewSelector(t0) {
|
|
|
123
106
|
var newDashboardItems = dashboardItems.filter(function (v) {
|
|
124
107
|
return v !== item.key;
|
|
125
108
|
});
|
|
109
|
+
setDashboardItems(newDashboardItems);
|
|
126
110
|
if (item.key === "sandwich") {
|
|
127
|
-
|
|
128
|
-
setDashboardItems(newDashboardItems);
|
|
129
|
-
setSandwichFunctionName(undefined);
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
setDashboardItems(newDashboardItems);
|
|
111
|
+
setSandwichFunctionName(null);
|
|
133
112
|
}
|
|
134
113
|
}
|
|
135
114
|
},
|
|
136
115
|
isDisabled: dashboardItems.length === 1 && dashboardItems.includes("sandwich")
|
|
137
116
|
};
|
|
138
117
|
};
|
|
139
|
-
|
|
118
|
+
t3 = allItems.map(function (item_0) {
|
|
140
119
|
return {
|
|
141
120
|
key: item_0.key,
|
|
142
121
|
disabled: !item_0.canBeSelected,
|
|
@@ -145,22 +124,21 @@ var ViewSelector = function ViewSelector(t0) {
|
|
|
145
124
|
innerAction: getInnerActionForItem(item_0)
|
|
146
125
|
};
|
|
147
126
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[13] = t6;
|
|
127
|
+
$[2] = dashboardItems;
|
|
128
|
+
$[3] = enableSandwichView;
|
|
129
|
+
$[4] = enableSourcesView;
|
|
130
|
+
$[5] = profileSource;
|
|
131
|
+
$[6] = setDashboardItems;
|
|
132
|
+
$[7] = setSandwichFunctionName;
|
|
133
|
+
$[8] = t2;
|
|
134
|
+
$[9] = t3;
|
|
157
135
|
} else {
|
|
158
|
-
|
|
136
|
+
t3 = $[9];
|
|
159
137
|
}
|
|
160
|
-
var items =
|
|
161
|
-
var
|
|
162
|
-
if ($[
|
|
163
|
-
|
|
138
|
+
var items = t3;
|
|
139
|
+
var t4;
|
|
140
|
+
if ($[10] !== dashboardItems || $[11] !== setDashboardItems) {
|
|
141
|
+
t4 = function t4(value) {
|
|
164
142
|
var isOnlyChart = dashboardItems.length === 1;
|
|
165
143
|
if (isOnlyChart && value === "sandwich") {
|
|
166
144
|
setDashboardItems([].concat(_toConsumableArray(dashboardItems), [value]));
|
|
@@ -173,33 +151,33 @@ var ViewSelector = function ViewSelector(t0) {
|
|
|
173
151
|
var newDashboardItems_0 = [dashboardItems[0], value];
|
|
174
152
|
setDashboardItems(newDashboardItems_0);
|
|
175
153
|
};
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
154
|
+
$[10] = dashboardItems;
|
|
155
|
+
$[11] = setDashboardItems;
|
|
156
|
+
$[12] = t4;
|
|
179
157
|
} else {
|
|
180
|
-
|
|
158
|
+
t4 = $[12];
|
|
181
159
|
}
|
|
182
|
-
var onSelection =
|
|
183
|
-
var
|
|
184
|
-
var
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
160
|
+
var onSelection = t4;
|
|
161
|
+
var t5 = dashboardItems.length >= 2 ? "Multiple" : dashboardItems[0];
|
|
162
|
+
var t6;
|
|
163
|
+
if ($[13] !== items || $[14] !== onSelection || $[15] !== t5) {
|
|
164
|
+
t6 = /*#__PURE__*/_jsx(Dropdown, {
|
|
187
165
|
className: "h-view-selector",
|
|
188
166
|
items: items,
|
|
189
|
-
selectedKey:
|
|
167
|
+
selectedKey: t5,
|
|
190
168
|
onSelection: onSelection,
|
|
191
169
|
placeholder: "Select view type...",
|
|
192
170
|
id: "h-view-selector",
|
|
193
171
|
optionsClassName: "min-w-[260px]"
|
|
194
172
|
});
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
173
|
+
$[13] = items;
|
|
174
|
+
$[14] = onSelection;
|
|
175
|
+
$[15] = t5;
|
|
176
|
+
$[16] = t6;
|
|
199
177
|
} else {
|
|
200
|
-
|
|
178
|
+
t6 = $[16];
|
|
201
179
|
}
|
|
202
|
-
return
|
|
180
|
+
return t6;
|
|
203
181
|
};
|
|
204
182
|
export default ViewSelector;
|
|
205
183
|
function _temp(t0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/DashboardContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardContext.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/context/DashboardContext.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAMvE,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAID,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CA4BnD,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,oBAM/B,CAAC"}
|
|
@@ -19,77 +19,69 @@ import { c as _c } from "react-compiler-runtime";
|
|
|
19
19
|
// limitations under the License.
|
|
20
20
|
|
|
21
21
|
import { createContext, useContext } from 'react';
|
|
22
|
-
import {
|
|
22
|
+
import { useQueryState } from 'nuqs';
|
|
23
|
+
import { stringParam } from '../../hooks/urlParsers';
|
|
24
|
+
import { useDashboardItems } from '../../hooks/useDashboardItems';
|
|
23
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
26
|
var DashboardContext = /*#__PURE__*/createContext(undefined);
|
|
25
27
|
export var DashboardProvider = function DashboardProvider(t0) {
|
|
26
|
-
var $ = _c(
|
|
28
|
+
var $ = _c(12);
|
|
27
29
|
var children = t0.children;
|
|
30
|
+
var _useDashboardItems = useDashboardItems(),
|
|
31
|
+
dashboardItems = _useDashboardItems.dashboardItems,
|
|
32
|
+
setDashboardItems = _useDashboardItems.setDashboardItems;
|
|
33
|
+
var _useQueryState = useQueryState("sandwich_function_name", stringParam),
|
|
34
|
+
_useQueryState2 = _slicedToArray(_useQueryState, 2),
|
|
35
|
+
setSandwichFunctionName = _useQueryState2[1];
|
|
28
36
|
var t1;
|
|
29
|
-
if ($[0]
|
|
30
|
-
t1 = {
|
|
31
|
-
alwaysReturnArray: true
|
|
32
|
-
};
|
|
33
|
-
$[0] = t1;
|
|
34
|
-
} else {
|
|
35
|
-
t1 = $[0];
|
|
36
|
-
}
|
|
37
|
-
var _useURLState = useURLState("dashboard_items", t1),
|
|
38
|
-
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
39
|
-
dashboardItems = _useURLState2[0],
|
|
40
|
-
setDashboardItems = _useURLState2[1];
|
|
41
|
-
var _useURLState3 = useURLState("sandwich_function_name"),
|
|
42
|
-
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
43
|
-
setSandwichFunctionName = _useURLState4[1];
|
|
44
|
-
var t2;
|
|
45
|
-
if ($[1] !== dashboardItems || $[2] !== setDashboardItems || $[3] !== setSandwichFunctionName) {
|
|
46
|
-
t2 = function t2(visualizationType) {
|
|
37
|
+
if ($[0] !== dashboardItems || $[1] !== setDashboardItems || $[2] !== setSandwichFunctionName) {
|
|
38
|
+
t1 = function t1(visualizationType) {
|
|
47
39
|
var newDashboardItems = dashboardItems.filter(function (item) {
|
|
48
40
|
return item !== visualizationType;
|
|
49
41
|
});
|
|
50
42
|
setDashboardItems(newDashboardItems);
|
|
51
43
|
if (visualizationType === "sandwich") {
|
|
52
|
-
setSandwichFunctionName(
|
|
44
|
+
setSandwichFunctionName(null);
|
|
53
45
|
}
|
|
54
46
|
};
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
47
|
+
$[0] = dashboardItems;
|
|
48
|
+
$[1] = setDashboardItems;
|
|
49
|
+
$[2] = setSandwichFunctionName;
|
|
50
|
+
$[3] = t1;
|
|
59
51
|
} else {
|
|
60
|
-
|
|
52
|
+
t1 = $[3];
|
|
61
53
|
}
|
|
62
|
-
var handleClosePanel =
|
|
54
|
+
var handleClosePanel = t1;
|
|
63
55
|
var isMultiPanelView = dashboardItems.length > 1;
|
|
64
|
-
var
|
|
65
|
-
if ($[
|
|
66
|
-
|
|
56
|
+
var t2;
|
|
57
|
+
if ($[4] !== dashboardItems || $[5] !== handleClosePanel || $[6] !== isMultiPanelView || $[7] !== setDashboardItems) {
|
|
58
|
+
t2 = {
|
|
67
59
|
dashboardItems: dashboardItems,
|
|
68
60
|
setDashboardItems: setDashboardItems,
|
|
69
61
|
handleClosePanel: handleClosePanel,
|
|
70
62
|
isMultiPanelView: isMultiPanelView
|
|
71
63
|
};
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
64
|
+
$[4] = dashboardItems;
|
|
65
|
+
$[5] = handleClosePanel;
|
|
66
|
+
$[6] = isMultiPanelView;
|
|
67
|
+
$[7] = setDashboardItems;
|
|
68
|
+
$[8] = t2;
|
|
77
69
|
} else {
|
|
78
|
-
|
|
70
|
+
t2 = $[8];
|
|
79
71
|
}
|
|
80
|
-
var
|
|
81
|
-
if ($[
|
|
82
|
-
|
|
83
|
-
value:
|
|
72
|
+
var t3;
|
|
73
|
+
if ($[9] !== children || $[10] !== t2) {
|
|
74
|
+
t3 = /*#__PURE__*/_jsx(DashboardContext.Provider, {
|
|
75
|
+
value: t2,
|
|
84
76
|
children: children
|
|
85
77
|
});
|
|
86
|
-
$[
|
|
78
|
+
$[9] = children;
|
|
79
|
+
$[10] = t2;
|
|
87
80
|
$[11] = t3;
|
|
88
|
-
$[12] = t4;
|
|
89
81
|
} else {
|
|
90
|
-
|
|
82
|
+
t3 = $[11];
|
|
91
83
|
}
|
|
92
|
-
return
|
|
84
|
+
return t3;
|
|
93
85
|
};
|
|
94
86
|
export var useDashboard = function useDashboard() {
|
|
95
87
|
var context = useContext(DashboardContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetFlameGraphState.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetFlameGraphState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useResetFlameGraphState.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetFlameGraphState.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,uBAAuB,QAAO,CAAC,MAAM,IAAI,CAWrD,CAAC"}
|
|
@@ -18,21 +18,22 @@ import { c as _c } from "react-compiler-runtime";
|
|
|
18
18
|
// See the License for the specific language governing permissions and
|
|
19
19
|
// limitations under the License.
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { useQueryState } from 'nuqs';
|
|
22
|
+
import { stringParam } from '../../hooks/urlParsers';
|
|
22
23
|
export var useResetFlameGraphState = function useResetFlameGraphState() {
|
|
23
24
|
var $ = _c(3);
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
val =
|
|
27
|
-
setCurPath =
|
|
25
|
+
var _useQueryState = useQueryState("cur_path", stringParam),
|
|
26
|
+
_useQueryState2 = _slicedToArray(_useQueryState, 2),
|
|
27
|
+
val = _useQueryState2[0],
|
|
28
|
+
setCurPath = _useQueryState2[1];
|
|
28
29
|
var t0;
|
|
29
30
|
if ($[0] !== setCurPath || $[1] !== val) {
|
|
30
31
|
t0 = function t0() {
|
|
31
32
|
setTimeout(function () {
|
|
32
|
-
if (val ===
|
|
33
|
+
if (val === null) {
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
setCurPath(
|
|
36
|
+
setCurPath(null);
|
|
36
37
|
});
|
|
37
38
|
};
|
|
38
39
|
$[0] = setCurPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetStateOnProfileTypeChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useResetStateOnProfileTypeChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gCAAgC,QAAO,CAAC,MAAM,IAAI,CA4B9D,CAAC"}
|
|
@@ -18,70 +18,70 @@ import { c as _c } from "react-compiler-runtime";
|
|
|
18
18
|
// See the License for the specific language governing permissions and
|
|
19
19
|
// limitations under the License.
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { useQueryStates } from 'nuqs';
|
|
22
|
+
import { stringParam } from '../../hooks/urlParsers';
|
|
22
23
|
import { useProfileFilters } from '../components/ProfileFilters/useProfileFilters';
|
|
23
24
|
export var useResetStateOnProfileTypeChange = function useResetStateOnProfileTypeChange() {
|
|
24
|
-
var $ = _c(
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
var $ = _c(10);
|
|
26
|
+
var t0;
|
|
27
|
+
var t1;
|
|
28
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
29
|
+
t0 = {
|
|
30
|
+
group_by: stringParam,
|
|
31
|
+
cur_path: stringParam,
|
|
32
|
+
sum_by_a: stringParam,
|
|
33
|
+
sum_by_b: stringParam,
|
|
34
|
+
sandwich_function_name: stringParam
|
|
35
|
+
};
|
|
36
|
+
t1 = {
|
|
37
|
+
history: "replace"
|
|
38
|
+
};
|
|
39
|
+
$[0] = t0;
|
|
40
|
+
$[1] = t1;
|
|
41
|
+
} else {
|
|
42
|
+
t0 = $[0];
|
|
43
|
+
t1 = $[1];
|
|
44
|
+
}
|
|
45
|
+
var _useQueryStates = useQueryStates(t0, t1),
|
|
46
|
+
_useQueryStates2 = _slicedToArray(_useQueryStates, 2),
|
|
47
|
+
state = _useQueryStates2[0],
|
|
48
|
+
setState = _useQueryStates2[1];
|
|
41
49
|
var _useProfileFilters = useProfileFilters(),
|
|
42
50
|
resetFilters = _useProfileFilters.resetFilters;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
resetFilters();
|
|
68
|
-
});
|
|
51
|
+
var t2;
|
|
52
|
+
if ($[2] !== resetFilters || $[3] !== setState || $[4] !== state.cur_path || $[5] !== state.group_by || $[6] !== state.sandwich_function_name || $[7] !== state.sum_by_a || $[8] !== state.sum_by_b) {
|
|
53
|
+
t2 = function t2() {
|
|
54
|
+
var updates = {};
|
|
55
|
+
if (state.group_by !== null) {
|
|
56
|
+
updates.group_by = null;
|
|
57
|
+
}
|
|
58
|
+
if (state.cur_path !== null) {
|
|
59
|
+
updates.cur_path = null;
|
|
60
|
+
}
|
|
61
|
+
if (state.sandwich_function_name !== null) {
|
|
62
|
+
updates.sandwich_function_name = null;
|
|
63
|
+
}
|
|
64
|
+
if (state.sum_by_a !== null) {
|
|
65
|
+
updates.sum_by_a = null;
|
|
66
|
+
}
|
|
67
|
+
if (state.sum_by_b !== null) {
|
|
68
|
+
updates.sum_by_b = null;
|
|
69
|
+
}
|
|
70
|
+
if (Object.keys(updates).length > 0) {
|
|
71
|
+
setState(updates);
|
|
72
|
+
}
|
|
73
|
+
resetFilters();
|
|
69
74
|
};
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[8] = setSumByA;
|
|
79
|
-
$[9] = setSumByB;
|
|
80
|
-
$[10] = sumByA;
|
|
81
|
-
$[11] = sumByB;
|
|
82
|
-
$[12] = t0;
|
|
75
|
+
$[2] = resetFilters;
|
|
76
|
+
$[3] = setState;
|
|
77
|
+
$[4] = state.cur_path;
|
|
78
|
+
$[5] = state.group_by;
|
|
79
|
+
$[6] = state.sandwich_function_name;
|
|
80
|
+
$[7] = state.sum_by_a;
|
|
81
|
+
$[8] = state.sum_by_b;
|
|
82
|
+
$[9] = t2;
|
|
83
83
|
} else {
|
|
84
|
-
|
|
84
|
+
t2 = $[9];
|
|
85
85
|
}
|
|
86
|
-
return
|
|
86
|
+
return t2;
|
|
87
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResetStateOnSeriesChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnSeriesChange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useResetStateOnSeriesChange.d.ts","sourceRoot":"","sources":["../../../src/ProfileView/hooks/useResetStateOnSeriesChange.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,2BAA2B,QAAO,CAAC,MAAM,IAAI,CAoBzD,CAAC"}
|
|
@@ -18,36 +18,51 @@ import { c as _c } from "react-compiler-runtime";
|
|
|
18
18
|
// See the License for the specific language governing permissions and
|
|
19
19
|
// limitations under the License.
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { useQueryStates } from 'nuqs';
|
|
22
|
+
import { stringParam } from '../../hooks/urlParsers';
|
|
22
23
|
export var useResetStateOnSeriesChange = function useResetStateOnSeriesChange() {
|
|
23
24
|
var $ = _c(5);
|
|
24
|
-
var _useURLState = useURLState("cur_path"),
|
|
25
|
-
_useURLState2 = _slicedToArray(_useURLState, 2),
|
|
26
|
-
curPath = _useURLState2[0],
|
|
27
|
-
setCurPath = _useURLState2[1];
|
|
28
|
-
var _useURLState3 = useURLState("sandwich_function_name"),
|
|
29
|
-
_useURLState4 = _slicedToArray(_useURLState3, 2),
|
|
30
|
-
sandwichFunctionName = _useURLState4[0],
|
|
31
|
-
setSandwichFunctionName = _useURLState4[1];
|
|
32
25
|
var t0;
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
var t1;
|
|
27
|
+
if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
|
|
28
|
+
t0 = {
|
|
29
|
+
cur_path: stringParam,
|
|
30
|
+
sandwich_function_name: stringParam
|
|
31
|
+
};
|
|
32
|
+
t1 = {
|
|
33
|
+
history: "replace"
|
|
34
|
+
};
|
|
35
|
+
$[0] = t0;
|
|
36
|
+
$[1] = t1;
|
|
37
|
+
} else {
|
|
38
|
+
t0 = $[0];
|
|
39
|
+
t1 = $[1];
|
|
40
|
+
}
|
|
41
|
+
var _useQueryStates = useQueryStates(t0, t1),
|
|
42
|
+
_useQueryStates2 = _slicedToArray(_useQueryStates, 2),
|
|
43
|
+
state = _useQueryStates2[0],
|
|
44
|
+
setState = _useQueryStates2[1];
|
|
45
|
+
var t2;
|
|
46
|
+
if ($[2] !== setState || $[3] !== state) {
|
|
47
|
+
t2 = function t2() {
|
|
35
48
|
setTimeout(function () {
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
var updates = {};
|
|
50
|
+
if (state.cur_path !== null) {
|
|
51
|
+
updates.cur_path = null;
|
|
52
|
+
}
|
|
53
|
+
if (state.sandwich_function_name !== null) {
|
|
54
|
+
updates.sandwich_function_name = null;
|
|
38
55
|
}
|
|
39
|
-
if (
|
|
40
|
-
|
|
56
|
+
if (Object.keys(updates).length > 0) {
|
|
57
|
+
setState(updates);
|
|
41
58
|
}
|
|
42
59
|
});
|
|
43
60
|
};
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
$[3] = setSandwichFunctionName;
|
|
48
|
-
$[4] = t0;
|
|
61
|
+
$[2] = setState;
|
|
62
|
+
$[3] = state;
|
|
63
|
+
$[4] = t2;
|
|
49
64
|
} else {
|
|
50
|
-
|
|
65
|
+
t2 = $[4];
|
|
51
66
|
}
|
|
52
|
-
return
|
|
67
|
+
return t2;
|
|
53
68
|
};
|