@perses-dev/plugin-system 0.0.0-snapshot-panel-extra-content-2-2767e21 → 0.0.0-snapshot-scatter-chart-embed-8efdfab

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 (373) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +6 -4
  2. package/dist/cjs/components/CalculationSelector/index.js +10 -8
  3. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +350 -0
  4. package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
  5. package/dist/cjs/components/DatasourceSelect.js +135 -25
  6. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +18 -16
  7. package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
  8. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +69 -0
  9. package/dist/cjs/components/OptionsEditorRadios/index.js +30 -0
  10. package/dist/cjs/components/{OptionsEditorTabs/TabPanel.js → OptionsEditorTabPanel/OptionsEditorTabPanel.js} +8 -6
  11. package/dist/cjs/components/OptionsEditorTabPanel/index.js +30 -0
  12. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +10 -8
  13. package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
  14. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +55 -14
  15. package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
  16. package/dist/cjs/components/PluginEditor/PluginEditor.js +24 -31
  17. package/dist/cjs/components/PluginEditor/index.js +11 -9
  18. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +5 -3
  19. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +23 -12
  20. package/dist/cjs/components/PluginKindSelect/index.js +10 -8
  21. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
  22. package/dist/cjs/components/PluginRegistry/index.js +10 -8
  23. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +6 -2
  24. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +6 -4
  25. package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
  26. package/dist/cjs/components/ProjectSelect.js +96 -0
  27. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +27 -23
  28. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +21 -19
  29. package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
  30. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +143 -0
  31. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +96 -0
  32. package/dist/cjs/components/TraceQueryEditor/index.js +30 -0
  33. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +438 -229
  34. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +32 -28
  35. package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
  36. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +35 -36
  37. package/dist/cjs/components/Variables/index.js +11 -9
  38. package/dist/cjs/components/Variables/variable-model.js +17 -9
  39. package/dist/cjs/components/index.js +23 -18
  40. package/dist/cjs/constants/index.js +10 -8
  41. package/dist/cjs/constants/user-interface-text.js +3 -1
  42. package/dist/cjs/context/ProjectStoreProvider.js +78 -0
  43. package/dist/cjs/context/index.js +30 -0
  44. package/dist/cjs/context/query-params.js +49 -0
  45. package/dist/cjs/index.js +17 -13
  46. package/dist/cjs/model/index.js +18 -15
  47. package/dist/cjs/model/legend.js +32 -20
  48. package/dist/cjs/model/panels.js +2 -2
  49. package/dist/cjs/model/plugin-base.js +2 -2
  50. package/dist/cjs/model/plugin-loading.js +3 -1
  51. package/dist/cjs/model/trace-queries.js +16 -0
  52. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +67 -35
  53. package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
  54. package/dist/cjs/runtime/DataQueriesProvider/model.js +81 -0
  55. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +43 -26
  56. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +43 -0
  57. package/dist/cjs/runtime/TimeRangeProvider/index.js +12 -9
  58. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +41 -55
  59. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +30 -0
  60. package/dist/cjs/runtime/builtin-variables.js +81 -0
  61. package/dist/cjs/runtime/datasources.js +31 -12
  62. package/dist/cjs/runtime/index.js +17 -13
  63. package/dist/cjs/runtime/plugin-registry.js +41 -11
  64. package/dist/cjs/runtime/template-variables.js +96 -4
  65. package/dist/cjs/runtime/time-series-queries.js +39 -27
  66. package/dist/cjs/runtime/trace-queries.js +76 -0
  67. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
  68. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +18 -15
  69. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
  70. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +31 -13
  71. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
  72. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +9 -7
  73. package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
  74. package/dist/cjs/stories/shared-utils/index.js +10 -8
  75. package/dist/cjs/test/index.js +11 -8
  76. package/dist/cjs/test/mock-data.js +80 -0
  77. package/dist/cjs/test/render.js +13 -11
  78. package/dist/cjs/test/test-plugins/bert/index.js +14 -10
  79. package/dist/cjs/test/test-plugins/ernie/index.js +13 -9
  80. package/dist/cjs/test/test-plugins/index.js +11 -9
  81. package/dist/cjs/test-utils/index.js +10 -8
  82. package/dist/cjs/test-utils/mock-plugin-registry.js +8 -4
  83. package/dist/cjs/utils/action.js +43 -0
  84. package/dist/cjs/utils/index.js +11 -8
  85. package/dist/cjs/utils/variables.js +26 -8
  86. package/dist/cjs/validation/datasource.js +30 -0
  87. package/dist/cjs/validation/index.js +33 -0
  88. package/dist/cjs/validation/resource.js +24 -0
  89. package/dist/cjs/validation/role.js +85 -0
  90. package/dist/cjs/validation/rolebinding.js +55 -0
  91. package/dist/cjs/validation/secret.js +176 -0
  92. package/dist/cjs/validation/variable.js +48 -0
  93. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  94. package/dist/components/CalculationSelector/index.js.map +1 -1
  95. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +15 -0
  96. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
  97. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +342 -0
  98. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
  99. package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
  100. package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
  101. package/dist/components/DatasourceEditorForm/index.js +15 -0
  102. package/dist/components/DatasourceEditorForm/index.js.map +1 -0
  103. package/dist/components/DatasourceSelect.d.ts +6 -0
  104. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  105. package/dist/components/DatasourceSelect.js +118 -23
  106. package/dist/components/DatasourceSelect.js.map +1 -1
  107. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -2
  108. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  109. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  110. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +16 -0
  111. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -0
  112. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +61 -0
  113. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -0
  114. package/dist/components/OptionsEditorRadios/index.d.ts +2 -0
  115. package/dist/components/OptionsEditorRadios/index.d.ts.map +1 -0
  116. package/dist/components/OptionsEditorRadios/index.js +15 -0
  117. package/dist/components/OptionsEditorRadios/index.js.map +1 -0
  118. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +9 -0
  119. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -0
  120. package/dist/components/{OptionsEditorTabs/TabPanel.js → OptionsEditorTabPanel/OptionsEditorTabPanel.js} +2 -2
  121. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -0
  122. package/dist/components/OptionsEditorTabPanel/index.d.ts +2 -0
  123. package/dist/components/OptionsEditorTabPanel/index.d.ts.map +1 -0
  124. package/dist/components/OptionsEditorTabPanel/index.js +15 -0
  125. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -0
  126. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +2 -2
  127. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  128. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  129. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +1 -1
  130. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  131. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +45 -6
  132. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  133. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  134. package/dist/components/PluginEditor/PluginEditor.js +15 -24
  135. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  136. package/dist/components/PluginEditor/index.js.map +1 -1
  137. package/dist/components/PluginEditor/plugin-editor-api.d.ts +2 -1
  138. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  139. package/dist/components/PluginEditor/plugin-editor-api.js +2 -2
  140. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  141. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
  142. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  143. package/dist/components/PluginKindSelect/PluginKindSelect.js +21 -12
  144. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  145. package/dist/components/PluginKindSelect/index.js.map +1 -1
  146. package/dist/components/PluginRegistry/PluginRegistry.js +3 -3
  147. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  148. package/dist/components/PluginRegistry/index.js.map +1 -1
  149. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  150. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +1 -0
  151. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  152. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  153. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  154. package/dist/components/ProjectSelect.d.ts +15 -0
  155. package/dist/components/ProjectSelect.d.ts.map +1 -0
  156. package/dist/components/ProjectSelect.js +91 -0
  157. package/dist/components/ProjectSelect.js.map +1 -0
  158. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -1
  159. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +19 -17
  160. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
  161. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +1 -1
  162. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
  163. package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
  164. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +9 -0
  165. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +1 -0
  166. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +130 -0
  167. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +1 -0
  168. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +13 -0
  169. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +1 -0
  170. package/dist/components/TraceQueryEditor/TraceQueryInput.js +83 -0
  171. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +1 -0
  172. package/dist/components/TraceQueryEditor/index.d.ts +2 -0
  173. package/dist/components/TraceQueryEditor/index.d.ts.map +1 -0
  174. package/dist/components/TraceQueryEditor/index.js +15 -0
  175. package/dist/components/TraceQueryEditor/index.js.map +1 -0
  176. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -8
  177. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  178. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -184
  179. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  180. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  181. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  182. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +8 -19
  183. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +29 -34
  185. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  186. package/dist/components/Variables/index.js.map +1 -1
  187. package/dist/components/Variables/variable-model.js +3 -3
  188. package/dist/components/Variables/variable-model.js.map +1 -1
  189. package/dist/components/index.d.ts +3 -0
  190. package/dist/components/index.d.ts.map +1 -1
  191. package/dist/components/index.js +3 -0
  192. package/dist/components/index.js.map +1 -1
  193. package/dist/constants/index.js.map +1 -1
  194. package/dist/constants/user-interface-text.js.map +1 -1
  195. package/dist/context/ProjectStoreProvider.d.ts +16 -0
  196. package/dist/context/ProjectStoreProvider.d.ts.map +1 -0
  197. package/dist/context/ProjectStoreProvider.js +56 -0
  198. package/dist/context/ProjectStoreProvider.js.map +1 -0
  199. package/dist/context/index.d.ts +2 -0
  200. package/dist/context/index.d.ts.map +1 -0
  201. package/dist/context/index.js +15 -0
  202. package/dist/context/index.js.map +1 -0
  203. package/dist/context/query-params.d.ts +5 -0
  204. package/dist/context/query-params.d.ts.map +1 -0
  205. package/dist/context/query-params.js +41 -0
  206. package/dist/context/query-params.js.map +1 -0
  207. package/dist/index.d.ts +2 -0
  208. package/dist/index.d.ts.map +1 -1
  209. package/dist/index.js +2 -0
  210. package/dist/index.js.map +1 -1
  211. package/dist/model/datasource.d.ts +2 -1
  212. package/dist/model/datasource.d.ts.map +1 -1
  213. package/dist/model/datasource.js.map +1 -1
  214. package/dist/model/index.d.ts +1 -0
  215. package/dist/model/index.d.ts.map +1 -1
  216. package/dist/model/index.js +1 -0
  217. package/dist/model/index.js.map +1 -1
  218. package/dist/model/legend.d.ts +1 -1
  219. package/dist/model/legend.d.ts.map +1 -1
  220. package/dist/model/legend.js +14 -14
  221. package/dist/model/legend.js.map +1 -1
  222. package/dist/model/panels.d.ts +2 -1
  223. package/dist/model/panels.d.ts.map +1 -1
  224. package/dist/model/panels.js.map +1 -1
  225. package/dist/model/plugin-base.d.ts +1 -0
  226. package/dist/model/plugin-base.d.ts.map +1 -1
  227. package/dist/model/plugin-base.js.map +1 -1
  228. package/dist/model/plugin-loading.js.map +1 -1
  229. package/dist/model/plugins.d.ts +2 -0
  230. package/dist/model/plugins.d.ts.map +1 -1
  231. package/dist/model/plugins.js.map +1 -1
  232. package/dist/model/trace-queries.d.ts +19 -0
  233. package/dist/model/trace-queries.d.ts.map +1 -0
  234. package/dist/model/trace-queries.js +15 -0
  235. package/dist/model/trace-queries.js.map +1 -0
  236. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +5 -5
  237. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  238. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +52 -28
  239. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  240. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  241. package/dist/runtime/DataQueriesProvider/model.d.ts +17 -12
  242. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  243. package/dist/runtime/DataQueriesProvider/model.js +67 -1
  244. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  245. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +4 -3
  246. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  247. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +28 -19
  248. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  249. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +9 -0
  250. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -0
  251. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js +30 -0
  252. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -0
  253. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  254. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  255. package/dist/runtime/TimeRangeProvider/index.js +1 -0
  256. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  257. package/dist/runtime/TimeRangeProvider/query-params.d.ts +4 -4
  258. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  259. package/dist/runtime/TimeRangeProvider/query-params.js +9 -41
  260. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  261. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +7 -0
  262. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -0
  263. package/dist/runtime/TimeRangeProvider/refresh-interval.js +25 -0
  264. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -0
  265. package/dist/runtime/builtin-variables.d.ts +11 -0
  266. package/dist/runtime/builtin-variables.d.ts.map +1 -0
  267. package/dist/runtime/builtin-variables.js +59 -0
  268. package/dist/runtime/builtin-variables.js.map +1 -0
  269. package/dist/runtime/datasources.d.ts +42 -7
  270. package/dist/runtime/datasources.d.ts.map +1 -1
  271. package/dist/runtime/datasources.js +15 -7
  272. package/dist/runtime/datasources.js.map +1 -1
  273. package/dist/runtime/index.d.ts +2 -0
  274. package/dist/runtime/index.d.ts.map +1 -1
  275. package/dist/runtime/index.js +2 -0
  276. package/dist/runtime/index.js.map +1 -1
  277. package/dist/runtime/plugin-registry.d.ts +2 -0
  278. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  279. package/dist/runtime/plugin-registry.js +19 -2
  280. package/dist/runtime/plugin-registry.js.map +1 -1
  281. package/dist/runtime/template-variables.d.ts +62 -2
  282. package/dist/runtime/template-variables.d.ts.map +1 -1
  283. package/dist/runtime/template-variables.js +83 -1
  284. package/dist/runtime/template-variables.js.map +1 -1
  285. package/dist/runtime/time-series-queries.d.ts +3 -3
  286. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  287. package/dist/runtime/time-series-queries.js +14 -12
  288. package/dist/runtime/time-series-queries.js.map +1 -1
  289. package/dist/runtime/trace-queries.d.ts +14 -0
  290. package/dist/runtime/trace-queries.d.ts.map +1 -0
  291. package/dist/runtime/trace-queries.js +61 -0
  292. package/dist/runtime/trace-queries.js.map +1 -0
  293. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  294. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
  295. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -1
  296. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
  297. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +13 -0
  298. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
  299. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
  300. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
  301. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  302. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +23 -7
  303. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  304. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
  305. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +2 -2
  306. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
  307. package/dist/stories/shared-utils/decorators/WithTimeRange.js +2 -2
  308. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  309. package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
  310. package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
  311. package/dist/stories/shared-utils/decorators/index.js +1 -0
  312. package/dist/stories/shared-utils/decorators/index.js.map +1 -1
  313. package/dist/stories/shared-utils/index.js.map +1 -1
  314. package/dist/test/index.d.ts +1 -0
  315. package/dist/test/index.d.ts.map +1 -1
  316. package/dist/test/index.js +1 -0
  317. package/dist/test/index.js.map +1 -1
  318. package/dist/test/mock-data.d.ts +4 -0
  319. package/dist/test/mock-data.d.ts.map +1 -0
  320. package/dist/test/mock-data.js +64 -0
  321. package/dist/test/mock-data.js.map +1 -0
  322. package/dist/test/render.js +2 -2
  323. package/dist/test/render.js.map +1 -1
  324. package/dist/test/setup-tests.js.map +1 -1
  325. package/dist/test/test-plugins/bert/index.js.map +1 -1
  326. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  327. package/dist/test/test-plugins/index.js.map +1 -1
  328. package/dist/test-utils/index.js.map +1 -1
  329. package/dist/test-utils/mock-plugin-registry.js +2 -2
  330. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  331. package/dist/utils/action.d.ts +4 -0
  332. package/dist/utils/action.d.ts.map +1 -0
  333. package/dist/utils/action.js +27 -0
  334. package/dist/utils/action.js.map +1 -0
  335. package/dist/utils/index.d.ts +1 -0
  336. package/dist/utils/index.d.ts.map +1 -1
  337. package/dist/utils/index.js +1 -0
  338. package/dist/utils/index.js.map +1 -1
  339. package/dist/utils/variables.d.ts.map +1 -1
  340. package/dist/utils/variables.js +17 -5
  341. package/dist/utils/variables.js.map +1 -1
  342. package/dist/validation/datasource.d.ts +19 -0
  343. package/dist/validation/datasource.d.ts.map +1 -0
  344. package/dist/validation/datasource.js +22 -0
  345. package/dist/validation/datasource.js.map +1 -0
  346. package/dist/validation/index.d.ts +5 -0
  347. package/dist/validation/index.d.ts.map +1 -0
  348. package/dist/validation/index.js +18 -0
  349. package/dist/validation/index.js.map +1 -0
  350. package/dist/validation/resource.d.ts +3 -0
  351. package/dist/validation/resource.d.ts.map +1 -0
  352. package/dist/validation/resource.js +16 -0
  353. package/dist/validation/resource.js.map +1 -0
  354. package/dist/validation/role.d.ts +228 -0
  355. package/dist/validation/role.d.ts.map +1 -0
  356. package/dist/validation/role.js +66 -0
  357. package/dist/validation/role.js.map +1 -0
  358. package/dist/validation/rolebinding.d.ts +137 -0
  359. package/dist/validation/rolebinding.d.ts.map +1 -0
  360. package/dist/validation/rolebinding.js +47 -0
  361. package/dist/validation/rolebinding.js.map +1 -0
  362. package/dist/validation/secret.d.ts +964 -0
  363. package/dist/validation/secret.d.ts.map +1 -0
  364. package/dist/validation/secret.js +157 -0
  365. package/dist/validation/secret.js.map +1 -0
  366. package/dist/validation/variable.d.ts +96 -0
  367. package/dist/validation/variable.d.ts.map +1 -0
  368. package/dist/validation/variable.js +40 -0
  369. package/dist/validation/variable.js.map +1 -0
  370. package/package.json +9 -6
  371. package/dist/components/OptionsEditorTabs/TabPanel.d.ts +0 -9
  372. package/dist/components/OptionsEditorTabs/TabPanel.d.ts.map +0 -1
  373. package/dist/components/OptionsEditorTabs/TabPanel.js.map +0 -1
@@ -21,18 +21,22 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- VariablePreview: ()=>VariablePreview,
25
- VariableListPreview: ()=>VariableListPreview
24
+ VariablePreview: function() {
25
+ return VariablePreview;
26
+ },
27
+ VariableListPreview: function() {
28
+ return VariableListPreview;
29
+ }
26
30
  });
27
- const _jsxRuntime = require("react/jsx-runtime");
28
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
31
+ const _jsxruntime = require("react/jsx-runtime");
32
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
29
33
  const _material = require("@mui/material");
30
34
  const _components = require("@perses-dev/components");
31
- const _refresh = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Refresh"));
32
- const _clipboardOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ClipboardOutline"));
35
+ const _Refresh = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Refresh"));
36
+ const _ClipboardOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ClipboardOutline"));
33
37
  const _constants = require("../../../constants");
34
- const _variableModel = require("../variable-model");
35
- function _interopRequireDefault(obj) {
38
+ const _variablemodel = require("../variable-model");
39
+ function _interop_require_default(obj) {
36
40
  return obj && obj.__esModule ? obj : {
37
41
  default: obj
38
42
  };
@@ -45,7 +49,7 @@ function _getRequireWildcardCache(nodeInterop) {
45
49
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
46
50
  })(nodeInterop);
47
51
  }
48
- function _interopRequireWildcard(obj, nodeInterop) {
52
+ function _interop_require_wildcard(obj, nodeInterop) {
49
53
  if (!nodeInterop && obj && obj.__esModule) {
50
54
  return obj;
51
55
  }
@@ -88,29 +92,29 @@ function VariablePreview(props) {
88
92
  if (values && (values === null || values === void 0 ? void 0 : values.length) > 0 && maxValues) {
89
93
  notShown = values.length - maxValues;
90
94
  }
91
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
95
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
92
96
  children: [
93
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
97
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
94
98
  direction: "row",
95
99
  spacing: 1,
96
100
  alignItems: "center",
97
101
  mb: 1,
98
102
  children: [
99
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
103
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
100
104
  variant: "h4",
101
105
  children: "Preview Values"
102
106
  }),
103
- onRefresh && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
107
+ onRefresh && /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
104
108
  description: _constants.TOOLTIP_TEXT.refreshVariableValues,
105
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
109
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
106
110
  onClick: onRefresh,
107
111
  size: "small",
108
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
112
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Refresh.default, {})
109
113
  })
110
114
  }),
111
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
115
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
112
116
  description: _constants.TOOLTIP_TEXT.copyVariableValues,
113
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
117
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
114
118
  onClick: async ()=>{
115
119
  if (values === null || values === void 0 ? void 0 : values.length) {
116
120
  await navigator.clipboard.writeText(values.map((value)=>value).join(', '));
@@ -118,14 +122,14 @@ function VariablePreview(props) {
118
122
  }
119
123
  },
120
124
  size: "small",
121
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_clipboardOutline.default, {})
125
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ClipboardOutline.default, {})
122
126
  })
123
127
  })
124
128
  ]
125
129
  }),
126
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Card, {
130
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Card, {
127
131
  variant: "outlined",
128
- children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
132
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
129
133
  sx: {
130
134
  display: 'flex',
131
135
  flexWrap: 'wrap',
@@ -133,27 +137,27 @@ function VariablePreview(props) {
133
137
  m: 2
134
138
  },
135
139
  children: [
136
- error && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Alert, {
140
+ error && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
137
141
  severity: "error",
138
142
  children: error
139
143
  }),
140
- (values === null || values === void 0 ? void 0 : values.length) === 0 && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Alert, {
144
+ (values === null || values === void 0 ? void 0 : values.length) === 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Alert, {
141
145
  severity: "info",
142
146
  children: "No results"
143
147
  }),
144
- isLoading && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
148
+ isLoading && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
145
149
  width: "100%",
146
150
  sx: {
147
151
  alignItems: 'center',
148
152
  justifyContent: 'center'
149
153
  },
150
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.CircularProgress, {})
154
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {})
151
155
  }),
152
- values === null || values === void 0 ? void 0 : values.slice(0, maxValues).map((val)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Chip, {
156
+ values === null || values === void 0 ? void 0 : values.slice(0, maxValues).map((val)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
153
157
  size: "small",
154
158
  label: val
155
159
  }, val)),
156
- notShown > 0 && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Chip, {
160
+ notShown > 0 && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Chip, {
157
161
  onClick: showAll,
158
162
  variant: "outlined",
159
163
  size: "small",
@@ -167,9 +171,9 @@ function VariablePreview(props) {
167
171
  }
168
172
  function VariableListPreview(props) {
169
173
  const { definition , onRefresh } = props;
170
- const { data , isFetching , error } = (0, _variableModel.useListVariablePluginValues)(definition);
174
+ const { data , isFetching , error } = (0, _variablemodel.useListVariablePluginValues)(definition);
171
175
  const errorMessage = error === null || error === void 0 ? void 0 : error.message;
172
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(VariablePreview, {
176
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(VariablePreview, {
173
177
  values: (data === null || data === void 0 ? void 0 : data.map((val)=>val.value)) || [],
174
178
  onRefresh: onRefresh,
175
179
  isLoading: isFetching,
@@ -14,16 +14,18 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./VariableEditorForm"), exports);
18
- _exportStar(require("./VariablePreview"), exports);
19
- function _exportStar(from, to) {
17
+ _export_star(require("./VariableEditorForm"), exports);
18
+ _export_star(require("./VariablePreview"), exports);
19
+ function _export_star(from, to) {
20
20
  Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
21
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
+ Object.defineProperty(to, k, {
23
+ enumerable: true,
24
+ get: function() {
25
+ return from[k];
26
+ }
27
+ });
28
+ }
27
29
  });
28
30
  return from;
29
31
  }
@@ -21,59 +21,57 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- getInitialState: ()=>getInitialState,
25
- getVariableDefinitionFromState: ()=>getVariableDefinitionFromState
24
+ getInitialState: function() {
25
+ return getInitialState;
26
+ },
27
+ getVariableDefinitionFromState: function() {
28
+ return getVariableDefinitionFromState;
29
+ }
26
30
  });
27
31
  function getInitialState(initialVariableDefinition) {
28
- var ref, ref1;
29
- var _value;
32
+ var _initialVariableDefinition_spec_display, _initialVariableDefinition_spec_display1;
33
+ var _initialVariableDefinition_spec_value, _initialVariableDefinition_spec_constant;
30
34
  const textVariableFields = {
31
- value: (_value = initialVariableDefinition.spec.value) !== null && _value !== void 0 ? _value : ''
35
+ value: (_initialVariableDefinition_spec_value = initialVariableDefinition.spec.value) !== null && _initialVariableDefinition_spec_value !== void 0 ? _initialVariableDefinition_spec_value : '',
36
+ constant: (_initialVariableDefinition_spec_constant = initialVariableDefinition.spec.constant) !== null && _initialVariableDefinition_spec_constant !== void 0 ? _initialVariableDefinition_spec_constant : false
32
37
  };
33
38
  const listVariableFields = {
34
39
  allowMultiple: false,
35
- allowAll: false,
36
- capturing_regexp: undefined,
40
+ allowAllValue: false,
41
+ customAllValue: undefined,
42
+ capturingRegexp: undefined,
43
+ sort: undefined,
37
44
  plugin: {
38
45
  kind: '',
39
46
  spec: {}
40
- },
41
- customAllValue: undefined
47
+ }
42
48
  };
43
49
  if (initialVariableDefinition.kind === 'ListVariable') {
44
- var _allow_all_value;
45
- listVariableFields.allowMultiple = (_allow_all_value = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value !== void 0 ? _allow_all_value : false;
46
- var _allow_all_value1;
47
- listVariableFields.allowAll = (_allow_all_value1 = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value1 !== void 0 ? _allow_all_value1 : false;
48
- listVariableFields.capturing_regexp = initialVariableDefinition.spec.capturing_regexp;
50
+ var _initialVariableDefinition_spec_allowMultiple;
51
+ listVariableFields.allowMultiple = (_initialVariableDefinition_spec_allowMultiple = initialVariableDefinition.spec.allowMultiple) !== null && _initialVariableDefinition_spec_allowMultiple !== void 0 ? _initialVariableDefinition_spec_allowMultiple : false;
52
+ var _initialVariableDefinition_spec_allowAllValue;
53
+ listVariableFields.allowAllValue = (_initialVariableDefinition_spec_allowAllValue = initialVariableDefinition.spec.allowAllValue) !== null && _initialVariableDefinition_spec_allowAllValue !== void 0 ? _initialVariableDefinition_spec_allowAllValue : false;
54
+ listVariableFields.customAllValue = initialVariableDefinition.spec.customAllValue;
55
+ listVariableFields.capturingRegexp = initialVariableDefinition.spec.capturingRegexp;
56
+ listVariableFields.sort = initialVariableDefinition.spec.sort;
49
57
  listVariableFields.plugin = initialVariableDefinition.spec.plugin;
50
- listVariableFields.customAllValue = initialVariableDefinition.spec.custom_all_value;
51
58
  }
59
+ var _initialVariableDefinition_spec_display_name, _initialVariableDefinition_spec_display_description;
52
60
  return {
53
61
  name: initialVariableDefinition.spec.name,
54
- title: (ref = initialVariableDefinition.spec.display) === null || ref === void 0 ? void 0 : ref.name,
62
+ title: (_initialVariableDefinition_spec_display_name = (_initialVariableDefinition_spec_display = initialVariableDefinition.spec.display) === null || _initialVariableDefinition_spec_display === void 0 ? void 0 : _initialVariableDefinition_spec_display.name) !== null && _initialVariableDefinition_spec_display_name !== void 0 ? _initialVariableDefinition_spec_display_name : '',
55
63
  kind: initialVariableDefinition.kind,
56
- description: (ref1 = initialVariableDefinition.spec.display) === null || ref1 === void 0 ? void 0 : ref1.description,
64
+ description: (_initialVariableDefinition_spec_display_description = (_initialVariableDefinition_spec_display1 = initialVariableDefinition.spec.display) === null || _initialVariableDefinition_spec_display1 === void 0 ? void 0 : _initialVariableDefinition_spec_display1.description) !== null && _initialVariableDefinition_spec_display_description !== void 0 ? _initialVariableDefinition_spec_display_description : '',
57
65
  listVariableFields,
58
66
  textVariableFields
59
67
  };
60
68
  }
61
69
  function getVariableDefinitionFromState(state) {
62
70
  const { name , title , kind , description } = state;
63
- let display = title ? {
64
- name: title
65
- } : undefined;
66
- if (description) {
67
- if (display) {
68
- display.description = description;
69
- } else {
70
- // Name is mandatory if you want to add a description, autofilled by the metadata name if undefined
71
- display = {
72
- name: name,
73
- description: description
74
- };
75
- }
76
- }
71
+ const display = {
72
+ name: title,
73
+ description: description
74
+ };
77
75
  if (kind === 'TextVariable') {
78
76
  return {
79
77
  kind,
@@ -90,11 +88,12 @@ function getVariableDefinitionFromState(state) {
90
88
  spec: {
91
89
  name,
92
90
  display,
93
- allow_multiple: state.listVariableFields.allowMultiple,
94
- allow_all_value: state.listVariableFields.allowAll,
95
- capturing_regexp: state.listVariableFields.capturing_regexp,
96
- plugin: state.listVariableFields.plugin,
97
- custom_all_value: state.listVariableFields.customAllValue
91
+ allowMultiple: state.listVariableFields.allowMultiple,
92
+ allowAllValue: state.listVariableFields.allowAllValue,
93
+ customAllValue: state.listVariableFields.customAllValue,
94
+ capturingRegexp: state.listVariableFields.capturingRegexp,
95
+ sort: state.listVariableFields.sort,
96
+ plugin: state.listVariableFields.plugin
98
97
  }
99
98
  };
100
99
  }
@@ -14,16 +14,18 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./variable-model"), exports);
18
- _exportStar(require("./VariableEditorForm"), exports);
19
- function _exportStar(from, to) {
17
+ _export_star(require("./variable-model"), exports);
18
+ _export_star(require("./VariableEditorForm"), exports);
19
+ function _export_star(from, to) {
20
20
  Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
21
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
+ Object.defineProperty(to, k, {
23
+ enumerable: true,
24
+ get: function() {
25
+ return from[k];
26
+ }
27
+ });
28
+ }
27
29
  });
28
30
  return from;
29
31
  }
@@ -21,12 +21,20 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- filterVariableList: ()=>filterVariableList,
25
- useListVariablePluginValues: ()=>useListVariablePluginValues,
26
- getVariableValuesKey: ()=>getVariableValuesKey,
27
- VARIABLE_TYPES: ()=>VARIABLE_TYPES
24
+ filterVariableList: function() {
25
+ return filterVariableList;
26
+ },
27
+ useListVariablePluginValues: function() {
28
+ return useListVariablePluginValues;
29
+ },
30
+ getVariableValuesKey: function() {
31
+ return getVariableValuesKey;
32
+ },
33
+ VARIABLE_TYPES: function() {
34
+ return VARIABLE_TYPES;
35
+ }
28
36
  });
29
- const _reactQuery = require("@tanstack/react-query");
37
+ const _reactquery = require("@tanstack/react-query");
30
38
  const _runtime = require("../../runtime");
31
39
  function filterVariableList(data, capturedRegexp) {
32
40
  const result = [];
@@ -64,7 +72,7 @@ function useListVariablePluginValues(definition) {
64
72
  variables: allVariables
65
73
  };
66
74
  const spec = definition.spec.plugin.spec;
67
- const capturingRegexp = definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;
75
+ const capturingRegexp = definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;
68
76
  let dependsOnVariables;
69
77
  if (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.dependsOn) {
70
78
  const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
@@ -74,12 +82,12 @@ function useListVariablePluginValues(definition) {
74
82
  let waitToLoad = false;
75
83
  if (dependsOnVariables) {
76
84
  waitToLoad = dependsOnVariables.some((v)=>{
77
- var ref;
78
- return (ref = variables[v]) === null || ref === void 0 ? void 0 : ref.loading;
85
+ var _variables_v;
86
+ return (_variables_v = variables[v]) === null || _variables_v === void 0 ? void 0 : _variables_v.loading;
79
87
  });
80
88
  }
81
89
  const variablesValueKey = getVariableValuesKey(variables);
82
- return (0, _reactQuery.useQuery)([
90
+ return (0, _reactquery.useQuery)([
83
91
  name,
84
92
  definition,
85
93
  variablesValueKey,
@@ -14,25 +14,30 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./CalculationSelector"), exports);
18
- _exportStar(require("./DatasourceSelect"), exports);
19
- _exportStar(require("./LegendOptionsEditor"), exports);
20
- _exportStar(require("./OptionsEditorTabs"), exports);
21
- _exportStar(require("./PanelSpecEditor"), exports);
22
- _exportStar(require("./PluginEditor"), exports);
23
- _exportStar(require("./PluginKindSelect"), exports);
24
- _exportStar(require("./PluginRegistry"), exports);
25
- _exportStar(require("./PluginSpecEditor"), exports);
26
- _exportStar(require("./TimeSeriesQueryEditor"), exports);
27
- _exportStar(require("./Variables"), exports);
28
- function _exportStar(from, to) {
17
+ _export_star(require("./CalculationSelector"), exports);
18
+ _export_star(require("./DatasourceEditorForm"), exports);
19
+ _export_star(require("./DatasourceSelect"), exports);
20
+ _export_star(require("./LegendOptionsEditor"), exports);
21
+ _export_star(require("./OptionsEditorRadios"), exports);
22
+ _export_star(require("./OptionsEditorTabs"), exports);
23
+ _export_star(require("./PanelSpecEditor"), exports);
24
+ _export_star(require("./PluginEditor"), exports);
25
+ _export_star(require("./PluginKindSelect"), exports);
26
+ _export_star(require("./PluginRegistry"), exports);
27
+ _export_star(require("./PluginSpecEditor"), exports);
28
+ _export_star(require("./TimeSeriesQueryEditor"), exports);
29
+ _export_star(require("./Variables"), exports);
30
+ _export_star(require("./ProjectSelect"), exports);
31
+ function _export_star(from, to) {
29
32
  Object.keys(from).forEach(function(k) {
30
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
31
- enumerable: true,
32
- get: function() {
33
- return from[k];
34
- }
35
- });
33
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
34
+ Object.defineProperty(to, k, {
35
+ enumerable: true,
36
+ get: function() {
37
+ return from[k];
38
+ }
39
+ });
40
+ }
36
41
  });
37
42
  return from;
38
43
  }
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./user-interface-text"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./user-interface-text"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
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
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -16,7 +16,9 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "TOOLTIP_TEXT", {
18
18
  enumerable: true,
19
- get: ()=>TOOLTIP_TEXT
19
+ get: function() {
20
+ return TOOLTIP_TEXT;
21
+ }
20
22
  });
21
23
  const TOOLTIP_TEXT = {
22
24
  // Variable editor buttons
@@ -0,0 +1,78 @@
1
+ // Copyright 2023 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: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ ProjectStoreContext: function() {
25
+ return ProjectStoreContext;
26
+ },
27
+ useProjectList: function() {
28
+ return useProjectList;
29
+ },
30
+ useProjectStore: function() {
31
+ return useProjectStore;
32
+ },
33
+ ProjectStoreProvider: function() {
34
+ return ProjectStoreProvider;
35
+ }
36
+ });
37
+ const _jsxruntime = require("react/jsx-runtime");
38
+ const _reactquery = require("@tanstack/react-query");
39
+ const _react = require("react");
40
+ const _core = require("@perses-dev/core");
41
+ const _queryparams = require("./query-params");
42
+ const ProjectStoreContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
43
+ function useProjectList() {
44
+ return (0, _reactquery.useQuery)([
45
+ 'projects'
46
+ ], ()=>{
47
+ return (0, _core.fetchJson)('/api/v1/projects');
48
+ });
49
+ }
50
+ function useProjectStore() {
51
+ const ctx = (0, _react.useContext)(ProjectStoreContext);
52
+ if (ctx === undefined) {
53
+ throw new Error('No ProjectStoreContext found. Did you forget a Provider?');
54
+ }
55
+ return ctx;
56
+ }
57
+ function ProjectStoreProvider(props) {
58
+ const { children , enabledURLParams } = props;
59
+ const { project , setProject } = (0, _queryparams.useSetProjectParams)(enabledURLParams);
60
+ const contextValue = (0, _react.useMemo)(()=>({
61
+ project: {
62
+ kind: 'Project',
63
+ metadata: {
64
+ name: project
65
+ }
66
+ },
67
+ setProject: (project)=>{
68
+ setProject(project.metadata.name);
69
+ }
70
+ }), [
71
+ project,
72
+ setProject
73
+ ]);
74
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(ProjectStoreContext.Provider, {
75
+ value: contextValue,
76
+ children: children
77
+ });
78
+ }
@@ -0,0 +1,30 @@
1
+ // Copyright 2023 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("./ProjectStoreProvider"), 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
+ }
@@ -0,0 +1,49 @@
1
+ // Copyright 2023 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, "useSetProjectParams", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return useSetProjectParams;
21
+ }
22
+ });
23
+ const _react = require("react");
24
+ const _usequeryparams = require("use-query-params");
25
+ function useSetProjectParams(enabledURLParams = true) {
26
+ const [query, setQuery] = (0, _usequeryparams.useQueryParams)({
27
+ project: ''
28
+ }, {
29
+ updateType: 'replaceIn'
30
+ });
31
+ const [projectState, setProjectState] = (0, _react.useState)('none');
32
+ const setProject = (0, _react.useCallback)((project)=>{
33
+ return setQuery({
34
+ project
35
+ });
36
+ }, [
37
+ setQuery
38
+ ]);
39
+ if (enabledURLParams) {
40
+ return {
41
+ project: query.project || 'none',
42
+ setProject
43
+ };
44
+ }
45
+ return {
46
+ project: projectState,
47
+ setProject: setProjectState
48
+ };
49
+ }
package/dist/cjs/index.js CHANGED
@@ -14,20 +14,24 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./components"), exports);
18
- _exportStar(require("./constants"), exports);
19
- _exportStar(require("./model"), exports);
20
- _exportStar(require("./runtime"), exports);
21
- _exportStar(require("./test-utils"), exports);
22
- _exportStar(require("./utils"), exports);
23
- function _exportStar(from, to) {
17
+ _export_star(require("./components"), exports);
18
+ _export_star(require("./constants"), exports);
19
+ _export_star(require("./model"), exports);
20
+ _export_star(require("./runtime"), exports);
21
+ _export_star(require("./test-utils"), exports);
22
+ _export_star(require("./utils"), exports);
23
+ _export_star(require("./validation"), exports);
24
+ _export_star(require("./context"), exports);
25
+ function _export_star(from, to) {
24
26
  Object.keys(from).forEach(function(k) {
25
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
26
- enumerable: true,
27
- get: function() {
28
- return from[k];
29
- }
30
- });
27
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
28
+ Object.defineProperty(to, k, {
29
+ enumerable: true,
30
+ get: function() {
31
+ return from[k];
32
+ }
33
+ });
34
+ }
31
35
  });
32
36
  return from;
33
37
  }