@perses-dev/dashboards 0.0.0-snapshot-panel-extra-content-3-17f9c42 → 0.0.0-snapshot-scatterplot-fix-imports-95e1b59

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 (411) hide show
  1. package/dist/cjs/components/AddGroupButton/AddGroupButton.js +11 -8
  2. package/dist/cjs/components/AddGroupButton/index.js +10 -8
  3. package/dist/cjs/components/AddPanelButton/AddPanelButton.js +12 -13
  4. package/dist/cjs/components/AddPanelButton/index.js +10 -8
  5. package/dist/cjs/components/Dashboard/Dashboard.js +12 -10
  6. package/dist/cjs/components/Dashboard/index.js +10 -8
  7. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +53 -22
  8. package/dist/cjs/components/DashboardStickyToolbar/index.js +10 -8
  9. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +82 -103
  10. package/dist/cjs/components/DashboardToolbar/index.js +10 -8
  11. package/dist/cjs/components/Datasources/DatasourceEditor.js +236 -0
  12. package/dist/cjs/components/Datasources/EditDatasourcesButton.js +112 -0
  13. package/dist/cjs/components/{ToolbarIconButton → Datasources}/index.js +11 -8
  14. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +16 -14
  15. package/dist/cjs/components/DeletePanelDialog/index.js +10 -8
  16. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +18 -16
  17. package/dist/cjs/components/DeletePanelGroupDialog/index.js +10 -8
  18. package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +6 -4
  19. package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +10 -8
  20. package/dist/cjs/components/DownloadButton/DownloadButton.js +13 -12
  21. package/dist/cjs/components/DownloadButton/index.js +10 -8
  22. package/dist/cjs/components/EditButton/EditButton.js +9 -7
  23. package/dist/cjs/components/EditButton/index.js +10 -8
  24. package/dist/cjs/components/EditJsonButton/EditJsonButton.js +15 -12
  25. package/dist/cjs/components/EditJsonButton/index.js +10 -8
  26. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +54 -25
  27. package/dist/cjs/components/EditJsonDialog/index.js +10 -8
  28. package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +21 -19
  29. package/dist/cjs/components/EmptyDashboard/index.js +10 -8
  30. package/dist/cjs/components/GridLayout/GridContainer.js +6 -4
  31. package/dist/cjs/components/GridLayout/GridItemContent.js +37 -19
  32. package/dist/cjs/components/GridLayout/GridLayout.js +21 -19
  33. package/dist/cjs/components/GridLayout/GridTitle.js +40 -39
  34. package/dist/cjs/components/GridLayout/index.js +13 -11
  35. package/dist/cjs/components/Panel/Panel.js +19 -23
  36. package/dist/cjs/components/Panel/PanelContent.js +11 -8
  37. package/dist/cjs/components/Panel/PanelHeader.js +35 -33
  38. package/dist/cjs/components/Panel/index.js +10 -8
  39. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +25 -77
  40. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +237 -144
  41. package/dist/cjs/components/PanelDrawer/PanelPreview.js +13 -12
  42. package/dist/cjs/components/PanelDrawer/index.js +11 -8
  43. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +5 -3
  44. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +18 -16
  45. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +16 -12
  46. package/dist/cjs/components/PanelGroupDialog/index.js +10 -8
  47. package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +48 -46
  48. package/dist/cjs/components/QuerySummaryTable/index.js +10 -8
  49. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +26 -24
  50. package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +10 -8
  51. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +14 -14
  52. package/dist/cjs/components/SaveDashboardButton/index.js +10 -8
  53. package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +141 -0
  54. package/dist/cjs/components/Variables/EditVariablesButton.js +19 -17
  55. package/dist/cjs/components/Variables/TemplateVariable.js +261 -107
  56. package/dist/cjs/components/Variables/VariableEditor.js +282 -207
  57. package/dist/cjs/components/Variables/VariableList.js +24 -22
  58. package/dist/cjs/components/Variables/index.js +14 -11
  59. package/dist/cjs/components/index.js +30 -29
  60. package/dist/cjs/constants/grid-layout-config.js +6 -2
  61. package/dist/cjs/constants/index.js +12 -9
  62. package/dist/cjs/constants/styles.js +42 -0
  63. package/dist/cjs/constants/user-interface-text.js +8 -3
  64. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +48 -35
  65. package/dist/cjs/context/DashboardProvider/common.js +6 -2
  66. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +81 -49
  67. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +4 -2
  68. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +8 -6
  69. package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +3 -1
  70. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +4 -2
  71. package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +3 -1
  72. package/dist/cjs/context/DashboardProvider/index.js +12 -10
  73. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +17 -17
  74. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +8 -6
  75. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +16 -8
  76. package/dist/cjs/context/DashboardProvider/panel-slice.js +3 -1
  77. package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +3 -1
  78. package/dist/cjs/context/DatasourceStoreProvider.js +177 -50
  79. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +150 -39
  80. package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +12 -10
  81. package/dist/cjs/context/TemplateVariableProvider/index.js +10 -8
  82. package/dist/cjs/context/TemplateVariableProvider/query-params.js +17 -7
  83. package/dist/cjs/context/TemplateVariableProvider/utils.js +15 -7
  84. package/dist/cjs/context/index.js +13 -11
  85. package/dist/cjs/context/useDashboard.js +30 -11
  86. package/dist/cjs/index.js +12 -10
  87. package/dist/cjs/stories/decorators/WithDashboard.js +6 -4
  88. package/dist/cjs/stories/decorators/WithDatasourceStore.js +6 -4
  89. package/dist/cjs/stories/decorators/WithTemplateVariables.js +6 -4
  90. package/dist/cjs/stories/decorators/constants.js +5 -3
  91. package/dist/cjs/stories/decorators/index.js +13 -11
  92. package/dist/cjs/test/dashboard-provider.js +8 -4
  93. package/dist/cjs/test/datasource-provider.js +16 -12
  94. package/dist/cjs/test/index.js +13 -11
  95. package/dist/cjs/test/plugin-registry.js +6 -4
  96. package/dist/cjs/test/render.js +28 -21
  97. package/dist/cjs/test/setup-tests.js +2 -2
  98. package/dist/cjs/test/testDashboard.js +13 -11
  99. package/dist/cjs/utils/index.js +10 -9
  100. package/dist/cjs/utils/panelUtils.js +11 -5
  101. package/dist/cjs/{components/TimeRangeControls → validation}/index.js +10 -8
  102. package/dist/cjs/{utils/time.js → validation/panel.js} +11 -9
  103. package/dist/cjs/views/ViewDashboard/DashboardApp.js +32 -18
  104. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +64 -21
  105. package/dist/cjs/views/ViewDashboard/index.js +10 -8
  106. package/dist/cjs/views/index.js +10 -8
  107. package/dist/components/AddGroupButton/AddGroupButton.d.ts +1 -2
  108. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
  109. package/dist/components/AddGroupButton/AddGroupButton.js +3 -2
  110. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
  111. package/dist/components/AddGroupButton/index.js.map +1 -1
  112. package/dist/components/AddPanelButton/AddPanelButton.d.ts +1 -2
  113. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
  114. package/dist/components/AddPanelButton/AddPanelButton.js +4 -7
  115. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
  116. package/dist/components/AddPanelButton/index.js.map +1 -1
  117. package/dist/components/Dashboard/Dashboard.d.ts +2 -3
  118. package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
  119. package/dist/components/Dashboard/Dashboard.js +1 -1
  120. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  121. package/dist/components/Dashboard/index.js.map +1 -1
  122. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +1 -2
  123. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
  124. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +38 -9
  125. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
  126. package/dist/components/DashboardStickyToolbar/index.js.map +1 -1
  127. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +1 -1
  128. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  129. package/dist/components/DashboardToolbar/DashboardToolbar.js +63 -86
  130. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  131. package/dist/components/DashboardToolbar/index.js.map +1 -1
  132. package/dist/components/Datasources/DatasourceEditor.d.ts +7 -0
  133. package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -0
  134. package/dist/components/Datasources/DatasourceEditor.js +223 -0
  135. package/dist/components/Datasources/DatasourceEditor.js.map +1 -0
  136. package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -0
  137. package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -0
  138. package/dist/components/Datasources/EditDatasourcesButton.js +99 -0
  139. package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -0
  140. package/dist/components/Datasources/index.d.ts +3 -0
  141. package/dist/components/Datasources/index.d.ts.map +1 -0
  142. package/dist/components/{TimeRangeControls → Datasources}/index.js +2 -1
  143. package/dist/components/Datasources/index.js.map +1 -0
  144. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +1 -2
  145. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
  146. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
  147. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  148. package/dist/components/DeletePanelDialog/index.js.map +1 -1
  149. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +1 -2
  150. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
  151. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +3 -3
  152. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  153. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
  154. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +1 -2
  155. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  156. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
  157. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  158. package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
  159. package/dist/components/DownloadButton/DownloadButton.d.ts +1 -2
  160. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  161. package/dist/components/DownloadButton/DownloadButton.js +3 -4
  162. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  163. package/dist/components/DownloadButton/index.js.map +1 -1
  164. package/dist/components/EditButton/EditButton.d.ts +1 -2
  165. package/dist/components/EditButton/EditButton.d.ts.map +1 -1
  166. package/dist/components/EditButton/EditButton.js +1 -1
  167. package/dist/components/EditButton/EditButton.js.map +1 -1
  168. package/dist/components/EditButton/index.js.map +1 -1
  169. package/dist/components/EditJsonButton/EditJsonButton.d.ts +4 -2
  170. package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
  171. package/dist/components/EditJsonButton/EditJsonButton.js +7 -6
  172. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  173. package/dist/components/EditJsonButton/index.js.map +1 -1
  174. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +5 -2
  175. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  176. package/dist/components/EditJsonDialog/EditJsonDialog.js +43 -16
  177. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  178. package/dist/components/EditJsonDialog/index.js.map +1 -1
  179. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +1 -1
  180. package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
  181. package/dist/components/EmptyDashboard/EmptyDashboard.js +3 -3
  182. package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
  183. package/dist/components/EmptyDashboard/index.js.map +1 -1
  184. package/dist/components/GridLayout/GridContainer.d.ts +1 -1
  185. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  186. package/dist/components/GridLayout/GridContainer.js +1 -1
  187. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  188. package/dist/components/GridLayout/GridItemContent.d.ts +1 -2
  189. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  190. package/dist/components/GridLayout/GridItemContent.js +31 -15
  191. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  192. package/dist/components/GridLayout/GridLayout.d.ts +1 -2
  193. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  194. package/dist/components/GridLayout/GridLayout.js +6 -6
  195. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  196. package/dist/components/GridLayout/GridTitle.d.ts +1 -2
  197. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  198. package/dist/components/GridLayout/GridTitle.js +5 -6
  199. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  200. package/dist/components/GridLayout/index.js.map +1 -1
  201. package/dist/components/Panel/Panel.d.ts +2 -2
  202. package/dist/components/Panel/Panel.d.ts.map +1 -1
  203. package/dist/components/Panel/Panel.js +7 -13
  204. package/dist/components/Panel/Panel.js.map +1 -1
  205. package/dist/components/Panel/PanelContent.d.ts +3 -3
  206. package/dist/components/Panel/PanelContent.d.ts.map +1 -1
  207. package/dist/components/Panel/PanelContent.js +4 -3
  208. package/dist/components/Panel/PanelContent.js.map +1 -1
  209. package/dist/components/Panel/PanelHeader.d.ts +2 -2
  210. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  211. package/dist/components/Panel/PanelHeader.js +2 -2
  212. package/dist/components/Panel/PanelHeader.js.map +1 -1
  213. package/dist/components/Panel/index.js.map +1 -1
  214. package/dist/components/PanelDrawer/PanelDrawer.d.ts +1 -2
  215. package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
  216. package/dist/components/PanelDrawer/PanelDrawer.js +22 -76
  217. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  218. package/dist/components/PanelDrawer/PanelEditorForm.d.ts +5 -3
  219. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  220. package/dist/components/PanelDrawer/PanelEditorForm.js +231 -142
  221. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  222. package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -2
  223. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  224. package/dist/components/PanelDrawer/PanelPreview.js +4 -5
  225. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  226. package/dist/components/PanelDrawer/index.d.ts +1 -0
  227. package/dist/components/PanelDrawer/index.d.ts.map +1 -1
  228. package/dist/components/PanelDrawer/index.js +1 -0
  229. package/dist/components/PanelDrawer/index.js.map +1 -1
  230. package/dist/components/PanelDrawer/usePanelEditor.js +2 -2
  231. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
  232. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +1 -2
  233. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  234. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  235. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +1 -2
  236. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
  237. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  238. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  239. package/dist/components/PanelGroupDialog/index.js.map +1 -1
  240. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +1 -2
  241. package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
  242. package/dist/components/QuerySummaryTable/QuerySummaryTable.js +8 -8
  243. package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
  244. package/dist/components/QuerySummaryTable/index.js.map +1 -1
  245. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +1 -2
  246. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
  247. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -8
  248. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
  249. package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -1
  250. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +1 -2
  251. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
  252. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +8 -10
  253. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
  254. package/dist/components/SaveDashboardButton/index.js.map +1 -1
  255. package/dist/components/Variables/BuiltinVariableAccordions.d.ts +7 -0
  256. package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -0
  257. package/dist/components/Variables/BuiltinVariableAccordions.js +128 -0
  258. package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -0
  259. package/dist/components/Variables/EditVariablesButton.d.ts +1 -2
  260. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
  261. package/dist/components/Variables/EditVariablesButton.js +7 -7
  262. package/dist/components/Variables/EditVariablesButton.js.map +1 -1
  263. package/dist/components/Variables/TemplateVariable.d.ts +12 -4
  264. package/dist/components/Variables/TemplateVariable.d.ts.map +1 -1
  265. package/dist/components/Variables/TemplateVariable.js +244 -100
  266. package/dist/components/Variables/TemplateVariable.js.map +1 -1
  267. package/dist/components/Variables/VariableEditor.d.ts +4 -4
  268. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  269. package/dist/components/Variables/VariableEditor.js +232 -161
  270. package/dist/components/Variables/VariableEditor.js.map +1 -1
  271. package/dist/components/Variables/VariableList.d.ts +2 -3
  272. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  273. package/dist/components/Variables/VariableList.js +11 -13
  274. package/dist/components/Variables/VariableList.js.map +1 -1
  275. package/dist/components/Variables/index.d.ts +1 -0
  276. package/dist/components/Variables/index.d.ts.map +1 -1
  277. package/dist/components/Variables/index.js +1 -0
  278. package/dist/components/Variables/index.js.map +1 -1
  279. package/dist/components/index.d.ts +1 -2
  280. package/dist/components/index.d.ts.map +1 -1
  281. package/dist/components/index.js +1 -2
  282. package/dist/components/index.js.map +1 -1
  283. package/dist/constants/grid-layout-config.js.map +1 -1
  284. package/dist/constants/index.d.ts +1 -0
  285. package/dist/constants/index.d.ts.map +1 -1
  286. package/dist/constants/index.js +1 -0
  287. package/dist/constants/index.js.map +1 -1
  288. package/dist/constants/styles.d.ts +5 -0
  289. package/dist/constants/styles.d.ts.map +1 -0
  290. package/dist/{utils/time.js → constants/styles.js} +10 -10
  291. package/dist/constants/styles.js.map +1 -0
  292. package/dist/constants/user-interface-text.d.ts +2 -1
  293. package/dist/constants/user-interface-text.d.ts.map +1 -1
  294. package/dist/constants/user-interface-text.js +2 -1
  295. package/dist/constants/user-interface-text.js.map +1 -1
  296. package/dist/context/DashboardProvider/DashboardProvider.d.ts +7 -4
  297. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  298. package/dist/context/DashboardProvider/DashboardProvider.js +16 -9
  299. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  300. package/dist/context/DashboardProvider/common.d.ts +3 -3
  301. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  302. package/dist/context/DashboardProvider/common.js.map +1 -1
  303. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -1
  304. package/dist/context/DashboardProvider/dashboard-provider-api.js +17 -17
  305. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  306. package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  307. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  308. package/dist/context/DashboardProvider/delete-panel-slice.js +5 -5
  309. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  310. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  311. package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
  312. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  313. package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
  314. package/dist/context/DashboardProvider/index.js.map +1 -1
  315. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -2
  316. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  317. package/dist/context/DashboardProvider/panel-editor-slice.js +11 -13
  318. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  319. package/dist/context/DashboardProvider/panel-group-editor-slice.js +2 -2
  320. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  321. package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -2
  322. package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
  323. package/dist/context/DashboardProvider/panel-group-slice.js +4 -4
  324. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  325. package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
  326. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
  327. package/dist/context/DatasourceStoreProvider.d.ts +17 -12
  328. package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
  329. package/dist/context/DatasourceStoreProvider.js +172 -47
  330. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  331. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +15 -8
  332. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
  333. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +115 -23
  334. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  335. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
  336. package/dist/context/TemplateVariableProvider/hydrationUtils.js +7 -7
  337. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
  338. package/dist/context/TemplateVariableProvider/index.js.map +1 -1
  339. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
  340. package/dist/context/TemplateVariableProvider/utils.js +3 -3
  341. package/dist/context/TemplateVariableProvider/utils.js.map +1 -1
  342. package/dist/context/index.js.map +1 -1
  343. package/dist/context/useDashboard.d.ts +3 -3
  344. package/dist/context/useDashboard.d.ts.map +1 -1
  345. package/dist/context/useDashboard.js +24 -7
  346. package/dist/context/useDashboard.js.map +1 -1
  347. package/dist/index.js.map +1 -1
  348. package/dist/stories/decorators/WithDashboard.js.map +1 -1
  349. package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
  350. package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
  351. package/dist/stories/decorators/constants.js +2 -2
  352. package/dist/stories/decorators/constants.js.map +1 -1
  353. package/dist/stories/decorators/index.js.map +1 -1
  354. package/dist/test/dashboard-provider.js.map +1 -1
  355. package/dist/test/datasource-provider.d.ts.map +1 -1
  356. package/dist/test/datasource-provider.js +5 -7
  357. package/dist/test/datasource-provider.js.map +1 -1
  358. package/dist/test/index.js.map +1 -1
  359. package/dist/test/plugin-registry.js.map +1 -1
  360. package/dist/test/render.d.ts.map +1 -1
  361. package/dist/test/render.js +9 -4
  362. package/dist/test/render.js.map +1 -1
  363. package/dist/test/setup-tests.js.map +1 -1
  364. package/dist/test/testDashboard.js +10 -10
  365. package/dist/test/testDashboard.js.map +1 -1
  366. package/dist/utils/index.d.ts +0 -1
  367. package/dist/utils/index.d.ts.map +1 -1
  368. package/dist/utils/index.js +0 -1
  369. package/dist/utils/index.js.map +1 -1
  370. package/dist/utils/panelUtils.d.ts +1 -1
  371. package/dist/utils/panelUtils.d.ts.map +1 -1
  372. package/dist/utils/panelUtils.js +2 -2
  373. package/dist/utils/panelUtils.js.map +1 -1
  374. package/dist/validation/index.d.ts +2 -0
  375. package/dist/validation/index.d.ts.map +1 -0
  376. package/dist/{components/ToolbarIconButton → validation}/index.js +1 -1
  377. package/dist/validation/index.js.map +1 -0
  378. package/dist/validation/panel.d.ts +19 -0
  379. package/dist/validation/panel.d.ts.map +1 -0
  380. package/dist/validation/panel.js +21 -0
  381. package/dist/validation/panel.js.map +1 -0
  382. package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -3
  383. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  384. package/dist/views/ViewDashboard/DashboardApp.js +19 -7
  385. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  386. package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -2
  387. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  388. package/dist/views/ViewDashboard/ViewDashboard.js +53 -12
  389. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  390. package/dist/views/ViewDashboard/index.js.map +1 -1
  391. package/dist/views/index.js.map +1 -1
  392. package/package.json +8 -7
  393. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -183
  394. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -38
  395. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
  396. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
  397. package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -165
  398. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
  399. package/dist/components/TimeRangeControls/index.d.ts +0 -2
  400. package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
  401. package/dist/components/TimeRangeControls/index.js.map +0 -1
  402. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
  403. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
  404. package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
  405. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
  406. package/dist/components/ToolbarIconButton/index.d.ts +0 -2
  407. package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
  408. package/dist/components/ToolbarIconButton/index.js.map +0 -1
  409. package/dist/utils/time.d.ts +0 -5
  410. package/dist/utils/time.d.ts.map +0 -1
  411. package/dist/utils/time.js.map +0 -1
@@ -14,21 +14,24 @@ import { createPanelRef } from '@perses-dev/core';
14
14
  import { useDashboardStore } from './DashboardProvider';
15
15
  import { useTemplateVariableActions, useTemplateVariableDefinitions } from './TemplateVariableProvider';
16
16
  export function useDashboard() {
17
- const { panels , panelGroups , panelGroupOrder , setDashboard: setDashboardResource , metadata , display , duration , refreshInterval , } = useDashboardStore(({ panels , panelGroups , panelGroupOrder , setDashboard , metadata , display , duration , refreshInterval })=>({
17
+ const { panels, panelGroups, panelGroupOrder, setDashboard: setDashboardResource, kind, metadata, display, duration, refreshInterval, datasources, ttl } = useDashboardStore(({ panels, panelGroups, panelGroupOrder, setDashboard, kind, metadata, display, duration, refreshInterval, datasources, ttl })=>({
18
18
  panels,
19
19
  panelGroups,
20
20
  panelGroupOrder,
21
21
  setDashboard,
22
+ kind,
22
23
  metadata,
23
24
  display,
24
25
  duration,
25
- refreshInterval
26
+ refreshInterval,
27
+ datasources,
28
+ ttl
26
29
  }));
27
- const { setVariableDefinitions } = useTemplateVariableActions();
30
+ const { setVariableDefinitions } = useTemplateVariableActions();
28
31
  const variables = useTemplateVariableDefinitions();
29
32
  const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);
30
- const dashboard = {
31
- kind: 'Dashboard',
33
+ const dashboard = kind === 'Dashboard' ? {
34
+ kind,
32
35
  metadata,
33
36
  spec: {
34
37
  display,
@@ -36,7 +39,21 @@ export function useDashboard() {
36
39
  layouts,
37
40
  variables,
38
41
  duration,
39
- refreshInterval
42
+ refreshInterval,
43
+ datasources
44
+ }
45
+ } : {
46
+ kind,
47
+ metadata,
48
+ spec: {
49
+ display,
50
+ panels,
51
+ layouts,
52
+ variables,
53
+ duration,
54
+ refreshInterval,
55
+ datasources,
56
+ ttl
40
57
  }
41
58
  };
42
59
  const setDashboard = (dashboardResource)=>{
@@ -55,7 +72,7 @@ function convertPanelGroupsToLayouts(panelGroups, panelGroupOrder) {
55
72
  if (group === undefined) {
56
73
  throw new Error('panel group not found');
57
74
  }
58
- const { title , isCollapsed , itemLayouts , itemPanelKeys } = group;
75
+ const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;
59
76
  let display = undefined;
60
77
  if (title) {
61
78
  display = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/context/useDashboard.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 { createPanelRef, DashboardResource, GridDefinition } from '@perses-dev/core';\nimport { PanelGroupDefinition, PanelGroupId, useDashboardStore } from './DashboardProvider';\nimport { useTemplateVariableActions, useTemplateVariableDefinitions } from './TemplateVariableProvider';\n\nexport function useDashboard() {\n const {\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard: setDashboardResource,\n metadata,\n display,\n duration,\n refreshInterval,\n } = useDashboardStore(\n ({ panels, panelGroups, panelGroupOrder, setDashboard, metadata, display, duration, refreshInterval }) => ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n metadata,\n display,\n duration,\n refreshInterval,\n })\n );\n const { setVariableDefinitions } = useTemplateVariableActions();\n const variables = useTemplateVariableDefinitions();\n const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);\n\n const dashboard: DashboardResource = {\n kind: 'Dashboard',\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n duration,\n refreshInterval,\n },\n };\n\n const setDashboard = (dashboardResource: DashboardResource) => {\n setVariableDefinitions(dashboardResource.spec.variables);\n setDashboardResource(dashboardResource);\n };\n\n return {\n dashboard,\n setDashboard,\n };\n}\n\nfunction convertPanelGroupsToLayouts(\n panelGroups: Record<number, PanelGroupDefinition>,\n panelGroupOrder: PanelGroupId[]\n): GridDefinition[] {\n const layouts: GridDefinition[] = [];\n panelGroupOrder.map((groupOrderId) => {\n const group = panelGroups[groupOrderId];\n if (group === undefined) {\n throw new Error('panel group not found');\n }\n const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;\n let display = undefined;\n if (title) {\n display = {\n title,\n collapse: {\n open: !isCollapsed,\n },\n };\n }\n const layout: GridDefinition = {\n kind: 'Grid',\n spec: {\n display,\n items: itemLayouts.map((layout) => {\n const panelKey = itemPanelKeys[layout.i];\n if (panelKey === undefined) {\n throw new Error(`Missing panel key of layout ${layout.i}`);\n }\n return {\n x: layout.x,\n y: layout.y,\n width: layout.w,\n height: layout.h,\n content: createPanelRef(panelKey),\n };\n }),\n },\n };\n layouts.push(layout);\n });\n\n return layouts;\n}\n"],"names":["createPanelRef","useDashboardStore","useTemplateVariableActions","useTemplateVariableDefinitions","useDashboard","panels","panelGroups","panelGroupOrder","setDashboard","setDashboardResource","metadata","display","duration","refreshInterval","setVariableDefinitions","variables","layouts","convertPanelGroupsToLayouts","dashboard","kind","spec","dashboardResource","map","groupOrderId","group","undefined","Error","title","isCollapsed","itemLayouts","itemPanelKeys","collapse","open","layout","items","panelKey","i","x","y","width","w","height","h","content","push"],"mappings":"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"}
1
+ {"version":3,"sources":["../../src/context/useDashboard.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 { createPanelRef, DashboardResource, EphemeralDashboardResource, GridDefinition } from '@perses-dev/core';\nimport { PanelGroupDefinition, PanelGroupId, useDashboardStore } from './DashboardProvider';\nimport { useTemplateVariableActions, useTemplateVariableDefinitions } from './TemplateVariableProvider';\n\nexport function useDashboard() {\n const {\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard: setDashboardResource,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n ttl,\n } = useDashboardStore(\n ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n ttl,\n }) => ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n display,\n duration,\n refreshInterval,\n datasources,\n ttl,\n })\n );\n const { setVariableDefinitions } = useTemplateVariableActions();\n const variables = useTemplateVariableDefinitions();\n const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);\n\n const dashboard =\n kind === 'Dashboard'\n ? ({\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n duration,\n refreshInterval,\n datasources,\n },\n } as DashboardResource)\n : ({\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n duration,\n refreshInterval,\n datasources,\n ttl,\n },\n } as EphemeralDashboardResource);\n\n const setDashboard = (dashboardResource: DashboardResource | EphemeralDashboardResource) => {\n setVariableDefinitions(dashboardResource.spec.variables);\n setDashboardResource(dashboardResource);\n };\n\n return {\n dashboard,\n setDashboard,\n };\n}\n\nfunction convertPanelGroupsToLayouts(\n panelGroups: Record<number, PanelGroupDefinition>,\n panelGroupOrder: PanelGroupId[]\n): GridDefinition[] {\n const layouts: GridDefinition[] = [];\n panelGroupOrder.map((groupOrderId) => {\n const group = panelGroups[groupOrderId];\n if (group === undefined) {\n throw new Error('panel group not found');\n }\n const { title, isCollapsed, itemLayouts, itemPanelKeys } = group;\n let display = undefined;\n if (title) {\n display = {\n title,\n collapse: {\n open: !isCollapsed,\n },\n };\n }\n const layout: GridDefinition = {\n kind: 'Grid',\n spec: {\n display,\n items: itemLayouts.map((layout) => {\n const panelKey = itemPanelKeys[layout.i];\n if (panelKey === undefined) {\n throw new Error(`Missing panel key of layout ${layout.i}`);\n }\n return {\n x: layout.x,\n y: layout.y,\n width: layout.w,\n height: layout.h,\n content: createPanelRef(panelKey),\n };\n }),\n },\n };\n layouts.push(layout);\n });\n\n return layouts;\n}\n"],"names":["createPanelRef","useDashboardStore","useTemplateVariableActions","useTemplateVariableDefinitions","useDashboard","panels","panelGroups","panelGroupOrder","setDashboard","setDashboardResource","kind","metadata","display","duration","refreshInterval","datasources","ttl","setVariableDefinitions","variables","layouts","convertPanelGroupsToLayouts","dashboard","spec","dashboardResource","map","groupOrderId","group","undefined","Error","title","isCollapsed","itemLayouts","itemPanelKeys","collapse","open","layout","items","panelKey","i","x","y","width","w","height","h","content","push"],"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,cAAc,QAAuE,mBAAmB;AACjH,SAA6CC,iBAAiB,QAAQ,sBAAsB;AAC5F,SAASC,0BAA0B,EAAEC,8BAA8B,QAAQ,6BAA6B;AAExG,OAAO,SAASC;IACd,MAAM,EACJC,MAAM,EACNC,WAAW,EACXC,eAAe,EACfC,cAAcC,oBAAoB,EAClCC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,GAAG,EACJ,GAAGf,kBACF,CAAC,EACCI,MAAM,EACNC,WAAW,EACXC,eAAe,EACfC,YAAY,EACZE,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,GAAG,EACJ,GAAM,CAAA;YACLX;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,CAAA;IAEF,MAAM,EAAEC,sBAAsB,EAAE,GAAGf;IACnC,MAAMgB,YAAYf;IAClB,MAAMgB,UAAUC,4BAA4Bd,aAAaC;IAEzD,MAAMc,YACJX,SAAS,cACJ;QACCA;QACAC;QACAW,MAAM;YACJV;YACAP;YACAc;YACAD;YACAL;YACAC;YACAC;QACF;IACF,IACC;QACCL;QACAC;QACAW,MAAM;YACJV;YACAP;YACAc;YACAD;YACAL;YACAC;YACAC;YACAC;QACF;IACF;IAEN,MAAMR,eAAe,CAACe;QACpBN,uBAAuBM,kBAAkBD,IAAI,CAACJ,SAAS;QACvDT,qBAAqBc;IACvB;IAEA,OAAO;QACLF;QACAb;IACF;AACF;AAEA,SAASY,4BACPd,WAAiD,EACjDC,eAA+B;IAE/B,MAAMY,UAA4B,EAAE;IACpCZ,gBAAgBiB,GAAG,CAAC,CAACC;QACnB,MAAMC,QAAQpB,WAAW,CAACmB,aAAa;QACvC,IAAIC,UAAUC,WAAW;YACvB,MAAM,IAAIC,MAAM;QAClB;QACA,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,WAAW,EAAEC,aAAa,EAAE,GAAGN;QAC3D,IAAId,UAAUe;QACd,IAAIE,OAAO;YACTjB,UAAU;gBACRiB;gBACAI,UAAU;oBACRC,MAAM,CAACJ;gBACT;YACF;QACF;QACA,MAAMK,SAAyB;YAC7BzB,MAAM;YACNY,MAAM;gBACJV;gBACAwB,OAAOL,YAAYP,GAAG,CAAC,CAACW;oBACtB,MAAME,WAAWL,aAAa,CAACG,OAAOG,CAAC,CAAC;oBACxC,IAAID,aAAaV,WAAW;wBAC1B,MAAM,IAAIC,MAAM,CAAC,4BAA4B,EAAEO,OAAOG,CAAC,CAAC,CAAC;oBAC3D;oBACA,OAAO;wBACLC,GAAGJ,OAAOI,CAAC;wBACXC,GAAGL,OAAOK,CAAC;wBACXC,OAAON,OAAOO,CAAC;wBACfC,QAAQR,OAAOS,CAAC;wBAChBC,SAAS7C,eAAeqC;oBAC1B;gBACF;YACF;QACF;QACAlB,QAAQ2B,IAAI,CAACX;IACf;IAEA,OAAOhB;AACT"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/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 './components';\nexport * from './context';\nexport * from './views';\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,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"sources":["../src/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 './components';\nexport * from './context';\nexport * from './views';\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,eAAe;AAC7B,cAAc,YAAY;AAC1B,cAAc,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithDashboard.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { DashboardProvider, DashboardProviderProps } from '@perses-dev/dashboards';\nimport { EMPTY_DASHBOARD_RESOURCE } from './constants';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withDashboard?: WithDashboardParameter;\n }\n}\n\nexport type WithDashboardParameter = {\n props: Partial<DashboardProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithDashboardParameter(parameter: unknown | WithDashboardParameter): parameter is WithDashboardParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithDashboard = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withDashboard;\n const parameter = isWithDashboardParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <DashboardProvider initialState={{ dashboardResource: EMPTY_DASHBOARD_RESOURCE }} {...props}>\n <Story />\n </DashboardProvider>\n );\n};\n"],"names":["DashboardProvider","EMPTY_DASHBOARD_RESOURCE","isWithDashboardParameter","parameter","WithDashboard","Story","context","initParameter","parameters","withDashboard","undefined","props","initialState","dashboardResource"],"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;AACA,SAASA,iBAAiB,QAAgC,wBAAwB,CAAC;AACnF,SAASC,wBAAwB,QAAQ,aAAa,CAAC;AAYvD,yDAAyD;AACzD,SAASC,wBAAwB,CAACC,SAA2C,EAAuC;IAClH,OAAO,CAAC,CAACA,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAO,IAAIA,SAAS,CAAC;AAC9E,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG,CAACC,KAAc,EAAEC,OAA8B,GAAK;IAC/E,MAAMC,aAAa,GAAGD,OAAO,CAACE,UAAU,CAACC,aAAa,AAAC;IACvD,MAAMN,SAAS,GAAGD,wBAAwB,CAACK,aAAa,CAAC,GAAGA,aAAa,GAAGG,SAAS,AAAC;IACtF,MAAMC,KAAK,GAAGR,SAAS,aAATA,SAAS,WAAO,GAAhBA,KAAAA,CAAgB,GAAhBA,SAAS,CAAEQ,KAAK,AAAC;IAE/B,qBACE,KAACX,iBAAiB;QAACY,YAAY,EAAE;YAAEC,iBAAiB,EAAEZ,wBAAwB;SAAE;QAAG,GAAGU,KAAK;kBACzF,cAAA,KAACN,KAAK,KAAG;MACS,CACpB;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/stories/decorators/WithDashboard.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { DashboardProvider, DashboardProviderProps } from '@perses-dev/dashboards';\nimport { EMPTY_DASHBOARD_RESOURCE } from './constants';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withDashboard?: WithDashboardParameter;\n }\n}\n\nexport type WithDashboardParameter = {\n props: Partial<DashboardProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithDashboardParameter(parameter: unknown | WithDashboardParameter): parameter is WithDashboardParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithDashboard = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withDashboard;\n const parameter = isWithDashboardParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <DashboardProvider initialState={{ dashboardResource: EMPTY_DASHBOARD_RESOURCE }} {...props}>\n <Story />\n </DashboardProvider>\n );\n};\n"],"names":["DashboardProvider","EMPTY_DASHBOARD_RESOURCE","isWithDashboardParameter","parameter","WithDashboard","Story","context","initParameter","parameters","withDashboard","undefined","props","initialState","dashboardResource"],"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;;AAGjC,SAASA,iBAAiB,QAAgC,yBAAyB;AACnF,SAASC,wBAAwB,QAAQ,cAAc;AAYvD,yDAAyD;AACzD,SAASC,yBAAyBC,SAA2C;IAC3E,OAAO,CAAC,CAACA,aAAa,OAAOA,cAAc,YAAY,WAAWA;AACpE;AAEA,OAAO,MAAMC,gBAAgB,CAACC,OAAgBC;IAC5C,MAAMC,gBAAgBD,QAAQE,UAAU,CAACC,aAAa;IACtD,MAAMN,YAAYD,yBAAyBK,iBAAiBA,gBAAgBG;IAC5E,MAAMC,QAAQR,sBAAAA,gCAAAA,UAAWQ,KAAK;IAE9B,qBACE,KAACX;QAAkBY,cAAc;YAAEC,mBAAmBZ;QAAyB;QAAI,GAAGU,KAAK;kBACzF,cAAA,KAACN;;AAGP,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithDatasourceStore.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { DatasourceStoreProvider, DatasourceStoreProviderProps } from '@perses-dev/dashboards';\nimport { defaultDatasourceProps } from '../../test';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withDatasourceStore?: WithDatasourceStoreParameter;\n }\n}\n\nexport type WithDatasourceStoreParameter = {\n props: Partial<DatasourceStoreProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithDatasourceStoreParameter(\n parameter: unknown | WithDatasourceStoreParameter\n): parameter is WithDatasourceStoreParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithDatasourceStore = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withDatasourceStore;\n const parameter = isWithDatasourceStoreParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <DatasourceStoreProvider {...defaultDatasourceProps} {...props}>\n <Story />\n </DatasourceStoreProvider>\n );\n};\n"],"names":["DatasourceStoreProvider","defaultDatasourceProps","isWithDatasourceStoreParameter","parameter","WithDatasourceStore","Story","context","initParameter","parameters","withDatasourceStore","undefined","props"],"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;AACA,SAASA,uBAAuB,QAAsC,wBAAwB,CAAC;AAC/F,SAASC,sBAAsB,QAAQ,YAAY,CAAC;AAYpD,yDAAyD;AACzD,SAASC,8BAA8B,CACrCC,SAAiD,EACN;IAC3C,OAAO,CAAC,CAACA,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAO,IAAIA,SAAS,CAAC;AAC9E,CAAC;AAED,OAAO,MAAMC,mBAAmB,GAAG,CAACC,KAAc,EAAEC,OAA8B,GAAK;IACrF,MAAMC,aAAa,GAAGD,OAAO,CAACE,UAAU,CAACC,mBAAmB,AAAC;IAC7D,MAAMN,SAAS,GAAGD,8BAA8B,CAACK,aAAa,CAAC,GAAGA,aAAa,GAAGG,SAAS,AAAC;IAC5F,MAAMC,KAAK,GAAGR,SAAS,aAATA,SAAS,WAAO,GAAhBA,KAAAA,CAAgB,GAAhBA,SAAS,CAAEQ,KAAK,AAAC;IAE/B,qBACE,KAACX,uBAAuB;QAAE,GAAGC,sBAAsB;QAAG,GAAGU,KAAK;kBAC5D,cAAA,KAACN,KAAK,KAAG;MACe,CAC1B;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/stories/decorators/WithDatasourceStore.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { DatasourceStoreProvider, DatasourceStoreProviderProps } from '@perses-dev/dashboards';\nimport { defaultDatasourceProps } from '../../test';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withDatasourceStore?: WithDatasourceStoreParameter;\n }\n}\n\nexport type WithDatasourceStoreParameter = {\n props: Partial<DatasourceStoreProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithDatasourceStoreParameter(\n parameter: unknown | WithDatasourceStoreParameter\n): parameter is WithDatasourceStoreParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithDatasourceStore = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withDatasourceStore;\n const parameter = isWithDatasourceStoreParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <DatasourceStoreProvider {...defaultDatasourceProps} {...props}>\n <Story />\n </DatasourceStoreProvider>\n );\n};\n"],"names":["DatasourceStoreProvider","defaultDatasourceProps","isWithDatasourceStoreParameter","parameter","WithDatasourceStore","Story","context","initParameter","parameters","withDatasourceStore","undefined","props"],"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;;AAGjC,SAASA,uBAAuB,QAAsC,yBAAyB;AAC/F,SAASC,sBAAsB,QAAQ,aAAa;AAYpD,yDAAyD;AACzD,SAASC,+BACPC,SAAiD;IAEjD,OAAO,CAAC,CAACA,aAAa,OAAOA,cAAc,YAAY,WAAWA;AACpE;AAEA,OAAO,MAAMC,sBAAsB,CAACC,OAAgBC;IAClD,MAAMC,gBAAgBD,QAAQE,UAAU,CAACC,mBAAmB;IAC5D,MAAMN,YAAYD,+BAA+BK,iBAAiBA,gBAAgBG;IAClF,MAAMC,QAAQR,sBAAAA,gCAAAA,UAAWQ,KAAK;IAE9B,qBACE,KAACX;QAAyB,GAAGC,sBAAsB;QAAG,GAAGU,KAAK;kBAC5D,cAAA,KAACN;;AAGP,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/WithTemplateVariables.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { TemplateVariableProvider, TemplateVariableProviderProps } from '@perses-dev/dashboards';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withTemplateVariables?: WithTemplateVariableParameter;\n }\n}\n\nexport type WithTemplateVariableParameter = {\n props: Partial<TemplateVariableProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithTemplateVariableParameter(\n parameter: unknown | WithTemplateVariableParameter\n): parameter is WithTemplateVariableParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithTemplateVariables = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withTemplateVariables;\n const parameter = isWithTemplateVariableParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <TemplateVariableProvider {...props}>\n <Story />\n </TemplateVariableProvider>\n );\n};\n"],"names":["TemplateVariableProvider","isWithTemplateVariableParameter","parameter","WithTemplateVariables","Story","context","initParameter","parameters","withTemplateVariables","undefined","props"],"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;AACA,SAASA,wBAAwB,QAAuC,wBAAwB,CAAC;AAYjG,yDAAyD;AACzD,SAASC,+BAA+B,CACtCC,SAAkD,EACN;IAC5C,OAAO,CAAC,CAACA,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,OAAO,IAAIA,SAAS,CAAC;AAC9E,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAG,CAACC,KAAc,EAAEC,OAA8B,GAAK;IACvF,MAAMC,aAAa,GAAGD,OAAO,CAACE,UAAU,CAACC,qBAAqB,AAAC;IAC/D,MAAMN,SAAS,GAAGD,+BAA+B,CAACK,aAAa,CAAC,GAAGA,aAAa,GAAGG,SAAS,AAAC;IAC7F,MAAMC,KAAK,GAAGR,SAAS,aAATA,SAAS,WAAO,GAAhBA,KAAAA,CAAgB,GAAhBA,SAAS,CAAEQ,KAAK,AAAC;IAE/B,qBACE,KAACV,wBAAwB;QAAE,GAAGU,KAAK;kBACjC,cAAA,KAACN,KAAK,KAAG;MACgB,CAC3B;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/stories/decorators/WithTemplateVariables.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 { StoryFn, StoryContext } from '@storybook/react';\nimport { TemplateVariableProvider, TemplateVariableProviderProps } from '@perses-dev/dashboards';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withTemplateVariables?: WithTemplateVariableParameter;\n }\n}\n\nexport type WithTemplateVariableParameter = {\n props: Partial<TemplateVariableProviderProps>;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithTemplateVariableParameter(\n parameter: unknown | WithTemplateVariableParameter\n): parameter is WithTemplateVariableParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithTemplateVariables = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withTemplateVariables;\n const parameter = isWithTemplateVariableParameter(initParameter) ? initParameter : undefined;\n const props = parameter?.props;\n\n return (\n <TemplateVariableProvider {...props}>\n <Story />\n </TemplateVariableProvider>\n );\n};\n"],"names":["TemplateVariableProvider","isWithTemplateVariableParameter","parameter","WithTemplateVariables","Story","context","initParameter","parameters","withTemplateVariables","undefined","props"],"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;;AAGjC,SAASA,wBAAwB,QAAuC,yBAAyB;AAYjG,yDAAyD;AACzD,SAASC,gCACPC,SAAkD;IAElD,OAAO,CAAC,CAACA,aAAa,OAAOA,cAAc,YAAY,WAAWA;AACpE;AAEA,OAAO,MAAMC,wBAAwB,CAACC,OAAgBC;IACpD,MAAMC,gBAAgBD,QAAQE,UAAU,CAACC,qBAAqB;IAC9D,MAAMN,YAAYD,gCAAgCK,iBAAiBA,gBAAgBG;IACnF,MAAMC,QAAQR,sBAAAA,gCAAAA,UAAWQ,KAAK;IAE9B,qBACE,KAACV;QAA0B,GAAGU,KAAK;kBACjC,cAAA,KAACN;;AAGP,EAAE"}
@@ -15,8 +15,8 @@ export const EMPTY_DASHBOARD_RESOURCE = {
15
15
  metadata: {
16
16
  name: 'My Dashboard',
17
17
  project: 'Storybook',
18
- created_at: '2021-11-09T00:00:00Z',
19
- updated_at: '2021-11-09T00:00:00Z',
18
+ createdAt: '2021-11-09T00:00:00Z',
19
+ updatedAt: '2021-11-09T00:00:00Z',
20
20
  version: 0
21
21
  },
22
22
  spec: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/constants.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\nimport { DashboardResource } from '@perses-dev/core';\n\nexport const EMPTY_DASHBOARD_RESOURCE: DashboardResource = {\n kind: 'Dashboard',\n metadata: {\n name: 'My Dashboard',\n project: 'Storybook',\n created_at: '2021-11-09T00:00:00Z',\n updated_at: '2021-11-09T00:00:00Z',\n version: 0,\n },\n spec: {\n duration: '1h',\n refreshInterval: '0s',\n variables: [],\n layouts: [],\n panels: {},\n },\n};\n"],"names":["EMPTY_DASHBOARD_RESOURCE","kind","metadata","name","project","created_at","updated_at","version","spec","duration","refreshInterval","variables","layouts","panels"],"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;AAIjC,OAAO,MAAMA,wBAAwB,GAAsB;IACzDC,IAAI,EAAE,WAAW;IACjBC,QAAQ,EAAE;QACRC,IAAI,EAAE,cAAc;QACpBC,OAAO,EAAE,WAAW;QACpBC,UAAU,EAAE,sBAAsB;QAClCC,UAAU,EAAE,sBAAsB;QAClCC,OAAO,EAAE,CAAC;KACX;IACDC,IAAI,EAAE;QACJC,QAAQ,EAAE,IAAI;QACdC,eAAe,EAAE,IAAI;QACrBC,SAAS,EAAE,EAAE;QACbC,OAAO,EAAE,EAAE;QACXC,MAAM,EAAE,EAAE;KACX;CACF,CAAC"}
1
+ {"version":3,"sources":["../../../src/stories/decorators/constants.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\nimport { DashboardResource } from '@perses-dev/core';\n\nexport const EMPTY_DASHBOARD_RESOURCE: DashboardResource = {\n kind: 'Dashboard',\n metadata: {\n name: 'My Dashboard',\n project: 'Storybook',\n createdAt: '2021-11-09T00:00:00Z',\n updatedAt: '2021-11-09T00:00:00Z',\n version: 0,\n },\n spec: {\n duration: '1h',\n refreshInterval: '0s',\n variables: [],\n layouts: [],\n panels: {},\n },\n};\n"],"names":["EMPTY_DASHBOARD_RESOURCE","kind","metadata","name","project","createdAt","updatedAt","version","spec","duration","refreshInterval","variables","layouts","panels"],"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;AAIjC,OAAO,MAAMA,2BAA8C;IACzDC,MAAM;IACNC,UAAU;QACRC,MAAM;QACNC,SAAS;QACTC,WAAW;QACXC,WAAW;QACXC,SAAS;IACX;IACAC,MAAM;QACJC,UAAU;QACVC,iBAAiB;QACjBC,WAAW,EAAE;QACbC,SAAS,EAAE;QACXC,QAAQ,CAAC;IACX;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/stories/decorators/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 './constants';\nexport * from './WithDashboard';\nexport * from './WithDatasourceStore';\nexport * from './WithTemplateVariables';\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,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"sources":["../../../src/stories/decorators/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 './constants';\nexport * from './WithDashboard';\nexport * from './WithDatasourceStore';\nexport * from './WithTemplateVariables';\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,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/dashboard-provider.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 { DashboardResource } from '@perses-dev/core';\nimport { useContext } from 'react';\nimport { StoreApi } from 'zustand';\nimport { DashboardContext, DashboardStoreState } from '../context';\nimport testDashboard from './testDashboard';\n\n/**\n * Helper to get a test dashboard resource.\n */\nexport function getTestDashboard(): DashboardResource {\n // TODO: Should we be cloning this to create a new object each time?\n return testDashboard;\n}\n\n/**\n * Test helper to create a \"spy\" component that will capture the DashboardProvider's store, allowing you to inspect\n * its state in tests. Be sure to render the DashboardProviderSpy component that's returned in the component test\n * underneath the DashboardProvider.\n */\nexport function createDashboardProviderSpy() {\n const store: { value?: StoreApi<DashboardStoreState> } = {};\n\n // Spy component just captures the store value so it can be inspected in tests\n function DashboardProviderSpy() {\n const ctx = useContext(DashboardContext);\n store.value = ctx;\n return null;\n }\n\n return {\n DashboardProviderSpy,\n store,\n };\n}\n"],"names":["useContext","DashboardContext","testDashboard","getTestDashboard","createDashboardProviderSpy","store","DashboardProviderSpy","ctx","value"],"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;AAGjC,SAASA,UAAU,QAAQ,OAAO,CAAC;AAEnC,SAASC,gBAAgB,QAA6B,YAAY,CAAC;AACnE,OAAOC,aAAa,MAAM,iBAAiB,CAAC;AAE5C;;CAEC,GACD,OAAO,SAASC,gBAAgB,GAAsB;IACpD,oEAAoE;IACpE,OAAOD,aAAa,CAAC;AACvB,CAAC;AAED;;;;CAIC,GACD,OAAO,SAASE,0BAA0B,GAAG;IAC3C,MAAMC,KAAK,GAA8C,EAAE,AAAC;IAE5D,8EAA8E;IAC9E,SAASC,oBAAoB,GAAG;QAC9B,MAAMC,GAAG,GAAGP,UAAU,CAACC,gBAAgB,CAAC,AAAC;QACzCI,KAAK,CAACG,KAAK,GAAGD,GAAG,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACLD,oBAAoB;QACpBD,KAAK;KACN,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../src/test/dashboard-provider.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 { DashboardResource } from '@perses-dev/core';\nimport { useContext } from 'react';\nimport { StoreApi } from 'zustand';\nimport { DashboardContext, DashboardStoreState } from '../context';\nimport testDashboard from './testDashboard';\n\n/**\n * Helper to get a test dashboard resource.\n */\nexport function getTestDashboard(): DashboardResource {\n // TODO: Should we be cloning this to create a new object each time?\n return testDashboard;\n}\n\n/**\n * Test helper to create a \"spy\" component that will capture the DashboardProvider's store, allowing you to inspect\n * its state in tests. Be sure to render the DashboardProviderSpy component that's returned in the component test\n * underneath the DashboardProvider.\n */\nexport function createDashboardProviderSpy() {\n const store: { value?: StoreApi<DashboardStoreState> } = {};\n\n // Spy component just captures the store value so it can be inspected in tests\n function DashboardProviderSpy() {\n const ctx = useContext(DashboardContext);\n store.value = ctx;\n return null;\n }\n\n return {\n DashboardProviderSpy,\n store,\n };\n}\n"],"names":["useContext","DashboardContext","testDashboard","getTestDashboard","createDashboardProviderSpy","store","DashboardProviderSpy","ctx","value"],"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;AAGjC,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,gBAAgB,QAA6B,aAAa;AACnE,OAAOC,mBAAmB,kBAAkB;AAE5C;;CAEC,GACD,OAAO,SAASC;IACd,oEAAoE;IACpE,OAAOD;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASE;IACd,MAAMC,QAAmD,CAAC;IAE1D,8EAA8E;IAC9E,SAASC;QACP,MAAMC,MAAMP,WAAWC;QACvBI,MAAMG,KAAK,GAAGD;QACd,OAAO;IACT;IAEA,OAAO;QACLD;QACAD;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"datasource-provider.d.ts","sourceRoot":"","sources":["../../src/test/datasource-provider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAG1D,eAAO,MAAM,iBAAiB,6CAA6C,CAAC;AAC5E,eAAO,MAAM,cAAc,EAAE,gBAenB,CAAC;AAKX,eAAO,MAAM,sBAAsB,EAAE,IAAI,CAAC,4BAA4B,EAAE,eAAe,GAAG,mBAAmB,CAoB5G,CAAC"}
1
+ {"version":3,"file":"datasource-provider.d.ts","sourceRoot":"","sources":["../../src/test/datasource-provider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAG1D,eAAO,MAAM,iBAAiB,6CAA6C,CAAC;AAC5E,eAAO,MAAM,cAAc,EAAE,gBAenB,CAAC;AAKX,eAAO,MAAM,sBAAsB,EAAE,IAAI,CAAC,4BAA4B,EAAE,eAAe,GAAG,mBAAmB,CAqB5G,CAAC"}
@@ -16,8 +16,8 @@ export const prometheusDemo = {
16
16
  kind: 'GlobalDatasource',
17
17
  metadata: {
18
18
  name: 'PrometheusDemo',
19
- created_at: '0001-01-01T00:00:00Z',
20
- updated_at: '0001-01-01T00:00:00Z',
19
+ createdAt: '0001-01-01T00:00:00Z',
20
+ updatedAt: '0001-01-01T00:00:00Z',
21
21
  version: 0
22
22
  },
23
23
  spec: {
@@ -25,7 +25,7 @@ export const prometheusDemo = {
25
25
  plugin: {
26
26
  kind: 'PrometheusDatasource',
27
27
  spec: {
28
- direct_url: prometheusDemoUrl
28
+ directUrl: prometheusDemoUrl
29
29
  }
30
30
  }
31
31
  }
@@ -36,15 +36,13 @@ export const prometheusDemo = {
36
36
  export const defaultDatasourceProps = {
37
37
  dashboardResource: getTestDashboard(),
38
38
  datasourceApi: {
39
+ buildProxyUrl: ()=>'',
39
40
  getDatasource: ()=>{
40
41
  return Promise.resolve(undefined);
41
42
  },
42
43
  getGlobalDatasource: (selector)=>{
43
44
  if (selector.kind === 'PrometheusDatasource') {
44
- return Promise.resolve({
45
- resource: prometheusDemo,
46
- proxyUrl: prometheusDemoUrl
47
- });
45
+ return Promise.resolve(prometheusDemo);
48
46
  }
49
47
  return Promise.resolve(undefined);
50
48
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/datasource-provider.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 { GlobalDatasource } from '@perses-dev/core';\nimport { DatasourceStoreProviderProps } from '../context';\nimport { getTestDashboard } from './dashboard-provider';\n\nexport const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';\nexport const prometheusDemo: GlobalDatasource = {\n kind: 'GlobalDatasource',\n metadata: {\n name: 'PrometheusDemo',\n created_at: '0001-01-01T00:00:00Z',\n updated_at: '0001-01-01T00:00:00Z',\n version: 0,\n },\n spec: {\n default: true,\n plugin: {\n kind: 'PrometheusDatasource',\n spec: { direct_url: prometheusDemoUrl },\n },\n },\n} as const;\n\n// This default currently defines the bare minimum to get a story working in\n// the `Dashboard` storybook with the Prometheus demo api. We'll likely want\n// to expand it to do more in the future.\nexport const defaultDatasourceProps: Pick<DatasourceStoreProviderProps, 'datasourceApi' | 'dashboardResource'> = {\n dashboardResource: getTestDashboard(),\n datasourceApi: {\n getDatasource: () => {\n return Promise.resolve(undefined);\n },\n getGlobalDatasource: (selector) => {\n if (selector.kind === 'PrometheusDatasource') {\n return Promise.resolve({ resource: prometheusDemo, proxyUrl: prometheusDemoUrl });\n }\n\n return Promise.resolve(undefined);\n },\n listDatasources: () => {\n return Promise.resolve([]);\n },\n listGlobalDatasources: () => {\n return Promise.resolve([]);\n },\n },\n};\n"],"names":["getTestDashboard","prometheusDemoUrl","prometheusDemo","kind","metadata","name","created_at","updated_at","version","spec","default","plugin","direct_url","defaultDatasourceProps","dashboardResource","datasourceApi","getDatasource","Promise","resolve","undefined","getGlobalDatasource","selector","resource","proxyUrl","listDatasources","listGlobalDatasources"],"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;AAIjC,SAASA,gBAAgB,QAAQ,sBAAsB,CAAC;AAExD,OAAO,MAAMC,iBAAiB,GAAG,0CAA0C,CAAC;AAC5E,OAAO,MAAMC,cAAc,GAAqB;IAC9CC,IAAI,EAAE,kBAAkB;IACxBC,QAAQ,EAAE;QACRC,IAAI,EAAE,gBAAgB;QACtBC,UAAU,EAAE,sBAAsB;QAClCC,UAAU,EAAE,sBAAsB;QAClCC,OAAO,EAAE,CAAC;KACX;IACDC,IAAI,EAAE;QACJC,OAAO,EAAE,IAAI;QACbC,MAAM,EAAE;YACNR,IAAI,EAAE,sBAAsB;YAC5BM,IAAI,EAAE;gBAAEG,UAAU,EAAEX,iBAAiB;aAAE;SACxC;KACF;CACF,AAAS,CAAC;AAEX,4EAA4E;AAC5E,4EAA4E;AAC5E,yCAAyC;AACzC,OAAO,MAAMY,sBAAsB,GAA8E;IAC/GC,iBAAiB,EAAEd,gBAAgB,EAAE;IACrCe,aAAa,EAAE;QACbC,aAAa,EAAE,IAAM;YACnB,OAAOC,OAAO,CAACC,OAAO,CAACC,SAAS,CAAC,CAAC;QACpC,CAAC;QACDC,mBAAmB,EAAE,CAACC,QAAQ,GAAK;YACjC,IAAIA,QAAQ,CAAClB,IAAI,KAAK,sBAAsB,EAAE;gBAC5C,OAAOc,OAAO,CAACC,OAAO,CAAC;oBAAEI,QAAQ,EAAEpB,cAAc;oBAAEqB,QAAQ,EAAEtB,iBAAiB;iBAAE,CAAC,CAAC;YACpF,CAAC;YAED,OAAOgB,OAAO,CAACC,OAAO,CAACC,SAAS,CAAC,CAAC;QACpC,CAAC;QACDK,eAAe,EAAE,IAAM;YACrB,OAAOP,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;QACDO,qBAAqB,EAAE,IAAM;YAC3B,OAAOR,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC;KACF;CACF,CAAC"}
1
+ {"version":3,"sources":["../../src/test/datasource-provider.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 { GlobalDatasource } from '@perses-dev/core';\nimport { DatasourceStoreProviderProps } from '../context';\nimport { getTestDashboard } from './dashboard-provider';\n\nexport const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';\nexport const prometheusDemo: GlobalDatasource = {\n kind: 'GlobalDatasource',\n metadata: {\n name: 'PrometheusDemo',\n createdAt: '0001-01-01T00:00:00Z',\n updatedAt: '0001-01-01T00:00:00Z',\n version: 0,\n },\n spec: {\n default: true,\n plugin: {\n kind: 'PrometheusDatasource',\n spec: { directUrl: prometheusDemoUrl },\n },\n },\n} as const;\n\n// This default currently defines the bare minimum to get a story working in\n// the `Dashboard` storybook with the Prometheus demo api. We'll likely want\n// to expand it to do more in the future.\nexport const defaultDatasourceProps: Pick<DatasourceStoreProviderProps, 'datasourceApi' | 'dashboardResource'> = {\n dashboardResource: getTestDashboard(),\n datasourceApi: {\n buildProxyUrl: () => '',\n getDatasource: () => {\n return Promise.resolve(undefined);\n },\n getGlobalDatasource: (selector) => {\n if (selector.kind === 'PrometheusDatasource') {\n return Promise.resolve(prometheusDemo);\n }\n\n return Promise.resolve(undefined);\n },\n listDatasources: () => {\n return Promise.resolve([]);\n },\n listGlobalDatasources: () => {\n return Promise.resolve([]);\n },\n },\n};\n"],"names":["getTestDashboard","prometheusDemoUrl","prometheusDemo","kind","metadata","name","createdAt","updatedAt","version","spec","default","plugin","directUrl","defaultDatasourceProps","dashboardResource","datasourceApi","buildProxyUrl","getDatasource","Promise","resolve","undefined","getGlobalDatasource","selector","listDatasources","listGlobalDatasources"],"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;AAIjC,SAASA,gBAAgB,QAAQ,uBAAuB;AAExD,OAAO,MAAMC,oBAAoB,2CAA2C;AAC5E,OAAO,MAAMC,iBAAmC;IAC9CC,MAAM;IACNC,UAAU;QACRC,MAAM;QACNC,WAAW;QACXC,WAAW;QACXC,SAAS;IACX;IACAC,MAAM;QACJC,SAAS;QACTC,QAAQ;YACNR,MAAM;YACNM,MAAM;gBAAEG,WAAWX;YAAkB;QACvC;IACF;AACF,EAAW;AAEX,4EAA4E;AAC5E,4EAA4E;AAC5E,yCAAyC;AACzC,OAAO,MAAMY,yBAAoG;IAC/GC,mBAAmBd;IACnBe,eAAe;QACbC,eAAe,IAAM;QACrBC,eAAe;YACb,OAAOC,QAAQC,OAAO,CAACC;QACzB;QACAC,qBAAqB,CAACC;YACpB,IAAIA,SAASnB,IAAI,KAAK,wBAAwB;gBAC5C,OAAOe,QAAQC,OAAO,CAACjB;YACzB;YAEA,OAAOgB,QAAQC,OAAO,CAACC;QACzB;QACAG,iBAAiB;YACf,OAAOL,QAAQC,OAAO,CAAC,EAAE;QAC3B;QACAK,uBAAuB;YACrB,OAAON,QAAQC,OAAO,CAAC,EAAE;QAC3B;IACF;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/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 './dashboard-provider';\nexport * from './datasource-provider';\nexport * from './plugin-registry';\nexport * from './render';\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,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"sources":["../../src/test/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 './dashboard-provider';\nexport * from './datasource-provider';\nexport * from './plugin-registry';\nexport * from './render';\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,uBAAuB;AACrC,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/plugin-registry.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 { UnknownSpec } from '@perses-dev/core';\nimport { PanelPlugin, MockPlugin } from '@perses-dev/plugin-system';\n\nconst FakeTimeSeriesChartOptionEditor = () => {\n return <div>TimeSeriesChart options</div>;\n};\n\nconst FakeTimeSeriesPlugin: PanelPlugin<UnknownSpec> = {\n PanelComponent: () => {\n return <div>TimeSeriesChart panel</div>;\n },\n panelOptionsEditorComponents: [\n {\n label: 'Settings',\n content: FakeTimeSeriesChartOptionEditor,\n },\n ],\n createInitialOptions: () => ({}),\n};\n\nconst MOCK_TIME_SERIES_PANEL: MockPlugin = {\n pluginType: 'Panel',\n kind: 'TimeSeriesChart',\n plugin: FakeTimeSeriesPlugin,\n};\n\n// Array of default mock plugins added to the PluginRegistry during test renders\nexport const MOCK_PLUGINS: MockPlugin[] = [MOCK_TIME_SERIES_PANEL];\n"],"names":["FakeTimeSeriesChartOptionEditor","div","FakeTimeSeriesPlugin","PanelComponent","panelOptionsEditorComponents","label","content","createInitialOptions","MOCK_TIME_SERIES_PANEL","pluginType","kind","plugin","MOCK_PLUGINS"],"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;AAGA,MAAMA,+BAA+B,GAAG,IAAM;IAC5C,qBAAO,KAACC,KAAG;kBAAC,yBAAuB;MAAM,CAAC;AAC5C,CAAC,AAAC;AAEF,MAAMC,oBAAoB,GAA6B;IACrDC,cAAc,EAAE,IAAM;QACpB,qBAAO,KAACF,KAAG;sBAAC,uBAAqB;UAAM,CAAC;IAC1C,CAAC;IACDG,4BAA4B,EAAE;QAC5B;YACEC,KAAK,EAAE,UAAU;YACjBC,OAAO,EAAEN,+BAA+B;SACzC;KACF;IACDO,oBAAoB,EAAE,IAAO,CAAA,EAAE,CAAA,AAAC;CACjC,AAAC;AAEF,MAAMC,sBAAsB,GAAe;IACzCC,UAAU,EAAE,OAAO;IACnBC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAET,oBAAoB;CAC7B,AAAC;AAEF,gFAAgF;AAChF,OAAO,MAAMU,YAAY,GAAiB;IAACJ,sBAAsB;CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/test/plugin-registry.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 { UnknownSpec } from '@perses-dev/core';\nimport { PanelPlugin, MockPlugin } from '@perses-dev/plugin-system';\n\nconst FakeTimeSeriesChartOptionEditor = () => {\n return <div>TimeSeriesChart options</div>;\n};\n\nconst FakeTimeSeriesPlugin: PanelPlugin<UnknownSpec> = {\n PanelComponent: () => {\n return <div>TimeSeriesChart panel</div>;\n },\n panelOptionsEditorComponents: [\n {\n label: 'Settings',\n content: FakeTimeSeriesChartOptionEditor,\n },\n ],\n createInitialOptions: () => ({}),\n};\n\nconst MOCK_TIME_SERIES_PANEL: MockPlugin = {\n pluginType: 'Panel',\n kind: 'TimeSeriesChart',\n plugin: FakeTimeSeriesPlugin,\n};\n\n// Array of default mock plugins added to the PluginRegistry during test renders\nexport const MOCK_PLUGINS: MockPlugin[] = [MOCK_TIME_SERIES_PANEL];\n"],"names":["FakeTimeSeriesChartOptionEditor","div","FakeTimeSeriesPlugin","PanelComponent","panelOptionsEditorComponents","label","content","createInitialOptions","MOCK_TIME_SERIES_PANEL","pluginType","kind","plugin","MOCK_PLUGINS"],"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;;AAKjC,MAAMA,kCAAkC;IACtC,qBAAO,KAACC;kBAAI;;AACd;AAEA,MAAMC,uBAAiD;IACrDC,gBAAgB;QACd,qBAAO,KAACF;sBAAI;;IACd;IACAG,8BAA8B;QAC5B;YACEC,OAAO;YACPC,SAASN;QACX;KACD;IACDO,sBAAsB,IAAO,CAAA,CAAC,CAAA;AAChC;AAEA,MAAMC,yBAAqC;IACzCC,YAAY;IACZC,MAAM;IACNC,QAAQT;AACV;AAEA,gFAAgF;AAChF,OAAO,MAAMU,eAA6B;IAACJ;CAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAuB,aAAa,EAAE,MAAM,SAAS,CAAC;AAgC7D;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,KAAK,CAAC,YAAY,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EACxC,OAAO,CAAC,EAAE,aAAa,gIAsBxB"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAuB,aAAa,EAAE,MAAM,SAAS,CAAC;AAkC7D;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,KAAK,CAAC,YAAY,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EACxC,OAAO,CAAC,EAAE,aAAa,gIAwBxB"}
@@ -18,13 +18,15 @@ import { createMemoryHistory } from 'history';
18
18
  import { QueryParamProvider } from 'use-query-params';
19
19
  import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';
20
20
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
21
- import { ChartsThemeProvider, SnackbarProvider, testChartsTheme } from '@perses-dev/components';
21
+ import { ChartsProvider, SnackbarProvider, testChartsTheme } from '@perses-dev/components';
22
22
  import { mockPluginRegistry, PluginRegistry } from '@perses-dev/plugin-system';
23
+ import { DatasourceStoreProvider } from '../context';
24
+ import { defaultDatasourceProps } from '../test';
23
25
  import { MOCK_PLUGINS } from './plugin-registry';
24
26
  /*
25
27
  * Workaround for React router upgrade type errors.
26
28
  * More details: https://stackoverflow.com/a/69948457/17575201
27
- */ const CustomRouter = ({ history , children })=>{
29
+ */ const CustomRouter = ({ history, children })=>{
28
30
  const [state, setState] = useState({
29
31
  action: history.action,
30
32
  location: history.location
@@ -63,11 +65,14 @@ import { MOCK_PLUGINS } from './plugin-registry';
63
65
  vertical: 'bottom',
64
66
  horizontal: 'right'
65
67
  },
66
- children: /*#__PURE__*/ _jsx(ChartsThemeProvider, {
68
+ children: /*#__PURE__*/ _jsx(ChartsProvider, {
67
69
  chartsTheme: testChartsTheme,
68
70
  children: /*#__PURE__*/ _jsx(PluginRegistry, {
69
71
  ...mockPluginRegistry(...MOCK_PLUGINS),
70
- children: ui
72
+ children: /*#__PURE__*/ _jsx(DatasourceStoreProvider, {
73
+ ...defaultDatasourceProps,
74
+ children: ui
75
+ })
71
76
  })
72
77
  })
73
78
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/render.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 { useLayoutEffect, useState } from 'react';\nimport { render, RenderOptions } from '@testing-library/react';\nimport { Router } from 'react-router-dom';\nimport { createMemoryHistory, MemoryHistory } from 'history';\nimport { QueryParamProvider } from 'use-query-params';\nimport { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ChartsThemeProvider, SnackbarProvider, testChartsTheme } from '@perses-dev/components';\nimport { mockPluginRegistry, PluginRegistry } from '@perses-dev/plugin-system';\nimport { MOCK_PLUGINS } from './plugin-registry';\n\ninterface CustomRouterProps {\n history: MemoryHistory;\n children: React.ReactNode;\n}\n\n/*\n * Workaround for React router upgrade type errors.\n * More details: https://stackoverflow.com/a/69948457/17575201\n */\nconst CustomRouter: React.FC<CustomRouterProps> = ({ history, children }) => {\n const [state, setState] = useState({\n action: history.action,\n location: history.location,\n });\n\n useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router location={state.location} navigationType={state.action} navigator={history}>\n {children}\n </Router>\n );\n};\n\n/**\n * Test helper to render a React component with some common app-level providers wrapped around it.\n */\nexport function renderWithContext(\n ui: React.ReactElement,\n options?: Omit<RenderOptions, 'queries'>,\n history?: MemoryHistory\n) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } } });\n\n const customHistory = history ?? createMemoryHistory();\n\n const BaseRender = () => (\n <CustomRouter history={customHistory}>\n <QueryClientProvider client={queryClient}>\n <QueryParamProvider adapter={ReactRouter6Adapter}>\n <SnackbarProvider anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}>\n <ChartsThemeProvider chartsTheme={testChartsTheme}>\n <PluginRegistry {...mockPluginRegistry(...MOCK_PLUGINS)}>{ui}</PluginRegistry>\n </ChartsThemeProvider>\n </SnackbarProvider>\n </QueryParamProvider>\n </QueryClientProvider>\n </CustomRouter>\n );\n\n return render(<BaseRender />, options);\n}\n"],"names":["useLayoutEffect","useState","render","Router","createMemoryHistory","QueryParamProvider","ReactRouter6Adapter","QueryClient","QueryClientProvider","ChartsThemeProvider","SnackbarProvider","testChartsTheme","mockPluginRegistry","PluginRegistry","MOCK_PLUGINS","CustomRouter","history","children","state","setState","action","location","listen","navigationType","navigator","renderWithContext","ui","options","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","customHistory","BaseRender","client","adapter","anchorOrigin","vertical","horizontal","chartsTheme"],"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;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO,CAAC;AAClD,SAASC,MAAM,QAAuB,wBAAwB,CAAC;AAC/D,SAASC,MAAM,QAAQ,kBAAkB,CAAC;AAC1C,SAASC,mBAAmB,QAAuB,SAAS,CAAC;AAC7D,SAASC,kBAAkB,QAAQ,kBAAkB,CAAC;AACtD,SAASC,mBAAmB,QAAQ,0CAA0C,CAAC;AAC/E,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,uBAAuB,CAAC;AACzE,SAASC,mBAAmB,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,wBAAwB,CAAC;AAChG,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,2BAA2B,CAAC;AAC/E,SAASC,YAAY,QAAQ,mBAAmB,CAAC;AAOjD;;;CAGC,GACD,MAAMC,YAAY,GAAgC,CAAC,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAK;IAC3E,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGlB,QAAQ,CAAC;QACjCmB,MAAM,EAAEJ,OAAO,CAACI,MAAM;QACtBC,QAAQ,EAAEL,OAAO,CAACK,QAAQ;KAC3B,CAAC,AAAC;IAEHrB,eAAe,CAAC,IAAMgB,OAAO,CAACM,MAAM,CAACH,QAAQ,CAAC,EAAE;QAACH,OAAO;KAAC,CAAC,CAAC;IAE3D,qBACE,KAACb,MAAM;QAACkB,QAAQ,EAAEH,KAAK,CAACG,QAAQ;QAAEE,cAAc,EAAEL,KAAK,CAACE,MAAM;QAAEI,SAAS,EAAER,OAAO;kBAC/EC,QAAQ;MACF,CACT;AACJ,CAAC,AAAC;AAEF;;CAEC,GACD,OAAO,SAASQ,iBAAiB,CAC/BC,EAAsB,EACtBC,OAAwC,EACxCX,OAAuB,EACvB;IACA,iEAAiE;IACjE,MAAMY,WAAW,GAAG,IAAIrB,WAAW,CAAC;QAAEsB,cAAc,EAAE;YAAEC,OAAO,EAAE;gBAAEC,oBAAoB,EAAE,KAAK;gBAAEC,KAAK,EAAE,KAAK;aAAE;SAAE;KAAE,CAAC,AAAC;IAEpH,MAAMC,aAAa,GAAGjB,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAIZ,mBAAmB,EAAE,AAAC;IAEvD,MAAM8B,UAAU,GAAG,kBACjB,KAACnB,YAAY;YAACC,OAAO,EAAEiB,aAAa;sBAClC,cAAA,KAACzB,mBAAmB;gBAAC2B,MAAM,EAAEP,WAAW;0BACtC,cAAA,KAACvB,kBAAkB;oBAAC+B,OAAO,EAAE9B,mBAAmB;8BAC9C,cAAA,KAACI,gBAAgB;wBAAC2B,YAAY,EAAE;4BAAEC,QAAQ,EAAE,QAAQ;4BAAEC,UAAU,EAAE,OAAO;yBAAE;kCACzE,cAAA,KAAC9B,mBAAmB;4BAAC+B,WAAW,EAAE7B,eAAe;sCAC/C,cAAA,KAACE,cAAc;gCAAE,GAAGD,kBAAkB,IAAIE,YAAY,CAAC;0CAAGY,EAAE;8BAAkB;0BAC1D;sBACL;kBACA;cACD;UACT,AAChB,AAAC;IAEF,OAAOxB,MAAM,eAAC,KAACgC,UAAU,KAAG,EAAEP,OAAO,CAAC,CAAC;AACzC,CAAC"}
1
+ {"version":3,"sources":["../../src/test/render.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 { useLayoutEffect, useState } from 'react';\nimport { render, RenderOptions } from '@testing-library/react';\nimport { Router } from 'react-router-dom';\nimport { createMemoryHistory, MemoryHistory } from 'history';\nimport { QueryParamProvider } from 'use-query-params';\nimport { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { ChartsProvider, SnackbarProvider, testChartsTheme } from '@perses-dev/components';\nimport { mockPluginRegistry, PluginRegistry } from '@perses-dev/plugin-system';\nimport { DatasourceStoreProvider } from '../context';\nimport { defaultDatasourceProps } from '../test';\nimport { MOCK_PLUGINS } from './plugin-registry';\n\ninterface CustomRouterProps {\n history: MemoryHistory;\n children: React.ReactNode;\n}\n\n/*\n * Workaround for React router upgrade type errors.\n * More details: https://stackoverflow.com/a/69948457/17575201\n */\nconst CustomRouter: React.FC<CustomRouterProps> = ({ history, children }) => {\n const [state, setState] = useState({\n action: history.action,\n location: history.location,\n });\n\n useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router location={state.location} navigationType={state.action} navigator={history}>\n {children}\n </Router>\n );\n};\n\n/**\n * Test helper to render a React component with some common app-level providers wrapped around it.\n */\nexport function renderWithContext(\n ui: React.ReactElement,\n options?: Omit<RenderOptions, 'queries'>,\n history?: MemoryHistory\n) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({ defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } } });\n\n const customHistory = history ?? createMemoryHistory();\n\n const BaseRender = () => (\n <CustomRouter history={customHistory}>\n <QueryClientProvider client={queryClient}>\n <QueryParamProvider adapter={ReactRouter6Adapter}>\n <SnackbarProvider anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}>\n <ChartsProvider chartsTheme={testChartsTheme}>\n <PluginRegistry {...mockPluginRegistry(...MOCK_PLUGINS)}>\n <DatasourceStoreProvider {...defaultDatasourceProps}>{ui}</DatasourceStoreProvider>\n </PluginRegistry>\n </ChartsProvider>\n </SnackbarProvider>\n </QueryParamProvider>\n </QueryClientProvider>\n </CustomRouter>\n );\n\n return render(<BaseRender />, options);\n}\n"],"names":["useLayoutEffect","useState","render","Router","createMemoryHistory","QueryParamProvider","ReactRouter6Adapter","QueryClient","QueryClientProvider","ChartsProvider","SnackbarProvider","testChartsTheme","mockPluginRegistry","PluginRegistry","DatasourceStoreProvider","defaultDatasourceProps","MOCK_PLUGINS","CustomRouter","history","children","state","setState","action","location","listen","navigationType","navigator","renderWithContext","ui","options","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","customHistory","BaseRender","client","adapter","anchorOrigin","vertical","horizontal","chartsTheme"],"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,eAAe,EAAEC,QAAQ,QAAQ,QAAQ;AAClD,SAASC,MAAM,QAAuB,yBAAyB;AAC/D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,mBAAmB,QAAuB,UAAU;AAC7D,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,wBAAwB;AACzE,SAASC,cAAc,EAAEC,gBAAgB,EAAEC,eAAe,QAAQ,yBAAyB;AAC3F,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,4BAA4B;AAC/E,SAASC,uBAAuB,QAAQ,aAAa;AACrD,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SAASC,YAAY,QAAQ,oBAAoB;AAOjD;;;CAGC,GACD,MAAMC,eAA4C,CAAC,EAAEC,OAAO,EAAEC,QAAQ,EAAE;IACtE,MAAM,CAACC,OAAOC,SAAS,GAAGpB,SAAS;QACjCqB,QAAQJ,QAAQI,MAAM;QACtBC,UAAUL,QAAQK,QAAQ;IAC5B;IAEAvB,gBAAgB,IAAMkB,QAAQM,MAAM,CAACH,WAAW;QAACH;KAAQ;IAEzD,qBACE,KAACf;QAAOoB,UAAUH,MAAMG,QAAQ;QAAEE,gBAAgBL,MAAME,MAAM;QAAEI,WAAWR;kBACxEC;;AAGP;AAEA;;CAEC,GACD,OAAO,SAASQ,kBACdC,EAAsB,EACtBC,OAAwC,EACxCX,OAAuB;IAEvB,iEAAiE;IACjE,MAAMY,cAAc,IAAIvB,YAAY;QAAEwB,gBAAgB;YAAEC,SAAS;gBAAEC,sBAAsB;gBAAOC,OAAO;YAAM;QAAE;IAAE;IAEjH,MAAMC,gBAAgBjB,oBAAAA,qBAAAA,UAAWd;IAEjC,MAAMgC,aAAa,kBACjB,KAACnB;YAAaC,SAASiB;sBACrB,cAAA,KAAC3B;gBAAoB6B,QAAQP;0BAC3B,cAAA,KAACzB;oBAAmBiC,SAAShC;8BAC3B,cAAA,KAACI;wBAAiB6B,cAAc;4BAAEC,UAAU;4BAAUC,YAAY;wBAAQ;kCACxE,cAAA,KAAChC;4BAAeiC,aAAa/B;sCAC3B,cAAA,KAACE;gCAAgB,GAAGD,sBAAsBI,aAAa;0CACrD,cAAA,KAACF;oCAAyB,GAAGC,sBAAsB;8CAAGa;;;;;;;;IASpE,OAAO1B,qBAAO,KAACkC,iBAAeP;AAChC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/setup-tests.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\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"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,qBAAqB,QAAQ,6BAA6B,CAAC;AAEpE,iCAAiC;AACjC,OAAO,yCAAyC,CAAC;AAEjD,iFAAiF;AACjFC,IAAI,CAACC,IAAI,CAAC,cAAc,CAAC,CAAC;AAE1B,qHAAqH;AACrH,qBAAqB;AACrBF,qBAAqB,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/test/setup-tests.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\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"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,qBAAqB,QAAQ,8BAA8B;AAEpE,iCAAiC;AACjC,OAAO,0CAA0C;AAEjD,iFAAiF;AACjFC,KAAKC,IAAI,CAAC;AAEV,qHAAqH;AACrH,qBAAqB;AACrBF,sBAAsB"}
@@ -15,8 +15,8 @@ const testDashboard = {
15
15
  metadata: {
16
16
  name: 'Node Stats',
17
17
  project: 'perses',
18
- created_at: '2021-11-09',
19
- updated_at: '2021-11-09',
18
+ createdAt: '2021-11-09',
19
+ updatedAt: '2021-11-09',
20
20
  version: 0
21
21
  },
22
22
  spec: {
@@ -55,8 +55,8 @@ const testDashboard = {
55
55
  plugin: {
56
56
  kind: 'TimeSeriesChart',
57
57
  spec: {
58
- unit: {
59
- kind: '%'
58
+ format: {
59
+ unit: '%'
60
60
  }
61
61
  }
62
62
  },
@@ -84,8 +84,8 @@ const testDashboard = {
84
84
  plugin: {
85
85
  kind: 'TimeSeriesChart',
86
86
  spec: {
87
- unit: {
88
- kind: 'Bytes'
87
+ format: {
88
+ unit: 'bytes'
89
89
  }
90
90
  }
91
91
  },
@@ -147,8 +147,8 @@ const testDashboard = {
147
147
  plugin: {
148
148
  kind: 'TimeSeriesChart',
149
149
  spec: {
150
- unit: {
151
- kind: 'Percent'
150
+ format: {
151
+ unit: 'percent'
152
152
  }
153
153
  }
154
154
  },
@@ -176,8 +176,8 @@ const testDashboard = {
176
176
  plugin: {
177
177
  kind: 'TimeSeriesChart',
178
178
  spec: {
179
- unit: {
180
- kind: 'Percent'
179
+ format: {
180
+ unit: 'percent'
181
181
  }
182
182
  }
183
183
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/test/testDashboard.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\nimport { DashboardResource } from '@perses-dev/core';\n\nconst testDashboard: DashboardResource = {\n kind: 'Dashboard',\n metadata: {\n name: 'Node Stats',\n project: 'perses',\n created_at: '2021-11-09',\n updated_at: '2021-11-09',\n version: 0,\n },\n spec: {\n duration: '30m',\n refreshInterval: '0s',\n variables: [\n {\n kind: 'TextVariable',\n spec: {\n name: 'job',\n value: 'node',\n },\n },\n {\n kind: 'TextVariable',\n spec: {\n name: 'instance',\n value: 'demo.do.prometheus.io:9100',\n },\n },\n {\n kind: 'TextVariable',\n spec: {\n name: 'interval',\n value: '1m',\n },\n },\n ],\n panels: {\n cpu: {\n kind: 'Panel',\n spec: {\n display: { name: 'CPU' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n unit: { kind: '%' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'avg without (cpu)(rate(node_cpu_seconds_total{job=\"node\",instance=\"$instance\",mode!=\"idle\"}[$interval]))',\n },\n },\n },\n },\n ],\n },\n },\n memory: {\n kind: 'Panel',\n spec: {\n display: { name: 'Memory' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n unit: { kind: 'Bytes' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'node_memory_MemTotal_bytes{job=\"node\",instance=\"$instance\"} - node_memory_MemFree_bytes{job=\"node\",instance=\"$instance\"} - node_memory_Buffers_bytes{job=\"node\",instance=\"$instance\"} - node_memory_Cached_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_Buffers_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_Cached_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_MemFree_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n ],\n },\n },\n // This panel is referenced in more than one layout below\n diskIO: {\n kind: 'Panel',\n spec: {\n display: { name: 'Disk I/O Utilization' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n unit: { kind: 'Percent' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'rate(node_disk_io_time_seconds_total{job=\"node\",instance=\"$instance\",device!~\"^(md\\\\\\\\d+$|dm-)\"}[$interval])',\n },\n },\n },\n },\n ],\n },\n },\n filesystemFullness: {\n kind: 'Panel',\n spec: {\n display: { name: 'Filesystem Fullness' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n unit: { kind: 'Percent' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n '1 - node_filesystem_free_bytes{job=\"node\",instance=\"$instance\",fstype!=\"rootfs\",mountpoint!~\"/(run|var).*\",mountpoint!=\"\"} / node_filesystem_size_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n ],\n },\n },\n },\n layouts: [\n // Regular Title, no collapse enabled\n {\n kind: 'Grid',\n spec: {\n display: {\n title: 'CPU Stats',\n collapse: {\n open: true,\n },\n },\n items: [\n // First Row\n {\n x: 0,\n y: 0,\n width: 12,\n height: 4,\n content: { $ref: '#/spec/panels/cpu' },\n },\n {\n x: 0,\n y: 5,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/diskIO' },\n },\n ],\n },\n },\n // No title,\n {\n kind: 'Grid',\n spec: {\n items: [\n {\n x: 0,\n y: 0,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/diskIO' },\n },\n {\n x: 8,\n y: 0,\n width: 8,\n height: 3,\n content: { $ref: '#/spec/panels/memory' },\n },\n ],\n },\n },\n // Collapsed\n {\n kind: 'Grid',\n spec: {\n display: {\n title: 'Disk Stats',\n collapse: {\n open: false,\n },\n },\n items: [\n {\n x: 18,\n y: 0,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/filesystemFullness' },\n },\n ],\n },\n },\n ],\n },\n};\n\nexport default testDashboard;\n"],"names":["testDashboard","kind","metadata","name","project","created_at","updated_at","version","spec","duration","refreshInterval","variables","value","panels","cpu","display","plugin","unit","queries","query","memory","diskIO","filesystemFullness","layouts","title","collapse","open","items","x","y","width","height","content","$ref"],"mappings":"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"}
1
+ {"version":3,"sources":["../../src/test/testDashboard.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\nimport { DashboardResource } from '@perses-dev/core';\n\nconst testDashboard: DashboardResource = {\n kind: 'Dashboard',\n metadata: {\n name: 'Node Stats',\n project: 'perses',\n createdAt: '2021-11-09',\n updatedAt: '2021-11-09',\n version: 0,\n },\n spec: {\n duration: '30m',\n refreshInterval: '0s',\n variables: [\n {\n kind: 'TextVariable',\n spec: {\n name: 'job',\n value: 'node',\n },\n },\n {\n kind: 'TextVariable',\n spec: {\n name: 'instance',\n value: 'demo.do.prometheus.io:9100',\n },\n },\n {\n kind: 'TextVariable',\n spec: {\n name: 'interval',\n value: '1m',\n },\n },\n ],\n panels: {\n cpu: {\n kind: 'Panel',\n spec: {\n display: { name: 'CPU' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n format: { unit: '%' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'avg without (cpu)(rate(node_cpu_seconds_total{job=\"node\",instance=\"$instance\",mode!=\"idle\"}[$interval]))',\n },\n },\n },\n },\n ],\n },\n },\n memory: {\n kind: 'Panel',\n spec: {\n display: { name: 'Memory' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n format: { unit: 'bytes' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'node_memory_MemTotal_bytes{job=\"node\",instance=\"$instance\"} - node_memory_MemFree_bytes{job=\"node\",instance=\"$instance\"} - node_memory_Buffers_bytes{job=\"node\",instance=\"$instance\"} - node_memory_Cached_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_Buffers_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_Cached_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query: 'node_memory_MemFree_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n ],\n },\n },\n // This panel is referenced in more than one layout below\n diskIO: {\n kind: 'Panel',\n spec: {\n display: { name: 'Disk I/O Utilization' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n format: { unit: 'percent' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n 'rate(node_disk_io_time_seconds_total{job=\"node\",instance=\"$instance\",device!~\"^(md\\\\\\\\d+$|dm-)\"}[$interval])',\n },\n },\n },\n },\n ],\n },\n },\n filesystemFullness: {\n kind: 'Panel',\n spec: {\n display: { name: 'Filesystem Fullness' },\n plugin: {\n kind: 'TimeSeriesChart',\n spec: {\n format: { unit: 'percent' },\n },\n },\n queries: [\n {\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: {\n kind: 'PrometheusTimeSeriesQuery',\n spec: {\n query:\n '1 - node_filesystem_free_bytes{job=\"node\",instance=\"$instance\",fstype!=\"rootfs\",mountpoint!~\"/(run|var).*\",mountpoint!=\"\"} / node_filesystem_size_bytes{job=\"node\",instance=\"$instance\"}',\n },\n },\n },\n },\n ],\n },\n },\n },\n layouts: [\n // Regular Title, no collapse enabled\n {\n kind: 'Grid',\n spec: {\n display: {\n title: 'CPU Stats',\n collapse: {\n open: true,\n },\n },\n items: [\n // First Row\n {\n x: 0,\n y: 0,\n width: 12,\n height: 4,\n content: { $ref: '#/spec/panels/cpu' },\n },\n {\n x: 0,\n y: 5,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/diskIO' },\n },\n ],\n },\n },\n // No title,\n {\n kind: 'Grid',\n spec: {\n items: [\n {\n x: 0,\n y: 0,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/diskIO' },\n },\n {\n x: 8,\n y: 0,\n width: 8,\n height: 3,\n content: { $ref: '#/spec/panels/memory' },\n },\n ],\n },\n },\n // Collapsed\n {\n kind: 'Grid',\n spec: {\n display: {\n title: 'Disk Stats',\n collapse: {\n open: false,\n },\n },\n items: [\n {\n x: 18,\n y: 0,\n width: 6,\n height: 2,\n content: { $ref: '#/spec/panels/filesystemFullness' },\n },\n ],\n },\n },\n ],\n },\n};\n\nexport default testDashboard;\n"],"names":["testDashboard","kind","metadata","name","project","createdAt","updatedAt","version","spec","duration","refreshInterval","variables","value","panels","cpu","display","plugin","format","unit","queries","query","memory","diskIO","filesystemFullness","layouts","title","collapse","open","items","x","y","width","height","content","$ref"],"mappings":"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"}
@@ -1,3 +1,2 @@
1
1
  export * from './panelUtils';
2
- export * from './time';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
@@ -11,6 +11,5 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export * from './panelUtils';
14
- export * from './time';
15
14
 
16
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/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 './panelUtils';\nexport * from './time';\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,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"sources":["../../src/utils/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 './panelUtils';\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,eAAe"}
@@ -1,7 +1,7 @@
1
1
  import { PanelDefinition } from '@perses-dev/core';
2
2
  import { PanelGroupDefinition, PanelGroupItemLayout } from '../context';
3
3
  export declare function getYForNewRow(group: PanelGroupDefinition): number;
4
- export declare type UnpositionedPanelGroupItemLayout = Omit<PanelGroupItemLayout, 'x' | 'y'>;
4
+ export type UnpositionedPanelGroupItemLayout = Omit<PanelGroupItemLayout, 'x' | 'y'>;
5
5
  /**
6
6
  * Inserts a new panel into the layout with placement determined by a specified
7
7
  * reference panel. The new panel is placed:
@@ -1 +1 @@
1
- {"version":3,"file":"panelUtils.d.ts","sourceRoot":"","sources":["../../src/utils/panelUtils.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIxE,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,UASxD;AA8BD,oBAAY,gCAAgC,GAAG,IAAI,CAAC,oBAAoB,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;AAErF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,gCAAgC,EAC3C,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,oBAAoB,EAAE,GAClC,oBAAoB,EAAE,CAyExB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CASlG"}
1
+ {"version":3,"file":"panelUtils.d.ts","sourceRoot":"","sources":["../../src/utils/panelUtils.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIxE,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,UASxD;AA8BD,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,oBAAoB,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC;AAErF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,gCAAgC,EAC3C,eAAe,EAAE,oBAAoB,EACrC,WAAW,EAAE,oBAAoB,EAAE,GAClC,oBAAoB,EAAE,CAyExB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CASlG"}
@@ -22,7 +22,7 @@ export function getYForNewRow(group) {
22
22
  }
23
23
  return newRowY;
24
24
  }
25
- function getPanelBounds({ x , y , w , h }) {
25
+ function getPanelBounds({ x, y, w, h }) {
26
26
  return {
27
27
  x1: x,
28
28
  x2: x + w,
@@ -157,7 +157,7 @@ const removeWhiteSpaces = (str)=>{
157
157
  function getUniquePanelKeys(panels) {
158
158
  const uniquePanelKeys = {};
159
159
  Object.keys(panels).forEach((panelKey)=>{
160
- const { name , number } = getPanelKeyParts(panelKey);
160
+ const { name, number } = getPanelKeyParts(panelKey);
161
161
  if (uniquePanelKeys[name] === undefined) {
162
162
  uniquePanelKeys[name] = 0;
163
163
  }