@perses-dev/plugin-system 0.27.0 → 0.28.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 (104) 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/test-plugins/bert/index.js +27 -20
  18. package/dist/cjs/test/test-plugins/ernie/index.js +37 -4
  19. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +10 -0
  20. package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -0
  21. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +69 -0
  22. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -0
  23. package/dist/components/PanelSpecEditor/index.d.ts +2 -0
  24. package/dist/components/PanelSpecEditor/index.d.ts.map +1 -0
  25. package/dist/components/PanelSpecEditor/index.js +15 -0
  26. package/dist/components/PanelSpecEditor/index.js.map +1 -0
  27. package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
  28. package/dist/components/PluginEditor/PluginEditor.js +2 -2
  29. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  30. package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -1
  31. package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
  32. package/dist/components/PluginEditor/plugin-editor-api.js +27 -6
  33. package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
  34. package/dist/components/{PluginKindSelect.d.ts → PluginKindSelect/PluginKindSelect.d.ts} +1 -1
  35. package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -0
  36. package/dist/components/{PluginKindSelect.js → PluginKindSelect/PluginKindSelect.js} +1 -1
  37. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -0
  38. package/dist/components/PluginKindSelect/index.d.ts +2 -0
  39. package/dist/components/PluginKindSelect/index.d.ts.map +1 -0
  40. package/dist/components/PluginKindSelect/index.js +15 -0
  41. package/dist/components/PluginKindSelect/index.js.map +1 -0
  42. package/dist/components/{PluginSpecEditor.d.ts → PluginSpecEditor/PluginSpecEditor.d.ts} +1 -1
  43. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -0
  44. package/dist/components/{PluginSpecEditor.js → PluginSpecEditor/PluginSpecEditor.js} +3 -31
  45. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -0
  46. package/dist/components/PluginSpecEditor/index.d.ts +2 -0
  47. package/dist/components/PluginSpecEditor/index.d.ts.map +1 -0
  48. package/dist/components/PluginSpecEditor/index.js +15 -0
  49. package/dist/components/PluginSpecEditor/index.js.map +1 -0
  50. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +8 -0
  51. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -0
  52. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +131 -0
  53. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -0
  54. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +13 -0
  55. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -0
  56. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +83 -0
  57. package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -0
  58. package/dist/components/TimeSeriesQueryEditor/index.d.ts +2 -0
  59. package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +1 -0
  60. package/dist/components/TimeSeriesQueryEditor/index.js +15 -0
  61. package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -0
  62. package/dist/components/index.d.ts +1 -0
  63. package/dist/components/index.d.ts.map +1 -1
  64. package/dist/components/index.js +1 -0
  65. package/dist/components/index.js.map +1 -1
  66. package/dist/model/panels.d.ts +6 -5
  67. package/dist/model/panels.d.ts.map +1 -1
  68. package/dist/model/panels.js.map +1 -1
  69. package/dist/model/plugin-base.d.ts +7 -0
  70. package/dist/model/plugin-base.d.ts.map +1 -1
  71. package/dist/model/plugin-base.js.map +1 -1
  72. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +8 -0
  73. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -0
  74. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +74 -0
  75. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -0
  76. package/dist/runtime/DataQueriesProvider/index.d.ts +3 -0
  77. package/dist/runtime/DataQueriesProvider/index.d.ts.map +1 -0
  78. package/dist/runtime/DataQueriesProvider/index.js +16 -0
  79. package/dist/runtime/DataQueriesProvider/index.js.map +1 -0
  80. package/dist/runtime/DataQueriesProvider/model.d.ts +27 -0
  81. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -0
  82. package/dist/runtime/DataQueriesProvider/model.js +15 -0
  83. package/dist/runtime/DataQueriesProvider/model.js.map +1 -0
  84. package/dist/runtime/index.d.ts +1 -0
  85. package/dist/runtime/index.d.ts.map +1 -1
  86. package/dist/runtime/index.js +1 -0
  87. package/dist/runtime/index.js.map +1 -1
  88. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  89. package/dist/test/test-plugins/bert/index.js +27 -20
  90. package/dist/test/test-plugins/bert/index.js.map +1 -1
  91. package/dist/test/test-plugins/ernie/index.d.ts +4 -1
  92. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  93. package/dist/test/test-plugins/ernie/index.js +28 -1
  94. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  95. package/package.json +3 -3
  96. package/dist/cjs/components/TimeSeriesQueryEditor.js +0 -42
  97. package/dist/components/PluginKindSelect.d.ts.map +0 -1
  98. package/dist/components/PluginKindSelect.js.map +0 -1
  99. package/dist/components/PluginSpecEditor.d.ts.map +0 -1
  100. package/dist/components/PluginSpecEditor.js.map +0 -1
  101. package/dist/components/TimeSeriesQueryEditor.d.ts +0 -14
  102. package/dist/components/TimeSeriesQueryEditor.d.ts.map +0 -1
  103. package/dist/components/TimeSeriesQueryEditor.js +0 -38
  104. package/dist/components/TimeSeriesQueryEditor.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.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 { createContext, useCallback, useContext, useMemo } from 'react';\nimport { Definition, TimeSeriesQueryDefinition, UnknownSpec } from '@perses-dev/core';\nimport { useTimeSeriesQueries } from '../time-series-queries';\nimport { DataQueriesProviderProps, QueryData, UseDataQueryResults } from './model';\n\nexport function useDataQueries(): UseDataQueryResults {\n const ctx = useDataQueriesContext();\n return ctx;\n}\n\nexport const DataQueriesContext = createContext<UseDataQueryResults | undefined>(undefined);\n\nexport function useDataQueriesContext() {\n const ctx = useContext(DataQueriesContext);\n if (ctx === undefined) {\n throw new Error('No DataQueriesContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\nexport function DataQueriesProvider(props: DataQueriesProviderProps) {\n const { definitions, options, children } = props;\n\n // For now we will map each query plugin definition to TimeSeriesQueryDefinition\n // Later on when we add support for other query types,\n // we will have to map each query maps to the correct QueryDefinition\n const timeSeriesQueries = definitions.map(\n (definition) =>\n ({\n kind: 'TimeSeriesQuery',\n spec: {\n plugin: definition,\n },\n } as TimeSeriesQueryDefinition)\n );\n const results = useTimeSeriesQueries(timeSeriesQueries, options);\n\n const data = results.map(({ data, isFetching, isLoading, refetch, error }, i) => {\n return {\n definition: definitions[i],\n data,\n isFetching,\n isLoading,\n refetch,\n error,\n } as QueryData<Definition<UnknownSpec>>;\n });\n\n const refetchAll = useCallback(() => {\n results.forEach((result) => result.refetch());\n }, [results]);\n\n const ctx = useMemo(() => {\n return {\n queryResults: data,\n isFetching: results.some((result) => result.isFetching),\n isLoading: results.some((result) => result.isLoading),\n refetchAll,\n errors: results.map((result) => result.error),\n };\n }, [data, results, refetchAll]);\n\n return <DataQueriesContext.Provider value={ctx}>{children}</DataQueriesContext.Provider>;\n}\n"],"names":["createContext","useCallback","useContext","useMemo","useTimeSeriesQueries","useDataQueries","ctx","useDataQueriesContext","DataQueriesContext","undefined","Error","DataQueriesProvider","props","definitions","options","children","timeSeriesQueries","map","definition","kind","spec","plugin","results","data","isFetching","isLoading","refetch","error","i","refetchAll","forEach","result","queryResults","some","errors","Provider","value"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1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EC,KAAK,CAAA,EAAE,EAAEC,CAAC,GAAK;QAC/E,OAAO;YACLV,UAAU,EAAEL,WAAW,CAACe,CAAC,CAAC;YAC1BL,IAAI;YACJC,UAAU;YACVC,SAAS;YACTC,OAAO;YACPC,KAAK;SACN,CAAuC;IAC1C,CAAC,CAAC,AAAC;IAEH,MAAME,UAAU,GAAG5B,WAAW,CAAC,IAAM;QACnCqB,OAAO,CAACQ,OAAO,CAAC,CAACC,MAAM,GAAKA,MAAM,CAACL,OAAO,EAAE,CAAC,CAAC;IAChD,CAAC,EAAE;QAACJ,OAAO;KAAC,CAAC,AAAC;IAEd,MAAMhB,GAAG,GAAGH,OAAO,CAAC,IAAM;QACxB,OAAO;YACL6B,YAAY,EAAET,IAAI;YAClBC,UAAU,EAAEF,OAAO,CAACW,IAAI,CAAC,CAACF,MAAM,GAAKA,MAAM,CAACP,UAAU,CAAC;YACvDC,SAAS,EAAEH,OAAO,CAACW,IAAI,CAAC,CAACF,MAAM,GAAKA,MAAM,CAACN,SAAS,CAAC;YACrDI,UAAU;YACVK,MAAM,EAAEZ,OAAO,CAACL,GAAG,CAAC,CAACc,MAAM,GAAKA,MAAM,CAACJ,KAAK,CAAC;SAC9C,CAAC;IACJ,CAAC,EAAE;QAACJ,IAAI;QAAED,OAAO;QAAEO,UAAU;KAAC,CAAC,AAAC;IAEhC,qBAAO,KAACrB,kBAAkB,CAAC2B,QAAQ;QAACC,KAAK,EAAE9B,GAAG;kBAAGS,QAAQ;MAA+B,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './DataQueriesProvider';
2
+ export * from './model';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,16 @@
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
+ export * from './DataQueriesProvider';
14
+ export * from './model';
15
+
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/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 './DataQueriesProvider';\nexport * from './model';\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,SAAS,CAAC"}
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { Definition, TimeSeriesData, UnknownSpec } from '@perses-dev/core';
3
+ declare type QueryOptions = Record<string, unknown>;
4
+ interface DataQueriesDefinitions<QueryPluginDefinition> {
5
+ definitions: QueryPluginDefinition[];
6
+ }
7
+ export interface DataQueriesProviderProps<QueryPluginDefinition = Definition<UnknownSpec>> extends DataQueriesDefinitions<QueryPluginDefinition> {
8
+ options?: QueryOptions;
9
+ children?: React.ReactNode;
10
+ }
11
+ export interface UseDataQueryResults<QueryPluginDefinition = Definition<UnknownSpec>> {
12
+ queryResults: Array<QueryData<QueryPluginDefinition>>;
13
+ refetchAll: () => void;
14
+ isFetching: boolean;
15
+ isLoading: boolean;
16
+ errors: unknown[];
17
+ }
18
+ export interface QueryData<QueryPluginDefinition> {
19
+ data?: TimeSeriesData;
20
+ definition: QueryPluginDefinition;
21
+ error: unknown;
22
+ isFetching: boolean;
23
+ isLoading: boolean;
24
+ refetch?: () => void;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/model.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3E,aAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5C,UAAU,sBAAsB,CAAC,qBAAqB;IACpD,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC;AACD,MAAM,WAAW,wBAAwB,CAAC,qBAAqB,GAAG,UAAU,CAAC,WAAW,CAAC,CACvF,SAAQ,sBAAsB,CAAC,qBAAqB,CAAC;IACrD,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB,CAAC,qBAAqB,GAAG,UAAU,CAAC,WAAW,CAAC;IAClF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACtD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,SAAS,CAAC,qBAAqB;IAC9C,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -0,0 +1,15 @@
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
+ export { };
14
+
15
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/runtime/DataQueriesProvider/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 { Definition, TimeSeriesData, UnknownSpec } from '@perses-dev/core';\n\ntype QueryOptions = Record<string, unknown>;\n\ninterface DataQueriesDefinitions<QueryPluginDefinition> {\n definitions: QueryPluginDefinition[];\n}\nexport interface DataQueriesProviderProps<QueryPluginDefinition = Definition<UnknownSpec>>\n extends DataQueriesDefinitions<QueryPluginDefinition> {\n options?: QueryOptions;\n children?: React.ReactNode;\n}\n\nexport interface UseDataQueryResults<QueryPluginDefinition = Definition<UnknownSpec>> {\n queryResults: Array<QueryData<QueryPluginDefinition>>;\n refetchAll: () => void;\n isFetching: boolean;\n isLoading: boolean;\n errors: unknown[];\n}\n\nexport interface QueryData<QueryPluginDefinition> {\n data?: TimeSeriesData;\n definition: QueryPluginDefinition;\n error: unknown;\n isFetching: boolean;\n isLoading: boolean;\n refetch?: () => void;\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,WA4BC"}
@@ -3,4 +3,5 @@ export * from './plugin-registry';
3
3
  export * from './template-variables';
4
4
  export * from './TimeRangeProvider';
5
5
  export * from './time-series-queries';
6
+ export * from './DataQueriesProvider';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAaA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAaA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
@@ -15,5 +15,6 @@ export * from './plugin-registry';
15
15
  export * from './template-variables';
16
16
  export * from './TimeRangeProvider';
17
17
  export * from './time-series-queries';
18
+ export * from './DataQueriesProvider';
18
19
 
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/runtime/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 './datasources';\nexport * from './plugin-registry';\nexport * from './template-variables';\nexport * from './TimeRangeProvider';\nexport * from './time-series-queries';\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,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"sources":["../../src/runtime/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 './datasources';\nexport * from './plugin-registry';\nexport * from './template-variables';\nexport * from './TimeRangeProvider';\nexport * from './time-series-queries';\nexport * from './DataQueriesProvider';\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,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/bert/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAgBvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CA2BvD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/bert/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAsB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiBjE,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CASvD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CA4BvD,CAAC"}
@@ -11,28 +11,34 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ function BertPanel1Editor({ value , onChange }) {
15
+ return /*#__PURE__*/ _jsxs("div", {
16
+ children: [
17
+ /*#__PURE__*/ _jsx("label", {
18
+ htmlFor: "editor-input",
19
+ children: "BertPanel1 editor"
20
+ }),
21
+ /*#__PURE__*/ _jsx("input", {
22
+ type: "text",
23
+ id: "editor-input",
24
+ value: value.option1,
25
+ onChange: (e)=>onChange({
26
+ ...value,
27
+ option1: e.target.value
28
+ })
29
+ })
30
+ ]
31
+ });
32
+ }
14
33
  // Dummy plugins to test loading
15
34
  export const BertPanel1 = {
16
35
  PanelComponent: ()=>null,
17
- PanelQueryEditorComponent: function BertPanel1Editor({ value , onChange }) {
18
- return /*#__PURE__*/ _jsxs("div", {
19
- children: [
20
- /*#__PURE__*/ _jsx("label", {
21
- htmlFor: "editor-input",
22
- children: "BertPanel1 editor"
23
- }),
24
- /*#__PURE__*/ _jsx("input", {
25
- type: "text",
26
- id: "editor-input",
27
- value: value.option1,
28
- onChange: (e)=>onChange({
29
- ...value,
30
- option1: e.target.value
31
- })
32
- })
33
- ]
34
- });
35
- },
36
+ panelOptionsEditorComponents: [
37
+ {
38
+ label: 'Editor',
39
+ content: BertPanel1Editor
40
+ }
41
+ ],
36
42
  createInitialOptions: ()=>({
37
43
  option1: ''
38
44
  })
@@ -73,7 +79,8 @@ export const BertPanel2 = {
73
79
  ],
74
80
  createInitialOptions: ()=>({
75
81
  option2: ''
76
- })
82
+ }),
83
+ hideQueryEditor: true
77
84
  };
78
85
 
79
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/test/test-plugins/bert/index.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 { PanelPlugin } from '../../../model';\n\n// Dummy plugins to test loading\nexport const BertPanel1: PanelPlugin<{ option1: string }> = {\n PanelComponent: () => null,\n PanelQueryEditorComponent: function BertPanel1Editor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel1 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option1}\n onChange={(e) => onChange({ ...value, option1: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ option1: '' }),\n};\n\nexport const BertPanel2: PanelPlugin<{ option2: string }> = {\n PanelComponent: () => null,\n panelOptionsEditorComponents: [\n {\n label: 'Settings',\n content: function BertPanel2Editor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option2}\n onChange={(e) => onChange({ ...value, option2: e.target.value })}\n />\n </div>\n );\n },\n },\n {\n label: 'Custom Tab',\n content: function Editor() {\n return <div>custom content</div>;\n },\n },\n ],\n createInitialOptions: () => ({ option2: '' }),\n};\n"],"names":["BertPanel1","PanelComponent","PanelQueryEditorComponent","BertPanel1Editor","value","onChange","div","label","htmlFor","input","type","id","option1","e","target","createInitialOptions","BertPanel2","panelOptionsEditorComponents","content","BertPanel2Editor","option2","Editor"],"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;AAEA,gCAAgC;AAChC,OAAO,MAAMA,UAAU,GAAqC;IAC1DC,cAAc,EAAE,IAAM,IAAI;IAC1BC,yBAAyB,EAAE,SAASC,gBAAgB,CAAC,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,EAAE;QACxE,qBACE,MAACC,KAAG;;8BACF,KAACC,OAAK;oBAACC,OAAO,EAAC,cAAc;8BAAC,mBAAiB;kBAAQ;8BACvD,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBP,KAAK,EAAEA,KAAK,CAACQ,OAAO;oBACpBP,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;4BAAE,GAAGD,KAAK;4BAAEQ,OAAO,EAAEC,CAAC,CAACC,MAAM,CAACV,KAAK;yBAAE,CAAC;kBAChE;;UACE,CACN;IACJ,CAAC;IACDW,oBAAoB,EAAE,IAAO,CAAA;YAAEH,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;CAC9C,CAAC;AAEF,OAAO,MAAMI,UAAU,GAAqC;IAC1Df,cAAc,EAAE,IAAM,IAAI;IAC1BgB,4BAA4B,EAAE;QAC5B;YACEV,KAAK,EAAE,UAAU;YACjBW,OAAO,EAAE,SAASC,gBAAgB,CAAC,EAAEf,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,EAAE;gBACtD,qBACE,MAACC,KAAG;;sCACF,KAACC,OAAK;4BAACC,OAAO,EAAC,cAAc;sCAAC,mBAAiB;0BAAQ;sCACvD,KAACC,OAAK;4BACJC,IAAI,EAAC,MAAM;4BACXC,EAAE,EAAC,cAAc;4BACjBP,KAAK,EAAEA,KAAK,CAACgB,OAAO;4BACpBf,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;oCAAE,GAAGD,KAAK;oCAAEgB,OAAO,EAAEP,CAAC,CAACC,MAAM,CAACV,KAAK;iCAAE,CAAC;0BAChE;;kBACE,CACN;YACJ,CAAC;SACF;QACD;YACEG,KAAK,EAAE,YAAY;YACnBW,OAAO,EAAE,SAASG,MAAM,GAAG;gBACzB,qBAAO,KAACf,KAAG;8BAAC,gBAAc;kBAAM,CAAC;YACnC,CAAC;SACF;KACF;IACDS,oBAAoB,EAAE,IAAO,CAAA;YAAEK,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;CAC9C,CAAC"}
1
+ {"version":3,"sources":["../../../../src/test/test-plugins/bert/index.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 { OptionsEditorProps, PanelPlugin } from '../../../model';\n\nfunction BertPanel1Editor({ value, onChange }: OptionsEditorProps<{ option1: string }>) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel1 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option1}\n onChange={(e) => onChange({ ...value, option1: e.target.value })}\n />\n </div>\n );\n}\n\n// Dummy plugins to test loading\nexport const BertPanel1: PanelPlugin<{ option1: string }> = {\n PanelComponent: () => null,\n panelOptionsEditorComponents: [\n {\n label: 'Editor',\n content: BertPanel1Editor,\n },\n ],\n createInitialOptions: () => ({ option1: '' }),\n};\n\nexport const BertPanel2: PanelPlugin<{ option2: string }> = {\n PanelComponent: () => null,\n panelOptionsEditorComponents: [\n {\n label: 'Settings',\n content: function BertPanel2Editor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">BertPanel2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.option2}\n onChange={(e) => onChange({ ...value, option2: e.target.value })}\n />\n </div>\n );\n },\n },\n {\n label: 'Custom Tab',\n content: function Editor() {\n return <div>custom content</div>;\n },\n },\n ],\n createInitialOptions: () => ({ option2: '' }),\n hideQueryEditor: true,\n};\n"],"names":["BertPanel1Editor","value","onChange","div","label","htmlFor","input","type","id","option1","e","target","BertPanel1","PanelComponent","panelOptionsEditorComponents","content","createInitialOptions","BertPanel2","BertPanel2Editor","option2","Editor","hideQueryEditor"],"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;AAEA,SAASA,g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MAAM,CAACV,KAAK;iCAAE,CAAC;0BAChE;;kBACE,CACN;YACJ,CAAC;SACF;QACD;YACEG,KAAK,EAAE,YAAY;YACnBW,OAAO,EAAE,SAASK,MAAM,GAAG;gBACzB,qBAAO,KAACjB,KAAG;8BAAC,gBAAc;kBAAM,CAAC;YACnC,CAAC;SACF;KACF;IACDa,oBAAoB,EAAE,IAAO,CAAA;YAAEG,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;IAC7CE,eAAe,EAAE,IAAI;CACtB,CAAC"}
@@ -1,5 +1,8 @@
1
1
  import { VariablePlugin } from '../../../model';
2
- export declare const ErnieVariable: VariablePlugin<{
2
+ export declare const ErnieVariable1: VariablePlugin<{
3
3
  variableOption: string;
4
4
  }>;
5
+ export declare const ErnieVariable2: VariablePlugin<{
6
+ variableOption2: string;
7
+ }>;
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAQhE,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,CAgBpE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAkB,MAAM,gBAAgB,CAAC;AAQhE,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,CAgBrE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAgBtE,CAAC"}
@@ -22,7 +22,7 @@ const data = [
22
22
  }
23
23
  ];
24
24
  // Dummy plugin to test loading
25
- export const ErnieVariable = {
25
+ export const ErnieVariable1 = {
26
26
  getVariableOptions: async ()=>({
27
27
  data
28
28
  }),
@@ -49,5 +49,32 @@ export const ErnieVariable = {
49
49
  variableOption: ''
50
50
  })
51
51
  };
52
+ export const ErnieVariable2 = {
53
+ getVariableOptions: async ()=>({
54
+ data
55
+ }),
56
+ OptionsEditorComponent: function ErnieVariableEditor({ value , onChange }) {
57
+ return /*#__PURE__*/ _jsxs("div", {
58
+ children: [
59
+ /*#__PURE__*/ _jsx("label", {
60
+ htmlFor: "editor-input",
61
+ children: "ErnieVariable2 editor"
62
+ }),
63
+ /*#__PURE__*/ _jsx("input", {
64
+ type: "text",
65
+ id: "editor-input",
66
+ value: value.variableOption2,
67
+ onChange: (e)=>onChange({
68
+ ...value,
69
+ variableOption2: e.target.value
70
+ })
71
+ })
72
+ ]
73
+ });
74
+ },
75
+ createInitialOptions: ()=>({
76
+ variableOption2: ''
77
+ })
78
+ };
52
79
 
53
80
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/test/test-plugins/ernie/index.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 { VariablePlugin, VariableOption } from '../../../model';\n\nconst data: VariableOption[] = [\n { label: 'Grover', value: 'Grover' },\n { label: 'Snuffleupagus', value: 'Snuffleupagus' },\n];\n\n// Dummy plugin to test loading\nexport const ErnieVariable: VariablePlugin<{ variableOption: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption}\n onChange={(e) => onChange({ ...value, variableOption: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption: '' }),\n};\n"],"names":["data","label","value","ErnieVariable","getVariableOptions","OptionsEditorComponent","ErnieVariableEditor","onChange","div","htmlFor","input","type","id","variableOption","e","target","createInitialOptions"],"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;AAEA,MAAMA,IAAI,GAAqB;IAC7B;QAAEC,KAAK,EAAE,QAAQ;QAAEC,KAAK,EAAE,QAAQ;KAAE;IACpC;QAAED,KAAK,EAAE,eAAe;QAAEC,KAAK,EAAE,eAAe;KAAE;CACnD,AAAC;AAEF,+BAA+B;AAC/B,OAAO,MAAMC,aAAa,GAA+C;IACvEC,kBAAkB,EAAE,UAAa,CAAA;YAAEJ,IAAI;SAAE,CAAA,AAAC;IAC1CK,sBAAsB,EAAE,SAASC,mBAAmB,CAAC,EAAEJ,KAAK,CAAA,EAAEK,QAAQ,CAAA,EAAE,EAAE;QACxE,qBACE,MAACC,KAAG;;8BACF,KAACP,OAAK;oBAACQ,OAAO,EAAC,cAAc;8BAAC,sBAAoB;kBAAQ;8BAC1D,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBV,KAAK,EAAEA,KAAK,CAACW,cAAc;oBAC3BN,QAAQ,EAAE,CAACO,CAAC,GAAKP,QAAQ,CAAC;4BAAE,GAAGL,KAAK;4BAAEW,cAAc,EAAEC,CAAC,CAACC,MAAM,CAACb,KAAK;yBAAE,CAAC;kBACvE;;UACE,CACN;IACJ,CAAC;IACDc,oBAAoB,EAAE,IAAO,CAAA;YAAEH,cAAc,EAAE,EAAE;SAAE,CAAA,AAAC;CACrD,CAAC"}
1
+ {"version":3,"sources":["../../../../src/test/test-plugins/ernie/index.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 { VariablePlugin, VariableOption } from '../../../model';\n\nconst data: VariableOption[] = [\n { label: 'Grover', value: 'Grover' },\n { label: 'Snuffleupagus', value: 'Snuffleupagus' },\n];\n\n// Dummy plugin to test loading\nexport const ErnieVariable1: VariablePlugin<{ variableOption: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption}\n onChange={(e) => onChange({ ...value, variableOption: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption: '' }),\n};\n\nexport const ErnieVariable2: VariablePlugin<{ variableOption2: string }> = {\n getVariableOptions: async () => ({ data }),\n OptionsEditorComponent: function ErnieVariableEditor({ value, onChange }) {\n return (\n <div>\n <label htmlFor=\"editor-input\">ErnieVariable2 editor</label>\n <input\n type=\"text\"\n id=\"editor-input\"\n value={value.variableOption2}\n onChange={(e) => onChange({ ...value, variableOption2: e.target.value })}\n />\n </div>\n );\n },\n createInitialOptions: () => ({ variableOption2: '' }),\n};\n"],"names":["data","label","value","ErnieVariable1","getVariableOptions","OptionsEditorComponent","ErnieVariableEditor","onChange","div","htmlFor","input","type","id","variableOption","e","target","createInitialOptions","ErnieVariable2","variableOption2"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CA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AC,uBAAqB;kBAAQ;8BAC3D,KAACC,OAAK;oBACJC,IAAI,EAAC,MAAM;oBACXC,EAAE,EAAC,cAAc;oBACjBV,KAAK,EAAEA,KAAK,CAACgB,eAAe;oBAC5BX,QAAQ,EAAE,CAACO,CAAC,GAAKP,QAAQ,CAAC;4BAAE,GAAGL,KAAK;4BAAEgB,eAAe,EAAEJ,CAAC,CAACC,MAAM,CAACb,KAAK;yBAAE,CAAC;kBACxE;;UACE,CACN;IACJ,CAAC;IACDc,oBAAoB,EAAE,IAAO,CAAA;YAAEE,eAAe,EAAE,EAAE;SAAE,CAAA,AAAC;CACtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/plugin-system",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "The plugin feature in Pereses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -28,8 +28,8 @@
28
28
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
29
  },
30
30
  "dependencies": {
31
- "@perses-dev/components": "0.27.0",
32
- "@perses-dev/core": "0.27.0",
31
+ "@perses-dev/components": "0.28.0",
32
+ "@perses-dev/core": "0.28.0",
33
33
  "immer": "^9.0.15",
34
34
  "use-immer": "^0.7.0",
35
35
  "use-query-params": "^2.1.2"
@@ -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","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AAO,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"}