@perses-dev/explore 0.55.0-beta.2 → 0.55.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/components/ExploreManager/ExploreManager.d.ts +1 -1
  2. package/dist/components/ExploreManager/ExploreManager.d.ts.map +1 -1
  3. package/dist/components/ExploreManager/ExploreManager.js +8 -8
  4. package/dist/components/ExploreManager/ExploreManager.js.map +1 -1
  5. package/dist/components/ExploreManager/ExplorerManagerProvider.d.ts +1 -1
  6. package/dist/components/ExploreManager/ExplorerManagerProvider.d.ts.map +1 -1
  7. package/dist/components/ExploreManager/ExplorerManagerProvider.js +2 -2
  8. package/dist/components/ExploreManager/ExplorerManagerProvider.js.map +1 -1
  9. package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.d.ts +1 -1
  10. package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.d.ts.map +1 -1
  11. package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js +2 -2
  12. package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js.map +1 -1
  13. package/dist/components/ExploreManager/index.js +4 -4
  14. package/dist/components/ExploreManager/index.js.map +1 -1
  15. package/dist/components/ExploreManager/query-params.d.ts +5 -5
  16. package/dist/components/ExploreManager/query-params.js +3 -3
  17. package/dist/components/ExploreManager/query-params.js.map +1 -1
  18. package/dist/components/ExploreToolbar/ExploreToolbar.d.ts +2 -1
  19. package/dist/components/ExploreToolbar/ExploreToolbar.d.ts.map +1 -1
  20. package/dist/components/ExploreToolbar/ExploreToolbar.js +3 -3
  21. package/dist/components/ExploreToolbar/ExploreToolbar.js.map +1 -1
  22. package/dist/components/ExploreToolbar/index.js +1 -1
  23. package/dist/components/ExploreToolbar/index.js.map +1 -1
  24. package/dist/components/index.js +2 -2
  25. package/dist/components/index.js.map +1 -1
  26. package/dist/index.js +2 -2
  27. package/dist/index.js.map +1 -1
  28. package/dist/test/setup-tests.d.ts +1 -1
  29. package/dist/test/setup-tests.d.ts.map +1 -1
  30. package/dist/test/setup-tests.js +3 -2
  31. package/dist/test/setup-tests.js.map +1 -1
  32. package/dist/views/ViewExplore/ViewExplore.d.ts +4 -3
  33. package/dist/views/ViewExplore/ViewExplore.d.ts.map +1 -1
  34. package/dist/views/ViewExplore/ViewExplore.js +7 -7
  35. package/dist/views/ViewExplore/ViewExplore.js.map +1 -1
  36. package/dist/views/ViewExplore/ViewExploreApp.d.ts +1 -1
  37. package/dist/views/ViewExplore/ViewExploreApp.d.ts.map +1 -1
  38. package/dist/views/ViewExplore/ViewExploreApp.js +3 -3
  39. package/dist/views/ViewExplore/ViewExploreApp.js.map +1 -1
  40. package/dist/views/ViewExplore/index.js +1 -1
  41. package/dist/views/ViewExplore/index.js.map +1 -1
  42. package/dist/views/index.js +1 -1
  43. package/dist/views/index.js.map +1 -1
  44. package/package.json +11 -9
  45. package/dist/cjs/components/ExploreManager/ExploreManager.js +0 -152
  46. package/dist/cjs/components/ExploreManager/ExplorerManagerProvider.js +0 -84
  47. package/dist/cjs/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js +0 -39
  48. package/dist/cjs/components/ExploreManager/index.js +0 -33
  49. package/dist/cjs/components/ExploreManager/query-params.js +0 -49
  50. package/dist/cjs/components/ExploreToolbar/ExploreToolbar.js +0 -60
  51. package/dist/cjs/components/ExploreToolbar/index.js +0 -30
  52. package/dist/cjs/components/index.js +0 -31
  53. package/dist/cjs/index.js +0 -31
  54. package/dist/cjs/test/setup-tests.js +0 -20
  55. package/dist/cjs/views/ViewExplore/ViewExplore.js +0 -66
  56. package/dist/cjs/views/ViewExplore/ViewExploreApp.js +0 -48
  57. package/dist/cjs/views/ViewExplore/index.js +0 -30
  58. package/dist/cjs/views/index.js +0 -30
package/package.json CHANGED
@@ -1,36 +1,38 @@
1
1
  {
2
2
  "name": "@perses-dev/explore",
3
- "version": "0.55.0-beta.2",
3
+ "version": "0.55.0-beta.6",
4
4
  "description": "The explore feature in Perses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/perses/perses.git"
9
+ "url": "git+https://github.com/perses/shared.git"
10
10
  },
11
11
  "bugs": {
12
12
  "url": "https://github.com/perses/perses/issues"
13
13
  },
14
+ "type": "module",
14
15
  "module": "dist/index.js",
15
- "main": "dist/cjs/index.js",
16
+ "main": "dist/index.js",
16
17
  "types": "dist/index.d.ts",
17
18
  "sideEffects": false,
18
19
  "scripts": {
19
20
  "clean": "rimraf dist/",
20
21
  "build": "concurrently \"npm:build:*\"",
21
- "build:cjs": "swc ./src -d dist/cjs --strip-leading-paths --config-file ../.cjs.swcrc",
22
22
  "build:esm": "swc ./src -d dist --strip-leading-paths --config-file ../.swcrc",
23
23
  "build:types": "tsc --project tsconfig.build.json",
24
24
  "type-check": "tsc --noEmit",
25
25
  "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
26
- "lint": "eslint src --ext .ts,.tsx",
27
- "lint:fix": "eslint --fix src --ext .ts,.tsx"
26
+ "test": "cross-env TZ=UTC vitest run",
27
+ "test:watch": "cross-env TZ=UTC vitest",
28
+ "lint": "oxlint src",
29
+ "lint:fix": "oxlint --fix src"
28
30
  },
29
31
  "dependencies": {
30
32
  "@nexucis/fuzzy": "^0.5.1",
31
- "@perses-dev/components": "0.55.0-beta.2",
32
- "@perses-dev/dashboards": "0.55.0-beta.2",
33
- "@perses-dev/plugin-system": "0.55.0-beta.2",
33
+ "@perses-dev/components": "0.55.0-beta.6",
34
+ "@perses-dev/dashboards": "0.55.0-beta.6",
35
+ "@perses-dev/plugin-system": "0.55.0-beta.6",
34
36
  "mdi-material-ui": "^7.9.2",
35
37
  "qs": "^6.14.0",
36
38
  "react-virtuoso": "^4.12.2",
@@ -1,152 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "ExploreManager", {
18
- enumerable: true,
19
- get: function() {
20
- return ExploreManager;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _pluginsystem = require("@perses-dev/plugin-system");
26
- const _react = require("react");
27
- const _ChevronRight = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronRight"));
28
- const _ChevronLeft = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ChevronLeft"));
29
- const _components = require("@perses-dev/components");
30
- const _ExploreToolbar = require("../ExploreToolbar");
31
- const _ExplorerManagerProvider = require("./ExplorerManagerProvider");
32
- function _interop_require_default(obj) {
33
- return obj && obj.__esModule ? obj : {
34
- default: obj
35
- };
36
- }
37
- const EXPLORE_TABS_COLLAPSED_KEY = 'PERSES_EXPLORE_TABS_COLLAPSED';
38
- function ExploreManager(props) {
39
- const { exploreTitleComponent } = props;
40
- const { explorer, setExplorer } = (0, _ExplorerManagerProvider.useExplorerManagerContext)();
41
- const plugins = (0, _pluginsystem.useListPluginMetadata)([
42
- 'Explore'
43
- ]);
44
- const isSmallScreen = (0, _material.useMediaQuery)('(max-width: 768px)');
45
- const [isCollapsed, setIsCollapsed] = (0, _components.useLocalStorage)(EXPLORE_TABS_COLLAPSED_KEY, false);
46
- const explorerPluginsMap = (0, _react.useMemo)(()=>Object.fromEntries(plugins.data?.map((plugin)=>[
47
- `${plugin.module.name}-${plugin.spec.name}`,
48
- plugin
49
- ]) ?? []), [
50
- plugins.data
51
- ]);
52
- (0, _react.useEffect)(()=>{
53
- const plugins = Object.keys(explorerPluginsMap);
54
- if (!explorer && plugins?.[0]) {
55
- setExplorer(plugins[0]);
56
- }
57
- }, [
58
- explorerPluginsMap,
59
- explorer,
60
- setExplorer
61
- ]);
62
- const currentPlugin = explorer ? explorerPluginsMap[explorer] : undefined;
63
- if (!explorer) {
64
- return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
65
- children: "No explorer plugin available"
66
- });
67
- }
68
- return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
69
- sx: {
70
- width: '100%'
71
- },
72
- px: 2,
73
- pb: 2,
74
- pt: 1.5,
75
- gap: 1,
76
- children: [
77
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_ExploreToolbar.ExploreToolbar, {
78
- exploreTitleComponent: exploreTitleComponent
79
- }),
80
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
81
- direction: isSmallScreen ? 'column' : 'row',
82
- gap: 2,
83
- sx: {
84
- width: '100%'
85
- },
86
- children: [
87
- /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
88
- sx: {
89
- borderRight: isSmallScreen ? 0 : 1,
90
- borderBottom: isSmallScreen ? 1 : 0,
91
- borderColor: 'divider',
92
- minWidth: isCollapsed ? 15 : 100
93
- },
94
- children: [
95
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
96
- sx: {
97
- position: 'relative',
98
- height: 30,
99
- display: isSmallScreen ? 'none' : undefined
100
- },
101
- "test-id": "qdqwd",
102
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
103
- title: isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs',
104
- "aria-label": isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs',
105
- variant: "text",
106
- sx: {
107
- position: 'absolute',
108
- right: -15,
109
- zIndex: 1,
110
- padding: 0.5,
111
- minWidth: 'auto',
112
- backgroundColor: (theme)=>theme.palette.background.default
113
- },
114
- onClick: ()=>setIsCollapsed(!isCollapsed),
115
- children: isCollapsed ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronRight.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_ChevronLeft.default, {})
116
- })
117
- }),
118
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tabs, {
119
- orientation: isSmallScreen ? 'horizontal' : 'vertical',
120
- value: explorer,
121
- onChange: (_, state)=>setExplorer(state),
122
- variant: isSmallScreen ? 'fullWidth' : 'scrollable',
123
- sx: {
124
- display: isCollapsed ? 'none' : 'flex'
125
- },
126
- children: plugins.data?.sort((a, b)=>a.spec.display.name.localeCompare(b.spec.display.name)).map((plugin)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tab, {
127
- value: `${plugin.module.name}-${plugin.spec.name}`,
128
- label: plugin.spec.display.name,
129
- sx: {
130
- padding: 0.5
131
- }
132
- }, `${plugin.module.name}-${plugin.spec.name}`))
133
- })
134
- ]
135
- }),
136
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Card, {
137
- sx: {
138
- padding: '10px',
139
- width: '100%'
140
- },
141
- children: currentPlugin && /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.PluginLoaderComponent, {
142
- plugin: {
143
- name: currentPlugin.spec.name,
144
- moduleName: currentPlugin.module.name
145
- }
146
- }, `${currentPlugin.module.name}-${currentPlugin.spec.name}`)
147
- })
148
- ]
149
- })
150
- ]
151
- });
152
- }
@@ -1,84 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: Object.getOwnPropertyDescriptor(all, name).get
21
- });
22
- }
23
- _export(exports, {
24
- get ExplorerManagerProvider () {
25
- return ExplorerManagerProvider;
26
- },
27
- get useExplorerManagerContext () {
28
- return useExplorerManagerContext;
29
- }
30
- });
31
- const _jsxruntime = require("react/jsx-runtime");
32
- const _react = require("react");
33
- const ExplorerManagerContext = /*#__PURE__*/ (0, _react.createContext)(undefined);
34
- function ExplorerManagerProvider({ children, store: externalStore }) {
35
- // cache the state of currently not rendered explore UIs
36
- const [explorerStateCache, setExplorerStateCache] = (0, _react.useState)({});
37
- // local store in case external store is not provided by prop
38
- const localStore = (0, _react.useState)({
39
- explorer: undefined,
40
- data: {}
41
- });
42
- // use store provided by 'store' prop if available, otherwise use local store
43
- const [explorerState, setExplorerState] = externalStore ? externalStore : localStore;
44
- const { explorer, data } = explorerState;
45
- function setExplorer(newExplorer) {
46
- if (explorer) {
47
- // store current explorer state
48
- explorerStateCache[explorer] = {
49
- data
50
- };
51
- setExplorerStateCache(explorerStateCache);
52
- }
53
- // restore previous explorer state (if any)
54
- const state = explorerStateCache[newExplorer] ?? {
55
- data: {}
56
- };
57
- setExplorerState({
58
- explorer: newExplorer,
59
- data: state.data
60
- });
61
- }
62
- function setData(newData) {
63
- setExplorerState({
64
- explorer,
65
- data: newData
66
- });
67
- }
68
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(ExplorerManagerContext.Provider, {
69
- value: {
70
- explorer,
71
- data,
72
- setExplorer,
73
- setData
74
- },
75
- children: children
76
- });
77
- }
78
- function useExplorerManagerContext() {
79
- const ctx = (0, _react.useContext)(ExplorerManagerContext);
80
- if (ctx === undefined) {
81
- throw new Error('No ExplorerManagerContext found. Did you forget a Provider?');
82
- }
83
- return ctx;
84
- }
@@ -1,39 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "ExplorerManagerProviderWithQueryParams", {
18
- enumerable: true,
19
- get: function() {
20
- return ExplorerManagerProviderWithQueryParams;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _usequeryparams = require("use-query-params");
25
- const _ExplorerManagerProvider = require("./ExplorerManagerProvider");
26
- const exploreQueryConfig = {
27
- explorer: (0, _usequeryparams.withDefault)(_usequeryparams.StringParam, undefined),
28
- data: (0, _usequeryparams.withDefault)(_usequeryparams.JsonParam, {})
29
- };
30
- function ExplorerManagerProviderWithQueryParams({ children }) {
31
- const [queryParams, setQueryParams] = (0, _usequeryparams.useQueryParams)(exploreQueryConfig);
32
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ExplorerManagerProvider.ExplorerManagerProvider, {
33
- store: [
34
- queryParams,
35
- setQueryParams
36
- ],
37
- children: children
38
- });
39
- }
@@ -1,33 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./ExploreManager"), exports);
18
- _export_star(require("./ExplorerManagerProvider"), exports);
19
- _export_star(require("./ExplorerManagerProviderWithQueryParams"), exports);
20
- _export_star(require("./query-params"), exports);
21
- function _export_star(from, to) {
22
- Object.keys(from).forEach(function(k) {
23
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
24
- Object.defineProperty(to, k, {
25
- enumerable: true,
26
- get: function() {
27
- return from[k];
28
- }
29
- });
30
- }
31
- });
32
- return from;
33
- }
@@ -1,49 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: Object.getOwnPropertyDescriptor(all, name).get
21
- });
22
- }
23
- _export(exports, {
24
- get explorerQueryConfig () {
25
- return explorerQueryConfig;
26
- },
27
- get useExplorerQueryParams () {
28
- return useExplorerQueryParams;
29
- }
30
- });
31
- const _usequeryparams = require("use-query-params");
32
- const _pluginsystem = require("@perses-dev/plugin-system");
33
- const _qs = require("qs");
34
- const explorerQueryConfig = {
35
- refresh: _pluginsystem.TimeRangeParam,
36
- start: _pluginsystem.TimeRangeParam,
37
- end: _pluginsystem.TimeRangeParam,
38
- explorer: _usequeryparams.StringParam,
39
- data: _usequeryparams.JsonParam
40
- };
41
- function useExplorerQueryParams(inputs) {
42
- const [query] = (0, _usequeryparams.useQueryParams)(explorerQueryConfig, {
43
- updateType: 'replaceIn'
44
- });
45
- return (0, _qs.stringify)((0, _usequeryparams.encodeQueryParams)(explorerQueryConfig, {
46
- ...query,
47
- ...inputs
48
- }));
49
- }
@@ -1,60 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "ExploreToolbar", {
18
- enumerable: true,
19
- get: function() {
20
- return ExploreToolbar;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _pluginsystem = require("@perses-dev/plugin-system");
26
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
27
- function _interop_require_default(obj) {
28
- return obj && obj.__esModule ? obj : {
29
- default: obj
30
- };
31
- }
32
- const ExploreToolbar = (props)=>{
33
- const { exploreTitleComponent } = props;
34
- const isBiggerThanLg = (0, _material.useMediaQuery)((0, _material.useTheme)().breakpoints.up('lg'));
35
- const { timeZone, setTimeZone } = (0, _pluginsystem.useTimeZoneParams)('local');
36
- const testId = 'explore-toolbar';
37
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
38
- "data-testid": testId,
39
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
40
- sx: {
41
- display: 'flex',
42
- width: '100%'
43
- },
44
- children: [
45
- exploreTitleComponent,
46
- /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
47
- direction: "row",
48
- spacing: 1,
49
- ml: "auto",
50
- flexWrap: isBiggerThanLg ? 'nowrap' : 'wrap-reverse',
51
- justifyContent: "end",
52
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeControls, {
53
- timeZone: timeZone,
54
- onTimeZoneChange: (tz)=>setTimeZone(tz.value)
55
- })
56
- })
57
- ]
58
- })
59
- });
60
- };
@@ -1,30 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./ExploreToolbar"), exports);
18
- function _export_star(from, to) {
19
- Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
- Object.defineProperty(to, k, {
22
- enumerable: true,
23
- get: function() {
24
- return from[k];
25
- }
26
- });
27
- }
28
- });
29
- return from;
30
- }
@@ -1,31 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./ExploreManager"), exports);
18
- _export_star(require("./ExploreToolbar"), exports);
19
- function _export_star(from, to) {
20
- Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
- Object.defineProperty(to, k, {
23
- enumerable: true,
24
- get: function() {
25
- return from[k];
26
- }
27
- });
28
- }
29
- });
30
- return from;
31
- }
package/dist/cjs/index.js DELETED
@@ -1,31 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- _export_star(require("./views"), exports);
18
- _export_star(require("./components"), exports);
19
- function _export_star(from, to) {
20
- Object.keys(from).forEach(function(k) {
21
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
22
- Object.defineProperty(to, k, {
23
- enumerable: true,
24
- get: function() {
25
- return from[k];
26
- }
27
- });
28
- }
29
- });
30
- return from;
31
- }
@@ -1,20 +0,0 @@
1
- // Copyright 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
- // Add testing library assertions
14
- "use strict";
15
- Object.defineProperty(exports, "__esModule", {
16
- value: true
17
- });
18
- require("@testing-library/jest-dom/extend-expect");
19
- // Always mock e-charts during tests since we don't have a proper canvas in jsdom
20
- jest.mock('echarts/core');
@@ -1,66 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- Object.defineProperty(exports, "ViewExplore", {
18
- enumerable: true,
19
- get: function() {
20
- return ViewExplore;
21
- }
22
- });
23
- const _jsxruntime = require("react/jsx-runtime");
24
- const _material = require("@mui/material");
25
- const _pluginsystem = require("@perses-dev/plugin-system");
26
- const _components = require("@perses-dev/components");
27
- const _dashboards = require("@perses-dev/dashboards");
28
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
29
- const _ViewExploreApp = require("./ViewExploreApp");
30
- function _interop_require_default(obj) {
31
- return obj && obj.__esModule ? obj : {
32
- default: obj
33
- };
34
- }
35
- function ViewExplore(props) {
36
- const { datasourceApi, projectName, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;
37
- const initialTimeRange = (0, _pluginsystem.useInitialTimeRange)(_dashboards.DEFAULT_DASHBOARD_DURATION);
38
- const initialRefreshInterval = (0, _pluginsystem.useInitialRefreshInterval)(_dashboards.DEFAULT_REFRESH_INTERVAL);
39
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.DatasourceStoreProvider, {
40
- datasourceApi: datasourceApi,
41
- projectName: projectName,
42
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.TimeRangeProviderWithQueryParams, {
43
- initialTimeRange: initialTimeRange,
44
- initialRefreshInterval: initialRefreshInterval,
45
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_dashboards.VariableProvider, {
46
- externalVariableDefinitions: externalVariableDefinitions,
47
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
48
- sx: (0, _components.combineSx)({
49
- display: 'flex',
50
- width: '100%',
51
- height: '100%',
52
- position: 'relative',
53
- overflow: 'hidden'
54
- }, sx),
55
- ...others,
56
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ErrorBoundary, {
57
- FallbackComponent: _components.ErrorAlert,
58
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_ViewExploreApp.ViewExploreApp, {
59
- exploreTitleComponent: exploreTitleComponent
60
- })
61
- })
62
- })
63
- })
64
- })
65
- });
66
- }