@perses-dev/loki-plugin 0.5.1 → 0.6.0-beta.0

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 (309) hide show
  1. package/__mf/css/async/7354.85c2cbf6.css +1 -0
  2. package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
  3. package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
  4. package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
  5. package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
  6. package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
  7. package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
  8. package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
  9. package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
  10. package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
  11. package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
  12. package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
  13. package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
  14. package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
  15. package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
  16. package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
  17. package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
  18. package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
  19. package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
  20. package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
  21. package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
  22. package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
  23. package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
  24. package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
  25. package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
  26. package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
  27. package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
  28. package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
  29. package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
  30. package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
  31. package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
  32. package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
  33. package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
  34. package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
  35. package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
  36. package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
  37. package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
  38. package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
  39. package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
  40. package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
  41. package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
  42. package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
  43. package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
  44. package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
  45. package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
  46. package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
  47. package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
  48. package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
  49. package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
  50. package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
  51. package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
  52. package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
  53. package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
  54. package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
  55. package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
  56. package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
  57. package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
  58. package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
  59. package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
  60. package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
  61. package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
  62. package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
  63. package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
  64. package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
  65. package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
  66. package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
  67. package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
  68. package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
  69. package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
  70. package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
  71. package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
  72. package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
  73. package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
  74. package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
  75. package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
  76. package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
  77. package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
  78. package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
  79. package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
  80. package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
  81. package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
  82. package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
  83. package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
  84. package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
  85. package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
  86. package/__mf/js/Loki.b7bb557c.js +7 -0
  87. package/__mf/js/async/1099.b49be119.js +1 -0
  88. package/__mf/js/async/155.fff99fe4.js +1 -0
  89. package/__mf/js/async/1616.9255be19.js +1 -0
  90. package/__mf/js/async/1728.c02a720c.js +1 -0
  91. package/__mf/js/async/1825.f02ff871.js +1 -0
  92. package/__mf/js/async/1969.f83e62d6.js +1 -0
  93. package/__mf/js/async/2043.79caea8b.js +2 -0
  94. package/__mf/js/async/2386.cebea91a.js +2 -0
  95. package/__mf/js/async/2502.943ec1cf.js +1 -0
  96. package/__mf/js/async/2657.5f9f9807.js +1 -0
  97. package/__mf/js/async/3181.b238b7b9.js +2 -0
  98. package/__mf/js/async/392.22b48ffa.js +2 -0
  99. package/__mf/js/async/4121.e547e3d4.js +2 -0
  100. package/__mf/js/async/4466.293eb237.js +74 -0
  101. package/__mf/js/async/5002.a483400c.js +1 -0
  102. package/__mf/js/async/5038.c6e1ac5e.js +2 -0
  103. package/__mf/js/async/5071.fd1136c7.js +1 -0
  104. package/__mf/js/async/5440.ff741d36.js +2 -0
  105. package/__mf/js/async/5587.e582af3f.js +1 -0
  106. package/__mf/js/async/6100.7d5962ad.js +1 -0
  107. package/__mf/js/async/6274.7255b4e9.js +2 -0
  108. package/__mf/js/async/6688.ad8a65bc.js +2 -0
  109. package/__mf/js/async/6823.7efa6882.js +2 -0
  110. package/__mf/js/async/{6710.a94fd362.js.LICENSE.txt → 6823.7efa6882.js.LICENSE.txt} +17 -1
  111. package/__mf/js/async/6898.11c8bae6.js +1 -0
  112. package/__mf/js/async/7095.0a8daf30.js +1 -0
  113. package/__mf/js/async/7177.7b6606d3.js +1 -0
  114. package/__mf/js/async/7192.b5444c91.js +1 -0
  115. package/__mf/js/async/7354.789ddba3.js +7 -0
  116. package/__mf/js/async/{9811.422fb6ad.js.LICENSE.txt → 7354.789ddba3.js.LICENSE.txt} +19 -1
  117. package/__mf/js/async/7413.972aa60d.js +1 -0
  118. package/__mf/js/async/7862.679d0bd3.js +2 -0
  119. package/__mf/js/async/7968.952aec3b.js +1 -0
  120. package/__mf/js/async/7978.5f20023d.js +1 -0
  121. package/__mf/js/async/8199.98434cf3.js +28 -0
  122. package/__mf/js/async/8356.6bbe764b.js +1 -0
  123. package/__mf/js/async/8470.6f15ddf5.js +2 -0
  124. package/__mf/js/async/873.f59ec7c0.js +1 -0
  125. package/__mf/js/async/8750.fe623c5f.js +3 -0
  126. package/__mf/js/async/8988.cb10cfd3.js +1 -0
  127. package/__mf/js/async/9235.8532a487.js +1 -0
  128. package/__mf/js/async/9389.a063f523.js +2 -0
  129. package/__mf/js/async/941.49e5f628.js +2 -0
  130. package/__mf/js/async/9588.688593c0.js +1 -0
  131. package/__mf/js/async/9754.0c807c53.js +10 -0
  132. package/__mf/js/async/{9754.5d7b21c2.js.LICENSE.txt → 9754.0c807c53.js.LICENSE.txt} +1 -1
  133. package/__mf/js/async/9836.5401a9ec.js +1 -0
  134. package/__mf/js/async/9877.874a39f4.js +38 -0
  135. package/__mf/js/async/9916.d88af7d4.js +22 -0
  136. package/__mf/js/async/__federation_expose_LokiDatasource.6b14cd90.js +2 -0
  137. package/__mf/js/async/__federation_expose_LokiLabelNamesVariable.59592351.js +1 -0
  138. package/__mf/js/async/__federation_expose_LokiLabelValuesVariable.6bdc7a31.js +1 -0
  139. package/__mf/js/async/__federation_expose_LokiLogQLVariable.914390c4.js +1 -0
  140. package/__mf/js/async/__federation_expose_LokiLogQuery.18f1e6d4.js +1 -0
  141. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.48d9f8d9.js +1 -0
  142. package/__mf/js/main.c96737bf.js +7 -0
  143. package/lib/cjs/components/complete.js +11 -4
  144. package/lib/cjs/datasources/loki-datasource/LokiDatasource.js +2 -2
  145. package/lib/cjs/index.js +1 -0
  146. package/lib/cjs/model/loki-client.js +51 -7
  147. package/lib/cjs/queries/loki-log-query/LokiLogQueryEditor.js +2 -6
  148. package/lib/cjs/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +2 -6
  149. package/lib/cjs/queries/loki-time-series-query/get-loki-time-series-data.js +2 -2
  150. package/lib/cjs/variables/LokiLabelNamesVariable.js +53 -0
  151. package/lib/cjs/variables/LokiLabelValuesVariable.js +58 -0
  152. package/lib/cjs/variables/LokiLogQLVariable.js +64 -0
  153. package/lib/cjs/variables/MatcherEditor.js +84 -0
  154. package/lib/cjs/variables/index.js +35 -0
  155. package/lib/cjs/variables/loki-variables.js +239 -0
  156. package/lib/cjs/variables/types.js +16 -0
  157. package/lib/components/complete.js +11 -4
  158. package/lib/components/complete.js.map +1 -1
  159. package/lib/components/logql-extension.d.ts +1 -1
  160. package/lib/components/logql-extension.js.map +1 -1
  161. package/lib/datasources/loki-datasource/LokiDatasource.d.ts.map +1 -1
  162. package/lib/datasources/loki-datasource/LokiDatasource.js +2 -2
  163. package/lib/datasources/loki-datasource/LokiDatasource.js.map +1 -1
  164. package/lib/datasources/loki-datasource/loki-datasource-types.d.ts +1 -1
  165. package/lib/datasources/loki-datasource/loki-datasource-types.js.map +1 -1
  166. package/lib/index.d.ts +1 -0
  167. package/lib/index.d.ts.map +1 -1
  168. package/lib/index.js +1 -0
  169. package/lib/index.js.map +1 -1
  170. package/lib/model/loki-client-types.d.ts +1 -1
  171. package/lib/model/loki-client-types.js.map +1 -1
  172. package/lib/model/loki-client.d.ts +20 -4
  173. package/lib/model/loki-client.d.ts.map +1 -1
  174. package/lib/model/loki-client.js +48 -7
  175. package/lib/model/loki-client.js.map +1 -1
  176. package/lib/model/loki-data-types.d.ts +1 -1
  177. package/lib/model/loki-data-types.d.ts.map +1 -1
  178. package/lib/model/loki-data-types.js.map +1 -1
  179. package/lib/model/loki-selectors.d.ts +1 -1
  180. package/lib/model/loki-selectors.d.ts.map +1 -1
  181. package/lib/model/loki-selectors.js.map +1 -1
  182. package/lib/queries/loki-log-query/LokiLogQueryEditor.d.ts.map +1 -1
  183. package/lib/queries/loki-log-query/LokiLogQueryEditor.js +2 -6
  184. package/lib/queries/loki-log-query/LokiLogQueryEditor.js.map +1 -1
  185. package/lib/queries/loki-log-query/get-loki-log-data.d.ts.map +1 -1
  186. package/lib/queries/loki-log-query/get-loki-log-data.js.map +1 -1
  187. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts +1 -1
  188. package/lib/queries/loki-log-query/log-query-plugin-interface.d.ts.map +1 -1
  189. package/lib/queries/loki-log-query/log-query-plugin-interface.js.map +1 -1
  190. package/lib/queries/loki-log-query/loki-log-query-types.d.ts +1 -1
  191. package/lib/queries/loki-log-query/loki-log-query-types.js.map +1 -1
  192. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.d.ts.map +1 -1
  193. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js +2 -6
  194. package/lib/queries/loki-time-series-query/LokiTimeSeriesQueryEditor.js.map +1 -1
  195. package/lib/queries/loki-time-series-query/get-loki-time-series-data.d.ts.map +1 -1
  196. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js +1 -1
  197. package/lib/queries/loki-time-series-query/get-loki-time-series-data.js.map +1 -1
  198. package/lib/queries/loki-time-series-query/loki-time-series-query-types.d.ts +1 -1
  199. package/lib/queries/loki-time-series-query/loki-time-series-query-types.js.map +1 -1
  200. package/lib/variables/LokiLabelNamesVariable.d.ts +4 -0
  201. package/lib/variables/LokiLabelNamesVariable.d.ts.map +1 -0
  202. package/lib/variables/LokiLabelNamesVariable.js +45 -0
  203. package/lib/variables/LokiLabelNamesVariable.js.map +1 -0
  204. package/lib/variables/LokiLabelValuesVariable.d.ts +4 -0
  205. package/lib/variables/LokiLabelValuesVariable.d.ts.map +1 -0
  206. package/lib/variables/LokiLabelValuesVariable.js +50 -0
  207. package/lib/variables/LokiLabelValuesVariable.js.map +1 -0
  208. package/lib/variables/LokiLogQLVariable.d.ts +4 -0
  209. package/lib/variables/LokiLogQLVariable.d.ts.map +1 -0
  210. package/lib/variables/LokiLogQLVariable.js +56 -0
  211. package/lib/variables/LokiLogQLVariable.js.map +1 -0
  212. package/lib/variables/MatcherEditor.d.ts +9 -0
  213. package/lib/variables/MatcherEditor.d.ts.map +1 -0
  214. package/lib/variables/MatcherEditor.js +71 -0
  215. package/lib/variables/MatcherEditor.js.map +1 -0
  216. package/lib/variables/index.d.ts +7 -0
  217. package/lib/variables/index.d.ts.map +1 -0
  218. package/lib/variables/index.js +20 -0
  219. package/lib/variables/index.js.map +1 -0
  220. package/lib/variables/loki-variables.d.ts +13 -0
  221. package/lib/variables/loki-variables.d.ts.map +1 -0
  222. package/lib/variables/loki-variables.js +211 -0
  223. package/lib/variables/loki-variables.js.map +1 -0
  224. package/lib/variables/types.d.ts +17 -0
  225. package/lib/variables/types.d.ts.map +1 -0
  226. package/lib/variables/types.js +15 -0
  227. package/lib/variables/types.js.map +1 -0
  228. package/mf-manifest.json +313 -133
  229. package/mf-stats.json +345 -133
  230. package/package.json +33 -6
  231. package/__mf/css/async/3061.d3010b86.css +0 -1
  232. package/__mf/css/async/5442.d3010b86.css +0 -1
  233. package/__mf/css/async/7370.d3010b86.css +0 -1
  234. package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
  235. package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
  236. package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
  237. package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
  238. package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
  239. package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
  240. package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
  241. package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
  242. package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
  243. package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
  244. package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
  245. package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
  246. package/__mf/js/Loki.ca74c810.js +0 -6
  247. package/__mf/js/async/1616.60c9a082.js +0 -1
  248. package/__mf/js/async/1728.c6a9c8d6.js +0 -1
  249. package/__mf/js/async/1750.a7bd1384.js +0 -1
  250. package/__mf/js/async/1811.a291a38b.js +0 -28
  251. package/__mf/js/async/1825.5005b3af.js +0 -1
  252. package/__mf/js/async/1969.53d223ca.js +0 -1
  253. package/__mf/js/async/2043.eb7e1c61.js +0 -2
  254. package/__mf/js/async/208.55931f88.js +0 -4
  255. package/__mf/js/async/208.55931f88.js.LICENSE.txt +0 -15
  256. package/__mf/js/async/2386.a3cfef97.js +0 -2
  257. package/__mf/js/async/3059.cb101ca2.js +0 -1
  258. package/__mf/js/async/3181.d2b90b95.js +0 -2
  259. package/__mf/js/async/392.2c7c202d.js +0 -2
  260. package/__mf/js/async/4121.328a1e93.js +0 -2
  261. package/__mf/js/async/4466.21ddc88c.js +0 -74
  262. package/__mf/js/async/5002.29685f8e.js +0 -1
  263. package/__mf/js/async/5071.a03a64fd.js +0 -1
  264. package/__mf/js/async/54.f8265ee0.js +0 -22
  265. package/__mf/js/async/5440.995ad0c5.js +0 -2
  266. package/__mf/js/async/5587.55dbc663.js +0 -1
  267. package/__mf/js/async/6100.e2898f9c.js +0 -1
  268. package/__mf/js/async/6274.293b47c4.js +0 -2
  269. package/__mf/js/async/6283.78af4bc8.js +0 -2
  270. package/__mf/js/async/6710.a94fd362.js +0 -2
  271. package/__mf/js/async/7177.b50a1c64.js +0 -1
  272. package/__mf/js/async/7192.4dea1fd0.js +0 -1
  273. package/__mf/js/async/7370.0ddd349a.js +0 -2
  274. package/__mf/js/async/7968.ec040694.js +0 -1
  275. package/__mf/js/async/7978.38078276.js +0 -1
  276. package/__mf/js/async/8356.5635696c.js +0 -1
  277. package/__mf/js/async/8470.c67049a2.js +0 -2
  278. package/__mf/js/async/8482.07caae1a.js +0 -1
  279. package/__mf/js/async/873.02aa55af.js +0 -1
  280. package/__mf/js/async/8988.1c565f12.js +0 -1
  281. package/__mf/js/async/9071.ed72bdac.js +0 -2
  282. package/__mf/js/async/9235.f2e0e95c.js +0 -1
  283. package/__mf/js/async/9249.d90da2ad.js +0 -1
  284. package/__mf/js/async/9389.29616aa6.js +0 -2
  285. package/__mf/js/async/941.0bce16fe.js +0 -2
  286. package/__mf/js/async/9588.2d82f477.js +0 -1
  287. package/__mf/js/async/9754.5d7b21c2.js +0 -10
  288. package/__mf/js/async/9811.422fb6ad.js +0 -7
  289. package/__mf/js/async/9836.de786d07.js +0 -1
  290. package/__mf/js/async/9877.b76d1711.js +0 -38
  291. package/__mf/js/async/__federation_expose_LokiDatasource.5e30f7dd.js +0 -2
  292. package/__mf/js/async/__federation_expose_LokiLogQuery.c30e299e.js +0 -1
  293. package/__mf/js/async/__federation_expose_LokiTimeSeriesQuery.aa1ffedf.js +0 -1
  294. package/__mf/js/main.34b789cc.js +0 -6
  295. /package/__mf/js/async/{2043.eb7e1c61.js.LICENSE.txt → 2043.79caea8b.js.LICENSE.txt} +0 -0
  296. /package/__mf/js/async/{2386.a3cfef97.js.LICENSE.txt → 2386.cebea91a.js.LICENSE.txt} +0 -0
  297. /package/__mf/js/async/{3181.d2b90b95.js.LICENSE.txt → 3181.b238b7b9.js.LICENSE.txt} +0 -0
  298. /package/__mf/js/async/{392.2c7c202d.js.LICENSE.txt → 392.22b48ffa.js.LICENSE.txt} +0 -0
  299. /package/__mf/js/async/{4121.328a1e93.js.LICENSE.txt → 4121.e547e3d4.js.LICENSE.txt} +0 -0
  300. /package/__mf/js/async/{7370.0ddd349a.js.LICENSE.txt → 5038.c6e1ac5e.js.LICENSE.txt} +0 -0
  301. /package/__mf/js/async/{5440.995ad0c5.js.LICENSE.txt → 5440.ff741d36.js.LICENSE.txt} +0 -0
  302. /package/__mf/js/async/{6274.293b47c4.js.LICENSE.txt → 6274.7255b4e9.js.LICENSE.txt} +0 -0
  303. /package/__mf/js/async/{9071.ed72bdac.js.LICENSE.txt → 6688.ad8a65bc.js.LICENSE.txt} +0 -0
  304. /package/__mf/js/async/{6283.78af4bc8.js.LICENSE.txt → 7862.679d0bd3.js.LICENSE.txt} +0 -0
  305. /package/__mf/js/async/{8470.c67049a2.js.LICENSE.txt → 8470.6f15ddf5.js.LICENSE.txt} +0 -0
  306. /package/__mf/js/async/{9389.29616aa6.js.LICENSE.txt → 9389.a063f523.js.LICENSE.txt} +0 -0
  307. /package/__mf/js/async/{941.0bce16fe.js.LICENSE.txt → 941.49e5f628.js.LICENSE.txt} +0 -0
  308. /package/__mf/js/async/{54.f8265ee0.js.LICENSE.txt → 9916.d88af7d4.js.LICENSE.txt} +0 -0
  309. /package/__mf/js/async/{__federation_expose_LokiDatasource.5e30f7dd.js.LICENSE.txt → __federation_expose_LokiDatasource.6b14cd90.js.LICENSE.txt} +0 -0
@@ -0,0 +1,71 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } 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 { Stack, TextField, Button, IconButton } from '@mui/material';
15
+ import { produce } from 'immer';
16
+ import TrashIcon from 'mdi-material-ui/TrashCan';
17
+ export function MatcherEditor({ matchers, onChange, isReadonly }) {
18
+ return /*#__PURE__*/ _jsxs(Stack, {
19
+ spacing: 1,
20
+ mb: 2,
21
+ children: [
22
+ matchers.map((matcher, index)=>/*#__PURE__*/ _jsxs(Stack, {
23
+ direction: "row",
24
+ alignItems: "center",
25
+ children: [
26
+ /*#__PURE__*/ _jsx(TextField, {
27
+ fullWidth: true,
28
+ label: "Stream Selector",
29
+ value: matcher,
30
+ slotProps: {
31
+ input: {
32
+ readOnly: isReadonly
33
+ }
34
+ },
35
+ onChange: (e)=>{
36
+ const newMatchers = produce(matchers, (draft)=>{
37
+ draft[index] = e.target.value;
38
+ });
39
+ onChange(newMatchers);
40
+ }
41
+ }),
42
+ /*#__PURE__*/ _jsx(IconButton, {
43
+ onClick: ()=>{
44
+ const newMatchers = produce(matchers, (draft)=>{
45
+ draft.splice(index, 1);
46
+ });
47
+ onChange(newMatchers);
48
+ },
49
+ disabled: isReadonly,
50
+ children: /*#__PURE__*/ _jsx(TrashIcon, {})
51
+ })
52
+ ]
53
+ }, index)),
54
+ /*#__PURE__*/ _jsx(Button, {
55
+ fullWidth: false,
56
+ color: "secondary",
57
+ variant: "outlined",
58
+ onClick: ()=>{
59
+ const newMatchers = produce(matchers, (draft)=>{
60
+ draft.push('');
61
+ });
62
+ onChange(newMatchers);
63
+ },
64
+ disabled: isReadonly,
65
+ children: "Add Stream Selector"
66
+ })
67
+ ]
68
+ });
69
+ }
70
+
71
+ //# sourceMappingURL=MatcherEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/variables/MatcherEditor.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 { Stack, TextField, Button, IconButton } from '@mui/material';\nimport { produce } from 'immer';\nimport TrashIcon from 'mdi-material-ui/TrashCan';\nimport { ReactElement } from 'react';\n\ntype MatcherEditorProps = {\n matchers: string[];\n onChange: (matchers: string[]) => void;\n isReadonly?: boolean;\n};\n\nexport function MatcherEditor({ matchers, onChange, isReadonly }: MatcherEditorProps): ReactElement {\n return (\n <Stack spacing={1} mb={2}>\n {matchers.map((matcher, index) => (\n <Stack key={index} direction=\"row\" alignItems=\"center\">\n <TextField\n fullWidth\n label=\"Stream Selector\"\n value={matcher}\n slotProps={{\n input: {\n readOnly: isReadonly,\n },\n }}\n onChange={(e) => {\n const newMatchers = produce(matchers, (draft) => {\n draft[index] = e.target.value;\n });\n onChange(newMatchers);\n }}\n />\n <IconButton\n onClick={() => {\n const newMatchers = produce(matchers, (draft) => {\n draft.splice(index, 1);\n });\n onChange(newMatchers);\n }}\n disabled={isReadonly}\n >\n <TrashIcon />\n </IconButton>\n </Stack>\n ))}\n <Button\n fullWidth={false}\n color=\"secondary\"\n variant=\"outlined\"\n onClick={() => {\n const newMatchers = produce(matchers, (draft) => {\n draft.push('');\n });\n onChange(newMatchers);\n }}\n disabled={isReadonly}\n >\n Add Stream Selector\n </Button>\n </Stack>\n );\n}\n"],"names":["Stack","TextField","Button","IconButton","produce","TrashIcon","MatcherEditor","matchers","onChange","isReadonly","spacing","mb","map","matcher","index","direction","alignItems","fullWidth","label","value","slotProps","input","readOnly","e","newMatchers","draft","target","onClick","splice","disabled","color","variant","push"],"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,KAAK,EAAEC,SAAS,EAAEC,MAAM,EAAEC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,eAAe,2BAA2B;AASjD,OAAO,SAASC,cAAc,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,EAAsB;IAClF,qBACE,MAACT;QAAMU,SAAS;QAAGC,IAAI;;YACpBJ,SAASK,GAAG,CAAC,CAACC,SAASC,sBACtB,MAACd;oBAAkBe,WAAU;oBAAMC,YAAW;;sCAC5C,KAACf;4BACCgB,SAAS;4BACTC,OAAM;4BACNC,OAAON;4BACPO,WAAW;gCACTC,OAAO;oCACLC,UAAUb;gCACZ;4BACF;4BACAD,UAAU,CAACe;gCACT,MAAMC,cAAcpB,QAAQG,UAAU,CAACkB;oCACrCA,KAAK,CAACX,MAAM,GAAGS,EAAEG,MAAM,CAACP,KAAK;gCAC/B;gCACAX,SAASgB;4BACX;;sCAEF,KAACrB;4BACCwB,SAAS;gCACP,MAAMH,cAAcpB,QAAQG,UAAU,CAACkB;oCACrCA,MAAMG,MAAM,CAACd,OAAO;gCACtB;gCACAN,SAASgB;4BACX;4BACAK,UAAUpB;sCAEV,cAAA,KAACJ;;;mBA1BOS;0BA8Bd,KAACZ;gBACCe,WAAW;gBACXa,OAAM;gBACNC,SAAQ;gBACRJ,SAAS;oBACP,MAAMH,cAAcpB,QAAQG,UAAU,CAACkB;wBACrCA,MAAMO,IAAI,CAAC;oBACb;oBACAxB,SAASgB;gBACX;gBACAK,UAAUpB;0BACX;;;;AAKP"}
@@ -0,0 +1,7 @@
1
+ export * from './loki-variables';
2
+ export * from './LokiLabelNamesVariable';
3
+ export * from './LokiLabelValuesVariable';
4
+ export * from './LokiLogQLVariable';
5
+ export * from './MatcherEditor';
6
+ export * from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/variables/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,20 @@
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
+ export * from './loki-variables';
14
+ export * from './LokiLabelNamesVariable';
15
+ export * from './LokiLabelValuesVariable';
16
+ export * from './LokiLogQLVariable';
17
+ export * from './MatcherEditor';
18
+ export * from './types';
19
+
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/variables/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 './loki-variables';\nexport * from './LokiLabelNamesVariable';\nexport * from './LokiLabelValuesVariable';\nexport * from './LokiLogQLVariable';\nexport * from './MatcherEditor';\nexport * from './types';\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;AACjC,cAAc,2BAA2B;AACzC,cAAc,4BAA4B;AAC1C,cAAc,sBAAsB;AACpC,cAAc,kBAAkB;AAChC,cAAc,UAAU"}
@@ -0,0 +1,13 @@
1
+ import { OptionsEditorProps, VariableOption } from '@perses-dev/plugin-system';
2
+ import { ReactElement } from 'react';
3
+ import { LokiStreamResult } from '../model';
4
+ import { LokiLabelNamesVariableOptions, LokiLabelValuesVariableOptions, LokiLogQLVariableOptions } from './types';
5
+ export declare function LokiLabelValuesVariableEditor(props: OptionsEditorProps<LokiLabelValuesVariableOptions>): ReactElement;
6
+ export declare function LokiLabelNamesVariableEditor(props: OptionsEditorProps<LokiLabelNamesVariableOptions>): ReactElement;
7
+ export declare function LokiLogQLVariableEditor(props: OptionsEditorProps<LokiLogQLVariableOptions>): ReactElement;
8
+ export declare function capturingMetric(results: Array<{
9
+ metric: Record<string, string>;
10
+ }>, labelName: string): string[];
11
+ export declare function capturingStreams(results: LokiStreamResult[], labelName: string): string[];
12
+ export declare const stringArrayToVariableOptions: (values?: string[]) => VariableOption[];
13
+ //# sourceMappingURL=loki-variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loki-variables.d.ts","sourceRoot":"","sources":["../../../src/variables/loki-variables.tsx"],"names":[],"mappings":"AAcA,OAAO,EAIL,kBAAkB,EAGlB,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAwC,MAAM,OAAO,CAAC;AAE3E,OAAO,EAOL,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,wBAAwB,EAEzB,MAAM,SAAS,CAAC;AAyBjB,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,kBAAkB,CAAC,8BAA8B,CAAC,GAAG,YAAY,CA8DrH;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,CAAC,6BAA6B,CAAC,GAAG,YAAY,CAwCnH;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,YAAY,CAsEzG;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAS/G;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CASzF;AAED,eAAO,MAAM,4BAA4B,GAAI,SAAS,MAAM,EAAE,KAAG,cAAc,EAM9E,CAAC"}
@@ -0,0 +1,211 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } 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 { FormControl, Stack, TextField } from '@mui/material';
15
+ import { DatasourceSelect, isVariableDatasource, useDatasourceClient, useDatasourceSelectValueToSelector } from '@perses-dev/plugin-system';
16
+ import { produce } from 'immer';
17
+ import { useCallback } from 'react';
18
+ import { LogQLEditor } from '../components';
19
+ import { DEFAULT_LOKI, isDefaultLokiSelector, isLokiDatasourceSelector, LOKI_DATASOURCE_KIND } from '../model';
20
+ import { MatcherEditor } from './MatcherEditor';
21
+ const EMPTY_MATCHERS = [];
22
+ function useLokiDatasourceChangeHandler(value, onChange) {
23
+ return useCallback((next)=>{
24
+ if (isVariableDatasource(next) || isLokiDatasourceSelector(next)) {
25
+ // If they're using the default, just omit the datasource prop
26
+ onChange(produce(value, (draft)=>{
27
+ draft.datasource = !isVariableDatasource(next) && isDefaultLokiSelector(next) ? undefined : next;
28
+ }));
29
+ return;
30
+ }
31
+ throw new Error('Got unexpected non-Loki datasource selector');
32
+ }, [
33
+ onChange,
34
+ value
35
+ ]);
36
+ }
37
+ export function LokiLabelValuesVariableEditor(props) {
38
+ const { onChange, value, value: { datasource } } = props;
39
+ const selectedDatasource = datasource ?? DEFAULT_LOKI;
40
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
41
+ const handleLabelChange = useCallback((e)=>{
42
+ onChange(produce(value, (draft)=>{
43
+ draft.labelName = e.target.value;
44
+ }));
45
+ }, [
46
+ onChange,
47
+ value
48
+ ]);
49
+ const handleMatchEditorsChange = useCallback((matchers)=>{
50
+ onChange(produce(value, (draft)=>{
51
+ draft.matchers = matchers;
52
+ }));
53
+ }, [
54
+ onChange,
55
+ value
56
+ ]);
57
+ return /*#__PURE__*/ _jsxs(Stack, {
58
+ spacing: 2,
59
+ children: [
60
+ /*#__PURE__*/ _jsx(FormControl, {
61
+ margin: "dense",
62
+ children: /*#__PURE__*/ _jsx(DatasourceSelect, {
63
+ datasourcePluginKind: LOKI_DATASOURCE_KIND,
64
+ value: selectedDatasource,
65
+ onChange: handleDatasourceChange,
66
+ disabled: props.isReadonly,
67
+ labelId: "loki-datasource-label",
68
+ label: "Loki Datasource"
69
+ })
70
+ }),
71
+ /*#__PURE__*/ _jsx(TextField, {
72
+ label: "Label Name",
73
+ required: true,
74
+ value: props.value.labelName,
75
+ onChange: handleLabelChange,
76
+ slotProps: {
77
+ input: {
78
+ readOnly: props.isReadonly
79
+ }
80
+ }
81
+ }),
82
+ /*#__PURE__*/ _jsx(MatcherEditor, {
83
+ matchers: props.value.matchers ?? EMPTY_MATCHERS,
84
+ onChange: handleMatchEditorsChange,
85
+ isReadonly: props.isReadonly
86
+ })
87
+ ]
88
+ });
89
+ }
90
+ export function LokiLabelNamesVariableEditor(props) {
91
+ const { onChange, value, value: { datasource } } = props;
92
+ const selectedDatasource = datasource ?? DEFAULT_LOKI;
93
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
94
+ const handleMatchEditorChange = useCallback((matchers)=>{
95
+ onChange(produce(value, (draft)=>{
96
+ draft.matchers = matchers;
97
+ }));
98
+ }, [
99
+ onChange,
100
+ value
101
+ ]);
102
+ return /*#__PURE__*/ _jsxs(Stack, {
103
+ spacing: 2,
104
+ children: [
105
+ /*#__PURE__*/ _jsx(FormControl, {
106
+ margin: "dense",
107
+ children: /*#__PURE__*/ _jsx(DatasourceSelect, {
108
+ datasourcePluginKind: LOKI_DATASOURCE_KIND,
109
+ value: selectedDatasource,
110
+ onChange: handleDatasourceChange,
111
+ disabled: props.isReadonly,
112
+ labelId: "loki-datasource-label",
113
+ label: "Loki Datasource"
114
+ })
115
+ }),
116
+ /*#__PURE__*/ _jsx(MatcherEditor, {
117
+ matchers: props.value.matchers ?? EMPTY_MATCHERS,
118
+ isReadonly: props.isReadonly,
119
+ onChange: handleMatchEditorChange
120
+ })
121
+ ]
122
+ });
123
+ }
124
+ export function LokiLogQLVariableEditor(props) {
125
+ const { onChange, value, value: { datasource } } = props;
126
+ const datasourceSelectValue = datasource ?? DEFAULT_LOKI;
127
+ const selectedDatasource = useDatasourceSelectValueToSelector(datasourceSelectValue, LOKI_DATASOURCE_KIND);
128
+ const { data: client } = useDatasourceClient(selectedDatasource);
129
+ const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);
130
+ const handleOnBlurLogQLChange = useCallback((e)=>{
131
+ onChange(produce(value, (draft)=>{
132
+ draft.expr = e.target.textContent ?? '';
133
+ }));
134
+ }, [
135
+ onChange,
136
+ value
137
+ ]);
138
+ const handleLabelNameChange = useCallback((e)=>{
139
+ onChange(produce(value, (draft)=>{
140
+ draft.labelName = e.target.value;
141
+ }));
142
+ }, [
143
+ onChange,
144
+ value
145
+ ]);
146
+ return /*#__PURE__*/ _jsxs(Stack, {
147
+ spacing: 2,
148
+ children: [
149
+ /*#__PURE__*/ _jsx(FormControl, {
150
+ margin: "dense",
151
+ children: /*#__PURE__*/ _jsx(DatasourceSelect, {
152
+ datasourcePluginKind: LOKI_DATASOURCE_KIND,
153
+ value: datasourceSelectValue,
154
+ onChange: handleDatasourceChange,
155
+ labelId: "loki-datasource-label",
156
+ label: "Loki Datasource",
157
+ disabled: props.isReadonly
158
+ })
159
+ }),
160
+ /*#__PURE__*/ _jsx(LogQLEditor, {
161
+ completionConfig: client ? {
162
+ client
163
+ } : undefined,
164
+ value: value.expr,
165
+ onBlur: handleOnBlurLogQLChange,
166
+ readOnly: props.isReadonly,
167
+ width: "100%"
168
+ }),
169
+ /*#__PURE__*/ _jsx(TextField, {
170
+ label: "Label Name",
171
+ required: true,
172
+ value: props.value.labelName,
173
+ slotProps: {
174
+ input: {
175
+ readOnly: props.isReadonly
176
+ }
177
+ },
178
+ onChange: handleLabelNameChange
179
+ })
180
+ ]
181
+ });
182
+ }
183
+ export function capturingMetric(results, labelName) {
184
+ const captured = new Set();
185
+ for (const sample of results){
186
+ const value = sample.metric[labelName];
187
+ if (value !== undefined) {
188
+ captured.add(value);
189
+ }
190
+ }
191
+ return Array.from(captured);
192
+ }
193
+ export function capturingStreams(results, labelName) {
194
+ const captured = new Set();
195
+ for (const sample of results){
196
+ const value = sample.stream[labelName];
197
+ if (value !== undefined) {
198
+ captured.add(value);
199
+ }
200
+ }
201
+ return Array.from(captured);
202
+ }
203
+ export const stringArrayToVariableOptions = (values)=>{
204
+ if (!values) return [];
205
+ return values.map((value)=>({
206
+ value,
207
+ label: value
208
+ }));
209
+ };
210
+
211
+ //# sourceMappingURL=loki-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/variables/loki-variables.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 { FormControl, Stack, TextField } from '@mui/material';\nimport {\n DatasourceSelect,\n DatasourceSelectProps,\n isVariableDatasource,\n OptionsEditorProps,\n useDatasourceClient,\n useDatasourceSelectValueToSelector,\n VariableOption,\n} from '@perses-dev/plugin-system';\nimport { produce } from 'immer';\nimport { ReactElement, useCallback, ChangeEvent, FocusEvent } from 'react';\nimport { LogQLEditor } from '../components';\nimport {\n DEFAULT_LOKI,\n isDefaultLokiSelector,\n isLokiDatasourceSelector,\n LOKI_DATASOURCE_KIND,\n LokiDatasourceSelector,\n LokiClient,\n LokiStreamResult,\n} from '../model';\nimport { MatcherEditor } from './MatcherEditor';\nimport {\n LokiLabelNamesVariableOptions,\n LokiLabelValuesVariableOptions,\n LokiLogQLVariableOptions,\n LokiVariableOptionsBase,\n} from './types';\n\nconst EMPTY_MATCHERS: string[] = [];\n\nfunction useLokiDatasourceChangeHandler<T extends LokiVariableOptionsBase>(\n value: T,\n onChange: (value: T) => void\n): DatasourceSelectProps['onChange'] {\n return useCallback(\n (next) => {\n if (isVariableDatasource(next) || isLokiDatasourceSelector(next)) {\n // If they're using the default, just omit the datasource prop\n onChange(\n produce(value, (draft) => {\n draft.datasource = !isVariableDatasource(next) && isDefaultLokiSelector(next) ? undefined : next;\n })\n );\n return;\n }\n throw new Error('Got unexpected non-Loki datasource selector');\n },\n [onChange, value]\n );\n}\n\nexport function LokiLabelValuesVariableEditor(props: OptionsEditorProps<LokiLabelValuesVariableOptions>): ReactElement {\n const {\n onChange,\n value,\n value: { datasource },\n } = props;\n const selectedDatasource = datasource ?? DEFAULT_LOKI;\n\n const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);\n\n const handleLabelChange = useCallback(\n (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onChange(\n produce(value, (draft) => {\n draft.labelName = e.target.value;\n })\n );\n },\n [onChange, value]\n );\n\n const handleMatchEditorsChange = useCallback(\n (matchers: string[]) => {\n onChange(\n produce(value, (draft) => {\n draft.matchers = matchers;\n })\n );\n },\n [onChange, value]\n );\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\">\n <DatasourceSelect\n datasourcePluginKind={LOKI_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n disabled={props.isReadonly}\n labelId=\"loki-datasource-label\"\n label=\"Loki Datasource\"\n />\n </FormControl>\n <TextField\n label=\"Label Name\"\n required\n value={props.value.labelName}\n onChange={handleLabelChange}\n slotProps={{\n input: {\n readOnly: props.isReadonly,\n },\n }}\n />\n <MatcherEditor\n matchers={props.value.matchers ?? EMPTY_MATCHERS}\n onChange={handleMatchEditorsChange}\n isReadonly={props.isReadonly}\n />\n </Stack>\n );\n}\n\nexport function LokiLabelNamesVariableEditor(props: OptionsEditorProps<LokiLabelNamesVariableOptions>): ReactElement {\n const {\n onChange,\n value,\n value: { datasource },\n } = props;\n\n const selectedDatasource = datasource ?? DEFAULT_LOKI;\n const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);\n\n const handleMatchEditorChange = useCallback(\n (matchers: string[]) => {\n onChange(\n produce(value, (draft) => {\n draft.matchers = matchers;\n })\n );\n },\n [onChange, value]\n );\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\">\n <DatasourceSelect\n datasourcePluginKind={LOKI_DATASOURCE_KIND}\n value={selectedDatasource}\n onChange={handleDatasourceChange}\n disabled={props.isReadonly}\n labelId=\"loki-datasource-label\"\n label=\"Loki Datasource\"\n />\n </FormControl>\n <MatcherEditor\n matchers={props.value.matchers ?? EMPTY_MATCHERS}\n isReadonly={props.isReadonly}\n onChange={handleMatchEditorChange}\n />\n </Stack>\n );\n}\n\nexport function LokiLogQLVariableEditor(props: OptionsEditorProps<LokiLogQLVariableOptions>): ReactElement {\n const {\n onChange,\n value,\n value: { datasource },\n } = props;\n const datasourceSelectValue = datasource ?? DEFAULT_LOKI;\n const selectedDatasource = useDatasourceSelectValueToSelector(\n datasourceSelectValue,\n LOKI_DATASOURCE_KIND\n ) as LokiDatasourceSelector;\n\n const { data: client } = useDatasourceClient<LokiClient>(selectedDatasource);\n\n const handleDatasourceChange = useLokiDatasourceChangeHandler(value, onChange);\n\n const handleOnBlurLogQLChange = useCallback(\n (e: FocusEvent<HTMLDivElement>) => {\n onChange(\n produce(value, (draft) => {\n draft.expr = e.target.textContent ?? '';\n })\n );\n },\n [onChange, value]\n );\n\n const handleLabelNameChange = useCallback(\n (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onChange(\n produce(value, (draft) => {\n draft.labelName = e.target.value;\n })\n );\n },\n [onChange, value]\n );\n\n return (\n <Stack spacing={2}>\n <FormControl margin=\"dense\">\n <DatasourceSelect\n datasourcePluginKind={LOKI_DATASOURCE_KIND}\n value={datasourceSelectValue}\n onChange={handleDatasourceChange}\n labelId=\"loki-datasource-label\"\n label=\"Loki Datasource\"\n disabled={props.isReadonly}\n />\n </FormControl>\n <LogQLEditor\n completionConfig={client ? { client } : undefined}\n value={value.expr}\n onBlur={handleOnBlurLogQLChange}\n readOnly={props.isReadonly}\n width=\"100%\"\n />\n <TextField\n label=\"Label Name\"\n required\n value={props.value.labelName}\n slotProps={{\n input: {\n readOnly: props.isReadonly,\n },\n }}\n onChange={handleLabelNameChange}\n />\n </Stack>\n );\n}\n\nexport function capturingMetric(results: Array<{ metric: Record<string, string> }>, labelName: string): string[] {\n const captured = new Set<string>();\n for (const sample of results) {\n const value = sample.metric[labelName];\n if (value !== undefined) {\n captured.add(value);\n }\n }\n return Array.from(captured);\n}\n\nexport function capturingStreams(results: LokiStreamResult[], labelName: string): string[] {\n const captured = new Set<string>();\n for (const sample of results) {\n const value = sample.stream[labelName];\n if (value !== undefined) {\n captured.add(value);\n }\n }\n return Array.from(captured);\n}\n\nexport const stringArrayToVariableOptions = (values?: string[]): VariableOption[] => {\n if (!values) return [];\n return values.map((value) => ({\n value,\n label: value,\n }));\n};\n"],"names":["FormControl","Stack","TextField","DatasourceSelect","isVariableDatasource","useDatasourceClient","useDatasourceSelectValueToSelector","produce","useCallback","LogQLEditor","DEFAULT_LOKI","isDefaultLokiSelector","isLokiDatasourceSelector","LOKI_DATASOURCE_KIND","MatcherEditor","EMPTY_MATCHERS","useLokiDatasourceChangeHandler","value","onChange","next","draft","datasource","undefined","Error","LokiLabelValuesVariableEditor","props","selectedDatasource","handleDatasourceChange","handleLabelChange","e","labelName","target","handleMatchEditorsChange","matchers","spacing","margin","datasourcePluginKind","disabled","isReadonly","labelId","label","required","slotProps","input","readOnly","LokiLabelNamesVariableEditor","handleMatchEditorChange","LokiLogQLVariableEditor","datasourceSelectValue","data","client","handleOnBlurLogQLChange","expr","textContent","handleLabelNameChange","completionConfig","onBlur","width","capturingMetric","results","captured","Set","sample","metric","add","Array","from","capturingStreams","stream","stringArrayToVariableOptions","values","map"],"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,KAAK,EAAEC,SAAS,QAAQ,gBAAgB;AAC9D,SACEC,gBAAgB,EAEhBC,oBAAoB,EAEpBC,mBAAmB,EACnBC,kCAAkC,QAE7B,4BAA4B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MAAMC,UAAUH,QAAS;QAC5B,MAAM1C,QAAQ6C,OAAOM,MAAM,CAACtC,UAAU;QACtC,IAAIb,UAAUK,WAAW;YACvBsC,SAASI,GAAG,CAAC/C;QACf;IACF;IACA,OAAOgD,MAAMC,IAAI,CAACN;AACpB;AAEA,OAAO,MAAMS,+BAA+B,CAACC;IAC3C,IAAI,CAACA,QAAQ,OAAO,EAAE;IACtB,OAAOA,OAAOC,GAAG,CAAC,CAACtD,QAAW,CAAA;YAC5BA;YACAuB,OAAOvB;QACT,CAAA;AACF,EAAE"}
@@ -0,0 +1,17 @@
1
+ import { DatasourceSelectValue } from '@perses-dev/plugin-system';
2
+ import { LokiDatasourceSelector } from '../model/loki-selectors';
3
+ export interface LokiVariableOptionsBase {
4
+ datasource?: DatasourceSelectValue<LokiDatasourceSelector>;
5
+ }
6
+ export type LokiLabelNamesVariableOptions = LokiVariableOptionsBase & {
7
+ matchers?: string[];
8
+ };
9
+ export type LokiLabelValuesVariableOptions = LokiVariableOptionsBase & {
10
+ labelName: string;
11
+ matchers?: string[];
12
+ };
13
+ export type LokiLogQLVariableOptions = LokiVariableOptionsBase & {
14
+ expr: string;
15
+ labelName: string;
16
+ };
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/variables/types.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,qBAAqB,CAAC,sBAAsB,CAAC,CAAC;CAC5D;AAED,MAAM,MAAM,6BAA6B,GAAG,uBAAuB,GAAG;IACpE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,uBAAuB,GAAG;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,15 @@
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
+ export { };
14
+
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/variables/types.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 { DatasourceSelectValue } from '@perses-dev/plugin-system';\nimport { LokiDatasourceSelector } from '../model/loki-selectors';\n\nexport interface LokiVariableOptionsBase {\n datasource?: DatasourceSelectValue<LokiDatasourceSelector>;\n}\n\nexport type LokiLabelNamesVariableOptions = LokiVariableOptionsBase & {\n matchers?: string[];\n};\n\nexport type LokiLabelValuesVariableOptions = LokiVariableOptionsBase & {\n labelName: string;\n matchers?: string[];\n};\n\nexport type LokiLogQLVariableOptions = LokiVariableOptionsBase & {\n expr: string;\n labelName: string;\n};\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;AAkBjC,WAGE"}