@perses-dev/plugin-system 0.55.0-beta.1 → 0.55.0-beta.11

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 (577) hide show
  1. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts +3 -3
  2. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.d.ts.map +1 -1
  3. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +11 -11
  4. package/dist/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js.map +1 -1
  5. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts +3 -3
  6. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.d.ts.map +1 -1
  7. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +6 -6
  8. package/dist/components/Annotations/AnnotationEditorForm/AnnotationPreview.js.map +1 -1
  9. package/dist/components/Annotations/AnnotationEditorForm/index.js +1 -1
  10. package/dist/components/Annotations/AnnotationEditorForm/index.js.map +1 -1
  11. package/dist/components/Annotations/index.js +2 -2
  12. package/dist/components/Annotations/index.js.map +1 -1
  13. package/dist/components/CalculationSelector/CalculationSelector.d.ts +2 -2
  14. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  15. package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
  16. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  17. package/dist/components/CalculationSelector/index.js +1 -1
  18. package/dist/components/CalculationSelector/index.js.map +1 -1
  19. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +3 -2
  20. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  21. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +10 -9
  22. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  23. package/dist/components/DatasourceEditorForm/index.js +1 -1
  24. package/dist/components/DatasourceEditorForm/index.js.map +1 -1
  25. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts +4 -4
  26. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
  27. package/dist/components/DatasourceSelect/DatasourceSelect.js +7 -7
  28. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  29. package/dist/components/DatasourceSelect/index.js +1 -1
  30. package/dist/components/DatasourceSelect/index.js.map +1 -1
  31. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts +8 -0
  32. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -0
  33. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js +45 -0
  34. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.js.map +1 -0
  35. package/dist/components/DatasourceTestConnectionButton/index.d.ts +2 -0
  36. package/dist/components/DatasourceTestConnectionButton/index.d.ts.map +1 -0
  37. package/dist/{cjs/model/alerts-queries.js → components/DatasourceTestConnectionButton/index.js} +3 -4
  38. package/dist/components/DatasourceTestConnectionButton/index.js.map +1 -0
  39. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts +10 -0
  40. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts.map +1 -0
  41. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js +99 -0
  42. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js.map +1 -0
  43. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +4 -2
  44. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  45. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +91 -41
  46. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  47. package/dist/components/HTTPSettingsEditor/index.js +1 -1
  48. package/dist/components/HTTPSettingsEditor/index.js.map +1 -1
  49. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts +1 -1
  50. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.d.ts.map +1 -1
  51. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +28 -28
  52. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  53. package/dist/components/ItemSelectionActionsOptionsEditor/index.js +1 -1
  54. package/dist/components/ItemSelectionActionsOptionsEditor/index.js.map +1 -1
  55. package/dist/components/LayoutEditor/LayoutEditor.d.ts +16 -0
  56. package/dist/components/LayoutEditor/LayoutEditor.d.ts.map +1 -0
  57. package/dist/components/LayoutEditor/LayoutEditor.js +115 -0
  58. package/dist/components/LayoutEditor/LayoutEditor.js.map +1 -0
  59. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts +7 -0
  60. package/dist/components/LayoutEditor/RepeatLayoutPreview.d.ts.map +1 -0
  61. package/dist/components/LayoutEditor/RepeatLayoutPreview.js +92 -0
  62. package/dist/components/LayoutEditor/RepeatLayoutPreview.js.map +1 -0
  63. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts +18 -0
  64. package/dist/components/LayoutEditor/RepeatVariableEditor.d.ts.map +1 -0
  65. package/dist/components/LayoutEditor/RepeatVariableEditor.js +168 -0
  66. package/dist/components/LayoutEditor/RepeatVariableEditor.js.map +1 -0
  67. package/dist/components/LayoutEditor/index.d.ts +4 -0
  68. package/dist/components/LayoutEditor/index.d.ts.map +1 -0
  69. package/dist/{cjs/model/explore.js → components/LayoutEditor/index.js} +5 -4
  70. package/dist/components/LayoutEditor/index.js.map +1 -0
  71. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts +2 -2
  72. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  73. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +5 -5
  74. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  75. package/dist/components/LegendOptionsEditor/index.js +1 -1
  76. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  77. package/dist/components/LinksEditor/LinksEditor.d.ts +3 -3
  78. package/dist/components/LinksEditor/LinksEditor.d.ts.map +1 -1
  79. package/dist/components/LinksEditor/LinksEditor.js +6 -6
  80. package/dist/components/LinksEditor/LinksEditor.js.map +1 -1
  81. package/dist/components/LinksEditor/index.js +1 -1
  82. package/dist/components/LinksEditor/index.js.map +1 -1
  83. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts +1 -1
  84. package/dist/components/MetricLabelInput/MetricLabelInput.d.ts.map +1 -1
  85. package/dist/components/MetricLabelInput/MetricLabelInput.js +2 -2
  86. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  87. package/dist/components/MetricLabelInput/index.js +1 -1
  88. package/dist/components/MetricLabelInput/index.js.map +1 -1
  89. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +3 -4
  90. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts.map +1 -1
  91. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +27 -9
  92. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  93. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts +3 -4
  94. package/dist/components/MultiQueryEditor/QueryEditorContainer.d.ts.map +1 -1
  95. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +14 -14
  96. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  97. package/dist/components/MultiQueryEditor/index.js +2 -2
  98. package/dist/components/MultiQueryEditor/index.js.map +1 -1
  99. package/dist/components/MultiQueryEditor/utils.d.ts +1 -1
  100. package/dist/components/MultiQueryEditor/utils.d.ts.map +1 -1
  101. package/dist/components/MultiQueryEditor/utils.js.map +1 -1
  102. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +1 -1
  103. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  104. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +4 -4
  105. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  106. package/dist/components/OptionsEditorRadios/index.js +1 -1
  107. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  108. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts +1 -1
  109. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.d.ts.map +1 -1
  110. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  111. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  112. package/dist/components/OptionsEditorTabPanel/index.js +1 -1
  113. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  114. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts +1 -1
  115. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  116. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +4 -4
  117. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  118. package/dist/components/OptionsEditorTabs/index.js +1 -1
  119. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  120. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts +2 -2
  121. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.d.ts.map +1 -1
  122. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js +9 -9
  123. package/dist/components/PanelSpecEditor/PanelAnnotationsEditor.js.map +1 -1
  124. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +8 -5
  125. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -1
  126. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +27 -12
  127. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  128. package/dist/components/PanelSpecEditor/index.js +1 -1
  129. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  130. package/dist/components/PluginEditor/PluginEditor.d.ts +2 -2
  131. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  132. package/dist/components/PluginEditor/PluginEditor.js +10 -9
  133. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  134. package/dist/components/PluginEditor/index.js +2 -2
  135. package/dist/components/PluginEditor/index.js.map +1 -1
  136. package/dist/components/PluginEditor/plugin-editor-api.d.ts +10 -3
  137. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  138. package/dist/components/PluginEditor/plugin-editor-api.js +10 -5
  139. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  140. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +17 -4
  141. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  142. package/dist/components/PluginKindSelect/PluginKindSelect.js +191 -27
  143. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  144. package/dist/components/PluginKindSelect/index.js +1 -1
  145. package/dist/components/PluginKindSelect/index.js.map +1 -1
  146. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  147. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  148. package/dist/components/PluginRegistry/PluginRegistry.js +71 -8
  149. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  150. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +2 -2
  151. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  152. package/dist/components/PluginRegistry/getPluginSearchHelper.js +2 -2
  153. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -1
  154. package/dist/components/PluginRegistry/index.js +1 -1
  155. package/dist/components/PluginRegistry/index.js.map +1 -1
  156. package/dist/components/PluginRegistry/plugin-indexes.d.ts +3 -1
  157. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  158. package/dist/components/PluginRegistry/plugin-indexes.js +9 -4
  159. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  160. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts +10 -0
  161. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.d.ts.map +1 -0
  162. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js +62 -0
  163. package/dist/components/PluginSpecEditor/DatasourceSpecEditor.js.map +1 -0
  164. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts +5 -4
  165. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  166. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +24 -6
  167. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  168. package/dist/components/PluginSpecEditor/index.js +1 -1
  169. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  170. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts +1 -1
  171. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.d.ts.map +1 -1
  172. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +3 -3
  173. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  174. package/dist/components/SelectionOptionsEditor/index.js +1 -1
  175. package/dist/components/SelectionOptionsEditor/index.js.map +1 -1
  176. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +4 -4
  177. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  178. package/dist/components/TimeRangeControls/TimeRangeControls.js +18 -55
  179. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  180. package/dist/components/TimeRangeControls/index.js +1 -1
  181. package/dist/components/TimeRangeControls/index.js.map +1 -1
  182. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +3 -3
  183. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -11
  185. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  186. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +2 -2
  187. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  188. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +8 -7
  189. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  190. package/dist/components/Variables/VariableEditorForm/index.js +3 -3
  191. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  192. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +2 -2
  193. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  194. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -6
  195. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  196. package/dist/components/Variables/index.js +2 -2
  197. package/dist/components/Variables/index.js.map +1 -1
  198. package/dist/components/Variables/variable-model.d.ts +8 -8
  199. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  200. package/dist/components/Variables/variable-model.js +10 -5
  201. package/dist/components/Variables/variable-model.js.map +1 -1
  202. package/dist/components/index.d.ts +2 -0
  203. package/dist/components/index.d.ts.map +1 -1
  204. package/dist/components/index.js +21 -19
  205. package/dist/components/index.js.map +1 -1
  206. package/dist/constants/index.d.ts +1 -0
  207. package/dist/constants/index.d.ts.map +1 -1
  208. package/dist/constants/index.js +2 -1
  209. package/dist/constants/index.js.map +1 -1
  210. package/dist/constants/repeat.d.ts +3 -0
  211. package/dist/constants/repeat.d.ts.map +1 -0
  212. package/dist/{cjs/model/datasource.js → constants/repeat.js} +4 -4
  213. package/dist/constants/repeat.js.map +1 -0
  214. package/dist/constants/user-interface-text.d.ts.map +1 -1
  215. package/dist/context/ValidationProvider.d.ts +9 -9
  216. package/dist/context/ValidationProvider.d.ts.map +1 -1
  217. package/dist/context/ValidationProvider.js +6 -6
  218. package/dist/context/ValidationProvider.js.map +1 -1
  219. package/dist/context/index.js +1 -1
  220. package/dist/context/index.js.map +1 -1
  221. package/dist/index.js +9 -9
  222. package/dist/index.js.map +1 -1
  223. package/dist/model/alerts-queries.d.ts +4 -4
  224. package/dist/model/alerts-queries.d.ts.map +1 -1
  225. package/dist/model/alerts-queries.js.map +1 -1
  226. package/dist/model/annotations.d.ts +3 -3
  227. package/dist/model/annotations.d.ts.map +1 -1
  228. package/dist/model/annotations.js.map +1 -1
  229. package/dist/model/calculations.d.ts +1 -1
  230. package/dist/model/calculations.d.ts.map +1 -1
  231. package/dist/model/calculations.js.map +1 -1
  232. package/dist/model/datasource.d.ts +10 -3
  233. package/dist/model/datasource.d.ts.map +1 -1
  234. package/dist/model/datasource.js +1 -1
  235. package/dist/model/datasource.js.map +1 -1
  236. package/dist/model/explore.d.ts +2 -3
  237. package/dist/model/explore.d.ts.map +1 -1
  238. package/dist/model/explore.js.map +1 -1
  239. package/dist/model/index.d.ts +1 -0
  240. package/dist/model/index.d.ts.map +1 -1
  241. package/dist/model/index.js +17 -16
  242. package/dist/model/index.js.map +1 -1
  243. package/dist/model/json-queries.d.ts +29 -0
  244. package/dist/model/json-queries.d.ts.map +1 -0
  245. package/dist/{cjs/model/annotations.js → model/json-queries.js} +5 -4
  246. package/dist/model/json-queries.js.map +1 -0
  247. package/dist/model/legend.d.ts +3 -3
  248. package/dist/model/legend.d.ts.map +1 -1
  249. package/dist/model/legend.js +2 -2
  250. package/dist/model/legend.js.map +1 -1
  251. package/dist/model/log-queries.d.ts +3 -3
  252. package/dist/model/log-queries.d.ts.map +1 -1
  253. package/dist/model/log-queries.js.map +1 -1
  254. package/dist/model/panels.d.ts +13 -4
  255. package/dist/model/panels.d.ts.map +1 -1
  256. package/dist/model/panels.js.map +1 -1
  257. package/dist/model/plugin-base.d.ts +3 -3
  258. package/dist/model/plugin-base.d.ts.map +1 -1
  259. package/dist/model/plugin-base.js.map +1 -1
  260. package/dist/model/plugin-loading.d.ts +1 -1
  261. package/dist/model/plugin-loading.d.ts.map +1 -1
  262. package/dist/model/plugin-loading.js +1 -1
  263. package/dist/model/plugin-loading.js.map +1 -1
  264. package/dist/model/plugins.d.ts +26 -13
  265. package/dist/model/plugins.d.ts.map +1 -1
  266. package/dist/model/plugins.js.map +1 -1
  267. package/dist/model/profile-queries.d.ts +4 -4
  268. package/dist/model/profile-queries.d.ts.map +1 -1
  269. package/dist/model/profile-queries.js.map +1 -1
  270. package/dist/model/silences-queries.d.ts +4 -4
  271. package/dist/model/silences-queries.d.ts.map +1 -1
  272. package/dist/model/silences-queries.js.map +1 -1
  273. package/dist/model/time-series-queries.d.ts +4 -4
  274. package/dist/model/time-series-queries.d.ts.map +1 -1
  275. package/dist/model/time-series-queries.js.map +1 -1
  276. package/dist/model/trace-queries.d.ts +4 -4
  277. package/dist/model/trace-queries.d.ts.map +1 -1
  278. package/dist/model/trace-queries.js.map +1 -1
  279. package/dist/model/variables.d.ts +7 -3
  280. package/dist/model/variables.d.ts.map +1 -1
  281. package/dist/model/variables.js +1 -3
  282. package/dist/model/variables.js.map +1 -1
  283. package/dist/remote/PluginLoaderComponent.d.ts +1 -2
  284. package/dist/remote/PluginLoaderComponent.d.ts.map +1 -1
  285. package/dist/remote/PluginLoaderComponent.js +2 -2
  286. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  287. package/dist/remote/PluginRuntime.d.ts +11 -2
  288. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  289. package/dist/remote/PluginRuntime.js +84 -79
  290. package/dist/remote/PluginRuntime.js.map +1 -1
  291. package/dist/remote/index.d.ts +1 -0
  292. package/dist/remote/index.d.ts.map +1 -1
  293. package/dist/remote/index.js +3 -2
  294. package/dist/remote/index.js.map +1 -1
  295. package/dist/remote/remotePluginLoader.d.ts +2 -2
  296. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  297. package/dist/remote/remotePluginLoader.js +3 -3
  298. package/dist/remote/remotePluginLoader.js.map +1 -1
  299. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +3 -3
  300. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  301. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +20 -12
  302. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  303. package/dist/runtime/DataQueriesProvider/index.js +2 -2
  304. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  305. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -3
  306. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  307. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  308. package/dist/runtime/RouterProvider.d.ts +2 -1
  309. package/dist/runtime/RouterProvider.d.ts.map +1 -1
  310. package/dist/runtime/RouterProvider.js +3 -3
  311. package/dist/runtime/RouterProvider.js.map +1 -1
  312. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts +3 -2
  313. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.d.ts.map +1 -1
  314. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +22 -8
  315. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  316. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts +3 -2
  317. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.d.ts.map +1 -1
  318. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js +5 -5
  319. package/dist/runtime/TimeRangeProvider/TimeRangeProviders.js.map +1 -1
  320. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +13 -2
  321. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  322. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +65 -4
  323. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  324. package/dist/runtime/TimeRangeProvider/index.js +4 -4
  325. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  326. package/dist/runtime/TimeRangeProvider/query-params.d.ts +3 -3
  327. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  328. package/dist/runtime/TimeRangeProvider/query-params.js +4 -4
  329. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  330. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts +1 -1
  331. package/dist/runtime/TimeRangeProvider/refresh-interval.d.ts.map +1 -1
  332. package/dist/runtime/TimeRangeProvider/refresh-interval.js +2 -2
  333. package/dist/runtime/TimeRangeProvider/refresh-interval.js.map +1 -1
  334. package/dist/runtime/UsageMetricsProvider.d.ts +3 -3
  335. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  336. package/dist/runtime/UsageMetricsProvider.js +3 -3
  337. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  338. package/dist/runtime/alerts-queries.d.ts +2 -2
  339. package/dist/runtime/alerts-queries.d.ts.map +1 -1
  340. package/dist/runtime/alerts-queries.js +11 -7
  341. package/dist/runtime/alerts-queries.js.map +1 -1
  342. package/dist/runtime/annotations.d.ts +2 -2
  343. package/dist/runtime/annotations.d.ts.map +1 -1
  344. package/dist/runtime/annotations.js +16 -9
  345. package/dist/runtime/annotations.js.map +1 -1
  346. package/dist/runtime/builtin-variables.d.ts +2 -3
  347. package/dist/runtime/builtin-variables.d.ts.map +1 -1
  348. package/dist/runtime/builtin-variables.js +1 -1
  349. package/dist/runtime/builtin-variables.js.map +1 -1
  350. package/dist/runtime/datasources.d.ts +2 -3
  351. package/dist/runtime/datasources.d.ts.map +1 -1
  352. package/dist/runtime/datasources.js +2 -2
  353. package/dist/runtime/datasources.js.map +1 -1
  354. package/dist/runtime/index.d.ts +1 -0
  355. package/dist/runtime/index.d.ts.map +1 -1
  356. package/dist/runtime/index.js +16 -15
  357. package/dist/runtime/index.js.map +1 -1
  358. package/dist/runtime/item-actions.d.ts +3 -3
  359. package/dist/runtime/item-actions.d.ts.map +1 -1
  360. package/dist/runtime/item-actions.js +2 -2
  361. package/dist/runtime/item-actions.js.map +1 -1
  362. package/dist/runtime/json-queries.d.ts +11 -0
  363. package/dist/runtime/json-queries.d.ts.map +1 -0
  364. package/dist/runtime/json-queries.js +58 -0
  365. package/dist/runtime/json-queries.js.map +1 -0
  366. package/dist/runtime/log-queries.d.ts +3 -3
  367. package/dist/runtime/log-queries.d.ts.map +1 -1
  368. package/dist/runtime/log-queries.js +8 -6
  369. package/dist/runtime/log-queries.js.map +1 -1
  370. package/dist/runtime/plugin-registry.d.ts +24 -11
  371. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  372. package/dist/runtime/plugin-registry.js +54 -18
  373. package/dist/runtime/plugin-registry.js.map +1 -1
  374. package/dist/runtime/profile-queries.d.ts +2 -2
  375. package/dist/runtime/profile-queries.d.ts.map +1 -1
  376. package/dist/runtime/profile-queries.js +7 -5
  377. package/dist/runtime/profile-queries.js.map +1 -1
  378. package/dist/runtime/silences-queries.d.ts +2 -2
  379. package/dist/runtime/silences-queries.d.ts.map +1 -1
  380. package/dist/runtime/silences-queries.js +11 -7
  381. package/dist/runtime/silences-queries.js.map +1 -1
  382. package/dist/runtime/time-series-queries.d.ts +3 -3
  383. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  384. package/dist/runtime/time-series-queries.js +16 -9
  385. package/dist/runtime/time-series-queries.js.map +1 -1
  386. package/dist/runtime/trace-queries.d.ts +2 -2
  387. package/dist/runtime/trace-queries.d.ts.map +1 -1
  388. package/dist/runtime/trace-queries.js +12 -8
  389. package/dist/runtime/trace-queries.js.map +1 -1
  390. package/dist/runtime/utils.d.ts +1 -1
  391. package/dist/runtime/utils.d.ts.map +1 -1
  392. package/dist/runtime/utils.js.map +1 -1
  393. package/dist/runtime/variables.d.ts +7 -2
  394. package/dist/runtime/variables.d.ts.map +1 -1
  395. package/dist/runtime/variables.js +20 -4
  396. package/dist/runtime/variables.js.map +1 -1
  397. package/dist/schema/index.js +1 -1
  398. package/dist/schema/index.js.map +1 -1
  399. package/dist/schema/panel.d.ts +4 -4
  400. package/dist/schema/panel.d.ts.map +1 -1
  401. package/dist/schema/panel.js +18 -4
  402. package/dist/schema/panel.js.map +1 -1
  403. package/dist/test/index.js +2 -2
  404. package/dist/test/index.js.map +1 -1
  405. package/dist/test/mock-data.d.ts +14 -13
  406. package/dist/test/mock-data.d.ts.map +1 -1
  407. package/dist/test/mock-data.js +6 -0
  408. package/dist/test/mock-data.js.map +1 -1
  409. package/dist/test/render-hook.d.ts +2 -2
  410. package/dist/test/render-hook.d.ts.map +1 -1
  411. package/dist/test/render-hook.js +2 -2
  412. package/dist/test/render-hook.js.map +1 -1
  413. package/dist/test/render.d.ts +3 -3
  414. package/dist/test/render.d.ts.map +1 -1
  415. package/dist/test/render.js +3 -3
  416. package/dist/test/render.js.map +1 -1
  417. package/dist/test/setup-tests.d.ts +1 -1
  418. package/dist/test/setup-tests.d.ts.map +1 -1
  419. package/dist/test/setup-tests.js +3 -2
  420. package/dist/test/setup-tests.js.map +1 -1
  421. package/dist/test/test-plugins/bert/index.d.ts +3 -3
  422. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  423. package/dist/test/test-plugins/bert/index.js.map +1 -1
  424. package/dist/test/test-plugins/ernie/index.d.ts +7 -1
  425. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  426. package/dist/test/test-plugins/ernie/index.js +58 -1
  427. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  428. package/dist/test/test-plugins/index.d.ts +1 -1
  429. package/dist/test/test-plugins/index.d.ts.map +1 -1
  430. package/dist/test/test-plugins/index.js +5 -5
  431. package/dist/test/test-plugins/index.js.map +1 -1
  432. package/dist/test/utils.d.ts +2 -2
  433. package/dist/test/utils.d.ts.map +1 -1
  434. package/dist/test/utils.js +5 -5
  435. package/dist/test/utils.js.map +1 -1
  436. package/dist/test-utils/index.js +1 -1
  437. package/dist/test-utils/index.js.map +1 -1
  438. package/dist/test-utils/mock-plugin-registry.d.ts +2 -2
  439. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  440. package/dist/test-utils/mock-plugin-registry.js +1 -1
  441. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  442. package/dist/utils/csv-export.d.ts.map +1 -1
  443. package/dist/utils/csv-export.js +2 -2
  444. package/dist/utils/csv-export.js.map +1 -1
  445. package/dist/utils/event.js +1 -1
  446. package/dist/utils/index.d.ts +1 -0
  447. package/dist/utils/index.d.ts.map +1 -1
  448. package/dist/utils/index.js +4 -3
  449. package/dist/utils/index.js.map +1 -1
  450. package/dist/utils/plugin-versions.d.ts +18 -0
  451. package/dist/utils/plugin-versions.d.ts.map +1 -0
  452. package/dist/utils/plugin-versions.js +52 -0
  453. package/dist/utils/plugin-versions.js.map +1 -0
  454. package/dist/utils/variables.js +1 -1
  455. package/package.json +18 -17
  456. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
  457. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
  458. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
  459. package/dist/cjs/components/Annotations/constants.js +0 -23
  460. package/dist/cjs/components/Annotations/index.js +0 -31
  461. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
  462. package/dist/cjs/components/CalculationSelector/index.js +0 -30
  463. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -270
  464. package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
  465. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
  466. package/dist/cjs/components/DatasourceSelect/index.js +0 -30
  467. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
  468. package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
  469. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
  470. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
  471. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
  472. package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
  473. package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
  474. package/dist/cjs/components/LinksEditor/index.js +0 -30
  475. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
  476. package/dist/cjs/components/MetricLabelInput/index.js +0 -30
  477. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -159
  478. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
  479. package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
  480. package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
  481. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
  482. package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
  483. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
  484. package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
  485. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
  486. package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
  487. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
  488. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -132
  489. package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
  490. package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
  491. package/dist/cjs/components/PluginEditor/index.js +0 -31
  492. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
  493. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
  494. package/dist/cjs/components/PluginKindSelect/index.js +0 -30
  495. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
  496. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
  497. package/dist/cjs/components/PluginRegistry/index.js +0 -30
  498. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
  499. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -55
  500. package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
  501. package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
  502. package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
  503. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -236
  504. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  505. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
  506. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
  507. package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
  508. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
  509. package/dist/cjs/components/Variables/index.js +0 -31
  510. package/dist/cjs/components/Variables/variable-model.js +0 -211
  511. package/dist/cjs/components/index.js +0 -48
  512. package/dist/cjs/constants/index.js +0 -30
  513. package/dist/cjs/constants/user-interface-text.js +0 -32
  514. package/dist/cjs/context/ValidationProvider.js +0 -77
  515. package/dist/cjs/context/index.js +0 -30
  516. package/dist/cjs/index.js +0 -38
  517. package/dist/cjs/model/calculations.js +0 -178
  518. package/dist/cjs/model/index.js +0 -45
  519. package/dist/cjs/model/legend.js +0 -111
  520. package/dist/cjs/model/log-queries.js +0 -16
  521. package/dist/cjs/model/log-volume-utils.js +0 -124
  522. package/dist/cjs/model/panels.js +0 -16
  523. package/dist/cjs/model/plugin-base.js +0 -16
  524. package/dist/cjs/model/plugin-loading.js +0 -56
  525. package/dist/cjs/model/plugins.js +0 -26
  526. package/dist/cjs/model/profile-queries.js +0 -16
  527. package/dist/cjs/model/silences-queries.js +0 -16
  528. package/dist/cjs/model/time-series-queries.js +0 -26
  529. package/dist/cjs/model/trace-queries.js +0 -16
  530. package/dist/cjs/model/variables.js +0 -16
  531. package/dist/cjs/remote/PersesPlugin.types.js +0 -16
  532. package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
  533. package/dist/cjs/remote/PluginRuntime.js +0 -331
  534. package/dist/cjs/remote/index.js +0 -31
  535. package/dist/cjs/remote/remotePluginLoader.js +0 -101
  536. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
  537. package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
  538. package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
  539. package/dist/cjs/runtime/RouterProvider.js +0 -114
  540. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -201
  541. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
  542. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
  543. package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
  544. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
  545. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
  546. package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
  547. package/dist/cjs/runtime/alerts-queries.js +0 -101
  548. package/dist/cjs/runtime/annotations.js +0 -148
  549. package/dist/cjs/runtime/builtin-variables.js +0 -81
  550. package/dist/cjs/runtime/datasources.js +0 -80
  551. package/dist/cjs/runtime/index.js +0 -44
  552. package/dist/cjs/runtime/item-actions.js +0 -302
  553. package/dist/cjs/runtime/log-queries.js +0 -76
  554. package/dist/cjs/runtime/plugin-registry.js +0 -135
  555. package/dist/cjs/runtime/profile-queries.js +0 -73
  556. package/dist/cjs/runtime/silences-queries.js +0 -101
  557. package/dist/cjs/runtime/time-series-queries.js +0 -165
  558. package/dist/cjs/runtime/trace-queries.js +0 -106
  559. package/dist/cjs/runtime/utils.js +0 -39
  560. package/dist/cjs/runtime/variables.js +0 -160
  561. package/dist/cjs/schema/index.js +0 -30
  562. package/dist/cjs/schema/panel.js +0 -42
  563. package/dist/cjs/test/index.js +0 -31
  564. package/dist/cjs/test/mock-data.js +0 -357
  565. package/dist/cjs/test/render-hook.js +0 -31
  566. package/dist/cjs/test/render.js +0 -31
  567. package/dist/cjs/test/setup-tests.js +0 -20
  568. package/dist/cjs/test/test-plugins/bert/index.js +0 -99
  569. package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
  570. package/dist/cjs/test/test-plugins/index.js +0 -81
  571. package/dist/cjs/test/utils.js +0 -58
  572. package/dist/cjs/test-utils/index.js +0 -30
  573. package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
  574. package/dist/cjs/utils/csv-export.js +0 -248
  575. package/dist/cjs/utils/event.js +0 -30
  576. package/dist/cjs/utils/index.js +0 -32
  577. package/dist/cjs/utils/variables.js +0 -44
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginRegistry/PluginRegistry.tsx"],"sourcesContent":["// Copyright 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 { UnknownSpec } from '@perses-dev/spec';\nimport { useRef, useCallback, useMemo, ReactNode, ReactElement } from 'react';\nimport {\n PluginModuleResource,\n PluginType,\n PluginImplementation,\n Plugin,\n PluginLoader,\n DefaultPluginKinds,\n} from '../../model';\nimport { PluginRegistryContext } from '../../runtime';\nimport { useEvent } from '../../utils';\nimport { usePluginIndexes, PluginCompoundKey } from './plugin-indexes';\nimport { resolvePluginKeys } from './getPluginSearchHelper';\n\nexport interface PluginRegistryProps {\n pluginLoader: PluginLoader;\n defaultPluginKinds?: DefaultPluginKinds;\n children?: ReactNode;\n}\n\n/**\n * PluginRegistryContext provider that keeps track of all available plugins and provides an API for getting them or\n * querying the metadata about them.\n */\nexport function PluginRegistry(props: PluginRegistryProps): ReactElement {\n const {\n pluginLoader: { getInstalledPlugins, importPluginModule },\n children,\n defaultPluginKinds,\n } = props;\n\n const getPluginIndexes = usePluginIndexes(getInstalledPlugins);\n\n // De-dupe calls to import plugin modules\n const importCache = useRef(new Map<PluginModuleResource, Promise<unknown>>());\n\n // Do useEvent here since this accesses the importPluginModule prop and we want a stable reference to it for the\n // callback below\n const loadPluginModule = useEvent((resource: PluginModuleResource) => {\n let request = importCache.current.get(resource);\n if (request === undefined) {\n request = importPluginModule(resource);\n importCache.current.set(resource, request);\n\n // Remove failed requests from the cache so they can potentially be retried\n request.catch(() => importCache.current.delete(resource));\n }\n return request;\n });\n\n const getPlugin = useCallback(\n async <T extends PluginType>(compoundKeyObj: PluginCompoundKey<T>): Promise<PluginImplementation<T>> => {\n const pluginIndexes = await getPluginIndexes();\n const { kind, name } = compoundKeyObj;\n\n const candidateKeys = resolvePluginKeys(\n pluginIndexes.pluginResourcesByNameKindRegistryVersion.keys(),\n compoundKeyObj\n );\n\n for (const resourceKey of candidateKeys) {\n const resource = pluginIndexes.pluginResourcesByNameKindRegistryVersion.get(resourceKey);\n if (!resource) continue;\n\n const pluginModule = (await loadPluginModule(resource)) as Record<string, Plugin<UnknownSpec>>;\n // Try to get the plugin implementation from the module using the versioned export first\n const plugin = pluginModule?.[resourceKey];\n if (plugin) return plugin as PluginImplementation<T>;\n // If the plugin module doesn't have a versioned export, fallback to the plugin name\n const versionlessPlugin = pluginModule?.[name];\n if (versionlessPlugin) return versionlessPlugin as PluginImplementation<T>;\n }\n\n throw new Error(`A ${name} plugin for kind '${kind}' is not installed`);\n },\n [getPluginIndexes, loadPluginModule]\n );\n\n const listPluginMetadata = useCallback(\n async (pluginTypes: PluginType[]) => {\n const pluginIndexes = await getPluginIndexes();\n return pluginTypes.flatMap((type) => pluginIndexes.pluginMetadataByKind.get(type) ?? []);\n },\n [getPluginIndexes]\n );\n\n // Create the registry's context value and render\n const context = useMemo(\n () => ({ getPlugin, listPluginMetadata, defaultPluginKinds }),\n [getPlugin, listPluginMetadata, defaultPluginKinds]\n );\n return <PluginRegistryContext.Provider value={context}>{children}</PluginRegistryContext.Provider>;\n}\n"],"names":["useRef","useCallback","useMemo","PluginRegistryContext","useEvent","usePluginIndexes","resolvePluginKeys","PluginRegistry","props","pluginLoader","getInstalledPlugins","importPluginModule","children","defaultPluginKinds","getPluginIndexes","importCache","Map","loadPluginModule","resource","request","current","get","undefined","set","catch","delete","getPlugin","compoundKeyObj","pluginIndexes","kind","name","candidateKeys","pluginResourcesByNameKindRegistryVersion","keys","resourceKey","pluginModule","plugin","versionlessPlugin","Error","listPluginMetadata","pluginTypes","flatMap","type","pluginMetadataByKind","context","Provider","value"],"mappings":"AAAA,+BAA+B;AAC/B,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,WAAW,EAAEC,OAAO,QAAiC,QAAQ;AAS9E,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAA2B,mBAAmB;AACvE,SAASC,iBAAiB,QAAQ,0BAA0B;AAQ5D;;;CAGC,GACD,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EACJC,cAAc,EAAEC,mBAAmB,EAAEC,kBAAkB,EAAE,EACzDC,QAAQ,EACRC,kBAAkB,EACnB,GAAGL;IAEJ,MAAMM,mBAAmBT,iBAAiBK;IAE1C,yCAAyC;IACzC,MAAMK,cAAcf,OAAO,IAAIgB;IAE/B,gHAAgH;IAChH,iBAAiB;IACjB,MAAMC,mBAAmBb,SAAS,CAACc;QACjC,IAAIC,UAAUJ,YAAYK,OAAO,CAACC,GAAG,CAACH;QACtC,IAAIC,YAAYG,WAAW;YACzBH,UAAUR,mBAAmBO;YAC7BH,YAAYK,OAAO,CAACG,GAAG,CAACL,UAAUC;YAElC,2EAA2E;YAC3EA,QAAQK,KAAK,CAAC,IAAMT,YAAYK,OAAO,CAACK,MAAM,CAACP;QACjD;QACA,OAAOC;IACT;IAEA,MAAMO,YAAYzB,YAChB,OAA6B0B;QAC3B,MAAMC,gBAAgB,MAAMd;QAC5B,MAAM,EAAEe,IAAI,EAAEC,IAAI,EAAE,GAAGH;QAEvB,MAAMI,gBAAgBzB,kBACpBsB,cAAcI,wCAAwC,CAACC,IAAI,IAC3DN;QAGF,KAAK,MAAMO,eAAeH,cAAe;YACvC,MAAMb,WAAWU,cAAcI,wCAAwC,CAACX,GAAG,CAACa;YAC5E,IAAI,CAAChB,UAAU;YAEf,MAAMiB,eAAgB,MAAMlB,iBAAiBC;YAC7C,wFAAwF;YACxF,MAAMkB,SAASD,cAAc,CAACD,YAAY;YAC1C,IAAIE,QAAQ,OAAOA;YACnB,oFAAoF;YACpF,MAAMC,oBAAoBF,cAAc,CAACL,KAAK;YAC9C,IAAIO,mBAAmB,OAAOA;QAChC;QAEA,MAAM,IAAIC,MAAM,CAAC,EAAE,EAAER,KAAK,kBAAkB,EAAED,KAAK,kBAAkB,CAAC;IACxE,GACA;QAACf;QAAkBG;KAAiB;IAGtC,MAAMsB,qBAAqBtC,YACzB,OAAOuC;QACL,MAAMZ,gBAAgB,MAAMd;QAC5B,OAAO0B,YAAYC,OAAO,CAAC,CAACC,OAASd,cAAce,oBAAoB,CAACtB,GAAG,CAACqB,SAAS,EAAE;IACzF,GACA;QAAC5B;KAAiB;IAGpB,iDAAiD;IACjD,MAAM8B,UAAU1C,QACd,IAAO,CAAA;YAAEwB;YAAWa;YAAoB1B;QAAmB,CAAA,GAC3D;QAACa;QAAWa;QAAoB1B;KAAmB;IAErD,qBAAO,KAACV,sBAAsB0C,QAAQ;QAACC,OAAOF;kBAAUhC;;AAC1D"}
1
+ {"version":3,"sources":["../../../src/components/PluginRegistry/PluginRegistry.tsx"],"sourcesContent":["// Copyright 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 type { UnknownSpec } from '@perses-dev/spec';\nimport type { ReactNode, ReactElement } from 'react';\nimport { useRef, useCallback, useMemo } from 'react';\n\nimport type {\n PluginModuleResource,\n PluginType,\n PluginImplementation,\n Plugin,\n PluginLoader,\n DefaultPluginKinds,\n} from '../../model';\nimport { PluginRegistryContext } from '../../runtime';\nimport { comparePluginVersions, useEvent } from '../../utils';\nimport { resolvePluginKeys } from './getPluginSearchHelper';\nimport type { PluginCompoundKey } from './plugin-indexes';\nimport { usePluginIndexes } from './plugin-indexes';\n\nexport interface PluginRegistryProps {\n pluginLoader: PluginLoader;\n defaultPluginKinds?: DefaultPluginKinds;\n children?: ReactNode;\n}\n\n/**\n * Returns the indexed key of a plugin served by a local dev server for the given plugin type and kind, if any.\n * Keys are `${kind}:${name}:${registry}:${version}`, so we match on the `kind:name:` prefix.\n */\nfunction findDevPluginKey(devPluginKeys: Set<string>, kind: string, name: string): string | undefined {\n const prefix = `${kind}:${name}:`;\n for (const key of devPluginKeys) {\n if (key.startsWith(prefix)) {\n return key;\n }\n }\n return undefined;\n}\n\n/**\n * Returns the indexed keys (`${kind}:${name}:${registry}:${version}`) matching *every* field supplied in the query.\n * `kind` and `name` are always compared; `registry` and `version` are only compared when they are set, so a\n * version-only pin matches whatever registry the plugin happens to be installed under, and a registry-only pin never\n * leaks into another registry. Results are ordered from the newest version to the oldest.\n */\nfunction findMatchingPluginKeys<T extends PluginType>(\n allKeys: Iterable<string>,\n query: PluginCompoundKey<T>,\n): string[] {\n const { kind, name, registry, version } = query;\n const prefix = `${kind}:${name}:`;\n const matches: Array<{ key: string; version: string }> = [];\n\n for (const key of allKeys) {\n if (!key.startsWith(prefix)) continue;\n const parts = key.split(':');\n if (parts.length !== 4) continue;\n const [, , keyRegistry, keyVersion] = parts;\n if (registry !== undefined && keyRegistry !== registry) continue;\n if (version !== undefined && keyVersion !== version) continue;\n matches.push({ key, version: keyVersion ?? '' });\n }\n\n return matches.toSorted((a, b) => comparePluginVersions(b.version, a.version)).map((match) => match.key);\n}\n\n/**\n * PluginRegistryContext provider that keeps track of all available plugins and provides an API for getting them or\n * querying the metadata about them.\n */\nexport function PluginRegistry(props: PluginRegistryProps): ReactElement {\n const {\n pluginLoader: { getInstalledPlugins, importPluginModule },\n children,\n defaultPluginKinds,\n } = props;\n\n const getPluginIndexes = usePluginIndexes(getInstalledPlugins);\n\n // De-dupe calls to import plugin modules\n const importCache = useRef(new Map<PluginModuleResource, Promise<unknown>>());\n\n // Do useEvent here since this accesses the importPluginModule prop and we want a stable reference to it for the\n // callback below\n const loadPluginModule = useEvent((resource: PluginModuleResource) => {\n let request = importCache.current.get(resource);\n if (request === undefined) {\n request = importPluginModule(resource);\n importCache.current.set(resource, request);\n\n // Remove failed requests from the cache so they can potentially be retried\n request.catch(() => importCache.current.delete(resource));\n }\n return request;\n });\n\n const getPlugin = useCallback(\n async <T extends PluginType>(compoundKeyObj: PluginCompoundKey<T>): Promise<PluginImplementation<T>> => {\n const pluginIndexes = await getPluginIndexes();\n const { kind, name, version, registry } = compoundKeyObj;\n const allKeys = pluginIndexes.pluginResourcesByNameKindRegistryVersion.keys();\n\n let candidateKeys: string[];\n if (version || registry) {\n // A pin is an exact constraint: only the plugins matching every supplied field are acceptable, and we never\n // silently fall back to another version or another registry.\n candidateKeys = findMatchingPluginKeys(allKeys, compoundKeyObj);\n } else {\n candidateKeys = resolvePluginKeys(allKeys, compoundKeyObj);\n // Nothing pinned: a plugin served by a local dev server (`percli plugin start`) wins over installed archives,\n // whatever their versions. Otherwise a dev plugin whose package version is lower than an installed archive would\n // never be used, which defeats the purpose of running it in dev.\n const devKey = findDevPluginKey(pluginIndexes.devPluginKeys, kind, name);\n if (devKey) {\n candidateKeys = [devKey, ...candidateKeys.filter((key) => key !== devKey)];\n }\n }\n\n for (const resourceKey of candidateKeys) {\n const resource = pluginIndexes.pluginResourcesByNameKindRegistryVersion.get(resourceKey);\n if (!resource) continue;\n\n const pluginModule = (await loadPluginModule(resource)) as Record<string, Plugin<UnknownSpec>>;\n // Try to get the plugin implementation from the module using the versioned export first\n const plugin = pluginModule?.[resourceKey];\n if (plugin) return plugin as PluginImplementation<T>;\n // If the plugin module doesn't have a versioned export, fallback to the plugin name\n const versionlessPlugin = pluginModule?.[name];\n if (versionlessPlugin) return versionlessPlugin as PluginImplementation<T>;\n }\n\n const pins = [\n version ? `version '${version}'` : undefined,\n registry ? `registry '${registry}'` : undefined,\n ].filter((pin) => pin !== undefined);\n throw new Error(\n pins.length > 0\n ? `A ${name} plugin for kind '${kind}' with ${pins.join(' and ')} is not installed`\n : `A ${name} plugin for kind '${kind}' is not installed`,\n );\n },\n [getPluginIndexes, loadPluginModule],\n );\n\n const listPluginMetadata = useCallback(\n async (pluginTypes?: PluginType[]) => {\n const pluginIndexes = await getPluginIndexes();\n if (pluginTypes === undefined) {\n // No filter: return the metadata of every installed plugin, whatever its type.\n return [...pluginIndexes.pluginMetadataByKind.values()].flat();\n }\n return pluginTypes.flatMap((type) => pluginIndexes.pluginMetadataByKind.get(type) ?? []);\n },\n [getPluginIndexes],\n );\n\n // Create the registry's context value and render\n const context = useMemo(\n () => ({ getPlugin, listPluginMetadata, defaultPluginKinds }),\n [getPlugin, listPluginMetadata, defaultPluginKinds],\n );\n return <PluginRegistryContext.Provider value={context}>{children}</PluginRegistryContext.Provider>;\n}\n"],"names":["useRef","useCallback","useMemo","PluginRegistryContext","comparePluginVersions","useEvent","resolvePluginKeys","usePluginIndexes","findDevPluginKey","devPluginKeys","kind","name","prefix","key","startsWith","undefined","findMatchingPluginKeys","allKeys","query","registry","version","matches","parts","split","length","keyRegistry","keyVersion","push","toSorted","a","b","map","match","PluginRegistry","props","pluginLoader","getInstalledPlugins","importPluginModule","children","defaultPluginKinds","getPluginIndexes","importCache","Map","loadPluginModule","resource","request","current","get","set","catch","delete","getPlugin","compoundKeyObj","pluginIndexes","pluginResourcesByNameKindRegistryVersion","keys","candidateKeys","devKey","filter","resourceKey","pluginModule","plugin","versionlessPlugin","pins","pin","Error","join","listPluginMetadata","pluginTypes","pluginMetadataByKind","values","flat","flatMap","type","context","Provider","value"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAIjC,SAASA,MAAM,EAAEC,WAAW,EAAEC,OAAO,QAAQ,QAAQ;AAUrD,SAASC,qBAAqB,QAAQ,yBAAgB;AACtD,SAASC,qBAAqB,EAAEC,QAAQ,QAAQ,uBAAc;AAC9D,SAASC,iBAAiB,QAAQ,6BAA0B;AAE5D,SAASC,gBAAgB,QAAQ,sBAAmB;AAQpD;;;CAGC,GACD,SAASC,iBAAiBC,aAA0B,EAAEC,IAAY,EAAEC,IAAY;IAC9E,MAAMC,SAAS,GAAGF,KAAK,CAAC,EAAEC,KAAK,CAAC,CAAC;IACjC,KAAK,MAAME,OAAOJ,cAAe;QAC/B,IAAII,IAAIC,UAAU,CAACF,SAAS;YAC1B,OAAOC;QACT;IACF;IACA,OAAOE;AACT;AAEA;;;;;CAKC,GACD,SAASC,uBACPC,OAAyB,EACzBC,KAA2B;IAE3B,MAAM,EAAER,IAAI,EAAEC,IAAI,EAAEQ,QAAQ,EAAEC,OAAO,EAAE,GAAGF;IAC1C,MAAMN,SAAS,GAAGF,KAAK,CAAC,EAAEC,KAAK,CAAC,CAAC;IACjC,MAAMU,UAAmD,EAAE;IAE3D,KAAK,MAAMR,OAAOI,QAAS;QACzB,IAAI,CAACJ,IAAIC,UAAU,CAACF,SAAS;QAC7B,MAAMU,QAAQT,IAAIU,KAAK,CAAC;QACxB,IAAID,MAAME,MAAM,KAAK,GAAG;QACxB,MAAM,KAAKC,aAAaC,WAAW,GAAGJ;QACtC,IAAIH,aAAaJ,aAAaU,gBAAgBN,UAAU;QACxD,IAAIC,YAAYL,aAAaW,eAAeN,SAAS;QACrDC,QAAQM,IAAI,CAAC;YAAEd;YAAKO,SAASM,cAAc;QAAG;IAChD;IAEA,OAAOL,QAAQO,QAAQ,CAAC,CAACC,GAAGC,IAAM1B,sBAAsB0B,EAAEV,OAAO,EAAES,EAAET,OAAO,GAAGW,GAAG,CAAC,CAACC,QAAUA,MAAMnB,GAAG;AACzG;AAEA;;;CAGC,GACD,OAAO,SAASoB,eAAeC,KAA0B;IACvD,MAAM,EACJC,cAAc,EAAEC,mBAAmB,EAAEC,kBAAkB,EAAE,EACzDC,QAAQ,EACRC,kBAAkB,EACnB,GAAGL;IAEJ,MAAMM,mBAAmBjC,iBAAiB6B;IAE1C,yCAAyC;IACzC,MAAMK,cAAczC,OAAO,IAAI0C;IAE/B,gHAAgH;IAChH,iBAAiB;IACjB,MAAMC,mBAAmBtC,SAAS,CAACuC;QACjC,IAAIC,UAAUJ,YAAYK,OAAO,CAACC,GAAG,CAACH;QACtC,IAAIC,YAAY9B,WAAW;YACzB8B,UAAUR,mBAAmBO;YAC7BH,YAAYK,OAAO,CAACE,GAAG,CAACJ,UAAUC;YAElC,2EAA2E;YAC3EA,QAAQI,KAAK,CAAC,IAAMR,YAAYK,OAAO,CAACI,MAAM,CAACN;QACjD;QACA,OAAOC;IACT;IAEA,MAAMM,YAAYlD,YAChB,OAA6BmD;QAC3B,MAAMC,gBAAgB,MAAMb;QAC5B,MAAM,EAAE9B,IAAI,EAAEC,IAAI,EAAES,OAAO,EAAED,QAAQ,EAAE,GAAGiC;QAC1C,MAAMnC,UAAUoC,cAAcC,wCAAwC,CAACC,IAAI;QAE3E,IAAIC;QACJ,IAAIpC,WAAWD,UAAU;YACvB,4GAA4G;YAC5G,6DAA6D;YAC7DqC,gBAAgBxC,uBAAuBC,SAASmC;QAClD,OAAO;YACLI,gBAAgBlD,kBAAkBW,SAASmC;YAC3C,8GAA8G;YAC9G,iHAAiH;YACjH,iEAAiE;YACjE,MAAMK,SAASjD,iBAAiB6C,cAAc5C,aAAa,EAAEC,MAAMC;YACnE,IAAI8C,QAAQ;gBACVD,gBAAgB;oBAACC;uBAAWD,cAAcE,MAAM,CAAC,CAAC7C,MAAQA,QAAQ4C;iBAAQ;YAC5E;QACF;QAEA,KAAK,MAAME,eAAeH,cAAe;YACvC,MAAMZ,WAAWS,cAAcC,wCAAwC,CAACP,GAAG,CAACY;YAC5E,IAAI,CAACf,UAAU;YAEf,MAAMgB,eAAgB,MAAMjB,iBAAiBC;YAC7C,wFAAwF;YACxF,MAAMiB,SAASD,cAAc,CAACD,YAAY;YAC1C,IAAIE,QAAQ,OAAOA;YACnB,oFAAoF;YACpF,MAAMC,oBAAoBF,cAAc,CAACjD,KAAK;YAC9C,IAAImD,mBAAmB,OAAOA;QAChC;QAEA,MAAMC,OAAO;YACX3C,UAAU,CAAC,SAAS,EAAEA,QAAQ,CAAC,CAAC,GAAGL;YACnCI,WAAW,CAAC,UAAU,EAAEA,SAAS,CAAC,CAAC,GAAGJ;SACvC,CAAC2C,MAAM,CAAC,CAACM,MAAQA,QAAQjD;QAC1B,MAAM,IAAIkD,MACRF,KAAKvC,MAAM,GAAG,IACV,CAAC,EAAE,EAAEb,KAAK,kBAAkB,EAAED,KAAK,OAAO,EAAEqD,KAAKG,IAAI,CAAC,SAAS,iBAAiB,CAAC,GACjF,CAAC,EAAE,EAAEvD,KAAK,kBAAkB,EAAED,KAAK,kBAAkB,CAAC;IAE9D,GACA;QAAC8B;QAAkBG;KAAiB;IAGtC,MAAMwB,qBAAqBlE,YACzB,OAAOmE;QACL,MAAMf,gBAAgB,MAAMb;QAC5B,IAAI4B,gBAAgBrD,WAAW;YAC7B,+EAA+E;YAC/E,OAAO;mBAAIsC,cAAcgB,oBAAoB,CAACC,MAAM;aAAG,CAACC,IAAI;QAC9D;QACA,OAAOH,YAAYI,OAAO,CAAC,CAACC,OAASpB,cAAcgB,oBAAoB,CAACtB,GAAG,CAAC0B,SAAS,EAAE;IACzF,GACA;QAACjC;KAAiB;IAGpB,iDAAiD;IACjD,MAAMkC,UAAUxE,QACd,IAAO,CAAA;YAAEiD;YAAWgB;YAAoB5B;QAAmB,CAAA,GAC3D;QAACY;QAAWgB;QAAoB5B;KAAmB;IAErD,qBAAO,KAACpC,sBAAsBwE,QAAQ;QAACC,OAAOF;kBAAUpC;;AAC1D"}
@@ -1,5 +1,5 @@
1
- import { PluginType } from '../../model';
2
- import { PluginCompoundKey } from './plugin-indexes';
1
+ import type { PluginType } from '../../model';
2
+ import type { PluginCompoundKey } from './plugin-indexes';
3
3
  export interface PluginLookupPrecedenceLogic {
4
4
  registryOverVersion: boolean;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPluginSearchHelper.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAA8B,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kCACnB,SAAS,MAAM,CAAC,SAClB,kBAAkB,CAAC,CAAC,oBACV,2BAA2B,KAC3C,MAAM,EAkER,CAAC"}
1
+ {"version":3,"file":"getPluginSearchHelper.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,UAAU,WAC3C,QAAQ,CAAC,MAAM,CAAC,SAClB,iBAAiB,CAAC,CAAC,CAAC,oBACV,2BAA2B,KAC3C,MAAM,EAkER,CAAC"}
@@ -10,8 +10,8 @@
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
- import { gt } from 'semver';
14
- import { getPluginModuleCompoundKey } from '../../model';
13
+ import { gt } from "semver";
14
+ import { getPluginModuleCompoundKey } from "../../model/index.js";
15
15
  const PLUGIN_LOOKUP_PRECEDENCE_LOGIC = {
16
16
  registryOverVersion: false
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"sourcesContent":["// Copyright 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 { gt } from 'semver';\nimport { PluginType, getPluginModuleCompoundKey } from '../../model';\nimport { PluginCompoundKey } from './plugin-indexes';\n\n// When both a registry and non-registry variant exist at the same version,\n// `registryOverVersion: true` prefers the registry variant.\nexport interface PluginLookupPrecedenceLogic {\n registryOverVersion: boolean;\n}\n\nconst PLUGIN_LOOKUP_PRECEDENCE_LOGIC: PluginLookupPrecedenceLogic = { registryOverVersion: false };\n\n/**\n * Returns an ordered list of candidate 4-part keys to try when resolving a plugin.\n * If version/registry are specified, the exact-match key comes first.\n * The best fallback key (highest version, tie-broken by precedence policy) follows.\n */\nexport const resolvePluginKeys = <T extends PluginType>(\n allKeys: Iterable<string>,\n query: PluginCompoundKey<T>,\n precedenceLogic: PluginLookupPrecedenceLogic = PLUGIN_LOOKUP_PRECEDENCE_LOGIC\n): string[] => {\n const { kind, name, version, registry } = query;\n const candidates: string[] = [];\n\n // Exact match first when version or registry is specified\n if (version || registry) {\n candidates.push(getPluginModuleCompoundKey({ kind, name, registry, version }));\n }\n\n // Find the best fallback by scanning all matching keys\n type PluginBucket = { key: string; version: string };\n const latestWithRegistry: PluginBucket = { key: '', version: '' };\n const latestWithoutRegistry: PluginBucket = { key: '', version: '' };\n\n const prefix = `${kind}:${name}:`;\n for (const key of allKeys) {\n if (!key.startsWith(prefix)) continue;\n const split = key.split(':');\n\n if (split.length !== 4) {\n console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);\n continue;\n }\n\n const [, , reg, ver] = split;\n if (!ver) {\n console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);\n continue;\n }\n\n if (reg) {\n if (!latestWithRegistry.key || gt(ver, latestWithRegistry.version)) {\n latestWithRegistry.key = key;\n latestWithRegistry.version = ver;\n }\n } else {\n if (!latestWithoutRegistry.key || gt(ver, latestWithoutRegistry.version)) {\n latestWithoutRegistry.key = key;\n latestWithoutRegistry.version = ver;\n }\n }\n }\n\n // Determine the best fallback key from the two buckets\n let fallbackKey: string | undefined;\n\n if (latestWithRegistry.key && latestWithoutRegistry.key) {\n const { registryOverVersion } = precedenceLogic;\n\n if (gt(latestWithRegistry.version, latestWithoutRegistry.version)) {\n fallbackKey = latestWithRegistry.key;\n } else if (gt(latestWithoutRegistry.version, latestWithRegistry.version)) {\n fallbackKey = latestWithoutRegistry.key;\n } else {\n // Versions are equal — use the tie-breaker\n fallbackKey = registryOverVersion ? latestWithRegistry.key : latestWithoutRegistry.key;\n }\n } else {\n fallbackKey = latestWithRegistry.key || latestWithoutRegistry.key || undefined;\n }\n\n if (fallbackKey && !candidates.includes(fallbackKey)) {\n candidates.push(fallbackKey);\n }\n\n return candidates;\n};\n"],"names":["gt","getPluginModuleCompoundKey","PLUGIN_LOOKUP_PRECEDENCE_LOGIC","registryOverVersion","resolvePluginKeys","allKeys","query","precedenceLogic","kind","name","version","registry","candidates","push","latestWithRegistry","key","latestWithoutRegistry","prefix","startsWith","split","length","console","warn","reg","ver","fallbackKey","undefined","includes"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,EAAE,QAAQ,SAAS;AAC5B,SAAqBC,0BAA0B,QAAQ,cAAc;AASrE,MAAMC,iCAA8D;IAAEC,qBAAqB;AAAM;AAEjG;;;;CAIC,GACD,OAAO,MAAMC,oBAAoB,CAC/BC,SACAC,OACAC,kBAA+CL,8BAA8B;IAE7E,MAAM,EAAEM,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGL;IAC1C,MAAMM,aAAuB,EAAE;IAE/B,0DAA0D;IAC1D,IAAIF,WAAWC,UAAU;QACvBC,WAAWC,IAAI,CAACZ,2BAA2B;YAAEO;YAAMC;YAAME;YAAUD;QAAQ;IAC7E;IAIA,MAAMI,qBAAmC;QAAEC,KAAK;QAAIL,SAAS;IAAG;IAChE,MAAMM,wBAAsC;QAAED,KAAK;QAAIL,SAAS;IAAG;IAEnE,MAAMO,SAAS,GAAGT,KAAK,CAAC,EAAEC,KAAK,CAAC,CAAC;IACjC,KAAK,MAAMM,OAAOV,QAAS;QACzB,IAAI,CAACU,IAAIG,UAAU,CAACD,SAAS;QAC7B,MAAME,QAAQJ,IAAII,KAAK,CAAC;QAExB,IAAIA,MAAMC,MAAM,KAAK,GAAG;YACtBC,QAAQC,IAAI,CAAC,CAAC,sEAAsE,EAAEP,KAAK;YAC3F;QACF;QAEA,MAAM,KAAKQ,KAAKC,IAAI,GAAGL;QACvB,IAAI,CAACK,KAAK;YACRH,QAAQC,IAAI,CAAC,CAAC,sEAAsE,EAAEP,KAAK;YAC3F;QACF;QAEA,IAAIQ,KAAK;YACP,IAAI,CAACT,mBAAmBC,GAAG,IAAIf,GAAGwB,KAAKV,mBAAmBJ,OAAO,GAAG;gBAClEI,mBAAmBC,GAAG,GAAGA;gBACzBD,mBAAmBJ,OAAO,GAAGc;YAC/B;QACF,OAAO;YACL,IAAI,CAACR,sBAAsBD,GAAG,IAAIf,GAAGwB,KAAKR,sBAAsBN,OAAO,GAAG;gBACxEM,sBAAsBD,GAAG,GAAGA;gBAC5BC,sBAAsBN,OAAO,GAAGc;YAClC;QACF;IACF;IAEA,uDAAuD;IACvD,IAAIC;IAEJ,IAAIX,mBAAmBC,GAAG,IAAIC,sBAAsBD,GAAG,EAAE;QACvD,MAAM,EAAEZ,mBAAmB,EAAE,GAAGI;QAEhC,IAAIP,GAAGc,mBAAmBJ,OAAO,EAAEM,sBAAsBN,OAAO,GAAG;YACjEe,cAAcX,mBAAmBC,GAAG;QACtC,OAAO,IAAIf,GAAGgB,sBAAsBN,OAAO,EAAEI,mBAAmBJ,OAAO,GAAG;YACxEe,cAAcT,sBAAsBD,GAAG;QACzC,OAAO;YACL,2CAA2C;YAC3CU,cAActB,sBAAsBW,mBAAmBC,GAAG,GAAGC,sBAAsBD,GAAG;QACxF;IACF,OAAO;QACLU,cAAcX,mBAAmBC,GAAG,IAAIC,sBAAsBD,GAAG,IAAIW;IACvE;IAEA,IAAID,eAAe,CAACb,WAAWe,QAAQ,CAACF,cAAc;QACpDb,WAAWC,IAAI,CAACY;IAClB;IAEA,OAAOb;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"sourcesContent":["// Copyright 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 { gt } from 'semver';\n\nimport type { PluginType } from '../../model';\nimport { getPluginModuleCompoundKey } from '../../model';\nimport type { PluginCompoundKey } from './plugin-indexes';\n\n// When both a registry and non-registry variant exist at the same version,\n// `registryOverVersion: true` prefers the registry variant.\nexport interface PluginLookupPrecedenceLogic {\n registryOverVersion: boolean;\n}\n\nconst PLUGIN_LOOKUP_PRECEDENCE_LOGIC: PluginLookupPrecedenceLogic = { registryOverVersion: false };\n\n/**\n * Returns an ordered list of candidate 4-part keys to try when resolving a plugin.\n * If version/registry are specified, the exact-match key comes first.\n * The best fallback key (highest version, tie-broken by precedence policy) follows.\n */\nexport const resolvePluginKeys = <T extends PluginType>(\n allKeys: Iterable<string>,\n query: PluginCompoundKey<T>,\n precedenceLogic: PluginLookupPrecedenceLogic = PLUGIN_LOOKUP_PRECEDENCE_LOGIC,\n): string[] => {\n const { kind, name, version, registry } = query;\n const candidates: string[] = [];\n\n // Exact match first when version or registry is specified\n if (version || registry) {\n candidates.push(getPluginModuleCompoundKey({ kind, name, registry, version }));\n }\n\n // Find the best fallback by scanning all matching keys\n type PluginBucket = { key: string; version: string };\n const latestWithRegistry: PluginBucket = { key: '', version: '' };\n const latestWithoutRegistry: PluginBucket = { key: '', version: '' };\n\n const prefix = `${kind}:${name}:`;\n for (const key of allKeys) {\n if (!key.startsWith(prefix)) continue;\n const split = key.split(':');\n\n if (split.length !== 4) {\n console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);\n continue;\n }\n\n const [, , reg, ver] = split;\n if (!ver) {\n console.warn(`An invalid Plugin Resource key detected during default plugin lookup: ${key}`);\n continue;\n }\n\n if (reg) {\n if (!latestWithRegistry.key || gt(ver, latestWithRegistry.version)) {\n latestWithRegistry.key = key;\n latestWithRegistry.version = ver;\n }\n } else {\n if (!latestWithoutRegistry.key || gt(ver, latestWithoutRegistry.version)) {\n latestWithoutRegistry.key = key;\n latestWithoutRegistry.version = ver;\n }\n }\n }\n\n // Determine the best fallback key from the two buckets\n let fallbackKey: string | undefined;\n\n if (latestWithRegistry.key && latestWithoutRegistry.key) {\n const { registryOverVersion } = precedenceLogic;\n\n if (gt(latestWithRegistry.version, latestWithoutRegistry.version)) {\n fallbackKey = latestWithRegistry.key;\n } else if (gt(latestWithoutRegistry.version, latestWithRegistry.version)) {\n fallbackKey = latestWithoutRegistry.key;\n } else {\n // Versions are equal — use the tie-breaker\n fallbackKey = registryOverVersion ? latestWithRegistry.key : latestWithoutRegistry.key;\n }\n } else {\n fallbackKey = latestWithRegistry.key || latestWithoutRegistry.key || undefined;\n }\n\n if (fallbackKey && !candidates.includes(fallbackKey)) {\n candidates.push(fallbackKey);\n }\n\n return candidates;\n};\n"],"names":["gt","getPluginModuleCompoundKey","PLUGIN_LOOKUP_PRECEDENCE_LOGIC","registryOverVersion","resolvePluginKeys","allKeys","query","precedenceLogic","kind","name","version","registry","candidates","push","latestWithRegistry","key","latestWithoutRegistry","prefix","startsWith","split","length","console","warn","reg","ver","fallbackKey","undefined","includes"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,EAAE,QAAQ,SAAS;AAG5B,SAASC,0BAA0B,QAAQ,uBAAc;AASzD,MAAMC,iCAA8D;IAAEC,qBAAqB;AAAM;AAEjG;;;;CAIC,GACD,OAAO,MAAMC,oBAAoB,CAC/BC,SACAC,OACAC,kBAA+CL,8BAA8B;IAE7E,MAAM,EAAEM,IAAI,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGL;IAC1C,MAAMM,aAAuB,EAAE;IAE/B,0DAA0D;IAC1D,IAAIF,WAAWC,UAAU;QACvBC,WAAWC,IAAI,CAACZ,2BAA2B;YAAEO;YAAMC;YAAME;YAAUD;QAAQ;IAC7E;IAIA,MAAMI,qBAAmC;QAAEC,KAAK;QAAIL,SAAS;IAAG;IAChE,MAAMM,wBAAsC;QAAED,KAAK;QAAIL,SAAS;IAAG;IAEnE,MAAMO,SAAS,GAAGT,KAAK,CAAC,EAAEC,KAAK,CAAC,CAAC;IACjC,KAAK,MAAMM,OAAOV,QAAS;QACzB,IAAI,CAACU,IAAIG,UAAU,CAACD,SAAS;QAC7B,MAAME,QAAQJ,IAAII,KAAK,CAAC;QAExB,IAAIA,MAAMC,MAAM,KAAK,GAAG;YACtBC,QAAQC,IAAI,CAAC,CAAC,sEAAsE,EAAEP,KAAK;YAC3F;QACF;QAEA,MAAM,KAAKQ,KAAKC,IAAI,GAAGL;QACvB,IAAI,CAACK,KAAK;YACRH,QAAQC,IAAI,CAAC,CAAC,sEAAsE,EAAEP,KAAK;YAC3F;QACF;QAEA,IAAIQ,KAAK;YACP,IAAI,CAACT,mBAAmBC,GAAG,IAAIf,GAAGwB,KAAKV,mBAAmBJ,OAAO,GAAG;gBAClEI,mBAAmBC,GAAG,GAAGA;gBACzBD,mBAAmBJ,OAAO,GAAGc;YAC/B;QACF,OAAO;YACL,IAAI,CAACR,sBAAsBD,GAAG,IAAIf,GAAGwB,KAAKR,sBAAsBN,OAAO,GAAG;gBACxEM,sBAAsBD,GAAG,GAAGA;gBAC5BC,sBAAsBN,OAAO,GAAGc;YAClC;QACF;IACF;IAEA,uDAAuD;IACvD,IAAIC;IAEJ,IAAIX,mBAAmBC,GAAG,IAAIC,sBAAsBD,GAAG,EAAE;QACvD,MAAM,EAAEZ,mBAAmB,EAAE,GAAGI;QAEhC,IAAIP,GAAGc,mBAAmBJ,OAAO,EAAEM,sBAAsBN,OAAO,GAAG;YACjEe,cAAcX,mBAAmBC,GAAG;QACtC,OAAO,IAAIf,GAAGgB,sBAAsBN,OAAO,EAAEI,mBAAmBJ,OAAO,GAAG;YACxEe,cAAcT,sBAAsBD,GAAG;QACzC,OAAO;YACL,2CAA2C;YAC3CU,cAActB,sBAAsBW,mBAAmBC,GAAG,GAAGC,sBAAsBD,GAAG;QACxF;IACF,OAAO;QACLU,cAAcX,mBAAmBC,GAAG,IAAIC,sBAAsBD,GAAG,IAAIW;IACvE;IAEA,IAAID,eAAe,CAACb,WAAWe,QAAQ,CAACF,cAAc;QACpDb,WAAWC,IAAI,CAACY;IAClB;IAEA,OAAOb;AACT,EAAE"}
@@ -10,6 +10,6 @@
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 * from './PluginRegistry';
13
+ export * from "./PluginRegistry.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginRegistry/index.ts"],"sourcesContent":["// Copyright 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 './PluginRegistry';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB"}
1
+ {"version":3,"sources":["../../../src/components/PluginRegistry/index.ts"],"sourcesContent":["// Copyright 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 './PluginRegistry';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAmB"}
@@ -1,9 +1,11 @@
1
- import { PluginLoader, PluginMetadataWithModule, PluginModuleResource, PluginType, PluginCompoundKey, getPluginModuleCompoundKey } from '../../model';
1
+ import type { PluginLoader, PluginMetadataWithModule, PluginModuleResource, PluginType, PluginCompoundKey } from '../../model';
2
+ import { getPluginModuleCompoundKey } from '../../model';
2
3
  export type { PluginCompoundKey };
3
4
  export { getPluginModuleCompoundKey };
4
5
  export interface PluginIndexes {
5
6
  pluginResourcesByNameKindRegistryVersion: Map<string, PluginModuleResource>;
6
7
  pluginMetadataByKind: Map<PluginType, PluginMetadataWithModule[]>;
8
+ devPluginKeys: Set<string>;
7
9
  }
8
10
  /**
9
11
  * Returns an async callback for getting indexes of the installed plugin data.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-indexes.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/plugin-indexes.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,MAAM,WAAW,aAAa;IAE5B,wCAAwC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAE5E,oBAAoB,EAAE,GAAG,CAAC,UAAU,EAAE,wBAAwB,EAAE,CAAC,CAAC;CACnE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,mBAAmB,EAAE,YAAY,CAAC,qBAAqB,CAAC,GACvD,MAAM,OAAO,CAAC,aAAa,CAAC,CA2D9B"}
1
+ {"version":3,"file":"plugin-indexes.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/plugin-indexes.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,MAAM,WAAW,aAAa;IAE5B,wCAAwC,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAE5E,oBAAoB,EAAE,GAAG,CAAC,UAAU,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAElE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,mBAAmB,EAAE,YAAY,CAAC,qBAAqB,CAAC,GACvD,MAAM,OAAO,CAAC,aAAa,CAAC,CAgE9B"}
@@ -10,9 +10,9 @@
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
- import { useCallback, useRef } from 'react';
14
- import { getPluginModuleCompoundKey } from '../../model';
15
- import { useEvent } from '../../utils';
13
+ import { useCallback, useRef } from "react";
14
+ import { getPluginModuleCompoundKey } from "../../model/index.js";
15
+ import { useEvent } from "../../utils/index.js";
16
16
  export { getPluginModuleCompoundKey };
17
17
  /**
18
18
  * Returns an async callback for getting indexes of the installed plugin data.
@@ -24,6 +24,7 @@ export { getPluginModuleCompoundKey };
24
24
  // Create the two indexes from the installed plugins
25
25
  const pluginResourcesByNameKindRegistryVersion = new Map();
26
26
  const pluginMetadataByKind = new Map();
27
+ const devPluginKeys = new Set();
27
28
  for (const resource of installedPlugins){
28
29
  const { metadata: { version, registry } } = resource;
29
30
  for (const pluginMetadata of resource.spec.plugins){
@@ -38,6 +39,9 @@ export { getPluginModuleCompoundKey };
38
39
  console.warn(`Got more than one ${kind} plugin for kind ${name}, registry '${registry || 'undefined'}', and version '${version || 'undefined'}'`);
39
40
  }
40
41
  pluginResourcesByNameKindRegistryVersion.set(key, resource);
42
+ if (resource.status?.inDev) {
43
+ devPluginKeys.add(key);
44
+ }
41
45
  // Index the metadata by plugin type
42
46
  let list = pluginMetadataByKind.get(kind);
43
47
  if (list === undefined) {
@@ -52,7 +56,8 @@ export { getPluginModuleCompoundKey };
52
56
  }
53
57
  return {
54
58
  pluginResourcesByNameKindRegistryVersion,
55
- pluginMetadataByKind
59
+ pluginMetadataByKind,
60
+ devPluginKeys
56
61
  };
57
62
  });
58
63
  // De-dupe creating plugin indexes (i.e. requests to get installed plugins)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginRegistry/plugin-indexes.ts"],"sourcesContent":["// Copyright 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 { useCallback, useRef } from 'react';\nimport {\n PluginLoader,\n PluginMetadataWithModule,\n PluginModuleResource,\n PluginType,\n PluginCompoundKey,\n getPluginModuleCompoundKey,\n} from '../../model';\nimport { useEvent } from '../../utils';\n\nexport type { PluginCompoundKey };\nexport { getPluginModuleCompoundKey };\n\nexport interface PluginIndexes {\n // Plugin resources by plugin type, kind, registry, and version\n pluginResourcesByNameKindRegistryVersion: Map<string, PluginModuleResource>;\n // Plugin metadata by plugin type\n pluginMetadataByKind: Map<PluginType, PluginMetadataWithModule[]>;\n}\n\n/**\n * Returns an async callback for getting indexes of the installed plugin data.\n */\nexport function usePluginIndexes(\n getInstalledPlugins: PluginLoader['getInstalledPlugins']\n): () => Promise<PluginIndexes> {\n // Creates indexes from the installed plugins data (does useEvent because this accesses the getInstalledPlugins prop\n // and we want a stable reference for the callback below)\n const createPluginIndexes = useEvent(async (): Promise<PluginIndexes> => {\n const installedPlugins = await getInstalledPlugins();\n\n // Create the two indexes from the installed plugins\n const pluginResourcesByNameKindRegistryVersion = new Map<string, PluginModuleResource>();\n const pluginMetadataByKind = new Map<PluginType, PluginMetadataWithModule[]>();\n\n for (const resource of installedPlugins) {\n const {\n metadata: { version, registry },\n } = resource;\n for (const pluginMetadata of resource.spec.plugins) {\n const {\n kind,\n spec: { name },\n } = pluginMetadata;\n\n const key = getPluginModuleCompoundKey({ kind, name, registry, version });\n if (pluginResourcesByNameKindRegistryVersion.has(key)) {\n console.warn(\n `Got more than one ${kind} plugin for kind ${name}, registry '${registry || 'undefined'}', and version '${version || 'undefined'}'`\n );\n }\n pluginResourcesByNameKindRegistryVersion.set(key, resource);\n\n // Index the metadata by plugin type\n let list = pluginMetadataByKind.get(kind);\n if (list === undefined) {\n list = [];\n pluginMetadataByKind.set(kind, list);\n }\n list.push({ ...pluginMetadata, module: resource.metadata });\n }\n }\n\n return {\n pluginResourcesByNameKindRegistryVersion,\n pluginMetadataByKind,\n };\n });\n\n // De-dupe creating plugin indexes (i.e. requests to get installed plugins)\n const pluginIndexesCache = useRef<Promise<PluginIndexes> | undefined>(undefined);\n const getPluginIndexes = useCallback(() => {\n let request = pluginIndexesCache.current;\n if (request === undefined) {\n request = createPluginIndexes();\n pluginIndexesCache.current = request;\n\n // Remove failed requests from the cache so they can potentially be retried\n request.catch(() => (pluginIndexesCache.current = undefined));\n }\n return request;\n }, [createPluginIndexes]);\n\n return getPluginIndexes;\n}\n"],"names":["useCallback","useRef","getPluginModuleCompoundKey","useEvent","usePluginIndexes","getInstalledPlugins","createPluginIndexes","installedPlugins","pluginResourcesByNameKindRegistryVersion","Map","pluginMetadataByKind","resource","metadata","version","registry","pluginMetadata","spec","plugins","kind","name","key","has","console","warn","set","list","get","undefined","push","module","pluginIndexesCache","getPluginIndexes","request","current","catch"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AAC5C,SAMEC,0BAA0B,QACrB,cAAc;AACrB,SAASC,QAAQ,QAAQ,cAAc;AAGvC,SAASD,0BAA0B,GAAG;AAStC;;CAEC,GACD,OAAO,SAASE,iBACdC,mBAAwD;IAExD,oHAAoH;IACpH,yDAAyD;IACzD,MAAMC,sBAAsBH,SAAS;QACnC,MAAMI,mBAAmB,MAAMF;QAE/B,oDAAoD;QACpD,MAAMG,2CAA2C,IAAIC;QACrD,MAAMC,uBAAuB,IAAID;QAEjC,KAAK,MAAME,YAAYJ,iBAAkB;YACvC,MAAM,EACJK,UAAU,EAAEC,OAAO,EAAEC,QAAQ,EAAE,EAChC,GAAGH;YACJ,KAAK,MAAMI,kBAAkBJ,SAASK,IAAI,CAACC,OAAO,CAAE;gBAClD,MAAM,EACJC,IAAI,EACJF,MAAM,EAAEG,IAAI,EAAE,EACf,GAAGJ;gBAEJ,MAAMK,MAAMlB,2BAA2B;oBAAEgB;oBAAMC;oBAAML;oBAAUD;gBAAQ;gBACvE,IAAIL,yCAAyCa,GAAG,CAACD,MAAM;oBACrDE,QAAQC,IAAI,CACV,CAAC,kBAAkB,EAAEL,KAAK,iBAAiB,EAAEC,KAAK,YAAY,EAAEL,YAAY,YAAY,gBAAgB,EAAED,WAAW,YAAY,CAAC,CAAC;gBAEvI;gBACAL,yCAAyCgB,GAAG,CAACJ,KAAKT;gBAElD,oCAAoC;gBACpC,IAAIc,OAAOf,qBAAqBgB,GAAG,CAACR;gBACpC,IAAIO,SAASE,WAAW;oBACtBF,OAAO,EAAE;oBACTf,qBAAqBc,GAAG,CAACN,MAAMO;gBACjC;gBACAA,KAAKG,IAAI,CAAC;oBAAE,GAAGb,cAAc;oBAAEc,QAAQlB,SAASC,QAAQ;gBAAC;YAC3D;QACF;QAEA,OAAO;YACLJ;YACAE;QACF;IACF;IAEA,2EAA2E;IAC3E,MAAMoB,qBAAqB7B,OAA2C0B;IACtE,MAAMI,mBAAmB/B,YAAY;QACnC,IAAIgC,UAAUF,mBAAmBG,OAAO;QACxC,IAAID,YAAYL,WAAW;YACzBK,UAAU1B;YACVwB,mBAAmBG,OAAO,GAAGD;YAE7B,2EAA2E;YAC3EA,QAAQE,KAAK,CAAC,IAAOJ,mBAAmBG,OAAO,GAAGN;QACpD;QACA,OAAOK;IACT,GAAG;QAAC1B;KAAoB;IAExB,OAAOyB;AACT"}
1
+ {"version":3,"sources":["../../../src/components/PluginRegistry/plugin-indexes.ts"],"sourcesContent":["// Copyright 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 { useCallback, useRef } from 'react';\n\nimport type {\n PluginLoader,\n PluginMetadataWithModule,\n PluginModuleResource,\n PluginType,\n PluginCompoundKey,\n} from '../../model';\nimport { getPluginModuleCompoundKey } from '../../model';\nimport { useEvent } from '../../utils';\n\nexport type { PluginCompoundKey };\nexport { getPluginModuleCompoundKey };\n\nexport interface PluginIndexes {\n // Plugin resources by plugin type, kind, registry, and version\n pluginResourcesByNameKindRegistryVersion: Map<string, PluginModuleResource>;\n // Plugin metadata by plugin type\n pluginMetadataByKind: Map<PluginType, PluginMetadataWithModule[]>;\n // Subset of the keys above that are served by a local dev server (`percli plugin start`)\n devPluginKeys: Set<string>;\n}\n\n/**\n * Returns an async callback for getting indexes of the installed plugin data.\n */\nexport function usePluginIndexes(\n getInstalledPlugins: PluginLoader['getInstalledPlugins'],\n): () => Promise<PluginIndexes> {\n // Creates indexes from the installed plugins data (does useEvent because this accesses the getInstalledPlugins prop\n // and we want a stable reference for the callback below)\n const createPluginIndexes = useEvent(async (): Promise<PluginIndexes> => {\n const installedPlugins = await getInstalledPlugins();\n\n // Create the two indexes from the installed plugins\n const pluginResourcesByNameKindRegistryVersion = new Map<string, PluginModuleResource>();\n const pluginMetadataByKind = new Map<PluginType, PluginMetadataWithModule[]>();\n const devPluginKeys = new Set<string>();\n\n for (const resource of installedPlugins) {\n const {\n metadata: { version, registry },\n } = resource;\n for (const pluginMetadata of resource.spec.plugins) {\n const {\n kind,\n spec: { name },\n } = pluginMetadata;\n\n const key = getPluginModuleCompoundKey({ kind, name, registry, version });\n if (pluginResourcesByNameKindRegistryVersion.has(key)) {\n console.warn(\n `Got more than one ${kind} plugin for kind ${name}, registry '${registry || 'undefined'}', and version '${version || 'undefined'}'`,\n );\n }\n pluginResourcesByNameKindRegistryVersion.set(key, resource);\n if (resource.status?.inDev) {\n devPluginKeys.add(key);\n }\n\n // Index the metadata by plugin type\n let list = pluginMetadataByKind.get(kind);\n if (list === undefined) {\n list = [];\n pluginMetadataByKind.set(kind, list);\n }\n list.push({ ...pluginMetadata, module: resource.metadata });\n }\n }\n\n return {\n pluginResourcesByNameKindRegistryVersion,\n pluginMetadataByKind,\n devPluginKeys,\n };\n });\n\n // De-dupe creating plugin indexes (i.e. requests to get installed plugins)\n const pluginIndexesCache = useRef<Promise<PluginIndexes> | undefined>(undefined);\n const getPluginIndexes = useCallback(() => {\n let request = pluginIndexesCache.current;\n if (request === undefined) {\n request = createPluginIndexes();\n pluginIndexesCache.current = request;\n\n // Remove failed requests from the cache so they can potentially be retried\n request.catch(() => (pluginIndexesCache.current = undefined));\n }\n return request;\n }, [createPluginIndexes]);\n\n return getPluginIndexes;\n}\n"],"names":["useCallback","useRef","getPluginModuleCompoundKey","useEvent","usePluginIndexes","getInstalledPlugins","createPluginIndexes","installedPlugins","pluginResourcesByNameKindRegistryVersion","Map","pluginMetadataByKind","devPluginKeys","Set","resource","metadata","version","registry","pluginMetadata","spec","plugins","kind","name","key","has","console","warn","set","status","inDev","add","list","get","undefined","push","module","pluginIndexesCache","getPluginIndexes","request","current","catch"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,MAAM,QAAQ,QAAQ;AAS5C,SAASC,0BAA0B,QAAQ,uBAAc;AACzD,SAASC,QAAQ,QAAQ,uBAAc;AAGvC,SAASD,0BAA0B,GAAG;AAWtC;;CAEC,GACD,OAAO,SAASE,iBACdC,mBAAwD;IAExD,oHAAoH;IACpH,yDAAyD;IACzD,MAAMC,sBAAsBH,SAAS;QACnC,MAAMI,mBAAmB,MAAMF;QAE/B,oDAAoD;QACpD,MAAMG,2CAA2C,IAAIC;QACrD,MAAMC,uBAAuB,IAAID;QACjC,MAAME,gBAAgB,IAAIC;QAE1B,KAAK,MAAMC,YAAYN,iBAAkB;YACvC,MAAM,EACJO,UAAU,EAAEC,OAAO,EAAEC,QAAQ,EAAE,EAChC,GAAGH;YACJ,KAAK,MAAMI,kBAAkBJ,SAASK,IAAI,CAACC,OAAO,CAAE;gBAClD,MAAM,EACJC,IAAI,EACJF,MAAM,EAAEG,IAAI,EAAE,EACf,GAAGJ;gBAEJ,MAAMK,MAAMpB,2BAA2B;oBAAEkB;oBAAMC;oBAAML;oBAAUD;gBAAQ;gBACvE,IAAIP,yCAAyCe,GAAG,CAACD,MAAM;oBACrDE,QAAQC,IAAI,CACV,CAAC,kBAAkB,EAAEL,KAAK,iBAAiB,EAAEC,KAAK,YAAY,EAAEL,YAAY,YAAY,gBAAgB,EAAED,WAAW,YAAY,CAAC,CAAC;gBAEvI;gBACAP,yCAAyCkB,GAAG,CAACJ,KAAKT;gBAClD,IAAIA,SAASc,MAAM,EAAEC,OAAO;oBAC1BjB,cAAckB,GAAG,CAACP;gBACpB;gBAEA,oCAAoC;gBACpC,IAAIQ,OAAOpB,qBAAqBqB,GAAG,CAACX;gBACpC,IAAIU,SAASE,WAAW;oBACtBF,OAAO,EAAE;oBACTpB,qBAAqBgB,GAAG,CAACN,MAAMU;gBACjC;gBACAA,KAAKG,IAAI,CAAC;oBAAE,GAAGhB,cAAc;oBAAEiB,QAAQrB,SAASC,QAAQ;gBAAC;YAC3D;QACF;QAEA,OAAO;YACLN;YACAE;YACAC;QACF;IACF;IAEA,2EAA2E;IAC3E,MAAMwB,qBAAqBlC,OAA2C+B;IACtE,MAAMI,mBAAmBpC,YAAY;QACnC,IAAIqC,UAAUF,mBAAmBG,OAAO;QACxC,IAAID,YAAYL,WAAW;YACzBK,UAAU/B;YACV6B,mBAAmBG,OAAO,GAAGD;YAE7B,2EAA2E;YAC3EA,QAAQE,KAAK,CAAC,IAAOJ,mBAAmBG,OAAO,GAAGN;QACpD;QACA,OAAOK;IACT,GAAG;QAAC/B;KAAoB;IAExB,OAAO8B;AACT"}
@@ -0,0 +1,10 @@
1
+ import type { DatasourceSpec, UnknownSpec } from '@perses-dev/spec';
2
+ import type { ReactElement } from 'react';
3
+ import type { DatasourcePlugin, OptionsEditorProps } from '../../model';
4
+ export interface DatasourceSpecEditorProps extends OptionsEditorProps<UnknownSpec> {
5
+ plugin: DatasourcePlugin;
6
+ pluginKind: string;
7
+ testConnection?: (spec: DatasourceSpec, healthCheckPath: string) => Promise<void>;
8
+ }
9
+ export declare function DatasourceSpecEditor({ plugin, pluginKind, value, testConnection, ...others }: DatasourceSpecEditorProps): ReactElement | null;
10
+ //# sourceMappingURL=DatasourceSpecEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DatasourceSpecEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PluginSpecEditor/DatasourceSpecEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExE,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB,CAAC,WAAW,CAAC;IAChF,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF;AAMD,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,UAAU,EACV,KAAK,EACL,cAAc,EACd,GAAG,MAAM,EACV,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAyBjD"}
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { hasHTTPProxy } from "@perses-dev/client";
15
+ import { produce } from "immer";
16
+ import { useMemo } from "react";
17
+ function escapeRegExp(str) {
18
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
19
+ }
20
+ export function DatasourceSpecEditor({ plugin, pluginKind, value, testConnection, ...others }) {
21
+ const healthCheckPath = plugin.healthCheckPath;
22
+ const boundTestConnection = useMemo(()=>{
23
+ if (!testConnection || !healthCheckPath) return undefined;
24
+ return ()=>{
25
+ const escapedPattern = escapeRegExp(healthCheckPath);
26
+ const augmentedPluginSpec = hasHTTPProxy(value) ? produce(value, (draft)=>{
27
+ const existing = draft.proxy.spec.allowedEndpoints ?? [];
28
+ const alreadyAllowed = existing.some((e)=>e.endpointPattern === escapedPattern && e.method === 'GET');
29
+ if (!alreadyAllowed) {
30
+ draft.proxy.spec.allowedEndpoints = [
31
+ ...existing,
32
+ {
33
+ endpointPattern: escapedPattern,
34
+ method: 'GET'
35
+ }
36
+ ];
37
+ }
38
+ }) : value;
39
+ const spec = {
40
+ default: false,
41
+ plugin: {
42
+ kind: pluginKind,
43
+ spec: augmentedPluginSpec
44
+ }
45
+ };
46
+ return testConnection(spec, healthCheckPath);
47
+ };
48
+ }, [
49
+ testConnection,
50
+ healthCheckPath,
51
+ pluginKind,
52
+ value
53
+ ]);
54
+ const { OptionsEditorComponent } = plugin;
55
+ return OptionsEditorComponent ? /*#__PURE__*/ _jsx(OptionsEditorComponent, {
56
+ ...others,
57
+ value: value,
58
+ testConnection: boundTestConnection
59
+ }) : null;
60
+ }
61
+
62
+ //# sourceMappingURL=DatasourceSpecEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/PluginSpecEditor/DatasourceSpecEditor.tsx"],"sourcesContent":["// Copyright 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 { hasHTTPProxy } from '@perses-dev/client';\nimport type { DatasourceSpec, UnknownSpec } from '@perses-dev/spec';\nimport { produce } from 'immer';\nimport type { ReactElement } from 'react';\nimport { useMemo } from 'react';\n\nimport type { DatasourcePlugin, OptionsEditorProps } from '../../model';\n\nexport interface DatasourceSpecEditorProps extends OptionsEditorProps<UnknownSpec> {\n plugin: DatasourcePlugin;\n pluginKind: string;\n testConnection?: (spec: DatasourceSpec, healthCheckPath: string) => Promise<void>;\n}\n\nfunction escapeRegExp(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nexport function DatasourceSpecEditor({\n plugin,\n pluginKind,\n value,\n testConnection,\n ...others\n}: DatasourceSpecEditorProps): ReactElement | null {\n const healthCheckPath = plugin.healthCheckPath;\n\n const boundTestConnection = useMemo((): (() => Promise<void>) | undefined => {\n if (!testConnection || !healthCheckPath) return undefined;\n return () => {\n const escapedPattern = escapeRegExp(healthCheckPath);\n const augmentedPluginSpec = hasHTTPProxy(value)\n ? produce(value, (draft) => {\n const existing = draft.proxy.spec.allowedEndpoints ?? [];\n const alreadyAllowed = existing.some((e) => e.endpointPattern === escapedPattern && e.method === 'GET');\n if (!alreadyAllowed) {\n draft.proxy.spec.allowedEndpoints = [...existing, { endpointPattern: escapedPattern, method: 'GET' }];\n }\n })\n : value;\n const spec: DatasourceSpec = { default: false, plugin: { kind: pluginKind, spec: augmentedPluginSpec } };\n return testConnection(spec, healthCheckPath);\n };\n }, [testConnection, healthCheckPath, pluginKind, value]);\n\n const { OptionsEditorComponent } = plugin;\n return OptionsEditorComponent ? (\n <OptionsEditorComponent {...others} value={value} testConnection={boundTestConnection} />\n ) : null;\n}\n"],"names":["hasHTTPProxy","produce","useMemo","escapeRegExp","str","replace","DatasourceSpecEditor","plugin","pluginKind","value","testConnection","others","healthCheckPath","boundTestConnection","undefined","escapedPattern","augmentedPluginSpec","draft","existing","proxy","spec","allowedEndpoints","alreadyAllowed","some","e","endpointPattern","method","default","kind","OptionsEditorComponent"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,YAAY,QAAQ,qBAAqB;AAElD,SAASC,OAAO,QAAQ,QAAQ;AAEhC,SAASC,OAAO,QAAQ,QAAQ;AAUhC,SAASC,aAAaC,GAAW;IAC/B,OAAOA,IAAIC,OAAO,CAAC,uBAAuB;AAC5C;AAEA,OAAO,SAASC,qBAAqB,EACnCC,MAAM,EACNC,UAAU,EACVC,KAAK,EACLC,cAAc,EACd,GAAGC,QACuB;IAC1B,MAAMC,kBAAkBL,OAAOK,eAAe;IAE9C,MAAMC,sBAAsBX,QAAQ;QAClC,IAAI,CAACQ,kBAAkB,CAACE,iBAAiB,OAAOE;QAChD,OAAO;YACL,MAAMC,iBAAiBZ,aAAaS;YACpC,MAAMI,sBAAsBhB,aAAaS,SACrCR,QAAQQ,OAAO,CAACQ;gBACd,MAAMC,WAAWD,MAAME,KAAK,CAACC,IAAI,CAACC,gBAAgB,IAAI,EAAE;gBACxD,MAAMC,iBAAiBJ,SAASK,IAAI,CAAC,CAACC,IAAMA,EAAEC,eAAe,KAAKV,kBAAkBS,EAAEE,MAAM,KAAK;gBACjG,IAAI,CAACJ,gBAAgB;oBACnBL,MAAME,KAAK,CAACC,IAAI,CAACC,gBAAgB,GAAG;2BAAIH;wBAAU;4BAAEO,iBAAiBV;4BAAgBW,QAAQ;wBAAM;qBAAE;gBACvG;YACF,KACAjB;YACJ,MAAMW,OAAuB;gBAAEO,SAAS;gBAAOpB,QAAQ;oBAAEqB,MAAMpB;oBAAYY,MAAMJ;gBAAoB;YAAE;YACvG,OAAON,eAAeU,MAAMR;QAC9B;IACF,GAAG;QAACF;QAAgBE;QAAiBJ;QAAYC;KAAM;IAEvD,MAAM,EAAEoB,sBAAsB,EAAE,GAAGtB;IACnC,OAAOsB,uCACL,KAACA;QAAwB,GAAGlB,MAAM;QAAEF,OAAOA;QAAOC,gBAAgBG;SAChE;AACN"}
@@ -1,10 +1,11 @@
1
- import { UnknownSpec } from '@perses-dev/spec';
2
- import { ReactElement } from 'react';
3
- import { OptionsEditorProps } from '../../model';
4
- import { PluginEditorSelection } from '../PluginEditor';
1
+ import type { DatasourceSpec, UnknownSpec } from '@perses-dev/spec';
2
+ import type { ReactElement } from 'react';
3
+ import type { OptionsEditorProps } from '../../model';
4
+ import type { PluginEditorSelection } from '../PluginEditor';
5
5
  export interface PluginSpecEditorProps extends OptionsEditorProps<UnknownSpec> {
6
6
  pluginSelection: PluginEditorSelection;
7
7
  isEditor?: boolean;
8
+ testConnection?: (spec: DatasourceSpec, healthCheckPath: string) => Promise<void>;
8
9
  }
9
10
  export declare function PluginSpecEditor(props: PluginSpecEditorProps): ReactElement | null;
10
11
  //# sourceMappingURL=PluginSpecEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginSpecEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PluginSpecEditor/PluginSpecEditor.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB,CAAC,WAAW,CAAC;IAC5E,eAAe,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CA4BlF"}
1
+ {"version":3,"file":"PluginSpecEditor.d.ts","sourceRoot":"","sources":["../../../src/components/PluginSpecEditor/PluginSpecEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAoB,kBAAkB,EAAsB,MAAM,aAAa,CAAC;AAE5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB,CAAC,WAAW,CAAC;IAC5E,eAAe,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnF;AASD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,GAAG,IAAI,CAmDlF"}
@@ -11,12 +11,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { ErrorAlert } from '@perses-dev/components';
15
- import { CircularProgress, Stack } from '@mui/material';
16
- import { usePlugin } from '../../runtime';
14
+ import { CircularProgress, Stack } from "@mui/material";
15
+ import { ErrorAlert } from "@perses-dev/components";
16
+ import { usePlugin } from "../../runtime/index.js";
17
+ import { DatasourceSpecEditor } from "./DatasourceSpecEditor.js";
18
+ function isDatasourcePlugin(pluginType, plugin) {
19
+ return pluginType === 'Datasource' && 'createClient' in plugin;
20
+ }
17
21
  export function PluginSpecEditor(props) {
18
- const { pluginSelection: { type: pluginType, kind: pluginKind }, ...others } = props;
19
- const { data: plugin, isLoading, error } = usePlugin(pluginType, pluginKind);
22
+ const { pluginSelection: { type: pluginType, kind: pluginKind, metadata: pluginMetadata }, value, testConnection, ...others } = props;
23
+ // Edit the exact implementation the definition is pinned to, so the options editor matches the saved spec schema.
24
+ const { data: plugin, isLoading, error } = usePlugin(pluginType, pluginKind, {
25
+ version: pluginMetadata?.version,
26
+ registry: pluginMetadata?.registry
27
+ });
20
28
  if (error) {
21
29
  return /*#__PURE__*/ _jsx(ErrorAlert, {
22
30
  error: error
@@ -38,9 +46,19 @@ export function PluginSpecEditor(props) {
38
46
  if (pluginType === 'Panel') {
39
47
  throw new Error('This editor should not be used for panel type. Please use Panel Spec Editor instead.');
40
48
  }
49
+ if (isDatasourcePlugin(pluginType, plugin)) {
50
+ return /*#__PURE__*/ _jsx(DatasourceSpecEditor, {
51
+ plugin: plugin,
52
+ pluginKind: pluginKind,
53
+ value: value,
54
+ testConnection: testConnection,
55
+ ...others
56
+ });
57
+ }
41
58
  const { OptionsEditorComponent } = plugin;
42
59
  return OptionsEditorComponent ? /*#__PURE__*/ _jsx(OptionsEditorComponent, {
43
- ...others
60
+ ...others,
61
+ value: value
44
62
  }) : null;
45
63
  }
46
64
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginSpecEditor/PluginSpecEditor.tsx"],"sourcesContent":["// Copyright 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 { ErrorAlert } from '@perses-dev/components';\nimport { UnknownSpec } from '@perses-dev/spec';\nimport { ReactElement } from 'react';\nimport { CircularProgress, Stack } from '@mui/material';\nimport { OptionsEditorProps } from '../../model';\nimport { usePlugin } from '../../runtime';\nimport { PluginEditorSelection } from '../PluginEditor';\n\nexport interface PluginSpecEditorProps extends OptionsEditorProps<UnknownSpec> {\n pluginSelection: PluginEditorSelection;\n isEditor?: boolean;\n}\n\nexport function PluginSpecEditor(props: PluginSpecEditorProps): ReactElement | null {\n const {\n pluginSelection: { type: pluginType, kind: pluginKind },\n ...others\n } = props;\n const { data: plugin, isLoading, error } = usePlugin(pluginType, pluginKind);\n if (error) {\n return <ErrorAlert error={error} />;\n }\n\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n }\n\n if (!plugin) {\n throw new Error(`Missing implementation for ${pluginType} plugin with kind '${pluginKind}'`);\n }\n\n if (pluginType === 'Panel') {\n throw new Error('This editor should not be used for panel type. Please use Panel Spec Editor instead.');\n }\n const { OptionsEditorComponent } = plugin;\n\n return OptionsEditorComponent ? <OptionsEditorComponent {...others} /> : null;\n}\n"],"names":["ErrorAlert","CircularProgress","Stack","usePlugin","PluginSpecEditor","props","pluginSelection","type","pluginType","kind","pluginKind","others","data","plugin","isLoading","error","width","sx","alignItems","justifyContent","Error","OptionsEditorComponent"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,UAAU,QAAQ,yBAAyB;AAGpD,SAASC,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAExD,SAASC,SAAS,QAAQ,gBAAgB;AAQ1C,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,iBAAiB,EAAEC,MAAMC,UAAU,EAAEC,MAAMC,UAAU,EAAE,EACvD,GAAGC,QACJ,GAAGN;IACJ,MAAM,EAAEO,MAAMC,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGZ,UAAUK,YAAYE;IACjE,IAAIK,OAAO;QACT,qBAAO,KAACf;YAAWe,OAAOA;;IAC5B;IAEA,IAAID,WAAW;QACb,qBACE,KAACZ;YAAMc,OAAM;YAAOC,IAAI;gBAAEC,YAAY;gBAAUC,gBAAgB;YAAS;sBACvE,cAAA,KAAClB;;IAGP;IAEA,IAAI,CAACY,QAAQ;QACX,MAAM,IAAIO,MAAM,CAAC,2BAA2B,EAAEZ,WAAW,mBAAmB,EAAEE,WAAW,CAAC,CAAC;IAC7F;IAEA,IAAIF,eAAe,SAAS;QAC1B,MAAM,IAAIY,MAAM;IAClB;IACA,MAAM,EAAEC,sBAAsB,EAAE,GAAGR;IAEnC,OAAOQ,uCAAyB,KAACA;QAAwB,GAAGV,MAAM;SAAO;AAC3E"}
1
+ {"version":3,"sources":["../../../src/components/PluginSpecEditor/PluginSpecEditor.tsx"],"sourcesContent":["// Copyright 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 { CircularProgress, Stack } from '@mui/material';\nimport { ErrorAlert } from '@perses-dev/components';\nimport type { DatasourceSpec, UnknownSpec } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\n\nimport type { DatasourcePlugin, OptionsEditorProps, Plugin, PluginType } from '../../model';\nimport { usePlugin } from '../../runtime';\nimport type { PluginEditorSelection } from '../PluginEditor';\nimport { DatasourceSpecEditor } from './DatasourceSpecEditor';\n\nexport interface PluginSpecEditorProps extends OptionsEditorProps<UnknownSpec> {\n pluginSelection: PluginEditorSelection;\n isEditor?: boolean;\n testConnection?: (spec: DatasourceSpec, healthCheckPath: string) => Promise<void>;\n}\n\nfunction isDatasourcePlugin(\n pluginType: PluginType,\n plugin: Plugin<UnknownSpec>,\n): plugin is DatasourcePlugin<UnknownSpec> {\n return pluginType === 'Datasource' && 'createClient' in plugin;\n}\n\nexport function PluginSpecEditor(props: PluginSpecEditorProps): ReactElement | null {\n const {\n pluginSelection: { type: pluginType, kind: pluginKind, metadata: pluginMetadata },\n value,\n testConnection,\n ...others\n } = props;\n // Edit the exact implementation the definition is pinned to, so the options editor matches the saved spec schema.\n const {\n data: plugin,\n isLoading,\n error,\n } = usePlugin(pluginType, pluginKind, {\n version: pluginMetadata?.version,\n registry: pluginMetadata?.registry,\n });\n\n if (error) {\n return <ErrorAlert error={error} />;\n }\n\n if (isLoading) {\n return (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n );\n }\n\n if (!plugin) {\n throw new Error(`Missing implementation for ${pluginType} plugin with kind '${pluginKind}'`);\n }\n\n if (pluginType === 'Panel') {\n throw new Error('This editor should not be used for panel type. Please use Panel Spec Editor instead.');\n }\n\n if (isDatasourcePlugin(pluginType, plugin)) {\n return (\n <DatasourceSpecEditor\n plugin={plugin}\n pluginKind={pluginKind}\n value={value}\n testConnection={testConnection}\n {...others}\n />\n );\n }\n\n const { OptionsEditorComponent } = plugin;\n return OptionsEditorComponent ? <OptionsEditorComponent {...others} value={value} /> : null;\n}\n"],"names":["CircularProgress","Stack","ErrorAlert","usePlugin","DatasourceSpecEditor","isDatasourcePlugin","pluginType","plugin","PluginSpecEditor","props","pluginSelection","type","kind","pluginKind","metadata","pluginMetadata","value","testConnection","others","data","isLoading","error","version","registry","width","sx","alignItems","justifyContent","Error","OptionsEditorComponent"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AACxD,SAASC,UAAU,QAAQ,yBAAyB;AAKpD,SAASC,SAAS,QAAQ,yBAAgB;AAE1C,SAASC,oBAAoB,QAAQ,4BAAyB;AAQ9D,SAASC,mBACPC,UAAsB,EACtBC,MAA2B;IAE3B,OAAOD,eAAe,gBAAgB,kBAAkBC;AAC1D;AAEA,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,iBAAiB,EAAEC,MAAML,UAAU,EAAEM,MAAMC,UAAU,EAAEC,UAAUC,cAAc,EAAE,EACjFC,KAAK,EACLC,cAAc,EACd,GAAGC,QACJ,GAAGT;IACJ,kHAAkH;IAClH,MAAM,EACJU,MAAMZ,MAAM,EACZa,SAAS,EACTC,KAAK,EACN,GAAGlB,UAAUG,YAAYO,YAAY;QACpCS,SAASP,gBAAgBO;QACzBC,UAAUR,gBAAgBQ;IAC5B;IAEA,IAAIF,OAAO;QACT,qBAAO,KAACnB;YAAWmB,OAAOA;;IAC5B;IAEA,IAAID,WAAW;QACb,qBACE,KAACnB;YAAMuB,OAAM;YAAOC,IAAI;gBAAEC,YAAY;gBAAUC,gBAAgB;YAAS;sBACvE,cAAA,KAAC3B;;IAGP;IAEA,IAAI,CAACO,QAAQ;QACX,MAAM,IAAIqB,MAAM,CAAC,2BAA2B,EAAEtB,WAAW,mBAAmB,EAAEO,WAAW,CAAC,CAAC;IAC7F;IAEA,IAAIP,eAAe,SAAS;QAC1B,MAAM,IAAIsB,MAAM;IAClB;IAEA,IAAIvB,mBAAmBC,YAAYC,SAAS;QAC1C,qBACE,KAACH;YACCG,QAAQA;YACRM,YAAYA;YACZG,OAAOA;YACPC,gBAAgBA;YACf,GAAGC,MAAM;;IAGhB;IAEA,MAAM,EAAEW,sBAAsB,EAAE,GAAGtB;IACnC,OAAOsB,uCAAyB,KAACA;QAAwB,GAAGX,MAAM;QAAEF,OAAOA;SAAY;AACzF"}
@@ -10,6 +10,6 @@
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 * from './PluginSpecEditor';
13
+ export * from "./PluginSpecEditor.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PluginSpecEditor/index.tsx"],"sourcesContent":["// Copyright 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 './PluginSpecEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,qBAAqB"}
1
+ {"version":3,"sources":["../../../src/components/PluginSpecEditor/index.tsx"],"sourcesContent":["// Copyright 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 './PluginSpecEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAqB"}
@@ -1,4 +1,4 @@
1
- import { ReactElement } from 'react';
1
+ import type { ReactElement } from 'react';
2
2
  export interface SelectionOptions {
3
3
  enabled?: boolean;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionOptionsEditor/SelectionOptionsEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,2BAA2B,GAAG,YAAY,CAcrG"}
1
+ {"version":3,"file":"SelectionOptionsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionOptionsEditor/SelectionOptionsEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAClD;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,2BAA2B,GAAG,YAAY,CAcrG"}
@@ -1,4 +1,3 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  // Copyright The Perses Authors
3
2
  // Licensed under the Apache License, Version 2.0 (the "License");
4
3
  // you may not use this file except in compliance with the License.
@@ -11,8 +10,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
11
  // See the License for the specific language governing permissions and
13
12
  // limitations under the License.
14
- import { Switch } from '@mui/material';
15
- import { OptionsEditorControl, OptionsEditorGroup } from '@perses-dev/components';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { Switch } from "@mui/material";
15
+ import { OptionsEditorControl, OptionsEditorGroup } from "@perses-dev/components";
16
16
  export function SelectionOptionsEditor({ value, onChange }) {
17
17
  const handleEnabledChange = (_, checked)=>{
18
18
  onChange(checked ? {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/SelectionOptionsEditor.tsx"],"sourcesContent":["// Copyright 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 { Switch, SwitchProps } from '@mui/material';\nimport { OptionsEditorControl, OptionsEditorGroup } from '@perses-dev/components';\nimport { ReactElement } from 'react';\n\nexport interface SelectionOptions {\n enabled?: boolean;\n}\n\nexport interface SelectionOptionsEditorProps {\n value?: SelectionOptions;\n onChange: (selection?: SelectionOptions) => void;\n}\n\nexport function SelectionOptionsEditor({ value, onChange }: SelectionOptionsEditorProps): ReactElement {\n const handleEnabledChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n onChange(checked ? { enabled: true } : undefined);\n };\n\n return (\n <OptionsEditorGroup title=\"Selection\">\n <OptionsEditorControl\n label=\"Enable Selection\"\n description=\"Allow selecting items to enable actions on selected data\"\n control={<Switch checked={value?.enabled ?? false} onChange={handleEnabledChange} />}\n />\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","OptionsEditorControl","OptionsEditorGroup","SelectionOptionsEditor","value","onChange","handleEnabledChange","_","checked","enabled","undefined","title","label","description","control"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,QAAqB,gBAAgB;AACpD,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,yBAAyB;AAYlF,OAAO,SAASC,uBAAuB,EAAEC,KAAK,EAAEC,QAAQ,EAA+B;IACrF,MAAMC,sBAA+C,CAACC,GAAYC;QAChEH,SAASG,UAAU;YAAEC,SAAS;QAAK,IAAIC;IACzC;IAEA,qBACE,KAACR;QAAmBS,OAAM;kBACxB,cAAA,KAACV;YACCW,OAAM;YACNC,aAAY;YACZC,uBAAS,KAACd;gBAAOQ,SAASJ,OAAOK,WAAW;gBAAOJ,UAAUC;;;;AAIrE"}
1
+ {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/SelectionOptionsEditor.tsx"],"sourcesContent":["// Copyright 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 type { SwitchProps } from '@mui/material';\nimport { Switch } from '@mui/material';\nimport { OptionsEditorControl, OptionsEditorGroup } from '@perses-dev/components';\nimport type { ReactElement } from 'react';\n\nexport interface SelectionOptions {\n enabled?: boolean;\n}\n\nexport interface SelectionOptionsEditorProps {\n value?: SelectionOptions;\n onChange: (selection?: SelectionOptions) => void;\n}\n\nexport function SelectionOptionsEditor({ value, onChange }: SelectionOptionsEditorProps): ReactElement {\n const handleEnabledChange: SwitchProps['onChange'] = (_: unknown, checked: boolean) => {\n onChange(checked ? { enabled: true } : undefined);\n };\n\n return (\n <OptionsEditorGroup title=\"Selection\">\n <OptionsEditorControl\n label=\"Enable Selection\"\n description=\"Allow selecting items to enable actions on selected data\"\n control={<Switch checked={value?.enabled ?? false} onChange={handleEnabledChange} />}\n />\n </OptionsEditorGroup>\n );\n}\n"],"names":["Switch","OptionsEditorControl","OptionsEditorGroup","SelectionOptionsEditor","value","onChange","handleEnabledChange","_","checked","enabled","undefined","title","label","description","control"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,MAAM,QAAQ,gBAAgB;AACvC,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,yBAAyB;AAYlF,OAAO,SAASC,uBAAuB,EAAEC,KAAK,EAAEC,QAAQ,EAA+B;IACrF,MAAMC,sBAA+C,CAACC,GAAYC;QAChEH,SAASG,UAAU;YAAEC,SAAS;QAAK,IAAIC;IACzC;IAEA,qBACE,KAACR;QAAmBS,OAAM;kBACxB,cAAA,KAACV;YACCW,OAAM;YACNC,aAAY;YACZC,uBAAS,KAACd;gBAAOQ,SAASJ,OAAOK,WAAW;gBAAOJ,UAAUC;;;;AAIrE"}
@@ -10,6 +10,6 @@
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 * from './SelectionOptionsEditor';
13
+ export * from "./SelectionOptionsEditor.js";
14
14
 
15
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/index.ts"],"sourcesContent":["// Copyright 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 './SelectionOptionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,2BAA2B"}
1
+ {"version":3,"sources":["../../../src/components/SelectionOptionsEditor/index.ts"],"sourcesContent":["// Copyright 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 './SelectionOptionsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,8BAA2B"}
@@ -1,6 +1,5 @@
1
- import { TimeOption, TimeZoneOption } from '@perses-dev/components';
2
- import { ReactElement } from 'react';
3
- export declare const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[];
1
+ import type { TimeOption, TimeZoneOption } from '@perses-dev/components';
2
+ import type { ReactElement } from 'react';
4
3
  interface TimeRangeControlsProps {
5
4
  heightPx?: number;
6
5
  showTimeRangeSelector?: boolean;
@@ -9,9 +8,10 @@ interface TimeRangeControlsProps {
9
8
  showCustomTimeRange?: boolean;
10
9
  showZoomButtons?: boolean;
11
10
  timePresets?: TimeOption[];
11
+ refreshIntervalOptions?: TimeOption[];
12
12
  timeZone: string;
13
13
  onTimeZoneChange: (timeZone: TimeZoneOption) => void;
14
14
  }
15
- export declare function TimeRangeControls({ heightPx, showTimeRangeSelector, showRefreshButton, showRefreshInterval, showCustomTimeRange, showZoomButtons, timePresets, timeZone, onTimeZoneChange, }: TimeRangeControlsProps): ReactElement;
15
+ export declare function TimeRangeControls({ heightPx, showTimeRangeSelector, showRefreshButton, showRefreshInterval, showCustomTimeRange, showZoomButtons, timePresets, timeZone, refreshIntervalOptions, onTimeZoneChange, }: TimeRangeControlsProps): ReactElement;
16
16
  export {};
17
17
  //# sourceMappingURL=TimeRangeControls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAGL,UAAU,EAGV,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAe,MAAM,OAAO,CAAC;AAQlD,eAAO,MAAM,gCAAgC,EAAE,UAAU,EAOxD,CAAC;AAIF,UAAU,sBAAsB;IAE9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACtD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,mBAAmB,EACnB,eAAsB,EACtB,WAAW,EACX,QAAQ,EACR,gBAAgB,GACjB,EAAE,sBAAsB,GAAG,YAAY,CAqKvC"}
1
+ {"version":3,"file":"TimeRangeControls.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAiBzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAe1C,UAAU,sBAAsB;IAE9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,sBAAsB,CAAC,EAAE,UAAU,EAAE,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CACtD;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,qBAA4B,EAC5B,iBAAwB,EACxB,mBAA0B,EAC1B,mBAAmB,EACnB,eAAsB,EACtB,WAAW,EACX,QAAQ,EACR,sBAAsB,EACtB,gBAAgB,GACjB,EAAE,sBAAsB,GAAG,YAAY,CAqKvC"}