@perses-dev/dashboards 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-explorer-plugin-c4a7621

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 (348) hide show
  1. package/dist/cjs/components/Dashboard/Dashboard.js +8 -1
  2. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +2 -2
  3. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +1 -1
  4. package/dist/cjs/components/Datasources/DatasourceEditor.js +18 -18
  5. package/dist/cjs/components/Datasources/EditDatasourcesButton.js +2 -5
  6. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -4
  7. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +10 -13
  8. package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +2 -2
  9. package/dist/cjs/components/GridLayout/GridContainer.js +15 -10
  10. package/dist/cjs/components/GridLayout/GridItemContent.js +19 -4
  11. package/dist/cjs/components/GridLayout/GridLayout.js +61 -12
  12. package/dist/cjs/components/GridLayout/GridTitle.js +3 -3
  13. package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
  14. package/dist/cjs/components/Panel/Panel.js +14 -10
  15. package/dist/cjs/components/Panel/PanelActions.js +216 -0
  16. package/dist/cjs/components/Panel/PanelContent.js +4 -4
  17. package/dist/cjs/components/Panel/PanelHeader.js +36 -103
  18. package/dist/cjs/components/Panel/PanelLinks.js +136 -0
  19. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
  20. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -65
  21. package/dist/cjs/components/PanelDrawer/PanelPreview.js +7 -3
  22. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
  23. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
  24. package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
  25. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -6
  26. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +2 -2
  27. package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -14
  28. package/dist/cjs/components/Variables/EditVariablesButton.js +4 -4
  29. package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +43 -60
  30. package/dist/cjs/components/Variables/VariableEditor.js +34 -40
  31. package/dist/cjs/components/Variables/VariableList.js +23 -22
  32. package/dist/cjs/components/Variables/index.js +2 -2
  33. package/dist/cjs/constants/styles.js +15 -7
  34. package/dist/cjs/constants/user-interface-text.js +3 -0
  35. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +10 -8
  36. package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
  37. package/dist/cjs/context/DashboardProvider/common.js +2 -2
  38. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +14 -6
  39. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -2
  40. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +7 -10
  41. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
  42. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +8 -3
  43. package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
  44. package/dist/cjs/context/DatasourceStoreProvider.js +18 -23
  45. package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +62 -69
  46. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
  47. package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
  48. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
  49. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
  50. package/dist/cjs/context/index.js +2 -2
  51. package/dist/cjs/context/useDashboard.js +4 -4
  52. package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
  53. package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
  54. package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
  55. package/dist/cjs/stories/decorators/index.js +2 -2
  56. package/dist/cjs/test/plugin-registry.js +4 -2
  57. package/dist/cjs/test/render.js +13 -11
  58. package/dist/cjs/views/ViewDashboard/DashboardApp.js +3 -3
  59. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +7 -8
  60. package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -1
  61. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
  62. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
  63. package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -1
  64. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
  65. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
  66. package/dist/components/Dashboard/Dashboard.d.ts +2 -1
  67. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
  68. package/dist/components/Dashboard/Dashboard.js +8 -1
  69. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  70. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -1
  71. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
  72. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +3 -3
  73. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  74. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
  75. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  76. package/dist/components/DashboardToolbar/DashboardToolbar.js +1 -1
  77. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  78. package/dist/components/Datasources/DatasourceEditor.d.ts +2 -1
  79. package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
  80. package/dist/components/Datasources/DatasourceEditor.js +19 -19
  81. package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
  82. package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -1
  83. package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
  84. package/dist/components/Datasources/EditDatasourcesButton.js +2 -5
  85. package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
  86. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -1
  87. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
  88. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  89. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -1
  90. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
  91. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -4
  92. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  93. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -1
  94. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  95. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  96. package/dist/components/DownloadButton/DownloadButton.d.ts +2 -1
  97. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  98. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  99. package/dist/components/EditButton/EditButton.d.ts +2 -1
  100. package/dist/components/EditButton/EditButton.d.ts.map +1 -1
  101. package/dist/components/EditButton/EditButton.js.map +1 -1
  102. package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -1
  103. package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
  104. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  105. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -1
  106. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  107. package/dist/components/EditJsonDialog/EditJsonDialog.js +7 -10
  108. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  109. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
  110. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
  111. package/dist/components/EmptyDashboard/EmptyDashboard.js +2 -2
  112. package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
  113. package/dist/components/GridLayout/GridContainer.d.ts +5 -3
  114. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  115. package/dist/components/GridLayout/GridContainer.js +15 -10
  116. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  117. package/dist/components/GridLayout/GridItemContent.d.ts +2 -1
  118. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  119. package/dist/components/GridLayout/GridItemContent.js +21 -6
  120. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  121. package/dist/components/GridLayout/GridLayout.d.ts +4 -2
  122. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  123. package/dist/components/GridLayout/GridLayout.js +63 -14
  124. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  125. package/dist/components/GridLayout/GridTitle.d.ts +3 -2
  126. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  127. package/dist/components/GridLayout/GridTitle.js +3 -3
  128. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  129. package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
  130. package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
  131. package/dist/{context/TemplateVariableProvider/index.js → components/Panel/HeaderIconButton.js} +7 -3
  132. package/dist/components/Panel/HeaderIconButton.js.map +1 -0
  133. package/dist/components/Panel/Panel.d.ts +11 -5
  134. package/dist/components/Panel/Panel.d.ts.map +1 -1
  135. package/dist/components/Panel/Panel.js +15 -11
  136. package/dist/components/Panel/Panel.js.map +1 -1
  137. package/dist/components/Panel/PanelActions.d.ts +16 -0
  138. package/dist/components/Panel/PanelActions.d.ts.map +1 -0
  139. package/dist/components/Panel/PanelActions.js +203 -0
  140. package/dist/components/Panel/PanelActions.js.map +1 -0
  141. package/dist/components/Panel/PanelContent.d.ts +2 -1
  142. package/dist/components/Panel/PanelContent.d.ts.map +1 -1
  143. package/dist/components/Panel/PanelContent.js +4 -4
  144. package/dist/components/Panel/PanelContent.js.map +1 -1
  145. package/dist/components/Panel/PanelHeader.d.ts +8 -8
  146. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  147. package/dist/components/Panel/PanelHeader.js +39 -106
  148. package/dist/components/Panel/PanelHeader.js.map +1 -1
  149. package/dist/components/Panel/PanelLinks.d.ts +6 -0
  150. package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
  151. package/dist/components/Panel/PanelLinks.js +123 -0
  152. package/dist/components/Panel/PanelLinks.js.map +1 -0
  153. package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -1
  154. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  155. package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
  156. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  157. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -3
  158. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  159. package/dist/components/PanelDrawer/PanelEditorForm.js +70 -68
  160. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  161. package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -2
  162. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  163. package/dist/components/PanelDrawer/PanelPreview.js +8 -4
  164. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  165. package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
  166. package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
  167. package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
  168. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  169. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -1
  170. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  171. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
  172. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  173. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -1
  174. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
  175. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  176. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -1
  177. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
  178. package/dist/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
  179. package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
  180. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -1
  181. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
  182. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +5 -7
  183. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  184. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -1
  185. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
  186. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +3 -3
  187. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
  188. package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -1
  189. package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
  190. package/dist/components/Variables/BuiltinVariableAccordions.js +7 -14
  191. package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
  192. package/dist/components/Variables/EditVariablesButton.d.ts +2 -1
  193. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
  194. package/dist/components/Variables/EditVariablesButton.js +5 -5
  195. package/dist/components/Variables/EditVariablesButton.js.map +1 -1
  196. package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -5
  197. package/dist/components/Variables/Variable.d.ts.map +1 -0
  198. package/dist/components/Variables/{TemplateVariable.js → Variable.js} +44 -61
  199. package/dist/components/Variables/Variable.js.map +1 -0
  200. package/dist/components/Variables/VariableEditor.d.ts +3 -2
  201. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  202. package/dist/components/Variables/VariableEditor.js +35 -41
  203. package/dist/components/Variables/VariableEditor.js.map +1 -1
  204. package/dist/components/Variables/VariableList.d.ts +4 -3
  205. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  206. package/dist/components/Variables/VariableList.js +21 -20
  207. package/dist/components/Variables/VariableList.js.map +1 -1
  208. package/dist/components/Variables/index.d.ts +1 -1
  209. package/dist/components/Variables/index.d.ts.map +1 -1
  210. package/dist/components/Variables/index.js +2 -2
  211. package/dist/components/Variables/index.js.map +1 -1
  212. package/dist/constants/styles.d.ts +4 -2
  213. package/dist/constants/styles.d.ts.map +1 -1
  214. package/dist/constants/styles.js +5 -3
  215. package/dist/constants/styles.js.map +1 -1
  216. package/dist/constants/user-interface-text.d.ts +3 -0
  217. package/dist/constants/user-interface-text.d.ts.map +1 -1
  218. package/dist/constants/user-interface-text.js +3 -0
  219. package/dist/constants/user-interface-text.js.map +1 -1
  220. package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -3
  221. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  222. package/dist/context/DashboardProvider/DashboardProvider.js +11 -9
  223. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  224. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
  225. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
  226. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
  227. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
  228. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  229. package/dist/context/DashboardProvider/common.js +2 -2
  230. package/dist/context/DashboardProvider/common.js.map +1 -1
  231. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
  232. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
  233. package/dist/context/DashboardProvider/dashboard-provider-api.js +13 -6
  234. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  235. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
  236. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -1
  237. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  238. package/dist/context/DashboardProvider/delete-panel-slice.js +1 -2
  239. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  240. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  241. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  242. package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
  243. package/dist/context/DashboardProvider/index.d.ts +1 -2
  244. package/dist/context/DashboardProvider/index.d.ts.map +1 -1
  245. package/dist/context/DashboardProvider/index.js.map +1 -1
  246. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
  247. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  248. package/dist/context/DashboardProvider/panel-editor-slice.js +4 -7
  249. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  250. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
  251. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
  252. package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
  253. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  254. package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
  255. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
  256. package/dist/context/DashboardProvider/panel-group-slice.js +7 -3
  257. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  258. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
  259. package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
  260. package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
  261. package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
  262. package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
  263. package/dist/context/DatasourceStoreProvider.d.ts +7 -7
  264. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
  265. package/dist/context/DatasourceStoreProvider.js +18 -23
  266. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  267. package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
  268. package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
  269. package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +51 -54
  270. package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
  271. package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
  272. package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
  273. package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
  274. package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
  275. package/dist/context/VariableProvider/index.d.ts +2 -0
  276. package/dist/context/VariableProvider/index.d.ts.map +1 -0
  277. package/dist/{validation → context/VariableProvider}/index.js +2 -2
  278. package/dist/context/VariableProvider/index.js.map +1 -0
  279. package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
  280. package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
  281. package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
  282. package/dist/context/VariableProvider/query-params.js.map +1 -0
  283. package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
  284. package/dist/context/VariableProvider/utils.d.ts.map +1 -0
  285. package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
  286. package/dist/context/VariableProvider/utils.js.map +1 -0
  287. package/dist/context/index.d.ts +1 -1
  288. package/dist/context/index.d.ts.map +1 -1
  289. package/dist/context/index.js +2 -2
  290. package/dist/context/index.js.map +1 -1
  291. package/dist/context/useDashboard.d.ts.map +1 -1
  292. package/dist/context/useDashboard.js +4 -4
  293. package/dist/context/useDashboard.js.map +1 -1
  294. package/dist/stories/decorators/WithDashboard.js +1 -1
  295. package/dist/stories/decorators/WithDashboard.js.map +1 -1
  296. package/dist/stories/decorators/WithDatasourceStore.js +1 -1
  297. package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
  298. package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
  299. package/dist/stories/decorators/WithVariables.js.map +1 -0
  300. package/dist/stories/decorators/index.js +2 -2
  301. package/dist/stories/decorators/index.js.map +1 -1
  302. package/dist/test/dashboard-provider.d.ts +1 -1
  303. package/dist/test/dashboard-provider.d.ts.map +1 -1
  304. package/dist/test/dashboard-provider.js.map +1 -1
  305. package/dist/test/datasource-provider.d.ts +2 -2
  306. package/dist/test/datasource-provider.d.ts.map +1 -1
  307. package/dist/test/datasource-provider.js.map +1 -1
  308. package/dist/test/plugin-registry.d.ts.map +1 -1
  309. package/dist/test/plugin-registry.js +4 -2
  310. package/dist/test/plugin-registry.js.map +1 -1
  311. package/dist/test/render.d.ts +2 -2
  312. package/dist/test/render.d.ts.map +1 -1
  313. package/dist/test/render.js +9 -7
  314. package/dist/test/render.js.map +1 -1
  315. package/dist/utils/panelUtils.d.ts.map +1 -1
  316. package/dist/utils/panelUtils.js.map +1 -1
  317. package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -2
  318. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  319. package/dist/views/ViewDashboard/DashboardApp.js +3 -3
  320. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  321. package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -3
  322. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  323. package/dist/views/ViewDashboard/ViewDashboard.js +8 -9
  324. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  325. package/package.json +9 -9
  326. package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
  327. package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
  328. package/dist/components/Variables/TemplateVariable.js.map +0 -1
  329. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
  330. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
  331. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
  332. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
  333. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
  334. package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
  335. package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
  336. package/dist/context/TemplateVariableProvider/index.js.map +0 -1
  337. package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
  338. package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
  339. package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
  340. package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
  341. package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
  342. package/dist/validation/index.d.ts +0 -2
  343. package/dist/validation/index.d.ts.map +0 -1
  344. package/dist/validation/index.js.map +0 -1
  345. package/dist/validation/panel.d.ts +0 -19
  346. package/dist/validation/panel.d.ts.map +0 -1
  347. package/dist/validation/panel.js +0 -21
  348. package/dist/validation/panel.js.map +0 -1
@@ -0,0 +1,216 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "PanelActions", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return PanelActions;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _react = require("react");
26
+ const _components = require("@perses-dev/components");
27
+ const _ArrowCollapse = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowCollapse"));
28
+ const _ArrowExpand = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ArrowExpand"));
29
+ const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
30
+ const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
31
+ const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DragVertical"));
32
+ const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
33
+ const _Menu = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Menu"));
34
+ const _constants = require("../../constants");
35
+ const _HeaderIconButton = require("./HeaderIconButton");
36
+ function _interop_require_default(obj) {
37
+ return obj && obj.__esModule ? obj : {
38
+ default: obj
39
+ };
40
+ }
41
+ const PanelActions = ({ editHandlers, readHandlers, extra, title })=>{
42
+ const readActions = (0, _react.useMemo)(()=>{
43
+ if (readHandlers !== undefined) {
44
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
45
+ description: _constants.TOOLTIP_TEXT.viewPanel,
46
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
47
+ "aria-label": _constants.ARIA_LABEL_TEXT.viewPanel(title),
48
+ size: "small",
49
+ onClick: readHandlers.onViewPanelClick,
50
+ children: readHandlers.isPanelViewed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowCollapse.default, {
51
+ fontSize: "inherit"
52
+ }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ArrowExpand.default, {
53
+ fontSize: "inherit"
54
+ })
55
+ })
56
+ });
57
+ }
58
+ return undefined;
59
+ }, [
60
+ readHandlers,
61
+ title
62
+ ]);
63
+ const editActions = (0, _react.useMemo)(()=>{
64
+ if (editHandlers !== undefined) {
65
+ // If there are edit handlers, always just show the edit buttons
66
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
67
+ children: [
68
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
69
+ description: _constants.TOOLTIP_TEXT.editPanel,
70
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
71
+ "aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
72
+ size: "small",
73
+ onClick: editHandlers.onEditPanelClick,
74
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
75
+ fontSize: "inherit"
76
+ })
77
+ })
78
+ }),
79
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
80
+ description: _constants.TOOLTIP_TEXT.duplicatePanel,
81
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
82
+ "aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
83
+ size: "small",
84
+ onClick: editHandlers.onDuplicatePanelClick,
85
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
86
+ fontSize: "inherit",
87
+ sx: {
88
+ // Shrink this icon a little bit to look more consistent
89
+ // with the other icons in the header.
90
+ transform: 'scale(0.925)'
91
+ }
92
+ })
93
+ })
94
+ }),
95
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
96
+ description: _constants.TOOLTIP_TEXT.deletePanel,
97
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
98
+ "aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
99
+ size: "small",
100
+ onClick: editHandlers.onDeletePanelClick,
101
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
102
+ fontSize: "inherit"
103
+ })
104
+ })
105
+ })
106
+ ]
107
+ });
108
+ }
109
+ return undefined;
110
+ }, [
111
+ editHandlers,
112
+ title
113
+ ]);
114
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(HeaderActionWrapper, {
115
+ direction: "row",
116
+ spacing: 0.25,
117
+ alignItems: "center",
118
+ sx: {
119
+ display: editHandlers !== undefined || readHandlers?.isPanelViewed ? 'flex' : 'var(--panel-hover, none)'
120
+ },
121
+ children: [
122
+ editHandlers === undefined && extra,
123
+ " ",
124
+ readActions,
125
+ editActions && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
126
+ children: [
127
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
128
+ sx: (0, _components.combineSx)((theme)=>({
129
+ display: 'block',
130
+ [theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).down(_constants.HEADER_ACTIONS_MIN_WIDTH)]: {
131
+ display: 'none'
132
+ }
133
+ })),
134
+ children: editActions
135
+ }),
136
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
137
+ sx: (0, _components.combineSx)((theme)=>({
138
+ display: 'block',
139
+ [theme.containerQueries(_constants.HEADER_ACTIONS_CONTAINER_NAME).up(_constants.HEADER_ACTIONS_MIN_WIDTH)]: {
140
+ display: 'none'
141
+ }
142
+ })),
143
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ShowAction, {
144
+ title: title,
145
+ children: editActions
146
+ })
147
+ })
148
+ ]
149
+ }),
150
+ editActions && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
151
+ description: _constants.TOOLTIP_TEXT.movePanel,
152
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
153
+ "aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
154
+ size: "small",
155
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
156
+ className: "drag-handle",
157
+ sx: {
158
+ cursor: 'grab'
159
+ },
160
+ fontSize: "inherit"
161
+ })
162
+ })
163
+ })
164
+ ]
165
+ });
166
+ };
167
+ const HeaderActionWrapper = (0, _material.styled)(_material.Stack)(()=>({
168
+ // Adding back the negative margins from MUI's defaults for actions, so we
169
+ // avoid increasing the header size when actions are present while also being
170
+ // able to vertically center the actions.
171
+ // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
172
+ marginTop: -4,
173
+ marginBottom: -4
174
+ }));
175
+ const ShowAction = ({ children, title })=>{
176
+ const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
177
+ const handleClick = (event)=>{
178
+ setAnchorEl(event.currentTarget);
179
+ };
180
+ const handleClose = ()=>{
181
+ setAnchorEl(null);
182
+ };
183
+ const open = Boolean(anchorEl);
184
+ const id = open ? 'actions-popover' : undefined;
185
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
186
+ children: [
187
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
188
+ className: "show-actions",
189
+ "aria-describedby": id,
190
+ onClick: handleClick,
191
+ "aria-label": _constants.ARIA_LABEL_TEXT.showPanelActions(title),
192
+ size: "small",
193
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Menu.default, {
194
+ fontSize: "inherit"
195
+ })
196
+ }),
197
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
198
+ id: id,
199
+ open: open,
200
+ anchorEl: anchorEl,
201
+ onClose: handleClose,
202
+ anchorOrigin: {
203
+ vertical: 'bottom',
204
+ horizontal: 'left'
205
+ },
206
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
207
+ sx: {
208
+ padding: '8px'
209
+ },
210
+ onClick: handleClose,
211
+ children: children
212
+ })
213
+ })
214
+ ]
215
+ });
216
+ };
@@ -26,14 +26,14 @@ const _material = require("@mui/material");
26
26
  function PanelContent(props) {
27
27
  const { panelPluginKind, contentDimensions, definition, ...others } = props;
28
28
  const { data: plugin, isLoading } = (0, _pluginsystem.usePlugin)('Panel', panelPluginKind, {
29
- useErrorBoundary: true
29
+ throwOnError: true
30
30
  });
31
- const PanelComponent = plugin === null || plugin === void 0 ? void 0 : plugin.PanelComponent;
31
+ const PanelComponent = plugin?.PanelComponent;
32
32
  if (isLoading) {
33
33
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
34
34
  variant: "rectangular",
35
- width: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.width,
36
- height: contentDimensions === null || contentDimensions === void 0 ? void 0 : contentDimensions.height,
35
+ width: contentDimensions?.width,
36
+ height: contentDimensions?.height,
37
37
  "aria-label": "Loading..."
38
38
  });
39
39
  }
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2025 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -23,83 +23,22 @@ Object.defineProperty(exports, "PanelHeader", {
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
24
  const _material = require("@mui/material");
25
25
  const _components = require("@perses-dev/components");
26
- const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
27
- const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
28
- const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
29
- const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DragVertical"));
30
- const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
31
26
  const _pluginsystem = require("@perses-dev/plugin-system");
27
+ const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
32
28
  const _constants = require("../../constants");
29
+ const _PanelActions = require("./PanelActions");
30
+ const _PanelLinks = require("./PanelLinks");
31
+ const _HeaderIconButton = require("./HeaderIconButton");
33
32
  function _interop_require_default(obj) {
34
33
  return obj && obj.__esModule ? obj : {
35
34
  default: obj
36
35
  };
37
36
  }
38
- function PanelHeader({ id, title: rawTitle, description: rawDescription, editHandlers, sx, extra, ...rest }) {
37
+ function PanelHeader({ id, title: rawTitle, description: rawDescription, links, readHandlers, editHandlers, sx, extra, ...rest }) {
39
38
  const titleElementId = `${id}-title`;
40
39
  const descriptionTooltipId = `${id}-description`;
41
40
  const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
42
41
  const description = (0, _pluginsystem.useReplaceVariablesInString)(rawDescription);
43
- let actions = undefined;
44
- if (editHandlers !== undefined) {
45
- // If there are edit handlers, always just show the edit buttons
46
- actions = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
47
- children: [
48
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
49
- description: _constants.TOOLTIP_TEXT.editPanel,
50
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
51
- "aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
52
- size: "small",
53
- onClick: editHandlers.onEditPanelClick,
54
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
55
- fontSize: "inherit"
56
- })
57
- })
58
- }),
59
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
60
- description: _constants.TOOLTIP_TEXT.duplicatePanel,
61
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
62
- "aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
63
- size: "small",
64
- onClick: editHandlers.onDuplicatePanelClick,
65
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
66
- fontSize: "inherit",
67
- sx: {
68
- // Shrink this icon a little bit to look more consistent
69
- // with the other icons in the header.
70
- transform: 'scale(0.925)'
71
- }
72
- })
73
- })
74
- }),
75
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
76
- description: _constants.TOOLTIP_TEXT.deletePanel,
77
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
78
- "aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
79
- size: "small",
80
- onClick: editHandlers.onDeletePanelClick,
81
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
82
- fontSize: "inherit"
83
- })
84
- })
85
- }),
86
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
87
- description: _constants.TOOLTIP_TEXT.movePanel,
88
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
89
- "aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
90
- size: "small",
91
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
92
- className: "drag-handle",
93
- sx: {
94
- cursor: 'grab'
95
- },
96
- fontSize: "inherit"
97
- })
98
- })
99
- })
100
- ]
101
- });
102
- }
103
42
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CardHeader, {
104
43
  id: id,
105
44
  component: "header",
@@ -116,43 +55,49 @@ function PanelHeader({ id, title: rawTitle, description: rawDescription, editHan
116
55
  // `minHeight` guarantees that the header has the correct height
117
56
  // when there is no title (i.e. in the preview)
118
57
  lineHeight: '24px',
119
- minHeight: '24px',
58
+ minHeight: '26px',
120
59
  whiteSpace: 'nowrap',
121
60
  overflow: 'hidden',
122
61
  textOverflow: 'ellipsis'
123
62
  },
124
63
  children: title
125
64
  }),
126
- description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
127
- id: descriptionTooltipId,
128
- description: description,
129
- enterDelay: 100,
130
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
131
- "aria-label": "panel description",
132
- size: "small",
133
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
134
- "aria-describedby": "info-tooltip",
135
- "aria-hidden": false,
136
- fontSize: "inherit",
137
- sx: {
138
- color: (theme)=>theme.palette.text.secondary
139
- }
65
+ description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
66
+ sx: {
67
+ display: editHandlers === undefined ? 'var(--panel-hover, none)' : 'flex'
68
+ },
69
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
70
+ id: descriptionTooltipId,
71
+ description: description,
72
+ enterDelay: 100,
73
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
74
+ "aria-label": "panel description",
75
+ size: "small",
76
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
77
+ "aria-describedby": "info-tooltip",
78
+ "aria-hidden": false,
79
+ fontSize: "inherit",
80
+ sx: {
81
+ color: (theme)=>theme.palette.text.secondary
82
+ }
83
+ })
140
84
  })
141
85
  })
86
+ }),
87
+ links !== undefined && links.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelLinks.PanelLinks, {
88
+ links: links
142
89
  })
143
90
  ]
144
91
  }),
145
- action: /*#__PURE__*/ (0, _jsxruntime.jsxs)(HeaderActionWrapper, {
146
- direction: "row",
147
- spacing: 0.25,
148
- alignItems: "center",
149
- children: [
150
- editHandlers === undefined && extra,
151
- " ",
152
- actions
153
- ]
92
+ action: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelActions.PanelActions, {
93
+ title: title,
94
+ readHandlers: readHandlers,
95
+ editHandlers: editHandlers,
96
+ extra: extra
154
97
  }),
155
98
  sx: (0, _components.combineSx)((theme)=>({
99
+ containerType: 'inline-size',
100
+ containerName: _constants.HEADER_ACTIONS_CONTAINER_NAME,
156
101
  padding: theme.spacing(1),
157
102
  borderBottom: `solid 1px ${theme.palette.divider}`,
158
103
  '.MuiCardHeader-content': {
@@ -169,15 +114,3 @@ function PanelHeader({ id, title: rawTitle, description: rawDescription, editHan
169
114
  ...rest
170
115
  });
171
116
  }
172
- const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
173
- borderRadius: theme.shape.borderRadius,
174
- padding: '4px'
175
- }));
176
- const HeaderActionWrapper = (0, _material.styled)(_material.Stack)(()=>({
177
- // Adding back the negative margins from MUI's defaults for actions, so we
178
- // avoid increasing the header size when actions are present while also being
179
- // able to vertically center the actions.
180
- // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
181
- marginTop: -4,
182
- marginBottom: -4
183
- }));
@@ -0,0 +1,136 @@
1
+ // Copyright 2024 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "PanelLinks", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return PanelLinks;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _Launch = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Launch"));
26
+ const _react = require("react");
27
+ const _components = require("@perses-dev/components");
28
+ const _pluginsystem = require("@perses-dev/plugin-system");
29
+ function _interop_require_default(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ function PanelLinks({ links }) {
35
+ const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
36
+ const isMenuOpened = Boolean(anchorEl);
37
+ const handleOpenMenu = (event)=>{
38
+ setAnchorEl(event.currentTarget);
39
+ };
40
+ const handleClose = ()=>{
41
+ setAnchorEl(null);
42
+ };
43
+ // If there is only one link, show it directly
44
+ if (links.length === 1 && links[0]) {
45
+ const link = links[0];
46
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkButton, {
47
+ link: link
48
+ });
49
+ }
50
+ // Else we show a menu with a list of all links
51
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
52
+ children: [
53
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
54
+ description: `${links.length} links`,
55
+ enterDelay: 100,
56
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
57
+ "aria-label": "Panel links",
58
+ size: "small",
59
+ onClick: handleOpenMenu,
60
+ sx: (theme)=>({
61
+ borderRadius: theme.shape.borderRadius,
62
+ padding: '4px'
63
+ }),
64
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
65
+ "aria-describedby": "links-icon",
66
+ fontSize: "inherit",
67
+ sx: {
68
+ color: (theme)=>theme.palette.text.secondary
69
+ }
70
+ })
71
+ })
72
+ }),
73
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
74
+ anchorEl: anchorEl,
75
+ open: isMenuOpened,
76
+ onClose: handleClose,
77
+ MenuListProps: {
78
+ 'aria-labelledby': 'panel-links'
79
+ },
80
+ children: links.map((link)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkMenuItem, {
81
+ link: link
82
+ }, link.url))
83
+ })
84
+ ]
85
+ });
86
+ }
87
+ function LinkButton({ link }) {
88
+ const { url, name, tooltip, targetBlank } = useLink(link);
89
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
90
+ description: tooltip ?? url,
91
+ enterDelay: 100,
92
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
93
+ "aria-label": name ?? url,
94
+ size: "small",
95
+ href: url,
96
+ target: targetBlank ? '_blank' : '_self',
97
+ sx: (theme)=>({
98
+ borderRadius: theme.shape.borderRadius,
99
+ padding: '4px'
100
+ }),
101
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
102
+ fontSize: "inherit",
103
+ sx: {
104
+ color: (theme)=>theme.palette.text.secondary
105
+ }
106
+ })
107
+ })
108
+ });
109
+ }
110
+ function LinkMenuItem({ link }) {
111
+ const { url, name, tooltip, targetBlank } = useLink(link);
112
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
113
+ description: tooltip ?? url,
114
+ enterDelay: 100,
115
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
116
+ component: _material.Link,
117
+ href: url,
118
+ target: targetBlank ? '_blank' : '_self',
119
+ children: name ?? url
120
+ })
121
+ });
122
+ }
123
+ function useLink(link) {
124
+ const url = (0, _pluginsystem.useReplaceVariablesInString)(link.url) ?? link.url;
125
+ const name = (0, _pluginsystem.useReplaceVariablesInString)(link.name);
126
+ const tooltip = (0, _pluginsystem.useReplaceVariablesInString)(link.tooltip);
127
+ if (link.renderVariables === false) {
128
+ return link;
129
+ }
130
+ return {
131
+ ...link,
132
+ url,
133
+ name,
134
+ tooltip
135
+ };
136
+ }
@@ -44,7 +44,7 @@ const PanelDrawer = ()=>{
44
44
  };
45
45
  // Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state
46
46
  const handleExited = ()=>{
47
- panelEditor === null || panelEditor === void 0 ? void 0 : panelEditor.close();
47
+ panelEditor?.close();
48
48
  setIsClosing(false);
49
49
  };
50
50
  // Disables closing on click out. This is a quick-win solution to avoid losing draft changes.
@@ -58,11 +58,14 @@ const PanelDrawer = ()=>{
58
58
  onExited: handleExited
59
59
  },
60
60
  "data-testid": "panel-editor",
61
- children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelEditorForm.PanelEditorForm, {
62
- initialAction: panelEditor.mode,
63
- initialValues: panelEditor.initialValues,
64
- onSave: handleSave,
65
- onClose: handleClose
61
+ children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
62
+ FallbackComponent: _components.ErrorAlert,
63
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelEditorForm.PanelEditorForm, {
64
+ initialAction: panelEditor.mode,
65
+ initialValues: panelEditor.initialValues,
66
+ onSave: handleSave,
67
+ onClose: handleClose
68
+ })
66
69
  })
67
70
  });
68
71
  };