@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 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 (400) hide show
  1. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +82 -162
  2. package/dist/cjs/components/DatasourceSelect.js +8 -13
  3. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +528 -0
  4. package/dist/cjs/components/{TimeSeriesQueryEditor → HTTPSettingsEditor}/index.js +2 -2
  5. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +8 -7
  6. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +41 -0
  7. package/dist/cjs/components/{TraceQueryEditor → MetricLabelInput}/index.js +2 -2
  8. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +22 -18
  9. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +23 -11
  10. package/dist/cjs/{validation/duration.js → components/MultiQueryEditor/index.js} +14 -9
  11. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +51 -59
  12. package/dist/cjs/components/PluginEditor/PluginEditor.js +16 -13
  13. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +43 -32
  14. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +55 -7
  15. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +8 -9
  16. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +17 -14
  17. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  18. package/dist/cjs/components/ProjectSelect.js +5 -5
  19. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +10 -71
  20. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +391 -442
  21. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  22. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  23. package/dist/cjs/components/Variables/variable-model.js +26 -27
  24. package/dist/cjs/components/index.js +3 -1
  25. package/dist/cjs/context/ProjectStoreProvider.js +7 -4
  26. package/dist/cjs/context/ValidationProvider.js +69 -0
  27. package/dist/cjs/context/index.js +1 -0
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/{components/TraceQueryEditor/index.js → cjs/model/explore.js} +4 -3
  30. package/dist/cjs/remote/PersesPlugin.types.js +16 -0
  31. package/dist/cjs/remote/PluginLoaderComponent.js +75 -0
  32. package/dist/cjs/remote/PluginRuntime.js +267 -0
  33. package/dist/cjs/{validation → remote}/index.js +2 -5
  34. package/dist/cjs/remote/remotePluginLoader.js +61 -0
  35. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  36. package/dist/cjs/runtime/DataQueriesProvider/model.js +9 -8
  37. package/dist/cjs/runtime/QueryCountProvider.js +83 -0
  38. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  39. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +100 -0
  40. package/dist/cjs/runtime/TimeRangeProvider/index.js +2 -1
  41. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +4 -7
  42. package/dist/cjs/runtime/UsageMetricsProvider.js +99 -0
  43. package/dist/cjs/runtime/builtin-variables.js +2 -2
  44. package/dist/cjs/runtime/datasources.js +23 -14
  45. package/dist/cjs/runtime/index.js +4 -2
  46. package/dist/cjs/runtime/plugin-registry.js +36 -24
  47. package/dist/cjs/runtime/time-series-queries.js +23 -28
  48. package/dist/cjs/runtime/trace-queries.js +6 -3
  49. package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
  50. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +1 -1
  51. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +1 -67
  52. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
  53. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +4 -4
  54. package/dist/cjs/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +9 -9
  55. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +1 -1
  56. package/dist/cjs/stories/shared-utils/decorators/index.js +2 -2
  57. package/dist/cjs/test/mock-data.js +25 -4
  58. package/dist/cjs/test/render.js +2 -11
  59. package/dist/cjs/test/test-plugins/bert/index.js +20 -19
  60. package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
  61. package/dist/cjs/utils/variables.js +24 -24
  62. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -1
  63. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  64. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  65. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +6 -5
  66. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  67. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
  68. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  69. package/dist/components/DatasourceSelect.d.ts +3 -2
  70. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  71. package/dist/components/DatasourceSelect.js +8 -13
  72. package/dist/components/DatasourceSelect.js.map +1 -1
  73. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
  74. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
  75. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +474 -0
  76. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
  77. package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
  78. package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
  79. package/dist/{validation/duration.js → components/HTTPSettingsEditor/index.js} +2 -4
  80. package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
  81. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
  82. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  83. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
  84. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  85. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
  86. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
  87. package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
  88. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
  89. package/dist/components/MetricLabelInput/index.d.ts +2 -0
  90. package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
  91. package/dist/components/MetricLabelInput/index.js +15 -0
  92. package/dist/components/MetricLabelInput/index.js.map +1 -0
  93. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
  94. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
  95. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +29 -18
  96. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
  97. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
  98. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
  99. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +33 -10
  100. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
  101. package/dist/components/MultiQueryEditor/index.d.ts +2 -0
  102. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
  103. package/dist/components/MultiQueryEditor/index.js +15 -0
  104. package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
  105. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  106. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  107. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  108. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
  109. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  110. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  111. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
  112. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  113. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  114. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
  115. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  116. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +53 -61
  117. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  118. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
  119. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  120. package/dist/components/PluginEditor/PluginEditor.js +16 -13
  121. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  122. package/dist/components/PluginEditor/plugin-editor-api.d.ts +15 -8
  123. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  124. package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
  125. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  126. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
  127. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  128. package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
  129. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  130. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  131. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  132. package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
  133. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  134. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
  135. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  136. package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
  137. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  138. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  139. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  140. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  141. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  142. package/dist/components/ProjectSelect.d.ts +2 -1
  143. package/dist/components/ProjectSelect.d.ts.map +1 -1
  144. package/dist/components/ProjectSelect.js +5 -5
  145. package/dist/components/ProjectSelect.js.map +1 -1
  146. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
  147. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  148. package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
  149. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  150. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
  151. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  152. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -446
  153. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  154. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
  155. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  156. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  157. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  158. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  159. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  160. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  161. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  162. package/dist/components/Variables/variable-model.d.ts +2 -1
  163. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  164. package/dist/components/Variables/variable-model.js +27 -28
  165. package/dist/components/Variables/variable-model.js.map +1 -1
  166. package/dist/components/index.d.ts +3 -1
  167. package/dist/components/index.d.ts.map +1 -1
  168. package/dist/components/index.js +3 -1
  169. package/dist/components/index.js.map +1 -1
  170. package/dist/context/ProjectStoreProvider.d.ts +4 -4
  171. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  172. package/dist/context/ProjectStoreProvider.js +7 -4
  173. package/dist/context/ProjectStoreProvider.js.map +1 -1
  174. package/dist/context/ValidationProvider.d.ts +19 -0
  175. package/dist/context/ValidationProvider.d.ts.map +1 -0
  176. package/dist/context/ValidationProvider.js +52 -0
  177. package/dist/context/ValidationProvider.js.map +1 -0
  178. package/dist/context/index.d.ts +1 -0
  179. package/dist/context/index.d.ts.map +1 -1
  180. package/dist/context/index.js +1 -0
  181. package/dist/context/index.js.map +1 -1
  182. package/dist/context/query-params.d.ts.map +1 -1
  183. package/dist/context/query-params.js.map +1 -1
  184. package/dist/index.d.ts +1 -1
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +1 -1
  187. package/dist/index.js.map +1 -1
  188. package/dist/model/explore.d.ts +13 -0
  189. package/dist/model/explore.d.ts.map +1 -0
  190. package/dist/{validation/index.js → model/explore.js} +4 -6
  191. package/dist/model/explore.js.map +1 -0
  192. package/dist/model/legend.d.ts.map +1 -1
  193. package/dist/model/legend.js.map +1 -1
  194. package/dist/model/panels.d.ts +16 -4
  195. package/dist/model/panels.d.ts.map +1 -1
  196. package/dist/model/panels.js.map +1 -1
  197. package/dist/model/plugin-loading.js.map +1 -1
  198. package/dist/model/plugins.d.ts +31 -17
  199. package/dist/model/plugins.d.ts.map +1 -1
  200. package/dist/model/plugins.js.map +1 -1
  201. package/dist/model/time-series-queries.d.ts +2 -1
  202. package/dist/model/time-series-queries.d.ts.map +1 -1
  203. package/dist/model/time-series-queries.js.map +1 -1
  204. package/dist/remote/PersesPlugin.types.d.ts +7 -0
  205. package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
  206. package/dist/remote/PersesPlugin.types.js +15 -0
  207. package/dist/remote/PersesPlugin.types.js.map +1 -0
  208. package/dist/remote/PluginLoaderComponent.d.ts +10 -0
  209. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
  210. package/dist/remote/PluginLoaderComponent.js +67 -0
  211. package/dist/remote/PluginLoaderComponent.js.map +1 -0
  212. package/dist/remote/PluginRuntime.d.ts +11 -0
  213. package/dist/remote/PluginRuntime.d.ts.map +1 -0
  214. package/dist/remote/PluginRuntime.js +202 -0
  215. package/dist/remote/PluginRuntime.js.map +1 -0
  216. package/dist/remote/index.d.ts +3 -0
  217. package/dist/remote/index.d.ts.map +1 -0
  218. package/dist/{components/TimeSeriesQueryEditor → remote}/index.js +2 -1
  219. package/dist/remote/index.js.map +1 -0
  220. package/dist/remote/remotePluginLoader.d.ts +3 -0
  221. package/dist/remote/remotePluginLoader.d.ts.map +1 -0
  222. package/dist/remote/remotePluginLoader.js +53 -0
  223. package/dist/remote/remotePluginLoader.js.map +1 -0
  224. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  225. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  226. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  227. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  228. package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
  229. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  230. package/dist/runtime/DataQueriesProvider/model.js +9 -8
  231. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  232. package/dist/runtime/QueryCountProvider.d.ts +9 -0
  233. package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
  234. package/dist/{validation/datasource.js → runtime/QueryCountProvider.js} +14 -10
  235. package/dist/runtime/QueryCountProvider.js.map +1 -0
  236. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -2
  237. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  238. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  239. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  240. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
  241. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  242. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  243. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
  244. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
  245. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
  246. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
  247. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  248. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  249. package/dist/runtime/TimeRangeProvider/index.js +2 -1
  250. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  251. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  252. package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
  253. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  254. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  255. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  256. package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
  257. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
  258. package/dist/runtime/UsageMetricsProvider.js +77 -0
  259. package/dist/runtime/UsageMetricsProvider.js.map +1 -0
  260. package/dist/runtime/builtin-variables.d.ts +1 -1
  261. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  262. package/dist/runtime/builtin-variables.js +2 -2
  263. package/dist/runtime/builtin-variables.js.map +1 -1
  264. package/dist/runtime/datasources.d.ts +5 -4
  265. package/dist/runtime/datasources.d.ts.map +1 -1
  266. package/dist/runtime/datasources.js +23 -14
  267. package/dist/runtime/datasources.js.map +1 -1
  268. package/dist/runtime/index.d.ts +3 -1
  269. package/dist/runtime/index.d.ts.map +1 -1
  270. package/dist/runtime/index.js +4 -2
  271. package/dist/runtime/index.js.map +1 -1
  272. package/dist/runtime/plugin-registry.d.ts +10 -10
  273. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  274. package/dist/runtime/plugin-registry.js +36 -24
  275. package/dist/runtime/plugin-registry.js.map +1 -1
  276. package/dist/runtime/time-series-queries.d.ts +5 -4
  277. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  278. package/dist/runtime/time-series-queries.js +23 -28
  279. package/dist/runtime/time-series-queries.js.map +1 -1
  280. package/dist/runtime/trace-queries.d.ts +4 -3
  281. package/dist/runtime/trace-queries.d.ts.map +1 -1
  282. package/dist/runtime/trace-queries.js +7 -4
  283. package/dist/runtime/trace-queries.js.map +1 -1
  284. package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
  285. package/dist/runtime/variables.d.ts.map +1 -0
  286. package/dist/runtime/{template-variables.js → variables.js} +28 -45
  287. package/dist/runtime/variables.js.map +1 -0
  288. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +2 -1
  289. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -1
  290. package/dist/stories/shared-utils/decorators/WithDataQueries.js +1 -1
  291. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  292. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +2 -1
  293. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -1
  294. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +2 -22
  295. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
  296. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +2 -1
  297. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -1
  298. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +1 -1
  299. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -1
  300. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +2 -1
  301. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  302. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +4 -4
  303. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  304. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts +13 -0
  305. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.d.ts.map +1 -0
  306. package/dist/stories/shared-utils/decorators/{WithPluginSystemTemplateVariables.js → WithPluginSystemVariables.js} +10 -10
  307. package/dist/stories/shared-utils/decorators/WithPluginSystemVariables.js.map +1 -0
  308. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +2 -1
  309. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -1
  310. package/dist/stories/shared-utils/decorators/WithTimeRange.js +1 -1
  311. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  312. package/dist/stories/shared-utils/decorators/index.d.ts +1 -1
  313. package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
  314. package/dist/stories/shared-utils/decorators/index.js +2 -2
  315. package/dist/stories/shared-utils/decorators/index.js.map +1 -1
  316. package/dist/test/mock-data.d.ts.map +1 -1
  317. package/dist/test/mock-data.js +25 -4
  318. package/dist/test/mock-data.js.map +1 -1
  319. package/dist/test/render.d.ts +3 -3
  320. package/dist/test/render.d.ts.map +1 -1
  321. package/dist/test/render.js +2 -11
  322. package/dist/test/render.js.map +1 -1
  323. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  324. package/dist/test/test-plugins/bert/index.js +20 -19
  325. package/dist/test/test-plugins/bert/index.js.map +1 -1
  326. package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
  327. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  328. package/dist/test-utils/mock-plugin-registry.js +10 -10
  329. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  330. package/dist/utils/variables.d.ts +4 -4
  331. package/dist/utils/variables.d.ts.map +1 -1
  332. package/dist/utils/variables.js +19 -19
  333. package/dist/utils/variables.js.map +1 -1
  334. package/package.json +7 -6
  335. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
  336. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
  337. package/dist/cjs/validation/datasource.js +0 -30
  338. package/dist/cjs/validation/resource.js +0 -24
  339. package/dist/cjs/validation/role.js +0 -86
  340. package/dist/cjs/validation/rolebinding.js +0 -55
  341. package/dist/cjs/validation/secret.js +0 -176
  342. package/dist/cjs/validation/user.js +0 -46
  343. package/dist/cjs/validation/variable.js +0 -48
  344. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
  345. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
  346. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
  347. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -12
  348. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
  349. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
  350. package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
  351. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
  352. package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
  353. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -8
  354. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
  355. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
  356. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
  357. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -12
  358. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
  359. package/dist/components/TraceQueryEditor/TraceQueryInput.js +0 -83
  360. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
  361. package/dist/components/TraceQueryEditor/index.d.ts +0 -2
  362. package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
  363. package/dist/runtime/template-variables.d.ts.map +0 -1
  364. package/dist/runtime/template-variables.js.map +0 -1
  365. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -12
  366. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
  367. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
  368. package/dist/validation/datasource.d.ts +0 -19
  369. package/dist/validation/datasource.d.ts.map +0 -1
  370. package/dist/validation/datasource.js.map +0 -1
  371. package/dist/validation/duration.d.ts +0 -3
  372. package/dist/validation/duration.d.ts.map +0 -1
  373. package/dist/validation/duration.js.map +0 -1
  374. package/dist/validation/index.d.ts +0 -6
  375. package/dist/validation/index.d.ts.map +0 -1
  376. package/dist/validation/index.js.map +0 -1
  377. package/dist/validation/resource.d.ts +0 -3
  378. package/dist/validation/resource.d.ts.map +0 -1
  379. package/dist/validation/resource.js +0 -16
  380. package/dist/validation/resource.js.map +0 -1
  381. package/dist/validation/role.d.ts +0 -228
  382. package/dist/validation/role.d.ts.map +0 -1
  383. package/dist/validation/role.js +0 -67
  384. package/dist/validation/role.js.map +0 -1
  385. package/dist/validation/rolebinding.d.ts +0 -137
  386. package/dist/validation/rolebinding.d.ts.map +0 -1
  387. package/dist/validation/rolebinding.js +0 -47
  388. package/dist/validation/rolebinding.js.map +0 -1
  389. package/dist/validation/secret.d.ts +0 -964
  390. package/dist/validation/secret.d.ts.map +0 -1
  391. package/dist/validation/secret.js +0 -157
  392. package/dist/validation/secret.js.map +0 -1
  393. package/dist/validation/user.d.ts +0 -93
  394. package/dist/validation/user.d.ts.map +0 -1
  395. package/dist/validation/user.js +0 -38
  396. package/dist/validation/user.js.map +0 -1
  397. package/dist/validation/variable.d.ts +0 -96
  398. package/dist/validation/variable.d.ts.map +0 -1
  399. package/dist/validation/variable.js +0 -40
  400. package/dist/validation/variable.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { VariableValue } from '@perses-dev/core';
2
2
  import { VariableStateMap } from '@perses-dev/plugin-system';
3
- export declare function replaceTemplateVariables(text: string, variableState: VariableStateMap): string;
4
- export declare function replaceTemplateVariable(text: string, varName: string, templateVariableValue: VariableValue): string;
3
+ export declare function replaceVariables(text: string, variableState: VariableStateMap): string;
4
+ export declare function replaceVariable(text: string, varName: string, variableValue: VariableValue): string;
5
5
  /**
6
- * Returns a list of template variables
6
+ * Returns a list of variables
7
7
  */
8
- export declare const parseTemplateVariables: (text: string) => string[];
8
+ export declare const parseVariables: (text: string) => string[];
9
9
  //# sourceMappingURL=variables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/utils/variables.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,GAAG,MAAM,CAgB9F;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,aAAa,UAc1G;AAWD;;GAEG;AACH,eAAO,MAAM,sBAAsB,SAAU,MAAM,aAkBlD,CAAC"}
1
+ {"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/utils/variables.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,GAAG,MAAM,CAgBtF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM,CAcnG;AAWD;;GAEG;AACH,eAAO,MAAM,cAAc,SAAU,MAAM,KAAG,MAAM,EAkBnD,CAAC"}
@@ -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
@@ -10,45 +10,45 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export function replaceTemplateVariables(text, variableState) {
14
- const variables = parseTemplateVariables(text);
13
+ export function replaceVariables(text, variableState) {
14
+ const variables = parseVariables(text);
15
15
  let finalText = text;
16
16
  variables// Sorting variables by their length.
17
17
  // In order to not have a variable name have contained in another variable name.
18
18
  // i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'
19
19
  .sort((a, b)=>b.length - a.length).forEach((v)=>{
20
20
  const variable = variableState[v];
21
- if (variable && (variable === null || variable === void 0 ? void 0 : variable.value)) {
22
- finalText = replaceTemplateVariable(finalText, v, variable === null || variable === void 0 ? void 0 : variable.value);
21
+ if (variable && variable.value !== undefined) {
22
+ finalText = replaceVariable(finalText, v, variable?.value);
23
23
  }
24
24
  });
25
25
  return finalText;
26
26
  }
27
- export function replaceTemplateVariable(text, varName, templateVariableValue) {
28
- const variableTemplate = '$' + varName;
29
- const bracketsVariableTemplate = '${' + varName + '}';
27
+ export function replaceVariable(text, varName, variableValue) {
28
+ const variableSyntax = '$' + varName;
29
+ const alternativeVariableSyntax = '${' + varName + '}';
30
30
  let replaceString = '';
31
- if (Array.isArray(templateVariableValue)) {
32
- replaceString = `(${templateVariableValue.join('|')})`; // regex style
31
+ if (Array.isArray(variableValue)) {
32
+ replaceString = `(${variableValue.join('|')})`; // regex style
33
33
  }
34
- if (typeof templateVariableValue === 'string') {
35
- replaceString = templateVariableValue;
34
+ if (typeof variableValue === 'string') {
35
+ replaceString = variableValue;
36
36
  }
37
- text = text.replaceAll(variableTemplate, replaceString);
38
- return text.replaceAll(bracketsVariableTemplate, replaceString);
37
+ text = text.replaceAll(variableSyntax, replaceString);
38
+ return text.replaceAll(alternativeVariableSyntax, replaceString);
39
39
  }
40
- // This regular expression is designed to identify variable references in a template string.
40
+ // This regular expression is designed to identify variable references in a string.
41
41
  // It supports two formats for referencing variables:
42
42
  // 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\w+ matches one or more word characters).
43
43
  // 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.
44
44
  // 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.
45
45
  // TODO: Fix this lint error
46
46
  // eslint-disable-next-line no-useless-escape
47
- const TEMPLATE_VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
47
+ const VARIABLE_REGEX = /\$(\w+)|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/gm;
48
48
  /**
49
- * Returns a list of template variables
50
- */ export const parseTemplateVariables = (text)=>{
51
- const regex = TEMPLATE_VARIABLE_REGEX;
49
+ * Returns a list of variables
50
+ */ export const parseVariables = (text)=>{
51
+ const regex = VARIABLE_REGEX;
52
52
  const matches = new Set();
53
53
  let match;
54
54
  while((match = regex.exec(text)) !== null){
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/variables.ts"],"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 { VariableValue } from '@perses-dev/core';\nimport { VariableStateMap } from '@perses-dev/plugin-system';\n\nexport function replaceTemplateVariables(text: string, variableState: VariableStateMap): string {\n const variables = parseTemplateVariables(text);\n let finalText = text;\n variables\n // Sorting variables by their length.\n // In order to not have a variable name have contained in another variable name.\n // i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'\n .sort((a, b) => b.length - a.length)\n .forEach((v) => {\n const variable = variableState[v];\n if (variable && variable?.value) {\n finalText = replaceTemplateVariable(finalText, v, variable?.value);\n }\n });\n\n return finalText;\n}\n\nexport function replaceTemplateVariable(text: string, varName: string, templateVariableValue: VariableValue) {\n const variableTemplate = '$' + varName;\n const bracketsVariableTemplate = '${' + varName + '}';\n\n let replaceString = '';\n if (Array.isArray(templateVariableValue)) {\n replaceString = `(${templateVariableValue.join('|')})`; // regex style\n }\n if (typeof templateVariableValue === 'string') {\n replaceString = templateVariableValue;\n }\n\n text = text.replaceAll(variableTemplate, replaceString);\n return text.replaceAll(bracketsVariableTemplate, replaceString);\n}\n\n// This regular expression is designed to identify variable references in a template string.\n// It supports two formats for referencing variables:\n// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\\w+ matches one or more word characters).\n// 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.\n// 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.\n// TODO: Fix this lint error\n// eslint-disable-next-line no-useless-escape\nconst TEMPLATE_VARIABLE_REGEX = /\\$(\\w+)|\\${(\\w+)(?:\\.([^:^\\}]+))?(?::([^\\}]+))?}/gm;\n\n/**\n * Returns a list of template variables\n */\nexport const parseTemplateVariables = (text: string) => {\n const regex = TEMPLATE_VARIABLE_REGEX;\n const matches = new Set<string>();\n let match;\n\n while ((match = regex.exec(text)) !== null) {\n if (match) {\n if (match[1]) {\n // \\$(\\w+)\\\n matches.add(match[1]);\n } else if (match[2]) {\n // \\${(\\w+)}\\\n matches.add(match[2]);\n }\n }\n }\n // return unique matches\n return Array.from(matches.values());\n};\n"],"names":["replaceTemplateVariables","text","variableState","variables","parseTemplateVariables","finalText","sort","a","b","length","forEach","v","variable","value","replaceTemplateVariable","varName","templateVariableValue","variableTemplate","bracketsVariableTemplate","replaceString","Array","isArray","join","replaceAll","TEMPLATE_VARIABLE_REGEX","regex","matches","Set","match","exec","add","from","values"],"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;AAKjC,OAAO,SAASA,yBAAyBC,IAAY,EAAEC,aAA+B;IACpF,MAAMC,YAAYC,uBAAuBH;IACzC,IAAII,YAAYJ;IAChBE,SACE,qCAAqC;IACrC,gFAAgF;IAChF,yEAAyE;KACxEG,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEC,MAAM,GAAGF,EAAEE,MAAM,EAClCC,OAAO,CAAC,CAACC;QACR,MAAMC,WAAWV,aAAa,CAACS,EAAE;QACjC,IAAIC,aAAYA,qBAAAA,+BAAAA,SAAUC,KAAK,GAAE;YAC/BR,YAAYS,wBAAwBT,WAAWM,GAAGC,qBAAAA,+BAAAA,SAAUC,KAAK;QACnE;IACF;IAEF,OAAOR;AACT;AAEA,OAAO,SAASS,wBAAwBb,IAAY,EAAEc,OAAe,EAAEC,qBAAoC;IACzG,MAAMC,mBAAmB,MAAMF;IAC/B,MAAMG,2BAA2B,OAAOH,UAAU;IAElD,IAAII,gBAAgB;IACpB,IAAIC,MAAMC,OAAO,CAACL,wBAAwB;QACxCG,gBAAgB,CAAC,CAAC,EAAEH,sBAAsBM,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc;IACxE;IACA,IAAI,OAAON,0BAA0B,UAAU;QAC7CG,gBAAgBH;IAClB;IAEAf,OAAOA,KAAKsB,UAAU,CAACN,kBAAkBE;IACzC,OAAOlB,KAAKsB,UAAU,CAACL,0BAA0BC;AACnD;AAEA,4FAA4F;AAC5F,qDAAqD;AACrD,gJAAgJ;AAChJ,0KAA0K;AAC1K,2HAA2H;AAC3H,4BAA4B;AAC5B,6CAA6C;AAC7C,MAAMK,0BAA0B;AAEhC;;CAEC,GACD,OAAO,MAAMpB,yBAAyB,CAACH;IACrC,MAAMwB,QAAQD;IACd,MAAME,UAAU,IAAIC;IACpB,IAAIC;IAEJ,MAAO,AAACA,CAAAA,QAAQH,MAAMI,IAAI,CAAC5B,KAAI,MAAO,KAAM;QAC1C,IAAI2B,OAAO;YACT,IAAIA,KAAK,CAAC,EAAE,EAAE;gBACZ,WAAW;gBACXF,QAAQI,GAAG,CAACF,KAAK,CAAC,EAAE;YACtB,OAAO,IAAIA,KAAK,CAAC,EAAE,EAAE;gBACnB,aAAa;gBACbF,QAAQI,GAAG,CAACF,KAAK,CAAC,EAAE;YACtB;QACF;IACF;IACA,wBAAwB;IACxB,OAAOR,MAAMW,IAAI,CAACL,QAAQM,MAAM;AAClC,EAAE"}
1
+ {"version":3,"sources":["../../src/utils/variables.ts"],"sourcesContent":["// Copyright 2024 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 { VariableValue } from '@perses-dev/core';\nimport { VariableStateMap } from '@perses-dev/plugin-system';\n\nexport function replaceVariables(text: string, variableState: VariableStateMap): string {\n const variables = parseVariables(text);\n let finalText = text;\n variables\n // Sorting variables by their length.\n // In order to not have a variable name have contained in another variable name.\n // i.e.: $__range replacing $__range_ms => '3600_ms' instead of '3600000'\n .sort((a, b) => b.length - a.length)\n .forEach((v) => {\n const variable = variableState[v];\n if (variable && variable.value !== undefined) {\n finalText = replaceVariable(finalText, v, variable?.value);\n }\n });\n\n return finalText;\n}\n\nexport function replaceVariable(text: string, varName: string, variableValue: VariableValue): string {\n const variableSyntax = '$' + varName;\n const alternativeVariableSyntax = '${' + varName + '}';\n\n let replaceString = '';\n if (Array.isArray(variableValue)) {\n replaceString = `(${variableValue.join('|')})`; // regex style\n }\n if (typeof variableValue === 'string') {\n replaceString = variableValue;\n }\n\n text = text.replaceAll(variableSyntax, replaceString);\n return text.replaceAll(alternativeVariableSyntax, replaceString);\n}\n\n// This regular expression is designed to identify variable references in a string.\n// It supports two formats for referencing variables:\n// 1. $variableName - This is a simpler format, and the regular expression captures the variable name (\\w+ matches one or more word characters).\n// 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.\n// 3. [COMING SOON] ${variableName:value} - This is a more complex format that allows specifying a format function as well.\n// TODO: Fix this lint error\n// eslint-disable-next-line no-useless-escape\nconst VARIABLE_REGEX = /\\$(\\w+)|\\${(\\w+)(?:\\.([^:^\\}]+))?(?::([^\\}]+))?}/gm;\n\n/**\n * Returns a list of variables\n */\nexport const parseVariables = (text: string): string[] => {\n const regex = VARIABLE_REGEX;\n const matches = new Set<string>();\n let match;\n\n while ((match = regex.exec(text)) !== null) {\n if (match) {\n if (match[1]) {\n // \\$(\\w+)\\\n matches.add(match[1]);\n } else if (match[2]) {\n // \\${(\\w+)}\\\n matches.add(match[2]);\n }\n }\n }\n // return unique matches\n return Array.from(matches.values());\n};\n"],"names":["replaceVariables","text","variableState","variables","parseVariables","finalText","sort","a","b","length","forEach","v","variable","value","undefined","replaceVariable","varName","variableValue","variableSyntax","alternativeVariableSyntax","replaceString","Array","isArray","join","replaceAll","VARIABLE_REGEX","regex","matches","Set","match","exec","add","from","values"],"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;AAKjC,OAAO,SAASA,iBAAiBC,IAAY,EAAEC,aAA+B;IAC5E,MAAMC,YAAYC,eAAeH;IACjC,IAAII,YAAYJ;IAChBE,SACE,qCAAqC;IACrC,gFAAgF;IAChF,yEAAyE;KACxEG,IAAI,CAAC,CAACC,GAAGC,IAAMA,EAAEC,MAAM,GAAGF,EAAEE,MAAM,EAClCC,OAAO,CAAC,CAACC;QACR,MAAMC,WAAWV,aAAa,CAACS,EAAE;QACjC,IAAIC,YAAYA,SAASC,KAAK,KAAKC,WAAW;YAC5CT,YAAYU,gBAAgBV,WAAWM,GAAGC,UAAUC;QACtD;IACF;IAEF,OAAOR;AACT;AAEA,OAAO,SAASU,gBAAgBd,IAAY,EAAEe,OAAe,EAAEC,aAA4B;IACzF,MAAMC,iBAAiB,MAAMF;IAC7B,MAAMG,4BAA4B,OAAOH,UAAU;IAEnD,IAAII,gBAAgB;IACpB,IAAIC,MAAMC,OAAO,CAACL,gBAAgB;QAChCG,gBAAgB,CAAC,CAAC,EAAEH,cAAcM,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc;IAChE;IACA,IAAI,OAAON,kBAAkB,UAAU;QACrCG,gBAAgBH;IAClB;IAEAhB,OAAOA,KAAKuB,UAAU,CAACN,gBAAgBE;IACvC,OAAOnB,KAAKuB,UAAU,CAACL,2BAA2BC;AACpD;AAEA,mFAAmF;AACnF,qDAAqD;AACrD,gJAAgJ;AAChJ,0KAA0K;AAC1K,2HAA2H;AAC3H,4BAA4B;AAC5B,6CAA6C;AAC7C,MAAMK,iBAAiB;AAEvB;;CAEC,GACD,OAAO,MAAMrB,iBAAiB,CAACH;IAC7B,MAAMyB,QAAQD;IACd,MAAME,UAAU,IAAIC;IACpB,IAAIC;IAEJ,MAAO,AAACA,CAAAA,QAAQH,MAAMI,IAAI,CAAC7B,KAAI,MAAO,KAAM;QAC1C,IAAI4B,OAAO;YACT,IAAIA,KAAK,CAAC,EAAE,EAAE;gBACZ,WAAW;gBACXF,QAAQI,GAAG,CAACF,KAAK,CAAC,EAAE;YACtB,OAAO,IAAIA,KAAK,CAAC,EAAE,EAAE;gBACnB,aAAa;gBACbF,QAAQI,GAAG,CAACF,KAAK,CAAC,EAAE;YACtB;QACF;IACF;IACA,wBAAwB;IACxB,OAAOR,MAAMW,IAAI,CAACL,QAAQM,MAAM;AAClC,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/plugin-system",
3
- "version": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
3
+ "version": "0.0.0-snapshot-explorer-plugin-c4a7621",
4
4
  "description": "The plugin feature in Pereses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -28,8 +28,9 @@
28
28
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
29
  },
30
30
  "dependencies": {
31
- "@perses-dev/components": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
32
- "@perses-dev/core": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59",
31
+ "@module-federation/enhanced": "^0.8.9",
32
+ "@perses-dev/components": "0.0.0-snapshot-explorer-plugin-c4a7621",
33
+ "@perses-dev/core": "0.0.0-snapshot-explorer-plugin-c4a7621",
33
34
  "date-fns": "^2.30.0",
34
35
  "immer": "^9.0.15",
35
36
  "react-hook-form": "^7.46.1",
@@ -38,11 +39,11 @@
38
39
  "zod": "^3.22.2"
39
40
  },
40
41
  "devDependencies": {
41
- "@perses-dev/storybook": "0.0.0-snapshot-scatterplot-fix-imports-95e1b59"
42
+ "@perses-dev/storybook": "0.0.0-snapshot-explorer-plugin-c4a7621"
42
43
  },
43
44
  "peerDependencies": {
44
- "@mui/material": "^5.10.0",
45
- "@tanstack/react-query": "^4.7.1",
45
+ "@mui/material": "^6.1.10",
46
+ "@tanstack/react-query": "^5.64.2",
46
47
  "react": "^17.0.2 || ^18.0.0",
47
48
  "react-dom": "^17.0.2 || ^18.0.0"
48
49
  },
@@ -1,143 +0,0 @@
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, "TraceQueryEditor", {
18
- enumerable: true,
19
- get: function() {
20
- return TraceQueryEditor;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
26
- const _react = require("react");
27
- const _immer = require("immer");
28
- const _runtime = require("../../runtime");
29
- const _TraceQueryInput = require("./TraceQueryInput");
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
35
- const DEFAULT_QUERY_PLUGIN_TYPE = 'TraceQuery';
36
- function TraceQueryEditor({ queries = [], onChange }) {
37
- const hasMoreThanOneQuery = queries.length > 1;
38
- const defaultTraceQueryKind = 'TempoTraceQuery';
39
- // State for which queries are collapsed
40
- // TODO: Would be easier if we had IDs for queries.
41
- const [queriesCollapsed, setQueriesCollapsed] = (0, _react.useState)(queries.map(()=>false));
42
- const { data: defaultQueryPlugin } = (0, _runtime.usePlugin)(DEFAULT_QUERY_PLUGIN_TYPE, defaultTraceQueryKind, {
43
- useErrorBoundary: true,
44
- enabled: true
45
- });
46
- // Query handlers
47
- const handleQueryChange = (index, queryDef)=>{
48
- onChange((0, _immer.produce)(queries, (draft)=>{
49
- if (draft) {
50
- draft[index] = queryDef;
51
- } else {
52
- draft = [
53
- queryDef
54
- ];
55
- }
56
- }));
57
- };
58
- const handleQueryAdd = ()=>{
59
- if (!defaultQueryPlugin) return;
60
- onChange((0, _immer.produce)(queries, (draft)=>{
61
- const queryDef = {
62
- kind: DEFAULT_QUERY_PLUGIN_TYPE,
63
- spec: {
64
- plugin: {
65
- kind: defaultTraceQueryKind,
66
- spec: defaultQueryPlugin.createInitialOptions()
67
- }
68
- }
69
- };
70
- if (draft) {
71
- draft.push(queryDef);
72
- } else {
73
- draft = [
74
- ...queries,
75
- queryDef
76
- ];
77
- }
78
- }));
79
- setQueriesCollapsed((queriesCollapsed)=>{
80
- queriesCollapsed.push(false);
81
- return [
82
- ...queriesCollapsed
83
- ];
84
- });
85
- };
86
- const handleQueryDelete = (index)=>{
87
- onChange((0, _immer.produce)(queries, (draft)=>{
88
- draft.splice(index, 1);
89
- }));
90
- setQueriesCollapsed((queriesCollapsed)=>{
91
- queriesCollapsed.splice(index, 1);
92
- return [
93
- ...queriesCollapsed
94
- ];
95
- });
96
- };
97
- const handleQueryCollapseExpand = (index)=>{
98
- setQueriesCollapsed((queriesCollapsed)=>{
99
- queriesCollapsed[index] = !queriesCollapsed[index];
100
- return [
101
- ...queriesCollapsed
102
- ];
103
- });
104
- };
105
- // show one query input if queries is empty
106
- const queryDefinitions = queries.length ? queries : [
107
- {
108
- kind: 'TraceQuery',
109
- spec: {
110
- plugin: {
111
- kind: 'TempoTraceQuery',
112
- spec: {
113
- query: ''
114
- }
115
- }
116
- }
117
- }
118
- ];
119
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
120
- children: [
121
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
122
- spacing: 1,
123
- children: queryDefinitions.map((query, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_TraceQueryInput.TraceQueryInput, {
124
- index: i,
125
- query: query,
126
- isCollapsed: !!queriesCollapsed[i],
127
- onChange: handleQueryChange,
128
- onDelete: hasMoreThanOneQuery ? handleQueryDelete : undefined,
129
- onCollapseExpand: handleQueryCollapseExpand
130
- }, i))
131
- }),
132
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
133
- variant: "contained",
134
- startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
135
- sx: {
136
- marginTop: 1
137
- },
138
- onClick: handleQueryAdd,
139
- children: "Add Query"
140
- })
141
- ]
142
- });
143
- }
@@ -1,96 +0,0 @@
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, "TraceQueryInput", {
18
- enumerable: true,
19
- get: function() {
20
- return TraceQueryInput;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _ChevronDown = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronDown"));
26
- const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
27
- const _DeleteOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/DeleteOutline"));
28
- const _immer = /*#__PURE__*/ _interop_require_default(require("immer"));
29
- const _PluginEditor = require("../PluginEditor");
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
35
- const TraceQueryInput = ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
36
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
37
- spacing: 1,
38
- children: [
39
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
40
- direction: "row",
41
- alignItems: "center",
42
- borderBottom: 1,
43
- borderColor: (theme)=>theme.palette.divider,
44
- children: [
45
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
46
- size: "small",
47
- onClick: ()=>onCollapseExpand(index),
48
- children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronDown.default, {})
49
- }),
50
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Typography, {
51
- variant: "overline",
52
- component: "h4",
53
- children: [
54
- "Query ",
55
- index + 1
56
- ]
57
- }),
58
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
59
- size: "small",
60
- // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible
61
- sx: {
62
- marginLeft: 'auto',
63
- visibility: `${onDelete ? 'visible' : 'hidden'}`
64
- },
65
- onClick: ()=>onDelete && onDelete(index),
66
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteOutline.default, {})
67
- })
68
- ]
69
- }),
70
- !isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsx)(QueryEditor, {
71
- value: query,
72
- onChange: (next)=>onChange(index, next)
73
- })
74
- ]
75
- }, index);
76
- };
77
- /**
78
- * Displays an editor for TraceQueryDefinition objects.
79
- */ function QueryEditor(props) {
80
- const { value, onChange, ...others } = props;
81
- const { spec: { plugin } } = value;
82
- const handlePluginChange = (next)=>{
83
- onChange((0, _immer.default)(value, (draft)=>{
84
- draft.spec.plugin = next;
85
- }));
86
- };
87
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
88
- ...others,
89
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_PluginEditor.PluginEditor, {
90
- pluginType: "TraceQuery",
91
- pluginKindLabel: "Query Type",
92
- value: plugin,
93
- onChange: handlePluginChange
94
- })
95
- });
96
- }
@@ -1,30 +0,0 @@
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, "datasourceEditValidationSchema", {
18
- enumerable: true,
19
- get: function() {
20
- return datasourceEditValidationSchema;
21
- }
22
- });
23
- const _zod = require("zod");
24
- const _resource = require("./resource");
25
- const datasourceEditValidationSchema = _zod.z.object({
26
- name: _resource.resourceIdValidationSchema,
27
- title: _zod.z.string().optional(),
28
- description: _zod.z.string().optional(),
29
- default: _zod.z.boolean()
30
- });
@@ -1,24 +0,0 @@
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, "resourceIdValidationSchema", {
18
- enumerable: true,
19
- get: function() {
20
- return resourceIdValidationSchema;
21
- }
22
- });
23
- const _zod = require("zod");
24
- const resourceIdValidationSchema = _zod.z.string().min(1, 'Required').max(75, 'Must be 75 or fewer characters long').regex(/^[a-zA-Z0-9_.-]+$/, 'Must only contains alphanumerical characters and special characters _ . -');
@@ -1,86 +0,0 @@
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
- globalRoleValidationSchema: function() {
25
- return globalRoleValidationSchema;
26
- },
27
- roleValidationSchema: function() {
28
- return roleValidationSchema;
29
- },
30
- rolesEditorValidationSchema: function() {
31
- return rolesEditorValidationSchema;
32
- }
33
- });
34
- const _zod = require("zod");
35
- const _resource = require("./resource");
36
- const permissionValidationSchema = _zod.z.object({
37
- // TODO: use SCOPE & ACTIONS constants
38
- actions: _zod.z.array(_zod.z.enum([
39
- '*',
40
- 'create',
41
- 'read',
42
- 'update',
43
- 'delete'
44
- ])).nonempty('Must contains at least 1 action'),
45
- scopes: _zod.z.array(_zod.z.enum([
46
- '*',
47
- 'Dashboard',
48
- 'Datasource',
49
- 'EphemeralDashboard',
50
- 'Folder',
51
- 'GlobalDatasource',
52
- 'GlobalRole',
53
- 'GlobalRoleBinding',
54
- 'GlobalSecret',
55
- 'GlobalVariable',
56
- 'Project',
57
- 'Role',
58
- 'RoleBinding',
59
- 'Secret',
60
- 'User',
61
- 'Variable'
62
- ])).nonempty('Must contains at least 1 scope')
63
- });
64
- const roleValidationSchema = _zod.z.object({
65
- kind: _zod.z.literal('Role'),
66
- metadata: _zod.z.object({
67
- name: _resource.resourceIdValidationSchema,
68
- project: _resource.resourceIdValidationSchema
69
- }),
70
- spec: _zod.z.object({
71
- permissions: _zod.z.array(permissionValidationSchema)
72
- })
73
- });
74
- const globalRoleValidationSchema = _zod.z.object({
75
- kind: _zod.z.literal('GlobalRole'),
76
- metadata: _zod.z.object({
77
- name: _resource.resourceIdValidationSchema
78
- }),
79
- spec: _zod.z.object({
80
- permissions: _zod.z.array(permissionValidationSchema)
81
- })
82
- });
83
- const rolesEditorValidationSchema = _zod.z.discriminatedUnion('kind', [
84
- roleValidationSchema,
85
- globalRoleValidationSchema
86
- ]);
@@ -1,55 +0,0 @@
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, "roleBindingsEditorValidationSchema", {
18
- enumerable: true,
19
- get: function() {
20
- return roleBindingsEditorValidationSchema;
21
- }
22
- });
23
- const _zod = require("zod");
24
- const _resource = require("./resource");
25
- const subjectValidationSchema = _zod.z.object({
26
- kind: _zod.z.enum([
27
- 'User'
28
- ]),
29
- name: _resource.resourceIdValidationSchema
30
- });
31
- const roleBindingValidationSchema = _zod.z.object({
32
- kind: _zod.z.literal('RoleBinding'),
33
- metadata: _zod.z.object({
34
- name: _resource.resourceIdValidationSchema,
35
- project: _resource.resourceIdValidationSchema
36
- }),
37
- spec: _zod.z.object({
38
- role: _resource.resourceIdValidationSchema,
39
- subjects: _zod.z.array(subjectValidationSchema).nonempty()
40
- })
41
- });
42
- const globalRoleBindingValidationSchema = _zod.z.object({
43
- kind: _zod.z.literal('GlobalRoleBinding'),
44
- metadata: _zod.z.object({
45
- name: _resource.resourceIdValidationSchema
46
- }),
47
- spec: _zod.z.object({
48
- role: _resource.resourceIdValidationSchema,
49
- subjects: _zod.z.array(subjectValidationSchema)
50
- })
51
- });
52
- const roleBindingsEditorValidationSchema = _zod.z.discriminatedUnion('kind', [
53
- roleBindingValidationSchema,
54
- globalRoleBindingValidationSchema
55
- ]);