@perses-dev/plugin-system 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104

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 (401) 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 +534 -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} +30 -23
  9. package/dist/cjs/components/{TimeSeriesQueryEditor/TimeSeriesQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +25 -13
  10. package/dist/cjs/{stories/shared-utils → components/MultiQueryEditor}/index.js +2 -2
  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/TimeSeriesQueryEditor/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 +273 -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 +10 -9
  37. package/dist/cjs/{stories/shared-utils/decorators/WithPluginRegistry.js → runtime/QueryCountProvider.js} +22 -39
  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 +49 -28
  47. package/dist/cjs/runtime/time-series-queries.js +23 -28
  48. package/dist/cjs/runtime/trace-queries.js +1 -2
  49. package/dist/cjs/runtime/{template-variables.js → variables.js} +29 -47
  50. package/dist/cjs/test/mock-data.js +25 -4
  51. package/dist/cjs/test/render.js +2 -11
  52. package/dist/cjs/test/test-plugins/bert/index.js +20 -19
  53. package/dist/cjs/test-utils/mock-plugin-registry.js +10 -10
  54. package/dist/cjs/utils/variables.js +24 -24
  55. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -1
  56. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  57. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  58. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +6 -5
  59. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  60. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +85 -165
  61. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  62. package/dist/components/DatasourceSelect.d.ts +5 -4
  63. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  64. package/dist/components/DatasourceSelect.js +8 -13
  65. package/dist/components/DatasourceSelect.js.map +1 -1
  66. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +11 -0
  67. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -0
  68. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +480 -0
  69. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -0
  70. package/dist/components/HTTPSettingsEditor/index.d.ts +2 -0
  71. package/dist/components/HTTPSettingsEditor/index.d.ts.map +1 -0
  72. package/dist/components/HTTPSettingsEditor/index.js +15 -0
  73. package/dist/components/HTTPSettingsEditor/index.js.map +1 -0
  74. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +3 -1
  75. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  76. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +10 -9
  77. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  78. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +7 -0
  79. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -0
  80. package/dist/components/MetricLabelInput/MetricLabelInput.js +33 -0
  81. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -0
  82. package/dist/components/MetricLabelInput/index.d.ts +2 -0
  83. package/dist/components/MetricLabelInput/index.d.ts.map +1 -0
  84. package/dist/components/MetricLabelInput/index.js +15 -0
  85. package/dist/components/MetricLabelInput/index.js.map +1 -0
  86. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +17 -0
  87. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -0
  88. package/dist/components/{TimeSeriesQueryEditor/TimeSeriesQueryEditor.js → MultiQueryEditor/MultiQueryEditor.js} +37 -23
  89. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -0
  90. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +29 -0
  91. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -0
  92. package/dist/components/{TraceQueryEditor/TraceQueryInput.js → MultiQueryEditor/QueryEditorContainer.js} +35 -12
  93. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -0
  94. package/dist/components/MultiQueryEditor/index.d.ts +2 -0
  95. package/dist/components/MultiQueryEditor/index.d.ts.map +1 -0
  96. package/dist/components/MultiQueryEditor/index.js +15 -0
  97. package/dist/components/{TraceQueryEditor → MultiQueryEditor}/index.js.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  100. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +2 -2
  102. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  103. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  104. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +3 -3
  105. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  106. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  107. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +5 -2
  108. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  109. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +53 -61
  110. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  111. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -1
  112. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  113. package/dist/components/PluginEditor/PluginEditor.js +16 -13
  114. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  115. package/dist/components/PluginEditor/plugin-editor-api.d.ts +15 -8
  116. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  117. package/dist/components/PluginEditor/plugin-editor-api.js +43 -32
  118. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  119. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +10 -4
  120. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  121. package/dist/components/PluginKindSelect/PluginKindSelect.js +61 -10
  122. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  123. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  124. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  125. package/dist/components/PluginRegistry/PluginRegistry.js +8 -9
  126. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  127. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -4
  128. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  129. package/dist/components/PluginRegistry/plugin-indexes.js +17 -14
  130. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  131. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  132. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  133. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  134. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  135. package/dist/components/ProjectSelect.d.ts +2 -1
  136. package/dist/components/ProjectSelect.d.ts.map +1 -1
  137. package/dist/components/ProjectSelect.js +5 -5
  138. package/dist/components/ProjectSelect.js.map +1 -1
  139. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +3 -2
  140. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  141. package/dist/components/TimeRangeControls/TimeRangeControls.js +12 -70
  142. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  143. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -3
  144. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  145. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +395 -446
  146. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  147. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +3 -2
  148. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  149. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +7 -7
  150. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  151. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  152. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  153. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -11
  154. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  155. package/dist/components/Variables/variable-model.d.ts +2 -1
  156. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  157. package/dist/components/Variables/variable-model.js +27 -28
  158. package/dist/components/Variables/variable-model.js.map +1 -1
  159. package/dist/components/index.d.ts +3 -1
  160. package/dist/components/index.d.ts.map +1 -1
  161. package/dist/components/index.js +3 -1
  162. package/dist/components/index.js.map +1 -1
  163. package/dist/context/ProjectStoreProvider.d.ts +4 -4
  164. package/dist/context/ProjectStoreProvider.d.ts.map +1 -1
  165. package/dist/context/ProjectStoreProvider.js +7 -4
  166. package/dist/context/ProjectStoreProvider.js.map +1 -1
  167. package/dist/context/ValidationProvider.d.ts +19 -0
  168. package/dist/context/ValidationProvider.d.ts.map +1 -0
  169. package/dist/context/ValidationProvider.js +52 -0
  170. package/dist/context/ValidationProvider.js.map +1 -0
  171. package/dist/context/index.d.ts +1 -0
  172. package/dist/context/index.d.ts.map +1 -1
  173. package/dist/context/index.js +1 -0
  174. package/dist/context/index.js.map +1 -1
  175. package/dist/context/query-params.d.ts.map +1 -1
  176. package/dist/context/query-params.js.map +1 -1
  177. package/dist/index.d.ts +1 -1
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +1 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/model/explore.d.ts +13 -0
  182. package/dist/model/explore.d.ts.map +1 -0
  183. package/dist/{validation/index.js → model/explore.js} +4 -6
  184. package/dist/model/explore.js.map +1 -0
  185. package/dist/model/legend.d.ts.map +1 -1
  186. package/dist/model/legend.js.map +1 -1
  187. package/dist/model/panels.d.ts +27 -5
  188. package/dist/model/panels.d.ts.map +1 -1
  189. package/dist/model/panels.js.map +1 -1
  190. package/dist/model/plugin-loading.js.map +1 -1
  191. package/dist/model/plugins.d.ts +31 -17
  192. package/dist/model/plugins.d.ts.map +1 -1
  193. package/dist/model/plugins.js.map +1 -1
  194. package/dist/model/time-series-queries.d.ts +2 -1
  195. package/dist/model/time-series-queries.d.ts.map +1 -1
  196. package/dist/model/time-series-queries.js.map +1 -1
  197. package/dist/remote/PersesPlugin.types.d.ts +7 -0
  198. package/dist/remote/PersesPlugin.types.d.ts.map +1 -0
  199. package/dist/{stories/shared-utils/index.js → remote/PersesPlugin.types.js} +3 -3
  200. package/dist/remote/PersesPlugin.types.js.map +1 -0
  201. package/dist/remote/PluginLoaderComponent.d.ts +10 -0
  202. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -0
  203. package/dist/remote/PluginLoaderComponent.js +67 -0
  204. package/dist/remote/PluginLoaderComponent.js.map +1 -0
  205. package/dist/remote/PluginRuntime.d.ts +10 -0
  206. package/dist/remote/PluginRuntime.d.ts.map +1 -0
  207. package/dist/remote/PluginRuntime.js +211 -0
  208. package/dist/remote/PluginRuntime.js.map +1 -0
  209. package/dist/remote/index.d.ts +3 -0
  210. package/dist/remote/index.d.ts.map +1 -0
  211. package/dist/{components/TraceQueryEditor → remote}/index.js +2 -1
  212. package/dist/remote/index.js.map +1 -0
  213. package/dist/remote/remotePluginLoader.d.ts +3 -0
  214. package/dist/remote/remotePluginLoader.d.ts.map +1 -0
  215. package/dist/remote/remotePluginLoader.js +53 -0
  216. package/dist/remote/remotePluginLoader.js.map +1 -0
  217. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +2 -2
  218. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  219. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -9
  220. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  221. package/dist/runtime/DataQueriesProvider/model.d.ts +5 -6
  222. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  223. package/dist/runtime/DataQueriesProvider/model.js +10 -9
  224. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  225. package/dist/runtime/QueryCountProvider.d.ts +9 -0
  226. package/dist/runtime/QueryCountProvider.d.ts.map +1 -0
  227. package/dist/{validation/duration.js → runtime/QueryCountProvider.js} +13 -4
  228. package/dist/runtime/QueryCountProvider.js.map +1 -0
  229. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +2 -2
  230. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  231. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +17 -4
  232. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  233. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts +2 -2
  234. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.d.ts.map +1 -1
  235. package/dist/runtime/TimeRangeProvider/TimeRangeProviderWithQueryParams.js.map +1 -1
  236. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +32 -0
  237. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -0
  238. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +82 -0
  239. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -0
  240. package/dist/runtime/TimeRangeProvider/index.d.ts +1 -0
  241. package/dist/runtime/TimeRangeProvider/index.d.ts.map +1 -1
  242. package/dist/runtime/TimeRangeProvider/index.js +2 -1
  243. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  244. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  245. package/dist/runtime/TimeRangeProvider/query-params.js +4 -7
  246. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  247. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  248. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  249. package/dist/runtime/UsageMetricsProvider.d.ts +25 -0
  250. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -0
  251. package/dist/runtime/UsageMetricsProvider.js +77 -0
  252. package/dist/runtime/UsageMetricsProvider.js.map +1 -0
  253. package/dist/runtime/builtin-variables.d.ts +1 -1
  254. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  255. package/dist/runtime/builtin-variables.js +2 -2
  256. package/dist/runtime/builtin-variables.js.map +1 -1
  257. package/dist/runtime/datasources.d.ts +5 -4
  258. package/dist/runtime/datasources.d.ts.map +1 -1
  259. package/dist/runtime/datasources.js +23 -14
  260. package/dist/runtime/datasources.js.map +1 -1
  261. package/dist/runtime/index.d.ts +3 -1
  262. package/dist/runtime/index.d.ts.map +1 -1
  263. package/dist/runtime/index.js +4 -2
  264. package/dist/runtime/index.js.map +1 -1
  265. package/dist/runtime/plugin-registry.d.ts +10 -10
  266. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  267. package/dist/runtime/plugin-registry.js +49 -28
  268. package/dist/runtime/plugin-registry.js.map +1 -1
  269. package/dist/runtime/time-series-queries.d.ts +5 -4
  270. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  271. package/dist/runtime/time-series-queries.js +23 -28
  272. package/dist/runtime/time-series-queries.js.map +1 -1
  273. package/dist/runtime/trace-queries.d.ts +4 -3
  274. package/dist/runtime/trace-queries.d.ts.map +1 -1
  275. package/dist/runtime/trace-queries.js +2 -3
  276. package/dist/runtime/trace-queries.js.map +1 -1
  277. package/dist/runtime/{template-variables.d.ts → variables.d.ts} +4 -4
  278. package/dist/runtime/variables.d.ts.map +1 -0
  279. package/dist/runtime/{template-variables.js → variables.js} +28 -45
  280. package/dist/runtime/variables.js.map +1 -0
  281. package/dist/test/mock-data.d.ts.map +1 -1
  282. package/dist/test/mock-data.js +25 -4
  283. package/dist/test/mock-data.js.map +1 -1
  284. package/dist/test/render.d.ts +3 -3
  285. package/dist/test/render.d.ts.map +1 -1
  286. package/dist/test/render.js +2 -11
  287. package/dist/test/render.js.map +1 -1
  288. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  289. package/dist/test/test-plugins/bert/index.js +20 -19
  290. package/dist/test/test-plugins/bert/index.js.map +1 -1
  291. package/dist/test-utils/mock-plugin-registry.d.ts +5 -3
  292. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  293. package/dist/test-utils/mock-plugin-registry.js +10 -10
  294. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  295. package/dist/utils/variables.d.ts +4 -4
  296. package/dist/utils/variables.d.ts.map +1 -1
  297. package/dist/utils/variables.js +19 -19
  298. package/dist/utils/variables.js.map +1 -1
  299. package/package.json +10 -11
  300. package/dist/cjs/components/TraceQueryEditor/TraceQueryEditor.js +0 -143
  301. package/dist/cjs/components/TraceQueryEditor/TraceQueryInput.js +0 -96
  302. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +0 -41
  303. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -42
  304. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -101
  305. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -42
  306. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +0 -41
  307. package/dist/cjs/stories/shared-utils/decorators/index.js +0 -35
  308. package/dist/cjs/validation/datasource.js +0 -30
  309. package/dist/cjs/validation/duration.js +0 -25
  310. package/dist/cjs/validation/resource.js +0 -24
  311. package/dist/cjs/validation/role.js +0 -86
  312. package/dist/cjs/validation/rolebinding.js +0 -55
  313. package/dist/cjs/validation/secret.js +0 -176
  314. package/dist/cjs/validation/user.js +0 -46
  315. package/dist/cjs/validation/variable.js +0 -48
  316. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +0 -7
  317. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +0 -1
  318. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +0 -1
  319. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +0 -12
  320. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +0 -1
  321. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +0 -83
  322. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +0 -1
  323. package/dist/components/TimeSeriesQueryEditor/index.d.ts +0 -2
  324. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +0 -1
  325. package/dist/components/TimeSeriesQueryEditor/index.js.map +0 -1
  326. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts +0 -8
  327. package/dist/components/TraceQueryEditor/TraceQueryEditor.d.ts.map +0 -1
  328. package/dist/components/TraceQueryEditor/TraceQueryEditor.js +0 -130
  329. package/dist/components/TraceQueryEditor/TraceQueryEditor.js.map +0 -1
  330. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts +0 -12
  331. package/dist/components/TraceQueryEditor/TraceQueryInput.d.ts.map +0 -1
  332. package/dist/components/TraceQueryEditor/TraceQueryInput.js.map +0 -1
  333. package/dist/components/TraceQueryEditor/index.d.ts +0 -2
  334. package/dist/components/TraceQueryEditor/index.d.ts.map +0 -1
  335. package/dist/runtime/template-variables.d.ts.map +0 -1
  336. package/dist/runtime/template-variables.js.map +0 -1
  337. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts +0 -12
  338. package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +0 -1
  339. package/dist/stories/shared-utils/decorators/WithDataQueries.js +0 -33
  340. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +0 -1
  341. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +0 -3
  342. package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +0 -1
  343. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +0 -46
  344. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +0 -1
  345. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +0 -12
  346. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +0 -1
  347. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +0 -39
  348. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +0 -1
  349. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts +0 -12
  350. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +0 -1
  351. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +0 -95
  352. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +0 -1
  353. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts +0 -12
  354. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.d.ts.map +0 -1
  355. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +0 -39
  356. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +0 -1
  357. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +0 -12
  358. package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +0 -1
  359. package/dist/stories/shared-utils/decorators/WithTimeRange.js +0 -33
  360. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +0 -1
  361. package/dist/stories/shared-utils/decorators/index.d.ts +0 -7
  362. package/dist/stories/shared-utils/decorators/index.d.ts.map +0 -1
  363. package/dist/stories/shared-utils/decorators/index.js +0 -20
  364. package/dist/stories/shared-utils/decorators/index.js.map +0 -1
  365. package/dist/stories/shared-utils/index.d.ts +0 -2
  366. package/dist/stories/shared-utils/index.d.ts.map +0 -1
  367. package/dist/stories/shared-utils/index.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 +0 -22
  371. package/dist/validation/datasource.js.map +0 -1
  372. package/dist/validation/duration.d.ts +0 -3
  373. package/dist/validation/duration.d.ts.map +0 -1
  374. package/dist/validation/duration.js.map +0 -1
  375. package/dist/validation/index.d.ts +0 -6
  376. package/dist/validation/index.d.ts.map +0 -1
  377. package/dist/validation/index.js.map +0 -1
  378. package/dist/validation/resource.d.ts +0 -3
  379. package/dist/validation/resource.d.ts.map +0 -1
  380. package/dist/validation/resource.js +0 -16
  381. package/dist/validation/resource.js.map +0 -1
  382. package/dist/validation/role.d.ts +0 -228
  383. package/dist/validation/role.d.ts.map +0 -1
  384. package/dist/validation/role.js +0 -67
  385. package/dist/validation/role.js.map +0 -1
  386. package/dist/validation/rolebinding.d.ts +0 -137
  387. package/dist/validation/rolebinding.d.ts.map +0 -1
  388. package/dist/validation/rolebinding.js +0 -47
  389. package/dist/validation/rolebinding.js.map +0 -1
  390. package/dist/validation/secret.d.ts +0 -964
  391. package/dist/validation/secret.d.ts.map +0 -1
  392. package/dist/validation/secret.js +0 -157
  393. package/dist/validation/secret.js.map +0 -1
  394. package/dist/validation/user.d.ts +0 -93
  395. package/dist/validation/user.d.ts.map +0 -1
  396. package/dist/validation/user.js +0 -38
  397. package/dist/validation/user.js.map +0 -1
  398. package/dist/validation/variable.d.ts +0 -96
  399. package/dist/validation/variable.d.ts.map +0 -1
  400. package/dist/validation/variable.js +0 -40
  401. package/dist/validation/variable.js.map +0 -1
@@ -1,46 +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, "userEditorValidationSchema", {
18
- enumerable: true,
19
- get: function() {
20
- return userEditorValidationSchema;
21
- }
22
- });
23
- const _zod = require("zod");
24
- const _resource = require("./resource");
25
- const nativeProviderSchema = _zod.z.object({
26
- password: _zod.z.string().optional()
27
- });
28
- const oauthProvidersSchema = _zod.z.object({
29
- issuer: _zod.z.string().optional(),
30
- email: _zod.z.string().optional(),
31
- subject: _zod.z.string().optional()
32
- });
33
- // TODO: handle exclusion native / oauth?
34
- const userSpecSchema = _zod.z.object({
35
- firstName: _zod.z.string().optional(),
36
- lastName: _zod.z.string().optional(),
37
- nativeProvider: nativeProviderSchema.optional(),
38
- oauthProviders: _zod.z.array(oauthProvidersSchema).optional()
39
- });
40
- const userEditorValidationSchema = _zod.z.object({
41
- kind: _zod.z.literal('User'),
42
- metadata: _zod.z.object({
43
- name: _resource.resourceIdValidationSchema
44
- }),
45
- spec: userSpecSchema
46
- });
@@ -1,48 +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, "variableEditorValidationSchema", {
18
- enumerable: true,
19
- get: function() {
20
- return variableEditorValidationSchema;
21
- }
22
- });
23
- const _zod = require("zod");
24
- const variableEditorValidationSchema = _zod.z.object({
25
- name: _zod.z.string().nonempty('Required').regex(/^\w+$/, 'Must only contains alphanumerical characters and underscores').refine((val)=>!val.startsWith('__'), '__ prefix is reserved to builtin variables'),
26
- title: _zod.z.string().optional(),
27
- description: _zod.z.string().optional(),
28
- kind: _zod.z.enum([
29
- 'TextVariable',
30
- 'ListVariable',
31
- 'BuiltinVariable'
32
- ]),
33
- textVariableFields: _zod.z.object({
34
- value: _zod.z.string(),
35
- constant: _zod.z.boolean()
36
- }),
37
- listVariableFields: _zod.z.object({
38
- allowMultiple: _zod.z.boolean(),
39
- allowAllValue: _zod.z.boolean(),
40
- customAllValue: _zod.z.string().optional(),
41
- capturingRegexp: _zod.z.string().optional(),
42
- sort: _zod.z.string().optional(),
43
- plugin: _zod.z.object({
44
- kind: _zod.z.string(),
45
- spec: _zod.z.object({})
46
- })
47
- })
48
- });
@@ -1,7 +0,0 @@
1
- import { TimeSeriesQueryDefinition, QueryDefinition } from '@perses-dev/core';
2
- export interface TimeSeriesQueryEditorProps {
3
- queries?: TimeSeriesQueryDefinition[];
4
- onChange: (queries: QueryDefinition[]) => void;
5
- }
6
- export declare function TimeSeriesQueryEditor({ queries, onChange }: TimeSeriesQueryEditorProps): import("react/jsx-runtime").JSX.Element;
7
- //# sourceMappingURL=TimeSeriesQueryEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAI9E,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACtC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,OAAY,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CA+F3F"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { produce } from 'immer';\nimport { Button, Stack } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { TimeSeriesQueryDefinition, QueryDefinition } from '@perses-dev/core';\nimport { TIME_SERIES_QUERY_KEY, useListPluginMetadata, usePlugin, usePluginRegistry } from '../../runtime';\nimport { TimeSeriesQueryInput } from './TimeSeriesQueryInput';\n\nexport interface TimeSeriesQueryEditorProps {\n queries?: TimeSeriesQueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nexport function TimeSeriesQueryEditor({ queries = [], onChange }: TimeSeriesQueryEditorProps) {\n // Build the default query plugin\n // Use as default the plugin kind explicitly set as default or the first in the list\n const { defaultPluginKinds } = usePluginRegistry();\n const { data: timeSeriesPlugins } = useListPluginMetadata(TIME_SERIES_QUERY_KEY);\n const defaultTimeSeriesQueryKind = defaultPluginKinds?.[TIME_SERIES_QUERY_KEY] ?? timeSeriesPlugins?.[0]?.kind ?? '';\n const { data: defaultQueryPlugin } = usePlugin(TIME_SERIES_QUERY_KEY, defaultTimeSeriesQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n // This default query definition is used if no query is provided initially or when we add a new query\n const defaultInitialQueryDefinition: TimeSeriesQueryDefinition = {\n kind: TIME_SERIES_QUERY_KEY,\n spec: {\n plugin: { kind: defaultTimeSeriesQueryKind, spec: defaultQueryPlugin?.createInitialOptions() || {} },\n },\n };\n\n // State for which queries are collapsed\n // TODO: Would be easier if we had IDs for queries.\n const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(() => false));\n\n // Query handlers\n const handleQueryChange = (index: number, queryDef: TimeSeriesQueryDefinition) => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft[index] = queryDef;\n } else {\n draft = [queryDef];\n }\n })\n );\n };\n\n const handleQueryAdd = () => {\n if (!defaultQueryPlugin) return;\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft.push(defaultInitialQueryDefinition);\n } else {\n draft = [...queries, defaultInitialQueryDefinition];\n }\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.push(false);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryDelete = (index: number) => {\n onChange(\n produce(queries, (draft) => {\n draft.splice(index, 1);\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.splice(index, 1);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryCollapseExpand = (index: number) => {\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed[index] = !queriesCollapsed[index];\n return [...queriesCollapsed];\n });\n };\n\n // show one query input if queries is empty\n const queryDefinitions: TimeSeriesQueryDefinition[] = queries.length ? queries : [defaultInitialQueryDefinition];\n\n return (\n <>\n <Stack spacing={1}>\n {queryDefinitions.map((query: TimeSeriesQueryDefinition, i: number) => (\n <TimeSeriesQueryInput\n key={i}\n index={i}\n query={query}\n isCollapsed={!!queriesCollapsed[i]}\n onChange={handleQueryChange}\n onDelete={queries.length > 1 ? handleQueryDelete : undefined}\n onCollapseExpand={handleQueryCollapseExpand}\n />\n ))}\n </Stack>\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleQueryAdd}>\n Add Query\n </Button>\n </>\n );\n}\n"],"names":["useState","produce","Button","Stack","AddIcon","TIME_SERIES_QUERY_KEY","useListPluginMetadata","usePlugin","usePluginRegistry","TimeSeriesQueryInput","TimeSeriesQueryEditor","queries","onChange","timeSeriesPlugins","defaultPluginKinds","data","defaultTimeSeriesQueryKind","kind","defaultQueryPlugin","useErrorBoundary","enabled","defaultInitialQueryDefinition","spec","plugin","createInitialOptions","queriesCollapsed","setQueriesCollapsed","map","handleQueryChange","index","queryDef","draft","handleQueryAdd","push","handleQueryDelete","splice","handleQueryCollapseExpand","queryDefinitions","length","spacing","query","i","isCollapsed","onDelete","undefined","onCollapseExpand","variant","startIcon","sx","marginTop","onClick"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,MAAM,EAA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rB,IAAI,CAACd,oBAAoB;QACzBN,SACEX,QAAQU,SAAS,CAACoB;YAChB,IAAIA,OAAO;gBACTA,MAAME,IAAI,CAACZ;YACb,OAAO;gBACLU,QAAQ;uBAAIpB;oBAASU;iBAA8B;YACrD;QACF;QAEFK,oBAAoB,CAACD;YACnBA,iBAAiBQ,IAAI,CAAC;YACtB,OAAO;mBAAIR;aAAiB;QAC9B;IACF;IAEA,MAAMS,oBAAoB,CAACL;QACzBjB,SACEX,QAAQU,SAAS,CAACoB;YAChBA,MAAMI,MAAM,CAACN,OAAO;QACtB;QAEFH,oBAAoB,CAACD;YACnBA,iBAAiBU,MAAM,CAACN,OAAO;YAC/B,OAAO;mBAAIJ;aAAiB;QAC9B;IACF;IAEA,MAAMW,4BAA4B,CAACP;QACjCH,oBAAoB,CAACD;YACnBA,gBAAgB,CAACI,MAAM,GAAG,CAACJ,gBAAgB,CAACI,MAAM;YAClD,OAAO;mBAAIJ;aAAiB;QAC9B;IACF;IAEA,2CAA2C;IAC3C,MAAMY,mBAAgD1B,QAAQ2B,MAAM,GAAG3B,UAAU;QAACU;KAA8B;IAEhH,qBACE;;0BACE,KAAClB;gBAAMoC,SAAS;0BACbF,iBAAiBV,GAAG,CAAC,CAACa,OAAkCC,kBACvD,KAAChC;wBAECoB,OAAOY;wBACPD,OAAOA;wBACPE,aAAa,CAAC,CAACjB,gBAAgB,CAACgB,EAAE;wBAClC7B,UAAUgB;wBACVe,UAAUhC,QAAQ2B,MAAM,GAAG,IAAIJ,oBAAoBU;wBACnDC,kBAAkBT;uBANbK;;0BAUX,KAACvC;gBAAO4C,SAAQ;gBAAYC,yBAAW,KAAC3C;gBAAY4C,IAAI;oBAAEC,WAAW;gBAAE;gBAAGC,SAASlB;0BAAgB;;;;AAKzG"}
@@ -1,12 +0,0 @@
1
- import { TimeSeriesQueryDefinition } from '@perses-dev/core';
2
- interface TimeSeriesQueryInputProps {
3
- query: TimeSeriesQueryDefinition;
4
- index: number;
5
- onChange: (index: number, query: TimeSeriesQueryDefinition) => void;
6
- onCollapseExpand: (index: number) => void;
7
- isCollapsed?: boolean;
8
- onDelete?: (index: number) => void;
9
- }
10
- export declare const TimeSeriesQueryInput: ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand, }: TimeSeriesQueryInputProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
12
- //# sourceMappingURL=TimeSeriesQueryInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeSeriesQueryInput.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAO7D,UAAU,yBAAyB;IACjC,KAAK,EAAE,yBAAyB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC;IACpE,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,oBAAoB,yEAO9B,yBAAyB,4CAsB3B,CAAC"}
@@ -1,83 +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
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
- import produce from 'immer';
15
- import { Stack, IconButton, Typography, Box } from '@mui/material';
16
- import DeleteIcon from 'mdi-material-ui/DeleteOutline';
17
- import ChevronDown from 'mdi-material-ui/ChevronDown';
18
- import ChevronRight from 'mdi-material-ui/ChevronRight';
19
- import { PluginEditor } from '../PluginEditor';
20
- export const TimeSeriesQueryInput = ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand })=>{
21
- return /*#__PURE__*/ _jsxs(Stack, {
22
- spacing: 1,
23
- children: [
24
- /*#__PURE__*/ _jsxs(Stack, {
25
- direction: "row",
26
- alignItems: "center",
27
- borderBottom: 1,
28
- borderColor: (theme)=>theme.palette.divider,
29
- children: [
30
- /*#__PURE__*/ _jsx(IconButton, {
31
- size: "small",
32
- onClick: ()=>onCollapseExpand(index),
33
- children: isCollapsed ? /*#__PURE__*/ _jsx(ChevronRight, {}) : /*#__PURE__*/ _jsx(ChevronDown, {})
34
- }),
35
- /*#__PURE__*/ _jsxs(Typography, {
36
- variant: "overline",
37
- component: "h4",
38
- children: [
39
- "Query ",
40
- index + 1
41
- ]
42
- }),
43
- /*#__PURE__*/ _jsx(IconButton, {
44
- size: "small",
45
- // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible
46
- sx: {
47
- marginLeft: 'auto',
48
- visibility: `${onDelete ? 'visible' : 'hidden'}`
49
- },
50
- onClick: ()=>onDelete && onDelete(index),
51
- children: /*#__PURE__*/ _jsx(DeleteIcon, {})
52
- })
53
- ]
54
- }),
55
- !isCollapsed && /*#__PURE__*/ _jsx(QueryEditor, {
56
- value: query,
57
- onChange: (next)=>onChange(index, next)
58
- })
59
- ]
60
- }, index);
61
- };
62
- /**
63
- * Displays an editor for TimeSeriesQueryDefinition objects.
64
- */ function QueryEditor(props) {
65
- const { value, onChange, ...others } = props;
66
- const { spec: { plugin } } = value;
67
- const handlePluginChange = (next)=>{
68
- onChange(produce(value, (draft)=>{
69
- draft.spec.plugin = next;
70
- }));
71
- };
72
- return /*#__PURE__*/ _jsx(Box, {
73
- ...others,
74
- children: /*#__PURE__*/ _jsx(PluginEditor, {
75
- pluginType: "TimeSeriesQuery",
76
- pluginKindLabel: "Query Type",
77
- value: plugin,
78
- onChange: handlePluginChange
79
- })
80
- });
81
- }
82
-
83
- //# sourceMappingURL=TimeSeriesQueryInput.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport produce from 'immer';\nimport { TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { Stack, IconButton, Typography, BoxProps, Box } from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport { PluginEditor, PluginEditorProps } from '../PluginEditor';\n\ninterface TimeSeriesQueryInputProps {\n query: TimeSeriesQueryDefinition;\n index: number;\n onChange: (index: number, query: TimeSeriesQueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n isCollapsed?: boolean;\n onDelete?: (index: number) => void;\n}\n\nexport const TimeSeriesQueryInput = ({\n index,\n query,\n isCollapsed,\n onDelete,\n onChange,\n onCollapseExpand,\n}: TimeSeriesQueryInputProps) => {\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query {index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && <QueryEditor value={query} onChange={(next) => onChange(index, next)} />}\n </Stack>\n );\n};\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\n\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TimeSeriesQueryDefinition;\n onChange: (next: TimeSeriesQueryDefinition) => void;\n}\n\n/**\n * Displays an editor for TimeSeriesQueryDefinition objects.\n */\nfunction QueryEditor(props: QueryEditorProps) {\n const { value, onChange, ...others } = props;\n const {\n spec: { plugin },\n } = value;\n\n const handlePluginChange: PluginEditorProps['onChange'] = (next) => {\n onChange(\n produce(value, (draft) => {\n draft.spec.plugin = next;\n })\n );\n };\n\n return (\n <Box {...others}>\n {/* If TimeSeriesQuery plugins ever have common props on the definition, the inputs could go here */}\n <PluginEditor\n pluginType=\"TimeSeriesQuery\"\n pluginKindLabel=\"Query Type\"\n value={plugin}\n onChange={handlePluginChange}\n />\n </Box>\n );\n}\n"],"names":["produce","Stack","IconButton","Typography","Box","DeleteIcon","ChevronDown","ChevronRight","PluginEditor","TimeSeriesQueryInput","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","props","others","spec","plugin","handlePluginChange","draft","pluginType","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCA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ACC,MAAM,GAAGJ;QACtB;IAEJ;IAEA,qBACE,KAAC7B;QAAK,GAAG+B,MAAM;kBAEb,cAAA,KAAC3B;YACCgC,YAAW;YACXC,iBAAgB;YAChBT,OAAOK;YACPvB,UAAUwB;;;AAIlB"}
@@ -1,2 +0,0 @@
1
- export * from './TimeSeriesQueryEditor';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/index.tsx"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/index.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './TimeSeriesQueryEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,0BAA0B"}
@@ -1,8 +0,0 @@
1
- import { QueryDefinition } from '@perses-dev/core';
2
- import { TraceQueryDefinition } from '../../runtime';
3
- export interface TraceQueryEditorProps {
4
- queries?: TraceQueryDefinition[];
5
- onChange: (queries: QueryDefinition[]) => void;
6
- }
7
- export declare function TraceQueryEditor({ queries, onChange }: TraceQueryEditorProps): import("react/jsx-runtime").JSX.Element;
8
- //# sourceMappingURL=TraceQueryEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TraceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/TraceQueryEditor/TraceQueryEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,EAAa,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAKhE,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,OAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAyGjF"}
@@ -1,130 +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
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
- import { Button, Stack } from '@mui/material';
15
- import AddIcon from 'mdi-material-ui/Plus';
16
- import { useState } from 'react';
17
- import { produce } from 'immer';
18
- import { usePlugin } from '../../runtime';
19
- import { TraceQueryInput } from './TraceQueryInput';
20
- const DEFAULT_QUERY_PLUGIN_TYPE = 'TraceQuery';
21
- export function TraceQueryEditor({ queries = [], onChange }) {
22
- const hasMoreThanOneQuery = queries.length > 1;
23
- const defaultTraceQueryKind = 'TempoTraceQuery';
24
- // State for which queries are collapsed
25
- // TODO: Would be easier if we had IDs for queries.
26
- const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(()=>false));
27
- const { data: defaultQueryPlugin } = usePlugin(DEFAULT_QUERY_PLUGIN_TYPE, defaultTraceQueryKind, {
28
- useErrorBoundary: true,
29
- enabled: true
30
- });
31
- // Query handlers
32
- const handleQueryChange = (index, queryDef)=>{
33
- onChange(produce(queries, (draft)=>{
34
- if (draft) {
35
- draft[index] = queryDef;
36
- } else {
37
- draft = [
38
- queryDef
39
- ];
40
- }
41
- }));
42
- };
43
- const handleQueryAdd = ()=>{
44
- if (!defaultQueryPlugin) return;
45
- onChange(produce(queries, (draft)=>{
46
- const queryDef = {
47
- kind: DEFAULT_QUERY_PLUGIN_TYPE,
48
- spec: {
49
- plugin: {
50
- kind: defaultTraceQueryKind,
51
- spec: defaultQueryPlugin.createInitialOptions()
52
- }
53
- }
54
- };
55
- if (draft) {
56
- draft.push(queryDef);
57
- } else {
58
- draft = [
59
- ...queries,
60
- queryDef
61
- ];
62
- }
63
- }));
64
- setQueriesCollapsed((queriesCollapsed)=>{
65
- queriesCollapsed.push(false);
66
- return [
67
- ...queriesCollapsed
68
- ];
69
- });
70
- };
71
- const handleQueryDelete = (index)=>{
72
- onChange(produce(queries, (draft)=>{
73
- draft.splice(index, 1);
74
- }));
75
- setQueriesCollapsed((queriesCollapsed)=>{
76
- queriesCollapsed.splice(index, 1);
77
- return [
78
- ...queriesCollapsed
79
- ];
80
- });
81
- };
82
- const handleQueryCollapseExpand = (index)=>{
83
- setQueriesCollapsed((queriesCollapsed)=>{
84
- queriesCollapsed[index] = !queriesCollapsed[index];
85
- return [
86
- ...queriesCollapsed
87
- ];
88
- });
89
- };
90
- // show one query input if queries is empty
91
- const queryDefinitions = queries.length ? queries : [
92
- {
93
- kind: 'TraceQuery',
94
- spec: {
95
- plugin: {
96
- kind: 'TempoTraceQuery',
97
- spec: {
98
- query: ''
99
- }
100
- }
101
- }
102
- }
103
- ];
104
- return /*#__PURE__*/ _jsxs(_Fragment, {
105
- children: [
106
- /*#__PURE__*/ _jsx(Stack, {
107
- spacing: 1,
108
- children: queryDefinitions.map((query, i)=>/*#__PURE__*/ _jsx(TraceQueryInput, {
109
- index: i,
110
- query: query,
111
- isCollapsed: !!queriesCollapsed[i],
112
- onChange: handleQueryChange,
113
- onDelete: hasMoreThanOneQuery ? handleQueryDelete : undefined,
114
- onCollapseExpand: handleQueryCollapseExpand
115
- }, i))
116
- }),
117
- /*#__PURE__*/ _jsx(Button, {
118
- variant: "contained",
119
- startIcon: /*#__PURE__*/ _jsx(AddIcon, {}),
120
- sx: {
121
- marginTop: 1
122
- },
123
- onClick: handleQueryAdd,
124
- children: "Add Query"
125
- })
126
- ]
127
- });
128
- }
129
-
130
- //# sourceMappingURL=TraceQueryEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TraceQueryEditor/TraceQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition } from '@perses-dev/core';\nimport { Button, Stack } from '@mui/material';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { useState } from 'react';\nimport { produce } from 'immer';\nimport { usePlugin, TraceQueryDefinition } from '../../runtime';\nimport { TraceQueryInput } from './TraceQueryInput';\n\nconst DEFAULT_QUERY_PLUGIN_TYPE = 'TraceQuery';\n\nexport interface TraceQueryEditorProps {\n queries?: TraceQueryDefinition[];\n onChange: (queries: QueryDefinition[]) => void;\n}\n\nexport function TraceQueryEditor({ queries = [], onChange }: TraceQueryEditorProps) {\n const hasMoreThanOneQuery = queries.length > 1;\n const defaultTraceQueryKind = 'TempoTraceQuery';\n\n // State for which queries are collapsed\n // TODO: Would be easier if we had IDs for queries.\n const [queriesCollapsed, setQueriesCollapsed] = useState(queries.map(() => false));\n\n const { data: defaultQueryPlugin } = usePlugin(DEFAULT_QUERY_PLUGIN_TYPE, defaultTraceQueryKind, {\n useErrorBoundary: true,\n enabled: true,\n });\n\n // Query handlers\n const handleQueryChange = (index: number, queryDef: TraceQueryDefinition) => {\n onChange(\n produce(queries, (draft) => {\n if (draft) {\n draft[index] = queryDef;\n } else {\n draft = [queryDef];\n }\n })\n );\n };\n\n const handleQueryAdd = () => {\n if (!defaultQueryPlugin) return;\n onChange(\n produce(queries, (draft) => {\n const queryDef: TraceQueryDefinition = {\n kind: DEFAULT_QUERY_PLUGIN_TYPE,\n spec: {\n plugin: { kind: defaultTraceQueryKind, spec: defaultQueryPlugin.createInitialOptions() },\n },\n };\n if (draft) {\n draft.push(queryDef);\n } else {\n draft = [...queries, queryDef];\n }\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.push(false);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryDelete = (index: number) => {\n onChange(\n produce(queries, (draft) => {\n draft.splice(index, 1);\n })\n );\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed.splice(index, 1);\n return [...queriesCollapsed];\n });\n };\n\n const handleQueryCollapseExpand = (index: number) => {\n setQueriesCollapsed((queriesCollapsed) => {\n queriesCollapsed[index] = !queriesCollapsed[index];\n return [...queriesCollapsed];\n });\n };\n\n // show one query input if queries is empty\n const queryDefinitions: TraceQueryDefinition[] = queries.length\n ? queries\n : [\n {\n kind: 'TraceQuery',\n spec: {\n plugin: {\n kind: 'TempoTraceQuery',\n spec: {\n query: '',\n },\n },\n },\n },\n ];\n\n return (\n <>\n <Stack spacing={1}>\n {queryDefinitions.map((query: TraceQueryDefinition, i: number) => (\n <TraceQueryInput\n key={i}\n index={i}\n query={query}\n isCollapsed={!!queriesCollapsed[i]}\n onChange={handleQueryChange}\n onDelete={hasMoreThanOneQuery ? handleQueryDelete : undefined}\n onCollapseExpand={handleQueryCollapseExpand}\n />\n ))}\n </Stack>\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleQueryAdd}>\n Add Query\n </Button>\n </>\n );\n}\n"],"names":["Button","Stack","AddIcon","useState","produce","usePlugin","TraceQueryInput","DEFAULT_QUERY_PLUGIN_TYPE","TraceQueryEditor","queries","onChange","hasMoreThanOneQuery","length","defaultTraceQueryKind","queriesCollapsed","setQueriesCollapsed","map","data","defaultQueryPlugin","useErrorBoundary","enabled","handleQueryChange","index","queryDef","draft","handleQueryAdd","kind","spec","plugin","createInitialOptions","push","handleQueryDelete","splice","handleQueryCollapseExpand","queryDefinitions","query","spacing","i","isCollapsed","onDelete","undefined","onCollapseExpand","variant","startIcon","sx","marginTop","onClick"],"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;;AAGjC,SAASA,MAAM,EAAEC,KAAK,QAAQ,gBAAgB;AAC9C,OAAOC,aAAa,uBAAuB;AAC3C,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,SAAS,QAA8B,gBAAgB;AAChE,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,MAAMC,4BAA4B;AAOlC,OAAO,SAASC,iBAAiB,EAAEC,UAAU,EAAE,EAAEC,QAAQ,EAAyB;IAChF,MAAMC,sBAAsBF,QAAQG,MAAM,GAAG;IAC7C,MAAMC,wBAAwB;IAE9B,wCAAwC;IACxC,mDAAmD;IACnD,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGZ,SAASM,QAAQO,GAAG,CAAC,IAAM;IAE3E,MAAM,EAAEC,MAAMC,kBAAkB,EAAE,GAAGb,UAAUE,2BAA2BM,uBAAuB;QAC/FM,kBAAkB;QAClBC,SAAS;IACX;IAEA,iBAAiB;IAC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OAAOe;wBACPF,OAAOA;wBACPG,aAAa,CAAC,CAACxB,gBAAgB,CAACuB,EAAE;wBAClC3B,UAAUW;wBACVkB,UAAU5B,sBAAsBoB,oBAAoBS;wBACpDC,kBAAkBR;uBANbI;;0BAUX,KAACrC;gBAAO0C,SAAQ;gBAAYC,yBAAW,KAACzC;gBAAY0C,IAAI;oBAAEC,WAAW;gBAAE;gBAAGC,SAASrB;0BAAgB;;;;AAKzG"}
@@ -1,12 +0,0 @@
1
- import { TraceQueryDefinition } from '../../runtime';
2
- interface TraceQueryInputProps {
3
- query: TraceQueryDefinition;
4
- index: number;
5
- onChange: (index: number, query: TraceQueryDefinition) => void;
6
- onCollapseExpand: (index: number) => void;
7
- isCollapsed?: boolean;
8
- onDelete?: (index: number) => void;
9
- }
10
- export declare const TraceQueryInput: ({ index, query, isCollapsed, onDelete, onChange, onCollapseExpand, }: TraceQueryInputProps) => import("react/jsx-runtime").JSX.Element;
11
- export {};
12
- //# sourceMappingURL=TraceQueryInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TraceQueryInput.d.ts","sourceRoot":"","sources":["../../../src/components/TraceQueryEditor/TraceQueryInput.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,UAAU,oBAAoB;IAC5B,KAAK,EAAE,oBAAoB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC/D,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAWD,eAAO,MAAM,eAAe,yEAOzB,oBAAoB,4CAsBtB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/TraceQueryEditor/TraceQueryInput.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, IconButton, Typography, BoxProps, Box } from '@mui/material';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport produce from 'immer';\nimport { PluginEditor, PluginEditorProps } from '../PluginEditor';\nimport { TraceQueryDefinition } from '../../runtime';\n\ninterface TraceQueryInputProps {\n query: TraceQueryDefinition;\n index: number;\n onChange: (index: number, query: TraceQueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n isCollapsed?: boolean;\n onDelete?: (index: number) => void;\n}\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\n\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TraceQueryDefinition;\n onChange: (next: TraceQueryDefinition) => void;\n}\n\nexport const TraceQueryInput = ({\n index,\n query,\n isCollapsed,\n onDelete,\n onChange,\n onCollapseExpand,\n}: TraceQueryInputProps) => {\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query {index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && <QueryEditor value={query} onChange={(next) => onChange(index, next)} />}\n </Stack>\n );\n};\n\n/**\n * Displays an editor for TraceQueryDefinition objects.\n */\nfunction QueryEditor(props: QueryEditorProps) {\n const { value, onChange, ...others } = props;\n const {\n spec: { plugin },\n } = value;\n\n const handlePluginChange: PluginEditorProps['onChange'] = (next) => {\n onChange(\n produce(value, (draft) => {\n draft.spec.plugin = next;\n })\n );\n };\n\n return (\n <Box {...others}>\n <PluginEditor pluginType=\"TraceQuery\" pluginKindLabel=\"Query Type\" value={plugin} onChange={handlePluginChange} />\n </Box>\n );\n}\n"],"names":["Stack","IconButton","Typography","Box","ChevronDown","ChevronRight","DeleteIcon","produce","PluginEditor","TraceQueryInput","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","props","others","spec","plugin","handlePluginChange","draft","pluginType","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,UAAU,EAAEC,UAAU,EAAYC,GAAG,QAAQ,gBAAgB;AAC7E,OAAOC,iBAAiB,8BAA8B;AACtD,OAAOC,kBAAkB,+BAA+B;AACxD,OAAOC,gBAAgB,gCAAgC;AACvD,OAAOC,aAAa,QAAQ;AAC5B,SAASC,YAAY,QAA2B,kBAAkB;AAqBlE,OAAO,MAAMC,kBAAkB,CAAC,EAC9BC,KAAK,EACLC,KAAK,EACLC,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRC,gBAAgB,EACK;IACrB,qBACE,MAACf;QAAkBgB,SAAS;;0BAC1B,MAAChB;gBAAMiB,WAAU;gBAAMC,YAAW;gBAASC,cAAc;gBAAGC,aAAa,CAACC,QAAUA,MAAMC,OAAO,CAACC,OAAO;;kCACvG,KAACtB;wBAAWuB,MAAK;wBAAQC,SAAS,IAAMV,iBAAiBL;kCACtDE,4BAAc,KAACP,kCAAkB,KAACD;;kCAErC,MAACF;wBAAWwB,SAAQ;wBAAWC,WAAU;;4BAAK;4BACrCjB,QAAQ;;;kCAEjB,KAACT;wBACCuB,MAAK;wBACL,2GAA2G;wBAC3GI,IAAI;4BAAEC,YAAY;4BAAQC,YAAY,CAAC,EAAEjB,WAAW,YAAY,SAAS,CAAC;wBAAC;wBAC3EY,SAAS,IAAMZ,YAAYA,SAASH;kCAEpC,cAAA,KAACJ;;;;YAGJ,CAACM,6BAAe,KAACmB;gBAAYC,OAAOrB;gBAAOG,UAAU,CAACmB,OAASnB,SAASJ,OAAOuB;;;OAjBtEvB;AAoBhB,EAAE;AAEF;;CAEC,GACD,SAASqB,YAAYG,KAAuB;IAC1C,MAAM,EAAEF,KAAK,EAAElB,QAAQ,EAAE,GAAGqB,QAAQ,GAAGD;IACvC,MAAM,EACJE,MAAM,EAAEC,MAAM,EAAE,EACjB,GAAGL;IAEJ,MAAMM,qBAAoD,CAACL;QACzDnB,SACEP,QAAQyB,OAAO,CAACO;YACdA,MAAMH,IAAI,CAACC,MAAM,GAAGJ;QACtB;IAEJ;IAEA,qBACE,KAAC9B;QAAK,GAAGgC,MAAM;kBACb,cAAA,KAAC3B;YAAagC,YAAW;YAAaC,iBAAgB;YAAaT,OAAOK;YAAQvB,UAAUwB;;;AAGlG"}
@@ -1,2 +0,0 @@
1
- export * from './TraceQueryEditor';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TraceQueryEditor/index.tsx"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-variables.d.ts","sourceRoot":"","sources":["../../src/runtime/template-variables.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,qBAAa,qBAAqB;IAChC;;;OAGG;IACH,CAAC,SAAS,CAAC,UAAQ;IAEnB,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAM;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqD;IAE5E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,aAAa,GAAG,SAAS;IAIrD;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,GAAG,aAAa,GAAG,SAAS;IAS3E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAInC;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO;IAiBtC,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,oBAAoB;CAG7B;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,uBAAuB,0DAA4D,CAAC;AAUjG,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAmB5E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAOpE;AAGD,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/runtime/template-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 { createContext, useContext, useMemo } from 'react';\nimport { VariableValue } from '@perses-dev/core';\nimport { immerable } from 'immer';\nimport { VariableOption } from '../model';\nimport { parseTemplateVariables, replaceTemplateVariables } from '../utils';\nimport { useBuiltinVariableValues } from './builtin-variables';\n\nexport type VariableState = {\n value: VariableValue;\n options?: VariableOption[];\n loading: boolean;\n error?: Error;\n /**\n * If a local variable is overriding an external variable, local var will have the flag ``overriding=true``.\n */\n overriding?: boolean;\n /**\n * If a local variable is overriding an external variable, external var will have the flag ``overridden=true``.\n */\n overridden?: boolean;\n defaultValue?: VariableValue;\n};\n\nexport type VariableStateMap = Record<string, VariableState>;\n\n/**\n * Structure used as key in the {@link VariableStoreStateMap}.\n */\nexport type VariableStateKey = {\n /**\n * name of the variable we want to access in the state.\n */\n name: string;\n /**\n * source of the variable we want to access in the state.\n * Defined only for external variables.\n */\n source?: string;\n};\n\n/**\n * A state map with two entry keys, materialized by {@link VariableStateKey} structure.\n */\nexport class VariableStoreStateMap {\n /**\n * \"Immerable\" is mandatory to be able to use this class in an immer context.\n * Ref: https://docs.pmnd.rs/zustand/integrations/immer-middleware#gotchas\n */\n [immerable] = true;\n\n private readonly DEFAULT_LOCAL_SOURCE_NAME = '';\n private readonly _state: Record<string, Record<string, VariableState>> = {};\n\n /**\n * Get variable state by key.\n * @param key\n */\n get(key: VariableStateKey): VariableState | undefined {\n return this._sourceStatesOrEmpty(key.source)[key.name];\n }\n\n /**\n * Set variable state by key.\n * @param key\n * @param value\n */\n set(key: VariableStateKey, value: VariableState): VariableState | undefined {\n const sourceName = this._sourceName(key.source);\n if (!this._state[sourceName]) {\n this._state[sourceName] = {};\n }\n this._sourceStatesOrEmpty(key.source)[key.name] = value;\n return value;\n }\n\n /**\n * Check presence of variable state by key.\n * @param key\n */\n has(key: VariableStateKey): boolean {\n return this._sourceStatesOrEmpty(key.source)[key.name] !== undefined;\n }\n\n /**\n * Delete variable state by key.\n * @param key\n */\n delete(key: VariableStateKey): boolean {\n const result = this.has(key);\n const sourceName = this._sourceName(key.source);\n const sourceStates = this._state[sourceName];\n\n // Delete var from source state\n if (sourceStates) {\n delete sourceStates[key.name];\n }\n\n // Delete source state from state if empty\n if (Object.keys(sourceStates ?? {})?.length === 0) {\n delete this._state[sourceName];\n }\n return result;\n }\n\n private _sourceName(source: string | undefined): string {\n return source ?? this.DEFAULT_LOCAL_SOURCE_NAME;\n }\n\n private _sourceStatesOrEmpty(source: string | undefined): Record<string, VariableState> {\n return this._state[this._sourceName(source)] ?? {};\n }\n}\n\nexport type TemplateVariableSrv = {\n state: VariableStateMap;\n};\n\nexport const TemplateVariableContext = createContext<TemplateVariableSrv | undefined>(undefined);\n\nfunction useTemplateVariableContext() {\n const ctx = useContext(TemplateVariableContext);\n if (ctx === undefined) {\n throw new Error('No TemplateVariableContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function useTemplateVariableValues(names?: string[]): VariableStateMap {\n const { state } = useTemplateVariableContext();\n\n const values = useMemo(() => {\n const values: VariableStateMap = {};\n names?.forEach((name) => {\n const s = state[name];\n if (s) {\n values[name] = s;\n }\n });\n return values;\n }, [state, names]);\n\n if (names === undefined) {\n return state;\n }\n\n return values;\n}\n\nexport function useVariableValues(names?: string[]): VariableStateMap {\n const templateVariableValues = useTemplateVariableValues(names);\n const builtinVariableValues = useBuiltinVariableValues(names);\n\n return useMemo(() => {\n return { ...templateVariableValues, ...builtinVariableValues } as VariableStateMap;\n }, [templateVariableValues, builtinVariableValues]);\n}\n\n// Convenience hook for replacing template variables in a string\nexport function useReplaceVariablesInString(str: string | undefined): string | undefined {\n const variablesInString = str ? parseTemplateVariables(str) : [];\n const variableValues = useVariableValues(variablesInString);\n if (!str) return undefined;\n return replaceTemplateVariables(str, variableValues);\n}\n"],"names":["createContext","useContext","useMemo","immerable","parseTemplateVariables","replaceTemplateVariables","useBuiltinVariableValues","VariableStoreStateMap","get","key","_sourceStatesOrEmpty","source","name","set","value","sourceName","_sourceName","_state","has","undefined","delete","Object","result","sourceStates","keys","length","DEFAULT_LOCAL_SOURCE_NAME","TemplateVariableContext","useTemplateVariableContext","ctx","Error","useTemplateVariableValues","names","state","values","forEach","s","useVariableValues","templateVariableValues","builtinVariableValues","useReplaceVariablesInString","str","variablesInString","variableValues"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;AAEjC,SAASA,aAAa,EAAEC,UAAU,EA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,MAAMC,oBAAoBD,MAAMrC,uBAAuBqC,OAAO,EAAE;IAChE,MAAME,iBAAiBN,kBAAkBK;IACzC,IAAI,CAACD,KAAK,OAAOtB;IACjB,OAAOd,yBAAyBoC,KAAKE;AACvC"}
@@ -1,12 +0,0 @@
1
- import { DataQueriesProviderProps } from '@perses-dev/plugin-system';
2
- import { StoryFn, StoryContext } from '@storybook/react';
3
- declare module '@storybook/react' {
4
- interface Parameters {
5
- withDataQueries?: WithDataQueriesProvideParameter;
6
- }
7
- }
8
- export type WithDataQueriesProvideParameter = {
9
- props: DataQueriesProviderProps;
10
- };
11
- export declare const WithDataQueries: (Story: StoryFn, context: StoryContext<unknown>) => import("react/jsx-runtime").JSX.Element;
12
- //# sourceMappingURL=WithDataQueries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WithDataQueries.d.ts","sourceRoot":"","sources":["../../../../src/stories/shared-utils/decorators/WithDataQueries.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAuB,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,UAAU;QAClB,eAAe,CAAC,EAAE,+BAA+B,CAAC;KACnD;CACF;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;AASF,eAAO,MAAM,eAAe,UAAW,OAAO,WAAW,aAAa,OAAO,CAAC,4CAY7E,CAAC"}
@@ -1,33 +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
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { DataQueriesProvider } from '@perses-dev/plugin-system';
15
- // Type guard because storybook types parameters as `any`
16
- function isWithDataQueriesParameter(parameter) {
17
- return !!parameter && typeof parameter === 'object' && 'props' in parameter;
18
- }
19
- export const WithDataQueries = (Story, context)=>{
20
- const initParameter = context.parameters.withDataQueries;
21
- const parameter = isWithDataQueriesParameter(initParameter) ? initParameter : {
22
- props: {
23
- definitions: []
24
- }
25
- };
26
- const props = parameter === null || parameter === void 0 ? void 0 : parameter.props;
27
- return /*#__PURE__*/ _jsx(DataQueriesProvider, {
28
- ...props,
29
- children: /*#__PURE__*/ _jsx(Story, {})
30
- });
31
- };
32
-
33
- //# sourceMappingURL=WithDataQueries.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/stories/shared-utils/decorators/WithDataQueries.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from '@perses-dev/core';\nimport { DataQueriesProvider, DataQueriesProviderProps } from '@perses-dev/plugin-system';\nimport { StoryFn, StoryContext } from '@storybook/react';\n\ndeclare module '@storybook/react' {\n interface Parameters {\n withDataQueries?: WithDataQueriesProvideParameter;\n }\n}\n\nexport type WithDataQueriesProvideParameter = {\n props: DataQueriesProviderProps;\n};\n\n// Type guard because storybook types parameters as `any`\nfunction isWithDataQueriesParameter(\n parameter: unknown | WithDataQueriesProvideParameter\n): parameter is WithDataQueriesProvideParameter {\n return !!parameter && typeof parameter === 'object' && 'props' in parameter;\n}\n\nexport const WithDataQueries = (Story: StoryFn, context: StoryContext<unknown>) => {\n const initParameter = context.parameters.withDataQueries;\n const parameter = isWithDataQueriesParameter(initParameter)\n ? initParameter\n : { props: { definitions: [] as Array<Definition<UnknownSpec>> } };\n const props = parameter?.props;\n\n return (\n <DataQueriesProvider {...props}>\n <Story />\n </DataQueriesProvider>\n );\n};\n"],"names":["DataQueriesProvider","isWithDataQueriesParameter","parameter","WithDataQueries","Story","context","initParameter","parameters","withDataQueries","props","definitions"],"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;;AAGjC,SAASA,mBAAmB,QAAkC,4BAA4B;AAa1F,yDAAyD;AACzD,SAASC,2BACPC,SAAoD;IAEpD,OAAO,CAAC,CAACA,aAAa,OAAOA,cAAc,YAAY,WAAWA;AACpE;AAEA,OAAO,MAAMC,kBAAkB,CAACC,OAAgBC;IAC9C,MAAMC,gBAAgBD,QAAQE,UAAU,CAACC,eAAe;IACxD,MAAMN,YAAYD,2BAA2BK,iBACzCA,gBACA;QAAEG,OAAO;YAAEC,aAAa,EAAE;QAAmC;IAAE;IACnE,MAAMD,QAAQP,sBAAAA,gCAAAA,UAAWO,KAAK;IAE9B,qBACE,KAACT;QAAqB,GAAGS,KAAK;kBAC5B,cAAA,KAACL;;AAGP,EAAE"}
@@ -1,3 +0,0 @@
1
- import { StoryFn } from '@storybook/react';
2
- export declare const WithPluginRegistry: (Story: StoryFn) => import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=WithPluginRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WithPluginRegistry.d.ts","sourceRoot":"","sources":["../../../../src/stories/shared-utils/decorators/WithPluginRegistry.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA8B3C,eAAO,MAAM,kBAAkB,UAAW,OAAO,4CAYhD,CAAC"}
@@ -1,46 +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
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { PluginRegistry, dynamicImportPluginLoader } from '@perses-dev/plugin-system';
15
- import prometheusResource from '@perses-dev/prometheus-plugin/plugin.json';
16
- import panelsResource from '@perses-dev/panels-plugin/plugin.json';
17
- const bundledPluginLoader = dynamicImportPluginLoader([
18
- {
19
- resource: prometheusResource,
20
- // This throws an error in CI (but not locally for some reason), likely because
21
- // this package isn't a dependency for dashboards. We probably do not want to
22
- // make it one solely for type-checking in storybook.
23
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
- // @ts-ignore
25
- importPlugin: ()=>import('@perses-dev/prometheus-plugin')
26
- },
27
- {
28
- resource: panelsResource,
29
- // Same comment as above.
30
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
31
- // @ts-ignore
32
- importPlugin: ()=>import('@perses-dev/panels-plugin')
33
- }
34
- ]);
35
- export const WithPluginRegistry = (Story)=>{
36
- return /*#__PURE__*/ _jsx(PluginRegistry, {
37
- pluginLoader: bundledPluginLoader,
38
- defaultPluginKinds: {
39
- TimeSeriesQuery: 'PrometheusTimeSeriesQuery',
40
- TraceQuery: 'TempoTraceQuery'
41
- },
42
- children: /*#__PURE__*/ _jsx(Story, {})
43
- });
44
- };
45
-
46
- //# sourceMappingURL=WithPluginRegistry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/stories/shared-utils/decorators/WithPluginRegistry.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { StoryFn } from '@storybook/react';\nimport {\n PluginRegistry,\n PluginLoader,\n PluginModuleResource,\n dynamicImportPluginLoader,\n} from '@perses-dev/plugin-system';\n\nimport prometheusResource from '@perses-dev/prometheus-plugin/plugin.json';\nimport panelsResource from '@perses-dev/panels-plugin/plugin.json';\n\nconst bundledPluginLoader: PluginLoader = dynamicImportPluginLoader([\n {\n resource: prometheusResource as PluginModuleResource,\n // This throws an error in CI (but not locally for some reason), likely because\n // this package isn't a dependency for dashboards. We probably do not want to\n // make it one solely for type-checking in storybook.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n importPlugin: () => import('@perses-dev/prometheus-plugin'),\n },\n {\n resource: panelsResource as PluginModuleResource,\n // Same comment as above.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n importPlugin: () => import('@perses-dev/panels-plugin'),\n },\n]);\n\nexport const WithPluginRegistry = (Story: StoryFn) => {\n return (\n <PluginRegistry\n pluginLoader={bundledPluginLoader}\n defaultPluginKinds={{\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n TraceQuery: 'TempoTraceQuery',\n }}\n >\n <Story />\n </PluginRegistry>\n );\n};\n"],"names":["PluginRegistry","dynamicImportPluginLoader","prometheusResource","panelsResource","bundledPluginLoader","resource","importPlugin","WithPluginRegistry","Story","pluginLoader","defaultPluginKinds","TimeSeriesQuery","TraceQuery"],"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;;AAGjC,SACEA,cAAc,EAGdC,yBAAyB,QACpB,4BAA4B;AAEnC,OAAOC,wBAAwB,4CAA4C;AAC3E,OAAOC,oBAAoB,wCAAwC;AAEnE,MAAMC,sBAAoCH,0BAA0B;IAClE;QACEI,UAAUH;QACV,+EAA+E;QAC/E,6EAA6E;QAC7E,qDAAqD;QACrD,6DAA6D;QAC7D,aAAa;QACbI,cAAc,IAAM,MAAM,CAAC;IAC7B;IACA;QACED,UAAUF;QACV,yBAAyB;QACzB,6DAA6D;QAC7D,aAAa;QACbG,cAAc,IAAM,MAAM,CAAC;IAC7B;CACD;AAED,OAAO,MAAMC,qBAAqB,CAACC;IACjC,qBACE,KAACR;QACCS,cAAcL;QACdM,oBAAoB;YAClBC,iBAAiB;YACjBC,YAAY;QACd;kBAEA,cAAA,KAACJ;;AAGP,EAAE"}