@perses-dev/plugin-system 0.55.0-beta.0 → 0.55.0-beta.10

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 (571) 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 +12 -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 +23 -11
  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 +4 -3
  137. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  138. package/dist/components/PluginEditor/plugin-editor-api.js +4 -4
  139. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  140. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -4
  141. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  142. package/dist/components/PluginKindSelect/PluginKindSelect.js +6 -6
  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 +5 -5
  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 +2 -1
  157. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  158. package/dist/components/PluginRegistry/plugin-indexes.js +3 -3
  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 +19 -5
  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 +22 -56
  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 +3 -3
  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 +15 -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 +5 -5
  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 +6 -6
  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 +5 -5
  369. package/dist/runtime/log-queries.js.map +1 -1
  370. package/dist/runtime/plugin-registry.d.ts +3 -4
  371. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  372. package/dist/runtime/plugin-registry.js +2 -2
  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 +4 -4
  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 +5 -5
  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 +6 -6
  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 +6 -6
  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 +1 -2
  394. package/dist/runtime/variables.d.ts.map +1 -1
  395. package/dist/runtime/variables.js +4 -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.js +3 -3
  447. package/dist/utils/index.js.map +1 -1
  448. package/dist/utils/variables.js +1 -1
  449. package/package.json +16 -16
  450. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationEditorForm.js +0 -283
  451. package/dist/cjs/components/Annotations/AnnotationEditorForm/AnnotationPreview.js +0 -197
  452. package/dist/cjs/components/Annotations/AnnotationEditorForm/index.js +0 -30
  453. package/dist/cjs/components/Annotations/constants.js +0 -23
  454. package/dist/cjs/components/Annotations/index.js +0 -31
  455. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +0 -49
  456. package/dist/cjs/components/CalculationSelector/index.js +0 -30
  457. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +0 -270
  458. package/dist/cjs/components/DatasourceEditorForm/index.js +0 -30
  459. package/dist/cjs/components/DatasourceSelect/DatasourceSelect.js +0 -266
  460. package/dist/cjs/components/DatasourceSelect/index.js +0 -30
  461. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +0 -568
  462. package/dist/cjs/components/HTTPSettingsEditor/index.js +0 -30
  463. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +0 -1175
  464. package/dist/cjs/components/ItemSelectionActionsOptionsEditor/index.js +0 -30
  465. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +0 -211
  466. package/dist/cjs/components/LegendOptionsEditor/index.js +0 -30
  467. package/dist/cjs/components/LinksEditor/LinksEditor.js +0 -162
  468. package/dist/cjs/components/LinksEditor/index.js +0 -30
  469. package/dist/cjs/components/MetricLabelInput/MetricLabelInput.js +0 -41
  470. package/dist/cjs/components/MetricLabelInput/index.js +0 -30
  471. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +0 -159
  472. package/dist/cjs/components/MultiQueryEditor/QueryEditorContainer.js +0 -250
  473. package/dist/cjs/components/MultiQueryEditor/index.js +0 -31
  474. package/dist/cjs/components/MultiQueryEditor/utils.js +0 -36
  475. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +0 -69
  476. package/dist/cjs/components/OptionsEditorRadios/index.js +0 -30
  477. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +0 -39
  478. package/dist/cjs/components/OptionsEditorTabPanel/index.js +0 -30
  479. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +0 -61
  480. package/dist/cjs/components/OptionsEditorTabs/index.js +0 -30
  481. package/dist/cjs/components/PanelSpecEditor/PanelAnnotationsEditor.js +0 -246
  482. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +0 -132
  483. package/dist/cjs/components/PanelSpecEditor/index.js +0 -30
  484. package/dist/cjs/components/PluginEditor/PluginEditor.js +0 -98
  485. package/dist/cjs/components/PluginEditor/index.js +0 -31
  486. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +0 -136
  487. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +0 -109
  488. package/dist/cjs/components/PluginKindSelect/index.js +0 -30
  489. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +0 -86
  490. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +0 -92
  491. package/dist/cjs/components/PluginRegistry/index.js +0 -30
  492. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +0 -88
  493. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +0 -55
  494. package/dist/cjs/components/PluginSpecEditor/index.js +0 -30
  495. package/dist/cjs/components/SelectionOptionsEditor/SelectionOptionsEditor.js +0 -43
  496. package/dist/cjs/components/SelectionOptionsEditor/index.js +0 -30
  497. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +0 -233
  498. package/dist/cjs/components/TimeRangeControls/index.js +0 -30
  499. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +0 -613
  500. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +0 -193
  501. package/dist/cjs/components/Variables/VariableEditorForm/index.js +0 -32
  502. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +0 -143
  503. package/dist/cjs/components/Variables/index.js +0 -31
  504. package/dist/cjs/components/Variables/variable-model.js +0 -211
  505. package/dist/cjs/components/index.js +0 -48
  506. package/dist/cjs/constants/index.js +0 -30
  507. package/dist/cjs/constants/user-interface-text.js +0 -32
  508. package/dist/cjs/context/ValidationProvider.js +0 -77
  509. package/dist/cjs/context/index.js +0 -30
  510. package/dist/cjs/index.js +0 -38
  511. package/dist/cjs/model/calculations.js +0 -178
  512. package/dist/cjs/model/index.js +0 -45
  513. package/dist/cjs/model/legend.js +0 -111
  514. package/dist/cjs/model/log-queries.js +0 -16
  515. package/dist/cjs/model/log-volume-utils.js +0 -124
  516. package/dist/cjs/model/panels.js +0 -16
  517. package/dist/cjs/model/plugin-base.js +0 -16
  518. package/dist/cjs/model/plugin-loading.js +0 -56
  519. package/dist/cjs/model/plugins.js +0 -26
  520. package/dist/cjs/model/profile-queries.js +0 -16
  521. package/dist/cjs/model/silences-queries.js +0 -16
  522. package/dist/cjs/model/time-series-queries.js +0 -26
  523. package/dist/cjs/model/trace-queries.js +0 -16
  524. package/dist/cjs/model/variables.js +0 -16
  525. package/dist/cjs/remote/PersesPlugin.types.js +0 -16
  526. package/dist/cjs/remote/PluginLoaderComponent.js +0 -87
  527. package/dist/cjs/remote/PluginRuntime.js +0 -331
  528. package/dist/cjs/remote/index.js +0 -31
  529. package/dist/cjs/remote/remotePluginLoader.js +0 -101
  530. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +0 -154
  531. package/dist/cjs/runtime/DataQueriesProvider/index.js +0 -31
  532. package/dist/cjs/runtime/DataQueriesProvider/model.js +0 -34
  533. package/dist/cjs/runtime/RouterProvider.js +0 -114
  534. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +0 -201
  535. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProviders.js +0 -66
  536. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +0 -113
  537. package/dist/cjs/runtime/TimeRangeProvider/index.js +0 -33
  538. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +0 -250
  539. package/dist/cjs/runtime/TimeRangeProvider/refresh-interval.js +0 -30
  540. package/dist/cjs/runtime/UsageMetricsProvider.js +0 -102
  541. package/dist/cjs/runtime/alerts-queries.js +0 -101
  542. package/dist/cjs/runtime/annotations.js +0 -148
  543. package/dist/cjs/runtime/builtin-variables.js +0 -81
  544. package/dist/cjs/runtime/datasources.js +0 -80
  545. package/dist/cjs/runtime/index.js +0 -44
  546. package/dist/cjs/runtime/item-actions.js +0 -302
  547. package/dist/cjs/runtime/log-queries.js +0 -76
  548. package/dist/cjs/runtime/plugin-registry.js +0 -135
  549. package/dist/cjs/runtime/profile-queries.js +0 -73
  550. package/dist/cjs/runtime/silences-queries.js +0 -101
  551. package/dist/cjs/runtime/time-series-queries.js +0 -165
  552. package/dist/cjs/runtime/trace-queries.js +0 -106
  553. package/dist/cjs/runtime/utils.js +0 -39
  554. package/dist/cjs/runtime/variables.js +0 -160
  555. package/dist/cjs/schema/index.js +0 -30
  556. package/dist/cjs/schema/panel.js +0 -42
  557. package/dist/cjs/test/index.js +0 -31
  558. package/dist/cjs/test/mock-data.js +0 -357
  559. package/dist/cjs/test/render-hook.js +0 -31
  560. package/dist/cjs/test/render.js +0 -31
  561. package/dist/cjs/test/setup-tests.js +0 -20
  562. package/dist/cjs/test/test-plugins/bert/index.js +0 -99
  563. package/dist/cjs/test/test-plugins/ernie/index.js +0 -92
  564. package/dist/cjs/test/test-plugins/index.js +0 -81
  565. package/dist/cjs/test/utils.js +0 -58
  566. package/dist/cjs/test-utils/index.js +0 -30
  567. package/dist/cjs/test-utils/mock-plugin-registry.js +0 -81
  568. package/dist/cjs/utils/csv-export.js +0 -248
  569. package/dist/cjs/utils/event.js +0 -30
  570. package/dist/cjs/utils/index.js +0 -32
  571. package/dist/cjs/utils/variables.js +0 -44
@@ -1,16 +1,4 @@
1
1
  // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the \"License\");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an \"AS IS\" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- /* eslint-disable @typescript-eslint/no-require-imports */ // Copyright The Perses Authors
14
2
  // Licensed under the Apache License, Version 2.0 (the "License");
15
3
  // you may not use this file except in compliance with the License.
16
4
  // You may obtain a copy of the License at
@@ -22,13 +10,37 @@
22
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
11
  // See the License for the specific language governing permissions and
24
12
  // limitations under the License.
25
- import { createInstance } from '@module-federation/enhanced/runtime';
26
- import * as ReactQuery from '@tanstack/react-query';
27
- import React from 'react';
28
- import ReactDOM from 'react-dom';
29
- import * as ReactHookForm from 'react-hook-form';
30
- import * as ReactRouterDOM from 'react-router-dom';
13
+ import * as EmotionReact from "@emotion/react";
14
+ import * as EmotionStyled from "@emotion/styled";
15
+ import { createInstance } from "@module-federation/enhanced/runtime";
16
+ import * as ReactQuery from "@tanstack/react-query";
17
+ import React from "react";
18
+ import ReactDOM from "react-dom";
19
+ import * as ReactHookForm from "react-hook-form";
20
+ import * as ReactRouterDOM from "react-router-dom";
31
21
  let instance = null;
22
+ function createSharedModuleLoader(loadModule) {
23
+ return async ()=>{
24
+ const module = await loadModule();
25
+ return ()=>module;
26
+ };
27
+ }
28
+ const hostSharedModules = new Map();
29
+ /*
30
+ * Shared singletons must be provided to Module Federation *synchronously* (via `lib`) so the host's
31
+ * copy wins singleton negotiation to avoid loader deadlocks or multiple instances.
32
+ */ export function registerHostSharedModules(modules) {
33
+ for (const [name, module] of Object.entries(modules)){
34
+ hostSharedModules.set(name, module);
35
+ }
36
+ }
37
+ function getHostSharedModule(name) {
38
+ const module = hostSharedModules.get(name);
39
+ if (!module) {
40
+ throw new Error(`Shared module "${name}" was not registered before a plugin tried to consume it. ` + `Call registerHostSharedModules() during app bootstrap.`);
41
+ }
42
+ return module;
43
+ }
32
44
  const getPluginRuntime = ()=>{
33
45
  if (instance === null) {
34
46
  const pluginRuntime = createInstance({
@@ -52,7 +64,7 @@ const getPluginRuntime = ()=>{
52
64
  }
53
65
  },
54
66
  'react-router-dom': {
55
- version: '6.26.0',
67
+ version: '6.30.4',
56
68
  lib: ()=>ReactRouterDOM,
57
69
  shareConfig: {
58
70
  singleton: true,
@@ -60,7 +72,7 @@ const getPluginRuntime = ()=>{
60
72
  }
61
73
  },
62
74
  '@tanstack/react-query': {
63
- version: '4.39.1',
75
+ version: '4.44.0',
64
76
  lib: ()=>ReactQuery,
65
77
  shareConfig: {
66
78
  singleton: true,
@@ -68,81 +80,90 @@ const getPluginRuntime = ()=>{
68
80
  }
69
81
  },
70
82
  'react-hook-form': {
71
- version: '7.52.2',
83
+ version: '7.87.0',
72
84
  lib: ()=>ReactHookForm,
73
85
  shareConfig: {
74
86
  singleton: true,
75
- requiredVersion: '^7.52.2'
87
+ requiredVersion: '^7.87.0'
76
88
  }
77
89
  },
78
- echarts: {
79
- version: '5.5.0',
80
- lib: ()=>require('echarts'),
90
+ '@emotion/react': {
91
+ version: '11.14.0',
92
+ lib: ()=>EmotionReact,
81
93
  shareConfig: {
82
94
  singleton: true,
83
- requiredVersion: '^5.5.0'
95
+ requiredVersion: '^11.11.3'
84
96
  }
85
97
  },
86
- '@perses-dev/spec': {
87
- version: '0.3.0-beta.0',
88
- lib: ()=>require('@perses-dev/spec'),
98
+ '@emotion/styled': {
99
+ version: '11.14.1',
100
+ lib: ()=>EmotionStyled,
89
101
  shareConfig: {
90
102
  singleton: true,
91
- requiredVersion: '^0.3.0-beta.0'
103
+ requiredVersion: '^11.11.0'
92
104
  }
93
105
  },
94
- '@perses-dev/core': {
95
- version: '0.53.1',
96
- lib: ()=>require('@perses-dev/core'),
106
+ '@perses-dev/spec': {
107
+ version: '0.3.0-beta.8',
108
+ lib: ()=>getHostSharedModule('@perses-dev/spec'),
97
109
  shareConfig: {
98
110
  singleton: true,
99
- requiredVersion: '^0.53.1'
111
+ requiredVersion: '^0.3.0-beta.8'
100
112
  }
101
113
  },
102
114
  '@perses-dev/client': {
103
- version: '0.55.0-beta.0',
104
- lib: ()=>require('@perses-dev/client'),
115
+ version: '0.55.0-beta.10',
116
+ lib: ()=>getHostSharedModule('@perses-dev/client'),
105
117
  shareConfig: {
106
118
  singleton: true,
107
- requiredVersion: '^0.55.0-beta.0'
119
+ requiredVersion: '^0.55.0-beta.10'
108
120
  }
109
121
  },
110
122
  '@perses-dev/components': {
111
- version: '0.55.0-beta.0',
112
- lib: ()=>require('@perses-dev/components'),
123
+ version: '0.55.0-beta.10',
124
+ lib: ()=>getHostSharedModule('@perses-dev/components'),
113
125
  shareConfig: {
114
126
  singleton: true,
115
- requiredVersion: '^0.55.0-beta.0'
127
+ requiredVersion: '^0.55.0-beta.10'
116
128
  }
117
129
  },
118
130
  '@perses-dev/plugin-system': {
119
- version: '0.55.0-beta.0',
120
- lib: ()=>require('@perses-dev/plugin-system'),
131
+ version: '0.55.0-beta.10',
132
+ lib: ()=>getHostSharedModule('@perses-dev/plugin-system'),
121
133
  shareConfig: {
122
134
  singleton: true,
123
- requiredVersion: '^0.55.0-beta.0'
135
+ requiredVersion: '^0.55.0-beta.10'
124
136
  }
125
137
  },
126
138
  '@perses-dev/explore': {
127
- version: '0.55.0-beta.0',
128
- lib: ()=>require('@perses-dev/explore'),
139
+ version: '0.55.0-beta.10',
140
+ lib: ()=>getHostSharedModule('@perses-dev/explore'),
129
141
  shareConfig: {
130
142
  singleton: true,
131
- requiredVersion: '^0.55.0-beta.0'
143
+ requiredVersion: '^0.55.0-beta.10'
132
144
  }
133
145
  },
134
146
  '@perses-dev/dashboards': {
135
- version: '0.55.0-beta.0',
136
- lib: ()=>require('@perses-dev/dashboards'),
147
+ version: '0.55.0-beta.10',
148
+ lib: ()=>getHostSharedModule('@perses-dev/dashboards'),
137
149
  shareConfig: {
138
150
  singleton: true,
139
- requiredVersion: '^0.55.0-beta.0'
151
+ requiredVersion: '^0.55.0-beta.10'
152
+ }
153
+ },
154
+ // Below are the shared modules that are used by the plugins and are loaded asynchronously on demand using get rather than lib.
155
+ // This is to avoid loading the modules if they are not used by the plugin.
156
+ echarts: {
157
+ version: '5.5.0',
158
+ get: createSharedModuleLoader(()=>import("echarts")),
159
+ shareConfig: {
160
+ singleton: true,
161
+ requiredVersion: '^5.5.0'
140
162
  }
141
163
  },
142
- // Below are the shared modules that are used by the plugins, this can be part of the SDK
143
164
  'date-fns': {
144
- version: '4.1.0',
145
- lib: ()=>require('date-fns'),
165
+ version: '4.2.1',
166
+ get: createSharedModuleLoader(()=>import("date-fns")),
146
167
  shareConfig: {
147
168
  singleton: true,
148
169
  requiredVersion: '^4.1.0'
@@ -150,63 +171,47 @@ const getPluginRuntime = ()=>{
150
171
  },
151
172
  'date-fns-tz': {
152
173
  version: '3.2.0',
153
- lib: ()=>require('date-fns-tz'),
174
+ get: createSharedModuleLoader(()=>import("date-fns-tz")),
154
175
  shareConfig: {
155
176
  singleton: true,
156
177
  requiredVersion: '^3.2.0'
157
178
  }
158
179
  },
159
180
  lodash: {
160
- version: '4.17.21',
161
- lib: ()=>require('lodash'),
181
+ version: '4.18.1',
182
+ get: createSharedModuleLoader(()=>import("lodash")),
162
183
  shareConfig: {
163
184
  singleton: true,
164
185
  requiredVersion: '^4.17.21'
165
186
  }
166
187
  },
167
- '@emotion/react': {
168
- version: '11.11.3',
169
- lib: ()=>require('@emotion/react'),
170
- shareConfig: {
171
- singleton: true,
172
- requiredVersion: '^11.11.3'
173
- }
174
- },
175
- '@emotion/styled': {
176
- version: '11.11.0',
177
- lib: ()=>require('@emotion/styled'),
178
- shareConfig: {
179
- singleton: true,
180
- requiredVersion: '^11.11.0'
181
- }
182
- },
183
188
  '@hookform/resolvers/zod': {
184
- version: '3.3.4',
185
- lib: ()=>require('@hookform/resolvers/zod'),
189
+ version: '5.9.1',
190
+ get: createSharedModuleLoader(()=>import("@hookform/resolvers/zod")),
186
191
  shareConfig: {
187
192
  singleton: true,
188
- requiredVersion: '^3.3.4'
193
+ requiredVersion: '^5.9.1'
189
194
  }
190
195
  },
191
196
  'use-resize-observer': {
192
197
  version: '9.1.0',
193
- lib: ()=>require('use-resize-observer'),
198
+ get: createSharedModuleLoader(()=>import("use-resize-observer")),
194
199
  shareConfig: {
195
200
  singleton: true,
196
201
  requiredVersion: '^9.1.0'
197
202
  }
198
203
  },
199
204
  'mdi-material-ui': {
200
- version: '7.4.0',
201
- lib: ()=>require('mdi-material-ui'),
205
+ version: '7.9.4',
206
+ get: createSharedModuleLoader(()=>import("mdi-material-ui")),
202
207
  shareConfig: {
203
208
  singleton: true,
204
209
  requiredVersion: '^7.4.0'
205
210
  }
206
211
  },
207
212
  immer: {
208
- version: '10.1.1',
209
- lib: ()=>require('immer'),
213
+ version: '10.2.0',
214
+ get: createSharedModuleLoader(()=>import("immer")),
210
215
  shareConfig: {
211
216
  singleton: true,
212
217
  requiredVersion: '^10.1.1'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/PluginRuntime.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\n/* eslint-disable @typescript-eslint/no-require-imports */\n// 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 { createInstance, ModuleFederation } from '@module-federation/enhanced/runtime';\n\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.39.1',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.0',\n lib: () => require('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.0',\n },\n },\n '@perses-dev/core': {\n version: '0.53.1',\n lib: () => require('@perses-dev/core'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.53.1',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.0',\n lib: () => require('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.0',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.0',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.0',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.0',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.0',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.0',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.0',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.0',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.0',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@hookform/resolvers/zod'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n lib: () => require('use-resize-observer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('immer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","getPluginRuntime","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE;AACtE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,wDAAwD,GACxD,+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,cAAc,QAA0B,sCAAsC;AAEvF,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAmB,kBAAkB;AACjD,YAAYC,oBAAoB,mBAAmB;AAGnD,IAAIC,WAAoC;AAExC,MAAMC,mBAAmB;IACvB,IAAID,aAAa,MAAM;QACrB,MAAME,gBAAgBR,eAAe;YACnCS,MAAM;YACNC,SAAS,EAAE;YACXC,QAAQ;gBACNC,OAAO;oBACLC,SAASX,MAAMW,OAAO;oBACtBC,KAAK,IAAMZ;oBACXa,aAAa;wBACXC,WAAW;wBACXC,iBAAiB,CAAC,CAAC,E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qB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUV;gBAASY;YAAQ;QACzE;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/remote/PluginRuntime.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 * as EmotionReact from '@emotion/react';\nimport * as EmotionStyled from '@emotion/styled';\nimport type { ModuleFederation } from '@module-federation/enhanced/runtime';\nimport { createInstance } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\n\nimport type { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nfunction createSharedModuleLoader<TModule>(loadModule: () => Promise<TModule>): () => Promise<() => TModule> {\n return async () => {\n const module = await loadModule();\n return () => module;\n };\n}\n\nexport interface HostSharedModules {\n '@perses-dev/spec': unknown;\n '@perses-dev/client': unknown;\n '@perses-dev/components': unknown;\n '@perses-dev/plugin-system': unknown;\n '@perses-dev/explore': unknown;\n '@perses-dev/dashboards': unknown;\n}\n\ntype HostSharedModuleName = keyof HostSharedModules;\n\nconst hostSharedModules = new Map<HostSharedModuleName, unknown>();\n\n/*\n * Shared singletons must be provided to Module Federation *synchronously* (via `lib`) so the host's\n * copy wins singleton negotiation to avoid loader deadlocks or multiple instances.\n */\nexport function registerHostSharedModules(modules: HostSharedModules): void {\n for (const [name, module] of Object.entries(modules) as Array<[HostSharedModuleName, unknown]>) {\n hostSharedModules.set(name, module);\n }\n}\n\nfunction getHostSharedModule(name: HostSharedModuleName): unknown {\n const module = hostSharedModules.get(name);\n if (!module) {\n throw new Error(\n `Shared module \"${name}\" was not registered before a plugin tried to consume it. ` +\n `Call registerHostSharedModules() during app bootstrap.`,\n );\n }\n return module;\n}\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.30.4',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.44.0',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.87.0',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.87.0',\n },\n },\n '@emotion/react': {\n version: '11.14.0',\n lib: () => EmotionReact,\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.14.1',\n lib: () => EmotionStyled,\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.8',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.10',\n lib: () => getHostSharedModule('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.10',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.10',\n lib: () => getHostSharedModule('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.10',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.10',\n lib: () => getHostSharedModule('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.10',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.10',\n lib: () => getHostSharedModule('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.10',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.10',\n lib: () => getHostSharedModule('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.10',\n },\n },\n // Below are the shared modules that are used by the plugins and are loaded asynchronously on demand using get rather than lib.\n // This is to avoid loading the modules if they are not used by the plugin.\n echarts: {\n version: '5.5.0',\n get: createSharedModuleLoader(() => import('echarts')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n 'date-fns': {\n version: '4.2.1',\n get: createSharedModuleLoader(() => import('date-fns')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n get: createSharedModuleLoader(() => import('date-fns-tz')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.18.1',\n get: createSharedModuleLoader(() => import('lodash')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@hookform/resolvers/zod': {\n version: '5.9.1',\n get: createSharedModuleLoader(() => import('@hookform/resolvers/zod')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.9.1',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n get: createSharedModuleLoader(() => import('use-resize-observer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.9.4',\n get: createSharedModuleLoader(() => import('mdi-material-ui')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.2.0',\n get: createSharedModuleLoader(() => import('immer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["EmotionReact","EmotionStyled","createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","createSharedModuleLoader","loadModule","module","hostSharedModules","Map","registerHostSharedModules","modules","name","Object","entries","set","getHostSharedModule","get","Error","getPluginRuntime","pluginRuntime","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"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,YAAYA,kBAAkB,iBAAiB;AAC/C,YAAYC,mBAAmB,kBAAkB;AAEjD,SAASC,cAAc,QAAQ,sCAAsC;AACrE,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAmB,kBAAkB;AACjD,YAAYC,oBAAoB,mBAAmB;AAInD,IAAIC,WAAoC;AAExC,SAASC,yBAAkCC,UAAkC;IAC3E,OAAO;QACL,MAAMC,SAAS,MAAMD;QACrB,OAAO,IAAMC;IACf;AACF;AAaA,MAAMC,oBAAoB,IAAIC;AAE9B;;;CAGC,GACD,OAAO,SAASC,0BAA0BC,OAA0B;IAClE,KAAK,MAAM,CAACC,MAAML,OAAO,IAAIM,OAAOC,OAAO,CAACH,SAAoD;QAC9FH,kBAAkBO,GAAG,CAACH,MAAML;IAC9B;AACF;AAEA,SAASS,oBAAoBJ,IAA0B;IACrD,MAAML,SAASC,kBAAkBS,GAAG,CAACL;IACrC,IAAI,CAACL,QAAQ;QACX,MAAM,IAAIW,MACR,CAAC,eAAe,EAAEN,KAAK,0DAA0D,CAAC,GAChF,CAAC,sDAAsD,CAAC;IAE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AAeJ,8BAA8BoB,YAAYnB,UAAUT;IACzE,OAAOJ,cAAckC,UAAU,CAAqB,GAAGlB,aAAa,CAAC,EAAEiB,YAAY;AACrF,EAAE;AAEF,OAAO,SAASE,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACLpC,eAAeD;QACf+B,YAAY;YACV,MAAM,EAAEE,UAAU,EAAExC,MAAMyC,UAAU,EAAEpB,QAAQ,EAAET,OAAO,EAAEW,OAAO,EAAE,GAAGqB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUT;gBAASW;YAAQ;QACzE;IACF;AACF"}
@@ -1,3 +1,4 @@
1
1
  export * from './PluginLoaderComponent';
2
2
  export * from './remotePluginLoader';
3
+ export * from './PluginRuntime';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote/index.ts"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote/index.ts"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
@@ -10,7 +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
- export * from './PluginLoaderComponent';
14
- export * from './remotePluginLoader';
13
+ export * from "./PluginLoaderComponent.js";
14
+ export * from "./remotePluginLoader.js";
15
+ export * from "./PluginRuntime.js";
15
16
 
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/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 './PluginLoaderComponent';\nexport * from './remotePluginLoader';\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,0BAA0B;AACxC,cAAc,uBAAuB"}
1
+ {"version":3,"sources":["../../src/remote/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 './PluginLoaderComponent';\nexport * from './remotePluginLoader';\nexport * from './PluginRuntime';\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,6BAA0B;AACxC,cAAc,0BAAuB;AACrC,cAAc,qBAAkB"}
@@ -1,5 +1,5 @@
1
- import { PluginLoader } from '@perses-dev/plugin-system';
2
- import { type FetchFn } from '@perses-dev/client';
1
+ import type { FetchFn } from '@perses-dev/client';
2
+ import type { PluginLoader } from '@perses-dev/plugin-system';
3
3
  type RemotePluginLoaderOptions = {
4
4
  /**
5
5
  * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.
@@ -1 +1 @@
1
- {"version":3,"file":"remotePluginLoader.d.ts","sourceRoot":"","sources":["../../src/remote/remotePluginLoader.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,YAAY,EAKb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAyB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA8BzE,KAAK,yBAAyB,GAAG;IAC/B;;;QAGI;IACJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwBF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,YAAY,CA0DpF"}
1
+ {"version":3,"file":"remotePluginLoader.d.ts","sourceRoot":"","sources":["../../src/remote/remotePluginLoader.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAoD,MAAM,2BAA2B,CAAC;AAgChH,KAAK,yBAAyB,GAAG;IAC/B;;;QAGI;IACJ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwBF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,YAAY,CA0DpF"}
@@ -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 { getPluginModuleCompoundKey } from '@perses-dev/plugin-system';
14
- import { fetch as defaultFetch } from '@perses-dev/client';
15
- import { loadPlugin } from './PluginRuntime';
13
+ import { fetch as defaultFetch } from "@perses-dev/client";
14
+ import { getPluginModuleCompoundKey } from "@perses-dev/plugin-system";
15
+ import { loadPlugin } from "./PluginRuntime.js";
16
16
  const isPluginMetadata = (plugin)=>{
17
17
  return typeof plugin === 'object' && plugin !== null && 'kind' in plugin && 'spec' in plugin && typeof plugin.spec === 'object' && plugin.spec !== null && 'name' in plugin.spec;
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/remotePluginLoader.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 {\n PluginLoader,\n PluginMetadata,\n PluginModuleResource,\n PluginType,\n getPluginModuleCompoundKey,\n} from '@perses-dev/plugin-system';\nimport { fetch as defaultFetch, type FetchFn } from '@perses-dev/client';\nimport { RemotePluginModule } from './PersesPlugin.types';\nimport { loadPlugin } from './PluginRuntime';\n\nconst isPluginMetadata = (plugin: unknown): plugin is PluginMetadata => {\n return (\n typeof plugin === 'object' &&\n plugin !== null &&\n 'kind' in plugin &&\n 'spec' in plugin &&\n typeof plugin.spec === 'object' &&\n plugin.spec !== null &&\n 'name' in plugin.spec\n );\n};\n\nconst isPluginModuleResource = (pluginModule: unknown): pluginModule is PluginModuleResource => {\n return (\n typeof pluginModule === 'object' &&\n pluginModule !== null &&\n 'metadata' in pluginModule &&\n 'spec' in pluginModule &&\n typeof pluginModule.spec === 'object' &&\n pluginModule.spec !== null &&\n 'plugins' in pluginModule.spec &&\n Array.isArray(pluginModule.spec.plugins) &&\n pluginModule.spec.plugins.every(isPluginMetadata)\n );\n};\n\ntype RemotePluginLoaderOptions = {\n /**\n * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.\n * @default ''\n **/\n apiPrefix?: string;\n /**\n * The base URL for loading plugin assets (e.g., JavaScript files). Used to construct the full URL to the `/plugins` directory\n * @default ''\n **/\n baseURL?: string;\n /**\n * Optional custom fetch function to use for network requests. If not provided, the default fetch implementation will be used.\n */\n fetchFn?: FetchFn;\n};\n\ntype ParsedPluginOptions = {\n pluginsApiPath: string;\n pluginsAssetsPath: string;\n};\n\nconst DEFAULT_PLUGINS_API_PATH = '/api/v1/plugins';\nconst DEFAULT_PLUGINS_ASSETS_PATH = '/plugins';\n\nconst paramToOptions = (options?: RemotePluginLoaderOptions): ParsedPluginOptions => {\n if (options === undefined) {\n return {\n pluginsApiPath: DEFAULT_PLUGINS_API_PATH,\n pluginsAssetsPath: DEFAULT_PLUGINS_ASSETS_PATH,\n };\n }\n\n return {\n pluginsApiPath: `${options?.apiPrefix ?? ''}${DEFAULT_PLUGINS_API_PATH}`,\n pluginsAssetsPath: `${options?.baseURL ?? ''}${DEFAULT_PLUGINS_ASSETS_PATH}`,\n };\n};\n\n/**\n * Get a PluginLoader that fetches the list of installed plugins from a remote server and loads them as needed.\n * @param options - Optional configuration options for the remote plugin loader.\n */\nexport function remotePluginLoader(options?: RemotePluginLoaderOptions): PluginLoader {\n const { pluginsApiPath, pluginsAssetsPath } = paramToOptions(options);\n const fetchFn = options?.fetchFn ?? defaultFetch;\n\n return {\n getInstalledPlugins: async (): Promise<PluginModuleResource[]> => {\n const pluginsResponse = await fetchFn(pluginsApiPath);\n\n const plugins = await pluginsResponse.json();\n let pluginModules: PluginModuleResource[] = [];\n\n if (Array.isArray(plugins)) {\n pluginModules = plugins.filter(isPluginModuleResource);\n } else {\n console.error('RemotePluginLoader: Error loading plugins, response is not an array');\n }\n\n if (!pluginModules.length) {\n console.error('RemotePluginLoader: No valid plugins found');\n }\n\n return pluginModules;\n },\n importPluginModule: async (resource): Promise<RemotePluginModule> => {\n const { name: pluginModuleName, version, registry } = resource.metadata;\n\n const pluginModule: RemotePluginModule = {};\n\n const loadPromises = resource.spec.plugins.map(async (plugin) => {\n const remotePluginModule = await loadPlugin({\n moduleName: pluginModuleName,\n pluginName: plugin.spec.name,\n registry,\n version,\n baseURL: pluginsAssetsPath,\n });\n\n const remotePlugin = remotePluginModule?.[plugin.spec.name];\n if (remotePlugin) {\n return { kind: plugin.kind as PluginType, name: plugin.spec.name, remotePlugin };\n } else {\n console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);\n return null;\n }\n });\n\n const loadedPlugins = await Promise.all(loadPromises);\n\n loadedPlugins.forEach((item) => {\n if (item?.remotePlugin) {\n pluginModule[getPluginModuleCompoundKey({ kind: item.kind, name: item.name, registry, version })] =\n item.remotePlugin;\n }\n });\n\n return pluginModule;\n },\n };\n}\n"],"names":["getPluginModuleCompoundKey","fetch","defaultFetch","loadPlugin","isPluginMetadata","plugin","spec","isPluginModuleResource","pluginModule","Array","isArray","plugins","every","DEFAULT_PLUGINS_API_PATH","DEFAULT_PLUGINS_ASSETS_PATH","paramToOptions","options","undefined","pluginsApiPath","pluginsAssetsPath","apiPrefix","baseURL","remotePluginLoader","fetchFn","getInstalledPlugins","pluginsResponse","json","pluginModules","filter","console","error","length","importPluginModule","resource","name","pluginModuleName","version","registry","metadata","loadPromises","map","remotePluginModule","moduleName","pluginName","remotePlugin","kind","loadedPlugins","Promise","all","forEach","item"],"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,SAKEA,0BAA0B,QACrB,4BAA4B;AACnC,SAASC,SAASC,YAAY,QAAsB,qBAAqB;AAEzE,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,MAAMC,mBAAmB,CA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T;QACAK,oBAAoB,OAAOC;YACzB,MAAM,EAAEC,MAAMC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGJ,SAASK,QAAQ;YAEvE,MAAM9B,eAAmC,CAAC;YAE1C,MAAM+B,eAAeN,SAAS3B,IAAI,CAACK,OAAO,CAAC6B,GAAG,CAAC,OAAOnC;gBACpD,MAAMoC,qBAAqB,MAAMtC,WAAW;oBAC1CuC,YAAYP;oBACZQ,YAAYtC,OAAOC,IAAI,CAAC4B,IAAI;oBAC5BG;oBACAD;oBACAf,SAASF;gBACX;gBAEA,MAAMyB,eAAeH,oBAAoB,CAACpC,OAAOC,IAAI,CAAC4B,IAAI,CAAC;gBAC3D,IAAIU,cAAc;oBAChB,OAAO;wBAAEC,MAAMxC,OAAOwC,IAAI;wBAAgBX,MAAM7B,OAAOC,IAAI,CAAC4B,IAAI;wBAAEU;oBAAa;gBACjF,OAAO;oBACLf,QAAQC,KAAK,CAAC,CAAC,yCAAyC,EAAEzB,OAAOC,IAAI,CAAC4B,IAAI,EAAE;oBAC5E,OAAO;gBACT;YACF;YAEA,MAAMY,gBAAgB,MAAMC,QAAQC,GAAG,CAACT;YAExCO,cAAcG,OAAO,CAAC,CAACC;gBACrB,IAAIA,MAAMN,cAAc;oBACtBpC,YAAY,CAACR,2BAA2B;wBAAE6C,MAAMK,KAAKL,IAAI;wBAAEX,MAAMgB,KAAKhB,IAAI;wBAAEG;wBAAUD;oBAAQ,GAAG,GAC/Fc,KAAKN,YAAY;gBACrB;YACF;YAEA,OAAOpC;QACT;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/remote/remotePluginLoader.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 { fetch as defaultFetch } from '@perses-dev/client';\nimport type { FetchFn } from '@perses-dev/client';\nimport type { PluginLoader, PluginMetadata, PluginModuleResource, PluginType } from '@perses-dev/plugin-system';\nimport { getPluginModuleCompoundKey } from '@perses-dev/plugin-system';\n\nimport type { RemotePluginModule } from './PersesPlugin.types';\nimport { loadPlugin } from './PluginRuntime';\n\nconst isPluginMetadata = (plugin: unknown): plugin is PluginMetadata => {\n return (\n typeof plugin === 'object' &&\n plugin !== null &&\n 'kind' in plugin &&\n 'spec' in plugin &&\n typeof plugin.spec === 'object' &&\n plugin.spec !== null &&\n 'name' in plugin.spec\n );\n};\n\nconst isPluginModuleResource = (pluginModule: unknown): pluginModule is PluginModuleResource => {\n return (\n typeof pluginModule === 'object' &&\n pluginModule !== null &&\n 'metadata' in pluginModule &&\n 'spec' in pluginModule &&\n typeof pluginModule.spec === 'object' &&\n pluginModule.spec !== null &&\n 'plugins' in pluginModule.spec &&\n Array.isArray(pluginModule.spec.plugins) &&\n pluginModule.spec.plugins.every(isPluginMetadata)\n );\n};\n\ntype RemotePluginLoaderOptions = {\n /**\n * The API path for fetching available Perses plugins. Used to construct the full URL to the `/api/v1/plugins` endpoint.\n * @default ''\n **/\n apiPrefix?: string;\n /**\n * The base URL for loading plugin assets (e.g., JavaScript files). Used to construct the full URL to the `/plugins` directory\n * @default ''\n **/\n baseURL?: string;\n /**\n * Optional custom fetch function to use for network requests. If not provided, the default fetch implementation will be used.\n */\n fetchFn?: FetchFn;\n};\n\ntype ParsedPluginOptions = {\n pluginsApiPath: string;\n pluginsAssetsPath: string;\n};\n\nconst DEFAULT_PLUGINS_API_PATH = '/api/v1/plugins';\nconst DEFAULT_PLUGINS_ASSETS_PATH = '/plugins';\n\nconst paramToOptions = (options?: RemotePluginLoaderOptions): ParsedPluginOptions => {\n if (options === undefined) {\n return {\n pluginsApiPath: DEFAULT_PLUGINS_API_PATH,\n pluginsAssetsPath: DEFAULT_PLUGINS_ASSETS_PATH,\n };\n }\n\n return {\n pluginsApiPath: `${options?.apiPrefix ?? ''}${DEFAULT_PLUGINS_API_PATH}`,\n pluginsAssetsPath: `${options?.baseURL ?? ''}${DEFAULT_PLUGINS_ASSETS_PATH}`,\n };\n};\n\n/**\n * Get a PluginLoader that fetches the list of installed plugins from a remote server and loads them as needed.\n * @param options - Optional configuration options for the remote plugin loader.\n */\nexport function remotePluginLoader(options?: RemotePluginLoaderOptions): PluginLoader {\n const { pluginsApiPath, pluginsAssetsPath } = paramToOptions(options);\n const fetchFn = options?.fetchFn ?? defaultFetch;\n\n return {\n getInstalledPlugins: async (): Promise<PluginModuleResource[]> => {\n const pluginsResponse = await fetchFn(pluginsApiPath);\n\n const plugins = await pluginsResponse.json();\n let pluginModules: PluginModuleResource[] = [];\n\n if (Array.isArray(plugins)) {\n pluginModules = plugins.filter(isPluginModuleResource);\n } else {\n console.error('RemotePluginLoader: Error loading plugins, response is not an array');\n }\n\n if (!pluginModules.length) {\n console.error('RemotePluginLoader: No valid plugins found');\n }\n\n return pluginModules;\n },\n importPluginModule: async (resource): Promise<RemotePluginModule> => {\n const { name: pluginModuleName, version, registry } = resource.metadata;\n\n const pluginModule: RemotePluginModule = {};\n\n const loadPromises = resource.spec.plugins.map(async (plugin) => {\n const remotePluginModule = await loadPlugin({\n moduleName: pluginModuleName,\n pluginName: plugin.spec.name,\n registry,\n version,\n baseURL: pluginsAssetsPath,\n });\n\n const remotePlugin = remotePluginModule?.[plugin.spec.name];\n if (remotePlugin) {\n return { kind: plugin.kind as PluginType, name: plugin.spec.name, remotePlugin };\n } else {\n console.error(`RemotePluginLoader: Error loading plugin ${plugin.spec.name}`);\n return null;\n }\n });\n\n const loadedPlugins = await Promise.all(loadPromises);\n\n loadedPlugins.forEach((item) => {\n if (item?.remotePlugin) {\n pluginModule[getPluginModuleCompoundKey({ kind: item.kind, name: item.name, registry, version })] =\n item.remotePlugin;\n }\n });\n\n return pluginModule;\n },\n };\n}\n"],"names":["fetch","defaultFetch","getPluginModuleCompoundKey","loadPlugin","isPluginMetadata","plugin","spec","isPluginModuleResource","pluginModule","Array","isArray","plugins","every","DEFAULT_PLUGINS_API_PATH","DEFAULT_PLUGINS_ASSETS_PATH","paramToOptions","options","undefined","pluginsApiPath","pluginsAssetsPath","apiPrefix","baseURL","remotePluginLoader","fetchFn","getInstalledPlugins","pluginsResponse","json","pluginModules","filter","console","error","length","importPluginModule","resource","name","pluginModuleName","version","registry","metadata","loadPromises","map","remotePluginModule","moduleName","pluginName","remotePlugin","kind","loadedPlugins","Promise","all","forEach","item"],"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,SAASC,YAAY,QAAQ,qBAAqB;AAG3D,SAASC,0BAA0B,QAAQ,4BAA4B;AAGvE,SAASC,UAAU,QAAQ,qBAAkB;AAE7C,MAAMC,mBAAmB,CAACC;IACxB,OACE,OAAOA,WAAW,YAClBA,WAAW,QACX,UAAUA,UACV,UAAUA,UACV,OAAOA,OAAOC,IAAI,KAAK,YACvBD,OAAOC,IAAI,KAAK,QAChB,UAAUD,OAAOC,IAAI;AAEzB;AAEA,MAAMC,yBAAyB,CAACC;IAC9B,OACE,OAAOA,iBAAiB,YACxBA,iBAAiB,QACjB,cAAcA,gBACd,UAAUA,gBACV,OAAOA,aAAaF,IAAI,KAAK,YAC7BE,aAAaF,IAAI,KAAK,QACtB,aAAaE,aAAaF,IAAI,IAC9BG,MAAMC,OAAO,CAACF,aAAaF,IAAI,CAACK,OAAO,KACvCH,aAAaF,IAAI,CAACK,OAAO,CAACC,KAAK,CAACR;AAEpC;AAwBA,MAAMS,2BAA2B;AACjC,MAAMC,8BAA8B;AAEpC,MAAMC,iB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B,OAAOC,IAAI,CAAC4B,IAAI;wBAAEU;oBAAa;gBACjF,OAAO;oBACLf,QAAQC,KAAK,CAAC,CAAC,yCAAyC,EAAEzB,OAAOC,IAAI,CAAC4B,IAAI,EAAE;oBAC5E,OAAO;gBACT;YACF;YAEA,MAAMY,gBAAgB,MAAMC,QAAQC,GAAG,CAACT;YAExCO,cAAcG,OAAO,CAAC,CAACC;gBACrB,IAAIA,MAAMN,cAAc;oBACtBpC,YAAY,CAACN,2BAA2B;wBAAE2C,MAAMK,KAAKL,IAAI;wBAAEX,MAAMgB,KAAKhB,IAAI;wBAAEG;wBAAUD;oBAAQ,GAAG,GAC/Fc,KAAKN,YAAY;gBACrB;YACF;YAEA,OAAOpC;QACT;IACF;AACF"}
@@ -1,6 +1,6 @@
1
- import { ReactElement } from 'react';
2
- import { QueryType } from '@perses-dev/spec';
3
- import { DataQueriesProviderProps, UseDataQueryResults, DataQueriesContextType } from './model';
1
+ import type { QueryType } from '@perses-dev/spec';
2
+ import type { ReactElement } from 'react';
3
+ import type { DataQueriesProviderProps, UseDataQueryResults, DataQueriesContextType } from './model';
4
4
  export declare const DataQueriesContext: import("react").Context<DataQueriesContextType | undefined>;
5
5
  export declare function useDataQueriesContext(): DataQueriesContextType;
6
6
  export declare function useDataQueries<T extends keyof QueryType>(queryType: T): UseDataQueryResults<QueryType[T]>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAoC,MAAM,OAAO,CAAC;AACtF,OAAO,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AASxE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EAEnB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,IAAI,sBAAsB,CAM9D;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAuBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CA2FjF"}
1
+ {"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAA6B,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAiB1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB,EAAa,MAAM,SAAS,CAAC;AAGhH,eAAO,MAAM,kBAAkB,6DAA+D,CAAC;AAE/F,wBAAgB,qBAAqB,IAAI,sBAAsB,CAM9D;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,SAAS,EAAE,SAAS,EAAE,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAuBzG;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,YAAY,CAkGjF"}
@@ -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,15 +10,17 @@ 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 { createContext, useCallback, useContext, useMemo } from 'react';
15
- import { useTimeSeriesQueries } from '../time-series-queries';
16
- import { useTraceQueries } from '../trace-queries';
17
- import { useProfileQueries } from '../profile-queries';
18
- import { useAlertsQueries } from '../alerts-queries';
19
- import { useSilencesQueries } from '../silences-queries';
20
- import { useUsageMetrics } from '../UsageMetricsProvider';
21
- import { useLogQueries } from '../log-queries';
22
- import { transformQueryResults } from './model';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { createContext, useCallback, useContext, useMemo } from "react";
15
+ import { useAlertsQueries } from "../alerts-queries.js";
16
+ import { useJsonQueries } from "../json-queries.js";
17
+ import { useLogQueries } from "../log-queries.js";
18
+ import { useProfileQueries } from "../profile-queries.js";
19
+ import { useSilencesQueries } from "../silences-queries.js";
20
+ import { useTimeSeriesQueries } from "../time-series-queries.js";
21
+ import { useTraceQueries } from "../trace-queries.js";
22
+ import { useUsageMetrics } from "../UsageMetricsProvider.js";
23
+ import { transformQueryResults } from "./model.js";
23
24
  export const DataQueriesContext = /*#__PURE__*/ createContext(undefined);
24
25
  export function useDataQueriesContext() {
25
26
  const ctx = useContext(DataQueriesContext);
@@ -62,6 +63,8 @@ export function DataQueriesProvider(props) {
62
63
  const alertsResults = useAlertsQueries(alertsQueries);
63
64
  const silencesQueries = definitions.filter((definition)=>definition.kind === 'SilencesQuery');
64
65
  const silencesResults = useSilencesQueries(silencesQueries);
66
+ const jsonQueries = definitions.filter((definition)=>definition.kind === 'JsonQuery');
67
+ const jsonResults = useJsonQueries(jsonQueries);
65
68
  const refetchAll = useCallback(()=>{
66
69
  timeSeriesResults.forEach((result)=>result.refetch());
67
70
  traceResults.forEach((result)=>result.refetch());
@@ -69,13 +72,15 @@ export function DataQueriesProvider(props) {
69
72
  logResults.forEach((result)=>result.refetch());
70
73
  alertsResults.forEach((result)=>result.refetch());
71
74
  silencesResults.forEach((result)=>result.refetch());
75
+ jsonResults.forEach((result)=>result.refetch());
72
76
  }, [
73
77
  timeSeriesResults,
74
78
  traceResults,
75
79
  profileResults,
76
80
  logResults,
77
81
  alertsResults,
78
- silencesResults
82
+ silencesResults,
83
+ jsonResults
79
84
  ]);
80
85
  const ctx = useMemo(()=>{
81
86
  const mergedQueryResults = [
@@ -84,7 +89,8 @@ export function DataQueriesProvider(props) {
84
89
  ...transformQueryResults(profileResults, profileQueries),
85
90
  ...transformQueryResults(logResults, logQueries),
86
91
  ...transformQueryResults(alertsResults, alertsQueries),
87
- ...transformQueryResults(silencesResults, silencesQueries)
92
+ ...transformQueryResults(silencesResults, silencesQueries),
93
+ ...transformQueryResults(jsonResults, jsonQueries)
88
94
  ];
89
95
  if (queryOptions?.enabled) {
90
96
  for (const result of mergedQueryResults){
@@ -114,6 +120,8 @@ export function DataQueriesProvider(props) {
114
120
  profileResults,
115
121
  silencesQueries,
116
122
  silencesResults,
123
+ jsonQueries,
124
+ jsonResults,
117
125
  timeSeriesQueries,
118
126
  timeSeriesResults,
119
127
  traceQueries,