@perses-dev/plugin-system 0.54.0-beta.0 → 0.54.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +283 -0
  2. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +197 -0
  3. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +30 -0
  4. package/dist/cjs/components/Annotations/constants.js +23 -0
  5. package/dist/cjs/components/Annotations/index.js +31 -0
  6. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +3 -3
  7. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +2 -3
  8. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +4 -5
  9. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +97 -12
  10. package/dist/cjs/components/MultiQueryEditor/index.js +1 -0
  11. package/dist/cjs/{utils/action.js → components/MultiQueryEditor/utils.js} +8 -15
  12. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +3 -6
  13. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -15
  14. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +92 -0
  15. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +16 -13
  16. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +2 -3
  17. package/dist/cjs/components/Variables/variable-model.js +115 -29
  18. package/dist/cjs/components/index.js +1 -0
  19. package/dist/cjs/context/ValidationProvider.js +10 -4
  20. package/dist/cjs/model/alerts-queries.js +16 -0
  21. package/dist/cjs/model/annotations.js +16 -0
  22. package/dist/cjs/model/calculations.js +178 -0
  23. package/dist/cjs/model/index.js +4 -0
  24. package/dist/cjs/model/legend.js +6 -5
  25. package/dist/cjs/model/log-volume-utils.js +10 -10
  26. package/dist/cjs/model/plugin-loading.js +24 -8
  27. package/dist/cjs/model/plugins.js +10 -0
  28. package/dist/cjs/model/silences-queries.js +16 -0
  29. package/dist/cjs/model/time-series-queries.js +10 -0
  30. package/dist/cjs/remote/PluginRuntime.js +46 -10
  31. package/dist/cjs/remote/remotePluginLoader.js +28 -5
  32. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +33 -24
  33. package/dist/cjs/runtime/DataQueriesProvider/model.js +3 -93
  34. package/dist/cjs/runtime/UsageMetricsProvider.js +2 -2
  35. package/dist/cjs/runtime/alerts-queries.js +101 -0
  36. package/dist/cjs/runtime/annotations.js +148 -0
  37. package/dist/cjs/runtime/index.js +3 -1
  38. package/dist/cjs/runtime/item-actions.js +3 -3
  39. package/dist/cjs/runtime/log-queries.js +4 -1
  40. package/dist/cjs/runtime/plugin-registry.js +12 -3
  41. package/dist/cjs/runtime/profile-queries.js +4 -1
  42. package/dist/cjs/runtime/silences-queries.js +101 -0
  43. package/dist/cjs/runtime/time-series-queries.js +4 -1
  44. package/dist/cjs/runtime/trace-queries.js +4 -1
  45. package/dist/cjs/test/mock-data.js +51 -0
  46. package/dist/cjs/test/test-plugins/bert/index.js +9 -12
  47. package/dist/cjs/test/test-plugins/ernie/index.js +9 -12
  48. package/dist/cjs/test/test-plugins/index.js +2 -2
  49. package/dist/cjs/test/utils.js +2 -2
  50. package/dist/cjs/test-utils/mock-plugin-registry.js +8 -2
  51. package/dist/cjs/utils/index.js +0 -1
  52. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +16 -0
  53. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -0
  54. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +270 -0
  55. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -0
  56. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +8 -0
  57. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -0
  58. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +184 -0
  59. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -0
  60. package/dist/components/Annotations/AnnotationEditorForm/index.d.ts +2 -0
  61. package/dist/components/Annotations/AnnotationEditorForm/index.d.ts.map +1 -0
  62. package/dist/{runtime/QueryCountProvider.js → components/Annotations/AnnotationEditorForm/index.js} +2 -13
  63. package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -0
  64. package/dist/components/Annotations/constants.d.ts +2 -0
  65. package/dist/components/Annotations/constants.d.ts.map +1 -0
  66. package/dist/components/Annotations/constants.js +15 -0
  67. package/dist/components/Annotations/constants.js.map +1 -0
  68. package/dist/components/Annotations/index.d.ts +3 -0
  69. package/dist/components/Annotations/index.d.ts.map +1 -0
  70. package/dist/components/Annotations/index.js +16 -0
  71. package/dist/components/Annotations/index.js.map +1 -0
  72. package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -1
  73. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  74. package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
  75. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  76. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +1 -1
  77. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  78. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +2 -3
  79. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  80. package/dist/components/DatasourceSelect/DatasourceSelect.js +2 -2
  81. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  82. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +1 -1
  83. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  84. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +2 -2
  85. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  86. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1 -1
  87. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  88. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  89. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -3
  90. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  91. package/dist/components/MetricLabelInput/MetricLabelInput.js +1 -1
  92. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  93. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +1 -1
  94. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
  95. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  96. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  97. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +100 -15
  98. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  99. package/dist/components/MultiQueryEditor/index.d.ts +1 -0
  100. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -1
  101. package/dist/components/MultiQueryEditor/index.js +1 -0
  102. package/dist/components/MultiQueryEditor/index.js.map +1 -1
  103. package/dist/components/MultiQueryEditor/utils.d.ts +8 -0
  104. package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -0
  105. package/dist/{utils/action.js → components/MultiQueryEditor/utils.js} +8 -12
  106. package/dist/components/MultiQueryEditor/utils.js.map +1 -0
  107. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
  108. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  109. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  110. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  111. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
  112. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  113. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  114. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +5 -8
  115. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  116. package/dist/components/PluginEditor/PluginEditor.js +1 -1
  117. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  118. package/dist/components/PluginKindSelect/PluginKindSelect.js +1 -1
  119. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  120. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  121. package/dist/components/PluginRegistry/PluginRegistry.js +12 -16
  122. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  123. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +12 -0
  124. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -0
  125. package/dist/components/PluginRegistry/getPluginSearchHelper.js +88 -0
  126. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -0
  127. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -6
  128. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  129. package/dist/components/PluginRegistry/plugin-indexes.js +15 -13
  130. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  131. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  132. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  133. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  134. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +1 -1
  135. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  136. package/dist/components/TimeRangeControls/TimeRangeControls.js +1 -1
  137. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  138. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +1 -1
  139. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  140. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +2 -3
  141. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  142. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  143. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  144. package/dist/components/Variables/variable-model.d.ts +9 -1
  145. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  146. package/dist/components/Variables/variable-model.js +117 -31
  147. package/dist/components/Variables/variable-model.js.map +1 -1
  148. package/dist/components/index.d.ts +1 -0
  149. package/dist/components/index.d.ts.map +1 -1
  150. package/dist/components/index.js +1 -0
  151. package/dist/components/index.js.map +1 -1
  152. package/dist/context/ValidationProvider.d.ts +4 -2
  153. package/dist/context/ValidationProvider.d.ts.map +1 -1
  154. package/dist/context/ValidationProvider.js +10 -4
  155. package/dist/context/ValidationProvider.js.map +1 -1
  156. package/dist/model/alerts-queries.d.ts +33 -0
  157. package/dist/model/alerts-queries.d.ts.map +1 -0
  158. package/dist/model/alerts-queries.js +15 -0
  159. package/dist/model/alerts-queries.js.map +1 -0
  160. package/dist/model/annotations.d.ts +28 -0
  161. package/dist/model/annotations.d.ts.map +1 -0
  162. package/dist/model/annotations.js +17 -0
  163. package/dist/model/annotations.js.map +1 -0
  164. package/dist/model/calculations.d.ts +45 -0
  165. package/dist/model/calculations.d.ts.map +1 -0
  166. package/dist/model/calculations.js +165 -0
  167. package/dist/model/calculations.js.map +1 -0
  168. package/dist/model/index.d.ts +4 -0
  169. package/dist/model/index.d.ts.map +1 -1
  170. package/dist/model/index.js +4 -0
  171. package/dist/model/index.js.map +1 -1
  172. package/dist/model/legend.d.ts +3 -2
  173. package/dist/model/legend.d.ts.map +1 -1
  174. package/dist/model/legend.js +2 -1
  175. package/dist/model/legend.js.map +1 -1
  176. package/dist/model/log-queries.d.ts +2 -1
  177. package/dist/model/log-queries.d.ts.map +1 -1
  178. package/dist/model/log-queries.js.map +1 -1
  179. package/dist/model/plugin-loading.d.ts.map +1 -1
  180. package/dist/model/plugin-loading.js +24 -8
  181. package/dist/model/plugin-loading.js.map +1 -1
  182. package/dist/model/plugins.d.ts +23 -0
  183. package/dist/model/plugins.d.ts.map +1 -1
  184. package/dist/model/plugins.js +4 -1
  185. package/dist/model/plugins.js.map +1 -1
  186. package/dist/model/silences-queries.d.ts +33 -0
  187. package/dist/model/silences-queries.d.ts.map +1 -0
  188. package/dist/model/silences-queries.js +15 -0
  189. package/dist/model/silences-queries.js.map +1 -0
  190. package/dist/model/time-series-queries.d.ts +11 -1
  191. package/dist/model/time-series-queries.d.ts.map +1 -1
  192. package/dist/model/time-series-queries.js +4 -1
  193. package/dist/model/time-series-queries.js.map +1 -1
  194. package/dist/model/trace-queries.d.ts +2 -3
  195. package/dist/model/trace-queries.d.ts.map +1 -1
  196. package/dist/model/trace-queries.js.map +1 -1
  197. package/dist/remote/PersesPlugin.types.d.ts +2 -0
  198. package/dist/remote/PersesPlugin.types.d.ts.map +1 -1
  199. package/dist/remote/PersesPlugin.types.js.map +1 -1
  200. package/dist/remote/PluginLoaderComponent.js +1 -1
  201. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  202. package/dist/remote/PluginRuntime.d.ts +7 -1
  203. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  204. package/dist/remote/PluginRuntime.js +46 -10
  205. package/dist/remote/PluginRuntime.js.map +1 -1
  206. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  207. package/dist/remote/remotePluginLoader.js +28 -5
  208. package/dist/remote/remotePluginLoader.js.map +1 -1
  209. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  210. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +35 -26
  211. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  212. package/dist/runtime/DataQueriesProvider/model.d.ts +4 -4
  213. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  214. package/dist/runtime/DataQueriesProvider/model.js +0 -82
  215. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  216. package/dist/runtime/RouterProvider.js +1 -1
  217. package/dist/runtime/RouterProvider.js.map +1 -1
  218. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
  219. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  220. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
  221. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  222. package/dist/runtime/UsageMetricsProvider.js +2 -2
  223. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  224. package/dist/runtime/alerts-queries.d.ts +11 -0
  225. package/dist/runtime/alerts-queries.d.ts.map +1 -0
  226. package/dist/runtime/alerts-queries.js +89 -0
  227. package/dist/runtime/alerts-queries.js.map +1 -0
  228. package/dist/runtime/annotations.d.ts +6 -0
  229. package/dist/runtime/annotations.d.ts.map +1 -0
  230. package/dist/runtime/annotations.js +129 -0
  231. package/dist/runtime/annotations.js.map +1 -0
  232. package/dist/runtime/datasources.d.ts +6 -0
  233. package/dist/runtime/datasources.d.ts.map +1 -1
  234. package/dist/runtime/datasources.js.map +1 -1
  235. package/dist/runtime/index.d.ts +3 -1
  236. package/dist/runtime/index.d.ts.map +1 -1
  237. package/dist/runtime/index.js +3 -1
  238. package/dist/runtime/index.js.map +1 -1
  239. package/dist/runtime/item-actions.js +1 -1
  240. package/dist/runtime/item-actions.js.map +1 -1
  241. package/dist/runtime/log-queries.js +4 -1
  242. package/dist/runtime/log-queries.js.map +1 -1
  243. package/dist/runtime/plugin-registry.d.ts +2 -2
  244. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  245. package/dist/runtime/plugin-registry.js +12 -3
  246. package/dist/runtime/plugin-registry.js.map +1 -1
  247. package/dist/runtime/profile-queries.js +4 -1
  248. package/dist/runtime/profile-queries.js.map +1 -1
  249. package/dist/runtime/silences-queries.d.ts +11 -0
  250. package/dist/runtime/silences-queries.d.ts.map +1 -0
  251. package/dist/runtime/silences-queries.js +89 -0
  252. package/dist/runtime/silences-queries.js.map +1 -0
  253. package/dist/runtime/time-series-queries.js +4 -1
  254. package/dist/runtime/time-series-queries.js.map +1 -1
  255. package/dist/runtime/trace-queries.js +4 -1
  256. package/dist/runtime/trace-queries.js.map +1 -1
  257. package/dist/test/mock-data.d.ts +3 -1
  258. package/dist/test/mock-data.d.ts.map +1 -1
  259. package/dist/test/mock-data.js +45 -0
  260. package/dist/test/mock-data.js.map +1 -1
  261. package/dist/test/render.js +1 -1
  262. package/dist/test/render.js.map +1 -1
  263. package/dist/test/test-plugins/bert/index.d.ts +12 -6
  264. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  265. package/dist/test/test-plugins/bert/index.js +6 -2
  266. package/dist/test/test-plugins/bert/index.js.map +1 -1
  267. package/dist/test/test-plugins/ernie/index.d.ts +8 -6
  268. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  269. package/dist/test/test-plugins/ernie/index.js +6 -2
  270. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  271. package/dist/test/test-plugins/index.js +2 -2
  272. package/dist/test/test-plugins/index.js.map +1 -1
  273. package/dist/test/utils.d.ts.map +1 -1
  274. package/dist/test/utils.js +2 -2
  275. package/dist/test/utils.js.map +1 -1
  276. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  277. package/dist/test-utils/mock-plugin-registry.js +8 -2
  278. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  279. package/dist/utils/index.d.ts +0 -1
  280. package/dist/utils/index.d.ts.map +1 -1
  281. package/dist/utils/index.js +0 -1
  282. package/dist/utils/index.js.map +1 -1
  283. package/package.json +7 -6
  284. package/dist/cjs/runtime/QueryCountProvider.js +0 -83
  285. package/dist/runtime/QueryCountProvider.d.ts +0 -9
  286. package/dist/runtime/QueryCountProvider.d.ts.map +0 -1
  287. package/dist/runtime/QueryCountProvider.js.map +0 -1
  288. package/dist/utils/action.d.ts +0 -4
  289. package/dist/utils/action.d.ts.map +0 -1
  290. package/dist/utils/action.js.map +0 -1
@@ -0,0 +1,101 @@
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 SILENCES_QUERY_KEY () {
25
+ return SILENCES_QUERY_KEY;
26
+ },
27
+ get useSilencesQueries () {
28
+ return useSilencesQueries;
29
+ }
30
+ });
31
+ const _reactquery = require("@tanstack/react-query");
32
+ const _datasources = require("./datasources");
33
+ const _pluginregistry = require("./plugin-registry");
34
+ const _variables = require("./variables");
35
+ const _utils = require("./utils");
36
+ const SILENCES_QUERY_KEY = 'SilencesQuery';
37
+ function useSilencesQueries(definitions) {
38
+ const { getPlugin } = (0, _pluginregistry.usePluginRegistry)();
39
+ const context = useSilencesQueryContext();
40
+ const pluginLoaderResponse = (0, _pluginregistry.usePlugins)('SilencesQuery', definitions.map((d)=>({
41
+ kind: d.spec.plugin.kind
42
+ })));
43
+ return (0, _reactquery.useQueries)({
44
+ queries: definitions.map((definition, idx)=>{
45
+ const plugin = pluginLoaderResponse[idx]?.data;
46
+ const { queryEnabled, queryKey } = getQueryOptions({
47
+ context,
48
+ definition,
49
+ plugin
50
+ });
51
+ const silencesQueryKind = definition?.spec?.plugin?.kind;
52
+ return {
53
+ enabled: queryEnabled,
54
+ queryKey: queryKey,
55
+ refetchOnMount: false,
56
+ refetchOnWindowFocus: false,
57
+ refetchOnReconnect: false,
58
+ staleTime: 60_000,
59
+ queryFn: async ({ signal })=>{
60
+ const plugin = await getPlugin({
61
+ kind: SILENCES_QUERY_KEY,
62
+ name: silencesQueryKind
63
+ });
64
+ const data = await plugin.getSilencesData(definition.spec.plugin.spec, context, signal);
65
+ return data;
66
+ }
67
+ };
68
+ })
69
+ });
70
+ }
71
+ function getQueryOptions({ plugin, definition, context }) {
72
+ const { variableState } = context;
73
+ const dependencies = plugin?.dependsOn ? plugin.dependsOn(definition.spec.plugin.spec, context) : {};
74
+ const variableDependencies = dependencies?.variables;
75
+ const filteredVariabledState = (0, _utils.filterVariableStateMap)(variableState, variableDependencies);
76
+ const variablesValueKey = (0, _utils.getVariableValuesKey)(filteredVariabledState);
77
+ // Note: no absoluteTimeRange in query key since silences are current state
78
+ const queryKey = [
79
+ 'query',
80
+ SILENCES_QUERY_KEY,
81
+ definition,
82
+ variablesValueKey
83
+ ];
84
+ let waitToLoad = false;
85
+ if (variableDependencies) {
86
+ waitToLoad = variableDependencies.some((v)=>variableState[v]?.loading);
87
+ }
88
+ const queryEnabled = plugin !== undefined && !waitToLoad;
89
+ return {
90
+ queryKey,
91
+ queryEnabled
92
+ };
93
+ }
94
+ function useSilencesQueryContext() {
95
+ const variableState = (0, _variables.useAllVariableValues)();
96
+ const datasourceStore = (0, _datasources.useDatasourceStore)();
97
+ return {
98
+ variableState,
99
+ datasourceStore
100
+ };
101
+ }
@@ -123,7 +123,10 @@ function useTimeSeriesQueries(definitions, options, queryOptions) {
123
123
  staleTime: Infinity,
124
124
  queryKey: queryKey,
125
125
  queryFn: async ({ signal })=>{
126
- const plugin = await getPlugin(TIME_SERIES_QUERY_KEY, definition.spec.plugin.kind);
126
+ const plugin = await getPlugin({
127
+ kind: TIME_SERIES_QUERY_KEY,
128
+ name: definition.spec.plugin.kind
129
+ });
127
130
  const data = await plugin.getTimeSeriesData(definition.spec.plugin.spec, context, signal);
128
131
  return data;
129
132
  }
@@ -60,7 +60,10 @@ function useTraceQueries(definitions) {
60
60
  refetchOnReconnect: false,
61
61
  staleTime: Infinity,
62
62
  queryFn: async ({ signal })=>{
63
- const plugin = await getPlugin(TRACE_QUERY_KEY, traceQueryKind);
63
+ const plugin = await getPlugin({
64
+ kind: TRACE_QUERY_KEY,
65
+ name: traceQueryKind
66
+ });
64
67
  const data = await plugin.getTraceData(definition.spec.plugin.spec, context, signal);
65
68
  return data;
66
69
  }
@@ -21,6 +21,9 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
+ get MOCK_ALERTS_DATA () {
25
+ return MOCK_ALERTS_DATA;
26
+ },
24
27
  get MOCK_EMPTY_PLUGIN_MODULE () {
25
28
  return MOCK_EMPTY_PLUGIN_MODULE;
26
29
  },
@@ -45,6 +48,9 @@ _export(exports, {
45
48
  get MOCK_REMOTE_PLUGIN_MODULE () {
46
49
  return MOCK_REMOTE_PLUGIN_MODULE;
47
50
  },
51
+ get MOCK_SILENCES_DATA () {
52
+ return MOCK_SILENCES_DATA;
53
+ },
48
54
  get MOCK_TIME_SERIES_DATA () {
49
55
  return MOCK_TIME_SERIES_DATA;
50
56
  },
@@ -170,6 +176,51 @@ const MOCK_PROFILE_DATA = {
170
176
  name: 'cpu'
171
177
  }
172
178
  };
179
+ const MOCK_ALERTS_DATA = {
180
+ alerts: [
181
+ {
182
+ id: 'abc123',
183
+ name: 'HighErrorRate',
184
+ state: 'firing',
185
+ labels: {
186
+ alertname: 'HighErrorRate',
187
+ severity: 'critical',
188
+ service: 'backend'
189
+ },
190
+ annotations: {
191
+ summary: 'High error rate detected'
192
+ },
193
+ severity: 'critical',
194
+ startsAt: '2024-01-01T00:00:00Z',
195
+ endsAt: '2024-01-02T00:00:00Z',
196
+ updatedAt: '2024-01-01T12:00:00Z',
197
+ receivers: [
198
+ 'cluster-01'
199
+ ]
200
+ }
201
+ ]
202
+ };
203
+ const MOCK_SILENCES_DATA = {
204
+ silences: [
205
+ {
206
+ id: 'silence-1',
207
+ state: 'active',
208
+ matchers: [
209
+ {
210
+ name: 'alertname',
211
+ value: 'HighErrorRate',
212
+ isRegex: false,
213
+ isEqual: true
214
+ }
215
+ ],
216
+ startsAt: '2024-01-01T00:00:00Z',
217
+ endsAt: '2024-01-02T00:00:00Z',
218
+ createdBy: 'admin',
219
+ comment: 'Maintenance window',
220
+ updatedAt: '2024-01-01T00:00:00Z'
221
+ }
222
+ ]
223
+ };
173
224
  const MOCK_VALID_PLUGIN_METADATA = {
174
225
  kind: 'Panel',
175
226
  spec: {
@@ -14,18 +14,10 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
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 BertPanel1 () {
25
- return BertPanel1;
26
- },
27
- get BertPanel2 () {
28
- return BertPanel2;
17
+ Object.defineProperty(exports, "plugins", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return plugins;
29
21
  }
30
22
  });
31
23
  const _jsxruntime = require("react/jsx-runtime");
@@ -48,6 +40,7 @@ function BertPanel1Editor({ value, onChange }) {
48
40
  ]
49
41
  });
50
42
  }
43
+ // Dummy plugins to test loading
51
44
  const BertPanel1 = {
52
45
  PanelComponent: ()=>null,
53
46
  panelOptionsEditorComponents: [
@@ -100,3 +93,7 @@ const BertPanel2 = {
100
93
  }),
101
94
  hideQueryEditor: true
102
95
  };
96
+ const plugins = {
97
+ 'Panel:BertPanel1::1.0.0': BertPanel1,
98
+ 'Panel:BertPanel2::1.0.0': BertPanel2
99
+ };
@@ -14,18 +14,10 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
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 ErnieVariable1 () {
25
- return ErnieVariable1;
26
- },
27
- get ErnieVariable2 () {
28
- return ErnieVariable2;
17
+ Object.defineProperty(exports, "plugins", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return plugins;
29
21
  }
30
22
  });
31
23
  const _jsxruntime = require("react/jsx-runtime");
@@ -39,6 +31,7 @@ const data = [
39
31
  value: 'Snuffleupagus'
40
32
  }
41
33
  ];
34
+ // Dummy plugin to test loading
42
35
  const ErnieVariable1 = {
43
36
  getVariableOptions: async ()=>({
44
37
  data
@@ -93,3 +86,7 @@ const ErnieVariable2 = {
93
86
  variableOption2: ''
94
87
  })
95
88
  };
89
+ const plugins = {
90
+ 'Variable:ErnieVariable1::1.0.0': ErnieVariable1,
91
+ 'Variable:ErnieVariable2::1.0.0': ErnieVariable2
92
+ };
@@ -72,10 +72,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
72
72
  const testPluginLoader = (0, _model.dynamicImportPluginLoader)([
73
73
  {
74
74
  resource: _pluginjson.default,
75
- importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bert")))
75
+ importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bert"))).then((m)=>m.plugins)
76
76
  },
77
77
  {
78
78
  resource: _pluginjson1.default,
79
- importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./ernie")))
79
+ importPlugin: ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./ernie"))).then((m)=>m.plugins)
80
80
  }
81
81
  ]);
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "getTestContextWrapper", {
22
22
  });
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
24
  const _reactquery = require("@tanstack/react-query");
25
- const _core = require("@perses-dev/core");
26
25
  const _components = require("../components");
27
26
  const _runtime = require("../runtime");
28
27
  const _testplugins = require("./test-plugins");
@@ -36,8 +35,9 @@ function getTestContextWrapper(contextOptions) {
36
35
  }
37
36
  }
38
37
  });
38
+ const DEFAULT_DASHBOARD_DURATION = '1h';
39
39
  const timeRange = {
40
- start: new Date(Date.now() - Number(_core.DEFAULT_DASHBOARD_DURATION)),
40
+ start: new Date(Date.now() - Number(DEFAULT_DASHBOARD_DURATION)),
41
41
  end: new Date()
42
42
  };
43
43
  return function Wrapper({ children }) {
@@ -28,12 +28,13 @@ _export(exports, {
28
28
  return mockPluginRegistry;
29
29
  }
30
30
  });
31
+ const _model = require("../model");
31
32
  function mockPluginRegistry(...mockPlugins) {
32
33
  const mockPluginResource = {
33
34
  kind: 'PluginModule',
34
35
  metadata: {
35
36
  name: 'Fake Plugin Module for Tests',
36
- version: '0'
37
+ version: '1.0.0'
37
38
  },
38
39
  spec: {
39
40
  // Add metadata for all mock plugins
@@ -51,7 +52,12 @@ function mockPluginRegistry(...mockPlugins) {
51
52
  const mockPluginModule = {};
52
53
  for (const mockPlugin of mockPlugins){
53
54
  // "Export" on the module under the same name as the kind the plugin handles
54
- mockPluginModule[mockPlugin.spec.name] = mockPlugin.plugin;
55
+ mockPluginModule[(0, _model.getPluginModuleCompoundKey)({
56
+ kind: mockPlugin.kind,
57
+ name: mockPlugin.spec.name,
58
+ registry: mockPluginResource.metadata.registry,
59
+ version: mockPluginResource.metadata.version
60
+ })] = mockPlugin.plugin;
55
61
  }
56
62
  const pluginLoader = {
57
63
  getInstalledPlugins () {
@@ -14,7 +14,6 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _export_star(require("./action"), exports);
18
17
  _export_star(require("./event"), exports);
19
18
  _export_star(require("./variables"), exports);
20
19
  _export_star(require("./csv-export"), exports);
@@ -0,0 +1,16 @@
1
+ import { DispatchWithoutAction, ReactElement } from 'react';
2
+ import { AnnotationSpec } from '@perses-dev/spec';
3
+ import { Action } from '@perses-dev/client';
4
+ interface AnnotationEditorFormProps {
5
+ initialAnnotationSpec: AnnotationSpec;
6
+ action: Action;
7
+ isDraft: boolean;
8
+ isReadonly?: boolean;
9
+ onActionChange?: (action: Action) => void;
10
+ onSave: (def: AnnotationSpec) => void;
11
+ onClose: () => void;
12
+ onDelete?: DispatchWithoutAction;
13
+ }
14
+ export declare function AnnotationEditorForm({ initialAnnotationSpec, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete, }: AnnotationEditorFormProps): ReactElement;
15
+ export {};
16
+ //# sourceMappingURL=AnnotationEditorForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationEditorForm.d.ts","sourceRoot":"","sources":["../../../../src/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAyB,MAAM,OAAO,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAclD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAmD5C,UAAU,yBAAyB;IACjC,qBAAqB,EAAE,cAAc,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,yBAAyB,GAAG,YAAY,CAuK1C"}
@@ -0,0 +1,270 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { useCallback, useState } from 'react';
15
+ import { Box, Typography, TextField, Grid, Divider, Stack, IconButton } from '@mui/material';
16
+ import { DiscardChangesConfirmationDialog, ErrorAlert, ErrorBoundary, FormActions, OptionsColorPicker, getSubmitText, getTitleAction } from '@perses-dev/components';
17
+ import { Controller, FormProvider, useForm, useWatch } from 'react-hook-form';
18
+ import { zodResolver } from '@hookform/resolvers/zod';
19
+ import { useQueryClient } from '@tanstack/react-query';
20
+ import InvertColorsIcon from 'mdi-material-ui/InvertColors';
21
+ import { PluginEditor } from '../../PluginEditor';
22
+ import { useValidationSchemas } from '../../../context';
23
+ import { DEFAULT_ANNOTATION_COLOR } from '../constants';
24
+ import { AnnotationPreview } from './AnnotationPreview';
25
+ function FallbackPreview() {
26
+ return /*#__PURE__*/ _jsx("div", {
27
+ children: "Error previewing annotations"
28
+ });
29
+ }
30
+ function AnnotationPluginControl({ action, control, onRunQuery }) {
31
+ const plugin = useWatch({
32
+ control,
33
+ name: 'plugin'
34
+ });
35
+ const kind = plugin?.kind;
36
+ const pluginSpec = plugin?.spec;
37
+ return /*#__PURE__*/ _jsx(Controller, {
38
+ control: control,
39
+ name: "plugin",
40
+ render: ({ field })=>{
41
+ return /*#__PURE__*/ _jsx(PluginEditor, {
42
+ withRunQueryButton: true,
43
+ width: "100%",
44
+ pluginTypes: [
45
+ 'Annotation'
46
+ ],
47
+ pluginKindLabel: "Source",
48
+ value: {
49
+ selection: {
50
+ type: 'Annotation',
51
+ kind: kind ?? 'StaticListAnnotation'
52
+ },
53
+ spec: pluginSpec ?? {}
54
+ },
55
+ isReadonly: action === 'read',
56
+ onChange: (v)=>{
57
+ field.onChange({
58
+ kind: v.selection.kind,
59
+ spec: v.spec
60
+ });
61
+ },
62
+ onRunQuery: onRunQuery
63
+ });
64
+ }
65
+ });
66
+ }
67
+ export function AnnotationEditorForm({ initialAnnotationSpec, action, isDraft, isReadonly, onActionChange, onSave, onClose, onDelete }) {
68
+ const queryClient = useQueryClient();
69
+ const [isDiscardDialogOpened, setDiscardDialogOpened] = useState(false);
70
+ const titleAction = getTitleAction(action, isDraft);
71
+ const submitText = getSubmitText(action, isDraft);
72
+ const { annotationEditorSchema } = useValidationSchemas();
73
+ const form = useForm({
74
+ resolver: zodResolver(annotationEditorSchema),
75
+ mode: 'onBlur',
76
+ defaultValues: initialAnnotationSpec
77
+ });
78
+ /* We use `previewDefinition` to explicitly update the spec
79
+ * that will be used for preview when running query. The reason why we do this is to avoid
80
+ * having to re-fetch the values when the user is still editing the spec.
81
+ * Using structuredClone to not have reference issues with nested objects.
82
+ */ const [previewSpec, setPreviewSpec] = useState(structuredClone(form.getValues()));
83
+ const handleRunQuery = useCallback(async ()=>{
84
+ const values = form.getValues();
85
+ if (JSON.stringify(previewSpec) === JSON.stringify(values)) {
86
+ await queryClient.invalidateQueries({
87
+ queryKey: [
88
+ 'annotation',
89
+ previewSpec
90
+ ]
91
+ });
92
+ } else {
93
+ setPreviewSpec(structuredClone(values));
94
+ }
95
+ }, [
96
+ form,
97
+ previewSpec,
98
+ queryClient
99
+ ]);
100
+ const processForm = (data)=>{
101
+ // reset display attributes to undefined when empty, because we don't want to save empty strings
102
+ onSave(data);
103
+ };
104
+ function handleCancel() {
105
+ if (JSON.stringify(initialAnnotationSpec) !== JSON.stringify(form.getValues())) {
106
+ setDiscardDialogOpened(true);
107
+ } else {
108
+ onClose();
109
+ }
110
+ }
111
+ return /*#__PURE__*/ _jsxs(FormProvider, {
112
+ ...form,
113
+ children: [
114
+ /*#__PURE__*/ _jsxs(Box, {
115
+ sx: {
116
+ display: 'flex',
117
+ alignItems: 'center',
118
+ padding: (theme)=>theme.spacing(1, 2),
119
+ borderBottom: (theme)=>`1px solid ${theme.palette.divider}`
120
+ },
121
+ children: [
122
+ /*#__PURE__*/ _jsxs(Typography, {
123
+ variant: "h2",
124
+ children: [
125
+ titleAction,
126
+ " Annotation"
127
+ ]
128
+ }),
129
+ /*#__PURE__*/ _jsx(FormActions, {
130
+ action: action,
131
+ submitText: submitText,
132
+ isReadonly: isReadonly,
133
+ isValid: form.formState.isValid,
134
+ onActionChange: onActionChange,
135
+ onSubmit: form.handleSubmit(processForm),
136
+ onDelete: onDelete,
137
+ onCancel: handleCancel
138
+ })
139
+ ]
140
+ }),
141
+ /*#__PURE__*/ _jsxs(Box, {
142
+ padding: 2,
143
+ sx: {
144
+ overflowY: 'scroll'
145
+ },
146
+ children: [
147
+ /*#__PURE__*/ _jsxs(Grid, {
148
+ container: true,
149
+ spacing: 2,
150
+ mb: 2,
151
+ children: [
152
+ /*#__PURE__*/ _jsx(Grid, {
153
+ item: true,
154
+ xs: 12,
155
+ children: /*#__PURE__*/ _jsx(Controller, {
156
+ control: form.control,
157
+ name: "display.name",
158
+ render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
159
+ ...field,
160
+ required: true,
161
+ fullWidth: true,
162
+ label: "Name",
163
+ InputLabelProps: {
164
+ shrink: action === 'read' ? true : undefined
165
+ },
166
+ InputProps: {
167
+ disabled: action === 'update' && !isDraft,
168
+ readOnly: action === 'read'
169
+ },
170
+ error: !!fieldState.error,
171
+ helperText: fieldState.error?.message,
172
+ value: field.value ?? '',
173
+ onChange: (event)=>{
174
+ field.onChange(event);
175
+ }
176
+ })
177
+ })
178
+ }),
179
+ /*#__PURE__*/ _jsx(Grid, {
180
+ item: true,
181
+ xs: 12,
182
+ children: /*#__PURE__*/ _jsxs(Stack, {
183
+ direction: "row",
184
+ gap: 1,
185
+ children: [
186
+ /*#__PURE__*/ _jsx(Controller, {
187
+ control: form.control,
188
+ name: "display.color",
189
+ render: ({ field })=>{
190
+ const isEnabled = field.value !== undefined;
191
+ return /*#__PURE__*/ _jsx(_Fragment, {
192
+ children: isEnabled ? /*#__PURE__*/ _jsx(OptionsColorPicker, {
193
+ size: "medium",
194
+ label: "annotation",
195
+ color: field.value ?? DEFAULT_ANNOTATION_COLOR,
196
+ onColorChange: (color)=>field.onChange(color),
197
+ onClear: ()=>field.onChange(undefined)
198
+ }) : /*#__PURE__*/ _jsx(IconButton, {
199
+ size: "medium",
200
+ onClick: ()=>field.onChange(DEFAULT_ANNOTATION_COLOR),
201
+ children: /*#__PURE__*/ _jsx(InvertColorsIcon, {})
202
+ })
203
+ });
204
+ }
205
+ }),
206
+ /*#__PURE__*/ _jsx(Controller, {
207
+ control: form.control,
208
+ name: "display.description",
209
+ render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
210
+ ...field,
211
+ fullWidth: true,
212
+ label: "Description",
213
+ InputLabelProps: {
214
+ shrink: action === 'read' ? true : undefined
215
+ },
216
+ InputProps: {
217
+ readOnly: action === 'read'
218
+ },
219
+ error: !!fieldState.error,
220
+ helperText: fieldState.error?.message,
221
+ value: field.value ?? '',
222
+ onChange: (event)=>{
223
+ field.onChange(event);
224
+ }
225
+ })
226
+ })
227
+ ]
228
+ })
229
+ })
230
+ ]
231
+ }),
232
+ /*#__PURE__*/ _jsx(Divider, {}),
233
+ /*#__PURE__*/ _jsx(ErrorBoundary, {
234
+ FallbackComponent: FallbackPreview,
235
+ resetKeys: [
236
+ previewSpec
237
+ ],
238
+ children: /*#__PURE__*/ _jsx(AnnotationPreview, {
239
+ spec: previewSpec,
240
+ sx: {
241
+ marginY: 2
242
+ }
243
+ })
244
+ }),
245
+ /*#__PURE__*/ _jsx(ErrorBoundary, {
246
+ FallbackComponent: ErrorAlert,
247
+ children: /*#__PURE__*/ _jsx(AnnotationPluginControl, {
248
+ action: action,
249
+ control: form.control,
250
+ onRunQuery: handleRunQuery
251
+ })
252
+ })
253
+ ]
254
+ }),
255
+ /*#__PURE__*/ _jsx(DiscardChangesConfirmationDialog, {
256
+ description: "Are you sure you want to discard these changes? Changes cannot be recovered.",
257
+ isOpen: isDiscardDialogOpened,
258
+ onCancel: ()=>{
259
+ setDiscardDialogOpened(false);
260
+ },
261
+ onDiscardChanges: ()=>{
262
+ setDiscardDialogOpened(false);
263
+ onClose();
264
+ }
265
+ })
266
+ ]
267
+ });
268
+ }
269
+
270
+ //# sourceMappingURL=AnnotationEditorForm.js.map