@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.
Files changed (253) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.d.ts.map +1 -1
  9. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +104 -72
  10. package/dist/MatchersInput/SuggestionItem.js +91 -12
  11. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  12. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  13. package/dist/MatchersInput/SuggestionsList.js +371 -157
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  15. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  16. package/dist/MatchersInput/index.js +308 -115
  17. package/dist/MetricsCircle/index.js +39 -3
  18. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  19. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  20. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  21. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  22. package/dist/MetricsGraph/index.js +552 -203
  23. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  24. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  25. package/dist/MetricsSeries/index.js +70 -7
  26. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  27. package/dist/PreSelectedMatchers/index.js +249 -102
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  29. package/dist/ProfileExplorer/ProfileExplorerCompare.js +241 -45
  30. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  31. package/dist/ProfileExplorer/index.js +183 -32
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  33. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  34. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts +2 -2
  35. package/dist/ProfileFlameChart/SamplesStrips/index.d.ts.map +1 -1
  36. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  37. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  38. package/dist/ProfileFlameChart/index.d.ts.map +1 -1
  39. package/dist/ProfileFlameChart/index.js +267 -129
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.d.ts.map +1 -1
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +288 -89
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +72 -47
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  56. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  57. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  58. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  59. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  60. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  61. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  62. package/dist/ProfileFlameGraph/index.d.ts.map +1 -1
  63. package/dist/ProfileFlameGraph/index.js +324 -150
  64. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  65. package/dist/ProfileMetricsGraph/index.d.ts.map +1 -1
  66. package/dist/ProfileMetricsGraph/index.js +519 -258
  67. package/dist/ProfileSelector/CompareButton.js +132 -12
  68. package/dist/ProfileSelector/MetricsGraphSection.d.ts.map +1 -1
  69. package/dist/ProfileSelector/MetricsGraphSection.js +236 -64
  70. package/dist/ProfileSelector/index.d.ts.map +1 -1
  71. package/dist/ProfileSelector/index.js +727 -141
  72. package/dist/ProfileSelector/useAutoQuerySelector.js +249 -130
  73. package/dist/ProfileSource.js +230 -163
  74. package/dist/ProfileTypeSelector/index.js +214 -125
  75. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  76. package/dist/ProfileView/components/ActionButtons/SortByDropdown.d.ts.map +1 -1
  77. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +141 -35
  78. package/dist/ProfileView/components/ColorStackLegend.d.ts.map +1 -1
  79. package/dist/ProfileView/components/ColorStackLegend.js +185 -55
  80. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  81. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  82. package/dist/ProfileView/components/DiffLegend.js +172 -29
  83. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  84. package/dist/ProfileView/components/InvertCallStack/index.d.ts.map +1 -1
  85. package/dist/ProfileView/components/InvertCallStack/index.js +100 -12
  86. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  87. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  88. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  89. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts +2 -1
  90. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.d.ts.map +1 -1
  91. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +188 -118
  92. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  93. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  94. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  95. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  96. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +678 -194
  97. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  98. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.d.ts.map +1 -1
  99. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +199 -157
  100. package/dist/ProfileView/components/Toolbars/index.d.ts +2 -2
  101. package/dist/ProfileView/components/Toolbars/index.d.ts.map +1 -1
  102. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  103. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  104. package/dist/ProfileView/components/ViewSelector/index.d.ts.map +1 -1
  105. package/dist/ProfileView/components/ViewSelector/index.js +212 -86
  106. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  107. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  108. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  109. package/dist/ProfileView/context/DashboardContext.d.ts.map +1 -1
  110. package/dist/ProfileView/context/DashboardContext.js +85 -29
  111. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  112. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  113. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  114. package/dist/ProfileView/hooks/useResetFlameGraphState.d.ts.map +1 -1
  115. package/dist/ProfileView/hooks/useResetFlameGraphState.js +32 -12
  116. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.d.ts.map +1 -1
  117. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  118. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.d.ts.map +1 -1
  119. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +40 -19
  120. package/dist/ProfileView/hooks/useVisualizationState.d.ts +3 -3
  121. package/dist/ProfileView/hooks/useVisualizationState.d.ts.map +1 -1
  122. package/dist/ProfileView/hooks/useVisualizationState.js +258 -67
  123. package/dist/ProfileView/index.js +383 -45
  124. package/dist/ProfileView/types/visualization.js +1 -13
  125. package/dist/ProfileView/utils/colorUtils.js +8 -7
  126. package/dist/ProfileViewWithData.d.ts.map +1 -1
  127. package/dist/ProfileViewWithData.js +332 -228
  128. package/dist/QueryControls/index.js +418 -47
  129. package/dist/Sandwich/components/CalleesSection.js +54 -4
  130. package/dist/Sandwich/components/CallersSection.js +97 -27
  131. package/dist/Sandwich/components/TableSection.js +77 -4
  132. package/dist/Sandwich/index.d.ts.map +1 -1
  133. package/dist/Sandwich/index.js +126 -14
  134. package/dist/Sandwich/utils/processRowData.js +48 -39
  135. package/dist/SelectWithRefresh/index.js +102 -28
  136. package/dist/SimpleMatchers/Select.js +520 -187
  137. package/dist/SimpleMatchers/index.js +590 -288
  138. package/dist/SourceView/Highlighter.js +230 -70
  139. package/dist/SourceView/LineNo.js +72 -17
  140. package/dist/SourceView/index.d.ts.map +1 -1
  141. package/dist/SourceView/index.js +178 -104
  142. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  143. package/dist/SourceView/lang-detector/index.js +28 -14
  144. package/dist/SourceView/useSelectedLineRange.d.ts.map +1 -1
  145. package/dist/SourceView/useSelectedLineRange.js +99 -23
  146. package/dist/Table/ColorCell.js +42 -1
  147. package/dist/Table/ColumnsVisibility.js +114 -6
  148. package/dist/Table/MoreDropdown.d.ts.map +1 -1
  149. package/dist/Table/MoreDropdown.js +122 -25
  150. package/dist/Table/TableContextMenu.d.ts.map +1 -1
  151. package/dist/Table/TableContextMenu.js +151 -137
  152. package/dist/Table/TableContextMenuWrapper.js +59 -14
  153. package/dist/Table/hooks/useColorManagement.js +58 -16
  154. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  155. package/dist/Table/hooks/useTableConfiguration.js +333 -169
  156. package/dist/Table/index.d.ts.map +1 -1
  157. package/dist/Table/index.js +222 -128
  158. package/dist/Table/utils/functions.js +169 -144
  159. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  160. package/dist/TimelineGuide/index.js +209 -16
  161. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  162. package/dist/TopTable/index.d.ts.map +1 -1
  163. package/dist/TopTable/index.js +342 -123
  164. package/dist/contexts/LabelsQueryProvider.js +94 -32
  165. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  166. package/dist/contexts/utils.js +37 -15
  167. package/dist/hooks/useCompareModeMeta.d.ts.map +1 -1
  168. package/dist/hooks/useCompareModeMeta.js +158 -64
  169. package/dist/hooks/useLabels.js +295 -52
  170. package/dist/hooks/useQueryState.d.ts +3 -3
  171. package/dist/hooks/useQueryState.d.ts.map +1 -1
  172. package/dist/hooks/useQueryState.js +373 -332
  173. package/dist/index.d.ts +2 -3
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +22 -8
  176. package/dist/testdata/fg-diff.json +3750 -0
  177. package/dist/testdata/fg-simple.json +1879 -0
  178. package/dist/testdata/link_data.json +56 -0
  179. package/dist/testdata/tabular.json +30 -0
  180. package/dist/testdata/test_flamegraph.json +26846 -0
  181. package/dist/testdata/test_graph.json +53 -0
  182. package/dist/useDelayedLoader.js +32 -18
  183. package/dist/useGrpcQuery/index.js +71 -11
  184. package/dist/useHasProfileData.js +90 -12
  185. package/dist/useQuery.js +205 -64
  186. package/dist/useSumBy.d.ts +1 -1
  187. package/dist/useSumBy.d.ts.map +1 -1
  188. package/dist/useSumBy.js +294 -138
  189. package/dist/utils.js +62 -30
  190. package/package.json +9 -10
  191. package/src/GraphTooltipArrow/index.tsx +3 -0
  192. package/src/GraphTooltipArrow/useGraphTooltipMetaInfo/index.ts +13 -11
  193. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  194. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  195. package/src/MatchersInput/index.tsx +1 -1
  196. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  197. package/src/PreSelectedMatchers/index.tsx +3 -0
  198. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -4
  199. package/src/ProfileFlameChart/SamplesStrips/index.tsx +2 -2
  200. package/src/ProfileFlameChart/index.tsx +28 -21
  201. package/src/ProfileFlameGraph/FlameGraphArrow/ContextMenu.tsx +9 -10
  202. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +6 -5
  203. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  204. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  205. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  206. package/src/ProfileFlameGraph/index.tsx +9 -6
  207. package/src/ProfileMetricsGraph/index.tsx +8 -6
  208. package/src/ProfileSelector/MetricsGraphSection.tsx +10 -5
  209. package/src/ProfileSelector/index.tsx +61 -39
  210. package/src/ProfileView/components/ActionButtons/SortByDropdown.tsx +6 -10
  211. package/src/ProfileView/components/ColorStackLegend.tsx +4 -2
  212. package/src/ProfileView/components/InvertCallStack/index.tsx +4 -5
  213. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.tsx +192 -94
  214. package/src/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.ts +21 -21
  215. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +28 -24
  216. package/src/ProfileView/components/Toolbars/TableColumnsDropdown.tsx +5 -4
  217. package/src/ProfileView/components/Toolbars/index.tsx +3 -3
  218. package/src/ProfileView/components/ViewSelector/index.tsx +16 -9
  219. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  220. package/src/ProfileView/context/DashboardContext.tsx +6 -6
  221. package/src/ProfileView/hooks/useResetFlameGraphState.ts +4 -6
  222. package/src/ProfileView/hooks/useResetStateOnProfileTypeChange.ts +26 -24
  223. package/src/ProfileView/hooks/useResetStateOnSeriesChange.ts +8 -16
  224. package/src/ProfileView/hooks/useVisualizationState.ts +69 -61
  225. package/src/ProfileViewWithData.tsx +35 -29
  226. package/src/Sandwich/index.tsx +3 -4
  227. package/src/SourceView/index.tsx +2 -4
  228. package/src/SourceView/useSelectedLineRange.ts +19 -34
  229. package/src/Table/MoreDropdown.tsx +11 -9
  230. package/src/Table/TableContextMenu.tsx +13 -10
  231. package/src/Table/hooks/useTableConfiguration.tsx +11 -16
  232. package/src/Table/index.tsx +21 -12
  233. package/src/TopTable/index.tsx +4 -3
  234. package/src/hooks/useCompareModeMeta.ts +91 -61
  235. package/src/hooks/useQueryState.test.tsx +345 -275
  236. package/src/hooks/useQueryState.ts +118 -136
  237. package/src/index.tsx +15 -16
  238. package/src/useDelayedLoader.ts +10 -10
  239. package/src/useSumBy.ts +15 -21
  240. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  241. package/dist/hooks/urlParsers.d.ts +0 -18
  242. package/dist/hooks/urlParsers.d.ts.map +0 -1
  243. package/dist/hooks/urlParsers.js +0 -32
  244. package/dist/hooks/useColorBy.d.ts +0 -5
  245. package/dist/hooks/useColorBy.d.ts.map +0 -1
  246. package/dist/hooks/useColorBy.js +0 -26
  247. package/dist/hooks/useDashboardItems.d.ts +0 -5
  248. package/dist/hooks/useDashboardItems.d.ts.map +0 -1
  249. package/dist/hooks/useDashboardItems.js +0 -27
  250. package/dist/hooks/useQueryState.test.js +0 -868
  251. package/src/hooks/urlParsers.ts +0 -38
  252. package/src/hooks/useColorBy.ts +0 -42
  253. package/src/hooks/useDashboardItems.ts +0 -46
@@ -1,4 +1,10 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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";
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,69 +17,193 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
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.
14
- import { useMemo } from 'react';
20
+
21
+ import React, { useMemo } from 'react';
15
22
  import { Icon } from '@iconify/react';
16
23
  import cx from 'classnames';
24
+ import { useURLState } from '@parca/components';
17
25
  import { USER_PREFERENCES, useCurrentColorProfile, useUserPreference } from '@parca/hooks';
18
26
  import { EVERYTHING_ELSE, selectDarkMode, useAppSelector } from '@parca/store';
19
27
  import { getMappingColors } from '../../ProfileFlameGraph/FlameGraphArrow';
20
28
  import useMappingList from '../../ProfileFlameGraph/FlameGraphArrow/useMappingList';
21
- import { useColorBy } from '../../hooks/useColorBy';
22
29
  import { useProfileFilters } from './ProfileFilters/useProfileFilters';
23
- const ColorStackLegend = ({ mappings, compareMode = false, loading }) => {
24
- const isDarkMode = useAppSelector(selectDarkMode);
25
- const currentColorProfile = useCurrentColorProfile();
26
- const [colorProfileName] = useUserPreference(USER_PREFERENCES.FLAMEGRAPH_COLOR_PROFILE.key);
27
- const { colorBy } = useColorBy();
28
- const { appliedFilters, removeExcludeBinary, excludeBinary } = useProfileFilters();
29
- // Get current binary filters from the new ProfileFilters system
30
- const currentBinaryFilters = useMemo(() => {
31
- return (appliedFilters ?? [])
32
- .filter(f => f.type === 'frame' && f.field === 'binary')
33
- .map(f => f.value);
34
- }, [appliedFilters]);
35
- const mappingsList = useMappingList(mappings);
36
- const mappingColors = useMemo(() => {
37
- const colors = getMappingColors(mappingsList, isDarkMode, currentColorProfile);
38
- return colors;
39
- }, [isDarkMode, mappingsList, currentColorProfile]);
40
- const stackColorArray = useMemo(() => {
41
- return Object.entries(mappingColors).sort(([featureA], [featureB]) => {
42
- if (featureA === EVERYTHING_ELSE) {
43
- return 1;
44
- }
45
- if (featureB === EVERYTHING_ELSE) {
46
- return -1;
47
- }
48
- return featureA?.localeCompare(featureB ?? '') ?? 0;
49
- });
50
- }, [mappingColors]);
51
- if (stackColorArray.length === 0 && loading === false) {
52
- return _jsx(_Fragment, {});
30
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
+ var ColorStackLegend = function ColorStackLegend(t0) {
32
+ var $ = _c(24);
33
+ var mappings = t0.mappings,
34
+ t1 = t0.compareMode,
35
+ loading = t0.loading;
36
+ var compareMode = t1 === undefined ? false : t1;
37
+ var isDarkMode = useAppSelector(selectDarkMode);
38
+ var currentColorProfile = useCurrentColorProfile();
39
+ var _useUserPreference = useUserPreference(USER_PREFERENCES.FLAMEGRAPH_COLOR_PROFILE.key),
40
+ _useUserPreference2 = _slicedToArray(_useUserPreference, 1),
41
+ colorProfileName = _useUserPreference2[0];
42
+ var _useURLState = useURLState("color_by"),
43
+ _useURLState2 = _slicedToArray(_useURLState, 1),
44
+ colorByValue = _useURLState2[0];
45
+ var colorBy = colorByValue === "binary" || colorByValue === undefined ? "binary" : "filename";
46
+ var _useProfileFilters = useProfileFilters(),
47
+ appliedFilters = _useProfileFilters.appliedFilters,
48
+ removeExcludeBinary = _useProfileFilters.removeExcludeBinary,
49
+ excludeBinary = _useProfileFilters.excludeBinary;
50
+ var t2;
51
+ if ($[0] !== appliedFilters) {
52
+ t2 = (appliedFilters !== null && appliedFilters !== void 0 ? appliedFilters : []).filter(_temp).map(_temp2);
53
+ $[0] = appliedFilters;
54
+ $[1] = t2;
55
+ } else {
56
+ t2 = $[1];
57
+ }
58
+ var currentBinaryFilters = t2;
59
+ var mappingsList = useMappingList(mappings);
60
+ var t3;
61
+ if ($[2] !== currentColorProfile || $[3] !== isDarkMode || $[4] !== mappingsList) {
62
+ t3 = getMappingColors(mappingsList, isDarkMode, currentColorProfile);
63
+ $[2] = currentColorProfile;
64
+ $[3] = isDarkMode;
65
+ $[4] = mappingsList;
66
+ $[5] = t3;
67
+ } else {
68
+ t3 = $[5];
69
+ }
70
+ var colors = t3;
71
+ var mappingColors = colors;
72
+ var t4;
73
+ if ($[6] !== mappingColors) {
74
+ t4 = Object.entries(mappingColors).sort(_temp3);
75
+ $[6] = mappingColors;
76
+ $[7] = t4;
77
+ } else {
78
+ t4 = $[7];
79
+ }
80
+ var stackColorArray = t4;
81
+ if (stackColorArray.length === 0 && loading === false) {
82
+ var _t;
83
+ if ($[8] === Symbol["for"]("react.memo_cache_sentinel")) {
84
+ _t = /*#__PURE__*/_jsx(_Fragment, {});
85
+ $[8] = _t;
86
+ } else {
87
+ _t = $[8];
88
+ }
89
+ return _t;
90
+ }
91
+ if (Object.entries(mappingColors).length === 0) {
92
+ var _t2;
93
+ if ($[9] === Symbol["for"]("react.memo_cache_sentinel")) {
94
+ _t2 = /*#__PURE__*/_jsx(_Fragment, {});
95
+ $[9] = _t2;
96
+ } else {
97
+ _t2 = $[9];
53
98
  }
54
- if (Object.entries(mappingColors).length === 0) {
55
- return _jsx(_Fragment, {});
99
+ return _t2;
100
+ }
101
+ if (colorProfileName === "default" || compareMode) {
102
+ var _t3;
103
+ if ($[10] === Symbol["for"]("react.memo_cache_sentinel")) {
104
+ _t3 = /*#__PURE__*/_jsx(_Fragment, {});
105
+ $[10] = _t3;
106
+ } else {
107
+ _t3 = $[10];
56
108
  }
57
- if (colorProfileName === 'default' || compareMode) {
58
- return _jsx(_Fragment, {});
109
+ return _t3;
110
+ }
111
+ var t5;
112
+ if ($[11] !== colorBy || $[12] !== currentBinaryFilters || $[13] !== excludeBinary || $[14] !== removeExcludeBinary || $[15] !== stackColorArray) {
113
+ var _t4;
114
+ if ($[17] !== colorBy || $[18] !== currentBinaryFilters || $[19] !== excludeBinary || $[20] !== removeExcludeBinary) {
115
+ _t4 = function _t4(t7) {
116
+ var _t5 = _slicedToArray(t7, 2),
117
+ feature = _t5[0],
118
+ color = _t5[1];
119
+ var filteringAllowed = feature !== EVERYTHING_ELSE;
120
+ var isHighlighted = currentBinaryFilters.includes(feature);
121
+ return /*#__PURE__*/_jsxs("div", {
122
+ className: cx("flex-no-wrap mb-1 flex w-[19.25%] items-center justify-between text-ellipsis p-1", {
123
+ "cursor-pointer": filteringAllowed && colorBy === "binary",
124
+ "bg-gray-200 dark:bg-gray-800": isHighlighted
125
+ }),
126
+ onClick: function onClick() {
127
+ if (!filteringAllowed || isHighlighted || colorBy !== "binary") {
128
+ return;
129
+ }
130
+ removeExcludeBinary(feature);
131
+ },
132
+ children: [/*#__PURE__*/_jsxs("div", {
133
+ className: "flex w-11/12 items-center justify-start",
134
+ children: [/*#__PURE__*/_jsx("div", {
135
+ className: "flex w-5 items-center",
136
+ children: /*#__PURE__*/_jsx("div", {
137
+ className: "mr-1 inline-block h-4 w-4 rounded-[4px]",
138
+ style: {
139
+ backgroundColor: color
140
+ }
141
+ })
142
+ }), /*#__PURE__*/_jsx("div", {
143
+ className: "shrink overflow-hidden text-ellipsis whitespace-nowrap text-sm hover:whitespace-normal",
144
+ children: feature
145
+ })]
146
+ }), /*#__PURE__*/_jsx("div", {
147
+ className: "flex w-1/12 justify-end",
148
+ children: isHighlighted && /*#__PURE__*/_jsx(Icon, {
149
+ icon: "radix-icons:cross-circled",
150
+ onClick: function onClick(e) {
151
+ excludeBinary(feature);
152
+ e.stopPropagation();
153
+ }
154
+ })
155
+ })]
156
+ }, feature);
157
+ };
158
+ $[17] = colorBy;
159
+ $[18] = currentBinaryFilters;
160
+ $[19] = excludeBinary;
161
+ $[20] = removeExcludeBinary;
162
+ $[21] = _t4;
163
+ } else {
164
+ _t4 = $[21];
59
165
  }
60
- return (_jsx("div", { className: "my-4 flex w-full flex-wrap justify-start column-gap-2", children: stackColorArray.map(([feature, color]) => {
61
- const filteringAllowed = feature !== EVERYTHING_ELSE;
62
- const isHighlighted = currentBinaryFilters.includes(feature);
63
- return (_jsxs("div", { className: cx('flex-no-wrap mb-1 flex w-[19.25%] items-center justify-between text-ellipsis p-1', {
64
- 'cursor-pointer': filteringAllowed && colorBy === 'binary',
65
- 'bg-gray-200 dark:bg-gray-800': isHighlighted,
66
- }), onClick: () => {
67
- if (!filteringAllowed || isHighlighted || colorBy !== 'binary') {
68
- return;
69
- }
70
- // Remove the exclude filter for this binary
71
- removeExcludeBinary(feature);
72
- }, children: [_jsxs("div", { className: "flex w-11/12 items-center justify-start", children: [_jsx("div", { className: "flex w-5 items-center", children: _jsx("div", { className: "mr-1 inline-block h-4 w-4 rounded-[4px]", style: { backgroundColor: color } }) }), _jsx("div", { className: "shrink overflow-hidden text-ellipsis whitespace-nowrap text-sm hover:whitespace-normal", children: feature })] }), _jsx("div", { className: "flex w-1/12 justify-end", children: isHighlighted && (_jsx(Icon, { icon: "radix-icons:cross-circled", onClick: e => {
73
- // Find and remove the filter for this binary
74
- excludeBinary(feature);
75
- e.stopPropagation();
76
- } })) })] }, feature));
77
- }) }));
166
+ t5 = stackColorArray.map(_t4);
167
+ $[11] = colorBy;
168
+ $[12] = currentBinaryFilters;
169
+ $[13] = excludeBinary;
170
+ $[14] = removeExcludeBinary;
171
+ $[15] = stackColorArray;
172
+ $[16] = t5;
173
+ } else {
174
+ t5 = $[16];
175
+ }
176
+ var t6;
177
+ if ($[22] !== t5) {
178
+ t6 = /*#__PURE__*/_jsx("div", {
179
+ className: "my-4 flex w-full flex-wrap justify-start column-gap-2",
180
+ children: t5
181
+ });
182
+ $[22] = t5;
183
+ $[23] = t6;
184
+ } else {
185
+ t6 = $[23];
186
+ }
187
+ return t6;
78
188
  };
79
189
  export default ColorStackLegend;
190
+ function _temp(f) {
191
+ return f.type === "frame" && f.field === "binary";
192
+ }
193
+ function _temp2(f_0) {
194
+ return f_0.value;
195
+ }
196
+ function _temp3(t0, t1) {
197
+ var _featureA$localeCompa;
198
+ var _t6 = _slicedToArray(t0, 1),
199
+ featureA = _t6[0];
200
+ var _t7 = _slicedToArray(t1, 1),
201
+ featureB = _t7[0];
202
+ if (featureA === EVERYTHING_ELSE) {
203
+ return 1;
204
+ }
205
+ if (featureB === EVERYTHING_ELSE) {
206
+ return -1;
207
+ }
208
+ return (_featureA$localeCompa = featureA === null || featureA === void 0 ? void 0 : featureA.localeCompare(featureB !== null && featureB !== void 0 ? featureB : "")) !== null && _featureA$localeCompa !== void 0 ? _featureA$localeCompa : 0;
209
+ }
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  // Copyright 2022 The Parca Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,6 +10,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
13
+
14
14
  import { Profiler } from 'react';
15
15
  import { ConditionalWrapper } from '@parca/components';
16
16
  import ProfileFlameChart from '../../../ProfileFlameChart';
@@ -18,30 +18,89 @@ import ProfileFlameGraph from '../../../ProfileFlameGraph';
18
18
  import Sandwich from '../../../Sandwich';
19
19
  import { SourceView } from '../../../SourceView';
20
20
  import { Table } from '../../../Table';
21
- export const getDashboardItem = ({ type, isHalfScreen, dimensions, flamegraphData, samplesData, topTableData, sourceData, sandwichData, profileSource, total, filtered, curPathArrow, setNewCurPathArrow, perf, queryClient, onSwitchToFifteenMinutes, }) => {
22
- switch (type) {
23
- case 'flamegraph':
24
- return (_jsx(ConditionalWrapper, { condition: perf?.onRender != null, WrapperComponent: Profiler, wrapperProps: {
25
- id: 'flameGraph',
26
- onRender: perf?.onRender ?? (() => { }),
27
- }, children: _jsx(ProfileFlameGraph, { curPathArrow: curPathArrow, setNewCurPathArrow: setNewCurPathArrow, arrow: flamegraphData?.arrow, total: total, filtered: filtered, profileType: profileSource?.ProfileType(), loading: flamegraphData.loading, error: flamegraphData.error, isHalfScreen: isHalfScreen, width: dimensions?.width !== undefined
28
- ? isHalfScreen
29
- ? (dimensions.width - 54) / 2
30
- : dimensions.width - 16
31
- : 0, metadataMappingFiles: flamegraphData.metadataMappingFiles, metadataLoading: flamegraphData.metadataLoading, profileSource: profileSource }) }));
32
- case 'flamechart':
33
- return (_jsx(ProfileFlameChart, { samplesData: samplesData, queryClient: queryClient, profileSource: profileSource, width: dimensions?.width !== undefined
34
- ? isHalfScreen
35
- ? (dimensions.width - 54) / 2
36
- : dimensions.width - 16
37
- : 0, total: total, filtered: filtered, profileType: profileSource?.ProfileType(), isHalfScreen: isHalfScreen, metadataMappingFiles: flamegraphData.metadataMappingFiles, metadataLoading: flamegraphData.metadataLoading, onSwitchToFifteenMinutes: onSwitchToFifteenMinutes }));
38
- case 'table':
39
- return topTableData != null ? (_jsx(Table, { error: topTableData.error, total: total, filtered: filtered, loading: topTableData.loading, data: topTableData.arrow?.record, unit: topTableData.unit, profileType: profileSource?.ProfileType(), isHalfScreen: isHalfScreen, metadataMappingFiles: flamegraphData.metadataMappingFiles })) : (_jsx(_Fragment, {}));
40
- case 'sandwich':
41
- return topTableData != null ? (_jsx(Sandwich, { profileSource: profileSource, sandwichData: sandwichData })) : (_jsx(_Fragment, {}));
42
- case 'source':
43
- return sourceData != null ? (_jsx(SourceView, { loading: sourceData.loading, data: sourceData.data, total: total, filtered: filtered })) : (_jsx(_Fragment, {}));
44
- default:
45
- return _jsx(_Fragment, {});
46
- }
47
- };
21
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
22
+ export var getDashboardItem = function getDashboardItem(_ref) {
23
+ var _perf$onRender, _topTableData$arrow;
24
+ var type = _ref.type,
25
+ isHalfScreen = _ref.isHalfScreen,
26
+ dimensions = _ref.dimensions,
27
+ flamegraphData = _ref.flamegraphData,
28
+ samplesData = _ref.samplesData,
29
+ topTableData = _ref.topTableData,
30
+ sourceData = _ref.sourceData,
31
+ sandwichData = _ref.sandwichData,
32
+ profileSource = _ref.profileSource,
33
+ total = _ref.total,
34
+ filtered = _ref.filtered,
35
+ curPathArrow = _ref.curPathArrow,
36
+ setNewCurPathArrow = _ref.setNewCurPathArrow,
37
+ perf = _ref.perf,
38
+ queryClient = _ref.queryClient,
39
+ onSwitchToFifteenMinutes = _ref.onSwitchToFifteenMinutes;
40
+ switch (type) {
41
+ case 'flamegraph':
42
+ return /*#__PURE__*/_jsx(ConditionalWrapper, {
43
+ condition: (perf === null || perf === void 0 ? void 0 : perf.onRender) != null,
44
+ WrapperComponent: Profiler,
45
+ wrapperProps: {
46
+ id: 'flameGraph',
47
+ onRender: (_perf$onRender = perf === null || perf === void 0 ? void 0 : perf.onRender) !== null && _perf$onRender !== void 0 ? _perf$onRender : function () {}
48
+ },
49
+ children: /*#__PURE__*/_jsx(ProfileFlameGraph, {
50
+ curPathArrow: curPathArrow,
51
+ setNewCurPathArrow: setNewCurPathArrow,
52
+ arrow: flamegraphData === null || flamegraphData === void 0 ? void 0 : flamegraphData.arrow,
53
+ total: total,
54
+ filtered: filtered,
55
+ profileType: profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType(),
56
+ loading: flamegraphData.loading,
57
+ error: flamegraphData.error,
58
+ isHalfScreen: isHalfScreen,
59
+ width: (dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== undefined ? isHalfScreen ? (dimensions.width - 54) / 2 : dimensions.width - 16 : 0,
60
+ metadataMappingFiles: flamegraphData.metadataMappingFiles,
61
+ metadataLoading: flamegraphData.metadataLoading,
62
+ profileSource: profileSource
63
+ })
64
+ });
65
+ case 'flamechart':
66
+ return /*#__PURE__*/_jsx(ProfileFlameChart, {
67
+ samplesData: samplesData,
68
+ queryClient: queryClient,
69
+ profileSource: profileSource,
70
+ width: (dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== undefined ? isHalfScreen ? (dimensions.width - 54) / 2 : dimensions.width - 16 : 0,
71
+ total: total,
72
+ filtered: filtered,
73
+ profileType: profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType(),
74
+ isHalfScreen: isHalfScreen,
75
+ metadataMappingFiles: flamegraphData.metadataMappingFiles,
76
+ metadataLoading: flamegraphData.metadataLoading,
77
+ onSwitchToFifteenMinutes: onSwitchToFifteenMinutes
78
+ });
79
+ case 'table':
80
+ return topTableData != null ? /*#__PURE__*/_jsx(Table, {
81
+ error: topTableData.error,
82
+ total: total,
83
+ filtered: filtered,
84
+ loading: topTableData.loading,
85
+ data: (_topTableData$arrow = topTableData.arrow) === null || _topTableData$arrow === void 0 ? void 0 : _topTableData$arrow.record,
86
+ unit: topTableData.unit,
87
+ profileType: profileSource === null || profileSource === void 0 ? void 0 : profileSource.ProfileType(),
88
+ isHalfScreen: isHalfScreen,
89
+ metadataMappingFiles: flamegraphData.metadataMappingFiles
90
+ }) : /*#__PURE__*/_jsx(_Fragment, {});
91
+ case 'sandwich':
92
+ return topTableData != null ? /*#__PURE__*/_jsx(Sandwich, {
93
+ profileSource: profileSource,
94
+ sandwichData: sandwichData
95
+ }) : /*#__PURE__*/_jsx(_Fragment, {});
96
+ case 'source':
97
+ return sourceData != null ? /*#__PURE__*/_jsx(SourceView, {
98
+ loading: sourceData.loading,
99
+ data: sourceData.data,
100
+ total: total,
101
+ filtered: filtered
102
+ }) : /*#__PURE__*/_jsx(_Fragment, {});
103
+ default:
104
+ return /*#__PURE__*/_jsx(_Fragment, {});
105
+ }
106
+ };
@@ -1,20 +1,112 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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 _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
11
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
12
+ 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; }
13
+ import { c as _c } from "react-compiler-runtime"; // Copyright 2022 The Parca Authors
14
+ // Licensed under the Apache License, Version 2.0 (the "License");
15
+ // you may not use this file except in compliance with the License.
16
+ // You may obtain a copy of the License at
17
+ //
18
+ // http://www.apache.org/licenses/LICENSE-2.0
19
+ //
20
+ // Unless required by applicable law or agreed to in writing, software
21
+ // distributed under the License is distributed on an "AS IS" BASIS,
22
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ // See the License for the specific language governing permissions and
24
+ // limitations under the License.
2
25
  import cx from 'classnames';
3
- import { DragDropContext, Draggable, Droppable, } from 'react-beautiful-dnd';
26
+ import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
4
27
  import { useDashboard } from '../../context/DashboardContext';
5
28
  import { VisualizationContainer } from '../VisualizationContainer';
6
- export const DashboardLayout = ({ getDashboardItemByType, actionButtons, }) => {
7
- const { dashboardItems, setDashboardItems, isMultiPanelView } = useDashboard();
8
- const onDragEnd = (result) => {
9
- const { destination, source, draggableId } = result;
10
- if (Boolean(destination) && destination?.index !== source.index) {
11
- const targetItem = draggableId;
12
- const otherItems = dashboardItems.filter(item => item !== targetItem);
13
- const newDashboardItems = destination.index < source.index
14
- ? [targetItem, ...otherItems]
15
- : [...otherItems, targetItem];
16
- setDashboardItems(newDashboardItems);
17
- }
29
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
+ export var DashboardLayout = function DashboardLayout(t0) {
31
+ var $ = _c(11);
32
+ var getDashboardItemByType = t0.getDashboardItemByType,
33
+ actionButtons = t0.actionButtons;
34
+ var _useDashboard = useDashboard(),
35
+ dashboardItems = _useDashboard.dashboardItems,
36
+ setDashboardItems = _useDashboard.setDashboardItems,
37
+ isMultiPanelView = _useDashboard.isMultiPanelView;
38
+ var t1;
39
+ if ($[0] !== dashboardItems || $[1] !== setDashboardItems) {
40
+ t1 = function t1(result) {
41
+ var destination = result.destination,
42
+ source = result.source,
43
+ draggableId = result.draggableId;
44
+ if (Boolean(destination) && (destination === null || destination === void 0 ? void 0 : destination.index) !== source.index) {
45
+ var targetItem = draggableId;
46
+ var otherItems = dashboardItems.filter(function (item) {
47
+ return item !== targetItem;
48
+ });
49
+ var newDashboardItems = destination.index < source.index ? [targetItem].concat(_toConsumableArray(otherItems)) : [].concat(_toConsumableArray(otherItems), [targetItem]);
50
+ setDashboardItems(newDashboardItems);
51
+ }
18
52
  };
19
- return (_jsx(DragDropContext, { onDragEnd: onDragEnd, children: _jsx(Droppable, { droppableId: "droppable", direction: "horizontal", children: provided => (_jsxs("div", { ref: provided.innerRef, className: cx('grid w-full gap-2', isMultiPanelView ? 'grid-cols-2 mt-4' : 'grid-cols-1'), ...provided.droppableProps, children: [dashboardItems.map((dashboardItem, index) => (_jsx(Draggable, { draggableId: dashboardItem, index: index, isDragDisabled: !isMultiPanelView, children: (provided, snapshot) => (_jsx(VisualizationContainer, { provided: provided, snapshot: snapshot, dashboardItem: dashboardItem, getDashboardItemByType: getDashboardItemByType, isMultiPanelView: isMultiPanelView, index: index, actionButtons: actionButtons })) }, dashboardItem))), provided.placeholder] })) }) }));
20
- };
53
+ $[0] = dashboardItems;
54
+ $[1] = setDashboardItems;
55
+ $[2] = t1;
56
+ } else {
57
+ t1 = $[2];
58
+ }
59
+ var onDragEnd = t1;
60
+ var t2;
61
+ if ($[3] !== actionButtons || $[4] !== dashboardItems || $[5] !== getDashboardItemByType || $[6] !== isMultiPanelView) {
62
+ t2 = /*#__PURE__*/_jsx(Droppable, {
63
+ droppableId: "droppable",
64
+ direction: "horizontal",
65
+ children: function children(provided) {
66
+ return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
67
+ ref: provided.innerRef,
68
+ className: cx("grid w-full gap-2", isMultiPanelView ? "grid-cols-2 mt-4" : "grid-cols-1")
69
+ }, provided.droppableProps), {}, {
70
+ children: [dashboardItems.map(function (dashboardItem, index) {
71
+ return /*#__PURE__*/_jsx(Draggable, {
72
+ draggableId: dashboardItem,
73
+ index: index,
74
+ isDragDisabled: !isMultiPanelView,
75
+ children: function children(provided_0, snapshot) {
76
+ return /*#__PURE__*/_jsx(VisualizationContainer, {
77
+ provided: provided_0,
78
+ snapshot: snapshot,
79
+ dashboardItem: dashboardItem,
80
+ getDashboardItemByType: getDashboardItemByType,
81
+ isMultiPanelView: isMultiPanelView,
82
+ index: index,
83
+ actionButtons: actionButtons
84
+ });
85
+ }
86
+ }, dashboardItem);
87
+ }), provided.placeholder]
88
+ }));
89
+ }
90
+ });
91
+ $[3] = actionButtons;
92
+ $[4] = dashboardItems;
93
+ $[5] = getDashboardItemByType;
94
+ $[6] = isMultiPanelView;
95
+ $[7] = t2;
96
+ } else {
97
+ t2 = $[7];
98
+ }
99
+ var t3;
100
+ if ($[8] !== onDragEnd || $[9] !== t2) {
101
+ t3 = /*#__PURE__*/_jsx(DragDropContext, {
102
+ onDragEnd: onDragEnd,
103
+ children: t2
104
+ });
105
+ $[8] = onDragEnd;
106
+ $[9] = t2;
107
+ $[10] = t3;
108
+ } else {
109
+ t3 = $[10];
110
+ }
111
+ return t3;
112
+ };