@perses-dev/plugin-system 0.39.0 → 0.40.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 (253) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +6 -4
  2. package/dist/cjs/components/CalculationSelector/index.js +10 -8
  3. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +380 -0
  4. package/dist/cjs/components/DatasourceEditorForm/index.js +30 -0
  5. package/dist/cjs/components/DatasourceSelect.js +119 -21
  6. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +18 -16
  7. package/dist/cjs/components/LegendOptionsEditor/index.js +10 -8
  8. package/dist/cjs/components/OptionsEditorRadios/OptionsEditorRadios.js +23 -28
  9. package/dist/cjs/components/OptionsEditorRadios/index.js +10 -8
  10. package/dist/cjs/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +6 -4
  11. package/dist/cjs/components/OptionsEditorTabPanel/index.js +10 -8
  12. package/dist/cjs/components/OptionsEditorTabs/OptionsEditorTabs.js +10 -8
  13. package/dist/cjs/components/OptionsEditorTabs/index.js +10 -8
  14. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +13 -11
  15. package/dist/cjs/components/PanelSpecEditor/index.js +10 -8
  16. package/dist/cjs/components/PluginEditor/PluginEditor.js +24 -31
  17. package/dist/cjs/components/PluginEditor/index.js +11 -9
  18. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +5 -3
  19. package/dist/cjs/components/PluginKindSelect/PluginKindSelect.js +23 -12
  20. package/dist/cjs/components/PluginKindSelect/index.js +10 -8
  21. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -9
  22. package/dist/cjs/components/PluginRegistry/index.js +10 -8
  23. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +6 -2
  24. package/dist/cjs/components/PluginSpecEditor/PluginSpecEditor.js +6 -4
  25. package/dist/cjs/components/PluginSpecEditor/index.js +10 -8
  26. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +15 -13
  27. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +21 -19
  28. package/dist/cjs/components/TimeSeriesQueryEditor/index.js +10 -8
  29. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +256 -166
  30. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +32 -28
  31. package/dist/cjs/components/Variables/VariableEditorForm/index.js +11 -9
  32. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +28 -32
  33. package/dist/cjs/components/Variables/index.js +11 -9
  34. package/dist/cjs/components/Variables/variable-model.js +17 -9
  35. package/dist/cjs/components/index.js +22 -19
  36. package/dist/cjs/constants/index.js +10 -8
  37. package/dist/cjs/constants/user-interface-text.js +3 -1
  38. package/dist/cjs/index.js +16 -13
  39. package/dist/cjs/model/index.js +17 -15
  40. package/dist/cjs/model/legend.js +32 -20
  41. package/dist/cjs/model/panels.js +2 -2
  42. package/dist/cjs/model/plugin-base.js +2 -2
  43. package/dist/cjs/model/plugin-loading.js +3 -1
  44. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -11
  45. package/dist/cjs/runtime/DataQueriesProvider/index.js +11 -9
  46. package/dist/cjs/runtime/DataQueriesProvider/model.js +12 -8
  47. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeProvider.js +19 -11
  48. package/dist/cjs/runtime/TimeRangeProvider/index.js +11 -9
  49. package/dist/cjs/runtime/TimeRangeProvider/query-params.js +36 -18
  50. package/dist/cjs/runtime/builtin-variables.js +81 -0
  51. package/dist/cjs/runtime/datasources.js +29 -11
  52. package/dist/cjs/runtime/index.js +16 -13
  53. package/dist/cjs/runtime/plugin-registry.js +41 -11
  54. package/dist/cjs/runtime/template-variables.js +42 -12
  55. package/dist/cjs/runtime/time-series-queries.js +39 -27
  56. package/dist/cjs/stories/shared-utils/decorators/WithDataQueries.js +7 -5
  57. package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +16 -14
  58. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +42 -0
  59. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +19 -13
  60. package/dist/cjs/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js +6 -4
  61. package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +7 -5
  62. package/dist/cjs/stories/shared-utils/decorators/index.js +15 -12
  63. package/dist/cjs/stories/shared-utils/index.js +10 -8
  64. package/dist/cjs/test/index.js +11 -9
  65. package/dist/cjs/test/mock-data.js +3 -1
  66. package/dist/cjs/test/render.js +13 -11
  67. package/dist/cjs/test/test-plugins/bert/index.js +14 -10
  68. package/dist/cjs/test/test-plugins/ernie/index.js +13 -9
  69. package/dist/cjs/test/test-plugins/index.js +11 -9
  70. package/dist/cjs/test-utils/index.js +10 -8
  71. package/dist/cjs/test-utils/mock-plugin-registry.js +8 -4
  72. package/dist/cjs/utils/action.js +43 -0
  73. package/dist/cjs/utils/index.js +11 -8
  74. package/dist/cjs/utils/variables.js +26 -8
  75. package/dist/cjs/validation/datasource.js +30 -0
  76. package/dist/cjs/validation/index.js +32 -0
  77. package/dist/cjs/validation/resource.js +24 -0
  78. package/dist/cjs/validation/variable.js +29 -0
  79. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  80. package/dist/components/CalculationSelector/index.js.map +1 -1
  81. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +15 -0
  82. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -0
  83. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +333 -0
  84. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -0
  85. package/dist/components/DatasourceEditorForm/index.d.ts +2 -0
  86. package/dist/components/DatasourceEditorForm/index.d.ts.map +1 -0
  87. package/dist/components/DatasourceEditorForm/index.js +15 -0
  88. package/dist/components/DatasourceEditorForm/index.js.map +1 -0
  89. package/dist/components/DatasourceSelect.d.ts +5 -0
  90. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  91. package/dist/components/DatasourceSelect.js +102 -19
  92. package/dist/components/DatasourceSelect.js.map +1 -1
  93. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -2
  94. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  95. package/dist/components/LegendOptionsEditor/index.js.map +1 -1
  96. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts +2 -2
  97. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  98. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +16 -23
  99. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  100. package/dist/components/OptionsEditorRadios/index.js.map +1 -1
  101. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  102. package/dist/components/OptionsEditorTabPanel/index.js.map +1 -1
  103. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  104. package/dist/components/OptionsEditorTabs/index.js.map +1 -1
  105. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +2 -2
  106. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  107. package/dist/components/PanelSpecEditor/index.js.map +1 -1
  108. package/dist/components/PluginEditor/PluginEditor.js +15 -24
  109. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  110. package/dist/components/PluginEditor/index.js.map +1 -1
  111. package/dist/components/PluginEditor/plugin-editor-api.d.ts +1 -1
  112. package/dist/components/PluginEditor/plugin-editor-api.js +2 -2
  113. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  114. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts +3 -3
  115. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -1
  116. package/dist/components/PluginKindSelect/PluginKindSelect.js +21 -12
  117. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  118. package/dist/components/PluginKindSelect/index.js.map +1 -1
  119. package/dist/components/PluginRegistry/PluginRegistry.js +3 -3
  120. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  121. package/dist/components/PluginRegistry/index.js.map +1 -1
  122. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  123. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  124. package/dist/components/PluginSpecEditor/index.js.map +1 -1
  125. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +4 -4
  126. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -1
  127. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +1 -1
  128. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -1
  129. package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -1
  130. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +10 -7
  131. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  132. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +200 -112
  133. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  134. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  135. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  136. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts +5 -4
  137. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  138. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +22 -30
  139. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  140. package/dist/components/Variables/index.js.map +1 -1
  141. package/dist/components/Variables/variable-model.js +3 -3
  142. package/dist/components/Variables/variable-model.js.map +1 -1
  143. package/dist/components/index.d.ts +1 -0
  144. package/dist/components/index.d.ts.map +1 -1
  145. package/dist/components/index.js +1 -0
  146. package/dist/components/index.js.map +1 -1
  147. package/dist/constants/index.js.map +1 -1
  148. package/dist/constants/user-interface-text.js.map +1 -1
  149. package/dist/index.d.ts +1 -0
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +1 -0
  152. package/dist/index.js.map +1 -1
  153. package/dist/model/datasource.d.ts +2 -1
  154. package/dist/model/datasource.d.ts.map +1 -1
  155. package/dist/model/datasource.js.map +1 -1
  156. package/dist/model/index.js.map +1 -1
  157. package/dist/model/legend.d.ts +1 -1
  158. package/dist/model/legend.d.ts.map +1 -1
  159. package/dist/model/legend.js +14 -14
  160. package/dist/model/legend.js.map +1 -1
  161. package/dist/model/panels.js.map +1 -1
  162. package/dist/model/plugin-base.js.map +1 -1
  163. package/dist/model/plugin-loading.js.map +1 -1
  164. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +4 -4
  165. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  166. package/dist/runtime/DataQueriesProvider/index.js.map +1 -1
  167. package/dist/runtime/DataQueriesProvider/model.d.ts +3 -2
  168. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  169. package/dist/runtime/DataQueriesProvider/model.js +4 -4
  170. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  171. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  172. package/dist/runtime/TimeRangeProvider/index.js.map +1 -1
  173. package/dist/runtime/TimeRangeProvider/query-params.js +1 -1
  174. package/dist/runtime/TimeRangeProvider/query-params.js.map +1 -1
  175. package/dist/runtime/builtin-variables.d.ts +11 -0
  176. package/dist/runtime/builtin-variables.d.ts.map +1 -0
  177. package/dist/runtime/builtin-variables.js +59 -0
  178. package/dist/runtime/builtin-variables.js.map +1 -0
  179. package/dist/runtime/datasources.d.ts +14 -6
  180. package/dist/runtime/datasources.d.ts.map +1 -1
  181. package/dist/runtime/datasources.js +13 -6
  182. package/dist/runtime/datasources.js.map +1 -1
  183. package/dist/runtime/index.d.ts +1 -0
  184. package/dist/runtime/index.d.ts.map +1 -1
  185. package/dist/runtime/index.js +1 -0
  186. package/dist/runtime/index.js.map +1 -1
  187. package/dist/runtime/plugin-registry.d.ts +2 -0
  188. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  189. package/dist/runtime/plugin-registry.js +19 -2
  190. package/dist/runtime/plugin-registry.js.map +1 -1
  191. package/dist/runtime/template-variables.d.ts +2 -1
  192. package/dist/runtime/template-variables.d.ts.map +1 -1
  193. package/dist/runtime/template-variables.js +27 -8
  194. package/dist/runtime/template-variables.js.map +1 -1
  195. package/dist/runtime/time-series-queries.d.ts +3 -3
  196. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  197. package/dist/runtime/time-series-queries.js +14 -12
  198. package/dist/runtime/time-series-queries.js.map +1 -1
  199. package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -1
  200. package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -1
  201. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts +13 -0
  202. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.d.ts.map +1 -0
  203. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js +39 -0
  204. package/dist/stories/shared-utils/decorators/WithPluginSystemBuiltinVariables.js.map +1 -0
  205. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.d.ts.map +1 -1
  206. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js +11 -7
  207. package/dist/stories/shared-utils/decorators/WithPluginSystemDatasourceStore.js.map +1 -1
  208. package/dist/stories/shared-utils/decorators/WithPluginSystemTemplateVariables.js.map +1 -1
  209. package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -1
  210. package/dist/stories/shared-utils/decorators/index.d.ts +1 -0
  211. package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -1
  212. package/dist/stories/shared-utils/decorators/index.js +1 -0
  213. package/dist/stories/shared-utils/decorators/index.js.map +1 -1
  214. package/dist/stories/shared-utils/index.js.map +1 -1
  215. package/dist/test/index.js.map +1 -1
  216. package/dist/test/mock-data.js.map +1 -1
  217. package/dist/test/render.js +2 -2
  218. package/dist/test/render.js.map +1 -1
  219. package/dist/test/setup-tests.js.map +1 -1
  220. package/dist/test/test-plugins/bert/index.js.map +1 -1
  221. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  222. package/dist/test/test-plugins/index.js.map +1 -1
  223. package/dist/test-utils/index.js.map +1 -1
  224. package/dist/test-utils/mock-plugin-registry.js +2 -2
  225. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  226. package/dist/utils/action.d.ts +4 -0
  227. package/dist/utils/action.d.ts.map +1 -0
  228. package/dist/utils/action.js +27 -0
  229. package/dist/utils/action.js.map +1 -0
  230. package/dist/utils/index.d.ts +1 -0
  231. package/dist/utils/index.d.ts.map +1 -1
  232. package/dist/utils/index.js +1 -0
  233. package/dist/utils/index.js.map +1 -1
  234. package/dist/utils/variables.d.ts.map +1 -1
  235. package/dist/utils/variables.js +17 -5
  236. package/dist/utils/variables.js.map +1 -1
  237. package/dist/validation/datasource.d.ts +19 -0
  238. package/dist/validation/datasource.d.ts.map +1 -0
  239. package/dist/validation/datasource.js +22 -0
  240. package/dist/validation/datasource.js.map +1 -0
  241. package/dist/validation/index.d.ts +4 -0
  242. package/dist/validation/index.d.ts.map +1 -0
  243. package/dist/validation/index.js +17 -0
  244. package/dist/validation/index.js.map +1 -0
  245. package/dist/validation/resource.d.ts +3 -0
  246. package/dist/validation/resource.d.ts.map +1 -0
  247. package/dist/validation/resource.js +16 -0
  248. package/dist/validation/resource.js.map +1 -0
  249. package/dist/validation/variable.d.ts +19 -0
  250. package/dist/validation/variable.d.ts.map +1 -0
  251. package/dist/validation/variable.js +21 -0
  252. package/dist/validation/variable.js.map +1 -0
  253. package/package.json +8 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { useState } from 'react';\nimport { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material';\nimport { InfoTooltip, useSnackbar } from '@perses-dev/components';\nimport Refresh from 'mdi-material-ui/Refresh';\nimport Clipboard from 'mdi-material-ui/ClipboardOutline';\nimport { ListVariableDefinition } from '@perses-dev/core';\nimport { TOOLTIP_TEXT } from '../../../constants';\nimport { useListVariablePluginValues } from '../variable-model';\n\nconst DEFAULT_MAX_PREVIEW_VALUES = 50;\n\ninterface VariablePreviewProps {\n values?: string[];\n onRefresh?: () => void;\n isLoading?: boolean;\n error?: string;\n}\n\nexport function VariablePreview(props: VariablePreviewProps) {\n const { values, onRefresh, isLoading, error } = props;\n const [maxValues, setMaxValues] = useState<number | undefined>(DEFAULT_MAX_PREVIEW_VALUES);\n const { infoSnackbar } = useSnackbar();\n const showAll = () => {\n setMaxValues(undefined);\n };\n let notShown = 0;\n\n if (values && values?.length > 0 && maxValues) {\n notShown = values.length - maxValues;\n }\n\n return (\n <Box>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\" mb={1}>\n <Typography variant=\"h4\">Preview Values</Typography>\n {onRefresh && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshVariableValues}>\n <IconButton onClick={onRefresh} size=\"small\">\n <Refresh />\n </IconButton>\n </InfoTooltip>\n )}\n <InfoTooltip description={TOOLTIP_TEXT.copyVariableValues}>\n <IconButton\n onClick={async () => {\n if (values?.length) {\n await navigator.clipboard.writeText(values.map((value) => value).join(', '));\n infoSnackbar('Preview values copied to clipboard!');\n }\n }}\n size=\"small\"\n >\n <Clipboard />\n </IconButton>\n </InfoTooltip>\n </Stack>\n <Card variant=\"outlined\">\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, m: 2 }}>\n {error && <Alert severity=\"error\">{error}</Alert>}\n {values?.length === 0 && <Alert severity=\"info\">No results</Alert>}\n {isLoading && (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n )}\n {values?.slice(0, maxValues).map((val) => (\n <Chip size=\"small\" key={val} label={val} />\n ))}\n {notShown > 0 && <Chip onClick={showAll} variant=\"outlined\" size=\"small\" label={`+${notShown} more`} />}\n </Box>\n </Card>\n </Box>\n );\n}\n\ninterface VariableListPreviewProps {\n definition: ListVariableDefinition;\n onRefresh: () => void;\n}\n\nexport function VariableListPreview(props: VariableListPreviewProps) {\n const { definition, onRefresh } = props;\n const { data, isFetching, error } = useListVariablePluginValues(definition);\n const errorMessage = (error as Error)?.message;\n\n return (\n <VariablePreview\n values={data?.map((val) => val.value) || []}\n onRefresh={onRefresh}\n isLoading={isFetching}\n error={errorMessage}\n />\n );\n}\n"],"names":["React","useState","Alert","Box","Card","Chip","CircularProgress","IconButton","Stack","Typography","InfoTooltip","useSnackbar","Refresh","Clipboard","TOOLTIP_TEXT","useListVariablePluginValues","DEFAULT_MAX_PREVIEW_VALUES","VariablePreview","props","values","onRefresh","isLoading","error","maxValues","setMaxValues","infoSnackbar","showAll","undefined","notShown","length","direction","spacing","alignItems","mb","variant","description","refreshVariableValues","onClick","size","copyVariableValues","navigator","clipboard","writeText","map","value","join","sx","display","flexWrap","gap","m","severity","width","justifyContent","slice","val","label","VariableListPreview","definition","data","isFetching","errorMessage","message"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,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,CAAEhB,GAAG,CAAC,CAACY,GAAG,GAAKA,GAAG,CAACX,KAAK,CAAC,KAAI,EAAE;QAC3CxB,SAAS,EAAEA,SAAS;QACpBC,SAAS,EAAEuC,UAAU;QACrBtC,KAAK,EAAEuC,YAAY;MACnB,CACF;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/VariablePreview.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { useState } from 'react';\nimport { Alert, Box, Card, Chip, CircularProgress, IconButton, Stack, Typography } from '@mui/material';\nimport { InfoTooltip, useSnackbar } from '@perses-dev/components';\nimport Refresh from 'mdi-material-ui/Refresh';\nimport Clipboard from 'mdi-material-ui/ClipboardOutline';\nimport { ListVariableDefinition } from '@perses-dev/core';\nimport { TOOLTIP_TEXT } from '../../../constants';\nimport { useListVariablePluginValues } from '../variable-model';\n\nconst DEFAULT_MAX_PREVIEW_VALUES = 50;\n\ninterface VariablePreviewProps {\n values?: string[];\n onRefresh?: () => void;\n isLoading?: boolean;\n error?: string;\n}\n\nexport function VariablePreview(props: VariablePreviewProps) {\n const { values, onRefresh, isLoading, error } = props;\n const [maxValues, setMaxValues] = useState<number | undefined>(DEFAULT_MAX_PREVIEW_VALUES);\n const { infoSnackbar } = useSnackbar();\n const showAll = () => {\n setMaxValues(undefined);\n };\n let notShown = 0;\n\n if (values && values?.length > 0 && maxValues) {\n notShown = values.length - maxValues;\n }\n\n return (\n <Box>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\" mb={1}>\n <Typography variant=\"h4\">Preview Values</Typography>\n {onRefresh && (\n <InfoTooltip description={TOOLTIP_TEXT.refreshVariableValues}>\n <IconButton onClick={onRefresh} size=\"small\">\n <Refresh />\n </IconButton>\n </InfoTooltip>\n )}\n <InfoTooltip description={TOOLTIP_TEXT.copyVariableValues}>\n <IconButton\n onClick={async () => {\n if (values?.length) {\n await navigator.clipboard.writeText(values.map((value) => value).join(', '));\n infoSnackbar('Preview values copied to clipboard!');\n }\n }}\n size=\"small\"\n >\n <Clipboard />\n </IconButton>\n </InfoTooltip>\n </Stack>\n <Card variant=\"outlined\">\n <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, m: 2 }}>\n {error && <Alert severity=\"error\">{error}</Alert>}\n {values?.length === 0 && <Alert severity=\"info\">No results</Alert>}\n {isLoading && (\n <Stack width=\"100%\" sx={{ alignItems: 'center', justifyContent: 'center' }}>\n <CircularProgress />\n </Stack>\n )}\n {values?.slice(0, maxValues).map((val) => (\n <Chip size=\"small\" key={val} label={val} />\n ))}\n {notShown > 0 && <Chip onClick={showAll} variant=\"outlined\" size=\"small\" label={`+${notShown} more`} />}\n </Box>\n </Card>\n </Box>\n );\n}\n\ninterface VariableListPreviewProps {\n definition: ListVariableDefinition;\n onRefresh: () => void;\n}\n\nexport function VariableListPreview(props: VariableListPreviewProps) {\n const { definition, onRefresh } = props;\n const { data, isFetching, error } = useListVariablePluginValues(definition);\n const errorMessage = (error as Error)?.message;\n\n return (\n <VariablePreview\n values={data?.map((val) => val.value) || []}\n onRefresh={onRefresh}\n isLoading={isFetching}\n error={errorMessage}\n />\n );\n}\n"],"names":["React","useState","Alert","Box","Card","Chip","CircularProgress","IconButton","Stack","Typography","InfoTooltip","useSnackbar","Refresh","Clipboard","TOOLTIP_TEXT","useListVariablePluginValues","DEFAULT_MAX_PREVIEW_VALUES","VariablePreview","props","values","onRefresh","isLoading","error","maxValues","setMaxValues","infoSnackbar","showAll","undefined","notShown","length","direction","spacing","alignItems","mb","variant","description","refreshVariableValues","onClick","size","copyVariableValues","navigator","clipboard","writeText","map","value","join","sx","display","flexWrap","gap","m","severity","width","justifyContent","slice","val","label","VariableListPreview","definition","data","isFetching","errorMessage","message"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,SAASC,QAAQ,QAAQ,QAAQ;AACxC,SAASC,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;AACxG,SAASC,WAAW,EAAEC,WAAW,QAAQ,yBAAyB;AAClE,OAAOC,aAAa,0BAA0B;AAC9C,OAAOC,eAAe,mCAAmC;AAEzD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,2BAA2B,QAAQ,oBAAoB;AAEhE,MAAMC,6BAA6B;AASnC,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,OAAM,EAAEC,UAAS,EAAEC,UAAS,EAAEC,MAAK,EAAE,GAAGJ;IAChD,MAAM,CAACK,WAAWC,aAAa,GAAGvB,SAA6Be;IAC/D,MAAM,EAAES,aAAY,EAAE,GAAGd;IACzB,MAAMe,UAAU;QACdF,aAAaG;IACf;IACA,IAAIC,WAAW;IAEf,IAAIT,UAAUA,CAAAA,mBAAAA,oBAAAA,KAAAA,IAAAA,OAAQU,MAAK,IAAI,KAAKN,WAAW;QAC7CK,WAAWT,OAAOU,SAASN;IAC7B;IAEA,qBACE,MAACpB;;0BACC,MAACK;gBAAMsB,WAAU;gBAAMC,SAAS;gBAAGC,YAAW;gBAASC,IAAI;;kCACzD,KAACxB;wBAAWyB,SAAQ;kCAAK;;oBACxBd,2BACC,KAACV;wBAAYyB,aAAarB,aAAasB;kCACrC,cAAA,KAAC7B;4BAAW8B,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IAAA,AAACA,MAAiBwC;IAEvC,qBACE,KAAC7C;QACCE,QAAQwC,CAAAA,iBAAAA,kBAAAA,KAAAA,IAAAA,KAAMhB,IAAI,CAACY,MAAQA,IAAIX,WAAU,EAAE;QAC3CxB,WAAWA;QACXC,WAAWuC;QACXtC,OAAOuC;;AAGb"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './VariableEditorForm';\nexport * from './VariablePreview';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './VariableEditorForm';\nexport * from './VariablePreview';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB;AACrC,cAAc,oBAAoB"}
@@ -1,13 +1,13 @@
1
1
  import { VariableDefinition } from '@perses-dev/core';
2
2
  export declare function getInitialState(initialVariableDefinition: VariableDefinition): {
3
3
  name: string;
4
- title: string | undefined;
5
- kind: "ListVariable" | "TextVariable";
6
- description: string | undefined;
4
+ title: string;
5
+ kind: "ListVariable" | "TextVariable" | "BuiltinVariable";
6
+ description: string;
7
7
  listVariableFields: {
8
8
  allowMultiple: boolean;
9
9
  allowAll: boolean;
10
- capturing_regexp: string | undefined;
10
+ capturingRegexp: string | undefined;
11
11
  plugin: {
12
12
  kind: string;
13
13
  spec: {};
@@ -16,6 +16,7 @@ export declare function getInitialState(initialVariableDefinition: VariableDefin
16
16
  };
17
17
  textVariableFields: {
18
18
  value: string;
19
+ constant: boolean;
19
20
  };
20
21
  };
21
22
  export declare type VariableEditorState = ReturnType<typeof getInitialState>;
@@ -1 +1 @@
1
- {"version":3,"file":"variable-editor-form-model.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAmC,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEvF,wBAAgB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;EA+B5E;AAED,oBAAY,mBAAmB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAErE,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CAuC7F"}
1
+ {"version":3,"file":"variable-editor-form-model.d.ts","sourceRoot":"","sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAA0B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,wBAAgB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;EAgC5E;AAED,oBAAY,mBAAmB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAErE,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,mBAAmB,GAAG,kBAAkB,CA+B7F"}
@@ -11,15 +11,16 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export function getInitialState(initialVariableDefinition) {
14
- var ref, ref1;
15
- var _value;
14
+ var _initialVariableDefinition_spec_display, _initialVariableDefinition_spec_display1;
15
+ var _initialVariableDefinition_spec_value, _initialVariableDefinition_spec_constant;
16
16
  const textVariableFields = {
17
- value: (_value = initialVariableDefinition.spec.value) !== null && _value !== void 0 ? _value : ''
17
+ value: (_initialVariableDefinition_spec_value = initialVariableDefinition.spec.value) !== null && _initialVariableDefinition_spec_value !== void 0 ? _initialVariableDefinition_spec_value : '',
18
+ constant: (_initialVariableDefinition_spec_constant = initialVariableDefinition.spec.constant) !== null && _initialVariableDefinition_spec_constant !== void 0 ? _initialVariableDefinition_spec_constant : false
18
19
  };
19
20
  const listVariableFields = {
20
21
  allowMultiple: false,
21
22
  allowAll: false,
22
- capturing_regexp: undefined,
23
+ capturingRegexp: undefined,
23
24
  plugin: {
24
25
  kind: '',
25
26
  spec: {}
@@ -27,39 +28,30 @@ export function getInitialState(initialVariableDefinition) {
27
28
  customAllValue: undefined
28
29
  };
29
30
  if (initialVariableDefinition.kind === 'ListVariable') {
30
- var _allow_all_value;
31
- listVariableFields.allowMultiple = (_allow_all_value = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value !== void 0 ? _allow_all_value : false;
32
- var _allow_all_value1;
33
- listVariableFields.allowAll = (_allow_all_value1 = initialVariableDefinition.spec.allow_all_value) !== null && _allow_all_value1 !== void 0 ? _allow_all_value1 : false;
34
- listVariableFields.capturing_regexp = initialVariableDefinition.spec.capturing_regexp;
31
+ var _initialVariableDefinition_spec_allowAllValue;
32
+ listVariableFields.allowMultiple = (_initialVariableDefinition_spec_allowAllValue = initialVariableDefinition.spec.allowAllValue) !== null && _initialVariableDefinition_spec_allowAllValue !== void 0 ? _initialVariableDefinition_spec_allowAllValue : false;
33
+ var _initialVariableDefinition_spec_allowAllValue1;
34
+ listVariableFields.allowAll = (_initialVariableDefinition_spec_allowAllValue1 = initialVariableDefinition.spec.allowAllValue) !== null && _initialVariableDefinition_spec_allowAllValue1 !== void 0 ? _initialVariableDefinition_spec_allowAllValue1 : false;
35
+ listVariableFields.capturingRegexp = initialVariableDefinition.spec.capturingRegexp;
35
36
  listVariableFields.plugin = initialVariableDefinition.spec.plugin;
36
- listVariableFields.customAllValue = initialVariableDefinition.spec.custom_all_value;
37
+ listVariableFields.customAllValue = initialVariableDefinition.spec.customAllValue;
37
38
  }
39
+ var _initialVariableDefinition_spec_display_name, _initialVariableDefinition_spec_display_description;
38
40
  return {
39
41
  name: initialVariableDefinition.spec.name,
40
- title: (ref = initialVariableDefinition.spec.display) === null || ref === void 0 ? void 0 : ref.name,
42
+ title: (_initialVariableDefinition_spec_display_name = (_initialVariableDefinition_spec_display = initialVariableDefinition.spec.display) === null || _initialVariableDefinition_spec_display === void 0 ? void 0 : _initialVariableDefinition_spec_display.name) !== null && _initialVariableDefinition_spec_display_name !== void 0 ? _initialVariableDefinition_spec_display_name : '',
41
43
  kind: initialVariableDefinition.kind,
42
- description: (ref1 = initialVariableDefinition.spec.display) === null || ref1 === void 0 ? void 0 : ref1.description,
44
+ description: (_initialVariableDefinition_spec_display_description = (_initialVariableDefinition_spec_display1 = initialVariableDefinition.spec.display) === null || _initialVariableDefinition_spec_display1 === void 0 ? void 0 : _initialVariableDefinition_spec_display1.description) !== null && _initialVariableDefinition_spec_display_description !== void 0 ? _initialVariableDefinition_spec_display_description : '',
43
45
  listVariableFields,
44
46
  textVariableFields
45
47
  };
46
48
  }
47
49
  export function getVariableDefinitionFromState(state) {
48
50
  const { name , title , kind , description } = state;
49
- let display = title ? {
50
- name: title
51
- } : undefined;
52
- if (description) {
53
- if (display) {
54
- display.description = description;
55
- } else {
56
- // Name is mandatory if you want to add a description, autofilled by the metadata name if undefined
57
- display = {
58
- name: name,
59
- description: description
60
- };
61
- }
62
- }
51
+ const display = {
52
+ name: title,
53
+ description: description
54
+ };
63
55
  if (kind === 'TextVariable') {
64
56
  return {
65
57
  kind,
@@ -76,11 +68,11 @@ export function getVariableDefinitionFromState(state) {
76
68
  spec: {
77
69
  name,
78
70
  display,
79
- allow_multiple: state.listVariableFields.allowMultiple,
80
- allow_all_value: state.listVariableFields.allowAll,
81
- capturing_regexp: state.listVariableFields.capturing_regexp,
71
+ allowMultiple: state.listVariableFields.allowMultiple,
72
+ allowAllValue: state.listVariableFields.allowAll,
73
+ capturingRegexp: state.listVariableFields.capturingRegexp,
82
74
  plugin: state.listVariableFields.plugin,
83
- custom_all_value: state.listVariableFields.customAllValue
75
+ customAllValue: state.listVariableFields.customAllValue
84
76
  }
85
77
  };
86
78
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Display, TextVariableDefinition, VariableDefinition } from '@perses-dev/core';\n\nexport function getInitialState(initialVariableDefinition: VariableDefinition) {\n const textVariableFields = {\n value: (initialVariableDefinition as TextVariableDefinition).spec.value ?? '',\n };\n\n const listVariableFields = {\n allowMultiple: false,\n allowAll: false,\n capturing_regexp: undefined as string | undefined,\n plugin: {\n kind: '',\n spec: {},\n },\n customAllValue: undefined as string | undefined,\n };\n if (initialVariableDefinition.kind === 'ListVariable') {\n listVariableFields.allowMultiple = initialVariableDefinition.spec.allow_all_value ?? false;\n listVariableFields.allowAll = initialVariableDefinition.spec.allow_all_value ?? false;\n listVariableFields.capturing_regexp = initialVariableDefinition.spec.capturing_regexp;\n listVariableFields.plugin = initialVariableDefinition.spec.plugin;\n listVariableFields.customAllValue = initialVariableDefinition.spec.custom_all_value;\n }\n\n return {\n name: initialVariableDefinition.spec.name,\n title: initialVariableDefinition.spec.display?.name,\n kind: initialVariableDefinition.kind,\n description: initialVariableDefinition.spec.display?.description,\n listVariableFields,\n textVariableFields,\n };\n}\n\nexport type VariableEditorState = ReturnType<typeof getInitialState>;\n\nexport function getVariableDefinitionFromState(state: VariableEditorState): VariableDefinition {\n const { name, title, kind, description } = state;\n\n let display: Display | undefined = title ? { name: title } : undefined;\n if (description) {\n if (display) {\n display.description = description;\n } else {\n // Name is mandatory if you want to add a description, autofilled by the metadata name if undefined\n display = { name: name, description: description };\n }\n }\n\n if (kind === 'TextVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n ...state.textVariableFields,\n },\n };\n }\n\n if (kind === 'ListVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n allow_multiple: state.listVariableFields.allowMultiple,\n allow_all_value: state.listVariableFields.allowAll,\n capturing_regexp: state.listVariableFields.capturing_regexp,\n plugin: state.listVariableFields.plugin,\n custom_all_value: state.listVariableFields.customAllValue,\n },\n };\n }\n throw new Error(`Unknown variable kind: ${kind}`);\n}\n"],"names":["getInitialState","initialVariableDefinition","textVariableFields","value","spec","listVariableFields","allowMultiple","allowAll","capturing_regexp","undefined","plugin","kind","customAllValue","allow_all_value","custom_all_value","name","title","display","description","getVariableDefinitionFromState","state","allow_multiple","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;A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,KAAK,CAACf,kBAAkB,CAACE,QAAQ;gBAClDC,gBAAgB,EAAEY,KAAK,CAACf,kBAAkB,CAACG,gBAAgB;gBAC3DE,MAAM,EAAEU,KAAK,CAACf,kBAAkB,CAACK,MAAM;gBACvCI,gBAAgB,EAAEM,KAAK,CAACf,kBAAkB,CAACO,cAAc;aAC1D;SACF,CAAC;IACJ,CAAC;IACD,MAAM,IAAIU,KAAK,CAAC,CAAC,uBAAuB,EAAEX,IAAI,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
1
+ {"version":3,"sources":["../../../../src/components/Variables/VariableEditorForm/variable-editor-form-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TextVariableDefinition, VariableDefinition } from '@perses-dev/core';\n\nexport function getInitialState(initialVariableDefinition: VariableDefinition) {\n const textVariableFields = {\n value: (initialVariableDefinition as TextVariableDefinition).spec.value ?? '',\n constant: (initialVariableDefinition as TextVariableDefinition).spec.constant ?? false,\n };\n\n const listVariableFields = {\n allowMultiple: false,\n allowAll: false,\n capturingRegexp: undefined as string | undefined,\n plugin: {\n kind: '',\n spec: {},\n },\n customAllValue: undefined as string | undefined,\n };\n if (initialVariableDefinition.kind === 'ListVariable') {\n listVariableFields.allowMultiple = initialVariableDefinition.spec.allowAllValue ?? false;\n listVariableFields.allowAll = initialVariableDefinition.spec.allowAllValue ?? false;\n listVariableFields.capturingRegexp = initialVariableDefinition.spec.capturingRegexp;\n listVariableFields.plugin = initialVariableDefinition.spec.plugin;\n listVariableFields.customAllValue = initialVariableDefinition.spec.customAllValue;\n }\n\n return {\n name: initialVariableDefinition.spec.name,\n title: initialVariableDefinition.spec.display?.name ?? '',\n kind: initialVariableDefinition.kind,\n description: initialVariableDefinition.spec.display?.description ?? '',\n listVariableFields,\n textVariableFields,\n };\n}\n\nexport type VariableEditorState = ReturnType<typeof getInitialState>;\n\nexport function getVariableDefinitionFromState(state: VariableEditorState): VariableDefinition {\n const { name, title, kind, description } = state;\n\n const display = { name: title, description: description };\n\n if (kind === 'TextVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n ...state.textVariableFields,\n },\n };\n }\n\n if (kind === 'ListVariable') {\n return {\n kind,\n spec: {\n name,\n display,\n allowMultiple: state.listVariableFields.allowMultiple,\n allowAllValue: state.listVariableFields.allowAll,\n capturingRegexp: state.listVariableFields.capturingRegexp,\n plugin: state.listVariableFields.plugin,\n customAllValue: state.listVariableFields.customAllValue,\n },\n };\n }\n throw new Error(`Unknown variable kind: ${kind}`);\n}\n"],"names":["getInitialState","initialVariableDefinition","textVariableFields","value","spec","constant","listVariableFields","allowMultiple","allowAll","capturingRegexp","undefined","plugin","kind","customAllValue","allowAllValue","name","title","display","description","getVariableDefinitionFromState","state","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,SAASA,gBAAgBC,yBAA6C;QA0BlEA,yCAEMA;QA1BN,uCACG;IAFZ,MAAMC,qBAAqB;QACzBC,OAAO,CAAA,wCAAA,AAACF,0BAAqDG,KAAKD,mBAA3D,mDAAA,wCAAoE;QAC3EE,UAAU,CAAA,2CAAA,AAACJ,0BAAqDG,KAAKC,sBAA3D,sDAAA,2CAAuE;IACnF;IAEA,MAAMC,qBAAqB;QACzBC,eAAe;QACfC,UAAU;QACVC,iBAAiBC;QACjBC,QAAQ;YACNC,MAAM;YACNR,MAA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AC1CE,QAAQS,MAAMd,mBAAmBK;gBACjCE,gBAAgBO,MAAMd,mBAAmBO;YAC3C;QACF;IACF;IACA,MAAM,IAAIQ,MAAM,CAAC,uBAAuB,EAAET,KAAK,CAAC;AAClD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Variables/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './variable-model';\nexport * from './VariableEditorForm';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/Variables/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './variable-model';\nexport * from './VariableEditorForm';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,uBAAuB"}
@@ -48,7 +48,7 @@ export function useListVariablePluginValues(definition) {
48
48
  variables: allVariables
49
49
  };
50
50
  const spec = definition.spec.plugin.spec;
51
- const capturingRegexp = definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;
51
+ const capturingRegexp = definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;
52
52
  let dependsOnVariables;
53
53
  if (variablePlugin === null || variablePlugin === void 0 ? void 0 : variablePlugin.dependsOn) {
54
54
  const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);
@@ -58,8 +58,8 @@ export function useListVariablePluginValues(definition) {
58
58
  let waitToLoad = false;
59
59
  if (dependsOnVariables) {
60
60
  waitToLoad = dependsOnVariables.some((v)=>{
61
- var ref;
62
- return (ref = variables[v]) === null || ref === void 0 ? void 0 : ref.loading;
61
+ var _variables_v;
62
+ return (_variables_v = variables[v]) === null || _variables_v === void 0 ? void 0 : _variables_v.loading;
63
63
  });
64
64
  }
65
65
  const variablesValueKey = getVariableValuesKey(variables);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Variables/variable-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ListVariableDefinition } from '@perses-dev/core';\nimport { useQuery } from '@tanstack/react-query';\nimport { VariableOption } from '../../model';\nimport {\n useDatasourceStore,\n usePlugin,\n useTemplateVariableValues,\n useTimeRange,\n VariableStateMap,\n} from '../../runtime';\n\nexport function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[] {\n const result: VariableOption[] = [];\n const filteredSet = new Set<string>();\n for (const variableValue of data) {\n const matches = variableValue.value.matchAll(capturedRegexp);\n let concat = '';\n for (const match of matches) {\n for (let i = 1; i < match.length; i++) {\n const m = match[i];\n if (m !== undefined) {\n concat = `${concat}${m}`;\n }\n }\n }\n if (concat !== '' && !filteredSet.has(concat)) {\n // like that we are avoiding to have duplicating variable value\n filteredSet.add(concat);\n result.push({ label: variableValue.label, value: concat });\n }\n }\n return result;\n}\n\nexport function useListVariablePluginValues(definition: ListVariableDefinition) {\n const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);\n const datasourceStore = useDatasourceStore();\n const allVariables = useTemplateVariableValues();\n const { absoluteTimeRange: timeRange, refreshKey } = useTimeRange();\n\n const variablePluginCtx = { timeRange, datasourceStore, variables: allVariables };\n\n const spec = definition.spec.plugin.spec;\n const capturingRegexp =\n definition.spec.capturing_regexp !== undefined ? new RegExp(definition.spec.capturing_regexp, 'g') : undefined;\n\n let dependsOnVariables: string[] | undefined;\n if (variablePlugin?.dependsOn) {\n const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);\n dependsOnVariables = dependencies.variables;\n }\n\n const variables = useTemplateVariableValues(dependsOnVariables);\n\n let waitToLoad = false;\n if (dependsOnVariables) {\n waitToLoad = dependsOnVariables.some((v) => variables[v]?.loading);\n }\n\n const variablesValueKey = getVariableValuesKey(variables);\n\n return useQuery(\n [name, definition, variablesValueKey, timeRange, refreshKey],\n async () => {\n const resp = await variablePlugin?.getVariableOptions(spec, { datasourceStore, variables, timeRange });\n if (resp === undefined) {\n return [];\n }\n if (capturingRegexp === undefined) {\n return resp.data;\n }\n return filterVariableList(resp.data, capturingRegexp);\n },\n { enabled: !!variablePlugin || waitToLoad }\n );\n}\n\n/**\n * Returns a serialized string of the current state of variable values.\n */\nexport function getVariableValuesKey(v: VariableStateMap) {\n return Object.values(v)\n .map((v) => JSON.stringify(v.value))\n .join(',');\n}\n\nexport const VARIABLE_TYPES = [\n { label: 'List', kind: 'ListVariable' },\n { label: 'Text', kind: 'TextVariable' },\n] as const;\n"],"names":["useQuery","useDatasourceStore","usePlugin","useTemplateVariableValues","useTimeRange","filterVariableList","data","capturedRegexp","result","filteredSet","Set","variableValue","matches","value","matchAll","concat","match","i","length","m","undefined","has","add","push","label","useListVariablePluginValues","definition","variablePlugin","spec","plugin","kind","datasourceStore","allVariables","absoluteTimeRange","timeRange","refreshKey","variablePluginCtx","variables","capturingRegexp","capturing_regexp","RegExp","dependsOnVariables","dependsOn","dependencies","waitToLoad","some","v","loading","variablesValueKey","getVariableValuesKey","name","resp","getVariableOptions","enabled","Object","values","map","JSON","stringify","join","VARIABLE_TYPES"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,QAAQ,QAAQ,uBAAuB,CAAC;AAEjD,SACEC,kBAAkB,EAClBC,SAAS,EACTC,yBAAyB,EACzBC,YAAY,QAEP,eAAe,CAAC;AAEvB,OAAO,SAASC,kBAAkB,CAACC,IAAsB,EAAEC,cAAsB,EAAoB;IACnG,MAAMC,MAAM,GAAqB,EAAE,AAAC;IACpC,MAAMC,WAAW,GAAG,IAAIC,GAAG,EAAU,AAAC;IACtC,KAAK,MAAMC,aAAa,IAAIL,IAAI,CAAE;QAChC,MAAMM,OAAO,GAAGD,aAAa,CAACE,KAAK,CAACC,QAAQ,CAACP,cAAc,CAAC,AAAC;QAC7D,IAAIQ,MAAM,GAAG,EAAE,AAAC;QAChB,KAAK,MAAMC,KAAK,IAAIJ,OAAO,CAAE;YAC3B,IAAK,IAAIK,CAAC,GAAG,CAAC,EAAE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ACjC,OAAO+B,IAAI,CAAC7C,IAAI,CAAC;QACnB,CAAC;QACD,OAAOD,kBAAkB,CAAC8C,IAAI,CAAC7C,IAAI,EAAEgC,eAAe,CAAC,CAAC;IACxD,CAAC,EACD;QAAEe,OAAO,EAAE,CAAC,CAAC1B,cAAc,IAAIiB,UAAU;KAAE,CAC5C,CAAC;AACJ,CAAC;AAED;;CAEC,GACD,OAAO,SAASK,oBAAoB,CAACH,CAAmB,EAAE;IACxD,OAAOQ,MAAM,CAACC,MAAM,CAACT,CAAC,CAAC,CACpBU,GAAG,CAAC,CAACV,CAAC,GAAKW,IAAI,CAACC,SAAS,CAACZ,CAAC,CAACjC,KAAK,CAAC,CAAC,CACnC8C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,OAAO,MAAMC,cAAc,GAAG;IAC5B;QAAEpC,KAAK,EAAE,MAAM;QAAEM,IAAI,EAAE,cAAc;KAAE;IACvC;QAAEN,KAAK,EAAE,MAAM;QAAEM,IAAI,EAAE,cAAc;KAAE;CACxC,AAAS,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/Variables/variable-model.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ListVariableDefinition } from '@perses-dev/core';\nimport { useQuery } from '@tanstack/react-query';\nimport { VariableOption } from '../../model';\nimport {\n useDatasourceStore,\n usePlugin,\n useTemplateVariableValues,\n useTimeRange,\n VariableStateMap,\n} from '../../runtime';\n\nexport function filterVariableList(data: VariableOption[], capturedRegexp: RegExp): VariableOption[] {\n const result: VariableOption[] = [];\n const filteredSet = new Set<string>();\n for (const variableValue of data) {\n const matches = variableValue.value.matchAll(capturedRegexp);\n let concat = '';\n for (const match of matches) {\n for (let i = 1; i < match.length; i++) {\n const m = match[i];\n if (m !== undefined) {\n concat = `${concat}${m}`;\n }\n }\n }\n if (concat !== '' && !filteredSet.has(concat)) {\n // like that we are avoiding to have duplicating variable value\n filteredSet.add(concat);\n result.push({ label: variableValue.label, value: concat });\n }\n }\n return result;\n}\n\nexport function useListVariablePluginValues(definition: ListVariableDefinition) {\n const { data: variablePlugin } = usePlugin('Variable', definition.spec.plugin.kind);\n const datasourceStore = useDatasourceStore();\n const allVariables = useTemplateVariableValues();\n const { absoluteTimeRange: timeRange, refreshKey } = useTimeRange();\n\n const variablePluginCtx = { timeRange, datasourceStore, variables: allVariables };\n\n const spec = definition.spec.plugin.spec;\n const capturingRegexp =\n definition.spec.capturingRegexp !== undefined ? new RegExp(definition.spec.capturingRegexp, 'g') : undefined;\n\n let dependsOnVariables: string[] | undefined;\n if (variablePlugin?.dependsOn) {\n const dependencies = variablePlugin.dependsOn(spec, variablePluginCtx);\n dependsOnVariables = dependencies.variables;\n }\n\n const variables = useTemplateVariableValues(dependsOnVariables);\n\n let waitToLoad = false;\n if (dependsOnVariables) {\n waitToLoad = dependsOnVariables.some((v) => variables[v]?.loading);\n }\n\n const variablesValueKey = getVariableValuesKey(variables);\n\n return useQuery(\n [name, definition, variablesValueKey, timeRange, refreshKey],\n async () => {\n const resp = await variablePlugin?.getVariableOptions(spec, { datasourceStore, variables, timeRange });\n if (resp === undefined) {\n return [];\n }\n if (capturingRegexp === undefined) {\n return resp.data;\n }\n return filterVariableList(resp.data, capturingRegexp);\n },\n { enabled: !!variablePlugin || waitToLoad }\n );\n}\n\n/**\n * Returns a serialized string of the current state of variable values.\n */\nexport function getVariableValuesKey(v: VariableStateMap) {\n return Object.values(v)\n .map((v) => JSON.stringify(v.value))\n .join(',');\n}\n\nexport const VARIABLE_TYPES = [\n { label: 'List', kind: 'ListVariable' },\n { label: 'Text', kind: 'TextVariable' },\n] as const;\n"],"names":["useQuery","useDatasourceStore","usePlugin","useTemplateVariableValues","useTimeRange","filterVariableList","data","capturedRegexp","result","filteredSet","Set","variableValue","matches","value","matchAll","concat","match","i","length","m","undefined","has","add","push","label","useListVariablePluginValues","definition","variablePlugin","spec","plugin","kind","datasourceStore","allVariables","absoluteTimeRange","timeRange","refreshKey","variablePluginCtx","variables","capturingRegexp","RegExp","dependsOnVariables","dependsOn","dependencies","waitToLoad","some","v","loading","variablesValueKey","getVariableValuesKey","name","resp","getVariableOptions","enabled","Object","values","map","JSON","stringify","join","VARIABLE_TYPES"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,SAASA,QAAQ,QAAQ,wBAAwB;AAEjD,SACEC,kBAAkB,EAClBC,SAAS,EACTC,yBAAyB,EACzBC,YAAY,QAEP,gBAAgB;AAEvB,OAAO,SAASC,mBAAmBC,IAAsB,EAAEC,cAAsB;IAC/E,MAAMC,SAA2B,EAAE;IACnC,MAAMC,cAAc,IAAIC;IACxB,KAAK,MAAMC,iBAAiBL,KAAM;QAChC,MAAMM,UAAUD,cAAcE,MAAMC,SAASP;QAC7C,IAAIQ,SAAS;QACb,KAAK,MAAMC,SAASJ,QAAS;YAC3B,IAAK,IAAIK,IAAI,GAAGA,IAAID,MAAME,QAAQD,IAAK;gBACrC,MAAME,IAAIH,KAAK,CAACC,EAAE;gBAClB,IAAIE,MAAMC,WAAW;oBACnBL,SAAS,CAAC,EAAEA,OAAO,EAAEI,EAAE,CAAC;gBAC1B;YACF;QACF;QACA,IAAIJ,WAAW,MAAM,CAACN,YAAYY,IAAIN,SAAS;YAC7C,+DAA+D;YAC/DN,YAAYa,IAAIP;YAChBP,OAAOe,KAAK;gBAAEC,OAAOb,cAA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c,SAAS,CAAC,CAACzB,kBAAkBgB;IAAW;AAE9C;AAEA;;CAEC,GACD,OAAO,SAASK,qBAAqBH,CAAmB;IACtD,OAAOQ,OAAOC,OAAOT,GAClBU,IAAI,CAACV,IAAMW,KAAKC,UAAUZ,EAAEhC,QAC5B6C,KAAK;AACV;AAEA,OAAO,MAAMC,iBAAiB;IAC5B;QAAEnC,OAAO;QAAQM,MAAM;IAAe;IACtC;QAAEN,OAAO;QAAQM,MAAM;IAAe;CACvC,CAAU"}
@@ -1,4 +1,5 @@
1
1
  export * from './CalculationSelector';
2
+ export * from './DatasourceEditorForm';
2
3
  export * from './DatasourceSelect';
3
4
  export * from './LegendOptionsEditor';
4
5
  export * from './OptionsEditorRadios';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC"}
@@ -11,6 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  export * from './CalculationSelector';
14
+ export * from './DatasourceEditorForm';
14
15
  export * from './DatasourceSelect';
15
16
  export * from './LegendOptionsEditor';
16
17
  export * from './OptionsEditorRadios';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './CalculationSelector';\nexport * from './DatasourceSelect';\nexport * from './LegendOptionsEditor';\nexport * from './OptionsEditorRadios';\nexport * from './OptionsEditorTabs';\nexport * from './PanelSpecEditor';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeSeriesQueryEditor';\nexport * from './Variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './CalculationSelector';\nexport * from './DatasourceEditorForm';\nexport * from './DatasourceSelect';\nexport * from './LegendOptionsEditor';\nexport * from './OptionsEditorRadios';\nexport * from './OptionsEditorTabs';\nexport * from './PanelSpecEditor';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeSeriesQueryEditor';\nexport * from './Variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAwB;AACtC,cAAc,yBAAyB;AACvC,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,mBAAmB;AACjC,cAAc,qBAAqB;AACnC,cAAc,0BAA0B;AACxC,cAAc,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './user-interface-text';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"sources":["../../src/constants/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './user-interface-text';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/constants/user-interface-text.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const TOOLTIP_TEXT = {\n // Variable editor buttons\n refreshVariableValues: 'Refresh values',\n copyVariableValues: 'Copy values to clipboard',\n};\n"],"names":["TOOLTIP_TEXT","refreshVariableValues","copyVariableValues"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,MAAMA,YAAY,GAAG;IAC1B,0BAA0B;IAC1BC,qBAAqB,EAAE,gBAAgB;IACvCC,kBAAkB,EAAE,0BAA0B;CAC/C,CAAC"}
1
+ {"version":3,"sources":["../../src/constants/user-interface-text.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport const TOOLTIP_TEXT = {\n // Variable editor buttons\n refreshVariableValues: 'Refresh values',\n copyVariableValues: 'Copy values to clipboard',\n};\n"],"names":["TOOLTIP_TEXT","refreshVariableValues","copyVariableValues"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,MAAMA,eAAe;IAC1B,0BAA0B;IAC1BC,uBAAuB;IACvBC,oBAAoB;AACtB,EAAE"}
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './model';
4
4
  export * from './runtime';
5
5
  export * from './test-utils';
6
6
  export * from './utils';
7
+ export * from './validation';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -16,5 +16,6 @@ export * from './model';
16
16
  export * from './runtime';
17
17
  export * from './test-utils';
18
18
  export * from './utils';
19
+ export * from './validation';
19
20
 
20
21
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './test-utils';\nexport * from './utils';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './components';\nexport * from './constants';\nexport * from './model';\nexport * from './runtime';\nexport * from './test-utils';\nexport * from './utils';\nexport * from './validation';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe"}
@@ -1,10 +1,11 @@
1
- import { UnknownSpec } from '@perses-dev/core';
1
+ import { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/core';
2
2
  import { Plugin } from './plugin-base';
3
3
  /**
4
4
  * Plugin that defines options for an external system that Perses talks to for data.
5
5
  */
6
6
  export interface DatasourcePlugin<Spec = UnknownSpec, Client = unknown> extends Plugin<Spec> {
7
7
  createClient: (spec: Spec, options: DatasourceClientOptions) => Client;
8
+ getBuiltinVariableDefinitions?: () => BuiltinVariableDefinition[];
8
9
  }
9
10
  export interface DatasourceClientOptions {
10
11
  proxyUrl?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,OAAO,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC1F,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,KAAK,MAAM,CAAC;CACxE;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC"}
1
+ {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,OAAO,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IAC1F,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,KAAK,MAAM,CAAC;IAEvE,6BAA6B,CAAC,EAAE,MAAM,yBAAyB,EAAE,CAAC;CACnE;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/datasource.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { UnknownSpec } from '@perses-dev/core';\nimport { Plugin } from './plugin-base';\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface DatasourcePlugin<Spec = UnknownSpec, Client = unknown> extends Plugin<Spec> {\n createClient: (spec: Spec, options: DatasourceClientOptions) => Client;\n}\n\nexport interface DatasourceClientOptions {\n proxyUrl?: string;\n}\n\n/**\n * Common properties for all clients\n */\nexport interface DatasourceClient {\n // TODO: set kind and define healthCheck function\n kind?: string;\n healthCheck?: () => Promise<boolean>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAqBC"}
1
+ {"version":3,"sources":["../../src/model/datasource.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { BuiltinVariableDefinition, UnknownSpec } from '@perses-dev/core';\nimport { Plugin } from './plugin-base';\n\n/**\n * Plugin that defines options for an external system that Perses talks to for data.\n */\nexport interface DatasourcePlugin<Spec = UnknownSpec, Client = unknown> extends Plugin<Spec> {\n createClient: (spec: Spec, options: DatasourceClientOptions) => Client;\n // Provide builtin variable definitions available on the datasource. Optional\n getBuiltinVariableDefinitions?: () => BuiltinVariableDefinition[];\n}\n\nexport interface DatasourceClientOptions {\n proxyUrl?: string;\n}\n\n/**\n * Common properties for all clients\n */\nexport interface DatasourceClient {\n // TODO: set kind and define healthCheck function\n kind?: string;\n healthCheck?: () => Promise<boolean>;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAuBC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './datasource';\nexport * from './legend';\nexport * from './panels';\nexport * from './plugins';\nexport * from './plugin-base';\nexport * from './plugin-loading';\nexport * from './time-series-queries';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './datasource';\nexport * from './legend';\nexport * from './panels';\nexport * from './plugins';\nexport * from './plugin-base';\nexport * from './plugin-loading';\nexport * from './time-series-queries';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe;AAC7B,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,cAAc"}
@@ -11,6 +11,6 @@ export declare type LegendSingleSelectConfig = {
11
11
  export declare const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>>;
12
12
  export declare const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>>;
13
13
  export declare const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>>;
14
- export declare const LEGEND_VALUE_CONFIG: Partial<Record<"First" | "Last" | "FirstNumber" | "LastNumber" | "Mean" | "Sum" | "Min" | "Max", LegendSingleSelectConfig>>;
14
+ export declare const LEGEND_VALUE_CONFIG: Partial<Record<"first" | "last" | "first-number" | "last-number" | "mean" | "sum" | "min" | "max", LegendSingleSelectConfig>>;
15
15
  export declare function validateLegendSpec(legend?: LegendOptionsBase): boolean;
16
16
  //# sourceMappingURL=legend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,eAAe,EAGf,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAU1B,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AACF,oBAAY,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAKxD,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAG/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,6HAIgC,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,iBAAiB,WAgB5D"}
1
+ {"version":3,"file":"legend.d.ts","sourceRoot":"","sources":["../../src/model/legend.ts"],"names":[],"mappings":"AAaA,OAAO,EAEL,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,eAAe,EAGf,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAU1B,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAC;AACF,oBAAY,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAKxD,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAG/F,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAGrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,+HAIgC,CAAC;AAEjE,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,iBAAiB,WAgB5D"}
@@ -19,36 +19,36 @@ import { CALCULATIONS_CONFIG, isValidLegendMode, isValidLegendPosition, isValidL
19
19
  // that we only use a subset of calculations for the legend because the calculations
20
20
  // are also used by other features.
21
21
  export const legendValues = [
22
- 'Mean',
23
- 'First',
24
- 'FirstNumber',
25
- 'Last',
26
- 'LastNumber',
27
- 'Min',
28
- 'Max',
29
- 'Sum'
22
+ 'mean',
23
+ 'first',
24
+ 'first-number',
25
+ 'last',
26
+ 'last-number',
27
+ 'min',
28
+ 'max',
29
+ 'sum'
30
30
  ];
31
31
  export const LEGEND_POSITIONS_CONFIG = {
32
- Bottom: {
32
+ bottom: {
33
33
  label: 'Bottom'
34
34
  },
35
- Right: {
35
+ right: {
36
36
  label: 'Right'
37
37
  }
38
38
  };
39
39
  export const LEGEND_MODE_CONFIG = {
40
- List: {
40
+ list: {
41
41
  label: 'List'
42
42
  },
43
- Table: {
43
+ table: {
44
44
  label: 'Table'
45
45
  }
46
46
  };
47
47
  export const LEGEND_SIZE_CONFIG = {
48
- Small: {
48
+ small: {
49
49
  label: 'Small'
50
50
  },
51
- Medium: {
51
+ medium: {
52
52
  label: 'Medium'
53
53
  }
54
54
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n CALCULATIONS_CONFIG,\n CalculationType,\n LegendMode,\n LegendOptionsBase,\n LegendPositions,\n isValidLegendMode,\n isValidLegendPosition,\n LegendSize,\n isValidLegendSize,\n} from '@perses-dev/core';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'Mean',\n 'First',\n 'FirstNumber',\n 'Last',\n 'LastNumber',\n 'Min',\n 'Max',\n 'Sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: LegendValue[];\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n Bottom: { label: 'Bottom' },\n Right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n List: { label: 'List' },\n Table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n Small: { label: 'Small' },\n Medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce((config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n}, {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase) {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["CALCULATIONS_CONFIG","isValidLegendMode","isValidLegendPosition","isValidLegendSize","legendValues","LEGEND_POSITIONS_CONFIG","Bottom","label","Right","LEGEND_MODE_CONFIG","List","Table","LEGEND_SIZE_CONFIG","Small","Medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;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,QAAQ,CAAC,EAAE;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAIF,MAAM,CAACG,IAAI,IAAI,CAACtB,iBAAiB,CAACmB,MAAM,CAACG,IAAI,CAAC,EAAE;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAIH,MAAM,CAACI,IAAI,IAAI,CAACrB,iBAAiB,CAACiB,MAAM,CAACI,IAAI,CAAC,EAAE;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n CALCULATIONS_CONFIG,\n CalculationType,\n LegendMode,\n LegendOptionsBase,\n LegendPositions,\n isValidLegendMode,\n isValidLegendPosition,\n LegendSize,\n isValidLegendSize,\n} from '@perses-dev/core';\n\n// This file contains legend-related model code specific to panel plugin specs.\n// See the `core` package for common/shared legend model code and the\n// `components` package for legend model code specific to the Legend component.\n\n// Explicity listing the calculations we intend to use for legend values because\n// we want them ordered in a specific way, and it may be possible in the future\n// that we only use a subset of calculations for the legend because the calculations\n// are also used by other features.\nexport const legendValues: CalculationType[] = [\n 'mean',\n 'first',\n 'first-number',\n 'last',\n 'last-number',\n 'min',\n 'max',\n 'sum',\n];\nexport type LegendValue = (typeof legendValues)[number];\n\n// Note: explicitly defining different options for the legend spec and\n// legend component that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport interface LegendSpecOptions extends LegendOptionsBase {\n values?: LegendValue[];\n}\n\nexport type LegendSingleSelectConfig = {\n label: string;\n description?: string;\n};\n\nexport const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>> = {\n bottom: { label: 'Bottom' },\n right: { label: 'Right' },\n};\n\nexport const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>> = {\n list: { label: 'List' },\n table: { label: 'Table' },\n};\n\nexport const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>> = {\n small: { label: 'Small' },\n medium: { label: 'Medium' },\n};\n\nexport const LEGEND_VALUE_CONFIG = legendValues.reduce((config, value) => {\n config[value] = CALCULATIONS_CONFIG[value];\n\n return config;\n}, {} as Partial<Record<LegendValue, LegendSingleSelectConfig>>);\n\nexport function validateLegendSpec(legend?: LegendOptionsBase) {\n if (legend === undefined) {\n // undefined is valid since this is how legend is hidden by default\n return true;\n }\n if (!isValidLegendPosition(legend.position)) {\n return false;\n }\n if (legend.mode && !isValidLegendMode(legend.mode)) {\n return false;\n }\n if (legend.size && !isValidLegendSize(legend.size)) {\n return false;\n }\n\n return true;\n}\n"],"names":["CALCULATIONS_CONFIG","isValidLegendMode","isValidLegendPosition","isValidLegendSize","legendValues","LEGEND_POSITIONS_CONFIG","bottom","label","right","LEGEND_MODE_CONFIG","list","table","LEGEND_SIZE_CONFIG","small","medium","LEGEND_VALUE_CONFIG","reduce","config","value","validateLegendSpec","legend","undefined","position","mode","size"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SACEA,mBAAmB,EAKnBC,iBAAiB,EACjBC,qBAAqB,EAErBC,iBAAiB,QACZ,mBAAmB;AAE1B,+EAA+E;AAC/E,qEAAqE;AACrE,+EAA+E;AAE/E,gFAAgF;AAChF,+EAA+E;AAC/E,oFAAoF;AACpF,mCAAmC;AACnC,OAAO,MAAMC,eAAkC;IAC7C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC;AAeF,OAAO,MAAMC,0BAAuF;IAClGC,QAAQ;QAAEC,OAAO;IAAS;IAC1BC,OAAO;QAAED,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAME,qBAA6E;IACxFC,MAAM;QAAEH,OAAO;IAAO;IACtBI,OAAO;QAAEJ,OAAO;IAAQ;AAC1B,EAAE;AAEF,OAAO,MAAMK,qBAA6E;IACxFC,OAAO;QAAEN,OAAO;IAAQ;IACxBO,QAAQ;QAAEP,OAAO;IAAS;AAC5B,EAAE;AAEF,OAAO,MAAMQ,sBAAsBX,aAAaY,OAAO,CAACC,QAAQC;IAC9DD,MAAM,CAACC,MAAM,GAAGlB,mBAAmB,CAACkB,MAAM;IAE1C,OAAOD;AACT,GAAG,CAAC,GAA6D;AAEjE,OAAO,SAASE,mBAAmBC,MAA0B;IAC3D,IAAIA,WAAWC,WAAW;QACxB,mEAAmE;QACnE,OAAO;IACT;IACA,IAAI,CAACnB,sBAAsBkB,OAAOE,WAAW;QAC3C,OAAO;IACT;IACA,IAAIF,OAAOG,QAAQ,CAACtB,kBAAkBmB,OAAOG,OAAO;QAClD,OAAO;IACT;IACA,IAAIH,OAAOI,QAAQ,CAACrB,kBAAkBiB,OAAOI,OAAO;QAClD,OAAO;IACT;IAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { UnknownSpec } from '@perses-dev/core';\nimport { OptionsEditorTab } from '../components';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n/**\n * Plugin the provides custom visualizations inside of a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<PanelProps<Spec>>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,KAAK,MAAM,OAAO,CAAC"}
1
+ {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { UnknownSpec } from '@perses-dev/core';\nimport { OptionsEditorTab } from '../components';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n/**\n * Plugin the provides custom visualizations inside of a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<PanelProps<Spec>>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,WAAW,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition } from '@perses-dev/core';\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorProps<Spec>>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n isReadonly?: boolean;\n}\n\n/**\n * Common props passed to query editor component\n */\nexport interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {\n queries: QueryDefinition[];\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,KAAK,MAAM,OAAO,CAAC"}
1
+ {"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition } from '@perses-dev/core';\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorProps<Spec>>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n isReadonly?: boolean;\n}\n\n/**\n * Common props passed to query editor component\n */\nexport interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {\n queries: QueryDefinition[];\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,WAAW,QAAQ"}