@perses-dev/plugin-system 0.0.0-snapshot-scatter-chart-embed-8efdfab → 0.0.0-snapshot-explorer-plugin-c4a7621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +1 -1
  2. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +83 -163
  3. package/dist/cjs/components/DatasourceSelect.js +12 -15
  4. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +528 -0
  5. package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
  6. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
  7. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
  8. package/dist/cjs/{validation/resource.js → components/MetricLabelInput/index.js} +15 -9
  9. package/dist/cjs/components/{TraceQueryEditor/TraceQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +39 -40
  10. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
  11. package/dist/cjs/components/MultiQueryEditor/index.js +30 -0
  12. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
  13. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  14. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
  15. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +54 -62
  16. package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
  17. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +44 -33
  18. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
  19. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +9 -10
  20. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +20 -17
  21. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
  22. package/dist/cjs/components/ProjectSelect.js +7 -7
  23. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +131 -0
  24. package/dist/cjs/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
  25. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +394 -439
  26. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +17 -15
  27. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
  28. package/dist/cjs/components/Variables/variable-model.js +35 -37
  29. package/dist/cjs/components/index.js +4 -1
  30. package/dist/cjs/constants/user-interface-text.js +4 -1
  31. package/dist/cjs/context/ProjectStoreProvider.js +12 -9
  32. package/dist/cjs/context/ValidationProvider.js +69 -0
  33. package/dist/cjs/context/index.js +1 -0
  34. package/dist/cjs/index.js +1 -1
  35. package/dist/{components/TimeSeriesQueryEditor/index.js → cjs/model/explore.js} +4 -3
  36. package/dist/cjs/model/legend.js +5 -5
  37. package/dist/cjs/remote/PersesPlugin.types.js +16 -0
  38. package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
  39. package/dist/cjs/remote/PluginRuntime.js +267 -0
  40. package/dist/cjs/{validation → remote}/index.js +2 -4
  41. package/dist/cjs/remote/remotePluginLoader.js +61 -0
  42. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +23 -14
  43. package/dist/cjs/runtime/DataQueriesProvider/model.js +10 -9
  44. package/dist/cjs/runtime/QueryCountProvider.js +83 -0
  45. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +37 -13
  46. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
  47. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
  48. package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
  49. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +20 -23
  50. package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
  51. package/dist/cjs/runtime/builtin-variables.js +7 -7
  52. package/dist/cjs/runtime/datasources.js +30 -21
  53. package/dist/cjs/runtime/index.js +4 -2
  54. package/dist/cjs/runtime/plugin-registry.js +48 -36
  55. package/dist/cjs/runtime/time-series-queries.js +35 -40
  56. package/dist/cjs/runtime/trace-queries.js +9 -6
  57. package/dist/cjs/runtime/{template-variables.js → variables.js} +38 -48
  58. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
  59. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -65
  60. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
  61. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
  62. package/dist/cjs/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +9 -9
  63. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +1 -1
  64. package/dist/cjs/stories/shared-utils/decorators/index.js +2 -2
  65. package/dist/cjs/test/mock-data.js +25 -4
  66. package/dist/cjs/test/render.js +2 -11
  67. package/dist/cjs/test/test-plugins/bert/index.js +21 -20
  68. package/dist/cjs/test/test-plugins/ernie/index.js +2 -2
  69. package/dist/cjs/test/test-plugins/index.js +3 -1
  70. package/dist/cjs/test-utils/mock-plugin-registry.js +13 -13
  71. package/dist/cjs/utils/action.js +3 -3
  72. package/dist/cjs/utils/variables.js +24 -24
  73. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
  74. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  75. package/dist/components/CalculationSelector/CalculationSelector.js +1 -1
  76. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  77. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +7 -7
  78. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  79. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +86 -166
  80. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  81. package/dist/components/DatasourceSelect.d.ts +4 -4
  82. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  83. package/dist/components/DatasourceSelect.js +9 -12
  84. package/dist/components/DatasourceSelect.js.map +1 -1
  85. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
  86. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
  87. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +474 -0
  88. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
  89. package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
  90. package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
  91. package/dist/components/HTTPSettingsEditor/index.js +15 -0
  92. package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
  93. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -2
  94. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  95. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
  96. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  97. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
  98. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
  99. package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
  100. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
  101. package/dist/components/MetricLabelInput/index.d.ts +2 -0
  102. package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
  103. package/dist/components/MetricLabelInput/index.js +15 -0
  104. package/dist/components/MetricLabelInput/index.js.map +1 -0
  105. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
  106. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
  107. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +42 -39
  108. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
  109. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
  110. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
  111. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +33 -10
  112. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
  113. package/dist/components/MultiQueryEditor/index.d.ts +2 -0
  114. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
  115. package/dist/components/MultiQueryEditor/index.js +15 -0
  116. package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
  117. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +4 -4
  118. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  119. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +3 -3
  120. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  121. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
  122. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  123. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  124. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  125. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +5 -5
  126. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  127. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +3 -3
  128. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  129. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -3
  130. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  131. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +56 -64
  132. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  133. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
  134. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  135. package/dist/components/PluginEditor/PluginEditor.js +16 -13
  136. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  137. package/dist/components/PluginEditor/plugin-editor-api.d.ts +16 -10
  138. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  139. package/dist/components/PluginEditor/plugin-editor-api.js +44 -33
  140. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  141. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +11 -5
  142. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  143. package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
  144. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  145. package/dist/components/PluginRegistry/PluginRegistry.d.ts +4 -4
  146. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  147. package/dist/components/PluginRegistry/PluginRegistry.js +9 -10
  148. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  149. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
  150. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  151. package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
  152. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  153. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -5
  154. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  155. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +3 -3
  156. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  157. package/dist/components/ProjectSelect.d.ts +3 -3
  158. package/dist/components/ProjectSelect.d.ts.map +1 -1
  159. package/dist/components/ProjectSelect.js +7 -7
  160. package/dist/components/ProjectSelect.js.map +1 -1
  161. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +14 -0
  162. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -0
  163. package/dist/components/TimeRangeControls/TimeRangeControls.js +110 -0
  164. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -0
  165. package/dist/components/TimeRangeControls/index.d.ts +2 -0
  166. package/dist/components/TimeRangeControls/index.d.ts.map +1 -0
  167. package/dist/components/{TraceQueryEditor → TimeRangeControls}/index.js +1 -1
  168. package/dist/components/TimeRangeControls/index.js.map +1 -0
  169. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
  170. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  171. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -442
  172. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  173. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -3
  174. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  175. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +11 -11
  176. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  177. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +3 -3
  178. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  179. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -12
  180. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  181. package/dist/components/Variables/variable-model.d.ts +2 -1
  182. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  183. package/dist/components/Variables/variable-model.js +29 -31
  184. package/dist/components/Variables/variable-model.js.map +1 -1
  185. package/dist/components/index.d.ts +4 -1
  186. package/dist/components/index.d.ts.map +1 -1
  187. package/dist/components/index.js +4 -1
  188. package/dist/components/index.js.map +1 -1
  189. package/dist/constants/user-interface-text.d.ts +2 -0
  190. package/dist/constants/user-interface-text.d.ts.map +1 -1
  191. package/dist/constants/user-interface-text.js +4 -1
  192. package/dist/constants/user-interface-text.js.map +1 -1
  193. package/dist/context/ProjectStoreProvider.d.ts +4 -4
  194. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  195. package/dist/context/ProjectStoreProvider.js +9 -6
  196. package/dist/context/ProjectStoreProvider.js.map +1 -1
  197. package/dist/context/ValidationProvider.d.ts +19 -0
  198. package/dist/context/ValidationProvider.d.ts.map +1 -0
  199. package/dist/context/ValidationProvider.js +52 -0
  200. package/dist/context/ValidationProvider.js.map +1 -0
  201. package/dist/context/index.d.ts +1 -0
  202. package/dist/context/index.d.ts.map +1 -1
  203. package/dist/context/index.js +1 -0
  204. package/dist/context/index.js.map +1 -1
  205. package/dist/context/query-params.d.ts.map +1 -1
  206. package/dist/context/query-params.js.map +1 -1
  207. package/dist/index.d.ts +1 -1
  208. package/dist/index.d.ts.map +1 -1
  209. package/dist/index.js +1 -1
  210. package/dist/index.js.map +1 -1
  211. package/dist/model/datasource.js +3 -1
  212. package/dist/model/datasource.js.map +1 -1
  213. package/dist/model/explore.d.ts +13 -0
  214. package/dist/model/explore.d.ts.map +1 -0
  215. package/dist/{validation/resource.js → model/explore.js} +4 -3
  216. package/dist/model/explore.js.map +1 -0
  217. package/dist/model/legend.d.ts +2 -2
  218. package/dist/model/legend.d.ts.map +1 -1
  219. package/dist/model/legend.js.map +1 -1
  220. package/dist/model/panels.d.ts +17 -5
  221. package/dist/model/panels.d.ts.map +1 -1
  222. package/dist/model/panels.js.map +1 -1
  223. package/dist/model/plugin-base.d.ts +0 -1
  224. package/dist/model/plugin-base.d.ts.map +1 -1
  225. package/dist/model/plugin-base.js.map +1 -1
  226. package/dist/model/plugin-loading.js.map +1 -1
  227. package/dist/model/plugins.d.ts +35 -21
  228. package/dist/model/plugins.d.ts.map +1 -1
  229. package/dist/model/plugins.js.map +1 -1
  230. package/dist/model/time-series-queries.d.ts +4 -3
  231. package/dist/model/time-series-queries.d.ts.map +1 -1
  232. package/dist/model/time-series-queries.js.map +1 -1
  233. package/dist/model/trace-queries.d.ts +1 -1
  234. package/dist/model/trace-queries.d.ts.map +1 -1
  235. package/dist/model/trace-queries.js.map +1 -1
  236. package/dist/model/variables.d.ts +2 -2
  237. package/dist/model/variables.d.ts.map +1 -1
  238. package/dist/model/variables.js +3 -1
  239. package/dist/model/variables.js.map +1 -1
  240. package/dist/remote/PersesPlugin.types.d.ts +7 -0
  241. package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
  242. package/dist/remote/PersesPlugin.types.js +15 -0
  243. package/dist/remote/PersesPlugin.types.js.map +1 -0
  244. package/dist/remote/PluginLoaderComponent.d.ts +10 -0
  245. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
  246. package/dist/remote/PluginLoaderComponent.js +67 -0
  247. package/dist/remote/PluginLoaderComponent.js.map +1 -0
  248. package/dist/remote/PluginRuntime.d.ts +11 -0
  249. package/dist/remote/PluginRuntime.d.ts.map +1 -0
  250. package/dist/remote/PluginRuntime.js +202 -0
  251. package/dist/remote/PluginRuntime.js.map +1 -0
  252. package/dist/remote/index.d.ts +3 -0
  253. package/dist/remote/index.d.ts.map +1 -0
  254. package/dist/{validation → remote}/index.js +2 -4
  255. package/dist/remote/index.js.map +1 -0
  256. package/dist/remote/remotePluginLoader.d.ts +3 -0
  257. package/dist/remote/remotePluginLoader.d.ts.map +1 -0
  258. package/dist/remote/remotePluginLoader.js +53 -0
  259. package/dist/remote/remotePluginLoader.js.map +1 -0
  260. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  261. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  262. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -10
  263. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  264. package/dist/runtime/DataQueriesProvider/model.d.ts +6 -7
  265. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  266. package/dist/runtime/DataQueriesProvider/model.js +10 -9
  267. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  268. package/dist/runtime/QueryCountProvider.d.ts +9 -0
  269. package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
  270. package/dist/{validation/datasource.js → runtime/QueryCountProvider.js} +14 -10
  271. package/dist/runtime/QueryCountProvider.js.map +1 -0
  272. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +6 -2
  273. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  274. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +30 -9
  275. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  276. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
  277. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  278. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +3 -3
  279. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  280. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
  281. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
  282. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
  283. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
  284. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  285. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  286. package/dist/runtime/TimeRangeProvider/index.js +2 -1
  287. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  288. package/dist/runtime/TimeRangeProvider/query-params.d.ts +1 -1
  289. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  290. package/dist/runtime/TimeRangeProvider/query-params.js +8 -11
  291. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  292. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  293. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  294. package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
  295. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
  296. package/dist/runtime/UsageMetricsProvider.js +77 -0
  297. package/dist/runtime/UsageMetricsProvider.js.map +1 -0
  298. package/dist/runtime/builtin-variables.d.ts +2 -2
  299. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  300. package/dist/runtime/builtin-variables.js +4 -4
  301. package/dist/runtime/builtin-variables.js.map +1 -1
  302. package/dist/runtime/datasources.d.ts +5 -4
  303. package/dist/runtime/datasources.d.ts.map +1 -1
  304. package/dist/runtime/datasources.js +24 -15
  305. package/dist/runtime/datasources.js.map +1 -1
  306. package/dist/runtime/index.d.ts +3 -1
  307. package/dist/runtime/index.d.ts.map +1 -1
  308. package/dist/runtime/index.js +4 -2
  309. package/dist/runtime/index.js.map +1 -1
  310. package/dist/runtime/plugin-registry.d.ts +11 -11
  311. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  312. package/dist/runtime/plugin-registry.js +40 -28
  313. package/dist/runtime/plugin-registry.js.map +1 -1
  314. package/dist/runtime/time-series-queries.d.ts +5 -4
  315. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  316. package/dist/runtime/time-series-queries.js +28 -33
  317. package/dist/runtime/time-series-queries.js.map +1 -1
  318. package/dist/runtime/trace-queries.d.ts +5 -4
  319. package/dist/runtime/trace-queries.d.ts.map +1 -1
  320. package/dist/runtime/trace-queries.js +10 -7
  321. package/dist/runtime/trace-queries.js.map +1 -1
  322. package/dist/runtime/{template-variables.d.ts → variables.d.ts} +7 -7
  323. package/dist/runtime/variables.d.ts.map +1 -0
  324. package/dist/runtime/{template-variables.js → variables.js} +35 -44
  325. package/dist/runtime/variables.js.map +1 -0
  326. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +3 -3
  327. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
  328. package/dist/stories/shared-utils/decorators/WithDataQueries.js +1 -1
  329. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  330. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +2 -2
  331. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
  332. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -22
  333. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
  334. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +3 -3
  335. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
  336. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
  337. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
  338. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +3 -3
  339. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  340. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +5 -5
  341. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  342. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts +13 -0
  343. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts.map +1 -0
  344. package/dist/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +10 -10
  345. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.js.map +1 -0
  346. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +3 -3
  347. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
  348. package/dist/stories/shared-utils/decorators/WithTimeRange.js +1 -1
  349. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  350. package/dist/stories/shared-utils/decorators/index.d.ts +1 -1
  351. package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
  352. package/dist/stories/shared-utils/decorators/index.js +2 -2
  353. package/dist/stories/shared-utils/decorators/index.js.map +1 -1
  354. package/dist/test/mock-data.d.ts.map +1 -1
  355. package/dist/test/mock-data.js +25 -4
  356. package/dist/test/mock-data.js.map +1 -1
  357. package/dist/test/render.d.ts +4 -4
  358. package/dist/test/render.d.ts.map +1 -1
  359. package/dist/test/render.js +2 -11
  360. package/dist/test/render.js.map +1 -1
  361. package/dist/test/setup-tests.js.map +1 -1
  362. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  363. package/dist/test/test-plugins/bert/index.js +21 -20
  364. package/dist/test/test-plugins/bert/index.js.map +1 -1
  365. package/dist/test/test-plugins/ernie/index.js +2 -2
  366. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  367. package/dist/test-utils/mock-plugin-registry.d.ts +6 -4
  368. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  369. package/dist/test-utils/mock-plugin-registry.js +10 -10
  370. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  371. package/dist/utils/variables.d.ts +4 -4
  372. package/dist/utils/variables.d.ts.map +1 -1
  373. package/dist/utils/variables.js +19 -19
  374. package/dist/utils/variables.js.map +1 -1
  375. package/package.json +7 -6
  376. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +0 -146
  377. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
  378. package/dist/cjs/validation/datasource.js +0 -30
  379. package/dist/cjs/validation/role.js +0 -85
  380. package/dist/cjs/validation/rolebinding.js +0 -55
  381. package/dist/cjs/validation/secret.js +0 -176
  382. package/dist/cjs/validation/variable.js +0 -48
  383. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -8
  384. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
  385. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
  386. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -13
  387. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
  388. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
  389. package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
  390. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
  391. package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
  392. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -9
  393. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
  394. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
  395. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
  396. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -13
  397. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
  398. package/dist/components/TraceQueryEditor/TraceQueryInput.js +0 -83
  399. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
  400. package/dist/components/TraceQueryEditor/index.d.ts +0 -2
  401. package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
  402. package/dist/runtime/template-variables.d.ts.map +0 -1
  403. package/dist/runtime/template-variables.js.map +0 -1
  404. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -13
  405. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
  406. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
  407. package/dist/validation/datasource.d.ts +0 -19
  408. package/dist/validation/datasource.d.ts.map +0 -1
  409. package/dist/validation/datasource.js.map +0 -1
  410. package/dist/validation/index.d.ts +0 -5
  411. package/dist/validation/index.d.ts.map +0 -1
  412. package/dist/validation/index.js.map +0 -1
  413. package/dist/validation/resource.d.ts +0 -3
  414. package/dist/validation/resource.d.ts.map +0 -1
  415. package/dist/validation/resource.js.map +0 -1
  416. package/dist/validation/role.d.ts +0 -228
  417. package/dist/validation/role.d.ts.map +0 -1
  418. package/dist/validation/role.js +0 -66
  419. package/dist/validation/role.js.map +0 -1
  420. package/dist/validation/rolebinding.d.ts +0 -137
  421. package/dist/validation/rolebinding.d.ts.map +0 -1
  422. package/dist/validation/rolebinding.js +0 -47
  423. package/dist/validation/rolebinding.js.map +0 -1
  424. package/dist/validation/secret.d.ts +0 -964
  425. package/dist/validation/secret.d.ts.map +0 -1
  426. package/dist/validation/secret.js +0 -157
  427. package/dist/validation/secret.js.map +0 -1
  428. package/dist/validation/variable.d.ts +0 -96
  429. package/dist/validation/variable.d.ts.map +0 -1
  430. package/dist/validation/variable.js +0 -40
  431. package/dist/validation/variable.js.map +0 -1
@@ -29,7 +29,7 @@ _export(exports, {
29
29
  }
30
30
  });
31
31
  const _jsxruntime = require("react/jsx-runtime");
32
- function BertPanel1Editor({ value , onChange }) {
32
+ function BertPanel1Editor({ value, onChange }) {
33
33
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
34
34
  children: [
35
35
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -60,30 +60,31 @@ const BertPanel1 = {
60
60
  option1: ''
61
61
  })
62
62
  };
63
+ function BertPanel2Editor({ value, onChange }) {
64
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
65
+ children: [
66
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
67
+ htmlFor: "editor-input",
68
+ children: "BertPanel2 editor"
69
+ }),
70
+ /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
71
+ type: "text",
72
+ id: "editor-input",
73
+ value: value.option2,
74
+ onChange: (e)=>onChange({
75
+ ...value,
76
+ option2: e.target.value
77
+ })
78
+ })
79
+ ]
80
+ });
81
+ }
63
82
  const BertPanel2 = {
64
83
  PanelComponent: ()=>null,
65
84
  panelOptionsEditorComponents: [
66
85
  {
67
86
  label: 'Settings',
68
- content: function BertPanel2Editor({ value , onChange }) {
69
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
70
- children: [
71
- /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
72
- htmlFor: "editor-input",
73
- children: "BertPanel2 editor"
74
- }),
75
- /*#__PURE__*/ (0, _jsxruntime.jsx)("input", {
76
- type: "text",
77
- id: "editor-input",
78
- value: value.option2,
79
- onChange: (e)=>onChange({
80
- ...value,
81
- option2: e.target.value
82
- })
83
- })
84
- ]
85
- });
86
- }
87
+ content: BertPanel2Editor
87
88
  },
88
89
  {
89
90
  label: 'Custom Tab',
@@ -43,7 +43,7 @@ const ErnieVariable1 = {
43
43
  getVariableOptions: async ()=>({
44
44
  data
45
45
  }),
46
- OptionsEditorComponent: function ErnieVariableEditor({ value , onChange }) {
46
+ OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
47
47
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
48
48
  children: [
49
49
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -70,7 +70,7 @@ const ErnieVariable2 = {
70
70
  getVariableOptions: async ()=>({
71
71
  data
72
72
  }),
73
- OptionsEditorComponent: function ErnieVariableEditor({ value , onChange }) {
73
+ OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {
74
74
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
75
75
  children: [
76
76
  /*#__PURE__*/ (0, _jsxruntime.jsx)("label", {
@@ -49,7 +49,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
49
49
  if (cache && cache.has(obj)) {
50
50
  return cache.get(obj);
51
51
  }
52
- var newObj = {};
52
+ var newObj = {
53
+ __proto__: null
54
+ };
53
55
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
54
56
  for(var key in obj){
55
57
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -21,11 +21,11 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- mockPluginRegistry: function() {
25
- return mockPluginRegistry;
26
- },
27
24
  getMockPluginName: function() {
28
25
  return getMockPluginName;
26
+ },
27
+ mockPluginRegistry: function() {
28
+ return mockPluginRegistry;
29
29
  }
30
30
  });
31
31
  function mockPluginRegistry(...mockPlugins) {
@@ -33,17 +33,17 @@ function mockPluginRegistry(...mockPlugins) {
33
33
  kind: 'PluginModule',
34
34
  metadata: {
35
35
  name: 'Fake Plugin Module for Tests',
36
- createdAt: '',
37
- updatedAt: '',
38
- version: 0
36
+ version: '0'
39
37
  },
40
38
  spec: {
41
39
  // Add metadata for all mock plugins
42
- plugins: mockPlugins.map(({ pluginType , kind })=>({
43
- pluginType,
40
+ plugins: mockPlugins.map(({ kind, spec: { name } })=>({
44
41
  kind,
45
- display: {
46
- name: getMockPluginName(pluginType, kind)
42
+ spec: {
43
+ name,
44
+ display: {
45
+ name: getMockPluginName(kind, name)
46
+ }
47
47
  }
48
48
  }))
49
49
  }
@@ -51,7 +51,7 @@ function mockPluginRegistry(...mockPlugins) {
51
51
  const mockPluginModule = {};
52
52
  for (const mockPlugin of mockPlugins){
53
53
  // "Export" on the module under the same name as the kind the plugin handles
54
- mockPluginModule[mockPlugin.kind] = mockPlugin.plugin;
54
+ mockPluginModule[mockPlugin.spec.name] = mockPlugin.plugin;
55
55
  }
56
56
  const pluginLoader = {
57
57
  getInstalledPlugins () {
@@ -70,6 +70,6 @@ function mockPluginRegistry(...mockPlugins) {
70
70
  }
71
71
  };
72
72
  }
73
- function getMockPluginName(pluginType, kind) {
74
- return `${pluginType} Plugin for ${kind}`;
73
+ function getMockPluginName(kind, name) {
74
+ return `${kind} Plugin for ${name}`;
75
75
  }
@@ -21,11 +21,11 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- getTitleAction: function() {
25
- return getTitleAction;
26
- },
27
24
  getSubmitText: function() {
28
25
  return getSubmitText;
26
+ },
27
+ getTitleAction: function() {
28
+ return getTitleAction;
29
29
  }
30
30
  });
31
31
  function getTitleAction(action, isDraft) {
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright 2024 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -21,53 +21,53 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- replaceTemplateVariables: function() {
25
- return replaceTemplateVariables;
24
+ parseVariables: function() {
25
+ return parseVariables;
26
26
  },
27
- replaceTemplateVariable: function() {
28
- return replaceTemplateVariable;
27
+ replaceVariable: function() {
28
+ return replaceVariable;
29
29
  },
30
- parseTemplateVariables: function() {
31
- return parseTemplateVariables;
30
+ replaceVariables: function() {
31
+ return replaceVariables;
32
32
  }
33
33
  });
34
- function replaceTemplateVariables(text, variableState) {
35
- const variables = parseTemplateVariables(text);
34
+ function replaceVariables(text, variableState) {
35
+ const variables = parseVariables(text);
36
36
  let finalText = text;
37
37
  variables// Sorting variables by their length.
38
38
  // In order to not have a variable name have contained in another variable name.
39
39
  // i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'
40
40
  .sort((a, b)=>b.length - a.length).forEach((v)=>{
41
41
  const variable = variableState[v];
42
- if (variable && (variable === null || variable === void 0 ? void 0 : variable.value)) {
43
- finalText = replaceTemplateVariable(finalText, v, variable === null || variable === void 0 ? void 0 : variable.value);
42
+ if (variable && variable.value !== undefined) {
43
+ finalText = replaceVariable(finalText, v, variable?.value);
44
44
  }
45
45
  });
46
46
  return finalText;
47
47
  }
48
- function replaceTemplateVariable(text, varName, templateVariableValue) {
49
- const variableTemplate = '$' + varName;
50
- const bracketsVariableTemplate = '${' + varName + '}';
48
+ function replaceVariable(text, varName, variableValue) {
49
+ const variableSyntax = '$' + varName;
50
+ const alternativeVariableSyntax = '${' + varName + '}';
51
51
  let replaceString = '';
52
- if (Array.isArray(templateVariableValue)) {
53
- replaceString = `(${templateVariableValue.join('|')})`; // regex style
52
+ if (Array.isArray(variableValue)) {
53
+ replaceString = `(${variableValue.join('|')})`; // regex style
54
54
  }
55
- if (typeof templateVariableValue === 'string') {
56
- replaceString = templateVariableValue;
55
+ if (typeof variableValue === 'string') {
56
+ replaceString = variableValue;
57
57
  }
58
- text = text.replaceAll(variableTemplate, replaceString);
59
- return text.replaceAll(bracketsVariableTemplate, replaceString);
58
+ text = text.replaceAll(variableSyntax, replaceString);
59
+ return text.replaceAll(alternativeVariableSyntax, replaceString);
60
60
  }
61
- // This regular expression is designed to identify variable references in a template string.
61
+ // This regular expression is designed to identify variable references in a string.
62
62
  // It supports two formats for referencing variables:
63
63
  // 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\w+ matches one or more word characters).
64
64
  // 2. ${variableName} - This is a more complex format and the regular expression captures the variable name (\w+ matches one or more word characters) in the curly braces.
65
65
  // 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.
66
66
  // TODO: Fix this lint error
67
67
  // eslint-disable-next-line no-useless-escape
68
- const TEMPLATE_VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
69
- const parseTemplateVariables = (text)=>{
70
- const regex = TEMPLATE_VARIABLE_REGEX;
68
+ const VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
69
+ const parseVariables = (text)=>{
70
+ const regex = VARIABLE_REGEX;
71
71
  const matches = new Set();
72
72
  let match;
73
73
  while((match = regex.exec(text)) !== null){
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
2
1
  import { CalculationType } from '@perses-dev/core';
2
+ import { ReactElement } from 'react';
3
3
  export interface CalculationSelectorProps {
4
4
  value: CalculationType;
5
5
  onChange: (unit: CalculationType) => void;
6
6
  }
7
- export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps): JSX.Element;
7
+ export declare function CalculationSelector({ value, onChange }: CalculationSelectorProps): ReactElement;
8
8
  //# sourceMappingURL=CalculationSelector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAU3F,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAuBhF"}
1
+ {"version":3,"file":"CalculationSelector.d.ts","sourceRoot":"","sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"names":[],"mappings":"AAcA,OAAO,EAA0C,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAUrC,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3C;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAuB/F"}
@@ -19,7 +19,7 @@ const CALC_OPTIONS = Object.entries(CALCULATIONS_CONFIG).map(([id, config])=>{
19
19
  ...config
20
20
  };
21
21
  });
22
- export function CalculationSelector({ value , onChange }) {
22
+ export function CalculationSelector({ value, onChange }) {
23
23
  const handleCalculationChange = (_, newValue)=>{
24
24
  onChange(newValue.id);
25
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps) {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption) => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n ></SettingsAutocomplete>\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","CALCULATIONS_CONFIG","CALC_OPTIONS","Object","entries","map","id","config","CalculationSelector","value","onChange","handleCalculationChange","_","newValue","calcConfig","label","control","options","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpF,SAASC,mBAAmB,QAA4C,mBAAmB;AAG3F,MAAMC,eAAgDC,OAAOC,QAAQH,qBAAqBI,IAAI,CAAC,CAACC,IAAIC,OAAO;IACzG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAOA,OAAO,SAASC,oBAAoB,EAAEC,MAAK,EAAEC,SAAQ,EAA4B;IAC/E,MAAMC,0BAA0B,CAACC,GAAYC;QAC3CH,SAASG,SAASP;IACpB;IAEA,MAAMQ,aAAab,mBAAmB,CAACQ,MAAM;IAE7C,qBACE,KAACV;QACCgB,OAAM;QACNC,uBACE,KAAChB;YACCS,OAAO;gBACL,GAAGK,UAAU;gBACbR,IAAIG;YACN;YACAQ,SAASf;YACTQ,UAAUC;YACVO,gBAAgB;;;AAK1B"}
1
+ {"version":3,"sources":["../../../src/components/CalculationSelector/CalculationSelector.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { OptionsEditorControl, SettingsAutocomplete } from '@perses-dev/components';\nimport { CALCULATIONS_CONFIG, CalculationConfig, CalculationType } from '@perses-dev/core';\nimport { ReactElement } from 'react';\n\ntype AutocompleteCalculationOption = CalculationConfig & { id: CalculationType };\nconst CALC_OPTIONS: AutocompleteCalculationOption[] = Object.entries(CALCULATIONS_CONFIG).map(([id, config]) => {\n return {\n id: id as CalculationType,\n ...config,\n };\n});\n\nexport interface CalculationSelectorProps {\n value: CalculationType;\n onChange: (unit: CalculationType) => void;\n}\n\nexport function CalculationSelector({ value, onChange }: CalculationSelectorProps): ReactElement {\n const handleCalculationChange = (_: unknown, newValue: AutocompleteCalculationOption): void => {\n onChange(newValue.id);\n };\n\n const calcConfig = CALCULATIONS_CONFIG[value];\n\n return (\n <OptionsEditorControl\n label=\"Calculation\"\n control={\n <SettingsAutocomplete\n value={{\n ...calcConfig,\n id: value,\n }}\n options={CALC_OPTIONS}\n onChange={handleCalculationChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","CALCULATIONS_CONFIG","CALC_OPTIONS","Object","entries","map","id","config","CalculationSelector","value","onChange","handleCalculationChange","_","newValue","calcConfig","label","control","options","disableClearable"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,oBAAoB,EAAEC,oBAAoB,QAAQ,yBAAyB;AACpF,SAASC,mBAAmB,QAA4C,mBAAmB;AAI3F,MAAMC,eAAgDC,OAAOC,OAAO,CAACH,qBAAqBI,GAAG,CAAC,CAAC,CAACC,IAAIC,OAAO;IACzG,OAAO;QACLD,IAAIA;QACJ,GAAGC,MAAM;IACX;AACF;AAOA,OAAO,SAASC,oBAAoB,EAAEC,KAAK,EAAEC,QAAQ,EAA4B;IAC/E,MAAMC,0BAA0B,CAACC,GAAYC;QAC3CH,SAASG,SAASP,EAAE;IACtB;IAEA,MAAMQ,aAAab,mBAAmB,CAACQ,MAAM;IAE7C,qBACE,KAACV;QACCgB,OAAM;QACNC,uBACE,KAAChB;YACCS,OAAO;gBACL,GAAGK,UAAU;gBACbR,IAAIG;YACN;YACAQ,SAASf;YACTQ,UAAUC;YACVO,gBAAgB;;;AAK1B"}
@@ -1,15 +1,15 @@
1
- import { Action, DatasourceSpec } from '@perses-dev/core';
2
- import { DispatchWithoutAction } from 'react';
1
+ import { Action, DatasourceDefinition } from '@perses-dev/core';
2
+ import { DispatchWithoutAction, ReactElement } from 'react';
3
3
  interface DatasourceEditorFormProps {
4
- initialName: string;
5
- initialSpec: DatasourceSpec;
6
- initialAction: Action;
4
+ initialDatasourceDefinition: DatasourceDefinition;
5
+ action: Action;
7
6
  isDraft: boolean;
8
7
  isReadonly?: boolean;
9
- onSave: (name: string, spec: DatasourceSpec) => void;
8
+ onActionChange?: (action: Action) => void;
9
+ onSave: (def: DatasourceDefinition) => void;
10
10
  onClose: DispatchWithoutAction;
11
11
  onDelete?: DispatchWithoutAction;
12
12
  }
13
- export declare function DatasourceEditorForm(props: DatasourceEditorFormProps): JSX.Element;
13
+ export declare function DatasourceEditorForm(props: DatasourceEditorFormProps): ReactElement;
14
14
  export {};
15
15
  //# sourceMappingURL=DatasourceEditorForm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAyB,MAAM,OAAO,CAAC;AA2BrE,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,cAAc,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACrD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,eAwOpE"}
1
+ {"version":3,"file":"DatasourceEditorForm.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceEditorForm/DatasourceEditorForm.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAMtE,UAAU,yBAAyB;IACjC,2BAA2B,EAAE,oBAAoB,CAAC;IAClD,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,oBAAoB,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,qBAAqB,CAAC;IAC/B,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,CA6MnF"}