@perses-dev/plugin-system 0.27.0 → 0.29.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 (121) hide show
  1. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +75 -0
  2. package/dist/cjs/components/PanelSpecEditor/index.js +28 -0
  3. package/dist/cjs/components/PluginEditor/PluginEditor.js +2 -2
  4. package/dist/cjs/components/PluginEditor/plugin-editor-api.js +27 -6
  5. package/dist/cjs/components/{PluginKindSelect.js → PluginKindSelect/PluginKindSelect.js} +1 -1
  6. package/dist/cjs/components/PluginKindSelect/index.js +28 -0
  7. package/dist/cjs/components/{PluginSpecEditor.js → PluginSpecEditor/PluginSpecEditor.js} +2 -30
  8. package/dist/cjs/components/PluginSpecEditor/index.js +28 -0
  9. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +142 -0
  10. package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +94 -0
  11. package/dist/cjs/components/TimeSeriesQueryEditor/index.js +28 -0
  12. package/dist/cjs/components/index.js +1 -0
  13. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +88 -0
  14. package/dist/cjs/runtime/DataQueriesProvider/index.js +29 -0
  15. package/dist/cjs/runtime/DataQueriesProvider/model.js +16 -0
  16. package/dist/cjs/runtime/index.js +1 -0
  17. package/dist/cjs/test/render.js +4 -1
  18. package/dist/cjs/test/test-plugins/bert/index.js +27 -20
  19. package/dist/cjs/test/test-plugins/ernie/index.js +37 -4
  20. package/dist/cjs/test-utils/mock-plugin-registry.js +4 -1
  21. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +10 -0
  22. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -0
  23. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +69 -0
  24. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -0
  25. package/dist/components/PanelSpecEditor/index.d.ts +2 -0
  26. package/dist/components/PanelSpecEditor/index.d.ts.map +1 -0
  27. package/dist/components/PanelSpecEditor/index.js +15 -0
  28. package/dist/components/PanelSpecEditor/index.js.map +1 -0
  29. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  30. package/dist/components/PluginEditor/PluginEditor.js +2 -2
  31. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  32. package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -1
  33. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  34. package/dist/components/PluginEditor/plugin-editor-api.js +27 -6
  35. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  36. package/dist/components/{PluginKindSelect.d.ts → PluginKindSelect/PluginKindSelect.d.ts} +1 -1
  37. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -0
  38. package/dist/components/{PluginKindSelect.js → PluginKindSelect/PluginKindSelect.js} +1 -1
  39. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -0
  40. package/dist/components/PluginKindSelect/index.d.ts +2 -0
  41. package/dist/components/PluginKindSelect/index.d.ts.map +1 -0
  42. package/dist/components/PluginKindSelect/index.js +15 -0
  43. package/dist/components/PluginKindSelect/index.js.map +1 -0
  44. package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
  45. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  46. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  47. package/dist/components/{PluginSpecEditor.d.ts → PluginSpecEditor/PluginSpecEditor.d.ts} +1 -1
  48. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -0
  49. package/dist/components/{PluginSpecEditor.js → PluginSpecEditor/PluginSpecEditor.js} +3 -31
  50. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -0
  51. package/dist/components/PluginSpecEditor/index.d.ts +2 -0
  52. package/dist/components/PluginSpecEditor/index.d.ts.map +1 -0
  53. package/dist/components/PluginSpecEditor/index.js +15 -0
  54. package/dist/components/PluginSpecEditor/index.js.map +1 -0
  55. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +8 -0
  56. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -0
  57. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +131 -0
  58. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -0
  59. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +13 -0
  60. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -0
  61. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +83 -0
  62. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -0
  63. package/dist/components/TimeSeriesQueryEditor/index.d.ts +2 -0
  64. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +1 -0
  65. package/dist/components/TimeSeriesQueryEditor/index.js +15 -0
  66. package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -0
  67. package/dist/components/index.d.ts +1 -0
  68. package/dist/components/index.d.ts.map +1 -1
  69. package/dist/components/index.js +1 -0
  70. package/dist/components/index.js.map +1 -1
  71. package/dist/model/panels.d.ts +6 -5
  72. package/dist/model/panels.d.ts.map +1 -1
  73. package/dist/model/panels.js.map +1 -1
  74. package/dist/model/plugin-base.d.ts +7 -0
  75. package/dist/model/plugin-base.d.ts.map +1 -1
  76. package/dist/model/plugin-base.js.map +1 -1
  77. package/dist/model/plugins.d.ts +3 -1
  78. package/dist/model/plugins.d.ts.map +1 -1
  79. package/dist/model/plugins.js.map +1 -1
  80. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +8 -0
  81. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -0
  82. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +74 -0
  83. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -0
  84. package/dist/runtime/DataQueriesProvider/index.d.ts +3 -0
  85. package/dist/runtime/DataQueriesProvider/index.d.ts.map +1 -0
  86. package/dist/runtime/DataQueriesProvider/index.js +16 -0
  87. package/dist/runtime/DataQueriesProvider/index.js.map +1 -0
  88. package/dist/runtime/DataQueriesProvider/model.d.ts +27 -0
  89. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -0
  90. package/dist/runtime/DataQueriesProvider/model.js +15 -0
  91. package/dist/runtime/DataQueriesProvider/model.js.map +1 -0
  92. package/dist/runtime/index.d.ts +1 -0
  93. package/dist/runtime/index.d.ts.map +1 -1
  94. package/dist/runtime/index.js +1 -0
  95. package/dist/runtime/index.js.map +1 -1
  96. package/dist/runtime/plugin-registry.d.ts +1 -1
  97. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  98. package/dist/runtime/plugin-registry.js.map +1 -1
  99. package/dist/test/render.d.ts.map +1 -1
  100. package/dist/test/render.js +4 -1
  101. package/dist/test/render.js.map +1 -1
  102. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  103. package/dist/test/test-plugins/bert/index.js +27 -20
  104. package/dist/test/test-plugins/bert/index.js.map +1 -1
  105. package/dist/test/test-plugins/ernie/index.d.ts +4 -1
  106. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  107. package/dist/test/test-plugins/ernie/index.js +28 -1
  108. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  109. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  110. package/dist/test-utils/mock-plugin-registry.js +4 -1
  111. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  112. package/package.json +3 -3
  113. package/dist/cjs/components/TimeSeriesQueryEditor.js +0 -42
  114. package/dist/components/PluginKindSelect.d.ts.map +0 -1
  115. package/dist/components/PluginKindSelect.js.map +0 -1
  116. package/dist/components/PluginSpecEditor.d.ts.map +0 -1
  117. package/dist/components/PluginSpecEditor.js.map +0 -1
  118. package/dist/components/TimeSeriesQueryEditor.d.ts +0 -14
  119. package/dist/components/TimeSeriesQueryEditor.d.ts.map +0 -1
  120. package/dist/components/TimeSeriesQueryEditor.js +0 -38
  121. package/dist/components/TimeSeriesQueryEditor.js.map +0 -1
@@ -1,42 +0,0 @@
1
- // Copyright 2023 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "TimeSeriesQueryEditor", {
18
- enumerable: true,
19
- get: ()=>TimeSeriesQueryEditor
20
- });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _material = require("@mui/material");
23
- const _immer = require("immer");
24
- const _pluginEditor = require("./PluginEditor");
25
- function TimeSeriesQueryEditor(props) {
26
- const { value , onChange , ...others } = props;
27
- const { spec: { plugin } , } = value;
28
- const handlePluginChange = (next)=>{
29
- onChange((0, _immer.produce)(value, (draft)=>{
30
- draft.spec.plugin = next;
31
- }));
32
- };
33
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
34
- ...others,
35
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginEditor.PluginEditor, {
36
- pluginType: "TimeSeriesQuery",
37
- pluginKindLabel: "Query Type",
38
- value: plugin,
39
- onChange: handlePluginChange
40
- })
41
- });
42
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginKindSelect.d.ts","sourceRoot":"","sources":["../../src/components/PluginKindSelect.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAU,WAAW,EAAY,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAClF,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAiB5D"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/PluginKindSelect.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 { Select, SelectProps, MenuItem } from '@mui/material';\nimport { PluginType } from '../model';\nimport { useListPluginMetadata } from '../runtime';\n\nexport interface PluginKindSelectProps extends Omit<SelectProps<string>, 'children'> {\n pluginType: PluginType;\n}\n\n/**\n * Displays a MUI Select input for selecting a plugin's kind from a list of all the available plugins of a specific\n * plugin type. (e.g. \"Show a list of all the Panel plugins\" or \"Show a list of all the Variable plugins\").\n */\nexport function PluginKindSelect(props: PluginKindSelectProps) {\n const { pluginType, value: propValue, ...others } = props;\n const { data, isLoading } = useListPluginMetadata(pluginType);\n\n // Pass an empty value while options are still loading so MUI doesn't complain about us using an \"out of range\" value\n const value = propValue !== '' && isLoading ? '' : propValue;\n\n // TODO: Does this need a loading indicator of some kind?\n return (\n <Select sx={{ minWidth: 120 }} {...others} value={value}>\n {data?.map((metadata) => (\n <MenuItem key={metadata.kind} value={metadata.kind}>\n {metadata.display.name}\n </MenuItem>\n ))}\n </Select>\n );\n}\n"],"names":["Select","MenuItem","useListPluginMetadata","PluginKindSelect","props","pluginType","value","propValue","others","data","isLoading","sx","minWidth","map","metadata","kind","display","name"],"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;AAAA,SAASA,MAAM,EAAeC,QAAQ,QAAQ,eAAe,CAAC;AAE9D,SAASC,qBAAqB,QAAQ,YAAY,CAAC;AAMnD;;;CAGC,GACD,OAAO,SAASC,gBAAgB,CAACC,KAA4B,EAAE;IAC7D,MAAM,EAAEC,UAAU,CAAA,EAAEC,KAAK,EAAEC,SAAS,CAAA,EAAE,GAAGC,MAAM,EAAE,GAAGJ,KAAK,AAAC;IAC1D,MAAM,EAAEK,IAAI,CAAA,EAAEC,SAAS,CAAA,EAAE,GAAGR,qBAAqB,CAACG,UAAU,CAAC,AAAC;IAE9D,qHAAqH;IACrH,MAAMC,KAAK,GAAGC,SAAS,KAAK,EAAE,IAAIG,SAAS,GAAG,EAAE,GAAGH,SAAS,AAAC;IAE7D,yDAAyD;IACzD,qBACE,KAACP,MAAM;QAACW,EAAE,EAAE;YAAEC,QAAQ,EAAE,GAAG;SAAE;QAAG,GAAGJ,MAAM;QAAEF,KAAK,EAAEA,KAAK;kBACpDG,IAAI,aAAJA,IAAI,WAAK,GAATA,KAAAA,CAAS,GAATA,IAAI,CAAEI,GAAG,CAAC,CAACC,QAAQ,iBAClB,KAACb,QAAQ;gBAAqBK,KAAK,EAAEQ,QAAQ,CAACC,IAAI;0BAC/CD,QAAQ,CAACE,OAAO,CAACC,IAAI;eADTH,QAAQ,CAACC,IAAI,CAEjB,AACZ,CAAC;MACK,CACT;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PluginSpecEditor.d.ts","sourceRoot":"","sources":["../../src/components/PluginSpecEditor.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAe,UAAU,EAAE,MAAM,UAAU,CAAC;AAIvE,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB,CAAC,WAAW,CAAC;IAC5E,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,sBA8C5D"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/PluginSpecEditor.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 { ErrorAlert, JSONEditor } from '@perses-dev/components';\nimport { UnknownSpec } from '@perses-dev/core';\nimport { OptionsEditorProps, PanelPlugin, PluginType } from '../model';\nimport { usePlugin } from '../runtime';\nimport { OptionsEditorTabsProps, OptionsEditorTabs } from './OptionsEditorTabs';\n\nexport interface PluginSpecEditorProps extends OptionsEditorProps<UnknownSpec> {\n pluginType: PluginType;\n pluginKind: string;\n}\n\nexport function PluginSpecEditor(props: PluginSpecEditorProps) {\n const { pluginType, pluginKind, ...others } = props;\n const { data: plugin, isLoading, error } = usePlugin(pluginType, pluginKind);\n\n if (error) {\n return <ErrorAlert error={error} />;\n }\n\n // TODO: Proper loading indicator\n if (isLoading) {\n return null;\n }\n\n if (plugin === undefined) {\n throw new Error(`Missing implementation for ${pluginType} plugin with kind '${pluginKind}'`);\n }\n\n if (pluginType === 'Panel') {\n const { PanelQueryEditorComponent, panelOptionsEditorComponents } = plugin as PanelPlugin;\n let tabs: OptionsEditorTabsProps['tabs'] = [];\n if (PanelQueryEditorComponent !== undefined) {\n tabs.push({ label: 'Query', content: <PanelQueryEditorComponent {...others} /> });\n }\n\n if (panelOptionsEditorComponents !== undefined) {\n tabs = tabs.concat(\n panelOptionsEditorComponents.map(({ label, content: OptionsEditorComponent }) => ({\n label,\n content: <OptionsEditorComponent {...others} />,\n }))\n );\n }\n\n // always show json editor by default\n tabs.push({ label: 'JSON', content: <JSONEditor {...others} /> });\n\n return <OptionsEditorTabs tabs={tabs} />;\n }\n\n const { OptionsEditorComponent } = plugin;\n\n if (OptionsEditorComponent !== undefined) {\n return <OptionsEditorComponent {...others} />;\n }\n\n return null;\n}\n"],"names":["ErrorAlert","JSONEditor","usePlugin","OptionsEditorTabs","PluginSpecEditor","props","pluginType","pluginKind","others","data","plugin","isLoading","error","undefined","Error","PanelQueryEditorComponent","panelOptionsEditorComponents","tabs","push","label","content","concat","map","OptionsEditorComponent"],"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;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,wBAAwB,CAAC;AAGhE,SAASC,SAAS,QAAQ,YAAY,CAAC;AACvC,SAAiCC,iBAAiB,QAAQ,qBAAqB,CAAC;AAOhF,OAAO,SAASC,gBAAgB,CAACC,KAA4B,EAAE;IAC7D,MAAM,EAAEC,UAAU,CAAA,EAAEC,UAAU,CAAA,EAAE,GAAGC,MAAM,EAAE,GAAGH,KAAK,AAAC;IACpD,MAAM,EAAEI,IAAI,EAAEC,MAAM,CAAA,EAAEC,SAAS,CAAA,EAAEC,KAAK,CAAA,EAAE,GAAGV,SAAS,CAACI,UAAU,EAAEC,UAAU,CAAC,AAAC;IAE7E,IAAIK,KAAK,EAAE;QACT,qBAAO,KAACZ,UAAU;YAACY,KAAK,EAAEA,KAAK;UAAI,CAAC;IACtC,CAAC;IAED,iCAAiC;IACjC,IAAID,SAAS,EAAE;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAID,MAAM,KAAKG,SAAS,EAAE;QACxB,MAAM,IAAIC,KAAK,CAAC,CAAC,2BAA2B,EAAER,UAAU,CAAC,mBAAmB,EAAEC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,IAAID,UAAU,KAAK,OAAO,EAAE;QAC1B,MAAM,EAAES,yBAAyB,CAAA,EAAEC,4BAA4B,CAAA,EAAE,GAAGN,MAAM,AAAe,AAAC;QAC1F,IAAIO,IAAI,GAAmC,EAAE,AAAC;QAC9C,IAAIF,yBAAyB,KAAKF,SAAS,EAAE;YAC3CI,IAAI,CAACC,IAAI,CAAC;gBAAEC,KAAK,EAAE,OAAO;gBAAEC,OAAO,gBAAE,KAACL,yBAAyB;oBAAE,GAAGP,MAAM;kBAAI;aAAE,CAAC,CAAC;QACpF,CAAC;QAED,IAAIQ,4BAA4B,KAAKH,SAAS,EAAE;YAC9CI,IAAI,GAAGA,IAAI,CAACI,MAAM,CAChBL,4BAA4B,CAACM,GAAG,CAAC,CAAC,EAAEH,KAAK,CAAA,EAAEC,OAAO,EAAEG,sBAAsB,CAAA,EAAE,GAAM,CAAA;oBAChFJ,KAAK;oBACLC,OAAO,gBAAE,KAACG,sBAAsB;wBAAE,GAAGf,MAAM;sBAAI;iBAChD,CAAA,AAAC,CAAC,CACJ,CAAC;QACJ,CAAC;QAED,qCAAqC;QACrCS,IAAI,CAACC,IAAI,CAAC;YAAEC,KAAK,EAAE,MAAM;YAAEC,OAAO,gBAAE,KAACnB,UAAU;gBAAE,GAAGO,MAAM;cAAI;SAAE,CAAC,CAAC;QAElE,qBAAO,KAACL,iBAAiB;YAACc,IAAI,EAAEA,IAAI;UAAI,CAAC;IAC3C,CAAC;IAED,MAAM,EAAEM,sBAAsB,CAAA,EAAE,GAAGb,MAAM,AAAC;IAE1C,IAAIa,sBAAsB,KAAKV,SAAS,EAAE;QACxC,qBAAO,KAACU,sBAAsB;YAAE,GAAGf,MAAM;UAAI,CAAC;IAChD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { BoxProps } from '@mui/material';
3
- import { TimeSeriesQueryDefinition } from '@perses-dev/core';
4
- declare type OmittedMuiProps = 'children' | 'value' | 'onChange';
5
- export interface TimeSeriesQueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {
6
- value: TimeSeriesQueryDefinition;
7
- onChange: (next: TimeSeriesQueryDefinition) => void;
8
- }
9
- /**
10
- * Displays an editor for TimeSeriesQueryDefinition objects.
11
- */
12
- export declare function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps): JSX.Element;
13
- export {};
14
- //# sourceMappingURL=TimeSeriesQueryEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimeSeriesQueryEditor.d.ts","sourceRoot":"","sources":["../../src/components/TimeSeriesQueryEditor.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAM7D,aAAK,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,QAAQ,EAAE,eAAe,CAAC;IACjF,KAAK,EAAE,yBAAyB,CAAC;IACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,yBAAyB,KAAK,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eAyBtE"}
@@ -1,38 +0,0 @@
1
- // Copyright 2023 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { Box } from '@mui/material';
15
- import { produce } from 'immer';
16
- import { PluginEditor } from './PluginEditor';
17
- /**
18
- * Displays an editor for TimeSeriesQueryDefinition objects.
19
- */ export function TimeSeriesQueryEditor(props) {
20
- const { value , onChange , ...others } = props;
21
- const { spec: { plugin } , } = value;
22
- const handlePluginChange = (next)=>{
23
- onChange(produce(value, (draft)=>{
24
- draft.spec.plugin = next;
25
- }));
26
- };
27
- return /*#__PURE__*/ _jsx(Box, {
28
- ...others,
29
- children: /*#__PURE__*/ _jsx(PluginEditor, {
30
- pluginType: "TimeSeriesQuery",
31
- pluginKindLabel: "Query Type",
32
- value: plugin,
33
- onChange: handlePluginChange
34
- })
35
- });
36
- }
37
-
38
- //# sourceMappingURL=TimeSeriesQueryEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/TimeSeriesQueryEditor.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport { TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { produce } from 'immer';\nimport { PluginEditor, PluginEditorProps } from './PluginEditor';\n\n// Props on MUI Box that we don't want people to pass because we're either redefining them or providing them in\n// this component\ntype OmittedMuiProps = 'children' | 'value' | 'onChange';\n\nexport interface TimeSeriesQueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TimeSeriesQueryDefinition;\n onChange: (next: TimeSeriesQueryDefinition) => void;\n}\n\n/**\n * Displays an editor for TimeSeriesQueryDefinition objects.\n */\nexport function TimeSeriesQueryEditor(props: TimeSeriesQueryEditorProps) {\n const { value, onChange, ...others } = props;\n const {\n spec: { plugin },\n } = value;\n\n const handlePluginChange: PluginEditorProps['onChange'] = (next) => {\n onChange(\n produce(value, (draft) => {\n draft.spec.plugin = next;\n })\n );\n };\n\n return (\n <Box {...others}>\n {/* If TimeSeriesQuery plugins ever have common props on the definition, the inputs could go here */}\n <PluginEditor\n pluginType=\"TimeSeriesQuery\"\n pluginKindLabel=\"Query Type\"\n value={plugin}\n onChange={handlePluginChange}\n />\n </Box>\n );\n}\n"],"names":["Box","produce","PluginEditor","TimeSeriesQueryEditor","props","value","onChange","others","spec","plugin","handlePluginChange","next","draft","pluginType","pluginKindLabel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,GAAG,QAAkB,eAAe,CAAC;AAE9C,SAASC,OAAO,QAAQ,OAAO,CAAC;AAChC,SAASC,YAAY,QAA2B,gBAAgB,CAAC;AAWjE;;CAEC,GACD,OAAO,SAASC,qBAAqB,CAACC,KAAiC,EAAE;IACvE,MAAM,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,MAAM,EAAE,GAAGH,KAAK,AAAC;IAC7C,MAAM,EACJI,IAAI,EAAE,EAAEC,MAAM,CAAA,EAAE,CAAA,IACjB,GAAGJ,KAAK,AAAC;IAEV,MAAMK,kBAAkB,GAAkC,CAACC,IAAI,GAAK;QAClEL,QAAQ,CACNL,OAAO,CAACI,KAAK,EAAE,CAACO,KAAK,GAAK;YACxBA,KAAK,CAACJ,IAAI,CAACC,MAAM,GAAGE,IAAI,CAAC;QAC3B,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,AAAC;IAEF,qBACE,KAACX,GAAG;QAAE,GAAGO,MAAM;kBAEb,cAAA,KAACL,YAAY;YACXW,UAAU,EAAC,iBAAiB;YAC5BC,eAAe,EAAC,YAAY;YAC5BT,KAAK,EAAEI,MAAM;YACbH,QAAQ,EAAEI,kBAAkB;UAC5B;MACE,CACN;AACJ,CAAC"}