@perses-dev/plugin-system 0.55.0-beta.2 → 0.55.0-beta.6
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/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
- package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
- package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
- package/dist/components/Annotations/index.js +2 -2
- package/dist/components/Annotations/index.js.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
- package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
- package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
- package/dist/components/CalculationSelector/index.js +1 -1
- package/dist/components/CalculationSelector/index.js.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +3 -2
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +10 -9
- package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
- package/dist/components/DatasourceEditorForm/index.js +1 -1
- package/dist/components/DatasourceEditorForm/index.js.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
- package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
- package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
- package/dist/components/DatasourceSelect/index.js +1 -1
- package/dist/components/DatasourceSelect/index.js.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +8 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
- package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
- package/dist/{cjs/model/alerts-queries.js → components/DatasourceTestConnectionButton/index.js} +3 -4
- package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +3 -2
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +54 -29
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/HTTPSettingsEditor/index.js +1 -1
- package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +24 -24
- package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
- package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
- package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
- package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
- package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
- package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
- package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
- package/dist/components/LayoutEditor/index.d.ts +4 -0
- package/dist/components/LayoutEditor/index.d.ts.map +1 -0
- package/dist/{cjs/model/explore.js → components/LayoutEditor/index.js} +5 -4
- package/dist/components/LayoutEditor/index.js.map +1 -0
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
- package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
- package/dist/components/LegendOptionsEditor/index.js +1 -1
- package/dist/components/LegendOptionsEditor/index.js.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
- package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
- package/dist/components/LinksEditor/LinksEditor.js +6 -6
- package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/components/LinksEditor/index.js +1 -1
- package/dist/components/LinksEditor/index.js.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
- package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
- package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
- package/dist/components/MetricLabelInput/index.js +1 -1
- package/dist/components/MetricLabelInput/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -4
- package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js +12 -9
- package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -4
- package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
- package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
- package/dist/components/MultiQueryEditor/index.js +2 -2
- package/dist/components/MultiQueryEditor/index.js.map +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
- package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
- package/dist/components/MultiQueryEditor/utils.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
- package/dist/components/OptionsEditorRadios/index.js +1 -1
- package/dist/components/OptionsEditorRadios/index.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
- package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js +1 -1
- package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
- package/dist/components/OptionsEditorTabs/index.js +1 -1
- package/dist/components/OptionsEditorTabs/index.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
- package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +7 -5
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +19 -10
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
- package/dist/components/PanelSpecEditor/index.js +1 -1
- package/dist/components/PanelSpecEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +10 -9
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/index.js +2 -2
- package/dist/components/PluginEditor/index.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -3
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js +4 -4
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
- package/dist/components/PluginKindSelect/index.js +1 -1
- package/dist/components/PluginKindSelect/index.js.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js +5 -5
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
- package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
- package/dist/components/PluginRegistry/index.js +1 -1
- package/dist/components/PluginRegistry/index.js.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts +2 -1
- package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
- package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js +19 -5
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
- package/dist/components/PluginSpecEditor/index.js +1 -1
- package/dist/components/PluginSpecEditor/index.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
- package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
- package/dist/components/SelectionOptionsEditor/index.js +1 -1
- package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +13 -14
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/TimeRangeControls/index.js +1 -1
- package/dist/components/TimeRangeControls/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
- package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
- package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/index.js +3 -3
- package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
- package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
- package/dist/components/Variables/index.js +2 -2
- package/dist/components/Variables/index.js.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +4 -4
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.js +3 -3
- package/dist/components/Variables/variable-model.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +21 -19
- package/dist/components/index.js.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +2 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/repeat.d.ts +3 -0
- package/dist/constants/repeat.d.ts.map +1 -0
- package/dist/{cjs/model/datasource.js → constants/repeat.js} +4 -4
- package/dist/constants/repeat.js.map +1 -0
- package/dist/context/ValidationProvider.d.ts +5 -5
- package/dist/context/ValidationProvider.d.ts.map +1 -1
- package/dist/context/ValidationProvider.js +5 -5
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/model/alerts-queries.d.ts +4 -4
- package/dist/model/alerts-queries.d.ts.map +1 -1
- package/dist/model/alerts-queries.js.map +1 -1
- package/dist/model/annotations.d.ts +3 -3
- package/dist/model/annotations.d.ts.map +1 -1
- package/dist/model/annotations.js.map +1 -1
- package/dist/model/calculations.d.ts +1 -1
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/datasource.d.ts +10 -3
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/explore.d.ts +2 -3
- package/dist/model/explore.d.ts.map +1 -1
- package/dist/model/explore.js.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +17 -16
- package/dist/model/index.js.map +1 -1
- package/dist/model/json-queries.d.ts +29 -0
- package/dist/model/json-queries.d.ts.map +1 -0
- package/dist/{cjs/model/annotations.js → model/json-queries.js} +5 -4
- package/dist/model/json-queries.js.map +1 -0
- package/dist/model/legend.d.ts +2 -2
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js +2 -2
- package/dist/model/legend.js.map +1 -1
- package/dist/model/log-queries.d.ts +3 -3
- package/dist/model/log-queries.d.ts.map +1 -1
- package/dist/model/log-queries.js.map +1 -1
- package/dist/model/panels.d.ts +13 -4
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +3 -3
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugin-loading.d.ts +1 -1
- package/dist/model/plugin-loading.d.ts.map +1 -1
- package/dist/model/plugin-loading.js +1 -1
- package/dist/model/plugin-loading.js.map +1 -1
- package/dist/model/plugins.d.ts +15 -13
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/model/profile-queries.d.ts +4 -4
- package/dist/model/profile-queries.d.ts.map +1 -1
- package/dist/model/profile-queries.js.map +1 -1
- package/dist/model/silences-queries.d.ts +4 -4
- package/dist/model/silences-queries.d.ts.map +1 -1
- package/dist/model/silences-queries.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +4 -4
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/trace-queries.d.ts +4 -4
- package/dist/model/trace-queries.d.ts.map +1 -1
- package/dist/model/trace-queries.js.map +1 -1
- package/dist/model/variables.d.ts +7 -3
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +1 -3
- package/dist/model/variables.js.map +1 -1
- package/dist/remote/PluginLoaderComponent.d.ts +1 -2
- package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
- package/dist/remote/PluginLoaderComponent.js +2 -2
- package/dist/remote/PluginLoaderComponent.js.map +1 -1
- package/dist/remote/PluginRuntime.d.ts +2 -2
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +18 -26
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/remote/index.js +2 -2
- package/dist/remote/index.js.map +1 -1
- package/dist/remote/remotePluginLoader.d.ts +2 -2
- package/dist/remote/remotePluginLoader.d.ts.map +1 -1
- package/dist/remote/remotePluginLoader.js +3 -3
- package/dist/remote/remotePluginLoader.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +20 -12
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/index.js +2 -2
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
- package/dist/runtime/RouterProvider.d.ts +2 -1
- package/dist/runtime/RouterProvider.d.ts.map +1 -1
- package/dist/runtime/RouterProvider.js +3 -3
- package/dist/runtime/RouterProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +22 -8
- package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +5 -5
- package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +9 -2
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +16 -3
- package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/index.js +4 -4
- package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
- package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
- package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
- package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/UsageMetricsProvider.js +3 -3
- package/dist/runtime/UsageMetricsProvider.js.map +1 -1
- package/dist/runtime/alerts-queries.d.ts +2 -2
- package/dist/runtime/alerts-queries.d.ts.map +1 -1
- package/dist/runtime/alerts-queries.js +5 -5
- package/dist/runtime/alerts-queries.js.map +1 -1
- package/dist/runtime/annotations.d.ts +2 -2
- package/dist/runtime/annotations.d.ts.map +1 -1
- package/dist/runtime/annotations.js +6 -6
- package/dist/runtime/annotations.js.map +1 -1
- package/dist/runtime/builtin-variables.d.ts +2 -3
- package/dist/runtime/builtin-variables.d.ts.map +1 -1
- package/dist/runtime/builtin-variables.js +1 -1
- package/dist/runtime/builtin-variables.js.map +1 -1
- package/dist/runtime/datasources.d.ts +2 -3
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +2 -2
- package/dist/runtime/datasources.js.map +1 -1
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +16 -15
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/item-actions.d.ts +3 -3
- package/dist/runtime/item-actions.d.ts.map +1 -1
- package/dist/runtime/item-actions.js +2 -2
- package/dist/runtime/item-actions.js.map +1 -1
- package/dist/runtime/json-queries.d.ts +11 -0
- package/dist/runtime/json-queries.d.ts.map +1 -0
- package/dist/runtime/json-queries.js +58 -0
- package/dist/runtime/json-queries.js.map +1 -0
- package/dist/runtime/log-queries.d.ts +3 -3
- package/dist/runtime/log-queries.d.ts.map +1 -1
- package/dist/runtime/log-queries.js +5 -5
- package/dist/runtime/log-queries.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +3 -4
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js +2 -2
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/runtime/profile-queries.d.ts +2 -2
- package/dist/runtime/profile-queries.d.ts.map +1 -1
- package/dist/runtime/profile-queries.js +4 -4
- package/dist/runtime/profile-queries.js.map +1 -1
- package/dist/runtime/silences-queries.d.ts +2 -2
- package/dist/runtime/silences-queries.d.ts.map +1 -1
- package/dist/runtime/silences-queries.js +5 -5
- package/dist/runtime/silences-queries.js.map +1 -1
- package/dist/runtime/time-series-queries.d.ts +3 -3
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.js +6 -6
- package/dist/runtime/time-series-queries.js.map +1 -1
- package/dist/runtime/trace-queries.d.ts +2 -2
- package/dist/runtime/trace-queries.d.ts.map +1 -1
- package/dist/runtime/trace-queries.js +6 -6
- package/dist/runtime/trace-queries.js.map +1 -1
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.d.ts.map +1 -1
- package/dist/runtime/utils.js.map +1 -1
- package/dist/runtime/variables.d.ts +1 -2
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/runtime/variables.js +4 -4
- package/dist/runtime/variables.js.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/panel.d.ts +2 -2
- package/dist/schema/panel.d.ts.map +1 -1
- package/dist/schema/panel.js +18 -4
- package/dist/schema/panel.js.map +1 -1
- package/dist/test/index.js +2 -2
- package/dist/test/index.js.map +1 -1
- package/dist/test/mock-data.d.ts +2 -1
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/mock-data.js +6 -0
- package/dist/test/mock-data.js.map +1 -1
- package/dist/test/render-hook.d.ts +2 -2
- package/dist/test/render-hook.d.ts.map +1 -1
- package/dist/test/render-hook.js +2 -2
- package/dist/test/render-hook.js.map +1 -1
- package/dist/test/render.d.ts +3 -3
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +3 -3
- package/dist/test/render.js.map +1 -1
- package/dist/test/setup-tests.d.ts +1 -1
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +3 -2
- package/dist/test/setup-tests.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts +3 -3
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts +7 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +58 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test/test-plugins/index.d.ts +1 -1
- package/dist/test/test-plugins/index.d.ts.map +1 -1
- package/dist/test/test-plugins/index.js +5 -5
- package/dist/test/test-plugins/index.js.map +1 -1
- package/dist/test/utils.d.ts +2 -2
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/test/utils.js +5 -5
- package/dist/test/utils.js.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +1 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/dist/utils/csv-export.d.ts.map +1 -1
- package/dist/utils/csv-export.js +1 -1
- package/dist/utils/csv-export.js.map +1 -1
- package/dist/utils/event.js +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/variables.js +1 -1
- package/package.json +11 -11
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
- package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
- package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
- package/dist/cjs/components/Annotations/constants.js +0 -23
- package/dist/cjs/components/Annotations/index.js +0 -31
- package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
- package/dist/cjs/components/CalculationSelector/index.js +0 -30
- package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -270
- package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
- package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
- package/dist/cjs/components/DatasourceSelect/index.js +0 -30
- package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
- package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
- package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
- package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
- package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
- package/dist/cjs/components/LinksEditor/index.js +0 -30
- package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
- package/dist/cjs/components/MetricLabelInput/index.js +0 -30
- package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -159
- package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
- package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
- package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
- package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
- package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
- package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
- package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
- package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
- package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -135
- package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
- package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
- package/dist/cjs/components/PluginEditor/index.js +0 -31
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
- package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
- package/dist/cjs/components/PluginKindSelect/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
- package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
- package/dist/cjs/components/PluginRegistry/index.js +0 -30
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
- package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -55
- package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
- package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
- package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -236
- package/dist/cjs/components/TimeRangeControls/index.js +0 -30
- package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
- package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
- package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
- package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
- package/dist/cjs/components/Variables/index.js +0 -31
- package/dist/cjs/components/Variables/variable-model.js +0 -211
- package/dist/cjs/components/index.js +0 -48
- package/dist/cjs/constants/index.js +0 -30
- package/dist/cjs/constants/user-interface-text.js +0 -32
- package/dist/cjs/context/ValidationProvider.js +0 -77
- package/dist/cjs/context/index.js +0 -30
- package/dist/cjs/index.js +0 -38
- package/dist/cjs/model/calculations.js +0 -178
- package/dist/cjs/model/index.js +0 -45
- package/dist/cjs/model/legend.js +0 -111
- package/dist/cjs/model/log-queries.js +0 -16
- package/dist/cjs/model/log-volume-utils.js +0 -124
- package/dist/cjs/model/panels.js +0 -16
- package/dist/cjs/model/plugin-base.js +0 -16
- package/dist/cjs/model/plugin-loading.js +0 -56
- package/dist/cjs/model/plugins.js +0 -26
- package/dist/cjs/model/profile-queries.js +0 -16
- package/dist/cjs/model/silences-queries.js +0 -16
- package/dist/cjs/model/time-series-queries.js +0 -26
- package/dist/cjs/model/trace-queries.js +0 -16
- package/dist/cjs/model/variables.js +0 -16
- package/dist/cjs/remote/PersesPlugin.types.js +0 -16
- package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
- package/dist/cjs/remote/PluginRuntime.js +0 -331
- package/dist/cjs/remote/index.js +0 -31
- package/dist/cjs/remote/remotePluginLoader.js +0 -101
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
- package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
- package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
- package/dist/cjs/runtime/RouterProvider.js +0 -114
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -201
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
- package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
- package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
- package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
- package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
- package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
- package/dist/cjs/runtime/alerts-queries.js +0 -101
- package/dist/cjs/runtime/annotations.js +0 -148
- package/dist/cjs/runtime/builtin-variables.js +0 -81
- package/dist/cjs/runtime/datasources.js +0 -80
- package/dist/cjs/runtime/index.js +0 -44
- package/dist/cjs/runtime/item-actions.js +0 -302
- package/dist/cjs/runtime/log-queries.js +0 -76
- package/dist/cjs/runtime/plugin-registry.js +0 -135
- package/dist/cjs/runtime/profile-queries.js +0 -73
- package/dist/cjs/runtime/silences-queries.js +0 -101
- package/dist/cjs/runtime/time-series-queries.js +0 -165
- package/dist/cjs/runtime/trace-queries.js +0 -106
- package/dist/cjs/runtime/utils.js +0 -39
- package/dist/cjs/runtime/variables.js +0 -160
- package/dist/cjs/schema/index.js +0 -30
- package/dist/cjs/schema/panel.js +0 -42
- package/dist/cjs/test/index.js +0 -31
- package/dist/cjs/test/mock-data.js +0 -357
- package/dist/cjs/test/render-hook.js +0 -31
- package/dist/cjs/test/render.js +0 -31
- package/dist/cjs/test/setup-tests.js +0 -20
- package/dist/cjs/test/test-plugins/bert/index.js +0 -99
- package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
- package/dist/cjs/test/test-plugins/index.js +0 -81
- package/dist/cjs/test/utils.js +0 -58
- package/dist/cjs/test-utils/index.js +0 -30
- package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
- package/dist/cjs/utils/csv-export.js +0 -248
- package/dist/cjs/utils/event.js +0 -30
- package/dist/cjs/utils/index.js +0 -32
- package/dist/cjs/utils/variables.js +0 -44
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
// Copyright 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, "usePluginEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return usePluginEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _react = require("react");
|
|
24
|
-
const _immer = require("immer");
|
|
25
|
-
const _runtime = require("../../runtime");
|
|
26
|
-
const _utils = require("../../utils");
|
|
27
|
-
function usePluginEditor(props) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
29
|
-
const { pluginTypes, value, onHideQueryEditorChange = ()=>{} } = props; // setting onHideQueryEditorChange to empty function here because useEvent requires a function
|
|
30
|
-
// Keep a stable reference, so we don't run the effect below when we don't need to
|
|
31
|
-
const onChange = (0, _utils.useEvent)(props.onChange);
|
|
32
|
-
const onHideQuery = (0, _utils.useEvent)(onHideQueryEditorChange);
|
|
33
|
-
// The previous spec state for PluginType and kind and a helper function for remembering current values
|
|
34
|
-
const prevSpecState = (0, _react.useRef)({
|
|
35
|
-
[value.selection.type]: {
|
|
36
|
-
[value.selection.kind]: value.spec
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const rememberCurrentSpecState = (0, _utils.useEvent)(()=>{
|
|
40
|
-
let byPluginType = prevSpecState.current[value.selection.type];
|
|
41
|
-
if (byPluginType === undefined) {
|
|
42
|
-
byPluginType = {};
|
|
43
|
-
prevSpecState.current[value.selection.type] = byPluginType;
|
|
44
|
-
}
|
|
45
|
-
byPluginType[value.selection.kind] = value.spec;
|
|
46
|
-
});
|
|
47
|
-
// The previous hide query state for each panel kind
|
|
48
|
-
const hideQueryState = (0, _react.useRef)({
|
|
49
|
-
[value.selection.kind]: false
|
|
50
|
-
});
|
|
51
|
-
const { defaultPluginKinds } = (0, _runtime.usePluginRegistry)();
|
|
52
|
-
const defaultPluginType = pluginTypes[0];
|
|
53
|
-
const defaultPluginKind = defaultPluginType ? defaultPluginKinds?.[defaultPluginType] : undefined;
|
|
54
|
-
const defaultPluginSelection = defaultPluginType && defaultPluginKind ? {
|
|
55
|
-
type: defaultPluginType,
|
|
56
|
-
kind: defaultPluginKind
|
|
57
|
-
} : undefined;
|
|
58
|
-
const initPendingSelection = !value.selection && defaultPluginSelection ? defaultPluginSelection : undefined;
|
|
59
|
-
// When kind changes and we haven't loaded that plugin before, we will need to enter a "pending" state so that we
|
|
60
|
-
// can generate proper initial spec values that match the new plugin kind
|
|
61
|
-
const [pendingSelection, setPendingSelection] = (0, _react.useState)(initPendingSelection);
|
|
62
|
-
// Take a default kind in case user write explicitly an empty kind in the initial value
|
|
63
|
-
(0, _react.useEffect)(()=>{
|
|
64
|
-
if (value.selection.kind === '') {
|
|
65
|
-
value.selection.kind = defaultPluginKind || '';
|
|
66
|
-
}
|
|
67
|
-
}, [
|
|
68
|
-
value.selection,
|
|
69
|
-
defaultPluginKind
|
|
70
|
-
]);
|
|
71
|
-
const { data: plugin, isFetching, error } = (0, _runtime.usePlugin)(pendingSelection?.type, pendingSelection?.kind || '');
|
|
72
|
-
(0, _react.useEffect)(()=>{
|
|
73
|
-
// Nothing to do if no new plugin kind is pending
|
|
74
|
-
if (!pendingSelection) return;
|
|
75
|
-
// Can't get spec value until we have a plugin
|
|
76
|
-
if (plugin === undefined || isFetching) return;
|
|
77
|
-
// Fire an onChange to change to the pending kind with initial values from the plugin
|
|
78
|
-
rememberCurrentSpecState();
|
|
79
|
-
onChange({
|
|
80
|
-
selection: pendingSelection,
|
|
81
|
-
spec: plugin.createInitialOptions ? plugin.createInitialOptions() : {}
|
|
82
|
-
});
|
|
83
|
-
if (pendingSelection.type === 'Panel') {
|
|
84
|
-
const panelPlugin = plugin;
|
|
85
|
-
hideQueryState.current[pendingSelection.kind] = !!panelPlugin.hideQueryEditor;
|
|
86
|
-
if (!!panelPlugin.hideQueryEditor !== hideQueryState.current[value.selection.kind]) {
|
|
87
|
-
onHideQuery(!!panelPlugin.hideQueryEditor);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
setPendingSelection(undefined);
|
|
91
|
-
}, [
|
|
92
|
-
pendingSelection,
|
|
93
|
-
plugin,
|
|
94
|
-
isFetching,
|
|
95
|
-
rememberCurrentSpecState,
|
|
96
|
-
onChange,
|
|
97
|
-
onHideQuery,
|
|
98
|
-
hideQueryState,
|
|
99
|
-
value.selection
|
|
100
|
-
]);
|
|
101
|
-
/**
|
|
102
|
-
* When the user tries to change the plugin kind, make sure we have the correct spec for that plugin kind before we
|
|
103
|
-
* make the switch.
|
|
104
|
-
*/ const onSelectionChange = (nextSelection)=>{
|
|
105
|
-
// If we already have state for this plugin type/kind from a previous selection, just use it
|
|
106
|
-
const previousState = prevSpecState.current[nextSelection.type]?.[nextSelection.kind];
|
|
107
|
-
if (previousState !== undefined) {
|
|
108
|
-
rememberCurrentSpecState();
|
|
109
|
-
onChange({
|
|
110
|
-
selection: nextSelection,
|
|
111
|
-
spec: previousState
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
// Otherwise, kick off the async loading process
|
|
115
|
-
setPendingSelection(nextSelection);
|
|
116
|
-
}
|
|
117
|
-
if (nextSelection.type === 'Panel' && hideQueryState.current[nextSelection.kind] !== undefined && hideQueryState.current[value.selection.kind] !== hideQueryState.current[nextSelection.kind]) {
|
|
118
|
-
onHideQuery(!!hideQueryState.current[nextSelection.kind]);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Spec changes are independent and always just set the spec state.
|
|
123
|
-
*/ const onSpecChange = (next)=>{
|
|
124
|
-
onChange((0, _immer.produce)(value, (draft)=>{
|
|
125
|
-
draft.spec = next;
|
|
126
|
-
}));
|
|
127
|
-
};
|
|
128
|
-
return {
|
|
129
|
-
pendingSelection,
|
|
130
|
-
isLoading: isFetching,
|
|
131
|
-
error,
|
|
132
|
-
onSelectionChange,
|
|
133
|
-
onSpecChange,
|
|
134
|
-
rememberCurrentSpecState
|
|
135
|
-
};
|
|
136
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
// Copyright 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, "PluginKindSelect", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return PluginKindSelect;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _material = require("@mui/material");
|
|
25
|
-
const _react = require("react");
|
|
26
|
-
const _runtime = require("../../runtime");
|
|
27
|
-
const PluginKindSelect = /*#__PURE__*/ (0, _react.forwardRef)((props, ref)=>{
|
|
28
|
-
const { pluginTypes, value: propValue, onChange, filteredQueryPlugins, ...others } = props;
|
|
29
|
-
const { data, isLoading } = (0, _runtime.useListPluginMetadata)(pluginTypes);
|
|
30
|
-
const sortedData = (0, _react.useMemo)(()=>{
|
|
31
|
-
if (filteredQueryPlugins?.length) {
|
|
32
|
-
return data?.filter((i)=>filteredQueryPlugins.includes(i.spec.name))?.sort((a, b)=>a.spec.display.name.localeCompare(b.spec.display.name));
|
|
33
|
-
}
|
|
34
|
-
return data?.sort((a, b)=>a.spec.display.name.localeCompare(b.spec.display.name));
|
|
35
|
-
}, [
|
|
36
|
-
data,
|
|
37
|
-
filteredQueryPlugins
|
|
38
|
-
]);
|
|
39
|
-
// Pass an empty value while options are still loading so MUI doesn't complain about us using an "out of range" value
|
|
40
|
-
const value = !propValue || isLoading ? '' : selectionToOptionValue(propValue);
|
|
41
|
-
const handleChange = (event)=>{
|
|
42
|
-
onChange?.(optionValueToSelection(event.target.value));
|
|
43
|
-
};
|
|
44
|
-
const renderValue = (0, _react.useCallback)((selected)=>{
|
|
45
|
-
if (selected === '') {
|
|
46
|
-
return '';
|
|
47
|
-
}
|
|
48
|
-
const selectedValue = optionValueToSelection(selected);
|
|
49
|
-
return sortedData?.find((v)=>v.kind === selectedValue.type && v.spec.name === selectedValue.kind)?.spec.display.name;
|
|
50
|
-
}, [
|
|
51
|
-
sortedData
|
|
52
|
-
]);
|
|
53
|
-
// TODO: Does this need a loading indicator of some kind?
|
|
54
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.TextField, {
|
|
55
|
-
select: true,
|
|
56
|
-
inputRef: ref,
|
|
57
|
-
...others,
|
|
58
|
-
value: value,
|
|
59
|
-
"aria-label": value,
|
|
60
|
-
onChange: handleChange,
|
|
61
|
-
SelectProps: {
|
|
62
|
-
renderValue
|
|
63
|
-
},
|
|
64
|
-
"data-testid": "plugin-kind-select",
|
|
65
|
-
children: [
|
|
66
|
-
isLoading && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
67
|
-
value: "",
|
|
68
|
-
children: "Loading..."
|
|
69
|
-
}),
|
|
70
|
-
sortedData?.map((metadata)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.MenuItem, {
|
|
71
|
-
"data-testid": "option",
|
|
72
|
-
value: selectionToOptionValue({
|
|
73
|
-
type: metadata.kind,
|
|
74
|
-
kind: metadata.spec.name
|
|
75
|
-
}),
|
|
76
|
-
children: metadata.spec.display.name
|
|
77
|
-
}, metadata.kind + metadata.spec.name))
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
PluginKindSelect.displayName = 'PluginKindSelect';
|
|
82
|
-
// Delimiter used to stringify/parse option values
|
|
83
|
-
const OPTION_VALUE_DELIMITER = '_____';
|
|
84
|
-
/**
|
|
85
|
-
* Given a PluginEditorSelection,
|
|
86
|
-
* returns a string value like `{type}_____{kind}` that can be used as a Select input value.
|
|
87
|
-
* @param selector
|
|
88
|
-
*/ function selectionToOptionValue(selector) {
|
|
89
|
-
return [
|
|
90
|
-
selector.type,
|
|
91
|
-
selector.kind
|
|
92
|
-
].join(OPTION_VALUE_DELIMITER);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Given an option value name like `{type}_____{kind}`,
|
|
96
|
-
* returns a PluginEditorSelection to be used by the query data model.
|
|
97
|
-
* @param optionValue
|
|
98
|
-
*/ function optionValueToSelection(optionValue) {
|
|
99
|
-
const words = optionValue.split(OPTION_VALUE_DELIMITER);
|
|
100
|
-
const type = words[0];
|
|
101
|
-
const kind = words[1];
|
|
102
|
-
if (type === undefined || kind === undefined) {
|
|
103
|
-
throw new Error('Invalid optionValue string');
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
type,
|
|
107
|
-
kind
|
|
108
|
-
};
|
|
109
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 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
|
-
_export_star(require("./PluginKindSelect"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// Copyright 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, "PluginRegistry", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return PluginRegistry;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _react = require("react");
|
|
25
|
-
const _runtime = require("../../runtime");
|
|
26
|
-
const _utils = require("../../utils");
|
|
27
|
-
const _pluginindexes = require("./plugin-indexes");
|
|
28
|
-
const _getPluginSearchHelper = require("./getPluginSearchHelper");
|
|
29
|
-
function PluginRegistry(props) {
|
|
30
|
-
const { pluginLoader: { getInstalledPlugins, importPluginModule }, children, defaultPluginKinds } = props;
|
|
31
|
-
const getPluginIndexes = (0, _pluginindexes.usePluginIndexes)(getInstalledPlugins);
|
|
32
|
-
// De-dupe calls to import plugin modules
|
|
33
|
-
const importCache = (0, _react.useRef)(new Map());
|
|
34
|
-
// Do useEvent here since this accesses the importPluginModule prop and we want a stable reference to it for the
|
|
35
|
-
// callback below
|
|
36
|
-
const loadPluginModule = (0, _utils.useEvent)((resource)=>{
|
|
37
|
-
let request = importCache.current.get(resource);
|
|
38
|
-
if (request === undefined) {
|
|
39
|
-
request = importPluginModule(resource);
|
|
40
|
-
importCache.current.set(resource, request);
|
|
41
|
-
// Remove failed requests from the cache so they can potentially be retried
|
|
42
|
-
request.catch(()=>importCache.current.delete(resource));
|
|
43
|
-
}
|
|
44
|
-
return request;
|
|
45
|
-
});
|
|
46
|
-
const getPlugin = (0, _react.useCallback)(async (compoundKeyObj)=>{
|
|
47
|
-
const pluginIndexes = await getPluginIndexes();
|
|
48
|
-
const { kind, name } = compoundKeyObj;
|
|
49
|
-
const candidateKeys = (0, _getPluginSearchHelper.resolvePluginKeys)(pluginIndexes.pluginResourcesByNameKindRegistryVersion.keys(), compoundKeyObj);
|
|
50
|
-
for (const resourceKey of candidateKeys){
|
|
51
|
-
const resource = pluginIndexes.pluginResourcesByNameKindRegistryVersion.get(resourceKey);
|
|
52
|
-
if (!resource) continue;
|
|
53
|
-
const pluginModule = await loadPluginModule(resource);
|
|
54
|
-
// Try to get the plugin implementation from the module using the versioned export first
|
|
55
|
-
const plugin = pluginModule?.[resourceKey];
|
|
56
|
-
if (plugin) return plugin;
|
|
57
|
-
// If the plugin module doesn't have a versioned export, fallback to the plugin name
|
|
58
|
-
const versionlessPlugin = pluginModule?.[name];
|
|
59
|
-
if (versionlessPlugin) return versionlessPlugin;
|
|
60
|
-
}
|
|
61
|
-
throw new Error(`A ${name} plugin for kind '${kind}' is not installed`);
|
|
62
|
-
}, [
|
|
63
|
-
getPluginIndexes,
|
|
64
|
-
loadPluginModule
|
|
65
|
-
]);
|
|
66
|
-
const listPluginMetadata = (0, _react.useCallback)(async (pluginTypes)=>{
|
|
67
|
-
const pluginIndexes = await getPluginIndexes();
|
|
68
|
-
return pluginTypes.flatMap((type)=>pluginIndexes.pluginMetadataByKind.get(type) ?? []);
|
|
69
|
-
}, [
|
|
70
|
-
getPluginIndexes
|
|
71
|
-
]);
|
|
72
|
-
// Create the registry's context value and render
|
|
73
|
-
const context = (0, _react.useMemo)(()=>({
|
|
74
|
-
getPlugin,
|
|
75
|
-
listPluginMetadata,
|
|
76
|
-
defaultPluginKinds
|
|
77
|
-
}), [
|
|
78
|
-
getPlugin,
|
|
79
|
-
listPluginMetadata,
|
|
80
|
-
defaultPluginKinds
|
|
81
|
-
]);
|
|
82
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_runtime.PluginRegistryContext.Provider, {
|
|
83
|
-
value: context,
|
|
84
|
-
children: children
|
|
85
|
-
});
|
|
86
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Copyright 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, "resolvePluginKeys", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return resolvePluginKeys;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _semver = require("semver");
|
|
24
|
-
const _model = require("../../model");
|
|
25
|
-
const PLUGIN_LOOKUP_PRECEDENCE_LOGIC = {
|
|
26
|
-
registryOverVersion: false
|
|
27
|
-
};
|
|
28
|
-
const resolvePluginKeys = (allKeys, query, precedenceLogic = PLUGIN_LOOKUP_PRECEDENCE_LOGIC)=>{
|
|
29
|
-
const { kind, name, version, registry } = query;
|
|
30
|
-
const candidates = [];
|
|
31
|
-
// Exact match first when version or registry is specified
|
|
32
|
-
if (version || registry) {
|
|
33
|
-
candidates.push((0, _model.getPluginModuleCompoundKey)({
|
|
34
|
-
kind,
|
|
35
|
-
name,
|
|
36
|
-
registry,
|
|
37
|
-
version
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
const latestWithRegistry = {
|
|
41
|
-
key: '',
|
|
42
|
-
version: ''
|
|
43
|
-
};
|
|
44
|
-
const latestWithoutRegistry = {
|
|
45
|
-
key: '',
|
|
46
|
-
version: ''
|
|
47
|
-
};
|
|
48
|
-
const prefix = `${kind}:${name}:`;
|
|
49
|
-
for (const key of allKeys){
|
|
50
|
-
if (!key.startsWith(prefix)) continue;
|
|
51
|
-
const split = key.split(':');
|
|
52
|
-
if (split.length !== 4) {
|
|
53
|
-
console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
const [, , reg, ver] = split;
|
|
57
|
-
if (!ver) {
|
|
58
|
-
console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
if (reg) {
|
|
62
|
-
if (!latestWithRegistry.key || (0, _semver.gt)(ver, latestWithRegistry.version)) {
|
|
63
|
-
latestWithRegistry.key = key;
|
|
64
|
-
latestWithRegistry.version = ver;
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
if (!latestWithoutRegistry.key || (0, _semver.gt)(ver, latestWithoutRegistry.version)) {
|
|
68
|
-
latestWithoutRegistry.key = key;
|
|
69
|
-
latestWithoutRegistry.version = ver;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// Determine the best fallback key from the two buckets
|
|
74
|
-
let fallbackKey;
|
|
75
|
-
if (latestWithRegistry.key && latestWithoutRegistry.key) {
|
|
76
|
-
const { registryOverVersion } = precedenceLogic;
|
|
77
|
-
if ((0, _semver.gt)(latestWithRegistry.version, latestWithoutRegistry.version)) {
|
|
78
|
-
fallbackKey = latestWithRegistry.key;
|
|
79
|
-
} else if ((0, _semver.gt)(latestWithoutRegistry.version, latestWithRegistry.version)) {
|
|
80
|
-
fallbackKey = latestWithoutRegistry.key;
|
|
81
|
-
} else {
|
|
82
|
-
// Versions are equal — use the tie-breaker
|
|
83
|
-
fallbackKey = registryOverVersion ? latestWithRegistry.key : latestWithoutRegistry.key;
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
fallbackKey = latestWithRegistry.key || latestWithoutRegistry.key || undefined;
|
|
87
|
-
}
|
|
88
|
-
if (fallbackKey && !candidates.includes(fallbackKey)) {
|
|
89
|
-
candidates.push(fallbackKey);
|
|
90
|
-
}
|
|
91
|
-
return candidates;
|
|
92
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 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
|
-
_export_star(require("./PluginRegistry"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Copyright 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
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get getPluginModuleCompoundKey () {
|
|
25
|
-
return _model.getPluginModuleCompoundKey;
|
|
26
|
-
},
|
|
27
|
-
get usePluginIndexes () {
|
|
28
|
-
return usePluginIndexes;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _react = require("react");
|
|
32
|
-
const _model = require("../../model");
|
|
33
|
-
const _utils = require("../../utils");
|
|
34
|
-
function usePluginIndexes(getInstalledPlugins) {
|
|
35
|
-
// Creates indexes from the installed plugins data (does useEvent because this accesses the getInstalledPlugins prop
|
|
36
|
-
// and we want a stable reference for the callback below)
|
|
37
|
-
const createPluginIndexes = (0, _utils.useEvent)(async ()=>{
|
|
38
|
-
const installedPlugins = await getInstalledPlugins();
|
|
39
|
-
// Create the two indexes from the installed plugins
|
|
40
|
-
const pluginResourcesByNameKindRegistryVersion = new Map();
|
|
41
|
-
const pluginMetadataByKind = new Map();
|
|
42
|
-
for (const resource of installedPlugins){
|
|
43
|
-
const { metadata: { version, registry } } = resource;
|
|
44
|
-
for (const pluginMetadata of resource.spec.plugins){
|
|
45
|
-
const { kind, spec: { name } } = pluginMetadata;
|
|
46
|
-
const key = (0, _model.getPluginModuleCompoundKey)({
|
|
47
|
-
kind,
|
|
48
|
-
name,
|
|
49
|
-
registry,
|
|
50
|
-
version
|
|
51
|
-
});
|
|
52
|
-
if (pluginResourcesByNameKindRegistryVersion.has(key)) {
|
|
53
|
-
console.warn(`Got more than one ${kind} plugin for kind ${name}, registry '${registry || 'undefined'}', and version '${version || 'undefined'}'`);
|
|
54
|
-
}
|
|
55
|
-
pluginResourcesByNameKindRegistryVersion.set(key, resource);
|
|
56
|
-
// Index the metadata by plugin type
|
|
57
|
-
let list = pluginMetadataByKind.get(kind);
|
|
58
|
-
if (list === undefined) {
|
|
59
|
-
list = [];
|
|
60
|
-
pluginMetadataByKind.set(kind, list);
|
|
61
|
-
}
|
|
62
|
-
list.push({
|
|
63
|
-
...pluginMetadata,
|
|
64
|
-
module: resource.metadata
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
pluginResourcesByNameKindRegistryVersion,
|
|
70
|
-
pluginMetadataByKind
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
// De-dupe creating plugin indexes (i.e. requests to get installed plugins)
|
|
74
|
-
const pluginIndexesCache = (0, _react.useRef)(undefined);
|
|
75
|
-
const getPluginIndexes = (0, _react.useCallback)(()=>{
|
|
76
|
-
let request = pluginIndexesCache.current;
|
|
77
|
-
if (request === undefined) {
|
|
78
|
-
request = createPluginIndexes();
|
|
79
|
-
pluginIndexesCache.current = request;
|
|
80
|
-
// Remove failed requests from the cache so they can potentially be retried
|
|
81
|
-
request.catch(()=>pluginIndexesCache.current = undefined);
|
|
82
|
-
}
|
|
83
|
-
return request;
|
|
84
|
-
}, [
|
|
85
|
-
createPluginIndexes
|
|
86
|
-
]);
|
|
87
|
-
return getPluginIndexes;
|
|
88
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Copyright 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, "PluginSpecEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return PluginSpecEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _components = require("@perses-dev/components");
|
|
25
|
-
const _material = require("@mui/material");
|
|
26
|
-
const _runtime = require("../../runtime");
|
|
27
|
-
function PluginSpecEditor(props) {
|
|
28
|
-
const { pluginSelection: { type: pluginType, kind: pluginKind }, ...others } = props;
|
|
29
|
-
const { data: plugin, isLoading, error } = (0, _runtime.usePlugin)(pluginType, pluginKind);
|
|
30
|
-
if (error) {
|
|
31
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorAlert, {
|
|
32
|
-
error: error
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (isLoading) {
|
|
36
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
|
|
37
|
-
width: "100%",
|
|
38
|
-
sx: {
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
justifyContent: 'center'
|
|
41
|
-
},
|
|
42
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {})
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
if (!plugin) {
|
|
46
|
-
throw new Error(`Missing implementation for ${pluginType} plugin with kind '${pluginKind}'`);
|
|
47
|
-
}
|
|
48
|
-
if (pluginType === 'Panel') {
|
|
49
|
-
throw new Error('This editor should not be used for panel type. Please use Panel Spec Editor instead.');
|
|
50
|
-
}
|
|
51
|
-
const { OptionsEditorComponent } = plugin;
|
|
52
|
-
return OptionsEditorComponent ? /*#__PURE__*/ (0, _jsxruntime.jsx)(OptionsEditorComponent, {
|
|
53
|
-
...others
|
|
54
|
-
}) : null;
|
|
55
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 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
|
-
_export_star(require("./PluginSpecEditor"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|