@perses-dev/dashboards 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104

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 (366) 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 +4 -4
  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/DeletePanelDialog/DeletePanelDialog.js +2 -0
  7. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +5 -4
  8. package/dist/cjs/components/DownloadButton/DownloadButton.js +135 -29
  9. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +10 -13
  10. package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +2 -2
  11. package/dist/cjs/components/GridLayout/GridContainer.js +15 -10
  12. package/dist/cjs/components/GridLayout/GridItemContent.js +20 -4
  13. package/dist/cjs/components/GridLayout/GridLayout.js +57 -12
  14. package/dist/cjs/components/GridLayout/GridTitle.js +3 -3
  15. package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
  16. package/dist/cjs/components/Panel/Panel.js +19 -11
  17. package/dist/cjs/components/Panel/PanelActions.js +365 -0
  18. package/dist/cjs/components/Panel/PanelContent.js +59 -13
  19. package/dist/cjs/components/Panel/PanelHeader.js +14 -117
  20. package/dist/cjs/components/Panel/PanelLinks.js +136 -0
  21. package/dist/cjs/components/Panel/PanelPluginLoader.js +56 -0
  22. package/dist/cjs/components/Panel/index.js +1 -0
  23. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
  24. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +81 -67
  25. package/dist/cjs/components/PanelDrawer/PanelPreview.js +7 -3
  26. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
  27. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
  28. package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
  29. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +4 -6
  30. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +2 -2
  31. package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +7 -14
  32. package/dist/cjs/components/Variables/EditVariablesButton.js +4 -4
  33. package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +52 -60
  34. package/dist/cjs/components/Variables/VariableEditor.js +34 -40
  35. package/dist/cjs/components/Variables/VariableList.js +23 -22
  36. package/dist/cjs/components/Variables/index.js +2 -2
  37. package/dist/cjs/constants/styles.js +19 -7
  38. package/dist/cjs/constants/user-interface-text.js +3 -1
  39. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +10 -8
  40. package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
  41. package/dist/cjs/context/DashboardProvider/common.js +2 -2
  42. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +25 -6
  43. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -2
  44. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +7 -10
  45. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
  46. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +8 -3
  47. package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
  48. package/dist/cjs/context/DatasourceStoreProvider.js +18 -23
  49. package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +76 -87
  50. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
  51. package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
  52. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
  53. package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
  54. package/dist/cjs/context/index.js +2 -2
  55. package/dist/cjs/context/useDashboard.js +4 -4
  56. package/dist/cjs/test/datasource-provider.js +1 -1
  57. package/dist/cjs/test/plugin-registry.js +8 -3
  58. package/dist/cjs/test/render.js +13 -11
  59. package/dist/cjs/views/ViewDashboard/DashboardApp.js +6 -4
  60. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -9
  61. package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -1
  62. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
  63. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
  64. package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -1
  65. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
  66. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
  67. package/dist/components/Dashboard/Dashboard.d.ts +2 -1
  68. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
  69. package/dist/components/Dashboard/Dashboard.js +8 -1
  70. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  71. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -1
  72. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
  73. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +3 -3
  74. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  75. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +4 -2
  76. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  77. package/dist/components/DashboardToolbar/DashboardToolbar.js +4 -4
  78. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  79. package/dist/components/Datasources/DatasourceEditor.d.ts +2 -1
  80. package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
  81. package/dist/components/Datasources/DatasourceEditor.js +19 -19
  82. package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
  83. package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -1
  84. package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
  85. package/dist/components/Datasources/EditDatasourcesButton.js +2 -5
  86. package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
  87. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -1
  88. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
  89. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +3 -1
  90. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  91. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -1
  92. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
  93. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +6 -5
  94. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  95. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -1
  96. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  97. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  98. package/dist/components/DownloadButton/DownloadButton.d.ts +2 -5
  99. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  100. package/dist/components/DownloadButton/DownloadButton.js +94 -29
  101. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  102. package/dist/components/EditButton/EditButton.d.ts +2 -1
  103. package/dist/components/EditButton/EditButton.d.ts.map +1 -1
  104. package/dist/components/EditButton/EditButton.js.map +1 -1
  105. package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -1
  106. package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
  107. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  108. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -1
  109. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  110. package/dist/components/EditJsonDialog/EditJsonDialog.js +7 -10
  111. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  112. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
  113. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
  114. package/dist/components/EmptyDashboard/EmptyDashboard.js +2 -2
  115. package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
  116. package/dist/components/GridLayout/GridContainer.d.ts +5 -3
  117. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  118. package/dist/components/GridLayout/GridContainer.js +15 -10
  119. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  120. package/dist/components/GridLayout/GridItemContent.d.ts +2 -1
  121. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  122. package/dist/components/GridLayout/GridItemContent.js +22 -6
  123. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  124. package/dist/components/GridLayout/GridLayout.d.ts +4 -2
  125. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  126. package/dist/components/GridLayout/GridLayout.js +59 -14
  127. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  128. package/dist/components/GridLayout/GridTitle.d.ts +3 -2
  129. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  130. package/dist/components/GridLayout/GridTitle.js +3 -3
  131. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  132. package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
  133. package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
  134. package/dist/{stories/decorators/index.js → components/Panel/HeaderIconButton.js} +7 -6
  135. package/dist/components/Panel/HeaderIconButton.js.map +1 -0
  136. package/dist/components/Panel/Panel.d.ts +16 -5
  137. package/dist/components/Panel/Panel.d.ts.map +1 -1
  138. package/dist/components/Panel/Panel.js +25 -12
  139. package/dist/components/Panel/Panel.js.map +1 -1
  140. package/dist/components/Panel/PanelActions.d.ts +22 -0
  141. package/dist/components/Panel/PanelActions.d.ts.map +1 -0
  142. package/dist/components/Panel/PanelActions.js +352 -0
  143. package/dist/components/Panel/PanelActions.js.map +1 -0
  144. package/dist/components/Panel/PanelContent.d.ts +7 -5
  145. package/dist/components/Panel/PanelContent.d.ts.map +1 -1
  146. package/dist/components/Panel/PanelContent.js +61 -15
  147. package/dist/components/Panel/PanelContent.js.map +1 -1
  148. package/dist/components/Panel/PanelHeader.d.ts +10 -8
  149. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  150. package/dist/components/Panel/PanelHeader.js +18 -116
  151. package/dist/components/Panel/PanelHeader.js.map +1 -1
  152. package/dist/components/Panel/PanelLinks.d.ts +6 -0
  153. package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
  154. package/dist/components/Panel/PanelLinks.js +123 -0
  155. package/dist/components/Panel/PanelLinks.js.map +1 -0
  156. package/dist/components/Panel/PanelPluginLoader.d.ts +13 -0
  157. package/dist/components/Panel/PanelPluginLoader.d.ts.map +1 -0
  158. package/dist/components/Panel/PanelPluginLoader.js +51 -0
  159. package/dist/components/Panel/PanelPluginLoader.js.map +1 -0
  160. package/dist/components/Panel/index.d.ts +1 -0
  161. package/dist/components/Panel/index.d.ts.map +1 -1
  162. package/dist/components/Panel/index.js +1 -0
  163. package/dist/components/Panel/index.js.map +1 -1
  164. package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -1
  165. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  166. package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
  167. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  168. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -3
  169. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  170. package/dist/components/PanelDrawer/PanelEditorForm.js +84 -70
  171. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  172. package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -2
  173. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  174. package/dist/components/PanelDrawer/PanelPreview.js +8 -4
  175. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  176. package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
  177. package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
  178. package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
  179. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  180. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -1
  181. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  182. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
  183. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  184. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -1
  185. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
  186. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  187. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -1
  188. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
  189. package/dist/components/QuerySummaryTable/QuerySummaryTable.js +3 -5
  190. package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
  191. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -1
  192. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
  193. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +5 -7
  194. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  195. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -1
  196. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
  197. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +3 -3
  198. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
  199. package/dist/components/Variables/BuiltinVariableAccordions.d.ts +2 -1
  200. package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
  201. package/dist/components/Variables/BuiltinVariableAccordions.js +7 -14
  202. package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
  203. package/dist/components/Variables/EditVariablesButton.d.ts +2 -1
  204. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
  205. package/dist/components/Variables/EditVariablesButton.js +5 -5
  206. package/dist/components/Variables/EditVariablesButton.js.map +1 -1
  207. package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -5
  208. package/dist/components/Variables/Variable.d.ts.map +1 -0
  209. package/dist/components/Variables/{TemplateVariable.js → Variable.js} +53 -61
  210. package/dist/components/Variables/Variable.js.map +1 -0
  211. package/dist/components/Variables/VariableEditor.d.ts +3 -2
  212. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  213. package/dist/components/Variables/VariableEditor.js +35 -41
  214. package/dist/components/Variables/VariableEditor.js.map +1 -1
  215. package/dist/components/Variables/VariableList.d.ts +4 -3
  216. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  217. package/dist/components/Variables/VariableList.js +21 -20
  218. package/dist/components/Variables/VariableList.js.map +1 -1
  219. package/dist/components/Variables/index.d.ts +1 -1
  220. package/dist/components/Variables/index.d.ts.map +1 -1
  221. package/dist/components/Variables/index.js +2 -2
  222. package/dist/components/Variables/index.js.map +1 -1
  223. package/dist/constants/styles.d.ts +5 -2
  224. package/dist/constants/styles.d.ts.map +1 -1
  225. package/dist/constants/styles.js +6 -3
  226. package/dist/constants/styles.js.map +1 -1
  227. package/dist/constants/user-interface-text.d.ts +3 -1
  228. package/dist/constants/user-interface-text.d.ts.map +1 -1
  229. package/dist/constants/user-interface-text.js +3 -1
  230. package/dist/constants/user-interface-text.js.map +1 -1
  231. package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -3
  232. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  233. package/dist/context/DashboardProvider/DashboardProvider.js +11 -9
  234. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  235. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
  236. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
  237. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
  238. package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
  239. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  240. package/dist/context/DashboardProvider/common.js +2 -2
  241. package/dist/context/DashboardProvider/common.js.map +1 -1
  242. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +45 -23
  243. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
  244. package/dist/context/DashboardProvider/dashboard-provider-api.js +23 -6
  245. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  246. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
  247. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -1
  248. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  249. package/dist/context/DashboardProvider/delete-panel-slice.js +1 -2
  250. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  251. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  252. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  253. package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
  254. package/dist/context/DashboardProvider/index.d.ts +1 -2
  255. package/dist/context/DashboardProvider/index.d.ts.map +1 -1
  256. package/dist/context/DashboardProvider/index.js.map +1 -1
  257. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
  258. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  259. package/dist/context/DashboardProvider/panel-editor-slice.js +4 -7
  260. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  261. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
  262. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
  263. package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
  264. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  265. package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
  266. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
  267. package/dist/context/DashboardProvider/panel-group-slice.js +7 -3
  268. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  269. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
  270. package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
  271. package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
  272. package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
  273. package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
  274. package/dist/context/DatasourceStoreProvider.d.ts +7 -7
  275. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
  276. package/dist/context/DatasourceStoreProvider.js +18 -23
  277. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  278. package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
  279. package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
  280. package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +62 -64
  281. package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
  282. package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
  283. package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
  284. package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
  285. package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
  286. package/dist/context/VariableProvider/index.d.ts +2 -0
  287. package/dist/context/VariableProvider/index.d.ts.map +1 -0
  288. package/dist/{validation → context/VariableProvider}/index.js +2 -2
  289. package/dist/context/VariableProvider/index.js.map +1 -0
  290. package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
  291. package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
  292. package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
  293. package/dist/context/VariableProvider/query-params.js.map +1 -0
  294. package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
  295. package/dist/context/VariableProvider/utils.d.ts.map +1 -0
  296. package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
  297. package/dist/context/VariableProvider/utils.js.map +1 -0
  298. package/dist/context/index.d.ts +1 -1
  299. package/dist/context/index.d.ts.map +1 -1
  300. package/dist/context/index.js +2 -2
  301. package/dist/context/index.js.map +1 -1
  302. package/dist/context/useDashboard.d.ts.map +1 -1
  303. package/dist/context/useDashboard.js +4 -4
  304. package/dist/context/useDashboard.js.map +1 -1
  305. package/dist/test/dashboard-provider.d.ts +1 -1
  306. package/dist/test/dashboard-provider.d.ts.map +1 -1
  307. package/dist/test/dashboard-provider.js.map +1 -1
  308. package/dist/test/datasource-provider.d.ts +3 -3
  309. package/dist/test/datasource-provider.d.ts.map +1 -1
  310. package/dist/test/datasource-provider.js +1 -1
  311. package/dist/test/datasource-provider.js.map +1 -1
  312. package/dist/test/plugin-registry.d.ts.map +1 -1
  313. package/dist/test/plugin-registry.js +8 -3
  314. package/dist/test/plugin-registry.js.map +1 -1
  315. package/dist/test/render.d.ts +2 -2
  316. package/dist/test/render.d.ts.map +1 -1
  317. package/dist/test/render.js +9 -7
  318. package/dist/test/render.js.map +1 -1
  319. package/dist/utils/panelUtils.d.ts.map +1 -1
  320. package/dist/utils/panelUtils.js.map +1 -1
  321. package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -2
  322. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  323. package/dist/views/ViewDashboard/DashboardApp.js +6 -4
  324. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  325. package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -3
  326. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  327. package/dist/views/ViewDashboard/ViewDashboard.js +11 -10
  328. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  329. package/package.json +12 -12
  330. package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
  331. package/dist/cjs/stories/decorators/WithDashboard.js +0 -41
  332. package/dist/cjs/stories/decorators/WithDatasourceStore.js +0 -39
  333. package/dist/cjs/stories/decorators/WithTemplateVariables.js +0 -37
  334. package/dist/cjs/stories/decorators/constants.js +0 -39
  335. package/dist/cjs/stories/decorators/index.js +0 -33
  336. package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
  337. package/dist/components/Variables/TemplateVariable.js.map +0 -1
  338. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
  339. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
  340. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
  341. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
  342. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
  343. package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
  344. package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
  345. package/dist/context/TemplateVariableProvider/index.js +0 -15
  346. package/dist/context/TemplateVariableProvider/index.js.map +0 -1
  347. package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
  348. package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
  349. package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
  350. package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
  351. package/dist/stories/decorators/WithDashboard.js +0 -33
  352. package/dist/stories/decorators/WithDashboard.js.map +0 -1
  353. package/dist/stories/decorators/WithDatasourceStore.js +0 -31
  354. package/dist/stories/decorators/WithDatasourceStore.js.map +0 -1
  355. package/dist/stories/decorators/WithTemplateVariables.js +0 -29
  356. package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
  357. package/dist/stories/decorators/constants.js +0 -31
  358. package/dist/stories/decorators/constants.js.map +0 -1
  359. package/dist/stories/decorators/index.js.map +0 -1
  360. package/dist/validation/index.d.ts +0 -2
  361. package/dist/validation/index.d.ts.map +0 -1
  362. package/dist/validation/index.js.map +0 -1
  363. package/dist/validation/panel.d.ts +0 -19
  364. package/dist/validation/panel.d.ts.map +0 -1
  365. package/dist/validation/panel.js +0 -21
  366. package/dist/validation/panel.js.map +0 -1
@@ -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
@@ -10,81 +10,17 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { CardHeader, Typography, Stack, IconButton, styled } from '@mui/material';
15
- import { InfoTooltip, combineSx } from '@perses-dev/components';
16
- import InformationOutlineIcon from 'mdi-material-ui/InformationOutline';
17
- import PencilIcon from 'mdi-material-ui/PencilOutline';
18
- import DeleteIcon from 'mdi-material-ui/DeleteOutline';
19
- import DragIcon from 'mdi-material-ui/DragVertical';
20
- import ContentCopy from 'mdi-material-ui/ContentCopy';
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { CardHeader, Stack, Typography } from '@mui/material';
15
+ import { combineSx } from '@perses-dev/components';
21
16
  import { useReplaceVariablesInString } from '@perses-dev/plugin-system';
22
- import { ARIA_LABEL_TEXT, TOOLTIP_TEXT } from '../../constants';
23
- export function PanelHeader({ id, title: rawTitle, description: rawDescription, editHandlers, sx, extra, ...rest }) {
17
+ import { HEADER_ACTIONS_CONTAINER_NAME } from '../../constants';
18
+ import { PanelActions } from './PanelActions';
19
+ export function PanelHeader({ id, title: rawTitle, description: rawDescription, links, queryResults, readHandlers, editHandlers, sx, extra, ...rest }) {
24
20
  const titleElementId = `${id}-title`;
25
21
  const descriptionTooltipId = `${id}-description`;
26
22
  const title = useReplaceVariablesInString(rawTitle);
27
23
  const description = useReplaceVariablesInString(rawDescription);
28
- let actions = undefined;
29
- if (editHandlers !== undefined) {
30
- // If there are edit handlers, always just show the edit buttons
31
- actions = /*#__PURE__*/ _jsxs(_Fragment, {
32
- children: [
33
- /*#__PURE__*/ _jsx(InfoTooltip, {
34
- description: TOOLTIP_TEXT.editPanel,
35
- children: /*#__PURE__*/ _jsx(HeaderIconButton, {
36
- "aria-label": ARIA_LABEL_TEXT.editPanel(title),
37
- size: "small",
38
- onClick: editHandlers.onEditPanelClick,
39
- children: /*#__PURE__*/ _jsx(PencilIcon, {
40
- fontSize: "inherit"
41
- })
42
- })
43
- }),
44
- /*#__PURE__*/ _jsx(InfoTooltip, {
45
- description: TOOLTIP_TEXT.duplicatePanel,
46
- children: /*#__PURE__*/ _jsx(HeaderIconButton, {
47
- "aria-label": ARIA_LABEL_TEXT.duplicatePanel(title),
48
- size: "small",
49
- onClick: editHandlers.onDuplicatePanelClick,
50
- children: /*#__PURE__*/ _jsx(ContentCopy, {
51
- fontSize: "inherit",
52
- sx: {
53
- // Shrink this icon a little bit to look more consistent
54
- // with the other icons in the header.
55
- transform: 'scale(0.925)'
56
- }
57
- })
58
- })
59
- }),
60
- /*#__PURE__*/ _jsx(InfoTooltip, {
61
- description: TOOLTIP_TEXT.deletePanel,
62
- children: /*#__PURE__*/ _jsx(HeaderIconButton, {
63
- "aria-label": ARIA_LABEL_TEXT.deletePanel(title),
64
- size: "small",
65
- onClick: editHandlers.onDeletePanelClick,
66
- children: /*#__PURE__*/ _jsx(DeleteIcon, {
67
- fontSize: "inherit"
68
- })
69
- })
70
- }),
71
- /*#__PURE__*/ _jsx(InfoTooltip, {
72
- description: TOOLTIP_TEXT.movePanel,
73
- children: /*#__PURE__*/ _jsx(HeaderIconButton, {
74
- "aria-label": ARIA_LABEL_TEXT.movePanel(title),
75
- size: "small",
76
- children: /*#__PURE__*/ _jsx(DragIcon, {
77
- className: "drag-handle",
78
- sx: {
79
- cursor: 'grab'
80
- },
81
- fontSize: "inherit"
82
- })
83
- })
84
- })
85
- ]
86
- });
87
- }
88
24
  return /*#__PURE__*/ _jsx(CardHeader, {
89
25
  id: id,
90
26
  component: "header",
@@ -101,70 +37,36 @@ export function PanelHeader({ id, title: rawTitle, description: rawDescription,
101
37
  // `minHeight` guarantees that the header has the correct height
102
38
  // when there is no title (i.e. in the preview)
103
39
  lineHeight: '24px',
104
- minHeight: '24px',
40
+ minHeight: '26px',
105
41
  whiteSpace: 'nowrap',
106
42
  overflow: 'hidden',
107
43
  textOverflow: 'ellipsis'
108
44
  },
109
45
  children: title
110
46
  }),
111
- description !== undefined && description.trim().length > 0 && /*#__PURE__*/ _jsx(InfoTooltip, {
112
- id: descriptionTooltipId,
47
+ /*#__PURE__*/ _jsx(PanelActions, {
48
+ title: title,
113
49
  description: description,
114
- enterDelay: 100,
115
- children: /*#__PURE__*/ _jsx(HeaderIconButton, {
116
- "aria-label": "panel description",
117
- size: "small",
118
- children: /*#__PURE__*/ _jsx(InformationOutlineIcon, {
119
- "aria-describedby": "info-tooltip",
120
- "aria-hidden": false,
121
- fontSize: "inherit",
122
- sx: {
123
- color: (theme)=>theme.palette.text.secondary
124
- }
125
- })
126
- })
50
+ descriptionTooltipId: descriptionTooltipId,
51
+ links: links,
52
+ queryResults: queryResults,
53
+ readHandlers: readHandlers,
54
+ editHandlers: editHandlers,
55
+ extra: extra
127
56
  })
128
57
  ]
129
58
  }),
130
- action: /*#__PURE__*/ _jsxs(HeaderActionWrapper, {
131
- direction: "row",
132
- spacing: 0.25,
133
- alignItems: "center",
134
- children: [
135
- editHandlers === undefined && extra,
136
- " ",
137
- actions
138
- ]
139
- }),
140
59
  sx: combineSx((theme)=>({
60
+ containerType: 'inline-size',
61
+ containerName: HEADER_ACTIONS_CONTAINER_NAME,
141
62
  padding: theme.spacing(1),
142
63
  borderBottom: `solid 1px ${theme.palette.divider}`,
143
64
  '.MuiCardHeader-content': {
144
65
  overflow: 'hidden'
145
- },
146
- '.MuiCardHeader-action': {
147
- // Overriding the negative margins from MUI's defaults, so we
148
- // can vertically center the icons. Moving these values to a wrapper
149
- // inside the action in `HeaderActionWrapper` below.
150
- // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
151
- margin: 'auto'
152
66
  }
153
67
  }), sx),
154
68
  ...rest
155
69
  });
156
70
  }
157
- const HeaderIconButton = styled(IconButton)(({ theme })=>({
158
- borderRadius: theme.shape.borderRadius,
159
- padding: '4px'
160
- }));
161
- const HeaderActionWrapper = styled(Stack)(()=>({
162
- // Adding back the negative margins from MUI's defaults for actions, so we
163
- // avoid increasing the header size when actions are present while also being
164
- // able to vertically center the actions.
165
- // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
166
- marginTop: -4,
167
- marginBottom: -4
168
- }));
169
71
 
170
72
  //# sourceMappingURL=PanelHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Panel/PanelHeader.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { CardHeader, Typography, Stack, IconButton, CardHeaderProps, styled } from '@mui/material';\nimport { InfoTooltip, combineSx } from '@perses-dev/components';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport DragIcon from 'mdi-material-ui/DragVertical';\nimport ContentCopy from 'mdi-material-ui/ContentCopy';\nimport { useReplaceVariablesInString } from '@perses-dev/plugin-system';\nimport { ARIA_LABEL_TEXT, TOOLTIP_TEXT } from '../../constants';\ntype OmittedProps = 'children' | 'action' | 'title' | 'disableTypography';\n\nexport interface PanelHeaderProps extends Omit<CardHeaderProps, OmittedProps> {\n id: string;\n title: string;\n description?: string;\n extra?: React.ReactNode;\n editHandlers?: {\n onEditPanelClick: () => void;\n onDuplicatePanelClick: () => void;\n onDeletePanelClick: () => void;\n };\n}\n\nexport function PanelHeader({\n id,\n title: rawTitle,\n description: rawDescription,\n editHandlers,\n sx,\n extra,\n ...rest\n}: PanelHeaderProps) {\n const titleElementId = `${id}-title`;\n const descriptionTooltipId = `${id}-description`;\n\n const title = useReplaceVariablesInString(rawTitle) as string;\n const description = useReplaceVariablesInString(rawDescription);\n\n let actions: CardHeaderProps['action'] = undefined;\n if (editHandlers !== undefined) {\n // If there are edit handlers, always just show the edit buttons\n actions = (\n <>\n <InfoTooltip description={TOOLTIP_TEXT.editPanel}>\n <HeaderIconButton\n aria-label={ARIA_LABEL_TEXT.editPanel(title)}\n size=\"small\"\n onClick={editHandlers.onEditPanelClick}\n >\n <PencilIcon fontSize=\"inherit\" />\n </HeaderIconButton>\n </InfoTooltip>\n <InfoTooltip description={TOOLTIP_TEXT.duplicatePanel}>\n <HeaderIconButton\n aria-label={ARIA_LABEL_TEXT.duplicatePanel(title)}\n size=\"small\"\n onClick={editHandlers.onDuplicatePanelClick}\n >\n <ContentCopy\n fontSize=\"inherit\"\n sx={{\n // Shrink this icon a little bit to look more consistent\n // with the other icons in the header.\n transform: 'scale(0.925)',\n }}\n />\n </HeaderIconButton>\n </InfoTooltip>\n <InfoTooltip description={TOOLTIP_TEXT.deletePanel}>\n <HeaderIconButton\n aria-label={ARIA_LABEL_TEXT.deletePanel(title)}\n size=\"small\"\n onClick={editHandlers.onDeletePanelClick}\n >\n <DeleteIcon fontSize=\"inherit\" />\n </HeaderIconButton>\n </InfoTooltip>\n <InfoTooltip description={TOOLTIP_TEXT.movePanel}>\n <HeaderIconButton aria-label={ARIA_LABEL_TEXT.movePanel(title)} size=\"small\">\n <DragIcon className=\"drag-handle\" sx={{ cursor: 'grab' }} fontSize=\"inherit\" />\n </HeaderIconButton>\n </InfoTooltip>\n </>\n );\n }\n\n return (\n <CardHeader\n id={id}\n component=\"header\"\n aria-labelledby={titleElementId}\n aria-describedby={descriptionTooltipId}\n disableTypography\n title={\n <Stack direction=\"row\">\n <Typography\n id={titleElementId}\n variant=\"subtitle1\"\n sx={{\n // `minHeight` guarantees that the header has the correct height\n // when there is no title (i.e. in the preview)\n lineHeight: '24px',\n minHeight: '24px',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {title}\n </Typography>\n {/* Show the info tooltip when description is defined and is not all whitespace */}\n {description !== undefined && description.trim().length > 0 && (\n <InfoTooltip id={descriptionTooltipId} description={description} enterDelay={100}>\n <HeaderIconButton aria-label=\"panel description\" size=\"small\">\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.text.secondary }}\n />\n </HeaderIconButton>\n </InfoTooltip>\n )}\n </Stack>\n }\n action={\n <HeaderActionWrapper direction=\"row\" spacing={0.25} alignItems=\"center\">\n {editHandlers === undefined && extra} {actions}\n </HeaderActionWrapper>\n }\n sx={combineSx(\n (theme) => ({\n padding: theme.spacing(1),\n borderBottom: `solid 1px ${theme.palette.divider}`,\n '.MuiCardHeader-content': {\n overflow: 'hidden',\n },\n '.MuiCardHeader-action': {\n // Overriding the negative margins from MUI's defaults, so we\n // can vertically center the icons. Moving these values to a wrapper\n // inside the action in `HeaderActionWrapper` below.\n // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58\n margin: 'auto',\n },\n }),\n sx\n )}\n {...rest}\n />\n );\n}\n\nconst HeaderIconButton = styled(IconButton)(({ theme }) => ({\n borderRadius: theme.shape.borderRadius,\n padding: '4px',\n}));\n\nconst HeaderActionWrapper = styled(Stack)(() => ({\n // Adding back the negative margins from MUI's defaults for actions, so we\n // avoid increasing the header size when actions are present while also being\n // able to vertically center the actions.\n // https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58\n marginTop: -4,\n marginBottom: -4,\n}));\n"],"names":["CardHeader","Typography","Stack","IconButton","styled","InfoTooltip","combineSx","InformationOutlineIcon","PencilIcon","DeleteIcon","DragIcon","ContentCopy","useReplaceVariablesInString","ARIA_LABEL_TEXT","TOOLTIP_TEXT","PanelHeader","id","title","rawTitle","description","rawDescription","editHandlers","sx","extra","rest","titleElementId","descriptionTooltipId","actions","undefined","editPanel","HeaderIconButton","aria-label","size","onClick","onEditPanelClick","fontSize","duplicatePanel","onDuplicatePanelClick","transform","deletePanel","onDeletePanelClick","movePanel","className","cursor","component","aria-labelledby","aria-describedby","disableTypography","direction","variant","lineHeight","minHeight","whiteSpace","overflow","textOverflow","trim","length","enterDelay","aria-hidden","color","theme","palette","text","secondary","action","HeaderActionWrapper","spacing","alignItems","padding","borderBottom","divider","margin","borderRadius","shape","marginTop","marginBottom"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../src/components/Panel/PanelHeader.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { CardHeader, CardHeaderProps, Stack, Typography } from '@mui/material';\nimport { combineSx } from '@perses-dev/components';\nimport { Link } from '@perses-dev/core';\nimport { QueryData, useReplaceVariablesInString } from '@perses-dev/plugin-system';\nimport { ReactElement, ReactNode } from 'react';\nimport { HEADER_ACTIONS_CONTAINER_NAME } from '../../constants';\nimport { PanelActions, PanelActionsProps } from './PanelActions';\n\ntype OmittedProps = 'children' | 'action' | 'title' | 'disableTypography';\n\nexport interface PanelHeaderProps extends Omit<CardHeaderProps, OmittedProps> {\n id: string;\n title: string;\n description?: string;\n links?: Link[];\n extra?: ReactNode;\n queryResults: QueryData[];\n readHandlers?: PanelActionsProps['readHandlers'];\n editHandlers?: PanelActionsProps['editHandlers'];\n}\n\nexport function PanelHeader({\n id,\n title: rawTitle,\n description: rawDescription,\n links,\n queryResults,\n readHandlers,\n editHandlers,\n sx,\n extra,\n ...rest\n}: PanelHeaderProps): ReactElement {\n const titleElementId = `${id}-title`;\n const descriptionTooltipId = `${id}-description`;\n\n const title = useReplaceVariablesInString(rawTitle) as string;\n const description = useReplaceVariablesInString(rawDescription);\n\n return (\n <CardHeader\n id={id}\n component=\"header\"\n aria-labelledby={titleElementId}\n aria-describedby={descriptionTooltipId}\n disableTypography\n title={\n <Stack direction=\"row\">\n <Typography\n id={titleElementId}\n variant=\"subtitle1\"\n sx={{\n // `minHeight` guarantees that the header has the correct height\n // when there is no title (i.e. in the preview)\n lineHeight: '24px',\n minHeight: '26px',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {title}\n </Typography>\n <PanelActions\n title={title}\n description={description}\n descriptionTooltipId={descriptionTooltipId}\n links={links}\n queryResults={queryResults}\n readHandlers={readHandlers}\n editHandlers={editHandlers}\n extra={extra}\n />\n </Stack>\n }\n sx={combineSx(\n (theme) => ({\n containerType: 'inline-size',\n containerName: HEADER_ACTIONS_CONTAINER_NAME,\n padding: theme.spacing(1),\n borderBottom: `solid 1px ${theme.palette.divider}`,\n '.MuiCardHeader-content': {\n overflow: 'hidden',\n },\n }),\n sx\n )}\n {...rest}\n />\n );\n}\n"],"names":["CardHeader","Stack","Typography","combineSx","useReplaceVariablesInString","HEADER_ACTIONS_CONTAINER_NAME","PanelActions","PanelHeader","id","title","rawTitle","description","rawDescription","links","queryResults","readHandlers","editHandlers","sx","extra","rest","titleElementId","descriptionTooltipId","component","aria-labelledby","aria-describedby","disableTypography","direction","variant","lineHeight","minHeight","whiteSpace","overflow","textOverflow","theme","containerType","containerName","padding","spacing","borderBottom","palette","divider"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,UAAU,EAAmBC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AAC/E,SAASC,SAAS,QAAQ,yBAAyB;AAEnD,SAAoBC,2BAA2B,QAAQ,4BAA4B;AAEnF,SAASC,6BAA6B,QAAQ,kBAAkB;AAChE,SAASC,YAAY,QAA2B,iBAAiB;AAejE,OAAO,SAASC,YAAY,EAC1BC,EAAE,EACFC,OAAOC,QAAQ,EACfC,aAAaC,cAAc,EAC3BC,KAAK,EACLC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,EAAE,EACFC,KAAK,EACL,GAAGC,MACc;IACjB,MAAMC,iBAAiB,GAAGZ,GAAG,MAAM,CAAC;IACpC,MAAMa,uBAAuB,GAAGb,GAAG,YAAY,CAAC;IAEhD,MAAMC,QAAQL,4BAA4BM;IAC1C,MAAMC,cAAcP,4BAA4BQ;IAEhD,qBACE,KAACZ;QACCQ,IAAIA;QACJc,WAAU;QACVC,mBAAiBH;QACjBI,oBAAkBH;QAClBI,iBAAiB;QACjBhB,qBACE,MAACR;YAAMyB,WAAU;;8BACf,KAACxB;oBACCM,IAAIY;oBACJO,SAAQ;oBACRV,IAAI;wBACF,gEAAgE;wBAChE,+CAA+C;wBAC/CW,YAAY;wBACZC,WAAW;wBACXC,YAAY;wBACZC,UAAU;wBACVC,cAAc;oBAChB;8BAECvB;;8BAEH,KAACH;oBACCG,OAAOA;oBACPE,aAAaA;oBACbU,sBAAsBA;oBACtBR,OAAOA;oBACPC,cAAcA;oBACdC,cAAcA;oBACdC,cAAcA;oBACdE,OAAOA;;;;QAIbD,IAAId,UACF,CAAC8B,QAAW,CAAA;gBACVC,eAAe;gBACfC,eAAe9B;gBACf+B,SAASH,MAAMI,OAAO,CAAC;gBACvBC,cAAc,CAAC,UAAU,EAAEL,MAAMM,OAAO,CAACC,OAAO,EAAE;gBAClD,0BAA0B;oBACxBT,UAAU;gBACZ;YACF,CAAA,GACAd;QAED,GAAGE,IAAI;;AAGd"}
@@ -0,0 +1,6 @@
1
+ import { Link } from '@perses-dev/core';
2
+ import { ReactElement } from 'react';
3
+ export declare function PanelLinks({ links }: {
4
+ links: Link[];
5
+ }): ReactElement;
6
+ //# sourceMappingURL=PanelLinks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelLinks.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/PanelLinks.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAc,YAAY,EAAY,MAAM,OAAO,CAAC;AAI3D,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,GAAG,YAAY,CAgDrE"}
@@ -0,0 +1,123 @@
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
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { IconButton, Link as LinkComponent, Menu, MenuItem } from '@mui/material';
15
+ import LaunchIcon from 'mdi-material-ui/Launch';
16
+ import { useState } from 'react';
17
+ import { InfoTooltip } from '@perses-dev/components';
18
+ import { useReplaceVariablesInString } from '@perses-dev/plugin-system';
19
+ export function PanelLinks({ links }) {
20
+ const [anchorEl, setAnchorEl] = useState(null);
21
+ const isMenuOpened = Boolean(anchorEl);
22
+ const handleOpenMenu = (event)=>{
23
+ setAnchorEl(event.currentTarget);
24
+ };
25
+ const handleClose = ()=>{
26
+ setAnchorEl(null);
27
+ };
28
+ // If there is only one link, show it directly
29
+ if (links.length === 1 && links[0]) {
30
+ const link = links[0];
31
+ return /*#__PURE__*/ _jsx(LinkButton, {
32
+ link: link
33
+ });
34
+ }
35
+ // Else we show a menu with a list of all links
36
+ return /*#__PURE__*/ _jsxs(_Fragment, {
37
+ children: [
38
+ /*#__PURE__*/ _jsx(InfoTooltip, {
39
+ description: `${links.length} links`,
40
+ enterDelay: 100,
41
+ children: /*#__PURE__*/ _jsx(IconButton, {
42
+ "aria-label": "Panel links",
43
+ size: "small",
44
+ onClick: handleOpenMenu,
45
+ sx: (theme)=>({
46
+ borderRadius: theme.shape.borderRadius,
47
+ padding: '4px'
48
+ }),
49
+ children: /*#__PURE__*/ _jsx(LaunchIcon, {
50
+ "aria-describedby": "links-icon",
51
+ fontSize: "inherit",
52
+ sx: {
53
+ color: (theme)=>theme.palette.text.secondary
54
+ }
55
+ })
56
+ })
57
+ }),
58
+ /*#__PURE__*/ _jsx(Menu, {
59
+ anchorEl: anchorEl,
60
+ open: isMenuOpened,
61
+ onClose: handleClose,
62
+ MenuListProps: {
63
+ 'aria-labelledby': 'panel-links'
64
+ },
65
+ children: links.map((link)=>/*#__PURE__*/ _jsx(LinkMenuItem, {
66
+ link: link
67
+ }, link.url))
68
+ })
69
+ ]
70
+ });
71
+ }
72
+ function LinkButton({ link }) {
73
+ const { url, name, tooltip, targetBlank } = useLink(link);
74
+ return /*#__PURE__*/ _jsx(InfoTooltip, {
75
+ description: tooltip ?? url,
76
+ enterDelay: 100,
77
+ children: /*#__PURE__*/ _jsx(IconButton, {
78
+ "aria-label": name ?? url,
79
+ size: "small",
80
+ href: url,
81
+ target: targetBlank ? '_blank' : '_self',
82
+ sx: (theme)=>({
83
+ borderRadius: theme.shape.borderRadius,
84
+ padding: '4px'
85
+ }),
86
+ children: /*#__PURE__*/ _jsx(LaunchIcon, {
87
+ fontSize: "inherit",
88
+ sx: {
89
+ color: (theme)=>theme.palette.text.secondary
90
+ }
91
+ })
92
+ })
93
+ });
94
+ }
95
+ function LinkMenuItem({ link }) {
96
+ const { url, name, tooltip, targetBlank } = useLink(link);
97
+ return /*#__PURE__*/ _jsx(InfoTooltip, {
98
+ description: tooltip ?? url,
99
+ enterDelay: 100,
100
+ children: /*#__PURE__*/ _jsx(MenuItem, {
101
+ component: LinkComponent,
102
+ href: url,
103
+ target: targetBlank ? '_blank' : '_self',
104
+ children: name ?? url
105
+ })
106
+ });
107
+ }
108
+ function useLink(link) {
109
+ const url = useReplaceVariablesInString(link.url) ?? link.url;
110
+ const name = useReplaceVariablesInString(link.name);
111
+ const tooltip = useReplaceVariablesInString(link.tooltip);
112
+ if (link.renderVariables === false) {
113
+ return link;
114
+ }
115
+ return {
116
+ ...link,
117
+ url,
118
+ name,
119
+ tooltip
120
+ };
121
+ }
122
+
123
+ //# sourceMappingURL=PanelLinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Panel/PanelLinks.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { IconButton, Link as LinkComponent, Menu, MenuItem, Theme } from '@mui/material';\nimport LaunchIcon from 'mdi-material-ui/Launch';\nimport { Link } from '@perses-dev/core';\nimport { MouseEvent, ReactElement, useState } from 'react';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { useReplaceVariablesInString } from '@perses-dev/plugin-system';\n\nexport function PanelLinks({ links }: { links: Link[] }): ReactElement {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n const isMenuOpened = Boolean(anchorEl);\n const handleOpenMenu = (event: MouseEvent<HTMLButtonElement>): void => {\n setAnchorEl(event.currentTarget);\n };\n const handleClose = (): void => {\n setAnchorEl(null);\n };\n\n // If there is only one link, show it directly\n if (links.length === 1 && links[0]) {\n const link = links[0];\n return <LinkButton link={link} />;\n }\n\n // Else we show a menu with a list of all links\n return (\n <>\n <InfoTooltip description={`${links.length} links`} enterDelay={100}>\n <IconButton\n aria-label=\"Panel links\"\n size=\"small\"\n onClick={handleOpenMenu}\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4px' })}\n >\n <LaunchIcon\n aria-describedby=\"links-icon\"\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.text.secondary }}\n />\n </IconButton>\n </InfoTooltip>\n\n <Menu\n anchorEl={anchorEl}\n open={isMenuOpened}\n onClose={handleClose}\n MenuListProps={{\n 'aria-labelledby': 'panel-links',\n }}\n >\n {links.map((link: Link) => (\n <LinkMenuItem key={link.url} link={link} />\n ))}\n </Menu>\n </>\n );\n}\n\nfunction LinkButton({ link }: { link: Link }): ReactElement {\n const { url, name, tooltip, targetBlank } = useLink(link);\n\n return (\n <InfoTooltip description={tooltip ?? url} enterDelay={100}>\n <IconButton\n aria-label={name ?? url}\n size=\"small\"\n href={url}\n target={targetBlank ? '_blank' : '_self'}\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4px' })}\n >\n <LaunchIcon fontSize=\"inherit\" sx={{ color: (theme: Theme) => theme.palette.text.secondary }} />\n </IconButton>\n </InfoTooltip>\n );\n}\n\nfunction LinkMenuItem({ link }: { link: Link }): ReactElement {\n const { url, name, tooltip, targetBlank } = useLink(link);\n\n return (\n <InfoTooltip description={tooltip ?? url} enterDelay={100}>\n <MenuItem component={LinkComponent} href={url} target={targetBlank ? '_blank' : '_self'}>\n {name ?? url}\n </MenuItem>\n </InfoTooltip>\n );\n}\n\nfunction useLink(link: Link): Link {\n const url = useReplaceVariablesInString(link.url) ?? link.url;\n const name = useReplaceVariablesInString(link.name);\n const tooltip = useReplaceVariablesInString(link.tooltip);\n\n if (link.renderVariables === false) {\n return link;\n }\n\n return { ...link, url, name, tooltip };\n}\n"],"names":["IconButton","Link","LinkComponent","Menu","MenuItem","LaunchIcon","useState","InfoTooltip","useReplaceVariablesInString","PanelLinks","links","anchorEl","setAnchorEl","isMenuOpened","Boolean","handleOpenMenu","event","currentTarget","handleClose","length","link","LinkButton","description","enterDelay","aria-label","size","onClick","sx","theme","borderRadius","shape","padding","aria-describedby","fontSize","color","palette","text","secondary","open","onClose","MenuListProps","map","LinkMenuItem","url","name","tooltip","targetBlank","useLink","href","target","component","renderVariables"],"mappings":"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"}
@@ -0,0 +1,13 @@
1
+ import { PanelProps } from '@perses-dev/plugin-system';
2
+ import { UnknownSpec, QueryDataType } from '@perses-dev/core';
3
+ import { ReactElement } from 'react';
4
+ interface PanelPluginProps extends PanelProps<UnknownSpec, QueryDataType> {
5
+ kind: string;
6
+ }
7
+ /**
8
+ * PanelPluginLoader loads the panel plugin specified by the 'kind' prop from the plugin registry and
9
+ * renders its PanelComponent.
10
+ */
11
+ export declare function PanelPluginLoader(props: PanelPluginProps): ReactElement;
12
+ export {};
13
+ //# sourceMappingURL=PanelPluginLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelPluginLoader.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/PanelPluginLoader.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAa,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,UAAU,gBAAiB,SAAQ,UAAU,CAAC,WAAW,EAAE,aAAa,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,YAAY,CAsCvE"}
@@ -0,0 +1,51 @@
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
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { usePlugin } from '@perses-dev/plugin-system';
15
+ import { Skeleton } from '@mui/material';
16
+ /**
17
+ * PanelPluginLoader loads the panel plugin specified by the 'kind' prop from the plugin registry and
18
+ * renders its PanelComponent.
19
+ */ export function PanelPluginLoader(props) {
20
+ const { kind, spec, contentDimensions, definition, queryResults } = props;
21
+ const { data: plugin, isLoading: isPanelLoading } = usePlugin('Panel', kind, {
22
+ throwOnError: true
23
+ });
24
+ const PanelComponent = plugin?.PanelComponent;
25
+ const supportedQueryTypes = plugin?.supportedQueryTypes || [];
26
+ // Show fullsize skeleton if the panel plugin is loading.
27
+ if (isPanelLoading) {
28
+ return /*#__PURE__*/ _jsx(Skeleton, {
29
+ variant: "rectangular",
30
+ width: contentDimensions?.width,
31
+ height: contentDimensions?.height,
32
+ "aria-label": "Loading..."
33
+ });
34
+ }
35
+ if (PanelComponent === undefined) {
36
+ throw new Error(`Missing PanelComponent from panel plugin for kind '${kind}'`);
37
+ }
38
+ for (const queryResult of queryResults){
39
+ if (!supportedQueryTypes.includes(queryResult.definition.kind)) {
40
+ throw new Error(`This panel does not support queries of type '${queryResult.definition.kind}'. Supported query types: ${supportedQueryTypes.join(', ')}.`);
41
+ }
42
+ }
43
+ return /*#__PURE__*/ _jsx(PanelComponent, {
44
+ spec: spec,
45
+ contentDimensions: contentDimensions,
46
+ definition: definition,
47
+ queryResults: queryResults
48
+ });
49
+ }
50
+
51
+ //# sourceMappingURL=PanelPluginLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Panel/PanelPluginLoader.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { usePlugin, PanelProps } from '@perses-dev/plugin-system';\nimport { UnknownSpec, QueryDataType } from '@perses-dev/core';\nimport { ReactElement } from 'react';\nimport { Skeleton } from '@mui/material';\n\ninterface PanelPluginProps extends PanelProps<UnknownSpec, QueryDataType> {\n kind: string;\n}\n\n/**\n * PanelPluginLoader loads the panel plugin specified by the 'kind' prop from the plugin registry and\n * renders its PanelComponent.\n */\nexport function PanelPluginLoader(props: PanelPluginProps): ReactElement {\n const { kind, spec, contentDimensions, definition, queryResults } = props;\n const { data: plugin, isLoading: isPanelLoading } = usePlugin('Panel', kind, { throwOnError: true });\n const PanelComponent = plugin?.PanelComponent;\n const supportedQueryTypes = plugin?.supportedQueryTypes || [];\n\n // Show fullsize skeleton if the panel plugin is loading.\n if (isPanelLoading) {\n return (\n <Skeleton\n variant=\"rectangular\"\n width={contentDimensions?.width}\n height={contentDimensions?.height}\n aria-label=\"Loading...\"\n />\n );\n }\n\n if (PanelComponent === undefined) {\n throw new Error(`Missing PanelComponent from panel plugin for kind '${kind}'`);\n }\n\n for (const queryResult of queryResults) {\n if (!supportedQueryTypes.includes(queryResult.definition.kind)) {\n throw new Error(\n `This panel does not support queries of type '${queryResult.definition.kind}'. Supported query types: ${supportedQueryTypes.join(', ')}.`\n );\n }\n }\n\n return (\n <PanelComponent\n spec={spec}\n contentDimensions={contentDimensions}\n definition={definition}\n queryResults={queryResults}\n />\n );\n}\n"],"names":["usePlugin","Skeleton","PanelPluginLoader","props","kind","spec","contentDimensions","definition","queryResults","data","plugin","isLoading","isPanelLoading","throwOnError","PanelComponent","supportedQueryTypes","variant","width","height","aria-label","undefined","Error","queryResult","includes","join"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,SAAS,QAAoB,4BAA4B;AAGlE,SAASC,QAAQ,QAAQ,gBAAgB;AAMzC;;;CAGC,GACD,OAAO,SAASC,kBAAkBC,KAAuB;IACvD,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,UAAU,EAAEC,YAAY,EAAE,GAAGL;IACpE,MAAM,EAAEM,MAAMC,MAAM,EAAEC,WAAWC,cAAc,EAAE,GAAGZ,UAAU,SAASI,MAAM;QAAES,cAAc;IAAK;IAClG,MAAMC,iBAAiBJ,QAAQI;IAC/B,MAAMC,sBAAsBL,QAAQK,uBAAuB,EAAE;IAE7D,yDAAyD;IACzD,IAAIH,gBAAgB;QAClB,qBACE,KAACX;YACCe,SAAQ;YACRC,OAAOX,mBAAmBW;YAC1BC,QAAQZ,mBAAmBY;YAC3BC,cAAW;;IAGjB;IAEA,IAAIL,mBAAmBM,WAAW;QAChC,MAAM,IAAIC,MAAM,CAAC,mDAAmD,EAAEjB,KAAK,CAAC,CAAC;IAC/E;IAEA,KAAK,MAAMkB,eAAed,aAAc;QACtC,IAAI,CAACO,oBAAoBQ,QAAQ,CAACD,YAAYf,UAAU,CAACH,IAAI,GAAG;YAC9D,MAAM,IAAIiB,MACR,CAAC,6CAA6C,EAAEC,YAAYf,UAAU,CAACH,IAAI,CAAC,0BAA0B,EAAEW,oBAAoBS,IAAI,CAAC,MAAM,CAAC,CAAC;QAE7I;IACF;IAEA,qBACE,KAACV;QACCT,MAAMA;QACNC,mBAAmBA;QACnBC,YAAYA;QACZC,cAAcA;;AAGpB"}
@@ -1,2 +1,3 @@
1
1
  export * from './Panel';
2
+ export * from './PanelPluginLoader';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.ts"],"names":[],"mappings":"AAaA,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.ts"],"names":[],"mappings":"AAaA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC"}
@@ -11,5 +11,6 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export * from './Panel';
14
+ export * from './PanelPluginLoader';
14
15
 
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Panel/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './Panel';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU"}
1
+ {"version":3,"sources":["../../../src/components/Panel/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './Panel';\nexport * from './PanelPluginLoader';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,sBAAsB"}
@@ -1,5 +1,6 @@
1
+ import { ReactElement } from 'react';
1
2
  /**
2
3
  * The Add/Edit panel drawer for editing a panel's options.
3
4
  */
4
- export declare const PanelDrawer: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const PanelDrawer: () => ReactElement;
5
6
  //# sourceMappingURL=PanelDrawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PanelDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/PanelDrawer/PanelDrawer.tsx"],"names":[],"mappings":"AAmBA;;GAEG;AACH,eAAO,MAAM,WAAW,+CA+CvB,CAAC"}
1
+ {"version":3,"file":"PanelDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/PanelDrawer/PanelDrawer.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAM/C;;GAEG;AACH,eAAO,MAAM,WAAW,QAAO,YAiD9B,CAAC"}
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { useState } from 'react';
15
- import { Drawer } from '@perses-dev/components';
15
+ import { Drawer, ErrorAlert, ErrorBoundary } from '@perses-dev/components';
16
16
  import { usePanelEditor } from '../../context';
17
17
  import { PanelEditorForm } from './PanelEditorForm';
18
18
  /**
@@ -36,7 +36,7 @@ import { PanelEditorForm } from './PanelEditorForm';
36
36
  };
37
37
  // Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state
38
38
  const handleExited = ()=>{
39
- panelEditor === null || panelEditor === void 0 ? void 0 : panelEditor.close();
39
+ panelEditor?.close();
40
40
  setIsClosing(false);
41
41
  };
42
42
  // Disables closing on click out. This is a quick-win solution to avoid losing draft changes.
@@ -50,11 +50,14 @@ import { PanelEditorForm } from './PanelEditorForm';
50
50
  onExited: handleExited
51
51
  },
52
52
  "data-testid": "panel-editor",
53
- children: panelEditor && /*#__PURE__*/ _jsx(PanelEditorForm, {
54
- initialAction: panelEditor.mode,
55
- initialValues: panelEditor.initialValues,
56
- onSave: handleSave,
57
- onClose: handleClose
53
+ children: panelEditor && /*#__PURE__*/ _jsx(ErrorBoundary, {
54
+ FallbackComponent: ErrorAlert,
55
+ children: /*#__PURE__*/ _jsx(PanelEditorForm, {
56
+ initialAction: panelEditor.mode,
57
+ initialValues: panelEditor.initialValues,
58
+ onSave: handleSave,
59
+ onClose: handleClose
60
+ })
58
61
  })
59
62
  });
60
63
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PanelDrawer/PanelDrawer.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Drawer } from '@perses-dev/components';\nimport { PanelEditorValues, usePanelEditor } from '../../context';\nimport { PanelEditorForm } from './PanelEditorForm';\n\n/**\n * The Add/Edit panel drawer for editing a panel's options.\n */\nexport const PanelDrawer = () => {\n const panelEditor = usePanelEditor();\n\n // When the user clicks close, start closing but don't call the store yet to keep values stable during animtation\n const [isClosing, setIsClosing] = useState(false);\n\n // Drawer is open if we have a model and we're not transitioning out\n const isOpen = panelEditor !== undefined && isClosing === false;\n\n function handleSave(values: PanelEditorValues) {\n // This shouldn't happen since we don't render the submit button until we have a model, but check to make TS happy\n if (panelEditor === undefined || values === undefined) {\n throw new Error('Cannot apply changes');\n }\n panelEditor.applyChanges(values);\n setIsClosing(true);\n }\n\n const handleClose = () => {\n setIsClosing(true);\n };\n\n // Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state\n const handleExited = () => {\n panelEditor?.close();\n setIsClosing(false);\n };\n\n // Disables closing on click out. This is a quick-win solution to avoid losing draft changes.\n // -> TODO find a way to enable closing by clicking-out in edit view, with a discard confirmation modal popping up\n const handleClickOut = () => {\n /* do nothing */\n };\n\n return (\n <Drawer isOpen={isOpen} onClose={handleClickOut} SlideProps={{ onExited: handleExited }} data-testid=\"panel-editor\">\n {/* When the drawer is opened, we should have panel editor state (this also ensures the form state gets reset between opens) */}\n {panelEditor && (\n <PanelEditorForm\n initialAction={panelEditor.mode}\n initialValues={panelEditor.initialValues}\n onSave={handleSave}\n onClose={handleClose}\n />\n )}\n </Drawer>\n );\n};\n"],"names":["useState","Drawer","usePanelEditor","PanelEditorForm","PanelDrawer","panelEditor","isClosing","setIsClosing","isOpen","undefined","handleSave","values","Error","applyChanges","handleClose","handleExited","close","handleClickOut","onClose","SlideProps","onExited","data-testid","initialAction","mode","initialValues","onSave"],"mappings":"AAAA,uDAAuD,GACvD,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAA4BC,cAAc,QAAQ,gBAAgB;AAClE,SAASC,eAAe,QAAQ,oBAAoB;AAEpD;;CAEC,GACD,OAAO,MAAMC,cAAc;IACzB,MAAMC,cAAcH;IAEpB,iHAAiH;IACjH,MAAM,CAACI,WAAWC,aAAa,GAAGP,SAAS;IAE3C,oEAAoE;IACpE,MAAMQ,SAASH,gBAAgBI,aAAaH,cAAc;IAE1D,SAASI,WAAWC,MAAyB;QAC3C,kHAAkH;QAClH,IAAIN,gBAAgBI,aAAaE,WAAWF,WAAW;YACrD,MAAM,IAAIG,MAAM;QAClB;QACAP,YAAYQ,YAAY,CAACF;QACzBJ,aAAa;IACf;IAEA,MAAMO,cAAc;QAClBP,aAAa;IACf;IAEA,6GAA6G;IAC7G,MAAMQ,eAAe;QACnBV,wBAAAA,kCAAAA,YAAaW,KAAK;QAClBT,aAAa;IACf;IAEA,6FAA6F;IAC7F,kHAAkH;IAClH,MAAMU,iBAAiB;IACrB,cAAc,GAChB;IAEA,qBACE,KAAChB;QAAOO,QAAQA;QAAQU,SAASD;QAAgBE,YAAY;YAAEC,UAAUL;QAAa;QAAGM,eAAY;kBAElGhB,6BACC,KAACF;YACCmB,eAAejB,YAAYkB,IAAI;YAC/BC,eAAenB,YAAYmB,aAAa;YACxCC,QAAQf;YACRQ,SAASJ;;;AAKnB,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/PanelDrawer/PanelDrawer.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\n// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useState } from 'react';\nimport { Drawer, ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { PanelEditorValues } from '@perses-dev/core';\nimport { usePanelEditor } from '../../context';\nimport { PanelEditorForm } from './PanelEditorForm';\n\n/**\n * The Add/Edit panel drawer for editing a panel's options.\n */\nexport const PanelDrawer = (): ReactElement => {\n const panelEditor = usePanelEditor();\n\n // When the user clicks close, start closing but don't call the store yet to keep values stable during animtation\n const [isClosing, setIsClosing] = useState(false);\n\n // Drawer is open if we have a model and we're not transitioning out\n const isOpen = panelEditor !== undefined && isClosing === false;\n\n function handleSave(values: PanelEditorValues): void {\n // This shouldn't happen since we don't render the submit button until we have a model, but check to make TS happy\n if (panelEditor === undefined || values === undefined) {\n throw new Error('Cannot apply changes');\n }\n panelEditor.applyChanges(values);\n setIsClosing(true);\n }\n\n const handleClose = (): void => {\n setIsClosing(true);\n };\n\n // Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state\n const handleExited = (): void => {\n panelEditor?.close();\n setIsClosing(false);\n };\n\n // Disables closing on click out. This is a quick-win solution to avoid losing draft changes.\n // -> TODO find a way to enable closing by clicking-out in edit view, with a discard confirmation modal popping up\n const handleClickOut = (): void => {\n /* do nothing */\n };\n\n return (\n <Drawer isOpen={isOpen} onClose={handleClickOut} SlideProps={{ onExited: handleExited }} data-testid=\"panel-editor\">\n {/* When the drawer is opened, we should have panel editor state (this also ensures the form state gets reset between opens) */}\n {panelEditor && (\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <PanelEditorForm\n initialAction={panelEditor.mode}\n initialValues={panelEditor.initialValues}\n onSave={handleSave}\n onClose={handleClose}\n />\n </ErrorBoundary>\n )}\n </Drawer>\n );\n};\n"],"names":["useState","Drawer","ErrorAlert","ErrorBoundary","usePanelEditor","PanelEditorForm","PanelDrawer","panelEditor","isClosing","setIsClosing","isOpen","undefined","handleSave","values","Error","applyChanges","handleClose","handleExited","close","handleClickOut","onClose","SlideProps","onExited","data-testid","FallbackComponent","initialAction","mode","initialValues","onSave"],"mappings":"AAAA,uDAAuD,GACvD,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAuBA,QAAQ,QAAQ,QAAQ;AAC/C,SAASC,MAAM,EAAEC,UAAU,EAAEC,aAAa,QAAQ,yBAAyB;AAE3E,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,eAAe,QAAQ,oBAAoB;AAEpD;;CAEC,GACD,OAAO,MAAMC,cAAc;IACzB,MAAMC,cAAcH;IAEpB,iHAAiH;IACjH,MAAM,CAACI,WAAWC,aAAa,GAAGT,SAAS;IAE3C,oEAAoE;IACpE,MAAMU,SAASH,gBAAgBI,aAAaH,cAAc;IAE1D,SAASI,WAAWC,MAAyB;QAC3C,kHAAkH;QAClH,IAAIN,gBAAgBI,aAAaE,WAAWF,WAAW;YACrD,MAAM,IAAIG,MAAM;QAClB;QACAP,YAAYQ,YAAY,CAACF;QACzBJ,aAAa;IACf;IAEA,MAAMO,cAAc;QAClBP,aAAa;IACf;IAEA,6GAA6G;IAC7G,MAAMQ,eAAe;QACnBV,aAAaW;QACbT,aAAa;IACf;IAEA,6FAA6F;IAC7F,kHAAkH;IAClH,MAAMU,iBAAiB;IACrB,cAAc,GAChB;IAEA,qBACE,KAAClB;QAAOS,QAAQA;QAAQU,SAASD;QAAgBE,YAAY;YAAEC,UAAUL;QAAa;QAAGM,eAAY;kBAElGhB,6BACC,KAACJ;YAAcqB,mBAAmBtB;sBAChC,cAAA,KAACG;gBACCoB,eAAelB,YAAYmB,IAAI;gBAC/BC,eAAepB,YAAYoB,aAAa;gBACxCC,QAAQhB;gBACRQ,SAASJ;;;;AAMrB,EAAE"}
@@ -1,12 +1,12 @@
1
- import { Action } from '@perses-dev/core';
2
- import { PanelEditorValues } from '../../context/DashboardProvider/panel-editor-slice';
1
+ import { ReactElement } from 'react';
2
+ import { Action, PanelEditorValues } from '@perses-dev/core';
3
3
  export interface PanelEditorFormProps {
4
4
  initialValues: PanelEditorValues;
5
5
  initialAction: Action;
6
6
  onSave: (values: PanelEditorValues) => void;
7
7
  onClose: () => void;
8
8
  }
9
- export declare function PanelEditorForm(props: PanelEditorFormProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function PanelEditorForm(props: PanelEditorFormProps): ReactElement;
10
10
  /**
11
11
  * The `id` attribute added to the `PanelEditorForm` component, allowing submit buttons to live outside the form.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"PanelEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelDrawer/PanelEditorForm.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAmB,MAAM,kBAAkB,CAAC;AAY3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AAKvF,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,iBAAiB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAwN1D;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"PanelEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/PanelDrawer/PanelEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAuB,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAmB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAgB9E,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,iBAAiB,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,YAAY,CA8NzE;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC"}