@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.
- package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +75 -0
- package/dist/cjs/components/PanelSpecEditor/index.js +28 -0
- package/dist/cjs/components/PluginEditor/PluginEditor.js +2 -2
- package/dist/cjs/components/PluginEditor/plugin-editor-api.js +27 -6
- package/dist/cjs/components/{PluginKindSelect.js → PluginKindSelect/PluginKindSelect.js} +1 -1
- package/dist/cjs/components/PluginKindSelect/index.js +28 -0
- package/dist/cjs/components/{PluginSpecEditor.js → PluginSpecEditor/PluginSpecEditor.js} +2 -30
- package/dist/cjs/components/PluginSpecEditor/index.js +28 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +142 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +94 -0
- package/dist/cjs/components/TimeSeriesQueryEditor/index.js +28 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +88 -0
- package/dist/cjs/runtime/DataQueriesProvider/index.js +29 -0
- package/dist/cjs/runtime/DataQueriesProvider/model.js +16 -0
- package/dist/cjs/runtime/index.js +1 -0
- package/dist/cjs/test/render.js +4 -1
- package/dist/cjs/test/test-plugins/bert/index.js +27 -20
- package/dist/cjs/test/test-plugins/ernie/index.js +37 -4
- package/dist/cjs/test-utils/mock-plugin-registry.js +4 -1
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts +10 -0
- package/dist/components/PanelSpecEditor/PanelSpecEditor.d.ts.map +1 -0
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js +69 -0
- package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -0
- package/dist/components/PanelSpecEditor/index.d.ts +2 -0
- package/dist/components/PanelSpecEditor/index.d.ts.map +1 -0
- package/dist/components/PanelSpecEditor/index.js +15 -0
- package/dist/components/PanelSpecEditor/index.js.map +1 -0
- package/dist/components/PluginEditor/PluginEditor.d.ts.map +1 -1
- package/dist/components/PluginEditor/PluginEditor.js +2 -2
- package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts +4 -1
- package/dist/components/PluginEditor/plugin-editor-api.d.ts.map +1 -1
- package/dist/components/PluginEditor/plugin-editor-api.js +27 -6
- package/dist/components/PluginEditor/plugin-editor-api.js.map +1 -1
- package/dist/components/{PluginKindSelect.d.ts → PluginKindSelect/PluginKindSelect.d.ts} +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.d.ts.map +1 -0
- package/dist/components/{PluginKindSelect.js → PluginKindSelect/PluginKindSelect.js} +1 -1
- package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -0
- package/dist/components/PluginKindSelect/index.d.ts +2 -0
- package/dist/components/PluginKindSelect/index.d.ts.map +1 -0
- package/dist/components/PluginKindSelect/index.js +15 -0
- package/dist/components/PluginKindSelect/index.js.map +1 -0
- package/dist/components/PluginRegistry/PluginRegistry.d.ts +2 -2
- package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
- package/dist/components/{PluginSpecEditor.d.ts → PluginSpecEditor/PluginSpecEditor.d.ts} +1 -1
- package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -0
- package/dist/components/{PluginSpecEditor.js → PluginSpecEditor/PluginSpecEditor.js} +3 -31
- package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -0
- package/dist/components/PluginSpecEditor/index.d.ts +2 -0
- package/dist/components/PluginSpecEditor/index.d.ts.map +1 -0
- package/dist/components/PluginSpecEditor/index.js +15 -0
- package/dist/components/PluginSpecEditor/index.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts +8 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.d.ts.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js +131 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryEditor.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts +13 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.d.ts.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js +83 -0
- package/dist/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.js.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/index.d.ts +2 -0
- package/dist/components/TimeSeriesQueryEditor/index.d.ts.map +1 -0
- package/dist/components/TimeSeriesQueryEditor/index.js +15 -0
- package/dist/components/TimeSeriesQueryEditor/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/model/panels.d.ts +6 -5
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/plugin-base.d.ts +7 -0
- package/dist/model/plugin-base.d.ts.map +1 -1
- package/dist/model/plugin-base.js.map +1 -1
- package/dist/model/plugins.d.ts +3 -1
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js.map +1 -1
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts +8 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +74 -0
- package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -0
- package/dist/runtime/DataQueriesProvider/index.d.ts +3 -0
- package/dist/runtime/DataQueriesProvider/index.d.ts.map +1 -0
- package/dist/runtime/DataQueriesProvider/index.js +16 -0
- package/dist/runtime/DataQueriesProvider/index.js.map +1 -0
- package/dist/runtime/DataQueriesProvider/model.d.ts +27 -0
- package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -0
- package/dist/runtime/DataQueriesProvider/model.js +15 -0
- package/dist/runtime/DataQueriesProvider/model.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/plugin-registry.d.ts +1 -1
- package/dist/runtime/plugin-registry.d.ts.map +1 -1
- package/dist/runtime/plugin-registry.js.map +1 -1
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +4 -1
- package/dist/test/render.js.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.js +27 -20
- package/dist/test/test-plugins/bert/index.js.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts +4 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.js +28 -1
- package/dist/test/test-plugins/ernie/index.js.map +1 -1
- package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
- package/dist/test-utils/mock-plugin-registry.js +4 -1
- package/dist/test-utils/mock-plugin-registry.js.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/components/TimeSeriesQueryEditor.js +0 -42
- package/dist/components/PluginKindSelect.d.ts.map +0 -1
- package/dist/components/PluginKindSelect.js.map +0 -1
- package/dist/components/PluginSpecEditor.d.ts.map +0 -1
- package/dist/components/PluginSpecEditor.js.map +0 -1
- package/dist/components/TimeSeriesQueryEditor.d.ts +0 -14
- package/dist/components/TimeSeriesQueryEditor.d.ts.map +0 -1
- package/dist/components/TimeSeriesQueryEditor.js +0 -38
- package/dist/components/TimeSeriesQueryEditor.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/plugins.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 { Metadata, UnknownSpec } from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin } from './time-series-queries';\nimport { PanelPlugin } from './panels';\nimport { VariablePlugin } from './variables';\nimport { DatasourcePlugin } from './datasource';\nimport { Plugin } from './plugin-base';\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: Metadata;\n spec: PluginSpec;\n}\n\nexport interface PluginSpec {\n plugins: PluginMetadata[];\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n pluginType: PluginType;\n kind: string;\n display: {\n name: string;\n description?: string;\n };\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n Datasource: DatasourcePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\
|
|
1
|
+
{"version":3,"sources":["../../src/model/plugins.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 { Metadata, UnknownSpec } from '@perses-dev/core';\nimport { TimeSeriesQueryPlugin } from './time-series-queries';\nimport { PanelPlugin } from './panels';\nimport { VariablePlugin } from './variables';\nimport { DatasourcePlugin } from './datasource';\nimport { Plugin } from './plugin-base';\n\n/**\n * Information about a module/package that contains plugins.\n */\nexport interface PluginModuleResource {\n kind: 'PluginModule';\n metadata: Metadata;\n spec: PluginSpec;\n}\n\nexport interface PluginSpec {\n plugins: PluginMetadata[];\n}\n\n/**\n * Metadata about an individual plugin that's part of a PluginModule.\n */\nexport interface PluginMetadata {\n pluginType: PluginType;\n kind: string;\n display: {\n name: string;\n description?: string;\n };\n}\n\n/**\n * All supported plugin types. A plugin's implementation must extend from `Plugin<UnknownSpec>` to be considered a valid\n * `PluginType`.\n */\nexport type PluginType = {\n // Filter out implementations on SupportedPlugins that don't extend `Plugin<UnknownSpec>`\n [K in keyof SupportedPlugins]: SupportedPlugins[K] extends Plugin<UnknownSpec> ? K : never;\n}[keyof SupportedPlugins];\n\n/**\n * Map of plugin type key/string -> implementation type. Use Typescript module augmentation to extend the plugin system\n * with new plugin types.\n */\nexport interface SupportedPlugins {\n Variable: VariablePlugin;\n Panel: PanelPlugin;\n TimeSeriesQuery: TimeSeriesQueryPlugin;\n Datasource: DatasourcePlugin;\n}\n\n/**\n * The implementation for a given plugin type.\n */\nexport type PluginImplementation<Type extends PluginType> = SupportedPlugins[Type];\n\n/**\n * Default plugin kinds by plugin type.\n */\ntype PluginKinds = Partial<Record<PluginType, string>>;\nexport type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;\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,WA6DuH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Definition, UnknownSpec } from '@perses-dev/core';
|
|
3
|
+
import { DataQueriesProviderProps, UseDataQueryResults } from './model';
|
|
4
|
+
export declare function useDataQueries(): UseDataQueryResults;
|
|
5
|
+
export declare const DataQueriesContext: import("react").Context<UseDataQueryResults<Definition<UnknownSpec>> | undefined>;
|
|
6
|
+
export declare function useDataQueriesContext(): UseDataQueryResults<Definition<UnknownSpec>>;
|
|
7
|
+
export declare function DataQueriesProvider(props: DataQueriesProviderProps): JSX.Element;
|
|
8
|
+
//# sourceMappingURL=DataQueriesProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataQueriesProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/DataQueriesProvider/DataQueriesProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,UAAU,EAA6B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,wBAAwB,EAAa,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnF,wBAAgB,cAAc,IAAI,mBAAmB,CAGpD;AAED,eAAO,MAAM,kBAAkB,mFAA4D,CAAC;AAE5F,wBAAgB,qBAAqB,iDAMpC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eA2ClE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 { createContext, useCallback, useContext, useMemo } from 'react';
|
|
15
|
+
import { useTimeSeriesQueries } from '../time-series-queries';
|
|
16
|
+
export function useDataQueries() {
|
|
17
|
+
const ctx = useDataQueriesContext();
|
|
18
|
+
return ctx;
|
|
19
|
+
}
|
|
20
|
+
export const DataQueriesContext = /*#__PURE__*/ createContext(undefined);
|
|
21
|
+
export function useDataQueriesContext() {
|
|
22
|
+
const ctx = useContext(DataQueriesContext);
|
|
23
|
+
if (ctx === undefined) {
|
|
24
|
+
throw new Error('No DataQueriesContext found. Did you forget a Provider?');
|
|
25
|
+
}
|
|
26
|
+
return ctx;
|
|
27
|
+
}
|
|
28
|
+
export function DataQueriesProvider(props) {
|
|
29
|
+
const { definitions , options , children } = props;
|
|
30
|
+
// For now we will map each query plugin definition to TimeSeriesQueryDefinition
|
|
31
|
+
// Later on when we add support for other query types,
|
|
32
|
+
// we will have to map each query maps to the correct QueryDefinition
|
|
33
|
+
const timeSeriesQueries = definitions.map((definition)=>({
|
|
34
|
+
kind: 'TimeSeriesQuery',
|
|
35
|
+
spec: {
|
|
36
|
+
plugin: definition
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
const results = useTimeSeriesQueries(timeSeriesQueries, options);
|
|
40
|
+
const data = results.map(({ data , isFetching , isLoading , refetch , error }, i)=>{
|
|
41
|
+
return {
|
|
42
|
+
definition: definitions[i],
|
|
43
|
+
data,
|
|
44
|
+
isFetching,
|
|
45
|
+
isLoading,
|
|
46
|
+
refetch,
|
|
47
|
+
error
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const refetchAll = useCallback(()=>{
|
|
51
|
+
results.forEach((result)=>result.refetch());
|
|
52
|
+
}, [
|
|
53
|
+
results
|
|
54
|
+
]);
|
|
55
|
+
const ctx = useMemo(()=>{
|
|
56
|
+
return {
|
|
57
|
+
queryResults: data,
|
|
58
|
+
isFetching: results.some((result)=>result.isFetching),
|
|
59
|
+
isLoading: results.some((result)=>result.isLoading),
|
|
60
|
+
refetchAll,
|
|
61
|
+
errors: results.map((result)=>result.error)
|
|
62
|
+
};
|
|
63
|
+
}, [
|
|
64
|
+
data,
|
|
65
|
+
results,
|
|
66
|
+
refetchAll
|
|
67
|
+
]);
|
|
68
|
+
return /*#__PURE__*/ _jsx(DataQueriesContext.Provider, {
|
|
69
|
+
value: ctx,
|
|
70
|
+
children: children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=DataQueriesProvider.js.map
|
|
@@ -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;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO,CAAC;AAExE,SAASC,oBAAoB,QAAQ,wBAAwB,CAAC;AAG9D,OAAO,SAASC,cAAc,GAAwB;IACpD,MAAMC,GAAG,GAAGC,qBAAqB,EAAE,AAAC;IACpC,OAAOD,GAAG,CAAC;AACb,CAAC;AAED,OAAO,MAAME,kBAAkB,iBAAGR,aAAa,CAAkCS,SAAS,CAAC,CAAC;AAE5F,OAAO,SAASF,qBAAqB,GAAG;IACtC,MAAMD,GAAG,GAAGJ,UAAU,CAACM,kBAAkB,CAAC,AAAC;IAC3C,IAAIF,GAAG,KAAKG,SAAS,EAAE;QACrB,MAAM,IAAIC,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAOJ,GAAG,CAAC;AACb,CAAC;AAED,OAAO,SAASK,mBAAmB,CAACC,KAA+B,EAAE;IACnE,MAAM,EAAEC,WAAW,CAAA,EAAEC,OAAO,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGH,KAAK,AAAC;IAEjD,gFAAgF;IAChF,sDAAsD;IACtD,qEAAqE;IACrE,MAAMI,iBAAiB,GAAGH,WAAW,CAACI,GAAG,CACvC,CAACC,UAAU,GACR,CAAA;YACCC,IAAI,EAAE,iBAAiB;YACvBC,IAAI,EAAE;gBACJC,MAAM,EAAEH,UAAU;aACnB;SACF,CAAA,AAA8B,CAClC,AAAC;IACF,MAAMI,OAAO,GAAGlB,oBAAoB,CAACY,iBAAiB,EAAEF,OAAO,CAAC,AAAC;IAEjE,MAAMS,IAAI,GAAGD,OAAO,CAACL,GAAG,CAAC,CAAC,EAAEM,IAAI,CAAA,EAAEC,UAAU,CAAA,EAAEC,SAAS,CAAA,EAAEC,OAAO,CAAA,EAAEC,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 @@
|
|
|
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"}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -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"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -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"}
|
|
@@ -4,7 +4,7 @@ import { DefaultPluginKinds, PluginImplementation, PluginMetadata, PluginType }
|
|
|
4
4
|
export interface PluginRegistryContextType {
|
|
5
5
|
getPlugin<T extends PluginType>(pluginType: T, kind: string): Promise<PluginImplementation<T>>;
|
|
6
6
|
listPluginMetadata(pluginType: PluginType): Promise<PluginMetadata[]>;
|
|
7
|
-
defaultPluginKinds
|
|
7
|
+
defaultPluginKinds: DefaultPluginKinds;
|
|
8
8
|
}
|
|
9
9
|
export declare const PluginRegistryContext: import("react").Context<PluginRegistryContextType | undefined>;
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/runtime/plugin-registry.ts"],"names":[],"mappings":";AAcA,OAAO,EAAwB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACtE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/runtime/plugin-registry.ts"],"names":[],"mappings":";AAcA,OAAO,EAAwB,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACtE,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,eAAO,MAAM,qBAAqB,gEAAkE,CAAC;AAErG;;;GAGG;AACH,wBAAgB,iBAAiB,8BAMhC;AAGD,aAAK,gBAAgB,CAAC,CAAC,SAAS,UAAU,IAAI,IAAI,CAChD,eAAe,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,EACtG,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,kFAQzG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,sFAU/F;AAGD,aAAK,4BAA4B,GAAG,IAAI,CACtC,eAAe,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAChF,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,4BAA4B,2EAGnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/runtime/plugin-registry.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 { createContext, useContext } from 'react';\nimport { useQuery, useQueries, UseQueryOptions } from '@tanstack/react-query';\nimport { DefaultPluginKinds, PluginImplementation, PluginMetadata, PluginType } from '../model';\n\nexport interface PluginRegistryContextType {\n getPlugin<T extends PluginType>(pluginType: T, kind: string): Promise<PluginImplementation<T>>;\n listPluginMetadata(pluginType: PluginType): Promise<PluginMetadata[]>;\n defaultPluginKinds
|
|
1
|
+
{"version":3,"sources":["../../src/runtime/plugin-registry.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 { createContext, useContext } from 'react';\nimport { useQuery, useQueries, UseQueryOptions } from '@tanstack/react-query';\nimport { DefaultPluginKinds, PluginImplementation, PluginMetadata, PluginType } from '../model';\n\nexport interface PluginRegistryContextType {\n getPlugin<T extends PluginType>(pluginType: T, kind: string): Promise<PluginImplementation<T>>;\n listPluginMetadata(pluginType: PluginType): Promise<PluginMetadata[]>;\n defaultPluginKinds: DefaultPluginKinds;\n}\n\nexport const PluginRegistryContext = createContext<PluginRegistryContextType | undefined>(undefined);\n\n/**\n * Use the PluginRegistry context directly. This is meant as an escape hatch for custom async flows. You should probably\n * be using `usePlugin` or `useListPluginMetadata` instead.\n */\nexport function usePluginRegistry() {\n const ctx = useContext(PluginRegistryContext);\n if (ctx === undefined) {\n throw new Error('PluginRegistryContext not found. Did you forget a provider?');\n }\n return ctx;\n}\n\n// Allows consumers to pass useQuery options from react-query when loading a plugin\ntype UsePluginOptions<T extends PluginType> = Omit<\n UseQueryOptions<PluginImplementation<T>, Error, PluginImplementation<T>, [string, PluginType, string]>,\n 'queryKey' | 'queryFn'\n>;\n\n/**\n * Loads a plugin and returns the plugin implementation, along with loading/error state.\n */\nexport function usePlugin<T extends PluginType>(pluginType: T, kind: string, options?: UsePluginOptions<T>) {\n // We never want to ask for a plugin when the kind isn't set yet, so disable those queries automatically\n options = {\n ...options,\n enabled: (options?.enabled ?? true) && kind !== '',\n };\n const { getPlugin } = usePluginRegistry();\n return useQuery(['getPlugin', pluginType, kind], () => getPlugin(pluginType, kind), options);\n}\n\n/**\n * Loads a list of plugins and returns the plugin implementation, along with loading/error state.\n */\nexport function usePlugins<T extends PluginType>(pluginType: T, plugins: Array<{ kind: string }>) {\n const { getPlugin } = usePluginRegistry();\n return useQueries({\n queries: plugins.map((p) => {\n return {\n queryKey: ['getPlugin', pluginType, p.kind],\n queryFn: () => getPlugin(pluginType, p.kind),\n };\n }),\n });\n}\n\n// Allow consumers to pass useQuery options from react-query when listing metadata\ntype UseListPluginMetadataOptions = Omit<\n UseQueryOptions<PluginMetadata[], Error, PluginMetadata[], [string, PluginType]>,\n 'queryKey' | 'queryFn'\n>;\n\n/**\n * Gets a list of plugin metadata for the specified plugin type and returns it, along with loading/error state.\n */\nexport function useListPluginMetadata(pluginType: PluginType, options?: UseListPluginMetadataOptions) {\n const { listPluginMetadata } = usePluginRegistry();\n return useQuery(['listPluginMetadata', pluginType], () => listPluginMetadata(pluginType), options);\n}\n"],"names":["createContext","useContext","useQuery","useQueries","PluginRegistryContext","undefined","usePluginRegistry","ctx","Error","usePlugin","pluginType","kind","options","enabled","getPlugin","usePlugins","plugins","queries","map","p","queryKey","queryFn","useListPluginMetadata","listPluginMetadata"],"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,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO,CAAC;AAClD,SAASC,QAAQ,EAAEC,UAAU,QAAyB,uBAAuB,CAAC;AAS9E,OAAO,MAAMC,qBAAqB,GAAGJ,aAAa,CAAwCK,SAAS,CAAC,CAAC;AAErG;;;CAGC,GACD,OAAO,SAASC,iBAAiB,GAAG;IAClC,MAAMC,GAAG,GAAGN,UAAU,CAACG,qBAAqB,CAAC,AAAC;IAC9C,IAAIG,GAAG,KAAKF,SAAS,EAAE;QACrB,MAAM,IAAIG,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IACD,OAAOD,GAAG,CAAC;AACb,CAAC;AAQD;;CAEC,GACD,OAAO,SAASE,SAAS,CAAuBC,UAAa,EAAEC,IAAY,EAAEC,OAA6B,EAAE;QAI9FA,GAAgB;IAH5B,wGAAwG;IACxGA,OAAO,GAAG;QACR,GAAGA,OAAO;QACVC,OAAO,EAAE,AAACD,CAAAA,CAAAA,GAAgB,GAAhBA,OAAO,aAAPA,OAAO,WAAS,GAAhBA,KAAAA,CAAgB,GAAhBA,OAAO,CAAEC,OAAO,cAAhBD,GAAgB,cAAhBA,GAAgB,GAAI,IAAI,CAAA,IAAKD,IAAI,KAAK,EAAE;KACnD,CAAC;IACF,MAAM,EAAEG,SAAS,CAAA,EAAE,GAAGR,iBAAiB,EAAE,AAAC;IAC1C,OAAOJ,QAAQ,CAAC;QAAC,WAAW;QAAEQ,UAAU;QAAEC,IAAI;KAAC,EAAE,IAAMG,SAAS,CAACJ,UAAU,EAAEC,IAAI,CAAC,EAAEC,OAAO,CAAC,CAAC;AAC/F,CAAC;AAED;;CAEC,GACD,OAAO,SAASG,UAAU,CAAuBL,UAAa,EAAEM,OAAgC,EAAE;IAChG,MAAM,EAAEF,SAAS,CAAA,EAAE,GAAGR,iBAAiB,EAAE,AAAC;IAC1C,OAAOH,UAAU,CAAC;QAChBc,OAAO,EAAED,OAAO,CAACE,GAAG,CAAC,CAACC,CAAC,GAAK;YAC1B,OAAO;gBACLC,QAAQ,EAAE;oBAAC,WAAW;oBAAEV,UAAU;oBAAES,CAAC,CAACR,IAAI;iBAAC;gBAC3CU,OAAO,EAAE,IAAMP,SAAS,CAACJ,UAAU,EAAES,CAAC,CAACR,IAAI,CAAC;aAC7C,CAAC;QACJ,CAAC,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAQD;;CAEC,GACD,OAAO,SAASW,qBAAqB,CAACZ,UAAsB,EAAEE,OAAsC,EAAE;IACpG,MAAM,EAAEW,kBAAkB,CAAA,EAAE,GAAGjB,iBAAiB,EAAE,AAAC;IACnD,OAAOJ,QAAQ,CAAC;QAAC,oBAAoB;QAAEQ,UAAU;KAAC,EAAE,IAAMa,kBAAkB,CAACb,UAAU,CAAC,EAAEE,OAAO,CAAC,CAAC;AACrG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAW9C,aAAK,cAAc,GAAG;IACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,KAAK,CAAC,SAAS,EACnB,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/test/render.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAU,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAW9C,aAAK,cAAc,GAAG;IACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,KAAK,CAAC,SAAS,EACnB,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,gIAsBhC"}
|
package/dist/test/render.js
CHANGED
|
@@ -36,11 +36,14 @@ const testLogger = {
|
|
|
36
36
|
},
|
|
37
37
|
logger: testLogger
|
|
38
38
|
});
|
|
39
|
+
var ref;
|
|
39
40
|
return render(/*#__PURE__*/ _jsx(QueryClientProvider, {
|
|
40
41
|
client: queryClient,
|
|
41
42
|
children: /*#__PURE__*/ _jsx(PluginRegistry, {
|
|
42
43
|
pluginLoader: testPluginLoader,
|
|
43
|
-
defaultPluginKinds: contextOptions === null || contextOptions === void 0 ? void 0 : contextOptions.defaultPluginKinds
|
|
44
|
+
defaultPluginKinds: (ref = contextOptions === null || contextOptions === void 0 ? void 0 : contextOptions.defaultPluginKinds) !== null && ref !== void 0 ? ref : {
|
|
45
|
+
TimeSeriesQuery: 'PrometheusTimeSeriesQuery'
|
|
46
|
+
},
|
|
44
47
|
children: ui
|
|
45
48
|
})
|
|
46
49
|
}), renderOptions);
|
package/dist/test/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test/render.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 { render, RenderOptions } from '@testing-library/react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { PluginRegistry } from '../components/PluginRegistry';\nimport { DefaultPluginKinds } from '../model';\nimport { testPluginLoader } from './test-plugins';\n\nconst testLogger = {\n log: console.log,\n warn: console.warn,\n error: () => {\n // Don't log network errors in tests to the console\n },\n};\n\ntype ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\n/**\n * Test helper to render a React component with some common app-level providers, as well as the PluginRegistry\n * wrapped around it.\n */\nexport function renderWithContext(\n ui: React.ReactNode,\n renderOptions?: Omit<RenderOptions, 'queries'>,\n contextOptions?: ContextOptions\n) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n logger: testLogger,\n });\n return render(\n <QueryClientProvider client={queryClient}>\n <PluginRegistry
|
|
1
|
+
{"version":3,"sources":["../../src/test/render.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 { render, RenderOptions } from '@testing-library/react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { PluginRegistry } from '../components/PluginRegistry';\nimport { DefaultPluginKinds } from '../model';\nimport { testPluginLoader } from './test-plugins';\n\nconst testLogger = {\n log: console.log,\n warn: console.warn,\n error: () => {\n // Don't log network errors in tests to the console\n },\n};\n\ntype ContextOptions = {\n defaultPluginKinds?: DefaultPluginKinds;\n};\n\n/**\n * Test helper to render a React component with some common app-level providers, as well as the PluginRegistry\n * wrapped around it.\n */\nexport function renderWithContext(\n ui: React.ReactNode,\n renderOptions?: Omit<RenderOptions, 'queries'>,\n contextOptions?: ContextOptions\n) {\n // Create a new QueryClient for each test to avoid caching issues\n const queryClient = new QueryClient({\n defaultOptions: { queries: { refetchOnWindowFocus: false, retry: false } },\n logger: testLogger,\n });\n return render(\n <QueryClientProvider client={queryClient}>\n <PluginRegistry\n pluginLoader={testPluginLoader}\n defaultPluginKinds={\n contextOptions?.defaultPluginKinds ?? {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n }\n }\n >\n {ui}\n </PluginRegistry>\n </QueryClientProvider>,\n renderOptions\n );\n}\n"],"names":["render","QueryClient","QueryClientProvider","PluginRegistry","testPluginLoader","testLogger","log","console","warn","error","renderWithContext","ui","renderOptions","contextOptions","queryClient","defaultOptions","queries","refetchOnWindowFocus","retry","logger","client","pluginLoader","defaultPluginKinds","TimeSeriesQuery"],"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,QAAuB,wBAAwB,CAAC;AAC/D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,uBAAuB,CAAC;AACzE,SAASC,cAAc,QAAQ,8BAA8B,CAAC;AAE9D,SAASC,gBAAgB,QAAQ,gBAAgB,CAAC;AAElD,MAAMC,UAAU,GAAG;IACjBC,GAAG,EAAEC,OAAO,CAACD,GAAG;IAChBE,IAAI,EAAED,OAAO,CAACC,IAAI;IAClBC,KAAK,EAAE,IAAM;IACX,mDAAmD;IACrD,CAAC;CACF,AAAC;AAMF;;;CAGC,GACD,OAAO,SAASC,iBAAiB,CAC/BC,EAAmB,EACnBC,aAA8C,EAC9CC,cAA+B,EAC/B;IACA,iEAAiE;IACjE,MAAMC,WAAW,GAAG,IAAIb,WAAW,CAAC;QAClCc,cAAc,EAAE;YAAEC,OAAO,EAAE;gBAAEC,oBAAoB,EAAE,KAAK;gBAAEC,KAAK,EAAE,KAAK;aAAE;SAAE;QAC1EC,MAAM,EAAEd,UAAU;KACnB,CAAC,AAAC;QAMKQ,GAAkC;IAL1C,OAAOb,MAAM,eACX,KAACE,mBAAmB;QAACkB,MAAM,EAAEN,WAAW;kBACtC,cAAA,KAACX,cAAc;YACbkB,YAAY,EAAEjB,gBAAgB;YAC9BkB,kBAAkB,EAChBT,CAAAA,GAAkC,GAAlCA,cAAc,aAAdA,cAAc,WAAoB,GAAlCA,KAAAA,CAAkC,GAAlCA,cAAc,CAAES,kBAAkB,cAAlCT,GAAkC,cAAlCA,GAAkC,GAAI;gBACpCU,eAAe,EAAE,2BAA2B;aAC7C;sBAGFZ,EAAE;UACY;MACG,EACtBC,aAAa,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/bert/index.tsx"],"names":[],"mappings":"AAaA,OAAO,
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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\
|
|
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,gBAAgB,CAAC,EAAEC,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAA2C,EAAE;IACtF,qBACE,MAACC,KAAG;;0BACF,KAACC,OAAK;gBAACC,OAAO,EAAC,cAAc;0BAAC,mBAAiB;cAAQ;0BACvD,KAACC,OAAK;gBACJC,IAAI,EAAC,MAAM;gBACXC,EAAE,EAAC,cAAc;gBACjBP,KAAK,EAAEA,KAAK,CAACQ,OAAO;gBACpBP,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;wBAAE,GAAGD,KAAK;wBAAEQ,OAAO,EAAEC,CAAC,CAACC,MAAM,CAACV,KAAK;qBAAE,CAAC;cAChE;;MACE,CACN;AACJ,CAAC;AAED,gCAAgC;AAChC,OAAO,MAAMW,UAAU,GAAqC;IAC1DC,cAAc,EAAE,IAAM,IAAI;IAC1BC,4BAA4B,EAAE;QAC5B;YACEV,KAAK,EAAE,QAAQ;YACfW,OAAO,EAAEf,gBAAgB;SAC1B;KACF;IACDgB,oBAAoB,EAAE,IAAO,CAAA;YAAEP,OAAO,EAAE,EAAE;SAAE,CAAA,AAAC;CAC9C,CAAC;AAEF,OAAO,MAAMQ,UAAU,GAAqC;IAC1DJ,cAAc,EAAE,IAAM,IAAI;IAC1BC,4BAA4B,EAAE;QAC5B;YACEV,KAAK,EAAE,UAAU;YACjBW,OAAO,EAAE,SAASG,gBAAgB,CAAC,EAAEjB,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,CAACkB,OAAO;4BACpBjB,QAAQ,EAAE,CAACQ,CAAC,GAAKR,QAAQ,CAAC;oCAAE,GAAGD,KAAK;oCAAEkB,OAAO,EAAET,CAAC,CAACC,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
|
|
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,
|
|
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
|
|
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
|
|
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,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,cAAc,GAA+C;IACxEC,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;AAEF,OAAO,MAAMI,cAAc,GAAgD;IACzEb,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,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test-utils/mock-plugin-registry.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAA8C,oBAAoB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExG,oBAAY,UAAU,GAAG;KACtB,CAAC,IAAI,UAAU,GAAG;QACjB,UAAU,EAAE,CAAC,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;KACjC;CACF,CAAC,UAAU,CAAC,CAAC;AAEd;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"mock-plugin-registry.d.ts","sourceRoot":"","sources":["../../src/test-utils/mock-plugin-registry.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAA8C,oBAAoB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExG,oBAAY,UAAU,GAAG;KACtB,CAAC,IAAI,UAAU,GAAG;QACjB,UAAU,EAAE,CAAC,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;KACjC;CACF,CAAC,UAAU,CAAC,CAAC;AAEd;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CA0CtG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,UAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.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 { UnknownSpec } from '@perses-dev/core';\nimport { PluginRegistryProps } from '../components';\nimport { PluginModuleResource, Plugin, PluginLoader, PluginImplementation, PluginType } from '../model';\n\nexport type MockPlugin = {\n [T in PluginType]: {\n pluginType: T;\n kind: string;\n plugin: PluginImplementation<T>;\n };\n}[PluginType];\n\n/**\n * Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`\n * component so that it will load the mock plugins you provide.\n */\nexport function mockPluginRegistry(...mockPlugins: MockPlugin[]): Omit<PluginRegistryProps, 'children'> {\n const mockPluginResource: PluginModuleResource = {\n kind: 'PluginModule',\n metadata: {\n name: 'Fake Plugin Module for Tests',\n created_at: '',\n updated_at: '',\n version: 0,\n },\n spec: {\n // Add metadata for all mock plugins\n plugins: mockPlugins.map(({ pluginType, kind }) => ({\n pluginType,\n kind,\n display: {\n name: getMockPluginName(pluginType, kind),\n },\n })),\n },\n };\n\n const mockPluginModule: Record<string, Plugin<UnknownSpec>> = {};\n for (const mockPlugin of mockPlugins) {\n // \"Export\" on the module under the same name as the kind the plugin handles\n mockPluginModule[mockPlugin.kind] = mockPlugin.plugin;\n }\n\n const pluginLoader: PluginLoader = {\n getInstalledPlugins() {\n return Promise.resolve([mockPluginResource]);\n },\n importPluginModule(/* resource */) {\n return Promise.resolve(mockPluginModule);\n },\n };\n\n return {\n pluginLoader,\n };\n}\n\n/**\n * The function that's used to generate the display name of mocked plugins in mockPluginRegistry. Can be useful if you\n * need to interact with some UI component that's displaying it.\n */\nexport function getMockPluginName(pluginType: PluginType, kind: string) {\n return `${pluginType} Plugin for ${kind}`;\n}\n"],"names":["mockPluginRegistry","mockPlugins","mockPluginResource","kind","metadata","name","created_at","updated_at","version","spec","plugins","map","pluginType","display","getMockPluginName","mockPluginModule","mockPlugin","plugin","pluginLoader","getInstalledPlugins","Promise","resolve","importPluginModule"],"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;AAcjC;;;CAGC,GACD,OAAO,SAASA,kBAAkB,CAAC,GAAGC,WAAW,AAAc,EAAyC;IACtG,MAAMC,kBAAkB,GAAyB;QAC/CC,IAAI,EAAE,cAAc;QACpBC,QAAQ,EAAE;YACRC,IAAI,EAAE,8BAA8B;YACpCC,UAAU,EAAE,EAAE;YACdC,UAAU,EAAE,EAAE;YACdC,OAAO,EAAE,CAAC;SACX;QACDC,IAAI,EAAE;YACJ,oCAAoC;YACpCC,OAAO,EAAET,WAAW,CAACU,GAAG,CAAC,CAAC,EAAEC,UAAU,CAAA,EAAET,IAAI,CAAA,EAAE,GAAM,CAAA;oBAClDS,UAAU;oBACVT,IAAI;oBACJU,OAAO,EAAE;wBACPR,IAAI,EAAES,iBAAiB,CAACF,UAAU,EAAET,IAAI,CAAC;qBAC1C;iBACF,CAAA,AAAC,CAAC;SACJ;KACF,AAAC;IAEF,MAAMY,gBAAgB,GAAwC,EAAE,AAAC;IACjE,KAAK,MAAMC,UAAU,IAAIf,WAAW,CAAE;QACpC,4EAA4E;QAC5Ec,gBAAgB,CAACC,UAAU,CAACb,IAAI,CAAC,GAAGa,UAAU,CAACC,MAAM,CAAC;IACxD,CAAC;IAED,MAAMC,YAAY,GAAiB;QACjCC,mBAAmB,IAAG;YACpB,OAAOC,OAAO,CAACC,OAAO,CAAC;gBAACnB,kBAAkB;aAAC,CAAC,CAAC;QAC/C,CAAC;QACDoB,kBAAkB,IAAiB;YACjC,OAAOF,OAAO,CAACC,OAAO,CAACN,gBAAgB,CAAC,CAAC;QAC3C,CAAC;KACF,AAAC;IAEF,OAAO;QACLG,YAAY;
|
|
1
|
+
{"version":3,"sources":["../../src/test-utils/mock-plugin-registry.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 { UnknownSpec } from '@perses-dev/core';\nimport { PluginRegistryProps } from '../components';\nimport { PluginModuleResource, Plugin, PluginLoader, PluginImplementation, PluginType } from '../model';\n\nexport type MockPlugin = {\n [T in PluginType]: {\n pluginType: T;\n kind: string;\n plugin: PluginImplementation<T>;\n };\n}[PluginType];\n\n/**\n * Helper for mocking `PluginRegistry` data during tests. Returns props that can be spread on the `PluginRegistry`\n * component so that it will load the mock plugins you provide.\n */\nexport function mockPluginRegistry(...mockPlugins: MockPlugin[]): Omit<PluginRegistryProps, 'children'> {\n const mockPluginResource: PluginModuleResource = {\n kind: 'PluginModule',\n metadata: {\n name: 'Fake Plugin Module for Tests',\n created_at: '',\n updated_at: '',\n version: 0,\n },\n spec: {\n // Add metadata for all mock plugins\n plugins: mockPlugins.map(({ pluginType, kind }) => ({\n pluginType,\n kind,\n display: {\n name: getMockPluginName(pluginType, kind),\n },\n })),\n },\n };\n\n const mockPluginModule: Record<string, Plugin<UnknownSpec>> = {};\n for (const mockPlugin of mockPlugins) {\n // \"Export\" on the module under the same name as the kind the plugin handles\n mockPluginModule[mockPlugin.kind] = mockPlugin.plugin;\n }\n\n const pluginLoader: PluginLoader = {\n getInstalledPlugins() {\n return Promise.resolve([mockPluginResource]);\n },\n importPluginModule(/* resource */) {\n return Promise.resolve(mockPluginModule);\n },\n };\n\n return {\n pluginLoader,\n defaultPluginKinds: {\n TimeSeriesQuery: 'PrometheusTimeSeriesQuery',\n },\n };\n}\n\n/**\n * The function that's used to generate the display name of mocked plugins in mockPluginRegistry. Can be useful if you\n * need to interact with some UI component that's displaying it.\n */\nexport function getMockPluginName(pluginType: PluginType, kind: string) {\n return `${pluginType} Plugin for ${kind}`;\n}\n"],"names":["mockPluginRegistry","mockPlugins","mockPluginResource","kind","metadata","name","created_at","updated_at","version","spec","plugins","map","pluginType","display","getMockPluginName","mockPluginModule","mockPlugin","plugin","pluginLoader","getInstalledPlugins","Promise","resolve","importPluginModule","defaultPluginKinds","TimeSeriesQuery"],"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;AAcjC;;;CAGC,GACD,OAAO,SAASA,kBAAkB,CAAC,GAAGC,WAAW,AAAc,EAAyC;IACtG,MAAMC,kBAAkB,GAAyB;QAC/CC,IAAI,EAAE,cAAc;QACpBC,QAAQ,EAAE;YACRC,IAAI,EAAE,8BAA8B;YACpCC,UAAU,EAAE,EAAE;YACdC,UAAU,EAAE,EAAE;YACdC,OAAO,EAAE,CAAC;SACX;QACDC,IAAI,EAAE;YACJ,oCAAoC;YACpCC,OAAO,EAAET,WAAW,CAACU,GAAG,CAAC,CAAC,EAAEC,UAAU,CAAA,EAAET,IAAI,CAAA,EAAE,GAAM,CAAA;oBAClDS,UAAU;oBACVT,IAAI;oBACJU,OAAO,EAAE;wBACPR,IAAI,EAAES,iBAAiB,CAACF,UAAU,EAAET,IAAI,CAAC;qBAC1C;iBACF,CAAA,AAAC,CAAC;SACJ;KACF,AAAC;IAEF,MAAMY,gBAAgB,GAAwC,EAAE,AAAC;IACjE,KAAK,MAAMC,UAAU,IAAIf,WAAW,CAAE;QACpC,4EAA4E;QAC5Ec,gBAAgB,CAACC,UAAU,CAACb,IAAI,CAAC,GAAGa,UAAU,CAACC,MAAM,CAAC;IACxD,CAAC;IAED,MAAMC,YAAY,GAAiB;QACjCC,mBAAmB,IAAG;YACpB,OAAOC,OAAO,CAACC,OAAO,CAAC;gBAACnB,kBAAkB;aAAC,CAAC,CAAC;QAC/C,CAAC;QACDoB,kBAAkB,IAAiB;YACjC,OAAOF,OAAO,CAACC,OAAO,CAACN,gBAAgB,CAAC,CAAC;QAC3C,CAAC;KACF,AAAC;IAEF,OAAO;QACLG,YAAY;QACZK,kBAAkB,EAAE;YAClBC,eAAe,EAAE,2BAA2B;SAC7C;KACF,CAAC;AACJ,CAAC;AAED;;;CAGC,GACD,OAAO,SAASV,iBAAiB,CAACF,UAAsB,EAAET,IAAY,EAAE;IACtE,OAAO,CAAC,EAAES,UAAU,CAAC,YAAY,EAAET,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/plugin-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.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.
|
|
32
|
-
"@perses-dev/core": "0.
|
|
31
|
+
"@perses-dev/components": "0.29.0",
|
|
32
|
+
"@perses-dev/core": "0.29.0",
|
|
33
33
|
"immer": "^9.0.15",
|
|
34
34
|
"use-immer": "^0.7.0",
|
|
35
35
|
"use-query-params": "^2.1.2"
|