@perses-dev/plugin-system 0.51.0-beta.1 → 0.51.0-rc.1

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 (83) hide show
  1. package/dist/cjs/components/DatasourceSelect.js +163 -81
  2. package/dist/cjs/components/HTTPSettingsEditor/HTTPSettingsEditor.js +5 -2
  3. package/dist/cjs/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
  4. package/dist/cjs/components/PanelSpecEditor/PanelSpecEditor.js +2 -2
  5. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +91 -1
  6. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -7
  7. package/dist/cjs/components/Variables/variable-model.js +4 -2
  8. package/dist/cjs/constants/user-interface-text.js +3 -1
  9. package/dist/cjs/remote/PluginRuntime.js +168 -162
  10. package/dist/cjs/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +13 -0
  11. package/dist/cjs/runtime/time-series-queries.js +5 -14
  12. package/dist/cjs/runtime/trace-queries.js +46 -16
  13. package/dist/cjs/runtime/utils.js +39 -0
  14. package/dist/cjs/test/render-hook.js +31 -0
  15. package/dist/cjs/test/render.js +4 -21
  16. package/dist/cjs/test/utils.js +49 -0
  17. package/dist/components/DatasourceSelect.d.ts +20 -3
  18. package/dist/components/DatasourceSelect.d.ts.map +1 -1
  19. package/dist/components/DatasourceSelect.js +150 -74
  20. package/dist/components/DatasourceSelect.js.map +1 -1
  21. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  22. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +5 -2
  23. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  24. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
  25. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  26. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +2 -2
  27. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  28. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  29. package/dist/components/PluginRegistry/plugin-indexes.d.ts +1 -1
  30. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  31. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  32. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -1
  33. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  34. package/dist/components/TimeRangeControls/TimeRangeControls.js +94 -2
  35. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  36. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  37. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +11 -7
  38. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  39. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  40. package/dist/components/Variables/variable-model.js +4 -2
  41. package/dist/components/Variables/variable-model.js.map +1 -1
  42. package/dist/constants/user-interface-text.d.ts +2 -0
  43. package/dist/constants/user-interface-text.d.ts.map +1 -1
  44. package/dist/constants/user-interface-text.js +3 -1
  45. package/dist/constants/user-interface-text.js.map +1 -1
  46. package/dist/model/trace-queries.d.ts +13 -1
  47. package/dist/model/trace-queries.d.ts.map +1 -1
  48. package/dist/model/trace-queries.js.map +1 -1
  49. package/dist/remote/PluginRuntime.d.ts +0 -1
  50. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  51. package/dist/remote/PluginRuntime.js +169 -160
  52. package/dist/remote/PluginRuntime.js.map +1 -1
  53. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +7 -0
  54. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  55. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +13 -0
  56. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  57. package/dist/runtime/plugin-registry.d.ts +2 -2
  58. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  59. package/dist/runtime/plugin-registry.js.map +1 -1
  60. package/dist/runtime/time-series-queries.d.ts +1 -1
  61. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  62. package/dist/runtime/time-series-queries.js +4 -13
  63. package/dist/runtime/time-series-queries.js.map +1 -1
  64. package/dist/runtime/trace-queries.d.ts.map +1 -1
  65. package/dist/runtime/trace-queries.js +47 -17
  66. package/dist/runtime/trace-queries.js.map +1 -1
  67. package/dist/runtime/utils.d.ts +7 -0
  68. package/dist/runtime/utils.d.ts.map +1 -0
  69. package/dist/runtime/utils.js +25 -0
  70. package/dist/runtime/utils.js.map +1 -0
  71. package/dist/test/render-hook.d.ts +8 -0
  72. package/dist/test/render-hook.d.ts.map +1 -0
  73. package/dist/test/render-hook.js +26 -0
  74. package/dist/test/render-hook.js.map +1 -0
  75. package/dist/test/render.d.ts +1 -5
  76. package/dist/test/render.d.ts.map +1 -1
  77. package/dist/test/render.js +4 -21
  78. package/dist/test/render.js.map +1 -1
  79. package/dist/test/utils.d.ts +9 -0
  80. package/dist/test/utils.d.ts.map +1 -0
  81. package/dist/test/utils.js +41 -0
  82. package/dist/test/utils.js.map +1 -0
  83. package/package.json +5 -5
@@ -14,168 +14,177 @@ import { init, loadRemote } from '@module-federation/enhanced/runtime';
14
14
  import * as ReactQuery from '@tanstack/react-query';
15
15
  import React from 'react';
16
16
  import ReactDOM from 'react-dom';
17
- import * as ReactRouterDOM from 'react-router-dom';
18
17
  import * as ReactHookForm from 'react-hook-form';
19
- export const pluginRuntime = init({
20
- name: '@perses/perses-ui-host',
21
- remotes: [],
22
- shared: {
23
- react: {
24
- version: React.version,
25
- lib: ()=>React,
26
- shareConfig: {
27
- singleton: true,
28
- requiredVersion: `^${React.version}`
29
- }
30
- },
31
- 'react-dom': {
32
- version: '18.3.1',
33
- lib: ()=>ReactDOM,
34
- shareConfig: {
35
- singleton: true,
36
- requiredVersion: `^18.3.1`
37
- }
38
- },
39
- 'react-router-dom': {
40
- version: '6.26.0',
41
- lib: ()=>ReactRouterDOM,
42
- shareConfig: {
43
- singleton: true,
44
- requiredVersion: '^6.26.0'
45
- }
46
- },
47
- '@tanstack/react-query': {
48
- version: '5.64.2',
49
- lib: ()=>ReactQuery,
50
- shareConfig: {
51
- singleton: true,
52
- requiredVersion: '^5.64.2'
53
- }
54
- },
55
- 'react-hook-form': {
56
- version: '7.52.2',
57
- lib: ()=>ReactHookForm,
58
- shareConfig: {
59
- singleton: true,
60
- requiredVersion: '^7.52.2'
61
- }
62
- },
63
- echarts: {
64
- version: '5.5.0',
65
- lib: ()=>require('echarts'),
66
- shareConfig: {
67
- singleton: true,
68
- requiredVersion: '^5.5.0'
69
- }
70
- },
71
- '@perses-dev/components': {
72
- version: '0.51.0-beta.0',
73
- lib: ()=>require('@perses-dev/components'),
74
- shareConfig: {
75
- singleton: true,
76
- requiredVersion: '^0.51.0-beta.0'
77
- }
78
- },
79
- '@perses-dev/plugin-system': {
80
- version: '0.51.0-beta.0',
81
- lib: ()=>require('@perses-dev/plugin-system'),
82
- shareConfig: {
83
- singleton: true,
84
- requiredVersion: '^0.51.0-beta.0'
85
- }
86
- },
87
- '@perses-dev/explore': {
88
- version: '0.51.0-beta.0',
89
- lib: ()=>require('@perses-dev/explore'),
90
- shareConfig: {
91
- singleton: true,
92
- requiredVersion: '^0.51.0-beta.0'
93
- }
94
- },
95
- '@perses-dev/dashboards': {
96
- version: '0.51.0-beta.0',
97
- lib: ()=>require('@perses-dev/dashboards'),
98
- shareConfig: {
99
- singleton: true,
100
- requiredVersion: '^0.51.0-beta.0'
101
- }
102
- },
103
- // Below are the shared modules that are used by the plugins, this can be part of the SDK
104
- 'date-fns': {
105
- version: '4.1.0',
106
- lib: ()=>require('date-fns'),
107
- shareConfig: {
108
- singleton: true,
109
- requiredVersion: '^4.1.0'
110
- }
111
- },
112
- 'date-fns-tz': {
113
- version: '3.2.0',
114
- lib: ()=>require('date-fns-tz'),
115
- shareConfig: {
116
- singleton: true,
117
- requiredVersion: '^3.2.0'
118
- }
119
- },
120
- lodash: {
121
- version: '4.17.21',
122
- lib: ()=>require('lodash'),
123
- shareConfig: {
124
- singleton: true,
125
- requiredVersion: '^4.17.21'
126
- }
127
- },
128
- '@emotion/react': {
129
- version: '11.11.3',
130
- lib: ()=>require('@emotion/react'),
131
- shareConfig: {
132
- singleton: true,
133
- requiredVersion: '^11.11.3'
134
- }
135
- },
136
- '@emotion/styled': {
137
- version: '11.11.0',
138
- lib: ()=>require('@emotion/styled'),
139
- shareConfig: {
140
- singleton: true,
141
- requiredVersion: '^11.11.0'
142
- }
143
- },
144
- '@hookform/resolvers/zod': {
145
- version: '3.3.4',
146
- lib: ()=>require('@hookform/resolvers/zod'),
147
- shareConfig: {
148
- singleton: true,
149
- requiredVersion: '^3.3.4'
150
- }
151
- },
152
- 'use-resize-observer': {
153
- version: '9.1.0',
154
- lib: ()=>require('use-resize-observer'),
155
- shareConfig: {
156
- singleton: true,
157
- requiredVersion: '^9.1.0'
158
- }
159
- },
160
- 'mdi-material-ui': {
161
- version: '7.4.0',
162
- lib: ()=>require('mdi-material-ui'),
163
- shareConfig: {
164
- singleton: true,
165
- requiredVersion: '^7.4.0'
166
- }
167
- },
168
- immer: {
169
- version: '10.1.1',
170
- lib: ()=>require('immer'),
171
- shareConfig: {
172
- singleton: true,
173
- requiredVersion: '^10.1.1'
174
- }
175
- }
18
+ import * as ReactRouterDOM from 'react-router-dom';
19
+ let instance = null;
20
+ const getPluginRuntime = ()=>{
21
+ if (instance === null) {
22
+ const pluginRuntime = init({
23
+ name: '@perses/perses-ui-host',
24
+ remotes: [],
25
+ shared: {
26
+ react: {
27
+ version: React.version,
28
+ lib: ()=>React,
29
+ shareConfig: {
30
+ singleton: true,
31
+ requiredVersion: `^${React.version}`
32
+ }
33
+ },
34
+ 'react-dom': {
35
+ version: '18.3.1',
36
+ lib: ()=>ReactDOM,
37
+ shareConfig: {
38
+ singleton: true,
39
+ requiredVersion: `^18.3.1`
40
+ }
41
+ },
42
+ 'react-router-dom': {
43
+ version: '6.26.0',
44
+ lib: ()=>ReactRouterDOM,
45
+ shareConfig: {
46
+ singleton: true,
47
+ requiredVersion: '^6.26.0'
48
+ }
49
+ },
50
+ '@tanstack/react-query': {
51
+ version: '4.39.1',
52
+ lib: ()=>ReactQuery,
53
+ shareConfig: {
54
+ singleton: true,
55
+ requiredVersion: '^4.39.1'
56
+ }
57
+ },
58
+ 'react-hook-form': {
59
+ version: '7.52.2',
60
+ lib: ()=>ReactHookForm,
61
+ shareConfig: {
62
+ singleton: true,
63
+ requiredVersion: '^7.52.2'
64
+ }
65
+ },
66
+ echarts: {
67
+ version: '5.5.0',
68
+ lib: ()=>require('echarts'),
69
+ shareConfig: {
70
+ singleton: true,
71
+ requiredVersion: '^5.5.0'
72
+ }
73
+ },
74
+ '@perses-dev/components': {
75
+ version: '0.51.0-beta.0',
76
+ lib: ()=>require('@perses-dev/components'),
77
+ shareConfig: {
78
+ singleton: true,
79
+ requiredVersion: '^0.51.0-rc.0'
80
+ }
81
+ },
82
+ '@perses-dev/plugin-system': {
83
+ version: '0.51.0-beta.0',
84
+ lib: ()=>require('@perses-dev/plugin-system'),
85
+ shareConfig: {
86
+ singleton: true,
87
+ requiredVersion: '^0.51.0-rc.0'
88
+ }
89
+ },
90
+ '@perses-dev/explore': {
91
+ version: '0.51.0-beta.0',
92
+ lib: ()=>require('@perses-dev/explore'),
93
+ shareConfig: {
94
+ singleton: true,
95
+ requiredVersion: '^0.51.0-rc.0'
96
+ }
97
+ },
98
+ '@perses-dev/dashboards': {
99
+ version: '0.51.0-beta.0',
100
+ lib: ()=>require('@perses-dev/dashboards'),
101
+ shareConfig: {
102
+ singleton: true,
103
+ requiredVersion: '^0.51.0-rc.0'
104
+ }
105
+ },
106
+ // Below are the shared modules that are used by the plugins, this can be part of the SDK
107
+ 'date-fns': {
108
+ version: '4.1.0',
109
+ lib: ()=>require('date-fns'),
110
+ shareConfig: {
111
+ singleton: true,
112
+ requiredVersion: '^4.1.0'
113
+ }
114
+ },
115
+ 'date-fns-tz': {
116
+ version: '3.2.0',
117
+ lib: ()=>require('date-fns-tz'),
118
+ shareConfig: {
119
+ singleton: true,
120
+ requiredVersion: '^3.2.0'
121
+ }
122
+ },
123
+ lodash: {
124
+ version: '4.17.21',
125
+ lib: ()=>require('lodash'),
126
+ shareConfig: {
127
+ singleton: true,
128
+ requiredVersion: '^4.17.21'
129
+ }
130
+ },
131
+ '@emotion/react': {
132
+ version: '11.11.3',
133
+ lib: ()=>require('@emotion/react'),
134
+ shareConfig: {
135
+ singleton: true,
136
+ requiredVersion: '^11.11.3'
137
+ }
138
+ },
139
+ '@emotion/styled': {
140
+ version: '11.11.0',
141
+ lib: ()=>require('@emotion/styled'),
142
+ shareConfig: {
143
+ singleton: true,
144
+ requiredVersion: '^11.11.0'
145
+ }
146
+ },
147
+ '@hookform/resolvers/zod': {
148
+ version: '3.3.4',
149
+ lib: ()=>require('@hookform/resolvers/zod'),
150
+ shareConfig: {
151
+ singleton: true,
152
+ requiredVersion: '^3.3.4'
153
+ }
154
+ },
155
+ 'use-resize-observer': {
156
+ version: '9.1.0',
157
+ lib: ()=>require('use-resize-observer'),
158
+ shareConfig: {
159
+ singleton: true,
160
+ requiredVersion: '^9.1.0'
161
+ }
162
+ },
163
+ 'mdi-material-ui': {
164
+ version: '7.4.0',
165
+ lib: ()=>require('mdi-material-ui'),
166
+ shareConfig: {
167
+ singleton: true,
168
+ requiredVersion: '^7.4.0'
169
+ }
170
+ },
171
+ immer: {
172
+ version: '10.1.1',
173
+ lib: ()=>require('immer'),
174
+ shareConfig: {
175
+ singleton: true,
176
+ requiredVersion: '^10.1.1'
177
+ }
178
+ }
179
+ }
180
+ });
181
+ instance = pluginRuntime;
182
+ return instance;
176
183
  }
177
- });
184
+ return instance;
185
+ };
178
186
  const registerRemote = (name, baseURL)=>{
187
+ const pluginRuntime = getPluginRuntime();
179
188
  const existingRemote = pluginRuntime.options.remotes.find((remote)=>remote.name === name);
180
189
  if (!existingRemote) {
181
190
  const remoteEntryURL = baseURL ? `${baseURL}/${name}/mf-manifest.json` : `/plugins/${name}/mf-manifest.json`;
@@ -194,7 +203,7 @@ export const loadPlugin = async (moduleName, pluginName, baseURL)=>{
194
203
  };
195
204
  export function usePluginRuntime({ plugin }) {
196
205
  return {
197
- pluginRuntime,
206
+ pluginRuntime: getPluginRuntime(),
198
207
  loadPlugin: ()=>loadPlugin(plugin.moduleName, plugin.name, plugin.baseURL)
199
208
  };
200
209
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-require-imports */\n// Copyright 2024 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 { FederationHost, init, loadRemote } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactRouterDOM from 'react-router-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nexport const pluginRuntime = init({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '5.64.2',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.64.2',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/components': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-beta.0',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-beta.0',\n },\n },\n '@perses-dev/explore': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-beta.0',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-beta.0',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@hookform/resolvers/zod'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n lib: () => require('use-resize-observer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('immer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n});\n\nconst registerRemote = (name: string, baseURL?: string): void => {\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === name);\n if (!existingRemote) {\n const remoteEntryURL = baseURL ? `${baseURL}/${name}/mf-manifest.json` : `/plugins/${name}/mf-manifest.json`;\n pluginRuntime.registerRemotes([\n {\n name,\n entry: remoteEntryURL,\n alias: name,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (\n moduleName: string,\n pluginName: string,\n baseURL?: string\n): Promise<RemotePluginModule | null> => {\n registerRemote(moduleName, baseURL);\n\n return loadRemote<RemotePluginModule>(`${moduleName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: FederationHost;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime,\n loadPlugin: () => loadPlugin(plugin.moduleName, plugin.name, plugin.baseURL),\n };\n}\n"],"names":["init","loadRemote","ReactQuery","React","ReactDOM","ReactRouterDOM","ReactHookForm","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","lodash","immer","registerRemote","baseURL","existingRemote","options","find","remote","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","moduleName","pluginName","usePluginRuntime","plugin"],"mappings":"AAAA,wDA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AQ;YACnBJ,aAAa;gBACXC,WAAW;gBACXC,iBAAiB;YACnB;QACF;IACF;AACF,GAAG;AAEH,MAAMK,iBAAiB,CAACb,MAAcc;IACpC,MAAMC,iBAAiBhB,cAAciB,OAAO,CAACf,OAAO,CAACgB,IAAI,CAAC,CAACC,SAAWA,OAAOlB,IAAI,KAAKA;IACtF,IAAI,CAACe,gBAAgB;QACnB,MAAMI,iBAAiBL,UAAU,GAAGA,QAAQ,CAAC,EAAEd,KAAK,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAEA,KAAK,iBAAiB,CAAC;QAC5GD,cAAcqB,eAAe,CAAC;YAC5B;gBACEpB;gBACAqB,OAAOF;gBACPG,OAAOtB;YACT;SACD;IACH;AACF;AAEA,OAAO,MAAMuB,aAAa,OACxBC,YACAC,YACAX;IAEAD,eAAeW,YAAYV;IAE3B,OAAOrB,WAA+B,GAAG+B,WAAW,CAAC,EAAEC,YAAY;AACrE,EAAE;AAEF,OAAO,SAASC,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACL5B;QACAwB,YAAY,IAAMA,WAAWI,OAAOH,UAAU,EAAEG,OAAO3B,IAAI,EAAE2B,OAAOb,OAAO;IAC7E;AACF"}
1
+ {"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-require-imports */\n// Copyright 2024 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 { FederationHost, init, loadRemote } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\nimport { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: FederationHost | null = null;\n\nconst getPluginRuntime = (): FederationHost => {\n if (instance === null) {\n const pluginRuntime = init({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.39.1',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/components': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-rc.0',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-rc.0',\n },\n },\n '@perses-dev/explore': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-rc.0',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.51.0-beta.0',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.51.0-rc.0',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@hookform/resolvers/zod'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n lib: () => require('use-resize-observer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('immer'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nconst registerRemote = (name: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === name);\n if (!existingRemote) {\n const remoteEntryURL = baseURL ? `${baseURL}/${name}/mf-manifest.json` : `/plugins/${name}/mf-manifest.json`;\n pluginRuntime.registerRemotes([\n {\n name,\n entry: remoteEntryURL,\n alias: name,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (\n moduleName: string,\n pluginName: string,\n baseURL?: string\n): Promise<RemotePluginModule | null> => {\n registerRemote(moduleName, baseURL);\n\n return loadRemote<RemotePluginModule>(`${moduleName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: FederationHost;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: () => loadPlugin(plugin.moduleName, plugin.name, plugin.baseURL),\n };\n}\n"],"names":["init","loadRemote","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","getPluginRuntime","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","lodash","immer","registerRemote","baseURL","existingRemote","options","find","remote","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","moduleName","pluginName","usePluginRuntime","plugin"],"mappings":"AAAA,wDAAwD,GACxD,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAAyBA,IAAI,EAAEC,UAAU,QAAQ,sCAAsC;AACvF,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAmB,kBAAkB;AACjD,YAAYC,oBAAoB,mBAAmB;AAGnD,IAAIC,WAAkC;AAEtC,MAAMC,mBAAmB;IACvB,IAAID,aAAa,MAAM;QACrB,MAAME,gBAAgBT,KAAK;YACzBU,MAAM;YACNC,SAAS,EAAE;YACXC,QAAQ;gBACNC,OAAO;oBACLC,SAASX,MAAMW,OAAO;oBACtBC,KAAK,IAAMZ;oBACXa,aAAa;wBACXC,WAAW;wBACXC,iBAAiB,CAAC,CAAC,EAAEf,MAAMW,OAAO,EAAE;oBACtC;gBACF;gBACA,aAAa;oBACX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AAOF;gBACPG,OAAOtB;YACT;SACD;IACH;AACF;AAEA,OAAO,MAAMuB,aAAa,OACxBC,YACAC,YACAX;IAEAD,eAAeW,YAAYV;IAE3B,OAAOvB,WAA+B,GAAGiC,WAAW,CAAC,EAAEC,YAAY;AACrE,EAAE;AAEF,OAAO,SAASC,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACL5B,eAAeD;QACfyB,YAAY,IAAMA,WAAWI,OAAOH,UAAU,EAAEG,OAAO3B,IAAI,EAAE2B,OAAOb,OAAO;IAC7E;AACF"}
@@ -2,11 +2,13 @@ import { ReactElement, ReactNode } from 'react';
2
2
  import { TimeOption } from '@perses-dev/components';
3
3
  export interface TimeRangeSettingsProviderProps {
4
4
  showCustom?: boolean;
5
+ showZoomButtons?: boolean;
5
6
  options?: TimeOption[];
6
7
  children: ReactNode;
7
8
  }
8
9
  export interface TimeRangeSettings {
9
10
  showCustom: boolean;
11
+ showZoomButtons: boolean;
10
12
  options: TimeOption[];
11
13
  }
12
14
  export declare const TimeRangeSettingsContext: import("react").Context<TimeRangeSettings>;
@@ -20,6 +22,11 @@ export declare function useTimeRangeSettings(): TimeRangeSettings;
20
22
  * @param override If set, the value of the provider will be overridden by this value.
21
23
  */
22
24
  export declare function useShowCustomTimeRangeSetting(override?: boolean): boolean;
25
+ /**
26
+ * Get the current value of the showZoomButtons setting.
27
+ * @param override If set, the value of the provider will be overridden by this value.
28
+ */
29
+ export declare function useShowZoomRangeSetting(override?: boolean): boolean;
23
30
  /**
24
31
  * Get the current value of the options setting.
25
32
  * @param override If set, the value of the provider will be overridden by this value.
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeSettingsProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AACpF,OAAO,EAA2B,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAS7E,MAAM,WAAW,8BAA8B;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,wBAAwB,4CAA6D,CAAC;AAEnG,wBAAgB,2BAA2B,IAAI,iBAAiB,CAM/D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAMzE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAMhF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,GAAG,YAAY,CAS7F"}
1
+ {"version":3,"file":"TimeRangeSettingsProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAiB,YAAY,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AACpF,OAAO,EAA2B,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAU7E,MAAM,WAAW,8BAA8B;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,wBAAwB,4CAA6D,CAAC;AAEnG,wBAAgB,2BAA2B,IAAI,iBAAiB,CAM/D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAMzE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAMnE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAMhF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,8BAA8B,GAAG,YAAY,CAW7F"}
@@ -26,6 +26,7 @@ const DEFAULT_OPTIONS = [
26
26
  ];
27
27
  const defaultTimeRangeSettings = {
28
28
  showCustom: true,
29
+ showZoomButtons: true,
29
30
  options: DEFAULT_OPTIONS.map((duration)=>buildRelativeTimeOption(duration))
30
31
  };
31
32
  export const TimeRangeSettingsContext = /*#__PURE__*/ createContext(defaultTimeRangeSettings);
@@ -51,6 +52,16 @@ export function useTimeRangeSettingsContext() {
51
52
  }
52
53
  return showCustomTimeRange;
53
54
  }
55
+ /**
56
+ * Get the current value of the showZoomButtons setting.
57
+ * @param override If set, the value of the provider will be overridden by this value.
58
+ */ export function useShowZoomRangeSetting(override) {
59
+ const showZoomTimeRange = useTimeRangeSettings().showZoomButtons;
60
+ if (override !== undefined) {
61
+ return override;
62
+ }
63
+ return showZoomTimeRange;
64
+ }
54
65
  /**
55
66
  * Get the current value of the options setting.
56
67
  * @param override If set, the value of the provider will be overridden by this value.
@@ -67,10 +78,12 @@ export function useTimeRangeSettingsContext() {
67
78
  const ctx = useMemo(()=>{
68
79
  return {
69
80
  showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,
81
+ showZoomButtons: props.showZoomButtons === undefined ? defaultTimeRangeSettings.showZoomButtons : props.showZoomButtons,
70
82
  options: props.options === undefined ? defaultTimeRangeSettings.options : props.options
71
83
  };
72
84
  }, [
73
85
  props.showCustom,
86
+ props.showZoomButtons,
74
87
  props.options
75
88
  ]);
76
89
  return /*#__PURE__*/ _jsx(TimeRangeSettingsContext.Provider, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx"],"sourcesContent":["// Copyright 2024 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, ReactElement, ReactNode, useContext, useMemo } from 'react';\nimport { buildRelativeTimeOption, TimeOption } from '@perses-dev/components';\nimport { DurationString } from '@perses-dev/core';\n\nconst DEFAULT_OPTIONS: DurationString[] = ['5m', '15m', '30m', '1h', '6h', '12h', '24h', '7d', '14d'];\nconst defaultTimeRangeSettings: TimeRangeSettings = {\n showCustom: true,\n options: DEFAULT_OPTIONS.map((duration) => buildRelativeTimeOption(duration)),\n};\n\nexport interface TimeRangeSettingsProviderProps {\n showCustom?: boolean;\n options?: TimeOption[];\n children: ReactNode;\n}\n\nexport interface TimeRangeSettings {\n showCustom: boolean;\n options: TimeOption[];\n}\n\nexport const TimeRangeSettingsContext = createContext<TimeRangeSettings>(defaultTimeRangeSettings);\n\nexport function useTimeRangeSettingsContext(): TimeRangeSettings {\n const ctx = useContext(TimeRangeSettingsContext);\n if (ctx === undefined) {\n throw new Error('No TimeRangeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\n/**\n * Get and set the current resolved time range at runtime.\n */\nexport function useTimeRangeSettings(): TimeRangeSettings {\n return useTimeRangeSettingsContext();\n}\n\n/**\n * Get the current value of the showCustom setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowCustomTimeRangeSetting(override?: boolean): boolean {\n const showCustomTimeRange = useTimeRangeSettings().showCustom;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the options setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useTimeRangeOptionsSetting(override?: TimeOption[]): TimeOption[] {\n const showCustomTimeRange = useTimeRangeSettings().options;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Provider implementation that supplies the time range state at runtime.\n */\nexport function TimeRangeSettingsProvider(props: TimeRangeSettingsProviderProps): ReactElement {\n const ctx = useMemo(() => {\n return {\n showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,\n options: props.options === undefined ? defaultTimeRangeSettings.options : props.options,\n };\n }, [props.showCustom, props.options]);\n\n return <TimeRangeSettingsContext.Provider value={ctx}>{props.children}</TimeRangeSettingsContext.Provider>;\n}\n"],"names":["createContext","useContext","useMemo","buildRelativeTimeOption","DEFAULT_OPTIONS","defaultTimeRangeSettings","showCustom","options","map","duration","TimeRangeSettingsContext","useTimeRangeSettingsContext","ctx","undefined","Error","useTimeRangeSettings","useShowCustomTimeRangeSetting","override","showCustomTimeRange","useTimeRangeOptionsSetting","TimeRangeSettingsProvider","props","Provider","value","children"],"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,EAA2BC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AACpF,SAASC,uBAAuB,QAAoB,yBAAyB;AAG7E,MAAMC,kBAAoC;IAAC;IAAM;IAAO;IAAO;IAAM;IAAM;IAAO;IAAO;IAAM;CAAM;AACrG,MAAMC,2BAA8C;IAClDC,YAAY;IACZC,SAASH,gBAAgBI,GAAG,CAAC,CAACC,WAAaN,wBAAwBM;AACrE;AAaA,OAAO,MAAMC,yCAA2BV,cAAiCK,0BAA0B;AAEnG,OAAO,SAASM;IACd,MAAMC,MAAMX,WAAWS;IACvB,IAAIE,QAAQC,WAAW;QACrB,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOF;AACT;AAEA;;CAEC,GACD,OAAO,SAASG;IACd,OAAOJ;AACT;AAEA;;;CAGC,GACD,OAAO,SAASK,8BAA8BC,QAAkB;IAC9D,MAAMC,sBAAsBH,uBAAuBT,UAAU;IAC7D,IAAIW,aAAaJ,WAAW;QAC1B,OAAOI;IACT;IACA,OAAOC;AACT;AAEA;;;CAGC,GACD,OAAO,SAASC,2BAA2BF,QAAuB;IAChE,MAAMC,sBAAsBH,uBAAuBR,OAAO;IAC1D,IAAIU,aAAaJ,WAAW;QAC1B,OAAOI;IACT;IACA,OAAOC;AACT;AAEA;;CAEC,GACD,OAAO,SAASE,0BAA0BC,KAAqC;IAC7E,MAAMT,MAAMV,QAAQ;QAClB,OAAO;YACLI,YAAYe,MAAMf,UAAU,KAAKO,YAAYR,yBAAyBC,UAAU,GAAGe,MAAMf,UAAU;YACnGC,SAASc,MAAMd,OAAO,KAAKM,YAAYR,yBAAyBE,OAAO,GAAGc,MAAMd,OAAO;QACzF;IACF,GAAG;QAACc,MAAMf,UAAU;QAAEe,MAAMd,OAAO;KAAC;IAEpC,qBAAO,KAACG,yBAAyBY,QAAQ;QAACC,OAAOX;kBAAMS,MAAMG,QAAQ;;AACvE"}
1
+ {"version":3,"sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx"],"sourcesContent":["// Copyright 2024 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, ReactElement, ReactNode, useContext, useMemo } from 'react';\nimport { buildRelativeTimeOption, TimeOption } from '@perses-dev/components';\nimport { DurationString } from '@perses-dev/core';\n\nconst DEFAULT_OPTIONS: DurationString[] = ['5m', '15m', '30m', '1h', '6h', '12h', '24h', '7d', '14d'];\nconst defaultTimeRangeSettings: TimeRangeSettings = {\n showCustom: true,\n showZoomButtons: true,\n options: DEFAULT_OPTIONS.map((duration) => buildRelativeTimeOption(duration)),\n};\n\nexport interface TimeRangeSettingsProviderProps {\n showCustom?: boolean;\n showZoomButtons?: boolean;\n options?: TimeOption[];\n children: ReactNode;\n}\n\nexport interface TimeRangeSettings {\n showCustom: boolean;\n showZoomButtons: boolean;\n options: TimeOption[];\n}\n\nexport const TimeRangeSettingsContext = createContext<TimeRangeSettings>(defaultTimeRangeSettings);\n\nexport function useTimeRangeSettingsContext(): TimeRangeSettings {\n const ctx = useContext(TimeRangeSettingsContext);\n if (ctx === undefined) {\n throw new Error('No TimeRangeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\n/**\n * Get and set the current resolved time range at runtime.\n */\nexport function useTimeRangeSettings(): TimeRangeSettings {\n return useTimeRangeSettingsContext();\n}\n\n/**\n * Get the current value of the showCustom setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowCustomTimeRangeSetting(override?: boolean): boolean {\n const showCustomTimeRange = useTimeRangeSettings().showCustom;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the showZoomButtons setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowZoomRangeSetting(override?: boolean): boolean {\n const showZoomTimeRange = useTimeRangeSettings().showZoomButtons;\n if (override !== undefined) {\n return override;\n }\n return showZoomTimeRange;\n}\n\n/**\n * Get the current value of the options setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useTimeRangeOptionsSetting(override?: TimeOption[]): TimeOption[] {\n const showCustomTimeRange = useTimeRangeSettings().options;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Provider implementation that supplies the time range state at runtime.\n */\nexport function TimeRangeSettingsProvider(props: TimeRangeSettingsProviderProps): ReactElement {\n const ctx = useMemo(() => {\n return {\n showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,\n showZoomButtons:\n props.showZoomButtons === undefined ? defaultTimeRangeSettings.showZoomButtons : props.showZoomButtons,\n options: props.options === undefined ? defaultTimeRangeSettings.options : props.options,\n };\n }, [props.showCustom, props.showZoomButtons, props.options]);\n\n return <TimeRangeSettingsContext.Provider value={ctx}>{props.children}</TimeRangeSettingsContext.Provider>;\n}\n"],"names":["createContext","useContext","useMemo","buildRelativeTimeOption","DEFAULT_OPTIONS","defaultTimeRangeSettings","showCustom","showZoomButtons","options","map","duration","TimeRangeSettingsContext","useTimeRangeSettingsContext","ctx","undefined","Error","useTimeRangeSettings","useShowCustomTimeRangeSetting","override","showCustomTimeRange","useShowZoomRangeSetting","showZoomTimeRange","useTimeRangeOptionsSetting","TimeRangeSettingsProvider","props","Provider","value","children"],"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,EAA2BC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AACpF,SAASC,uBAAuB,QAAoB,yBAAyB;AAG7E,MAAMC,kBAAoC;IAAC;IAAM;IAAO;IAAO;IAAM;IAAM;IAAO;IAAO;IAAM;CAAM;AACrG,MAAMC,2BAA8C;IAClDC,YAAY;IACZC,iBAAiB;IACjBC,SAASJ,gBAAgBK,GAAG,CAAC,CAACC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Options, UseQueryResult } from '@tanstack/react-query';
4
4
  import { DefaultPluginKinds, PluginImplementation, PluginMetadataWithModule, PluginType } from '../model';
5
5
  export interface PluginRegistryContextType {
6
6
  getPlugin<T extends PluginType>(kind: T, name: string): Promise<PluginImplementation<T>>;
7
- listPluginMetadata(pluginTypes: string[]): Promise<PluginMetadataWithModule[]>;
7
+ listPluginMetadata(pluginTypes: PluginType[]): Promise<PluginMetadataWithModule[]>;
8
8
  defaultPluginKinds?: DefaultPluginKinds;
9
9
  }
10
10
  export declare const PluginRegistryContext: import("react").Context<PluginRegistryContextType | undefined>;
@@ -28,7 +28,7 @@ type UseListPluginMetadataOptions = Omit<UseQueryOptions<PluginMetadataWithModul
28
28
  /**
29
29
  * Gets a list of plugin metadata for the specified plugin type and returns it, along with loading/error state.
30
30
  */
31
- export declare function useListPluginMetadata(pluginTypes: string[], options?: UseListPluginMetadataOptions): UseQueryResult<PluginMetadataWithModule[]>;
31
+ export declare function useListPluginMetadata(pluginTypes: PluginType[], options?: UseListPluginMetadataOptions): UseQueryResult<PluginMetadataWithModule[]>;
32
32
  export declare function usePluginBuiltinVariableDefinitions(): UseQueryResult<BuiltinVariableDefinition[]>;
33
33
  export {};
34
34
  //# sourceMappingURL=plugin-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-registry.d.ts","sourceRoot":"","sources":["../../src/runtime/plugin-registry.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAwB,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE1G,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAA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gB,CAAC,CAAC,CAAC,GAC5B,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAYhD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAC7C,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/B,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAoBhD;AAGD,KAAK,4BAA4B,GAAG,IAAI,CACtC,eAAe,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAClG,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,CAAC,EAAE,4BAA4B,GACrC,cAAc,CAAC,wBAAwB,EAAE,CAAC,CAO5C;AAED,wBAAgB,mCAAmC,IAAI,cAAc,CAAC,yBAAyB,EAAE,CAAC,CAkBjG"}
@@ -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 { BuiltinVariableDefinition } from '@perses-dev/core';\nimport { useQueries, useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';\nimport { createContext, useContext } from 'react';\nimport { DefaultPluginKinds, PluginImplementation, PluginMetadataWithModule, PluginType } from '../model';\n\nexport interface PluginRegistryContextType {\n getPlugin<T extends PluginType>(kind: T, name: string): Promise<PluginImplementation<T>>;\n listPluginMetadata(pluginTypes: string[]): Promise<PluginMetadataWithModule[]>;\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(): PluginRegistryContextType {\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 | undefined, 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>(\n pluginType: T | undefined,\n kind: string,\n options?: UsePluginOptions<T>\n): UseQueryResult<PluginImplementation<T>, Error> {\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) && pluginType !== undefined && kind !== '',\n };\n const { getPlugin } = usePluginRegistry();\n return useQuery({\n queryKey: ['getPlugin', pluginType, kind],\n queryFn: () => getPlugin(pluginType!, kind),\n ...options,\n });\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>(\n pluginType: T,\n plugins: Array<{ kind: string }>\n): Array<UseQueryResult<PluginImplementation<T>>> {\n const { getPlugin } = usePluginRegistry();\n\n // useQueries() does not support queries with duplicate keys, therefore we de-duplicate the plugin kinds before running useQueries()\n // This resolves the following warning in the JS console: \"[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.\"\n // https://github.com/TanStack/query/issues/8224#issuecomment-2523554831\n // https://github.com/TanStack/query/issues/4187#issuecomment-1256336901\n const kinds = [...new Set(plugins.map((p) => p.kind))];\n\n const result: Array<UseQueryResult<PluginImplementation<T>>> = useQueries({\n queries: kinds.map((kind) => {\n return {\n queryKey: ['getPlugin', pluginType, kind],\n queryFn: () => getPlugin(pluginType, kind),\n };\n }),\n });\n\n // Re-assemble array in original order\n return plugins.map((p) => result[kinds.indexOf(p.kind)]!);\n}\n\n// Allow consumers to pass useQuery options from react-query when listing metadata\ntype UseListPluginMetadataOptions = Omit<\n UseQueryOptions<PluginMetadataWithModule[], Error, PluginMetadataWithModule[], [string, string[]]>,\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(\n pluginTypes: string[],\n options?: UseListPluginMetadataOptions\n): UseQueryResult<PluginMetadataWithModule[]> {\n const { listPluginMetadata } = usePluginRegistry();\n return useQuery({\n queryKey: ['listPluginMetadata', pluginTypes],\n queryFn: () => listPluginMetadata(pluginTypes),\n ...options,\n });\n}\n\nexport function usePluginBuiltinVariableDefinitions(): UseQueryResult<BuiltinVariableDefinition[]> {\n const { getPlugin, listPluginMetadata } = usePluginRegistry();\n\n return useQuery({\n queryKey: ['usePluginBuiltinVariableDefinitions'],\n queryFn: async () => {\n const datasources = await listPluginMetadata(['Datasource']);\n const datasourceNames = new Set(datasources.map((datasource) => datasource.spec.name));\n const result: BuiltinVariableDefinition[] = [];\n for (const name of datasourceNames) {\n const plugin = await getPlugin('Datasource', name);\n if (plugin.getBuiltinVariableDefinitions) {\n plugin.getBuiltinVariableDefinitions().forEach((definition) => result.push(definition));\n }\n }\n return result;\n },\n });\n}\n"],"names":["useQueries","useQuery","createContext","useContext","PluginRegistryContext","undefined","usePluginRegistry","ctx","Error","usePlugin","pluginType","kind","options","enabled","getPlugin","queryKey","queryFn","usePlugins","plugins","kinds","Set","map","p","result","queries","indexOf","useListPluginMetadata","pluginTypes","listPluginMetadata","usePluginBuiltinVariableDefinitions","datasources","datasourceNames","datasource","spec","name","plugin","getBuiltinVariableDefinitions","forEach","definition","push"],"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,SAASA,UAAU,EAAEC,QAAQ,QAAyC,wBAAwB;AAC9F,SAASC,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AASlD,OAAO,MAAMC,wBAAwBF,cAAqDG,WAAW;AAErG;;;CAGC,GACD,OAAO,SAASC;IACd,MAAMC,MAAMJ,WAAWC;IACvB,IAAIG,QAAQF,WAAW;QACrB,MAAM,IAAIG,MAAM;IAClB;IACA,OAAOD;AACT;AAQA;;CAEC,GACD,OAAO,SAASE,UACdC,UAAyB,EACzBC,IAAY,EACZC,OAA6B;IAE7B,wGAAwG;IACxGA,UAAU;QACR,GAAGA,OAAO;QACVC,SAAS,AAACD,CAAAA,SAASC,WAAW,IAAG,KAAMH,eAAeL,aAAaM,SAAS;IAC9E;IACA,MAAM,EAAEG,SAAS,EAAE,GAAGR;IACtB,OAAOL,SAAS;QACdc,UAAU;YAAC;YAAaL;YAAYC;SAAK;QACzCK,SAAS,IAAMF,UAAUJ,YAAaC;QACtC,GAAGC,OAAO;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,SAASK,WACdP,UAAa,EACbQ,OAAgC;IAEhC,MAAM,EAAEJ,SAAS,EAAE,GAAGR;IAEtB,oIAAoI;IACpI,iJAAiJ;IACjJ,wEAAwE;IACxE,wEAAwE;IACxE,MAAMa,QAAQ;WAAI,IAAIC,IAAIF,QAAQG,GAAG,CAAC,CAACC,IAAMA,EAAEX,IAAI;KAAG;IAEtD,MAAMY,SAAyDvB,WAAW;QACxEwB,SAASL,MAAME,GAAG,CAAC,CAACV;YAClB,OAAO;gBACLI,UAAU;oBAAC;oBAAaL;oBAAYC;iBAAK;gBACzCK,SAAS,IAAMF,UAAUJ,YAAYC;YACvC;QACF;IACF;IAEA,sCAAsC;IACtC,OAAOO,QAAQG,GAAG,CAAC,CAACC,IAAMC,MAAM,CAACJ,MAAMM,OAAO,CAACH,EAAEX,IAAI,EAAE;AACzD;AAQA;;CAEC,GACD,OAAO,SAASe,sBACdC,WAAqB,EACrBf,OAAsC;IAEtC,MAAM,EAAEgB,kBAAkB,EAAE,GAAGtB;IAC/B,OAAOL,SAAS;QACdc,UAAU;YAAC;YAAsBY;SAAY;QAC7CX,SAAS,IAAMY,mBAAmBD;QAClC,GAAGf,OAAO;IACZ;AACF;AAEA,OAAO,SAASiB;IACd,MAAM,EAAEf,SAAS,EAAEc,kBAAkB,EAAE,GAAGtB;IAE1C,OAAOL,SAAS;QACdc,UAAU;YAAC;SAAsC;QACjDC,SAAS;YACP,MAAMc,cAAc,MAAMF,mBAAmB;gBAAC;aAAa;YAC3D,MAAMG,kBAAkB,IAAIX,IAAIU,YAAYT,GAAG,CAAC,CAACW,aAAeA,WAAWC,IAAI,CAACC,IAAI;YACpF,MAAMX,SAAsC,EAAE;YAC9C,KAAK,MAAMW,QAAQH,gBAAiB;gBAClC,MAAMI,SAAS,MAAMrB,UAAU,cAAcoB;gBAC7C,IAAIC,OAAOC,6BAA6B,EAAE;oBACxCD,OAAOC,6BAA6B,GAAGC,OAAO,CAAC,CAACC,aAAef,OAAOgB,IAAI,CAACD;gBAC7E;YACF;YACA,OAAOf;QACT;IACF;AACF"}
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 { BuiltinVariableDefinition } from '@perses-dev/core';\nimport { useQueries, useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';\nimport { createContext, useContext } from 'react';\nimport { DefaultPluginKinds, PluginImplementation, PluginMetadataWithModule, PluginType } from '../model';\n\nexport interface PluginRegistryContextType {\n getPlugin<T extends PluginType>(kind: T, name: string): Promise<PluginImplementation<T>>;\n listPluginMetadata(pluginTypes: PluginType[]): Promise<PluginMetadataWithModule[]>;\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(): PluginRegistryContextType {\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 | undefined, 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>(\n pluginType: T | undefined,\n kind: string,\n options?: UsePluginOptions<T>\n): UseQueryResult<PluginImplementation<T>, Error> {\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) && pluginType !== undefined && kind !== '',\n };\n const { getPlugin } = usePluginRegistry();\n return useQuery({\n queryKey: ['getPlugin', pluginType, kind],\n queryFn: () => getPlugin(pluginType!, kind),\n ...options,\n });\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>(\n pluginType: T,\n plugins: Array<{ kind: string }>\n): Array<UseQueryResult<PluginImplementation<T>>> {\n const { getPlugin } = usePluginRegistry();\n\n // useQueries() does not support queries with duplicate keys, therefore we de-duplicate the plugin kinds before running useQueries()\n // This resolves the following warning in the JS console: \"[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.\"\n // https://github.com/TanStack/query/issues/8224#issuecomment-2523554831\n // https://github.com/TanStack/query/issues/4187#issuecomment-1256336901\n const kinds = [...new Set(plugins.map((p) => p.kind))];\n\n const result: Array<UseQueryResult<PluginImplementation<T>>> = useQueries({\n queries: kinds.map((kind) => {\n return {\n queryKey: ['getPlugin', pluginType, kind],\n queryFn: () => getPlugin(pluginType, kind),\n };\n }),\n });\n\n // Re-assemble array in original order\n return plugins.map((p) => result[kinds.indexOf(p.kind)]!);\n}\n\n// Allow consumers to pass useQuery options from react-query when listing metadata\ntype UseListPluginMetadataOptions = Omit<\n UseQueryOptions<PluginMetadataWithModule[], Error, PluginMetadataWithModule[], [string, string[]]>,\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(\n pluginTypes: PluginType[],\n options?: UseListPluginMetadataOptions\n): UseQueryResult<PluginMetadataWithModule[]> {\n const { listPluginMetadata } = usePluginRegistry();\n return useQuery({\n queryKey: ['listPluginMetadata', pluginTypes],\n queryFn: () => listPluginMetadata(pluginTypes),\n ...options,\n });\n}\n\nexport function usePluginBuiltinVariableDefinitions(): UseQueryResult<BuiltinVariableDefinition[]> {\n const { getPlugin, listPluginMetadata } = usePluginRegistry();\n\n return useQuery({\n queryKey: ['usePluginBuiltinVariableDefinitions'],\n queryFn: async () => {\n const datasources = await listPluginMetadata(['Datasource']);\n const datasourceNames = new Set(datasources.map((datasource) => datasource.spec.name));\n const result: BuiltinVariableDefinition[] = [];\n for (const name of datasourceNames) {\n const plugin = await getPlugin('Datasource', name);\n if (plugin.getBuiltinVariableDefinitions) {\n plugin.getBuiltinVariableDefinitions().forEach((definition) => result.push(definition));\n }\n }\n return result;\n },\n });\n}\n"],"names":["useQueries","useQuery","createContext","useContext","PluginRegistryContext","undefined","usePluginRegistry","ctx","Error","usePlugin","pluginType","kind","options","enabled","getPlugin","queryKey","queryFn","usePlugins","plugins","kinds","Set","map","p","result","queries","indexOf","useListPluginMetadata","pluginTypes","listPluginMetadata","usePluginBuiltinVariableDefinitions","datasources","datasourceNames","datasource","spec","name","plugin","getBuiltinVariableDefinitions","forEach","definition","push"],"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,SAASA,UAAU,EAAEC,QAAQ,QAAyC,wBAAwB;AAC9F,SAASC,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AASlD,OAAO,MAAMC,wBAAwBF,cAAqDG,WAAW;AAErG;;;CAGC,GACD,OAAO,SAASC;IACd,MAAMC,MAAMJ,WAAWC;IACvB,IAAIG,QAAQF,WAAW;QACrB,MAAM,IAAIG,MAAM;IAClB;IACA,OAAOD;AACT;AAQA;;CAEC,GACD,OAAO,SAASE,UACdC,UAAyB,EACzBC,IAAY,EACZC,OAA6B;IAE7B,wGAAwG;IACxGA,UAAU;QACR,GAAGA,OAAO;QACVC,SAAS,AAACD,CAAAA,SAASC,WAAW,IAAG,KAAMH,eAAeL,aAAaM,SAAS;IAC9E;IACA,MAAM,EAAEG,SAAS,EAAE,GAAGR;IACtB,OAAOL,SAAS;QACdc,UAAU;YAAC;YAAaL;YAAYC;SAAK;QACzCK,SAAS,IAAMF,UAAUJ,YAAaC;QACtC,GAAGC,OAAO;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,SAASK,WACdP,UAAa,EACbQ,OAAgC;IAEhC,MAAM,EAAEJ,SAAS,EAAE,GAAGR;IAEtB,oIAAoI;IACp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ryDefinition } from '@perses-dev/core';
1
2
  import { QueryCache, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query';
2
- import { TimeSeriesQueryDefinition, TimeSeriesData } from '@perses-dev/core';
3
3
  import { TimeSeriesDataQuery, TimeSeriesQueryMode } from '../model';
4
4
  export interface UseTimeSeriesQueryOptions {
5
5
  suggestedStepMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/runtime/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAKL,UAAU,EAEV,oBAAoB,EACpB,cAAc,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAe,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAA0B,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AAMnH,MAAM,WAAW,yBAAyB;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AA8DvD;;GAEG;AACH,eAAO,MAAM,kBAAkB,eACjB,yBAAyB,YAC3B,yBAAyB,iBACpB,qBAAqB,cAAc,CAAC,KAClD,eAAe,cAAc,CAkB/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,yBAAyB,EAAE,EACxC,OAAO,CAAC,EAAE,yBAAyB,EACnC,YAAY,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GACpD,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAiCvC;AAkBD;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,mBAAmB,EAAE,CAIlE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAWnF"}
1
+ {"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/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