@perses-dev/dashboards 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +9 -2
- package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +6 -6
- package/dist/cjs/components/Datasources/DatasourceEditor.js +19 -20
- package/dist/cjs/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/cjs/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/cjs/components/EditButton/EditButton.js +1 -1
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/cjs/components/GridLayout/GridContainer.js +16 -11
- package/dist/cjs/components/GridLayout/GridItemContent.js +24 -10
- package/dist/cjs/components/GridLayout/GridLayout.js +63 -14
- package/dist/cjs/components/GridLayout/GridTitle.js +8 -9
- package/dist/cjs/{validation/panel.js → components/Panel/HeaderIconButton.js} +8 -10
- package/dist/cjs/components/Panel/Panel.js +15 -11
- package/dist/cjs/components/Panel/PanelActions.js +216 -0
- package/dist/cjs/components/Panel/PanelContent.js +6 -6
- package/dist/cjs/components/Panel/PanelHeader.js +36 -103
- package/dist/cjs/components/Panel/PanelLinks.js +136 -0
- package/dist/cjs/components/PanelDrawer/PanelDrawer.js +9 -6
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +67 -62
- package/dist/cjs/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/cjs/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +7 -9
- package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +8 -8
- package/dist/cjs/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/cjs/components/Variables/EditVariablesButton.js +5 -5
- package/dist/cjs/components/Variables/{TemplateVariable.js → Variable.js} +48 -56
- package/dist/cjs/components/Variables/VariableEditor.js +39 -46
- package/dist/cjs/components/Variables/VariableList.js +23 -22
- package/dist/cjs/components/Variables/index.js +2 -2
- package/dist/cjs/components/index.js +0 -2
- package/dist/cjs/constants/styles.js +17 -9
- package/dist/cjs/constants/user-interface-text.js +6 -5
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +24 -17
- package/dist/cjs/context/DashboardProvider/DashboardProviderWithQueryParams.js +36 -0
- package/dist/cjs/context/DashboardProvider/common.js +5 -5
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +51 -43
- package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +11 -16
- package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/cjs/context/DashboardProvider/panel-group-slice.js +13 -8
- package/dist/cjs/context/DashboardProvider/view-panel-slice.js +79 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +32 -31
- package/dist/cjs/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +128 -131
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +11 -14
- package/dist/cjs/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/query-params.js +8 -8
- package/dist/cjs/context/{TemplateVariableProvider → VariableProvider}/utils.js +6 -6
- package/dist/cjs/context/index.js +2 -2
- package/dist/cjs/context/useDashboard.js +24 -9
- package/dist/cjs/stories/decorators/WithDashboard.js +1 -1
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/cjs/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/cjs/stories/decorators/index.js +2 -2
- package/dist/cjs/test/dashboard-provider.js +3 -3
- package/dist/cjs/test/datasource-provider.js +4 -4
- package/dist/cjs/test/plugin-registry.js +4 -2
- package/dist/cjs/test/render.js +14 -12
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/panelUtils.js +5 -5
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +10 -11
- package/dist/components/AddGroupButton/AddGroupButton.d.ts +2 -2
- package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js +1 -1
- package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +2 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +3 -3
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +9 -2
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +2 -2
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -1
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +4 -4
- package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +5 -5
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.d.ts +2 -2
- package/dist/components/Datasources/DatasourceEditor.d.ts.map +1 -1
- package/dist/components/Datasources/DatasourceEditor.js +20 -21
- package/dist/components/Datasources/DatasourceEditor.js.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.d.ts +2 -2
- package/dist/components/Datasources/EditDatasourcesButton.d.ts.map +1 -1
- package/dist/components/Datasources/EditDatasourcesButton.js +11 -8
- package/dist/components/Datasources/EditDatasourcesButton.js.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts +2 -2
- package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js +4 -4
- package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts +2 -2
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.d.ts.map +1 -1
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +4 -5
- package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
- package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.d.ts +2 -2
- package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.js +3 -4
- package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +2 -2
- package/dist/components/EditButton/EditButton.d.ts.map +1 -1
- package/dist/components/EditButton/EditButton.js +1 -1
- package/dist/components/EditButton/EditButton.js.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +2 -2
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -1
- package/dist/components/EditJsonButton/EditJsonButton.js +3 -4
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +2 -2
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
- package/dist/components/EditJsonDialog/EditJsonDialog.js +21 -17
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +3 -3
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -1
- package/dist/components/EmptyDashboard/EmptyDashboard.js +5 -5
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -1
- package/dist/components/GridLayout/GridContainer.d.ts +5 -3
- package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
- package/dist/components/GridLayout/GridContainer.js +16 -11
- package/dist/components/GridLayout/GridContainer.js.map +1 -1
- package/dist/components/GridLayout/GridItemContent.d.ts +2 -2
- package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
- package/dist/components/GridLayout/GridItemContent.js +25 -11
- package/dist/components/GridLayout/GridItemContent.js.map +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts +4 -3
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js +65 -16
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +3 -3
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js +8 -9
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/Panel/HeaderIconButton.d.ts +5 -0
- package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -0
- package/dist/components/{TimeRangeControls/index.js → Panel/HeaderIconButton.js} +7 -3
- package/dist/components/Panel/HeaderIconButton.js.map +1 -0
- package/dist/components/Panel/Panel.d.ts +13 -7
- package/dist/components/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +16 -12
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelActions.d.ts +16 -0
- package/dist/components/Panel/PanelActions.d.ts.map +1 -0
- package/dist/components/Panel/PanelActions.js +203 -0
- package/dist/components/Panel/PanelActions.js.map +1 -0
- package/dist/components/Panel/PanelContent.d.ts +2 -2
- package/dist/components/Panel/PanelContent.d.ts.map +1 -1
- package/dist/components/Panel/PanelContent.js +6 -6
- package/dist/components/Panel/PanelContent.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +9 -9
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +39 -106
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- package/dist/components/Panel/PanelLinks.d.ts +6 -0
- package/dist/components/Panel/PanelLinks.d.ts.map +1 -0
- package/dist/components/Panel/PanelLinks.js +123 -0
- package/dist/components/Panel/PanelLinks.js.map +1 -0
- package/dist/components/PanelDrawer/PanelDrawer.d.ts +2 -2
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +10 -7
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +3 -4
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +70 -65
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +3 -3
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js +9 -6
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.d.ts +12 -10
- package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -1
- package/dist/components/PanelDrawer/usePanelEditor.js +9 -6
- package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts +2 -2
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.d.ts.map +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
- package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +2 -2
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -1
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +5 -7
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +2 -2
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -1
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +8 -10
- package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +2 -2
- package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -1
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js +9 -9
- package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts +3 -3
- package/dist/components/Variables/BuiltinVariableAccordions.d.ts.map +1 -1
- package/dist/components/Variables/BuiltinVariableAccordions.js +8 -14
- package/dist/components/Variables/BuiltinVariableAccordions.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +2 -2
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +6 -6
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/Variables/{TemplateVariable.d.ts → Variable.d.ts} +6 -6
- package/dist/components/Variables/Variable.d.ts.map +1 -0
- package/dist/components/Variables/{TemplateVariable.js → Variable.js} +49 -57
- package/dist/components/Variables/Variable.js.map +1 -0
- package/dist/components/Variables/VariableEditor.d.ts +3 -3
- package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditor.js +40 -47
- package/dist/components/Variables/VariableEditor.js.map +1 -1
- package/dist/components/Variables/VariableList.d.ts +4 -4
- package/dist/components/Variables/VariableList.d.ts.map +1 -1
- package/dist/components/Variables/VariableList.js +21 -20
- package/dist/components/Variables/VariableList.js.map +1 -1
- package/dist/components/Variables/index.d.ts +1 -1
- package/dist/components/Variables/index.d.ts.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +1 -1
- package/dist/constants/styles.d.ts +4 -2
- package/dist/constants/styles.d.ts.map +1 -1
- package/dist/constants/styles.js +5 -3
- package/dist/constants/styles.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +3 -2
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +3 -2
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +11 -6
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +22 -15
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts +4 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.d.ts.map +1 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js +28 -0
- package/dist/context/DashboardProvider/DashboardProviderWithQueryParams.js.map +1 -0
- package/dist/context/DashboardProvider/common.d.ts +3 -3
- package/dist/context/DashboardProvider/common.d.ts.map +1 -1
- package/dist/context/DashboardProvider/common.js +2 -2
- package/dist/context/DashboardProvider/common.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +36 -23
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +26 -19
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-slice.js +4 -5
- package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js +1 -1
- package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/index.d.ts +1 -2
- package/dist/context/DashboardProvider/index.d.ts.map +1 -1
- package/dist/context/DashboardProvider/index.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +2 -9
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js +8 -13
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -2
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +3 -3
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js +8 -4
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.d.ts +21 -0
- package/dist/context/DashboardProvider/view-panel-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/view-panel-slice.js +73 -0
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +10 -10
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +32 -31
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts +119 -0
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider/TemplateVariableProvider.js → VariableProvider/VariableProvider.js} +117 -116
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.d.ts +1 -1
- package/dist/context/VariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/hydrationUtils.js +9 -12
- package/dist/context/VariableProvider/hydrationUtils.js.map +1 -0
- package/dist/context/VariableProvider/index.d.ts +2 -0
- package/dist/context/VariableProvider/index.d.ts.map +1 -0
- package/dist/{validation → context/VariableProvider}/index.js +2 -2
- package/dist/context/VariableProvider/index.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.d.ts +2 -6
- package/dist/context/VariableProvider/query-params.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/query-params.js +1 -1
- package/dist/context/VariableProvider/query-params.js.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.d.ts +1 -1
- package/dist/context/VariableProvider/utils.d.ts.map +1 -0
- package/dist/context/{TemplateVariableProvider → VariableProvider}/utils.js +3 -3
- package/dist/context/VariableProvider/utils.js.map +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +1 -1
- package/dist/context/useDashboard.d.ts +3 -3
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js +24 -9
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +1 -1
- package/dist/stories/decorators/WithDashboard.js.map +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js +1 -1
- package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
- package/dist/stories/decorators/{WithTemplateVariables.js → WithVariables.js} +9 -9
- package/dist/stories/decorators/WithVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +2 -2
- package/dist/stories/decorators/index.js.map +1 -1
- package/dist/test/dashboard-provider.d.ts +1 -1
- package/dist/test/dashboard-provider.d.ts.map +1 -1
- package/dist/test/dashboard-provider.js.map +1 -1
- package/dist/test/datasource-provider.d.ts +2 -2
- package/dist/test/datasource-provider.d.ts.map +1 -1
- package/dist/test/datasource-provider.js.map +1 -1
- package/dist/test/plugin-registry.d.ts.map +1 -1
- package/dist/test/plugin-registry.js +4 -2
- package/dist/test/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts +2 -2
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +10 -8
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/panelUtils.d.ts +1 -1
- package/dist/utils/panelUtils.d.ts.map +1 -1
- package/dist/utils/panelUtils.js +2 -2
- package/dist/utils/panelUtils.js.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.d.ts +4 -4
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +8 -8
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +4 -4
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +11 -12
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +9 -9
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -210
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +0 -40
- package/dist/cjs/components/ToolbarIconButton/index.js +0 -30
- package/dist/cjs/context/TemplateVariableProvider/index.js +0 -30
- package/dist/cjs/utils/time.js +0 -29
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +0 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +0 -186
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +0 -1
- package/dist/components/TimeRangeControls/index.d.ts +0 -2
- package/dist/components/TimeRangeControls/index.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/index.js.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +0 -6
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +0 -32
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +0 -1
- package/dist/components/ToolbarIconButton/index.d.ts +0 -2
- package/dist/components/ToolbarIconButton/index.d.ts.map +0 -1
- package/dist/components/ToolbarIconButton/index.js +0 -15
- package/dist/components/ToolbarIconButton/index.js.map +0 -1
- package/dist/components/Variables/TemplateVariable.d.ts.map +0 -1
- package/dist/components/Variables/TemplateVariable.js.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +0 -77
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +0 -1
- package/dist/context/TemplateVariableProvider/index.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/index.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/index.js +0 -15
- package/dist/context/TemplateVariableProvider/index.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.js.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/utils.js.map +0 -1
- package/dist/stories/decorators/WithTemplateVariables.js.map +0 -1
- package/dist/utils/time.d.ts +0 -5
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -23
- package/dist/utils/time.js.map +0 -1
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/panel.d.ts +0 -19
- package/dist/validation/panel.d.ts.map +0 -1
- package/dist/validation/panel.js +0 -21
- package/dist/validation/panel.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 The Perses Authors
|
|
2
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
3
|
// you may not use this file except in compliance with the License.
|
|
4
4
|
// You may obtain a copy of the License at
|
|
@@ -23,83 +23,22 @@ Object.defineProperty(exports, "PanelHeader", {
|
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _material = require("@mui/material");
|
|
25
25
|
const _components = require("@perses-dev/components");
|
|
26
|
-
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
27
|
-
const _PencilOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/PencilOutline"));
|
|
28
|
-
const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
|
|
29
|
-
const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DragVertical"));
|
|
30
|
-
const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
|
|
31
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
|
+
const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
|
|
32
28
|
const _constants = require("../../constants");
|
|
29
|
+
const _PanelActions = require("./PanelActions");
|
|
30
|
+
const _PanelLinks = require("./PanelLinks");
|
|
31
|
+
const _HeaderIconButton = require("./HeaderIconButton");
|
|
33
32
|
function _interop_require_default(obj) {
|
|
34
33
|
return obj && obj.__esModule ? obj : {
|
|
35
34
|
default: obj
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
|
-
function PanelHeader({ id
|
|
37
|
+
function PanelHeader({ id, title: rawTitle, description: rawDescription, links, readHandlers, editHandlers, sx, extra, ...rest }) {
|
|
39
38
|
const titleElementId = `${id}-title`;
|
|
40
39
|
const descriptionTooltipId = `${id}-description`;
|
|
41
40
|
const title = (0, _pluginsystem.useReplaceVariablesInString)(rawTitle);
|
|
42
41
|
const description = (0, _pluginsystem.useReplaceVariablesInString)(rawDescription);
|
|
43
|
-
let actions = undefined;
|
|
44
|
-
if (editHandlers !== undefined) {
|
|
45
|
-
// If there are edit handlers, always just show the edit buttons
|
|
46
|
-
actions = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
47
|
-
children: [
|
|
48
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
49
|
-
description: _constants.TOOLTIP_TEXT.editPanel,
|
|
50
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
51
|
-
"aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
|
|
52
|
-
size: "small",
|
|
53
|
-
onClick: editHandlers.onEditPanelClick,
|
|
54
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PencilOutline.default, {
|
|
55
|
-
fontSize: "inherit"
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
59
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
60
|
-
description: _constants.TOOLTIP_TEXT.duplicatePanel,
|
|
61
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
62
|
-
"aria-label": _constants.ARIA_LABEL_TEXT.duplicatePanel(title),
|
|
63
|
-
size: "small",
|
|
64
|
-
onClick: editHandlers.onDuplicatePanelClick,
|
|
65
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ContentCopy.default, {
|
|
66
|
-
fontSize: "inherit",
|
|
67
|
-
sx: {
|
|
68
|
-
// Shrink this icon a little bit to look more consistent
|
|
69
|
-
// with the other icons in the header.
|
|
70
|
-
transform: 'scale(0.925)'
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
}),
|
|
75
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
76
|
-
description: _constants.TOOLTIP_TEXT.deletePanel,
|
|
77
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
78
|
-
"aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
|
|
79
|
-
size: "small",
|
|
80
|
-
onClick: editHandlers.onDeletePanelClick,
|
|
81
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {
|
|
82
|
-
fontSize: "inherit"
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
}),
|
|
86
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
87
|
-
description: _constants.TOOLTIP_TEXT.movePanel,
|
|
88
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(HeaderIconButton, {
|
|
89
|
-
"aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
|
|
90
|
-
size: "small",
|
|
91
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DragVertical.default, {
|
|
92
|
-
className: "drag-handle",
|
|
93
|
-
sx: {
|
|
94
|
-
cursor: 'grab'
|
|
95
|
-
},
|
|
96
|
-
fontSize: "inherit"
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
})
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
42
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CardHeader, {
|
|
104
43
|
id: id,
|
|
105
44
|
component: "header",
|
|
@@ -116,43 +55,49 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
116
55
|
// `minHeight` guarantees that the header has the correct height
|
|
117
56
|
// when there is no title (i.e. in the preview)
|
|
118
57
|
lineHeight: '24px',
|
|
119
|
-
minHeight: '
|
|
58
|
+
minHeight: '26px',
|
|
120
59
|
whiteSpace: 'nowrap',
|
|
121
60
|
overflow: 'hidden',
|
|
122
61
|
textOverflow: 'ellipsis'
|
|
123
62
|
},
|
|
124
63
|
children: title
|
|
125
64
|
}),
|
|
126
|
-
description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"aria-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
65
|
+
description !== undefined && description.trim().length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
66
|
+
sx: {
|
|
67
|
+
display: editHandlers === undefined ? 'var(--panel-hover, none)' : 'flex'
|
|
68
|
+
},
|
|
69
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
70
|
+
id: descriptionTooltipId,
|
|
71
|
+
description: description,
|
|
72
|
+
enterDelay: 100,
|
|
73
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
|
|
74
|
+
"aria-label": "panel description",
|
|
75
|
+
size: "small",
|
|
76
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
|
|
77
|
+
"aria-describedby": "info-tooltip",
|
|
78
|
+
"aria-hidden": false,
|
|
79
|
+
fontSize: "inherit",
|
|
80
|
+
sx: {
|
|
81
|
+
color: (theme)=>theme.palette.text.secondary
|
|
82
|
+
}
|
|
83
|
+
})
|
|
140
84
|
})
|
|
141
85
|
})
|
|
86
|
+
}),
|
|
87
|
+
links !== undefined && links.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelLinks.PanelLinks, {
|
|
88
|
+
links: links
|
|
142
89
|
})
|
|
143
90
|
]
|
|
144
91
|
}),
|
|
145
|
-
action: /*#__PURE__*/ (0, _jsxruntime.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
editHandlers === undefined && extra,
|
|
151
|
-
" ",
|
|
152
|
-
actions
|
|
153
|
-
]
|
|
92
|
+
action: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelActions.PanelActions, {
|
|
93
|
+
title: title,
|
|
94
|
+
readHandlers: readHandlers,
|
|
95
|
+
editHandlers: editHandlers,
|
|
96
|
+
extra: extra
|
|
154
97
|
}),
|
|
155
98
|
sx: (0, _components.combineSx)((theme)=>({
|
|
99
|
+
containerType: 'inline-size',
|
|
100
|
+
containerName: _constants.HEADER_ACTIONS_CONTAINER_NAME,
|
|
156
101
|
padding: theme.spacing(1),
|
|
157
102
|
borderBottom: `solid 1px ${theme.palette.divider}`,
|
|
158
103
|
'.MuiCardHeader-content': {
|
|
@@ -169,15 +114,3 @@ function PanelHeader({ id , title: rawTitle , description: rawDescription , edit
|
|
|
169
114
|
...rest
|
|
170
115
|
});
|
|
171
116
|
}
|
|
172
|
-
const HeaderIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
|
|
173
|
-
borderRadius: theme.shape.borderRadius,
|
|
174
|
-
padding: '4px'
|
|
175
|
-
}));
|
|
176
|
-
const HeaderActionWrapper = (0, _material.styled)(_material.Stack)(()=>({
|
|
177
|
-
// Adding back the negative margins from MUI's defaults for actions, so we
|
|
178
|
-
// avoid increasing the header size when actions are present while also being
|
|
179
|
-
// able to vertically center the actions.
|
|
180
|
-
// https://github.com/mui/material-ui/blob/master/packages/mui-material/src/CardHeader/CardHeader.js#L56-L58
|
|
181
|
-
marginTop: -4,
|
|
182
|
-
marginBottom: -4
|
|
183
|
-
}));
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// Copyright 2024 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "PanelLinks", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return PanelLinks;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _material = require("@mui/material");
|
|
25
|
+
const _Launch = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Launch"));
|
|
26
|
+
const _react = require("react");
|
|
27
|
+
const _components = require("@perses-dev/components");
|
|
28
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
29
|
+
function _interop_require_default(obj) {
|
|
30
|
+
return obj && obj.__esModule ? obj : {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function PanelLinks({ links }) {
|
|
35
|
+
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
36
|
+
const isMenuOpened = Boolean(anchorEl);
|
|
37
|
+
const handleOpenMenu = (event)=>{
|
|
38
|
+
setAnchorEl(event.currentTarget);
|
|
39
|
+
};
|
|
40
|
+
const handleClose = ()=>{
|
|
41
|
+
setAnchorEl(null);
|
|
42
|
+
};
|
|
43
|
+
// If there is only one link, show it directly
|
|
44
|
+
if (links.length === 1 && links[0]) {
|
|
45
|
+
const link = links[0];
|
|
46
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkButton, {
|
|
47
|
+
link: link
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Else we show a menu with a list of all links
|
|
51
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
54
|
+
description: `${links.length} links`,
|
|
55
|
+
enterDelay: 100,
|
|
56
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
57
|
+
"aria-label": "Panel links",
|
|
58
|
+
size: "small",
|
|
59
|
+
onClick: handleOpenMenu,
|
|
60
|
+
sx: (theme)=>({
|
|
61
|
+
borderRadius: theme.shape.borderRadius,
|
|
62
|
+
padding: '4px'
|
|
63
|
+
}),
|
|
64
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
|
|
65
|
+
"aria-describedby": "links-icon",
|
|
66
|
+
fontSize: "inherit",
|
|
67
|
+
sx: {
|
|
68
|
+
color: (theme)=>theme.palette.text.secondary
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
|
|
74
|
+
anchorEl: anchorEl,
|
|
75
|
+
open: isMenuOpened,
|
|
76
|
+
onClose: handleClose,
|
|
77
|
+
MenuListProps: {
|
|
78
|
+
'aria-labelledby': 'panel-links'
|
|
79
|
+
},
|
|
80
|
+
children: links.map((link)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(LinkMenuItem, {
|
|
81
|
+
link: link
|
|
82
|
+
}, link.url))
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function LinkButton({ link }) {
|
|
88
|
+
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
89
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
90
|
+
description: tooltip ?? url,
|
|
91
|
+
enterDelay: 100,
|
|
92
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
93
|
+
"aria-label": name ?? url,
|
|
94
|
+
size: "small",
|
|
95
|
+
href: url,
|
|
96
|
+
target: targetBlank ? '_blank' : '_self',
|
|
97
|
+
sx: (theme)=>({
|
|
98
|
+
borderRadius: theme.shape.borderRadius,
|
|
99
|
+
padding: '4px'
|
|
100
|
+
}),
|
|
101
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Launch.default, {
|
|
102
|
+
fontSize: "inherit",
|
|
103
|
+
sx: {
|
|
104
|
+
color: (theme)=>theme.palette.text.secondary
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function LinkMenuItem({ link }) {
|
|
111
|
+
const { url, name, tooltip, targetBlank } = useLink(link);
|
|
112
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
|
|
113
|
+
description: tooltip ?? url,
|
|
114
|
+
enterDelay: 100,
|
|
115
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
116
|
+
component: _material.Link,
|
|
117
|
+
href: url,
|
|
118
|
+
target: targetBlank ? '_blank' : '_self',
|
|
119
|
+
children: name ?? url
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function useLink(link) {
|
|
124
|
+
const url = (0, _pluginsystem.useReplaceVariablesInString)(link.url) ?? link.url;
|
|
125
|
+
const name = (0, _pluginsystem.useReplaceVariablesInString)(link.name);
|
|
126
|
+
const tooltip = (0, _pluginsystem.useReplaceVariablesInString)(link.tooltip);
|
|
127
|
+
if (link.renderVariables === false) {
|
|
128
|
+
return link;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
...link,
|
|
132
|
+
url,
|
|
133
|
+
name,
|
|
134
|
+
tooltip
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -44,7 +44,7 @@ const PanelDrawer = ()=>{
|
|
|
44
44
|
};
|
|
45
45
|
// Don't call closeDrawer on the store until the Drawer has completely transitioned out and reset close state
|
|
46
46
|
const handleExited = ()=>{
|
|
47
|
-
panelEditor
|
|
47
|
+
panelEditor?.close();
|
|
48
48
|
setIsClosing(false);
|
|
49
49
|
};
|
|
50
50
|
// Disables closing on click out. This is a quick-win solution to avoid losing draft changes.
|
|
@@ -58,11 +58,14 @@ const PanelDrawer = ()=>{
|
|
|
58
58
|
onExited: handleExited
|
|
59
59
|
},
|
|
60
60
|
"data-testid": "panel-editor",
|
|
61
|
-
children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
children: panelEditor && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
62
|
+
FallbackComponent: _components.ErrorAlert,
|
|
63
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PanelEditorForm.PanelEditorForm, {
|
|
64
|
+
initialAction: panelEditor.mode,
|
|
65
|
+
initialValues: panelEditor.initialValues,
|
|
66
|
+
onSave: handleSave,
|
|
67
|
+
onClose: handleClose
|
|
68
|
+
})
|
|
66
69
|
})
|
|
67
70
|
});
|
|
68
71
|
};
|
|
@@ -36,25 +36,35 @@ const _pluginsystem = require("@perses-dev/plugin-system");
|
|
|
36
36
|
const _reacthookform = require("react-hook-form");
|
|
37
37
|
const _zod = require("@hookform/resolvers/zod");
|
|
38
38
|
const _context = require("../../context");
|
|
39
|
-
const _validation = require("../../validation");
|
|
40
39
|
const _PanelPreview = require("./PanelPreview");
|
|
41
40
|
const _usePanelEditor = require("./usePanelEditor");
|
|
42
41
|
function PanelEditorForm(props) {
|
|
43
|
-
const { initialValues
|
|
42
|
+
const { initialValues, initialAction, onSave, onClose } = props;
|
|
44
43
|
const panelGroups = (0, _context.useListPanelGroups)();
|
|
45
|
-
const
|
|
46
|
-
const {
|
|
47
|
-
const { plugin } = panelDefinition.spec;
|
|
44
|
+
const { panelDefinition, setName, setDescription, setLinks, setQueries, setPlugin, setPanelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialValues.panelDefinition);
|
|
45
|
+
const { plugin } = panelDefinition.spec;
|
|
48
46
|
const [isDiscardDialogOpened, setDiscardDialogOpened] = (0, _react.useState)(false);
|
|
49
47
|
// Use common plugin editor logic even though we've split the inputs up in this form
|
|
50
48
|
const pluginEditor = (0, _pluginsystem.usePluginEditor)({
|
|
51
|
-
|
|
49
|
+
pluginTypes: [
|
|
50
|
+
'Panel'
|
|
51
|
+
],
|
|
52
52
|
value: {
|
|
53
|
-
|
|
53
|
+
selection: {
|
|
54
|
+
kind: plugin.kind,
|
|
55
|
+
type: 'Panel'
|
|
56
|
+
},
|
|
54
57
|
spec: plugin.spec
|
|
55
58
|
},
|
|
56
59
|
onChange: (plugin)=>{
|
|
57
|
-
|
|
60
|
+
form.setValue('panelDefinition.spec.plugin', {
|
|
61
|
+
kind: plugin.selection.kind,
|
|
62
|
+
spec: plugin.spec
|
|
63
|
+
});
|
|
64
|
+
setPlugin({
|
|
65
|
+
kind: plugin.selection.kind,
|
|
66
|
+
spec: plugin.spec
|
|
67
|
+
});
|
|
58
68
|
},
|
|
59
69
|
onHideQueryEditorChange: (isHidden)=>{
|
|
60
70
|
setQueries(undefined, isHidden);
|
|
@@ -62,35 +72,31 @@ function PanelEditorForm(props) {
|
|
|
62
72
|
});
|
|
63
73
|
const titleAction = (0, _pluginsystem.getTitleAction)(initialAction, true);
|
|
64
74
|
const submitText = (0, _pluginsystem.getSubmitText)(initialAction, true);
|
|
75
|
+
const { panelEditorSchema } = (0, _pluginsystem.useValidationSchemas)();
|
|
65
76
|
const form = (0, _reacthookform.useForm)({
|
|
66
|
-
resolver: (0, _zod.zodResolver)(
|
|
77
|
+
resolver: (0, _zod.zodResolver)(panelEditorSchema),
|
|
67
78
|
mode: 'onBlur',
|
|
68
|
-
defaultValues:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
79
|
+
defaultValues: initialValues
|
|
80
|
+
});
|
|
81
|
+
const links = (0, _reacthookform.useWatch)({
|
|
82
|
+
control: form.control,
|
|
83
|
+
name: 'panelDefinition.spec.links'
|
|
74
84
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
(0, _react.useEffect)(()=>{
|
|
86
|
+
setLinks(links);
|
|
87
|
+
}, [
|
|
88
|
+
setLinks,
|
|
89
|
+
links
|
|
90
|
+
]);
|
|
91
|
+
const processForm = (data)=>{
|
|
92
|
+
onSave(data);
|
|
81
93
|
};
|
|
82
94
|
// When user click on cancel, several possibilities:
|
|
83
95
|
// - create action: ask for discard approval
|
|
84
96
|
// - update action: ask for discard approval if changed
|
|
85
97
|
// - read action: don´t ask for discard approval
|
|
86
98
|
function handleCancel() {
|
|
87
|
-
if (JSON.stringify({
|
|
88
|
-
groupId: initialGroupId,
|
|
89
|
-
panelDefinition: initialPanelDef
|
|
90
|
-
}) !== JSON.stringify({
|
|
91
|
-
groupId,
|
|
92
|
-
panelDefinition
|
|
93
|
-
})) {
|
|
99
|
+
if (JSON.stringify(initialValues) !== JSON.stringify(form.getValues())) {
|
|
94
100
|
setDiscardDialogOpened(true);
|
|
95
101
|
} else {
|
|
96
102
|
onClose();
|
|
@@ -98,14 +104,13 @@ function PanelEditorForm(props) {
|
|
|
98
104
|
}
|
|
99
105
|
const handlePanelDefinitionChange = (nextPanelDefStr)=>{
|
|
100
106
|
const nextPanelDef = JSON.parse(nextPanelDefStr);
|
|
101
|
-
const { kind: pluginKind
|
|
107
|
+
const { kind: pluginKind, spec: pluginSpec } = nextPanelDef.spec.plugin;
|
|
102
108
|
// if panel plugin kind and spec are modified, then need to save current spec
|
|
103
109
|
if (panelDefinition.spec.plugin.kind !== pluginKind && JSON.stringify(panelDefinition.spec.plugin.spec) !== JSON.stringify(pluginSpec)) {
|
|
104
110
|
pluginEditor.rememberCurrentSpecState();
|
|
105
111
|
}
|
|
106
112
|
setPanelDefinition(nextPanelDef);
|
|
107
113
|
};
|
|
108
|
-
var _panelGroup_title, _pluginEditor_error_message;
|
|
109
114
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reacthookform.FormProvider, {
|
|
110
115
|
...form,
|
|
111
116
|
children: [
|
|
@@ -160,94 +165,93 @@ function PanelEditorForm(props) {
|
|
|
160
165
|
item: true,
|
|
161
166
|
xs: 8,
|
|
162
167
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
168
|
+
control: form.control,
|
|
169
|
+
name: "panelDefinition.spec.display.name",
|
|
170
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
167
171
|
...field,
|
|
168
172
|
required: true,
|
|
169
173
|
fullWidth: true,
|
|
170
174
|
label: "Name",
|
|
171
175
|
error: !!fieldState.error,
|
|
172
|
-
helperText:
|
|
176
|
+
helperText: fieldState.error?.message,
|
|
177
|
+
value: field.value ?? '',
|
|
173
178
|
onChange: (event)=>{
|
|
174
179
|
field.onChange(event);
|
|
175
180
|
setName(event.target.value);
|
|
176
181
|
}
|
|
177
|
-
})
|
|
178
|
-
}
|
|
182
|
+
})
|
|
179
183
|
})
|
|
180
184
|
}),
|
|
181
185
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
182
186
|
item: true,
|
|
183
187
|
xs: 4,
|
|
184
188
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
189
|
+
control: form.control,
|
|
185
190
|
name: "groupId",
|
|
186
|
-
render: ({ field
|
|
187
|
-
var _fieldState_error;
|
|
188
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
191
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
189
192
|
select: true,
|
|
190
193
|
...field,
|
|
191
194
|
required: true,
|
|
192
195
|
fullWidth: true,
|
|
193
196
|
label: "Group",
|
|
194
197
|
error: !!fieldState.error,
|
|
195
|
-
helperText:
|
|
198
|
+
helperText: fieldState.error?.message,
|
|
196
199
|
onChange: (event)=>{
|
|
197
200
|
field.onChange(event);
|
|
198
|
-
setGroupId(+event.target.value);
|
|
199
201
|
},
|
|
200
202
|
children: panelGroups.map((panelGroup, index)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
201
203
|
value: panelGroup.id,
|
|
202
|
-
children:
|
|
204
|
+
children: panelGroup.title ?? `Group ${index + 1}`
|
|
203
205
|
}, panelGroup.id))
|
|
204
|
-
})
|
|
205
|
-
}
|
|
206
|
+
})
|
|
206
207
|
})
|
|
207
208
|
}),
|
|
208
209
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
209
210
|
item: true,
|
|
210
211
|
xs: 8,
|
|
211
212
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_material.TextField, {
|
|
213
|
+
control: form.control,
|
|
214
|
+
name: "panelDefinition.spec.display.description",
|
|
215
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
216
216
|
...field,
|
|
217
217
|
fullWidth: true,
|
|
218
218
|
label: "Description",
|
|
219
219
|
error: !!fieldState.error,
|
|
220
|
-
helperText:
|
|
220
|
+
helperText: fieldState.error?.message,
|
|
221
|
+
value: field.value ?? '',
|
|
221
222
|
onChange: (event)=>{
|
|
222
223
|
field.onChange(event);
|
|
223
224
|
setDescription(event.target.value);
|
|
224
225
|
}
|
|
225
|
-
})
|
|
226
|
-
}
|
|
226
|
+
})
|
|
227
227
|
})
|
|
228
228
|
}),
|
|
229
229
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Grid, {
|
|
230
230
|
item: true,
|
|
231
231
|
xs: 4,
|
|
232
232
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reacthookform.Controller, {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
/*#__PURE__*/ return (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
233
|
+
control: form.control,
|
|
234
|
+
name: "panelDefinition.spec.plugin.kind",
|
|
235
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginKindSelect, {
|
|
237
236
|
...field,
|
|
238
|
-
|
|
237
|
+
pluginTypes: [
|
|
238
|
+
'Panel'
|
|
239
|
+
],
|
|
239
240
|
required: true,
|
|
240
241
|
fullWidth: true,
|
|
241
242
|
label: "Type",
|
|
242
243
|
disabled: pluginEditor.isLoading,
|
|
243
244
|
error: !!pluginEditor.error || !!fieldState.error,
|
|
244
|
-
helperText:
|
|
245
|
+
helperText: pluginEditor.error?.message ?? fieldState.error?.message,
|
|
246
|
+
value: {
|
|
247
|
+
type: 'Panel',
|
|
248
|
+
kind: field.value
|
|
249
|
+
},
|
|
245
250
|
onChange: (event)=>{
|
|
246
|
-
field.onChange(event);
|
|
247
|
-
pluginEditor.
|
|
251
|
+
field.onChange(event.kind);
|
|
252
|
+
pluginEditor.onSelectionChange(event);
|
|
248
253
|
}
|
|
249
|
-
})
|
|
250
|
-
}
|
|
254
|
+
})
|
|
251
255
|
})
|
|
252
256
|
}),
|
|
253
257
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Grid, {
|
|
@@ -273,6 +277,7 @@ function PanelEditorForm(props) {
|
|
|
273
277
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
|
|
274
278
|
FallbackComponent: _components.ErrorAlert,
|
|
275
279
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PanelSpecEditor, {
|
|
280
|
+
control: form.control,
|
|
276
281
|
panelDefinition: panelDefinition,
|
|
277
282
|
onJSONChange: handlePanelDefinitionChange,
|
|
278
283
|
onQueriesChange: (queries)=>{
|
|
@@ -25,21 +25,23 @@ const _react = require("react");
|
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
27
27
|
const _Panel = require("../Panel");
|
|
28
|
-
const _utils = require("../../utils");
|
|
29
28
|
const PANEL_PREVIEW_HEIGHT = 300;
|
|
30
29
|
const PANEL_PREVIEW_DEFAULT_WIDTH = 840;
|
|
31
|
-
function PanelPreview({ panelDefinition
|
|
30
|
+
function PanelPreview({ panelDefinition }) {
|
|
32
31
|
const boxRef = (0, _react.useRef)(null);
|
|
33
32
|
let width = PANEL_PREVIEW_DEFAULT_WIDTH;
|
|
34
33
|
if (boxRef.current !== null) {
|
|
35
34
|
width = boxRef.current.getBoundingClientRect().width;
|
|
36
35
|
}
|
|
37
|
-
const suggestedStepMs = (0,
|
|
36
|
+
const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(width);
|
|
37
|
+
const { data: plugin, isPending } = (0, _pluginsystem.usePlugin)('Panel', panelDefinition.spec.plugin.kind);
|
|
38
|
+
if (isPending) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
38
41
|
if (panelDefinition.spec.plugin.kind === '') {
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
41
|
-
|
|
42
|
-
const queries = (_panelDefinition_spec_queries = panelDefinition.spec.queries) !== null && _panelDefinition_spec_queries !== void 0 ? _panelDefinition_spec_queries : [];
|
|
44
|
+
const queries = panelDefinition.spec.queries ?? [];
|
|
43
45
|
// map TimeSeriesQueryDefinition to Definition<UnknownSpec>
|
|
44
46
|
const definitions = queries.length ? queries.map((query)=>{
|
|
45
47
|
return {
|
|
@@ -53,7 +55,8 @@ function PanelPreview({ panelDefinition }) {
|
|
|
53
55
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DataQueriesProvider, {
|
|
54
56
|
definitions: definitions,
|
|
55
57
|
options: {
|
|
56
|
-
suggestedStepMs
|
|
58
|
+
suggestedStepMs,
|
|
59
|
+
...plugin?.queryOptions
|
|
57
60
|
},
|
|
58
61
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Panel.Panel, {
|
|
59
62
|
definition: panelDefinition
|