@perses-dev/dashboards 0.0.0-snapshot-time-range-height-80d08fc

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 (372) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/components/Dashboard/Dashboard.js +37 -0
  3. package/dist/cjs/components/Dashboard/index.js +28 -0
  4. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +176 -0
  5. package/dist/cjs/components/DashboardToolbar/index.js +28 -0
  6. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +92 -0
  7. package/dist/cjs/components/DeletePanelDialog/index.js +28 -0
  8. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +88 -0
  9. package/dist/cjs/components/DeletePanelGroupDialog/index.js +28 -0
  10. package/dist/cjs/components/DownloadButton/DownloadButton.js +109 -0
  11. package/dist/cjs/components/DownloadButton/index.js +28 -0
  12. package/dist/cjs/components/GridLayout/GridContainer.js +219 -0
  13. package/dist/cjs/components/GridLayout/GridItemContent.js +41 -0
  14. package/dist/cjs/components/GridLayout/GridLayout.js +104 -0
  15. package/dist/cjs/components/GridLayout/GridTitle.js +100 -0
  16. package/dist/cjs/components/GridLayout/index.js +29 -0
  17. package/dist/cjs/components/Panel/Panel.js +123 -0
  18. package/dist/cjs/components/Panel/Panel.test.js +129 -0
  19. package/dist/cjs/components/Panel/PanelContent.js +44 -0
  20. package/dist/cjs/components/Panel/PanelHeader.js +120 -0
  21. package/dist/cjs/components/Panel/index.js +28 -0
  22. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +98 -0
  23. package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +131 -0
  24. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +202 -0
  25. package/dist/cjs/components/PanelDrawer/PanelPreview.js +47 -0
  26. package/dist/cjs/components/PanelDrawer/index.js +28 -0
  27. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +101 -0
  28. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +87 -0
  29. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +92 -0
  30. package/dist/cjs/components/PanelGroupDialog/index.js +28 -0
  31. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +136 -0
  32. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +95 -0
  33. package/dist/cjs/components/TimeRangeControls/index.js +28 -0
  34. package/dist/cjs/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +67 -0
  35. package/dist/cjs/components/UnsavedChangesConfirmationDialog/index.js +28 -0
  36. package/dist/cjs/components/Variables/Variable.js +194 -0
  37. package/dist/cjs/components/Variables/VariableEditor.js +276 -0
  38. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +459 -0
  39. package/dist/cjs/components/Variables/VariableEditorForm/index.js +28 -0
  40. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +89 -0
  41. package/dist/cjs/components/Variables/VariableList.js +150 -0
  42. package/dist/cjs/components/Variables/index.js +30 -0
  43. package/dist/cjs/components/Variables/variable-model.js +117 -0
  44. package/dist/cjs/components/Variables/variable-model.test.js +106 -0
  45. package/dist/cjs/components/index.js +39 -0
  46. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +95 -0
  47. package/dist/cjs/context/DashboardProvider/common.js +28 -0
  48. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +191 -0
  49. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +70 -0
  50. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +85 -0
  51. package/dist/cjs/context/DashboardProvider/index.js +29 -0
  52. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +205 -0
  53. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +85 -0
  54. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +113 -0
  55. package/dist/cjs/context/DashboardProvider/panel-slice.js +25 -0
  56. package/dist/cjs/context/DatasourceStoreProvider.js +170 -0
  57. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +228 -0
  58. package/dist/cjs/context/TemplateVariableProvider/index.js +28 -0
  59. package/dist/cjs/context/TemplateVariableProvider/query-params.js +81 -0
  60. package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +82 -0
  61. package/dist/cjs/context/index.js +31 -0
  62. package/dist/cjs/context/useDashboard.js +94 -0
  63. package/dist/cjs/index.js +30 -0
  64. package/dist/cjs/test/dashboard-provider.js +51 -0
  65. package/dist/cjs/test/index.js +30 -0
  66. package/dist/cjs/test/plugin-registry.js +42 -0
  67. package/dist/cjs/test/render.js +62 -0
  68. package/dist/cjs/test/setup-tests.js +23 -0
  69. package/dist/cjs/test/testDashboard.js +293 -0
  70. package/dist/cjs/utils/functions.js +23 -0
  71. package/dist/cjs/views/ViewDashboard/DashboardApp.js +96 -0
  72. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +68 -0
  73. package/dist/cjs/views/ViewDashboard/index.js +28 -0
  74. package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +110 -0
  75. package/dist/cjs/views/index.js +28 -0
  76. package/dist/components/Dashboard/Dashboard.d.ts +8 -0
  77. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -0
  78. package/dist/components/Dashboard/Dashboard.js +33 -0
  79. package/dist/components/Dashboard/Dashboard.js.map +1 -0
  80. package/dist/components/Dashboard/index.d.ts +2 -0
  81. package/dist/components/Dashboard/index.d.ts.map +1 -0
  82. package/dist/components/Dashboard/index.js +15 -0
  83. package/dist/components/Dashboard/index.js.map +1 -0
  84. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +11 -0
  85. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -0
  86. package/dist/components/DashboardToolbar/DashboardToolbar.js +165 -0
  87. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -0
  88. package/dist/components/DashboardToolbar/index.d.ts +2 -0
  89. package/dist/components/DashboardToolbar/index.d.ts.map +1 -0
  90. package/dist/components/DashboardToolbar/index.js +15 -0
  91. package/dist/components/DashboardToolbar/index.js.map +1 -0
  92. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +3 -0
  93. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -0
  94. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +81 -0
  95. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -0
  96. package/dist/components/DeletePanelDialog/index.d.ts +2 -0
  97. package/dist/components/DeletePanelDialog/index.d.ts.map +1 -0
  98. package/dist/components/DeletePanelDialog/index.js +15 -0
  99. package/dist/components/DeletePanelDialog/index.js.map +1 -0
  100. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +3 -0
  101. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -0
  102. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +77 -0
  103. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -0
  104. package/dist/components/DeletePanelGroupDialog/index.d.ts +2 -0
  105. package/dist/components/DeletePanelGroupDialog/index.d.ts.map +1 -0
  106. package/dist/components/DeletePanelGroupDialog/index.js +15 -0
  107. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -0
  108. package/dist/components/DownloadButton/DownloadButton.d.ts +3 -0
  109. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -0
  110. package/dist/components/DownloadButton/DownloadButton.js +60 -0
  111. package/dist/components/DownloadButton/DownloadButton.js.map +1 -0
  112. package/dist/components/DownloadButton/index.d.ts +2 -0
  113. package/dist/components/DownloadButton/index.d.ts.map +1 -0
  114. package/dist/components/DownloadButton/index.js +15 -0
  115. package/dist/components/DownloadButton/index.js.map +1 -0
  116. package/dist/components/GridLayout/GridContainer.d.ts +6 -0
  117. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -0
  118. package/dist/components/GridLayout/GridContainer.js +213 -0
  119. package/dist/components/GridLayout/GridContainer.js.map +1 -0
  120. package/dist/components/GridLayout/GridItemContent.d.ts +10 -0
  121. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -0
  122. package/dist/components/GridLayout/GridItemContent.js +37 -0
  123. package/dist/components/GridLayout/GridItemContent.js.map +1 -0
  124. package/dist/components/GridLayout/GridLayout.d.ts +10 -0
  125. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -0
  126. package/dist/components/GridLayout/GridLayout.js +100 -0
  127. package/dist/components/GridLayout/GridLayout.js.map +1 -0
  128. package/dist/components/GridLayout/GridTitle.d.ts +16 -0
  129. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -0
  130. package/dist/components/GridLayout/GridTitle.js +92 -0
  131. package/dist/components/GridLayout/GridTitle.js.map +1 -0
  132. package/dist/components/GridLayout/index.d.ts +3 -0
  133. package/dist/components/GridLayout/index.d.ts.map +1 -0
  134. package/dist/components/GridLayout/index.js +16 -0
  135. package/dist/components/GridLayout/index.js.map +1 -0
  136. package/dist/components/Panel/Panel.d.ts +13 -0
  137. package/dist/components/Panel/Panel.d.ts.map +1 -0
  138. package/dist/components/Panel/Panel.js +114 -0
  139. package/dist/components/Panel/Panel.js.map +1 -0
  140. package/dist/components/Panel/Panel.test.d.ts +2 -0
  141. package/dist/components/Panel/Panel.test.d.ts.map +1 -0
  142. package/dist/components/Panel/Panel.test.js +122 -0
  143. package/dist/components/Panel/Panel.test.js.map +1 -0
  144. package/dist/components/Panel/PanelContent.d.ts +12 -0
  145. package/dist/components/Panel/PanelContent.d.ts.map +1 -0
  146. package/dist/components/Panel/PanelContent.js +41 -0
  147. package/dist/components/Panel/PanelContent.js.map +1 -0
  148. package/dist/components/Panel/PanelHeader.d.ts +16 -0
  149. package/dist/components/Panel/PanelHeader.d.ts.map +1 -0
  150. package/dist/components/Panel/PanelHeader.js +109 -0
  151. package/dist/components/Panel/PanelHeader.js.map +1 -0
  152. package/dist/components/Panel/index.d.ts +2 -0
  153. package/dist/components/Panel/index.d.ts.map +1 -0
  154. package/dist/components/Panel/index.js +15 -0
  155. package/dist/components/Panel/index.js.map +1 -0
  156. package/dist/components/PanelDrawer/PanelDrawer.d.ts +6 -0
  157. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -0
  158. package/dist/components/PanelDrawer/PanelDrawer.js +94 -0
  159. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -0
  160. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +2 -0
  161. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +1 -0
  162. package/dist/components/PanelDrawer/PanelDrawer.test.js +124 -0
  163. package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -0
  164. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +12 -0
  165. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -0
  166. package/dist/components/PanelDrawer/PanelEditorForm.js +192 -0
  167. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -0
  168. package/dist/components/PanelDrawer/PanelPreview.d.ts +4 -0
  169. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -0
  170. package/dist/components/PanelDrawer/PanelPreview.js +41 -0
  171. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -0
  172. package/dist/components/PanelDrawer/index.d.ts +2 -0
  173. package/dist/components/PanelDrawer/index.d.ts.map +1 -0
  174. package/dist/components/PanelDrawer/index.js +15 -0
  175. package/dist/components/PanelDrawer/index.js.map +1 -0
  176. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +6 -0
  177. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -0
  178. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +92 -0
  179. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -0
  180. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +2 -0
  181. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +1 -0
  182. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +80 -0
  183. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -0
  184. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +12 -0
  185. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -0
  186. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +82 -0
  187. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -0
  188. package/dist/components/PanelGroupDialog/index.d.ts +2 -0
  189. package/dist/components/PanelGroupDialog/index.d.ts.map +1 -0
  190. package/dist/components/PanelGroupDialog/index.js +15 -0
  191. package/dist/components/PanelGroupDialog/index.js.map +1 -0
  192. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +9 -0
  193. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
  194. package/dist/components/TimeRangeControls/TimeRangeControls.js +119 -0
  195. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
  196. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +2 -0
  197. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +1 -0
  198. package/dist/components/TimeRangeControls/TimeRangeControls.test.js +88 -0
  199. package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -0
  200. package/dist/components/TimeRangeControls/index.d.ts +2 -0
  201. package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
  202. package/dist/components/TimeRangeControls/index.js +15 -0
  203. package/dist/components/TimeRangeControls/index.js.map +1 -0
  204. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts +8 -0
  205. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.d.ts.map +1 -0
  206. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js +56 -0
  207. package/dist/components/UnsavedChangesConfirmationDialog/UnsavedChangesConfirmationDialog.js.map +1 -0
  208. package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts +2 -0
  209. package/dist/components/UnsavedChangesConfirmationDialog/index.d.ts.map +1 -0
  210. package/dist/components/UnsavedChangesConfirmationDialog/index.js +15 -0
  211. package/dist/components/UnsavedChangesConfirmationDialog/index.js.map +1 -0
  212. package/dist/components/Variables/Variable.d.ts +8 -0
  213. package/dist/components/Variables/Variable.d.ts.map +1 -0
  214. package/dist/components/Variables/Variable.js +188 -0
  215. package/dist/components/Variables/Variable.js.map +1 -0
  216. package/dist/components/Variables/VariableEditor.d.ts +8 -0
  217. package/dist/components/Variables/VariableEditor.d.ts.map +1 -0
  218. package/dist/components/Variables/VariableEditor.js +265 -0
  219. package/dist/components/Variables/VariableEditor.js.map +1 -0
  220. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +8 -0
  221. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -0
  222. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +409 -0
  223. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -0
  224. package/dist/components/Variables/VariableEditorForm/index.d.ts +2 -0
  225. package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -0
  226. package/dist/components/Variables/VariableEditorForm/index.js +15 -0
  227. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -0
  228. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +22 -0
  229. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -0
  230. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +77 -0
  231. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -0
  232. package/dist/components/Variables/VariableList.d.ts +9 -0
  233. package/dist/components/Variables/VariableList.d.ts.map +1 -0
  234. package/dist/components/Variables/VariableList.js +100 -0
  235. package/dist/components/Variables/VariableList.js.map +1 -0
  236. package/dist/components/Variables/index.d.ts +4 -0
  237. package/dist/components/Variables/index.d.ts.map +1 -0
  238. package/dist/components/Variables/index.js +17 -0
  239. package/dist/components/Variables/index.js.map +1 -0
  240. package/dist/components/Variables/variable-model.d.ts +16 -0
  241. package/dist/components/Variables/variable-model.d.ts.map +1 -0
  242. package/dist/components/Variables/variable-model.js +105 -0
  243. package/dist/components/Variables/variable-model.js.map +1 -0
  244. package/dist/components/Variables/variable-model.test.d.ts +2 -0
  245. package/dist/components/Variables/variable-model.test.d.ts.map +1 -0
  246. package/dist/components/Variables/variable-model.test.js +104 -0
  247. package/dist/components/Variables/variable-model.test.js.map +1 -0
  248. package/dist/components/index.d.ts +13 -0
  249. package/dist/components/index.d.ts.map +1 -0
  250. package/dist/components/index.js +26 -0
  251. package/dist/components/index.js.map +1 -0
  252. package/dist/context/DashboardProvider/DashboardProvider.d.ts +28 -0
  253. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -0
  254. package/dist/context/DashboardProvider/DashboardProvider.js +77 -0
  255. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -0
  256. package/dist/context/DashboardProvider/common.d.ts +12 -0
  257. package/dist/context/DashboardProvider/common.d.ts.map +1 -0
  258. package/dist/context/DashboardProvider/common.js +24 -0
  259. package/dist/context/DashboardProvider/common.js.map +1 -0
  260. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +74 -0
  261. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -0
  262. package/dist/context/DashboardProvider/dashboard-provider-api.js +190 -0
  263. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -0
  264. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +23 -0
  265. package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -0
  266. package/dist/context/DashboardProvider/delete-panel-group-slice.js +64 -0
  267. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -0
  268. package/dist/context/DashboardProvider/delete-panel-slice.d.ts +36 -0
  269. package/dist/context/DashboardProvider/delete-panel-slice.d.ts.map +1 -0
  270. package/dist/context/DashboardProvider/delete-panel-slice.js +81 -0
  271. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -0
  272. package/dist/context/DashboardProvider/index.d.ts +7 -0
  273. package/dist/context/DashboardProvider/index.d.ts.map +1 -0
  274. package/dist/context/DashboardProvider/index.js +16 -0
  275. package/dist/context/DashboardProvider/index.js.map +1 -0
  276. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +56 -0
  277. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -0
  278. package/dist/context/DashboardProvider/panel-editor-slice.js +201 -0
  279. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -0
  280. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +33 -0
  281. package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -0
  282. package/dist/context/DashboardProvider/panel-group-editor-slice.js +79 -0
  283. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -0
  284. package/dist/context/DashboardProvider/panel-group-slice.d.ts +59 -0
  285. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -0
  286. package/dist/context/DashboardProvider/panel-group-slice.js +105 -0
  287. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -0
  288. package/dist/context/DashboardProvider/panel-slice.d.ts +14 -0
  289. package/dist/context/DashboardProvider/panel-slice.d.ts.map +1 -0
  290. package/dist/context/DashboardProvider/panel-slice.js +21 -0
  291. package/dist/context/DashboardProvider/panel-slice.js.map +1 -0
  292. package/dist/context/DatasourceStoreProvider.d.ts +24 -0
  293. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -0
  294. package/dist/context/DatasourceStoreProvider.js +166 -0
  295. package/dist/context/DatasourceStoreProvider.js.map +1 -0
  296. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +30 -0
  297. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -0
  298. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +212 -0
  299. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -0
  300. package/dist/context/TemplateVariableProvider/index.d.ts +2 -0
  301. package/dist/context/TemplateVariableProvider/index.d.ts.map +1 -0
  302. package/dist/context/TemplateVariableProvider/index.js +15 -0
  303. package/dist/context/TemplateVariableProvider/index.js.map +1 -0
  304. package/dist/context/TemplateVariableProvider/query-params.d.ts +12 -0
  305. package/dist/context/TemplateVariableProvider/query-params.d.ts.map +1 -0
  306. package/dist/context/TemplateVariableProvider/query-params.js +66 -0
  307. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -0
  308. package/dist/context/TemplateVariableProvider/query-params.test.d.ts +2 -0
  309. package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +1 -0
  310. package/dist/context/TemplateVariableProvider/query-params.test.js +80 -0
  311. package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -0
  312. package/dist/context/index.d.ts +5 -0
  313. package/dist/context/index.d.ts.map +1 -0
  314. package/dist/context/index.js +18 -0
  315. package/dist/context/index.js.map +1 -0
  316. package/dist/context/useDashboard.d.ts +6 -0
  317. package/dist/context/useDashboard.d.ts.map +1 -0
  318. package/dist/context/useDashboard.js +88 -0
  319. package/dist/context/useDashboard.js.map +1 -0
  320. package/dist/index.d.ts +4 -0
  321. package/dist/index.d.ts.map +1 -0
  322. package/dist/index.js +17 -0
  323. package/dist/index.js.map +1 -0
  324. package/dist/test/dashboard-provider.d.ts +19 -0
  325. package/dist/test/dashboard-provider.d.ts.map +1 -0
  326. package/dist/test/dashboard-provider.js +40 -0
  327. package/dist/test/dashboard-provider.js.map +1 -0
  328. package/dist/test/index.d.ts +4 -0
  329. package/dist/test/index.d.ts.map +1 -0
  330. package/dist/test/index.js +17 -0
  331. package/dist/test/index.js.map +1 -0
  332. package/dist/test/plugin-registry.d.ts +3 -0
  333. package/dist/test/plugin-registry.d.ts.map +1 -0
  334. package/dist/test/plugin-registry.js +37 -0
  335. package/dist/test/plugin-registry.js.map +1 -0
  336. package/dist/test/render.d.ts +8 -0
  337. package/dist/test/render.d.ts.map +1 -0
  338. package/dist/test/render.js +58 -0
  339. package/dist/test/render.js.map +1 -0
  340. package/dist/test/setup-tests.d.ts +2 -0
  341. package/dist/test/setup-tests.d.ts.map +1 -0
  342. package/dist/test/setup-tests.js +22 -0
  343. package/dist/test/setup-tests.js.map +1 -0
  344. package/dist/test/testDashboard.d.ts +4 -0
  345. package/dist/test/testDashboard.d.ts.map +1 -0
  346. package/dist/test/testDashboard.js +287 -0
  347. package/dist/test/testDashboard.js.map +1 -0
  348. package/dist/utils/functions.d.ts +2 -0
  349. package/dist/utils/functions.d.ts.map +1 -0
  350. package/dist/utils/functions.js +17 -0
  351. package/dist/utils/functions.js.map +1 -0
  352. package/dist/views/ViewDashboard/DashboardApp.d.ts +10 -0
  353. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -0
  354. package/dist/views/ViewDashboard/DashboardApp.js +90 -0
  355. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -0
  356. package/dist/views/ViewDashboard/ViewDashboard.d.ts +16 -0
  357. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -0
  358. package/dist/views/ViewDashboard/ViewDashboard.js +64 -0
  359. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -0
  360. package/dist/views/ViewDashboard/index.d.ts +2 -0
  361. package/dist/views/ViewDashboard/index.d.ts.map +1 -0
  362. package/dist/views/ViewDashboard/index.js +15 -0
  363. package/dist/views/ViewDashboard/index.js.map +1 -0
  364. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +2 -0
  365. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +1 -0
  366. package/dist/views/ViewDashboard/tests/panelGroups.test.js +103 -0
  367. package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -0
  368. package/dist/views/index.d.ts +2 -0
  369. package/dist/views/index.d.ts.map +1 -0
  370. package/dist/views/index.js +15 -0
  371. package/dist/views/index.js.map +1 -0
  372. package/package.json +57 -0
@@ -0,0 +1,24 @@
1
+ // Copyright 2022 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
+ /**
14
+ * The middleware applied to the DashboardStore (can be used as generic argument in StateCreator).
15
+ */ /**
16
+ * Helper function to generate unique IDs for things in the dashboard store that don't have a "natural" ID.
17
+ */ export function generateId() {
18
+ if (globalThis.dashboardStoreId === undefined) {
19
+ globalThis.dashboardStoreId = 0;
20
+ }
21
+ return globalThis.dashboardStoreId++;
22
+ }
23
+
24
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/common.ts"],"sourcesContent":["// Copyright 2022 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\n/**\n * The middleware applied to the DashboardStore (can be used as generic argument in StateCreator).\n */\nexport type Middleware = [['zustand/immer', never], ['zustand/devtools', never]];\n\ndeclare global {\n // eslint-disable-next-line no-var\n var dashboardStoreId: number;\n}\n\n/**\n * Helper function to generate unique IDs for things in the dashboard store that don't have a \"natural\" ID.\n */\nexport function generateId() {\n if (globalThis.dashboardStoreId === undefined) {\n globalThis.dashboardStoreId = 0;\n }\n return globalThis.dashboardStoreId++;\n}\n"],"names":["generateId","globalThis","dashboardStoreId","undefined"],"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;;CAEC,GACD,AAOA;;CAEC,GACD,OAAO,SAASA,UAAU,GAAG;IAC3B,IAAIC,UAAU,CAACC,gBAAgB,KAAKC,SAAS,EAAE;QAC7CF,UAAU,CAACC,gBAAgB,GAAG,CAAC,CAAC;IAClC,CAAC;IACD,OAAOD,UAAU,CAACC,gBAAgB,EAAE,CAAC;AACvC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { PanelGroupItemId, PanelGroupId, PanelGroupItemLayout } from './panel-group-slice';
2
+ export declare function useEditMode(): {
3
+ isEditMode: boolean;
4
+ setEditMode: (isEditMode: boolean) => void;
5
+ };
6
+ /**
7
+ * Returns actions that can be performed on the current dashboard.
8
+ */
9
+ export declare function useDashboardActions(): {
10
+ setDashboard: (dashboard: import("@perses-dev/core").DashboardResource) => void;
11
+ openAddPanelGroup: () => void;
12
+ openAddPanel: () => void;
13
+ };
14
+ /**
15
+ * Returns an array of PanelGroupIds in the order they appear in the dashboard.
16
+ */
17
+ export declare function usePanelGroupIds(): number[];
18
+ /**
19
+ * Returns an array of PanelGroupDefinitions in the order they appear in the dashboard.
20
+ */
21
+ export declare function useListPanelGroups(): import("./panel-group-slice").PanelGroupDefinition[];
22
+ /**
23
+ * Gets a specific panel group by its id. Throws if the panel group does not exist.
24
+ */
25
+ export declare function usePanelGroup(panelGroupId: PanelGroupId): import("./panel-group-slice").PanelGroupDefinition;
26
+ /**
27
+ * Returns actions that can be performed on the given panel group.
28
+ */
29
+ export declare function usePanelGroupActions(panelGroupId: PanelGroupId): {
30
+ openEditPanelGroup: () => void;
31
+ deletePanelGroup: () => void;
32
+ openAddPanel: () => void;
33
+ moveUp: (() => void) | undefined;
34
+ moveDown: (() => void) | undefined;
35
+ updatePanelGroupLayouts: (itemLayouts: PanelGroupItemLayout[]) => void;
36
+ };
37
+ /**
38
+ * Gets the Panel Group editor state.
39
+ */
40
+ export declare function usePanelGroupEditor(): import("./panel-group-editor-slice").PanelGroupEditor | undefined;
41
+ /**
42
+ * Gets the Delete Panel Group dialog state.
43
+ */
44
+ export declare function useDeletePanelGroupDialog(): {
45
+ deletePanelGroupDialog: import("./delete-panel-group-slice").DeletePanelGroupDialogState | undefined;
46
+ deletePanelGroup: (panelGroupId: number) => void;
47
+ openDeletePanelGroupDialog: (panelGroupId: number) => void;
48
+ closeDeletePanelGroupDialog: () => void;
49
+ };
50
+ /**
51
+ * Gets an individual panel in the store. Throws if the panel can't be found.
52
+ */
53
+ export declare function usePanel(panelGroupItemId: PanelGroupItemId): import("@perses-dev/core").PanelDefinition<import("@perses-dev/core").UnknownSpec>;
54
+ /**
55
+ * Returns actions that can be performed on the given Panel.
56
+ */
57
+ export declare function usePanelActions(panelGroupItemId: PanelGroupItemId): {
58
+ openEditPanel: () => void;
59
+ openDeletePanelDialog: () => void;
60
+ };
61
+ /**
62
+ * Gets the state for the Panel Editor.
63
+ */
64
+ export declare function usePanelEditor(): import("./panel-editor-slice").PanelEditorState | undefined;
65
+ /**
66
+ * Gets the state for the Delete Panel dialog.
67
+ */
68
+ export declare function useDeletePanelDialog(): {
69
+ deletePanelDialog: import("./delete-panel-slice").DeletePanelDialogState | undefined;
70
+ deletePanel: (panelGroupItemId: PanelGroupItemId) => void;
71
+ closeDeletePanelDialog: () => void;
72
+ };
73
+ export declare function useDefaultTimeRange(): import("@perses-dev/core").RelativeTimeRange;
74
+ //# sourceMappingURL=dashboard-provider-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-provider-api.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/dashboard-provider-api.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG3F,wBAAgB,WAAW;;;EAE1B;AAOD;;GAEG;AACH,wBAAgB,mBAAmB;;;;EAOlC;AAGD;;GAEG;AACH,wBAAgB,gBAAgB,aAE/B;AAGD;;GAEG;AACH,wBAAgB,kBAAkB,yDAYjC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,sDAMvD;AAaD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY;;;;;;2CAWpB,oBAAoB,EAAE;EAGhE;AA4BD;;GAEG;AACH,wBAAgB,mBAAmB,sEAElC;AAaD;;GAEG;AACH,wBAAgB,yBAAyB;;;;;EASxC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,sFAiB1D;AAMD;;GAEG;AACH,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB;;;EAMjE;AAGD;;GAEG;AACH,wBAAgB,cAAc,gEAE7B;AAQD;;GAEG;AACH,wBAAgB,oBAAoB;;;;EAGnC;AAGD,wBAAgB,mBAAmB,iDAElC"}
@@ -0,0 +1,190 @@
1
+ // Copyright 2022 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 { useCallback, useMemo } from 'react';
14
+ import { useDashboardStore } from './DashboardProvider';
15
+ const selectEditMode = ({ isEditMode , setEditMode })=>({
16
+ isEditMode,
17
+ setEditMode
18
+ });
19
+ export function useEditMode() {
20
+ return useDashboardStore(selectEditMode);
21
+ }
22
+ const selectDashboardActions = ({ setDashboard , openAddPanelGroup , openAddPanel })=>({
23
+ setDashboard,
24
+ openAddPanelGroup,
25
+ openAddPanel
26
+ });
27
+ /**
28
+ * Returns actions that can be performed on the current dashboard.
29
+ */ export function useDashboardActions() {
30
+ const { setDashboard , openAddPanelGroup , openAddPanel } = useDashboardStore(selectDashboardActions);
31
+ return {
32
+ setDashboard,
33
+ openAddPanelGroup: ()=>openAddPanelGroup(),
34
+ openAddPanel: ()=>openAddPanel()
35
+ };
36
+ }
37
+ const selectPanelGroupOrder = (state)=>state.panelGroupOrder;
38
+ /**
39
+ * Returns an array of PanelGroupIds in the order they appear in the dashboard.
40
+ */ export function usePanelGroupIds() {
41
+ return useDashboardStore(selectPanelGroupOrder);
42
+ }
43
+ const selectPanelGroups = (state)=>state.panelGroups;
44
+ /**
45
+ * Returns an array of PanelGroupDefinitions in the order they appear in the dashboard.
46
+ */ export function useListPanelGroups() {
47
+ const panelGroupIds = usePanelGroupIds();
48
+ const panelGroups = useDashboardStore(selectPanelGroups);
49
+ return useMemo(()=>{
50
+ return panelGroupIds.map((id)=>{
51
+ const group = panelGroups[id];
52
+ if (group === undefined) {
53
+ throw new Error(`Invalid panel group Id found ${id}`);
54
+ }
55
+ return group;
56
+ });
57
+ }, [
58
+ panelGroupIds,
59
+ panelGroups
60
+ ]);
61
+ }
62
+ /**
63
+ * Gets a specific panel group by its id. Throws if the panel group does not exist.
64
+ */ export function usePanelGroup(panelGroupId) {
65
+ const panelGroup = useDashboardStore(useCallback((state)=>state.panelGroups[panelGroupId], [
66
+ panelGroupId
67
+ ]));
68
+ if (panelGroup === undefined) {
69
+ throw new Error(`Panel group with Id ${panelGroupId} was not found`);
70
+ }
71
+ return panelGroup;
72
+ }
73
+ const selectPanelGroupActions = ({ openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts })=>({
74
+ openEditPanelGroup,
75
+ deletePanelGroup,
76
+ openAddPanel,
77
+ updatePanelGroupLayouts
78
+ });
79
+ /**
80
+ * Returns actions that can be performed on the given panel group.
81
+ */ export function usePanelGroupActions(panelGroupId) {
82
+ const { moveUp , moveDown } = useMovePanelGroup(panelGroupId);
83
+ const { openEditPanelGroup , deletePanelGroup , openAddPanel , updatePanelGroupLayouts } = useDashboardStore(selectPanelGroupActions);
84
+ return {
85
+ openEditPanelGroup: ()=>openEditPanelGroup(panelGroupId),
86
+ deletePanelGroup: ()=>deletePanelGroup(panelGroupId),
87
+ openAddPanel: ()=>openAddPanel(panelGroupId),
88
+ moveUp,
89
+ moveDown,
90
+ updatePanelGroupLayouts: (itemLayouts)=>updatePanelGroupLayouts(panelGroupId, itemLayouts)
91
+ };
92
+ }
93
+ const selectSwapPanelGroups = (state)=>state.swapPanelGroups;
94
+ const selectPanelGroupsLength = (state)=>state.panelGroupOrder.length;
95
+ /**
96
+ * Returns functions for moving a panel group up or down. A function will be undefined if the panel group can't be
97
+ * moved in that direction.
98
+ */ function useMovePanelGroup(panelGroupId) {
99
+ const currentIndex = useDashboardStore(useCallback((store)=>store.panelGroupOrder.findIndex((id)=>id === panelGroupId), [
100
+ panelGroupId
101
+ ]));
102
+ const panelGroupsLength = useDashboardStore(selectPanelGroupsLength);
103
+ const swapPanelGroups = useDashboardStore(selectSwapPanelGroups);
104
+ if (currentIndex < 0) {
105
+ throw new Error(`Could not find panel group with Id ${panelGroupId} in order array`);
106
+ }
107
+ const moveUp = ()=>swapPanelGroups(currentIndex, currentIndex - 1);
108
+ const moveDown = ()=>swapPanelGroups(currentIndex, currentIndex + 1);
109
+ return {
110
+ moveUp: currentIndex > 0 ? moveUp : undefined,
111
+ moveDown: currentIndex < panelGroupsLength - 1 ? moveDown : undefined
112
+ };
113
+ }
114
+ const selectPanelGroupEditor = (state)=>state.panelGroupEditor;
115
+ /**
116
+ * Gets the Panel Group editor state.
117
+ */ export function usePanelGroupEditor() {
118
+ return useDashboardStore(selectPanelGroupEditor);
119
+ }
120
+ const selectDeletePanelGroupDialog = ({ deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup })=>({
121
+ deletePanelGroupDialog,
122
+ openDeletePanelGroupDialog,
123
+ closeDeletePanelGroupDialog,
124
+ deletePanelGroup
125
+ });
126
+ /**
127
+ * Gets the Delete Panel Group dialog state.
128
+ */ export function useDeletePanelGroupDialog() {
129
+ const { deletePanelGroupDialog , openDeletePanelGroupDialog , closeDeletePanelGroupDialog , deletePanelGroup } = useDashboardStore(selectDeletePanelGroupDialog);
130
+ return {
131
+ deletePanelGroupDialog,
132
+ deletePanelGroup,
133
+ openDeletePanelGroupDialog,
134
+ closeDeletePanelGroupDialog: ()=>closeDeletePanelGroupDialog()
135
+ };
136
+ }
137
+ /**
138
+ * Gets an individual panel in the store. Throws if the panel can't be found.
139
+ */ export function usePanel(panelGroupItemId) {
140
+ const { panelGroupId , panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
141
+ const panel = useDashboardStore(useCallback((store)=>{
142
+ var ref;
143
+ const panelKey = (ref = store.panelGroups[panelGroupId]) === null || ref === void 0 ? void 0 : ref.itemPanelKeys[panelGroupLayoutId];
144
+ if (panelKey === undefined) return;
145
+ return store.panels[panelKey];
146
+ }, [
147
+ panelGroupId,
148
+ panelGroupLayoutId
149
+ ]));
150
+ if (panel === undefined) {
151
+ throw new Error(`Could not find panel for Id ${panelGroupItemId}`);
152
+ }
153
+ return panel;
154
+ }
155
+ const selectPanelActions = ({ openEditPanel , openDeletePanelDialog })=>({
156
+ openEditPanel,
157
+ openDeletePanelDialog
158
+ });
159
+ /**
160
+ * Returns actions that can be performed on the given Panel.
161
+ */ export function usePanelActions(panelGroupItemId) {
162
+ const { openEditPanel , openDeletePanelDialog } = useDashboardStore(selectPanelActions);
163
+ return {
164
+ openEditPanel: ()=>openEditPanel(panelGroupItemId),
165
+ openDeletePanelDialog: ()=>openDeletePanelDialog(panelGroupItemId)
166
+ };
167
+ }
168
+ const selectPanelEditor = (state)=>state.panelEditor;
169
+ /**
170
+ * Gets the state for the Panel Editor.
171
+ */ export function usePanelEditor() {
172
+ return useDashboardStore(selectPanelEditor);
173
+ }
174
+ const selectDeletePanelDialog = ({ deletePanelDialog , deletePanel , closeDeletePanelDialog })=>({
175
+ deletePanelDialog,
176
+ deletePanel,
177
+ closeDeletePanelDialog
178
+ });
179
+ /**
180
+ * Gets the state for the Delete Panel dialog.
181
+ */ export function useDeletePanelDialog() {
182
+ // TODO: Refactor similar to other dialogs/editors so these are on the editor state itself
183
+ return useDashboardStore(selectDeletePanelDialog);
184
+ }
185
+ const selectDefaultTimeRange = (state)=>state.defaultTimeRange;
186
+ export function useDefaultTimeRange() {
187
+ return useDashboardStore(selectDefaultTimeRange);
188
+ }
189
+
190
+ //# sourceMappingURL=dashboard-provider-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/dashboard-provider-api.ts"],"sourcesContent":["// Copyright 2022 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 { useCallback, useMemo } from 'react';\nimport { DashboardStoreState, useDashboardStore } from './DashboardProvider';\nimport { PanelGroupItemId, PanelGroupId, PanelGroupItemLayout } from './panel-group-slice';\n\nconst selectEditMode = ({ isEditMode, setEditMode }: DashboardStoreState) => ({ isEditMode, setEditMode });\nexport function useEditMode() {\n return useDashboardStore(selectEditMode);\n}\n\nconst selectDashboardActions = ({ setDashboard, openAddPanelGroup, openAddPanel }: DashboardStoreState) => ({\n setDashboard,\n openAddPanelGroup,\n openAddPanel,\n});\n/**\n * Returns actions that can be performed on the current dashboard.\n */\nexport function useDashboardActions() {\n const { setDashboard, openAddPanelGroup, openAddPanel } = useDashboardStore(selectDashboardActions);\n return {\n setDashboard,\n openAddPanelGroup: () => openAddPanelGroup(),\n openAddPanel: () => openAddPanel(),\n };\n}\n\nconst selectPanelGroupOrder = (state: DashboardStoreState) => state.panelGroupOrder;\n/**\n * Returns an array of PanelGroupIds in the order they appear in the dashboard.\n */\nexport function usePanelGroupIds() {\n return useDashboardStore(selectPanelGroupOrder);\n}\n\nconst selectPanelGroups = (state: DashboardStoreState) => state.panelGroups;\n/**\n * Returns an array of PanelGroupDefinitions in the order they appear in the dashboard.\n */\nexport function useListPanelGroups() {\n const panelGroupIds = usePanelGroupIds();\n const panelGroups = useDashboardStore(selectPanelGroups);\n return useMemo(() => {\n return panelGroupIds.map((id) => {\n const group = panelGroups[id];\n if (group === undefined) {\n throw new Error(`Invalid panel group Id found ${id}`);\n }\n return group;\n });\n }, [panelGroupIds, panelGroups]);\n}\n\n/**\n * Gets a specific panel group by its id. Throws if the panel group does not exist.\n */\nexport function usePanelGroup(panelGroupId: PanelGroupId) {\n const panelGroup = useDashboardStore(useCallback((state) => state.panelGroups[panelGroupId], [panelGroupId]));\n if (panelGroup === undefined) {\n throw new Error(`Panel group with Id ${panelGroupId} was not found`);\n }\n return panelGroup;\n}\n\nconst selectPanelGroupActions = ({\n openEditPanelGroup,\n deletePanelGroup,\n openAddPanel,\n updatePanelGroupLayouts,\n}: DashboardStoreState) => ({\n openEditPanelGroup,\n deletePanelGroup,\n openAddPanel,\n updatePanelGroupLayouts,\n});\n/**\n * Returns actions that can be performed on the given panel group.\n */\nexport function usePanelGroupActions(panelGroupId: PanelGroupId) {\n const { moveUp, moveDown } = useMovePanelGroup(panelGroupId);\n const { openEditPanelGroup, deletePanelGroup, openAddPanel, updatePanelGroupLayouts } =\n useDashboardStore(selectPanelGroupActions);\n\n return {\n openEditPanelGroup: () => openEditPanelGroup(panelGroupId),\n deletePanelGroup: () => deletePanelGroup(panelGroupId),\n openAddPanel: () => openAddPanel(panelGroupId),\n moveUp,\n moveDown,\n updatePanelGroupLayouts: (itemLayouts: PanelGroupItemLayout[]) =>\n updatePanelGroupLayouts(panelGroupId, itemLayouts),\n };\n}\n\nconst selectSwapPanelGroups = (state: DashboardStoreState) => state.swapPanelGroups;\nconst selectPanelGroupsLength = (state: DashboardStoreState) => state.panelGroupOrder.length;\n/**\n * Returns functions for moving a panel group up or down. A function will be undefined if the panel group can't be\n * moved in that direction.\n */\nfunction useMovePanelGroup(panelGroupId: PanelGroupId) {\n const currentIndex = useDashboardStore(\n useCallback((store) => store.panelGroupOrder.findIndex((id) => id === panelGroupId), [panelGroupId])\n );\n const panelGroupsLength = useDashboardStore(selectPanelGroupsLength);\n const swapPanelGroups = useDashboardStore(selectSwapPanelGroups);\n\n if (currentIndex < 0) {\n throw new Error(`Could not find panel group with Id ${panelGroupId} in order array`);\n }\n\n const moveUp = () => swapPanelGroups(currentIndex, currentIndex - 1);\n const moveDown = () => swapPanelGroups(currentIndex, currentIndex + 1);\n return {\n moveUp: currentIndex > 0 ? moveUp : undefined,\n moveDown: currentIndex < panelGroupsLength - 1 ? moveDown : undefined,\n };\n}\n\nconst selectPanelGroupEditor = (state: DashboardStoreState) => state.panelGroupEditor;\n/**\n * Gets the Panel Group editor state.\n */\nexport function usePanelGroupEditor() {\n return useDashboardStore(selectPanelGroupEditor);\n}\n\nconst selectDeletePanelGroupDialog = ({\n deletePanelGroupDialog,\n openDeletePanelGroupDialog,\n closeDeletePanelGroupDialog,\n deletePanelGroup,\n}: DashboardStoreState) => ({\n deletePanelGroupDialog,\n openDeletePanelGroupDialog,\n closeDeletePanelGroupDialog,\n deletePanelGroup,\n});\n/**\n * Gets the Delete Panel Group dialog state.\n */\nexport function useDeletePanelGroupDialog() {\n const { deletePanelGroupDialog, openDeletePanelGroupDialog, closeDeletePanelGroupDialog, deletePanelGroup } =\n useDashboardStore(selectDeletePanelGroupDialog);\n return {\n deletePanelGroupDialog,\n deletePanelGroup,\n openDeletePanelGroupDialog,\n closeDeletePanelGroupDialog: () => closeDeletePanelGroupDialog(),\n };\n}\n\n/**\n * Gets an individual panel in the store. Throws if the panel can't be found.\n */\nexport function usePanel(panelGroupItemId: PanelGroupItemId) {\n const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;\n const panel = useDashboardStore(\n useCallback(\n (store) => {\n const panelKey = store.panelGroups[panelGroupId]?.itemPanelKeys[panelGroupLayoutId];\n if (panelKey === undefined) return;\n return store.panels[panelKey];\n },\n [panelGroupId, panelGroupLayoutId]\n )\n );\n\n if (panel === undefined) {\n throw new Error(`Could not find panel for Id ${panelGroupItemId}`);\n }\n return panel;\n}\n\nconst selectPanelActions = ({ openEditPanel, openDeletePanelDialog }: DashboardStoreState) => ({\n openEditPanel,\n openDeletePanelDialog,\n});\n/**\n * Returns actions that can be performed on the given Panel.\n */\nexport function usePanelActions(panelGroupItemId: PanelGroupItemId) {\n const { openEditPanel, openDeletePanelDialog } = useDashboardStore(selectPanelActions);\n return {\n openEditPanel: () => openEditPanel(panelGroupItemId),\n openDeletePanelDialog: () => openDeletePanelDialog(panelGroupItemId),\n };\n}\n\nconst selectPanelEditor = (state: DashboardStoreState) => state.panelEditor;\n/**\n * Gets the state for the Panel Editor.\n */\nexport function usePanelEditor() {\n return useDashboardStore(selectPanelEditor);\n}\n\nconst selectDeletePanelDialog = ({ deletePanelDialog, deletePanel, closeDeletePanelDialog }: DashboardStoreState) => ({\n deletePanelDialog,\n deletePanel,\n closeDeletePanelDialog,\n});\n\n/**\n * Gets the state for the Delete Panel dialog.\n */\nexport function useDeletePanelDialog() {\n // TODO: Refactor similar to other dialogs/editors so these are on the editor state itself\n return useDashboardStore(selectDeletePanelDialog);\n}\n\nconst selectDefaultTimeRange = (state: DashboardStoreState) => state.defaultTimeRange;\nexport function useDefaultTimeRange() {\n return useDashboardStore(selectDefaultTimeRange);\n}\n"],"names":["useCallback","useMemo","useDashboardStore","selectEditMode","isEditMode","setEditMode","useEditMode","selectDashboardActions","setDashboard","openAddPanelGroup","openAddPanel","useDashboardActions","selectPanelGroupOrder","state","panelGroupOrder","usePanelGroupIds","selectPanelGroups","panelGroups","useListPanelGroups","panelGroupIds","map","id","group","undefined","Error","usePanelGroup","panelGroupId","panelGroup","selectPanelGroupActions","openEditPanelGroup","deletePanelGroup","updatePanelGroupLayouts","usePanelGroupActions","moveUp","moveDown","useMovePanelGroup","itemLayouts","selectSwapPanelGroups","swapPanelGroups","selectPanelGroupsLength","length","currentIndex","store","findIndex","panelGroupsLength","selectPanelGroupEditor","panelGroupEditor","usePanelGroupEditor","selectDeletePanelGroupDialog","deletePanelGroupDialog","openDeletePanelGroupDialog","closeDeletePanelGroupDialog","useDeletePanelGroupDialog","usePanel","panelGroupItemId","panelGroupItemLayoutId","panelGroupLayoutId","panel","panelKey","itemPanelKeys","panels","selectPanelActions","openEditPanel","openDeletePanelDialog","usePanelActions","selectPanelEditor","panelEditor","usePanelEditor","selectDeletePanelDialog","deletePanelDialog","deletePanel","closeDeletePanelDialog","useDeletePanelDialog","selectDefaultTimeRange","defaultTimeRange","useDefaultTimeRange"],"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,WAAW,EAAEC,OAAO,QAAQ,OAAO,CAAC;AAC7C,SAA8BC,iBAAiB,QAAQ,qBAAqB,CAAC;AAG7E,MAAMC,cAAc,GAAG,CAAC,EAAEC,UAAU,CAAA,EAAEC,WAAW,CAAA,EAAuB,GAAM,CAAA;QAAED,UAAU;QAAEC,WAAW;KAAE,CAAA,AAAC,AAAC;AAC3G,OAAO,SAASC,WAAW,GAAG;IAC5B,OAAOJ,iBAAiB,CAACC,cAAc,CAAC,CAAC;AAC3C,CAAC;AAED,MAAMI,sBAAsB,GAAG,CAAC,EAAEC,YAAY,CAAA,EAAEC,iBAAiB,CAAA,EAAEC,YAAY,CAAA,EAAuB,GAAM,CAAA;QAC1GF,YAAY;QACZC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AAK,CAAC;AACf,CAAC;AAED,MAAMI,kBAAkB,GAAG,CAAC,EAAEC,aAAa,CAAA,EAAEC,qBAAqB,CAAA,EAAuB,GAAM,CAAA;QAC7FD,aAAa;QACbC,qBAAqB;KACtB,CAAA,AAAC,AAAC;AACH;;CAEC,GACD,OAAO,SAASC,eAAe,CAACV,gBAAkC,EAAE;IAClE,MAAM,EAAEQ,aAAa,CAAA,EAAEC,qBAAqB,CAAA,EAAE,GAAG7D,iBAAiB,CAAC2D,kBAAkB,CAAC,AAAC;IACvF,OAAO;QACLC,aAAa,EAAE,IAAMA,aAAa,CAACR,gBAAgB,CAAC;QACpDS,qBAAqB,EAAE,IAAMA,qBAAqB,CAACT,gBAAgB,CAAC;KACrE,CAAC;AACJ,CAAC;AAED,MAAMW,iBAAiB,GAAG,CAACpD,KAA0B,GAAKA,KAAK,CAACqD,WAAW,AAAC;AAC5E;;CAEC,GACD,OAAO,SAASC,cAAc,GAAG;IAC/B,OAAOjE,iBAAiB,CAAC+D,iBAAiB,CAAC,CAAC;AAC9C,CAAC;AAED,MAAMG,uBAAuB,GAAG,CAAC,EAAEC,iBAAiB,CAAA,EAAEC,WAAW,CAAA,EAAEC,sBAAsB,CAAA,EAAuB,GAAM,CAAA;QACpHF,iBAAiB;QACjBC,WAAW;QACXC,sBAAsB;KACvB,CAAA,AAAC,AAAC;AAEH;;CAEC,GACD,OAAO,SAASC,oBAAoB,GAAG;IACrC,0FAA0F;IAC1F,OAAOtE,iBAAiB,CAACkE,uBAAuB,CAAC,CAAC;AACpD,CAAC;AAED,MAAMK,sBAAsB,GAAG,CAAC5D,KAA0B,GAAKA,KAAK,CAAC6D,gBAAgB,AAAC;AACtF,OAAO,SAASC,mBAAmB,GAAG;IACpC,OAAOzE,iBAAiB,CAACuE,sBAAsB,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { Middleware } from './common';
3
+ import { PanelGroupId, PanelGroupSlice } from './panel-group-slice';
4
+ import { PanelSlice } from './panel-slice';
5
+ /**
6
+ * Slice that handles the visual editor state and related actions for deleting a Panel Group.
7
+ */
8
+ export interface DeletePanelGroupSlice {
9
+ deletePanelGroupDialog?: DeletePanelGroupDialogState;
10
+ /**
11
+ * Delete panel group and all the panels within the group
12
+ */
13
+ deletePanelGroup: (panelGroupId: PanelGroupId) => void;
14
+ openDeletePanelGroupDialog: (panelGroupId: PanelGroupId) => void;
15
+ closeDeletePanelGroupDialog: () => void;
16
+ }
17
+ export interface DeletePanelGroupDialogState {
18
+ panelGroupId: PanelGroupId;
19
+ panelGroupName?: string;
20
+ }
21
+ export declare const createDeletePanelGroupSlice: StateCreator<DeletePanelGroupSlice & PanelGroupSlice & PanelSlice, Middleware, [
22
+ ], DeletePanelGroupSlice>;
23
+ //# sourceMappingURL=delete-panel-group-slice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-panel-group-slice.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/delete-panel-group-slice.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,sBAAsB,CAAC,EAAE,2BAA2B,CAAC;IAErD;;OAEG;IACH,gBAAgB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IAEvD,0BAA0B,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;IACjE,2BAA2B,EAAE,MAAM,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAEpD,qBAAqB,GAAG,eAAe,GAAG,UAAU,EACpD,UAAU,EACV;CAAE,EACF,qBAAqB,CA6CrB,CAAC"}
@@ -0,0 +1,64 @@
1
+ // Copyright 2022 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
+ export const createDeletePanelGroupSlice = (set, get)=>({
14
+ deletePanelGroup (panelGroupId) {
15
+ const { panelGroups , panelGroupOrder } = get();
16
+ const group = panelGroups[panelGroupId];
17
+ const idIndex = panelGroupOrder.findIndex((id)=>id === panelGroupId);
18
+ if (group === undefined || idIndex === -1) {
19
+ throw new Error(`Panel group ${panelGroupId} not found`);
20
+ }
21
+ // Get the panel keys for all the panel items in the group we're going to delete
22
+ const panelKeys = Object.values(group.itemPanelKeys);
23
+ set((draft)=>{
24
+ // Delete the panel group which also deletes all its items
25
+ delete draft.panelGroups[panelGroupId];
26
+ draft.panelGroupOrder.splice(idIndex, 1);
27
+ // Get all remaining panel keys in use
28
+ const usedPanelKeys = getUsedPanelKeys(draft.panelGroups);
29
+ // For the panel keys of the items that were just deleted, see if they're still used and if not, also delete the
30
+ // panel definition
31
+ for (const panelKey of panelKeys){
32
+ if (usedPanelKeys.has(panelKey)) continue;
33
+ delete draft.panels[panelKey];
34
+ }
35
+ });
36
+ },
37
+ openDeletePanelGroupDialog: (panelGroupId)=>{
38
+ const panelGroup = get().panelGroups[panelGroupId];
39
+ if (panelGroup === undefined) {
40
+ throw new Error(`Panel group with Id ${panelGroupId} not found`);
41
+ }
42
+ set((state)=>{
43
+ state.deletePanelGroupDialog = {
44
+ panelGroupId,
45
+ panelGroupName: panelGroup.title
46
+ };
47
+ });
48
+ },
49
+ closeDeletePanelGroupDialog: ()=>set((state)=>{
50
+ state.deletePanelGroupDialog = undefined;
51
+ })
52
+ });
53
+ // Helper to get the panel keys of all groups, returning a set to eliminate duplicates
54
+ function getUsedPanelKeys(panelGroups) {
55
+ const usedPanelKeys = new Set();
56
+ for (const group of Object.values(panelGroups)){
57
+ for (const panelKey of Object.values(group.itemPanelKeys)){
58
+ usedPanelKeys.add(panelKey);
59
+ }
60
+ }
61
+ return usedPanelKeys;
62
+ }
63
+
64
+ //# sourceMappingURL=delete-panel-group-slice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/delete-panel-group-slice.ts"],"sourcesContent":["// Copyright 2022 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 { StateCreator } from 'zustand';\nimport { Middleware } from './common';\nimport { PanelGroupId, PanelGroupSlice } from './panel-group-slice';\nimport { PanelSlice } from './panel-slice';\n\n/**\n * Slice that handles the visual editor state and related actions for deleting a Panel Group.\n */\nexport interface DeletePanelGroupSlice {\n deletePanelGroupDialog?: DeletePanelGroupDialogState;\n\n /**\n * Delete panel group and all the panels within the group\n */\n deletePanelGroup: (panelGroupId: PanelGroupId) => void;\n\n openDeletePanelGroupDialog: (panelGroupId: PanelGroupId) => void;\n closeDeletePanelGroupDialog: () => void;\n}\n\nexport interface DeletePanelGroupDialogState {\n panelGroupId: PanelGroupId;\n panelGroupName?: string;\n}\n\nexport const createDeletePanelGroupSlice: StateCreator<\n // Actions in here need to modify both Panels and Panel Groups state\n DeletePanelGroupSlice & PanelGroupSlice & PanelSlice,\n Middleware,\n [],\n DeletePanelGroupSlice\n> = (set, get) => ({\n deletePanelGroup(panelGroupId) {\n const { panelGroups, panelGroupOrder } = get();\n const group = panelGroups[panelGroupId];\n const idIndex = panelGroupOrder.findIndex((id) => id === panelGroupId);\n if (group === undefined || idIndex === -1) {\n throw new Error(`Panel group ${panelGroupId} not found`);\n }\n\n // Get the panel keys for all the panel items in the group we're going to delete\n const panelKeys = Object.values(group.itemPanelKeys);\n\n set((draft) => {\n // Delete the panel group which also deletes all its items\n delete draft.panelGroups[panelGroupId];\n draft.panelGroupOrder.splice(idIndex, 1);\n\n // Get all remaining panel keys in use\n const usedPanelKeys = getUsedPanelKeys(draft.panelGroups);\n\n // For the panel keys of the items that were just deleted, see if they're still used and if not, also delete the\n // panel definition\n for (const panelKey of panelKeys) {\n if (usedPanelKeys.has(panelKey)) continue;\n\n delete draft.panels[panelKey];\n }\n });\n },\n\n openDeletePanelGroupDialog: (panelGroupId) => {\n const panelGroup = get().panelGroups[panelGroupId];\n if (panelGroup === undefined) {\n throw new Error(`Panel group with Id ${panelGroupId} not found`);\n }\n set((state) => {\n state.deletePanelGroupDialog = { panelGroupId, panelGroupName: panelGroup.title };\n });\n },\n\n closeDeletePanelGroupDialog: () =>\n set((state) => {\n state.deletePanelGroupDialog = undefined;\n }),\n});\n\n// Helper to get the panel keys of all groups, returning a set to eliminate duplicates\nfunction getUsedPanelKeys(panelGroups: PanelGroupSlice['panelGroups']): Set<string> {\n const usedPanelKeys = new Set<string>();\n for (const group of Object.values(panelGroups)) {\n for (const panelKey of Object.values(group.itemPanelKeys)) {\n usedPanelKeys.add(panelKey);\n }\n }\n return usedPanelKeys;\n}\n"],"names":["createDeletePanelGroupSlice","set","get","deletePanelGroup","panelGroupId","panelGroups","panelGroupOrder","group","idIndex","findIndex","id","undefined","Error","panelKeys","Object","values","itemPanelKeys","draft","splice","usedPanelKeys","getUsedPanelKeys","panelKey","has","panels","openDeletePanelGroupDialog","panelGroup","state","deletePanelGroupDialog","panelGroupName","title","closeDeletePanelGroupDialog","Set","add"],"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;AA2BjC,OAAO,MAAMA,2BAA2B,GAMpC,CAACC,GAAG,EAAEC,GAAG,GAAM,CAAA;QACjBC,gBAAgB,EAACC,YAAY,EAAE;YAC7B,MAAM,EAAEC,WAAW,CAAA,EAAEC,eAAe,CAAA,EAAE,GAAGJ,GAAG,EAAE,AAAC;YAC/C,MAAMK,KAAK,GAAGF,WAAW,CAACD,YAAY,CAAC,AAAC;YACxC,MAAMI,OAAO,GAAGF,eAAe,CAACG,SAAS,CAAC,CAACC,EAAE,GAAKA,EAAE,KAAKN,YAAY,CAAC,AAAC;YACvE,IAAIG,KAAK,KAAKI,SAAS,IAAIH,OAAO,KAAK,CAAC,CAAC,EAAE;gBACzC,MAAM,IAAII,KAAK,CAAC,CAAC,YAAY,EAAER,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;YAC3D,CAAC;YAED,gFAAgF;YAChF,MAAMS,SAAS,GAAGC,MAAM,CAACC,MAAM,CAACR,KAAK,CAACS,aAAa,CAAC,AAAC;YAErDf,GAAG,CAAC,CAACgB,KAAK,GAAK;gBACb,0DAA0D;gBAC1D,OAAOA,KAAK,CAACZ,WAAW,CAACD,YAAY,CAAC,CAAC;gBACvCa,KAAK,CAACX,eAAe,CAACY,MAAM,CAACV,OAAO,EAAE,CAAC,CAAC,CAAC;gBAEzC,sCAAsC;gBACtC,MAAMW,aAAa,GAAGC,gBAAgB,CAACH,KAAK,CAACZ,WAAW,CAAC,AAAC;gBAE1D,gHAAgH;gBAChH,mBAAmB;gBACnB,KAAK,MAAMgB,QAAQ,IAAIR,SAAS,CAAE;oBAChC,IAAIM,aAAa,CAACG,GAAG,CAACD,QAAQ,CAAC,EAAE,SAAS;oBAE1C,OAAOJ,KAAK,CAACM,MAAM,CAACF,QAAQ,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAEDG,0BAA0B,EAAE,CAACpB,YAAY,GAAK;YAC5C,MAAMqB,UAAU,GAAGvB,GAAG,EAAE,CAACG,WAAW,CAACD,YAAY,CAAC,AAAC;YACnD,IAAIqB,UAAU,KAAKd,SAAS,EAAE;gBAC5B,MAAM,IAAIC,KAAK,CAAC,CAAC,oBAAoB,EAAER,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;YACnE,CAAC;YACDH,GAAG,CAAC,CAACyB,KAAK,GAAK;gBACbA,KAAK,CAACC,sBAAsB,GAAG;oBAAEvB,YAAY;oBAAEwB,cAAc,EAAEH,UAAU,CAACI,KAAK;iBAAE,CAAC;YACpF,CAAC,CAAC,CAAC;QACL,CAAC;QAEDC,2BAA2B,EAAE,IAC3B7B,GAAG,CAAC,CAACyB,KAAK,GAAK;gBACbA,KAAK,CAACC,sBAAsB,GAAGhB,SAAS,CAAC;YAC3C,CAAC,CAAC;KACL,CAAA,AAAC,CAAC;AAEH,sFAAsF;AACtF,SAASS,gBAAgB,CAACf,WAA2C,EAAe;IAClF,MAAMc,aAAa,GAAG,IAAIY,GAAG,EAAU,AAAC;IACxC,KAAK,MAAMxB,KAAK,IAAIO,MAAM,CAACC,MAAM,CAACV,WAAW,CAAC,CAAE;QAC9C,KAAK,MAAMgB,QAAQ,IAAIP,MAAM,CAACC,MAAM,CAACR,KAAK,CAACS,aAAa,CAAC,CAAE;YACzDG,aAAa,CAACa,GAAG,CAACX,QAAQ,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAOF,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { StateCreator } from 'zustand';
2
+ import { Middleware } from './common';
3
+ import { PanelGroupSlice, PanelGroupItemId } from './panel-group-slice';
4
+ import { PanelSlice } from './panel-slice';
5
+ /**
6
+ * Slice that handles the visual editor state and actions for deleting Panels.
7
+ */
8
+ export interface DeletePanelSlice {
9
+ /**
10
+ * Delete panels
11
+ */
12
+ deletePanel: (panelGroupItemId: PanelGroupItemId) => void;
13
+ /**
14
+ * State for the delete panel dialog when it's open, otherwise undefined when it's closed.
15
+ */
16
+ deletePanelDialog?: DeletePanelDialogState;
17
+ /**
18
+ * Open delete panel dialog
19
+ */
20
+ openDeletePanelDialog: (panelGroupItemId: PanelGroupItemId) => void;
21
+ /**
22
+ * Close delete panel dialog
23
+ */
24
+ closeDeletePanelDialog: () => void;
25
+ }
26
+ export interface DeletePanelDialogState {
27
+ panelGroupItemId: PanelGroupItemId;
28
+ panelName: string;
29
+ panelGroupName: string;
30
+ }
31
+ /**
32
+ * Curried function for creating the PanelDeleteSlice.
33
+ */
34
+ export declare function createDeletePanelSlice(): StateCreator<DeletePanelSlice & PanelSlice & PanelGroupSlice, Middleware, [
35
+ ], DeletePanelSlice>;
36
+ //# sourceMappingURL=delete-panel-slice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-panel-slice.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/delete-panel-slice.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE1D;;OAEG;IACH,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAE3C;;OAEG;IACH,qBAAqB,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEpE;;OAEG;IACH,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,YAAY,CAEpD,gBAAgB,GAAG,UAAU,GAAG,eAAe,EAC/C,UAAU,EACV;CAAE,EACF,gBAAgB,CACjB,CA6DA"}
@@ -0,0 +1,81 @@
1
+ // Copyright 2022 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
+ /**
14
+ * Curried function for creating the PanelDeleteSlice.
15
+ */ export function createDeletePanelSlice() {
16
+ // Return the state creator function for Zustand that uses the panels provided as intitial state
17
+ return (set, get)=>({
18
+ deletePanel (panelGroupItemId) {
19
+ set((draft)=>{
20
+ const { panelGroupId , panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
21
+ const existingGroup = draft.panelGroups[panelGroupId];
22
+ if (existingGroup === undefined) {
23
+ throw new Error(`Missing panel group ${panelGroupId}`);
24
+ }
25
+ const existingLayoutIdx = existingGroup.itemLayouts.findIndex((layout)=>layout.i === panelGroupLayoutId);
26
+ const existingPanelKey = existingGroup.itemPanelKeys[panelGroupLayoutId];
27
+ if (existingLayoutIdx === -1 || existingPanelKey === undefined) {
28
+ throw new Error(`Missing panel group item ${panelGroupLayoutId}`);
29
+ }
30
+ // remove panel from panel group
31
+ existingGroup.itemLayouts.splice(existingLayoutIdx, 1);
32
+ delete existingGroup.itemPanelKeys[panelGroupLayoutId];
33
+ // See if panel key is still used and if not, delete it
34
+ if (isPanelKeyStillUsed(draft.panelGroups, existingPanelKey) === false) {
35
+ delete draft.panels[existingPanelKey];
36
+ }
37
+ });
38
+ },
39
+ openDeletePanelDialog (panelGroupItemId) {
40
+ const { panelGroupId , panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;
41
+ const { panels , panelGroups } = get();
42
+ const panelGroup = panelGroups[panelGroupId];
43
+ if (panelGroup === undefined) {
44
+ throw new Error(`Panel group not found ${panelGroupId}`);
45
+ }
46
+ const panelKey = panelGroup.itemPanelKeys[panelGroupLayoutId];
47
+ if (panelKey === undefined) {
48
+ throw new Error(`Could not find Panel Group item ${panelGroupLayoutId}`);
49
+ }
50
+ const panel = panels[panelKey];
51
+ if (panel === undefined) {
52
+ throw new Error(`Could not find panel ${panelKey}`);
53
+ }
54
+ set((state)=>{
55
+ var _title;
56
+ state.deletePanelDialog = {
57
+ panelGroupItemId: panelGroupItemId,
58
+ panelName: panel.spec.display.name,
59
+ panelGroupName: (_title = panelGroup.title) !== null && _title !== void 0 ? _title : ''
60
+ };
61
+ });
62
+ },
63
+ closeDeletePanelDialog () {
64
+ set((state)=>{
65
+ state.deletePanelDialog = undefined;
66
+ });
67
+ }
68
+ });
69
+ }
70
+ // Helper function to determine if a panel key is still being used somewhere in Panel Groups
71
+ function isPanelKeyStillUsed(panelGroups, panelKey) {
72
+ for (const group of Object.values(panelGroups)){
73
+ const found = Object.values(group.itemPanelKeys).find((key)=>key === panelKey);
74
+ if (found !== undefined) {
75
+ return true;
76
+ }
77
+ }
78
+ return false;
79
+ }
80
+
81
+ //# sourceMappingURL=delete-panel-slice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/delete-panel-slice.ts"],"sourcesContent":["// Copyright 2022 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 { StateCreator } from 'zustand';\nimport { Middleware } from './common';\nimport { PanelGroupSlice, PanelGroupItemId } from './panel-group-slice';\nimport { PanelSlice } from './panel-slice';\n\n/**\n * Slice that handles the visual editor state and actions for deleting Panels.\n */\nexport interface DeletePanelSlice {\n /**\n * Delete panels\n */\n deletePanel: (panelGroupItemId: PanelGroupItemId) => void;\n\n /**\n * State for the delete panel dialog when it's open, otherwise undefined when it's closed.\n */\n deletePanelDialog?: DeletePanelDialogState;\n\n /**\n * Open delete panel dialog\n */\n openDeletePanelDialog: (panelGroupItemId: PanelGroupItemId) => void;\n\n /**\n * Close delete panel dialog\n */\n closeDeletePanelDialog: () => void;\n}\n\nexport interface DeletePanelDialogState {\n panelGroupItemId: PanelGroupItemId;\n panelName: string;\n panelGroupName: string;\n}\n\n/**\n * Curried function for creating the PanelDeleteSlice.\n */\nexport function createDeletePanelSlice(): StateCreator<\n // Actions in here need to modify both Panels and Panel Groups state\n DeletePanelSlice & PanelSlice & PanelGroupSlice,\n Middleware,\n [],\n DeletePanelSlice\n> {\n // Return the state creator function for Zustand that uses the panels provided as intitial state\n return (set, get) => ({\n deletePanel(panelGroupItemId: PanelGroupItemId) {\n set((draft) => {\n const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;\n const existingGroup = draft.panelGroups[panelGroupId];\n if (existingGroup === undefined) {\n throw new Error(`Missing panel group ${panelGroupId}`);\n }\n const existingLayoutIdx = existingGroup.itemLayouts.findIndex((layout) => layout.i === panelGroupLayoutId);\n const existingPanelKey = existingGroup.itemPanelKeys[panelGroupLayoutId];\n if (existingLayoutIdx === -1 || existingPanelKey === undefined) {\n throw new Error(`Missing panel group item ${panelGroupLayoutId}`);\n }\n\n // remove panel from panel group\n existingGroup.itemLayouts.splice(existingLayoutIdx, 1);\n delete existingGroup.itemPanelKeys[panelGroupLayoutId];\n\n // See if panel key is still used and if not, delete it\n if (isPanelKeyStillUsed(draft.panelGroups, existingPanelKey) === false) {\n delete draft.panels[existingPanelKey];\n }\n });\n },\n\n openDeletePanelDialog(panelGroupItemId: PanelGroupItemId) {\n const { panelGroupId, panelGroupItemLayoutId: panelGroupLayoutId } = panelGroupItemId;\n\n const { panels, panelGroups } = get();\n const panelGroup = panelGroups[panelGroupId];\n if (panelGroup === undefined) {\n throw new Error(`Panel group not found ${panelGroupId}`);\n }\n\n const panelKey = panelGroup.itemPanelKeys[panelGroupLayoutId];\n if (panelKey === undefined) {\n throw new Error(`Could not find Panel Group item ${panelGroupLayoutId}`);\n }\n\n const panel = panels[panelKey];\n if (panel === undefined) {\n throw new Error(`Could not find panel ${panelKey}`);\n }\n\n set((state) => {\n state.deletePanelDialog = {\n panelGroupItemId: panelGroupItemId,\n panelName: panel.spec.display.name,\n panelGroupName: panelGroup.title ?? '',\n };\n });\n },\n\n closeDeletePanelDialog() {\n set((state) => {\n state.deletePanelDialog = undefined;\n });\n },\n });\n}\n\n// Helper function to determine if a panel key is still being used somewhere in Panel Groups\nfunction isPanelKeyStillUsed(panelGroups: PanelGroupSlice['panelGroups'], panelKey: string) {\n for (const group of Object.values(panelGroups)) {\n const found = Object.values(group.itemPanelKeys).find((key) => key === panelKey);\n if (found !== undefined) {\n return true;\n }\n }\n return false;\n}\n"],"names":["createDeletePanelSlice","set","get","deletePanel","panelGroupItemId","draft","panelGroupId","panelGroupItemLayoutId","panelGroupLayoutId","existingGroup","panelGroups","undefined","Error","existingLayoutIdx","itemLayouts","findIndex","layout","i","existingPanelKey","itemPanelKeys","splice","isPanelKeyStillUsed","panels","openDeletePanelDialog","panelGroup","panelKey","panel","state","deletePanelDialog","panelName","spec","display","name","panelGroupName","title","closeD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ACC,OAAO,CAACC,IAAI;wBAClCC,cAAc,EAAET,CAAAA,MAAgB,GAAhBA,UAAU,CAACU,KAAK,cAAhBV,MAAgB,cAAhBA,MAAgB,GAAI,EAAE;qBACvC,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC;YAEDW,sBAAsB,IAAG;gBACvBlC,GAAG,CAAC,CAAC0B,KAAK,GAAK;oBACbA,KAAK,CAACC,iBAAiB,GAAGjB,SAAS,CAAC;gBACtC,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAA,AAAC,CAAC;AACL,CAAC;AAED,4FAA4F;AAC5F,SAASU,mBAAmB,CAACX,WAA2C,EAAEe,QAAgB,EAAE;IAC1F,KAAK,MAAMW,KAAK,IAAIC,MAAM,CAACC,MAAM,CAAC5B,WAAW,CAAC,CAAE;QAC9C,MAAM6B,KAAK,GAAGF,MAAM,CAACC,MAAM,CAACF,KAAK,CAACjB,aAAa,CAAC,CAACqB,IAAI,CAAC,CAACC,GAAG,GAAKA,GAAG,KAAKhB,QAAQ,CAAC,AAAC;QACjF,IAAIc,KAAK,KAAK5B,SAAS,EAAE;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './dashboard-provider-api';
2
+ export * from './DashboardProvider';
3
+ export type { PanelGroupId, PanelGroupDefinition, PanelGroupItemId, PanelGroupItemLayoutId as PanelGroupLayoutId, } from './panel-group-slice';
4
+ export type { PanelGroupEditor, PanelGroupEditorValues } from './panel-group-editor-slice';
5
+ export type { DeletePanelDialogState } from './delete-panel-slice';
6
+ export type { PanelEditorValues } from './panel-editor-slice';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/DashboardProvider/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,IAAI,kBAAkB,GAC7C,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAC3F,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ // Copyright 2022 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
+ export * from './dashboard-provider-api';
14
+ export * from './DashboardProvider';
15
+
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/context/DashboardProvider/index.ts"],"sourcesContent":["// Copyright 2022 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 './dashboard-provider-api';\nexport * from './DashboardProvider';\nexport type {\n PanelGroupId,\n PanelGroupDefinition,\n PanelGroupItemId,\n PanelGroupItemLayoutId as PanelGroupLayoutId,\n} from './panel-group-slice';\nexport type { PanelGroupEditor, PanelGroupEditorValues } from './panel-group-editor-slice';\nexport type { DeletePanelDialogState } from './delete-panel-slice';\nexport type { PanelEditorValues } from './panel-editor-slice';\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,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}