@perses-dev/plugin-system 0.0.0-snapshot-color-palette-gen-test-0ebddd6 → 0.0.0-snapshot-tooltip-highlight-c995fc8
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/stories/shared-utils/decorators/WithDataQueries.js +39 -0
- package/dist/cjs/stories/shared-utils/decorators/WithDatasourceStore.js +83 -0
- package/dist/cjs/stories/shared-utils/decorators/WithPluginRegistry.js +94 -0
- package/dist/cjs/stories/shared-utils/decorators/WithTimeRange.js +38 -0
- package/dist/cjs/stories/shared-utils/decorators/index.js +31 -0
- package/dist/cjs/stories/shared-utils/index.js +28 -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/stories/shared-utils/decorators/WithDataQueries.d.ts +8 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.js +33 -0
- package/dist/stories/shared-utils/decorators/WithDataQueries.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDatasourceStore.d.ts +8 -0
- package/dist/stories/shared-utils/decorators/WithDatasourceStore.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithDatasourceStore.js +77 -0
- package/dist/stories/shared-utils/decorators/WithDatasourceStore.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts +4 -0
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js +49 -0
- package/dist/stories/shared-utils/decorators/WithPluginRegistry.js.map +1 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts +8 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.js +32 -0
- package/dist/stories/shared-utils/decorators/WithTimeRange.js.map +1 -0
- package/dist/stories/shared-utils/decorators/index.d.ts +5 -0
- package/dist/stories/shared-utils/decorators/index.d.ts.map +1 -0
- package/dist/stories/shared-utils/decorators/index.js +18 -0
- package/dist/stories/shared-utils/decorators/index.js.map +1 -0
- package/dist/stories/shared-utils/index.d.ts +2 -0
- package/dist/stories/shared-utils/index.d.ts.map +1 -0
- package/dist/stories/shared-utils/index.js +15 -0
- package/dist/stories/shared-utils/index.js.map +1 -0
- 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 +6 -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
|
@@ -0,0 +1,83 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import produce from 'immer';
|
|
15
|
+
import { Stack, IconButton, Typography, Box } from '@mui/material';
|
|
16
|
+
import DeleteIcon from 'mdi-material-ui/DeleteOutline';
|
|
17
|
+
import ChevronDown from 'mdi-material-ui/ChevronDown';
|
|
18
|
+
import ChevronRight from 'mdi-material-ui/ChevronRight';
|
|
19
|
+
import { PluginEditor } from '../PluginEditor';
|
|
20
|
+
export const TimeSeriesQueryInput = ({ index , query , isCollapsed , onDelete , onChange , onCollapseExpand })=>{
|
|
21
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
22
|
+
spacing: 1,
|
|
23
|
+
children: [
|
|
24
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
25
|
+
direction: "row",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
borderBottom: 1,
|
|
28
|
+
borderColor: (theme)=>theme.palette.divider,
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ _jsx(IconButton, {
|
|
31
|
+
size: "small",
|
|
32
|
+
onClick: ()=>onCollapseExpand(index),
|
|
33
|
+
children: isCollapsed ? /*#__PURE__*/ _jsx(ChevronRight, {}) : /*#__PURE__*/ _jsx(ChevronDown, {})
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsxs(Typography, {
|
|
36
|
+
variant: "overline",
|
|
37
|
+
component: "h4",
|
|
38
|
+
children: [
|
|
39
|
+
"Query ",
|
|
40
|
+
index + 1
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ _jsx(IconButton, {
|
|
44
|
+
size: "small",
|
|
45
|
+
// Use `visibility` to ensure that the row has the same height when delete button is visible or not visible
|
|
46
|
+
sx: {
|
|
47
|
+
marginLeft: 'auto',
|
|
48
|
+
visibility: `${onDelete ? 'visible' : 'hidden'}`
|
|
49
|
+
},
|
|
50
|
+
onClick: ()=>onDelete && onDelete(index),
|
|
51
|
+
children: /*#__PURE__*/ _jsx(DeleteIcon, {})
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
55
|
+
!isCollapsed && /*#__PURE__*/ _jsx(QueryEditor, {
|
|
56
|
+
value: query,
|
|
57
|
+
onChange: (next)=>onChange(index, next)
|
|
58
|
+
})
|
|
59
|
+
]
|
|
60
|
+
}, index);
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Displays an editor for TimeSeriesQueryDefinition objects.
|
|
64
|
+
*/ function QueryEditor(props) {
|
|
65
|
+
const { value , onChange , ...others } = props;
|
|
66
|
+
const { spec: { plugin } , } = value;
|
|
67
|
+
const handlePluginChange = (next)=>{
|
|
68
|
+
onChange(produce(value, (draft)=>{
|
|
69
|
+
draft.spec.plugin = next;
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
73
|
+
...others,
|
|
74
|
+
children: /*#__PURE__*/ _jsx(PluginEditor, {
|
|
75
|
+
pluginType: "TimeSeriesQuery",
|
|
76
|
+
pluginKindLabel: "Query Type",
|
|
77
|
+
value: plugin,
|
|
78
|
+
onChange: handlePluginChange
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=TimeSeriesQueryInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/TimeSeriesQueryInput.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 produce from 'immer';\nimport { TimeSeriesQueryDefinition } from '@perses-dev/core';\nimport { Stack, IconButton, Typography, BoxProps, Box } from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport ChevronDown from 'mdi-material-ui/ChevronDown';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport { PluginEditor, PluginEditorProps } from '../PluginEditor';\n\ninterface TimeSeriesQueryInputProps {\n query: TimeSeriesQueryDefinition;\n index: number;\n onChange: (index: number, query: TimeSeriesQueryDefinition) => void;\n onCollapseExpand: (index: number) => void;\n isCollapsed?: boolean;\n onDelete?: (index: number) => void;\n}\n\nexport const TimeSeriesQueryInput = ({\n index,\n query,\n isCollapsed,\n onDelete,\n onChange,\n onCollapseExpand,\n}: TimeSeriesQueryInputProps) => {\n return (\n <Stack key={index} spacing={1}>\n <Stack direction=\"row\" alignItems=\"center\" borderBottom={1} borderColor={(theme) => theme.palette.divider}>\n <IconButton size=\"small\" onClick={() => onCollapseExpand(index)}>\n {isCollapsed ? <ChevronRight /> : <ChevronDown />}\n </IconButton>\n <Typography variant=\"overline\" component=\"h4\">\n Query {index + 1}\n </Typography>\n <IconButton\n size=\"small\"\n // Use `visibility` to ensure that the row has the same height when delete button is visible or not visible\n sx={{ marginLeft: 'auto', visibility: `${onDelete ? 'visible' : 'hidden'}` }}\n onClick={() => onDelete && onDelete(index)}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n {!isCollapsed && <QueryEditor value={query} onChange={(next) => onChange(index, next)} />}\n </Stack>\n );\n};\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\ninterface QueryEditorProps extends Omit<BoxProps, OmittedMuiProps> {\n value: TimeSeriesQueryDefinition;\n onChange: (next: TimeSeriesQueryDefinition) => void;\n}\n\n/**\n * Displays an editor for TimeSeriesQueryDefinition objects.\n */\nfunction QueryEditor(props: QueryEditorProps) {\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":["produce","Stack","IconButton","Typography","Box","DeleteIcon","ChevronDown","ChevronRight","PluginEditor","TimeSeriesQueryInput","index","query","isCollapsed","onDelete","onChange","onCollapseExpand","spacing","direction","alignItems","borderBottom","borderColor","theme","palette","divider","size","onClick","variant","component","sx","marginLeft","visibility","QueryEditor","value","next","props","others","spec","plugin","handlePluginChange","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,OAAOA,OAAO,MAAM,OAAO,CAAC;AAE5B,SAASC,KAAK,EAAEC,UAAU,EAAEC,UAAU,EAAYC,GAAG,QAAQ,eAAe,CAAC;AAC7E,OAAOC,UAAU,MAAM,+BAA+B,CAAC;AACvD,OAAOC,WAAW,MAAM,6BAA6B,CAAC;AACt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K,CAkBT,CACR;AACJ,CAAC,CAAC;AAWF;;CAEC,GACD,SAASqB,WAAW,CAACG,KAAuB,EAAE;IAC5C,MAAM,EAAEF,KAAK,CAAA,EAAElB,QAAQ,CAAA,EAAE,GAAGqB,MAAM,EAAE,GAAGD,KAAK,AAAC;IAC7C,MAAM,EACJE,IAAI,EAAE,EAAEC,MAAM,CAAA,EAAE,CAAA,IACjB,GAAGL,KAAK,AAAC;IAEV,MAAMM,kBAAkB,GAAkC,CAACL,IAAI,GAAK;QAClEnB,QAAQ,CACNd,OAAO,CAACgC,KAAK,EAAE,CAACO,KAAK,GAAK;YACxBA,KAAK,CAACH,IAAI,CAACC,MAAM,GAAGJ,IAAI,CAAC;QAC3B,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,AAAC;IAEF,qBACE,KAAC7B,GAAG;QAAE,GAAG+B,MAAM;kBAEb,cAAA,KAAC3B,YAAY;YACXgC,UAAU,EAAC,iBAAiB;YAC5BC,eAAe,EAAC,YAAY;YAC5BT,KAAK,EAAEK,MAAM;YACbvB,QAAQ,EAAEwB,kBAAkB;UAC5B;MACE,CACN;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TimeSeriesQueryEditor/index.tsx"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC"}
|
|
@@ -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 * from './TimeSeriesQueryEditor';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/TimeSeriesQueryEditor/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\nexport * from './TimeSeriesQueryEditor';\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,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
export * from './CalculationSelector';
|
|
14
14
|
export * from './DatasourceSelect';
|
|
15
15
|
export * from './OptionsEditorTabs';
|
|
16
|
+
export * from './PanelSpecEditor';
|
|
16
17
|
export * from './PluginEditor';
|
|
17
18
|
export * from './PluginKindSelect';
|
|
18
19
|
export * from './PluginRegistry';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './CalculationSelector';\nexport * from './DatasourceSelect';\nexport * from './OptionsEditorTabs';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeSeriesQueryEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './CalculationSelector';\nexport * from './DatasourceSelect';\nexport * from './OptionsEditorTabs';\nexport * from './PanelSpecEditor';\nexport * from './PluginEditor';\nexport * from './PluginKindSelect';\nexport * from './PluginRegistry';\nexport * from './PluginSpecEditor';\nexport * from './TimeSeriesQueryEditor';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC"}
|
package/dist/model/panels.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnknownSpec } from '@perses-dev/core';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { UnknownSpec } from '@perses-dev/core';
|
|
3
3
|
import { OptionsEditorTab } from '../components';
|
|
4
4
|
import { OptionsEditorProps, Plugin } from './plugin-base';
|
|
5
5
|
export declare type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {
|
|
@@ -10,14 +10,15 @@ export declare type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'lab
|
|
|
10
10
|
*/
|
|
11
11
|
export interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {
|
|
12
12
|
PanelComponent: React.ComponentType<PanelProps<Spec>>;
|
|
13
|
-
/**
|
|
14
|
-
* React component for the content of "Query" tab
|
|
15
|
-
*/
|
|
16
|
-
PanelQueryEditorComponent?: React.ComponentType<OptionsEditorProps<Spec>>;
|
|
17
13
|
/**
|
|
18
14
|
* React components for custom tabs
|
|
19
15
|
*/
|
|
20
16
|
panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;
|
|
17
|
+
/**
|
|
18
|
+
* If true, query editor will be hidden for panel plugin
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
hideQueryEditor?: boolean;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* The props provided by Perses to a panel plugin's PanelComponent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE3D,oBAAY,2BAA2B,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG;IAC7E,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AACF;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI,GAAG,WAAW,CAAE,SAAQ,MAAM,CAAC,IAAI,CAAC;IACnE,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD;;OAEG;IACH,4BAA4B,CAAC,EAAE,KAAK,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
|
package/dist/model/panels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { UnknownSpec } from '@perses-dev/core';\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\nimport { UnknownSpec } from '@perses-dev/core';\nimport { OptionsEditorTab } from '../components';\nimport { OptionsEditorProps, Plugin } from './plugin-base';\n\nexport type PanelOptionsEditorComponent<T> = Pick<OptionsEditorTab, 'label'> & {\n content: React.ComponentType<OptionsEditorProps<T>>;\n};\n/**\n * Plugin the provides custom visualizations inside of a Panel.\n */\nexport interface PanelPlugin<Spec = UnknownSpec> extends Plugin<Spec> {\n PanelComponent: React.ComponentType<PanelProps<Spec>>;\n /**\n * React components for custom tabs\n */\n panelOptionsEditorComponents?: Array<PanelOptionsEditorComponent<Spec>>;\n /**\n * If true, query editor will be hidden for panel plugin\n * @default false\n */\n hideQueryEditor?: boolean;\n}\n\n/**\n * The props provided by Perses to a panel plugin's PanelComponent.\n */\nexport interface PanelProps<Spec> {\n spec: Spec;\n contentDimensions?: {\n width: number;\n height: number;\n };\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAOA,KAAK,MAAM,OAAO,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { QueryDefinition } from '@perses-dev/core';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* Base type of all plugin implementations.
|
|
@@ -19,4 +20,10 @@ export interface OptionsEditorProps<Spec> {
|
|
|
19
20
|
value: Spec;
|
|
20
21
|
onChange: (next: Spec) => void;
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Common props passed to query editor component
|
|
25
|
+
*/
|
|
26
|
+
export interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {
|
|
27
|
+
queries: QueryDefinition[];
|
|
28
|
+
}
|
|
22
29
|
//# sourceMappingURL=plugin-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-base.d.ts","sourceRoot":"","sources":["../../src/model/plugin-base.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,IAAI;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAEvE;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI;IAGtC,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC"}
|
|
1
|
+
{"version":3,"file":"plugin-base.d.ts","sourceRoot":"","sources":["../../src/model/plugin-base.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,MAAM,CAAC,IAAI;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAEvE;;OAEG;IACH,oBAAoB,EAAE,MAAM,IAAI,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,IAAI;IAGtC,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,IAAI,CAAE,SAAQ,kBAAkB,CAAC,IAAI,CAAC;IACtE,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorProps<Spec>>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;
|
|
1
|
+
{"version":3,"sources":["../../src/model/plugin-base.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { QueryDefinition } from '@perses-dev/core';\nimport React from 'react';\n\n/**\n * Base type of all plugin implementations.\n */\nexport interface Plugin<Spec> {\n /**\n * React component for editing the plugin's options in the UI.\n */\n OptionsEditorComponent?: React.ComponentType<OptionsEditorProps<Spec>>;\n\n /**\n * Callback for creating the initial options for the plugin.\n */\n createInitialOptions: () => Spec;\n}\n\n/**\n * Common props passed to options editor components.\n */\nexport interface OptionsEditorProps<Spec> {\n // TODO: These are temporary and may not actually make sense, so replace\n // with whatever makes sense as visual editing evolves\n value: Spec;\n onChange: (next: Spec) => void;\n}\n\n/**\n * Common props passed to query editor component\n */\nexport interface QueryEditorProps<Spec> extends OptionsEditorProps<Spec> {\n queries: QueryDefinition[];\n}\n"],"names":["React"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAOA,KAAK,MAAM,OAAO,CAAC"}
|
package/dist/model/plugins.d.ts
CHANGED
|
@@ -50,5 +50,7 @@ export declare type PluginImplementation<Type extends PluginType> = SupportedPlu
|
|
|
50
50
|
/**
|
|
51
51
|
* Default plugin kinds by plugin type.
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
declare type PluginKinds = Partial<Record<PluginType, string>>;
|
|
54
|
+
export declare type DefaultPluginKinds = Required<Pick<PluginKinds, 'TimeSeriesQuery'>> & Omit<PluginKinds, 'TimeSeriesQuery'>;
|
|
55
|
+
export {};
|
|
54
56
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/model/plugins.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAA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C,WAAW,EAAE,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -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"],"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,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,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C,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,O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2
|
+
import { DataQueriesProviderProps } from '@perses-dev/plugin-system';
|
|
3
|
+
import { StoryFn, StoryContext } from '@storybook/react';
|
|
4
|
+
export declare type WithDataQueriesProvideParameter = {
|
|
5
|
+
props: DataQueriesProviderProps;
|
|
6
|
+
};
|
|
7
|
+
export declare const WithDataQueries: (Story: StoryFn, context: StoryContext<unknown>) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=WithDataQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithDataQueries.d.ts","sourceRoot":"","sources":["../../../../src/stories/shared-utils/decorators/WithDataQueries.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAuB,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzD,oBAAY,+BAA+B,GAAG;IAC5C,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;AASF,eAAO,MAAM,eAAe,UAAW,OAAO,WAAW,aAAa,OAAO,CAAC,gBAY7E,CAAC"}
|