@perses-dev/plugin-system 0.8.0 → 0.9.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/PluginRegistry/PluginRegistry.js +43 -29
- package/dist/cjs/components/PluginRegistry/PluginRegistry.test.js +114 -38
- package/dist/cjs/components/PluginRegistry/index.js +17 -18
- package/dist/cjs/components/PluginRegistry/plugin-indexes.js +23 -20
- package/dist/cjs/components/PluginRegistry/plugin-registry-model.js +17 -7
- package/dist/cjs/components/PluginRegistry/test-plugins/bert/index.js +22 -12
- package/dist/cjs/components/PluginRegistry/test-plugins/ernie/index.js +20 -8
- package/dist/cjs/components/PluginRegistry/test-plugins/index.js +59 -39
- package/dist/cjs/components/index.js +17 -20
- package/dist/cjs/index.js +19 -20
- package/dist/cjs/model/datasource.js +16 -0
- package/dist/cjs/model/index.js +21 -21
- package/dist/cjs/model/panels.js +4 -21
- package/dist/cjs/model/plugins.js +4 -7
- package/dist/cjs/model/time-series-queries.js +16 -0
- package/dist/cjs/model/variables.js +5 -17
- package/dist/cjs/model/visual-editing.js +10 -2
- package/dist/cjs/runtime/datasources.js +20 -13
- package/dist/cjs/runtime/index.js +22 -21
- package/dist/cjs/runtime/plugins.js +25 -22
- package/dist/cjs/runtime/query-string.js +17 -10
- package/dist/cjs/runtime/template-variables.js +34 -16
- package/dist/cjs/runtime/time-range.js +17 -10
- package/dist/cjs/runtime/time-series-queries.js +58 -0
- package/dist/cjs/test/render.js +32 -13
- package/dist/cjs/test/setup-tests.js +4 -10
- package/dist/cjs/utils/cache-keys.js +8 -7
- package/dist/components/PluginRegistry/PluginRegistry.js +81 -1
- package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -0
- package/dist/components/PluginRegistry/PluginRegistry.test.js +142 -1
- package/dist/components/PluginRegistry/PluginRegistry.test.js.map +1 -0
- package/dist/components/PluginRegistry/index.js +16 -1
- package/dist/components/PluginRegistry/index.js.map +1 -0
- package/dist/components/PluginRegistry/plugin-indexes.js +66 -1
- package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -0
- package/dist/components/PluginRegistry/plugin-registry-model.d.ts +1 -2
- package/dist/components/PluginRegistry/plugin-registry-model.d.ts.map +1 -1
- package/dist/components/PluginRegistry/plugin-registry-model.js +23 -1
- package/dist/components/PluginRegistry/plugin-registry-model.js.map +1 -0
- package/dist/components/PluginRegistry/test-plugins/bert/index.js +25 -1
- package/dist/components/PluginRegistry/test-plugins/bert/index.js.map +1 -0
- package/dist/components/PluginRegistry/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/components/PluginRegistry/test-plugins/ernie/index.js +30 -1
- package/dist/components/PluginRegistry/test-plugins/ernie/index.js.map +1 -0
- package/dist/components/PluginRegistry/test-plugins/index.js +35 -1
- package/dist/components/PluginRegistry/test-plugins/index.js.map +1 -0
- package/dist/components/index.d.ts +1 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +15 -1
- package/dist/components/index.js.map +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -0
- package/dist/model/datasource.d.ts +9 -0
- package/dist/model/datasource.d.ts.map +1 -0
- package/dist/model/datasource.js +15 -0
- package/dist/model/datasource.js.map +1 -0
- package/dist/model/index.d.ts +2 -1
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +20 -1
- package/dist/model/index.js.map +1 -0
- package/dist/model/panels.d.ts +7 -11
- package/dist/model/panels.d.ts.map +1 -1
- package/dist/model/panels.js +15 -1
- package/dist/model/panels.js.map +1 -0
- package/dist/model/plugins.d.ts +16 -25
- package/dist/model/plugins.d.ts.map +1 -1
- package/dist/model/plugins.js +15 -1
- package/dist/model/plugins.js.map +1 -0
- package/dist/model/time-series-queries.d.ts +28 -0
- package/dist/model/time-series-queries.d.ts.map +1 -0
- package/dist/model/time-series-queries.js +15 -0
- package/dist/model/time-series-queries.js.map +1 -0
- package/dist/model/variables.d.ts +16 -11
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js +15 -1
- package/dist/model/variables.js.map +1 -0
- package/dist/model/visual-editing.d.ts +5 -6
- package/dist/model/visual-editing.d.ts.map +1 -1
- package/dist/model/visual-editing.js +15 -1
- package/dist/model/visual-editing.js.map +1 -0
- package/dist/runtime/datasources.d.ts +5 -9
- package/dist/runtime/datasources.d.ts.map +1 -1
- package/dist/runtime/datasources.js +23 -1
- package/dist/runtime/datasources.js.map +1 -0
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +20 -1
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/plugins.d.ts +5 -14
- package/dist/runtime/plugins.d.ts.map +1 -1
- package/dist/runtime/plugins.js +33 -1
- package/dist/runtime/plugins.js.map +1 -0
- package/dist/runtime/query-string.js +25 -1
- package/dist/runtime/query-string.js.map +1 -0
- package/dist/runtime/template-variables.d.ts +10 -1
- package/dist/runtime/template-variables.d.ts.map +1 -1
- package/dist/runtime/template-variables.js +44 -1
- package/dist/runtime/template-variables.js.map +1 -0
- package/dist/runtime/time-range.js +25 -1
- package/dist/runtime/time-range.js.map +1 -0
- package/dist/runtime/time-series-queries.d.ts +14 -0
- package/dist/runtime/time-series-queries.d.ts.map +1 -0
- package/dist/runtime/time-series-queries.js +54 -0
- package/dist/runtime/time-series-queries.js.map +1 -0
- package/dist/test/render.d.ts.map +1 -1
- package/dist/test/render.js +42 -1
- package/dist/test/render.js.map +1 -0
- package/dist/test/setup-tests.d.ts.map +1 -1
- package/dist/test/setup-tests.js +16 -1
- package/dist/test/setup-tests.js.map +1 -0
- package/dist/utils/cache-keys.js +19 -1
- package/dist/utils/cache-keys.js.map +1 -0
- package/package.json +11 -8
- package/dist/cjs/components/PluginBoundary.js +0 -14
- package/dist/cjs/components/PluginLoadingBoundary/PluginLoader.js +0 -39
- package/dist/cjs/components/PluginLoadingBoundary/PluginLoadingBoundary.js +0 -85
- package/dist/cjs/components/PluginLoadingBoundary/index.js +0 -29
- package/dist/cjs/components/PluginRegistry/legacy/PluginRegistry.js +0 -57
- package/dist/cjs/components/PluginRegistry/legacy/index.js +0 -29
- package/dist/cjs/components/PluginRegistry/legacy/registry-state.js +0 -97
- package/dist/cjs/components/PluginRegistry/test-plugins/bert/plugin.json +0 -32
- package/dist/cjs/components/PluginRegistry/test-plugins/ernie/plugin.json +0 -24
- package/dist/cjs/model/graph-queries.js +0 -28
- package/dist/components/PluginBoundary.d.ts +0 -13
- package/dist/components/PluginBoundary.d.ts.map +0 -1
- package/dist/components/PluginBoundary.js +0 -1
- package/dist/components/PluginLoadingBoundary/PluginLoader.d.ts +0 -11
- package/dist/components/PluginLoadingBoundary/PluginLoader.d.ts.map +0 -1
- package/dist/components/PluginLoadingBoundary/PluginLoader.js +0 -1
- package/dist/components/PluginLoadingBoundary/PluginLoadingBoundary.d.ts +0 -27
- package/dist/components/PluginLoadingBoundary/PluginLoadingBoundary.d.ts.map +0 -1
- package/dist/components/PluginLoadingBoundary/PluginLoadingBoundary.js +0 -1
- package/dist/components/PluginLoadingBoundary/index.d.ts +0 -2
- package/dist/components/PluginLoadingBoundary/index.d.ts.map +0 -1
- package/dist/components/PluginLoadingBoundary/index.js +0 -1
- package/dist/components/PluginRegistry/legacy/PluginRegistry.d.ts +0 -29
- package/dist/components/PluginRegistry/legacy/PluginRegistry.d.ts.map +0 -1
- package/dist/components/PluginRegistry/legacy/PluginRegistry.js +0 -1
- package/dist/components/PluginRegistry/legacy/index.d.ts +0 -2
- package/dist/components/PluginRegistry/legacy/index.d.ts.map +0 -1
- package/dist/components/PluginRegistry/legacy/index.js +0 -1
- package/dist/components/PluginRegistry/legacy/registry-state.d.ts +0 -18
- package/dist/components/PluginRegistry/legacy/registry-state.d.ts.map +0 -1
- package/dist/components/PluginRegistry/legacy/registry-state.js +0 -1
- package/dist/components/PluginRegistry/test-plugins/bert/plugin.json +0 -32
- package/dist/components/PluginRegistry/test-plugins/ernie/plugin.json +0 -24
- package/dist/model/graph-queries.d.ts +0 -36
- package/dist/model/graph-queries.d.ts.map +0 -1
- package/dist/model/graph-queries.js +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,53 +10,74 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
-
}
|
|
20
|
-
Object.defineProperty(o, k2, desc);
|
|
21
|
-
}) : (function(o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
}));
|
|
25
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
-
}) : function(o, v) {
|
|
28
|
-
o["default"] = v;
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
29
16
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
Object.defineProperty(exports, "testRegistryProps", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: ()=>testRegistryProps
|
|
20
|
+
});
|
|
21
|
+
const _pluginJson = /*#__PURE__*/ _interopRequireDefault(require("./bert/plugin.json"));
|
|
22
|
+
const _pluginJson1 = /*#__PURE__*/ _interopRequireDefault(require("./ernie/plugin.json"));
|
|
23
|
+
function _interopRequireDefault(obj) {
|
|
24
|
+
return obj && obj.__esModule ? obj : {
|
|
25
|
+
default: obj
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
29
|
+
if (typeof WeakMap !== "function") return null;
|
|
30
|
+
var cacheBabelInterop = new WeakMap();
|
|
31
|
+
var cacheNodeInterop = new WeakMap();
|
|
32
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
33
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
34
|
+
})(nodeInterop);
|
|
35
|
+
}
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
|
37
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
38
|
+
return obj;
|
|
39
|
+
}
|
|
40
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
41
|
+
return {
|
|
42
|
+
default: obj
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
46
|
+
if (cache && cache.has(obj)) {
|
|
47
|
+
return cache.get(obj);
|
|
48
|
+
}
|
|
49
|
+
var newObj = {};
|
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
|
+
for(var key in obj){
|
|
52
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
|
56
|
+
} else {
|
|
57
|
+
newObj[key] = obj[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
newObj.default = obj;
|
|
62
|
+
if (cache) {
|
|
63
|
+
cache.set(obj, newObj);
|
|
64
|
+
}
|
|
65
|
+
return newObj;
|
|
66
|
+
}
|
|
44
67
|
// Put all the test plugins into a Map
|
|
45
68
|
const testPlugins = new Map();
|
|
46
|
-
testPlugins.set(
|
|
47
|
-
testPlugins.set(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
exports.testRegistryProps = {
|
|
52
|
-
getInstalledPlugins: () => {
|
|
69
|
+
testPlugins.set(_pluginJson.default, ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./bert"))));
|
|
70
|
+
testPlugins.set(_pluginJson1.default, ()=>Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(require("./ernie"))));
|
|
71
|
+
const testRegistryProps = {
|
|
72
|
+
getInstalledPlugins: ()=>{
|
|
53
73
|
const resources = Array.from(testPlugins.keys());
|
|
54
74
|
return Promise.resolve(resources);
|
|
55
75
|
},
|
|
56
|
-
importPluginModule: (resource)
|
|
76
|
+
importPluginModule: (resource)=>{
|
|
57
77
|
const importFn = testPlugins.get(resource);
|
|
58
78
|
if (importFn === undefined) {
|
|
59
79
|
throw new Error('Plugin not found');
|
|
60
80
|
}
|
|
61
81
|
return importFn();
|
|
62
|
-
}
|
|
82
|
+
}
|
|
63
83
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,21 +10,19 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Object.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
__exportStar(require("./PluginLoadingBoundary"), exports);
|
|
31
|
-
__exportStar(require("./PluginRegistry/legacy"), exports);
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./PluginRegistry"), exports);
|
|
18
|
+
function _exportStar(from, to) {
|
|
19
|
+
Object.keys(from).forEach(function(k) {
|
|
20
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function() {
|
|
23
|
+
return from[k];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return from;
|
|
28
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,21 +10,21 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./components"), exports);
|
|
18
|
+
_exportStar(require("./model"), exports);
|
|
19
|
+
_exportStar(require("./runtime"), exports);
|
|
20
|
+
function _exportStar(from, to) {
|
|
21
|
+
Object.keys(from).forEach(function(k) {
|
|
22
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return from;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,23 +10,24 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./datasource"), exports);
|
|
18
|
+
_exportStar(require("./panels"), exports);
|
|
19
|
+
_exportStar(require("./plugins"), exports);
|
|
20
|
+
_exportStar(require("./time-series-queries"), exports);
|
|
21
|
+
_exportStar(require("./variables"), exports);
|
|
22
|
+
_exportStar(require("./visual-editing"), exports);
|
|
23
|
+
function _exportStar(from, to) {
|
|
24
|
+
Object.keys(from).forEach(function(k) {
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return from[k];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
package/dist/cjs/model/panels.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,23 +10,7 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
exports
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Hook for using a panel plugin at runtime.
|
|
19
|
-
*/
|
|
20
|
-
function usePanelPlugin(kind) {
|
|
21
|
-
const plugin = (0, PluginLoadingBoundary_1.usePlugin)('Panel', kind);
|
|
22
|
-
if (plugin !== undefined) {
|
|
23
|
-
return plugin;
|
|
24
|
-
}
|
|
25
|
-
// Return a default/placeholder plugin while loading happens
|
|
26
|
-
return defaultPanelPlugin;
|
|
27
|
-
}
|
|
28
|
-
exports.usePanelPlugin = usePanelPlugin;
|
|
29
|
-
const defaultPanelPlugin = {
|
|
30
|
-
PanelComponent: () => null,
|
|
31
|
-
OptionsEditorComponent: () => null,
|
|
32
|
-
createInitialOptions: () => ({}),
|
|
33
|
-
};
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,9 +10,7 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
exports
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
exports.ALL_PLUGIN_TYPES = ['Variable', 'Panel', 'GraphQuery'];
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,18 +10,7 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
exports
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Use the variable options from a variable plugin at runtime.
|
|
19
|
-
*/
|
|
20
|
-
const useVariableOptions = (definition) => {
|
|
21
|
-
const plugin = (0, PluginLoadingBoundary_1.usePlugin)('Variable', definition.kind);
|
|
22
|
-
if (plugin === undefined) {
|
|
23
|
-
// Provide default values while the plugin is being loaded
|
|
24
|
-
return { data: [], loading: true };
|
|
25
|
-
}
|
|
26
|
-
return plugin.useVariableOptions(definition);
|
|
27
|
-
};
|
|
28
|
-
exports.useVariableOptions = useVariableOptions;
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,4 +10,13 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
|
|
18
|
+
function _interopRequireDefault(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,18 +10,26 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
DatasourceStoreContext: ()=>DatasourceStoreContext,
|
|
25
|
+
useDatasourceStore: ()=>useDatasourceStore
|
|
26
|
+
});
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
const DatasourceStoreContext = (0, _react.createContext)(undefined);
|
|
29
|
+
function useDatasourceStore() {
|
|
30
|
+
const ctx = (0, _react.useContext)(DatasourceStoreContext);
|
|
23
31
|
if (ctx === undefined) {
|
|
24
|
-
throw new Error('No
|
|
32
|
+
throw new Error('No DatasourceStoreContext found. Did you forget a Provider?');
|
|
25
33
|
}
|
|
26
34
|
return ctx;
|
|
27
35
|
}
|
|
28
|
-
exports.useDatasources = useDatasources;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// Copyright 2021 The Perses Authors
|
|
1
|
+
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
5
4
|
// You may obtain a copy of the License at
|
|
@@ -11,22 +10,24 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_exportStar(require("./datasources"), exports);
|
|
18
|
+
_exportStar(require("./time-series-queries"), exports);
|
|
19
|
+
_exportStar(require("./plugins"), exports);
|
|
20
|
+
_exportStar(require("./query-string"), exports);
|
|
21
|
+
_exportStar(require("./template-variables"), exports);
|
|
22
|
+
_exportStar(require("./time-range"), exports);
|
|
23
|
+
function _exportStar(from, to) {
|
|
24
|
+
Object.keys(from).forEach(function(k) {
|
|
25
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function() {
|
|
28
|
+
return from[k];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,28 +10,32 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
usePlugin: ()=>usePlugin,
|
|
25
|
+
useListPluginMetadata: ()=>useListPluginMetadata
|
|
26
|
+
});
|
|
27
|
+
const _reactQuery = require("@tanstack/react-query");
|
|
28
|
+
const _pluginRegistry = require("../components/PluginRegistry");
|
|
22
29
|
function usePlugin(pluginType, kind, options) {
|
|
23
|
-
const { getPlugin
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
const { getPlugin } = (0, _pluginRegistry.usePluginRegistry)();
|
|
31
|
+
return (0, _reactQuery.useQuery)([
|
|
32
|
+
pluginType,
|
|
33
|
+
kind
|
|
34
|
+
], ()=>getPlugin(pluginType, kind), options);
|
|
27
35
|
}
|
|
28
|
-
exports.usePlugin = usePlugin;
|
|
29
|
-
/**
|
|
30
|
-
* Gets a list of plugin metadata for the specified plugin type and returns it, along with loading/error state.
|
|
31
|
-
*/
|
|
32
36
|
function useListPluginMetadata(pluginType, options) {
|
|
33
|
-
const { listPluginMetadata
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
const { listPluginMetadata } = (0, _pluginRegistry.usePluginRegistry)();
|
|
38
|
+
return (0, _reactQuery.useQuery)([
|
|
39
|
+
pluginType
|
|
40
|
+
], ()=>listPluginMetadata(pluginType), options);
|
|
37
41
|
}
|
|
38
|
-
exports.useListPluginMetadata = useListPluginMetadata;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2022 The Perses Authors
|
|
3
2
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
3
|
// you may not use this file except in compliance with the License.
|
|
@@ -11,18 +10,26 @@
|
|
|
11
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
11
|
// See the License for the specific language governing permissions and
|
|
13
12
|
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
QueryStringContext: ()=>QueryStringContext,
|
|
25
|
+
useQueryString: ()=>useQueryString
|
|
26
|
+
});
|
|
27
|
+
const _react = require("react");
|
|
28
|
+
const QueryStringContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
|
|
21
29
|
function useQueryString() {
|
|
22
|
-
const ctx = (0,
|
|
30
|
+
const ctx = (0, _react.useContext)(QueryStringContext);
|
|
23
31
|
if (ctx === undefined) {
|
|
24
32
|
throw new Error('No QueryStringContext found. Did you forget a Provider?');
|
|
25
33
|
}
|
|
26
34
|
return ctx;
|
|
27
35
|
}
|
|
28
|
-
exports.useQueryString = useQueryString;
|