@perses-dev/dashboards 0.53.0-beta.2 → 0.53.0-beta.4

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 (56) hide show
  1. package/dist/cjs/components/GridLayout/GridLayout.js +3 -3
  2. package/dist/cjs/components/LeaveDialog/LeaveDialog.js +3 -3
  3. package/dist/cjs/components/Panel/PanelActions.js +36 -0
  4. package/dist/cjs/components/Panel/PanelPluginLoader.js +4 -2
  5. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +3 -5
  6. package/dist/cjs/components/PanelDrawer/PanelQueriesSharedControls.js +24 -8
  7. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +3 -3
  8. package/dist/cjs/components/Variables/ListVariableListBox.js +4 -4
  9. package/dist/cjs/components/Variables/Variable.js +3 -3
  10. package/dist/cjs/components/Variables/VariableEditor.js +3 -3
  11. package/dist/cjs/components/Variables/VariableList.js +3 -3
  12. package/dist/cjs/constants/grid-layout-config.js +3 -3
  13. package/dist/cjs/constants/styles.js +7 -7
  14. package/dist/cjs/constants/user-interface-text.js +3 -3
  15. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +4 -4
  16. package/dist/cjs/context/DashboardProvider/common.js +3 -3
  17. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +19 -19
  18. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +1 -1
  19. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +1 -1
  20. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +5 -5
  21. package/dist/cjs/context/PanelEditorProvider/PanelEditorProvider.js +4 -5
  22. package/dist/cjs/context/VariableProvider/VariableProvider.js +9 -9
  23. package/dist/cjs/context/VariableProvider/query-params.js +6 -6
  24. package/dist/cjs/context/VariableProvider/utils.js +5 -5
  25. package/dist/cjs/test/dashboard-provider.js +3 -3
  26. package/dist/cjs/test/datasource-provider.js +4 -4
  27. package/dist/cjs/utils/panelUtils.js +11 -48
  28. package/dist/components/Panel/HeaderIconButton.d.ts +6 -4
  29. package/dist/components/Panel/HeaderIconButton.d.ts.map +1 -1
  30. package/dist/components/Panel/HeaderIconButton.js.map +1 -1
  31. package/dist/components/Panel/PanelActions.d.ts.map +1 -1
  32. package/dist/components/Panel/PanelActions.js +36 -0
  33. package/dist/components/Panel/PanelActions.js.map +1 -1
  34. package/dist/components/Panel/PanelPluginLoader.d.ts.map +1 -1
  35. package/dist/components/Panel/PanelPluginLoader.js +4 -2
  36. package/dist/components/Panel/PanelPluginLoader.js.map +1 -1
  37. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  38. package/dist/components/PanelDrawer/PanelEditorForm.js +1 -3
  39. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  40. package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts.map +1 -1
  41. package/dist/components/PanelDrawer/PanelQueriesSharedControls.js +25 -9
  42. package/dist/components/PanelDrawer/PanelQueriesSharedControls.js.map +1 -1
  43. package/dist/context/DashboardProvider/duplicate-panel-slice.js +2 -2
  44. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -1
  45. package/dist/context/DashboardProvider/panel-editor-slice.js +2 -2
  46. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  47. package/dist/context/PanelEditorProvider/PanelEditorProvider.d.ts +1 -1
  48. package/dist/context/PanelEditorProvider/PanelEditorProvider.d.ts.map +1 -1
  49. package/dist/context/PanelEditorProvider/PanelEditorProvider.js +1 -2
  50. package/dist/context/PanelEditorProvider/PanelEditorProvider.js.map +1 -1
  51. package/dist/utils/panelUtils.d.ts +3 -8
  52. package/dist/utils/panelUtils.d.ts.map +1 -1
  53. package/dist/utils/panelUtils.js +7 -49
  54. package/dist/utils/panelUtils.js.map +1 -1
  55. package/package.json +5 -6
  56. package/LICENSE +0 -201
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- GridLayout: function() {
24
+ get GridLayout () {
25
25
  return GridLayout;
26
26
  },
27
- RepeatGridLayout: function() {
27
+ get RepeatGridLayout () {
28
28
  return RepeatGridLayout;
29
29
  }
30
30
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- LeaveDialog: function() {
24
+ get LeaveDialog () {
25
25
  return LeaveDialog;
26
26
  },
27
- Prompt: function() {
27
+ get Prompt () {
28
28
  return Prompt;
29
29
  }
30
30
  });
@@ -33,6 +33,7 @@ const _DragVertical = /*#__PURE__*/ _interop_require_default(require("mdi-materi
33
33
  const _ContentCopy = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/ContentCopy"));
34
34
  const _Menu = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Menu"));
35
35
  const _Alert = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Alert"));
36
+ const _AlertCircle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/AlertCircle"));
36
37
  const _InformationOutline = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/InformationOutline"));
37
38
  const _constants = require("../../constants");
38
39
  const _HeaderIconButton = require("./HeaderIconButton");
@@ -42,6 +43,19 @@ function _interop_require_default(obj) {
42
43
  default: obj
43
44
  };
44
45
  }
46
+ const noticeTypeToIcon = {
47
+ error: /*#__PURE__*/ (0, _jsxruntime.jsx)(_AlertCircle.default, {
48
+ color: "error"
49
+ }),
50
+ warning: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Alert.default, {
51
+ fontSize: "inherit",
52
+ color: "warning"
53
+ }),
54
+ info: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InformationOutline.default, {
55
+ fontSize: "inherit",
56
+ color: "info"
57
+ })
58
+ };
45
59
  const ConditionalBox = (0, _material.styled)(_material.Box)({
46
60
  display: 'none',
47
61
  alignItems: 'center',
@@ -106,6 +120,24 @@ const PanelActions = ({ editHandlers, readHandlers, viewQueriesHandler, extra, t
106
120
  }, [
107
121
  queryResults
108
122
  ]);
123
+ const noticesIndicator = (0, _react.useMemo)(()=>{
124
+ const notices = queryResults.flatMap((q)=>{
125
+ return q.data?.metadata?.notices ?? [];
126
+ });
127
+ if (notices.length > 0) {
128
+ const lastNotice = notices[notices.length - 1];
129
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
130
+ description: lastNotice.message,
131
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_HeaderIconButton.HeaderIconButton, {
132
+ "aria-label": "panel notices",
133
+ size: "small",
134
+ children: noticeTypeToIcon[lastNotice.type]
135
+ })
136
+ });
137
+ }
138
+ }, [
139
+ queryResults
140
+ ]);
109
141
  const readActions = (0, _react.useMemo)(()=>{
110
142
  if (readHandlers !== undefined) {
111
143
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_components.InfoTooltip, {
@@ -253,6 +285,8 @@ const PanelActions = ({ editHandlers, readHandlers, viewQueriesHandler, extra, t
253
285
  " ",
254
286
  queryStateIndicator,
255
287
  " ",
288
+ noticesIndicator,
289
+ " ",
256
290
  extraActions,
257
291
  " ",
258
292
  viewQueryAction,
@@ -284,6 +318,7 @@ const PanelActions = ({ editHandlers, readHandlers, viewQueriesHandler, extra, t
284
318
  divider,
285
319
  " ",
286
320
  queryStateIndicator,
321
+ noticesIndicator,
287
322
  /*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
288
323
  children: [
289
324
  extraActions,
@@ -322,6 +357,7 @@ const PanelActions = ({ editHandlers, readHandlers, viewQueriesHandler, extra, t
322
357
  divider,
323
358
  " ",
324
359
  queryStateIndicator,
360
+ noticesIndicator,
325
361
  /*#__PURE__*/ (0, _jsxruntime.jsxs)(OnHover, {
326
362
  children: [
327
363
  extraActions,
@@ -30,6 +30,8 @@ function PanelPluginLoader(props) {
30
30
  });
31
31
  const PanelComponent = plugin?.PanelComponent;
32
32
  const supportedQueryTypes = plugin?.supportedQueryTypes || [];
33
+ // Clear out the queryResults parameter for plugins which don't support any query types
34
+ const supportedQueryResults = supportedQueryTypes.length > 0 ? queryResults : [];
33
35
  // Show fullsize skeleton if the panel plugin is loading.
34
36
  if (isPanelLoading) {
35
37
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
@@ -42,7 +44,7 @@ function PanelPluginLoader(props) {
42
44
  if (PanelComponent === undefined) {
43
45
  throw new Error(`Missing PanelComponent from panel plugin for kind '${kind}'`);
44
46
  }
45
- for (const queryResult of queryResults){
47
+ for (const queryResult of supportedQueryResults){
46
48
  if (!supportedQueryTypes.includes(queryResult.definition.kind)) {
47
49
  throw new Error(`This panel does not support queries of type '${queryResult.definition.kind}'. Supported query types: ${supportedQueryTypes.join(', ')}.`);
48
50
  }
@@ -51,6 +53,6 @@ function PanelPluginLoader(props) {
51
53
  spec: spec,
52
54
  contentDimensions: contentDimensions,
53
55
  definition: definition,
54
- queryResults: queryResults
56
+ queryResults: supportedQueryResults
55
57
  });
56
58
  }
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- PanelEditorForm: function() {
24
+ get PanelEditorForm () {
25
25
  return PanelEditorForm;
26
26
  },
27
- panelEditorFormId: function() {
27
+ get panelEditorFormId () {
28
28
  return panelEditorFormId;
29
29
  }
30
30
  });
@@ -41,7 +41,6 @@ const _usePanelEditor = require("./usePanelEditor");
41
41
  const _PanelQueriesSharedControls = require("./PanelQueriesSharedControls");
42
42
  function PanelEditorForm(props) {
43
43
  const { initialValues, initialAction, onSave, onClose } = props;
44
- const pluginEditorRef = (0, _react.useRef)(null);
45
44
  const panelGroups = (0, _context.useListPanelGroups)();
46
45
  const { panelDefinition, setName, setDescription, setLinks, setQueries, setPlugin, setPanelDefinition } = (0, _usePanelEditor.usePanelEditor)(initialValues.panelDefinition);
47
46
  const { plugin } = panelDefinition.spec;
@@ -128,7 +127,6 @@ function PanelEditorForm(props) {
128
127
  name: 'panelDefinition.spec.plugin.kind'
129
128
  });
130
129
  const handleSubmit = (0, _react.useCallback)(()=>{
131
- pluginEditorRef.current?.flushChanges?.();
132
130
  form.handleSubmit(processForm)();
133
131
  }, [
134
132
  form,
@@ -29,16 +29,31 @@ const _react = require("react");
29
29
  function PanelQueriesSharedControls({ plugin, control, panelDefinition, onQueriesChange, onPluginSpecChange, onJSONChange }) {
30
30
  const { data: pluginPreview } = (0, _pluginsystem.usePlugin)('Panel', plugin.kind);
31
31
  const panelEditorContext = (0, _react.useContext)(_dashboards.PanelEditorContext);
32
- const pluginQueryOptions = typeof pluginPreview?.queryOptions === 'function' ? pluginPreview?.queryOptions(panelDefinition.spec.plugin.spec) : pluginPreview?.queryOptions;
33
32
  const suggestedStepMs = (0, _pluginsystem.useSuggestedStepMs)(panelEditorContext?.preview.previewPanelWidth);
34
- const definitions = panelDefinition.spec.queries?.map((query)=>{
35
- return {
36
- kind: query.spec.plugin.kind,
37
- spec: query.spec.plugin.spec
38
- };
39
- }) ?? [];
33
+ const pluginQueryOptions = (0, _react.useMemo)(()=>typeof pluginPreview?.queryOptions === 'function' ? pluginPreview?.queryOptions(panelDefinition.spec.plugin.spec) : pluginPreview?.queryOptions, [
34
+ panelDefinition.spec.plugin.spec,
35
+ pluginPreview
36
+ ]);
37
+ const [previewDefinition, setPreviewDefinition] = (0, _react.useState)(()=>panelDefinition.spec.queries?.map((query)=>{
38
+ return {
39
+ kind: query.spec.plugin.kind,
40
+ spec: query.spec.plugin.spec
41
+ };
42
+ }) ?? []);
43
+ const handleRunQuery = (0, _react.useCallback)((index, newDef)=>{
44
+ setPreviewDefinition((prev)=>{
45
+ const newDefinitions = [
46
+ ...prev
47
+ ];
48
+ newDefinitions[index] = {
49
+ kind: newDef.spec.plugin.kind,
50
+ spec: newDef.spec.plugin.spec
51
+ };
52
+ return newDefinitions;
53
+ });
54
+ }, []);
40
55
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_pluginsystem.DataQueriesProvider, {
41
- definitions: definitions,
56
+ definitions: previewDefinition,
42
57
  options: {
43
58
  suggestedStepMs,
44
59
  ...pluginQueryOptions
@@ -71,6 +86,7 @@ function PanelQueriesSharedControls({ plugin, control, panelDefinition, onQuerie
71
86
  panelDefinition: panelDefinition,
72
87
  onJSONChange: onJSONChange,
73
88
  onQueriesChange: onQueriesChange,
89
+ onQueryRun: handleRunQuery,
74
90
  onPluginSpecChange: onPluginSpecChange
75
91
  })
76
92
  })
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- PanelGroupEditorForm: function() {
24
+ get PanelGroupEditorForm () {
25
25
  return PanelGroupEditorForm;
26
26
  },
27
- panelGroupEditorFormId: function() {
27
+ get panelGroupEditorFormId () {
28
28
  return panelGroupEditorFormId;
29
29
  }
30
30
  });
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- ListVariableListBox: function() {
24
+ get ListVariableListBox () {
25
25
  return ListVariableListBox;
26
26
  },
27
- ListVariableListBoxProvider: function() {
27
+ get ListVariableListBoxProvider () {
28
28
  return ListVariableListBoxProvider;
29
29
  },
30
- useListVariableListBoxContext: function() {
30
+ get useListVariableListBoxContext () {
31
31
  return useListVariableListBoxContext;
32
32
  }
33
33
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- Variable: function() {
24
+ get Variable () {
25
25
  return Variable;
26
26
  },
27
- useListVariableState: function() {
27
+ get useListVariableState () {
28
28
  return useListVariableState;
29
29
  }
30
30
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- VariableEditor: function() {
24
+ get VariableEditor () {
25
25
  return VariableEditor;
26
26
  },
27
- VariableName: function() {
27
+ get VariableName () {
28
28
  return VariableName;
29
29
  }
30
30
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- VariableList: function() {
24
+ get VariableList () {
25
25
  return VariableList;
26
26
  },
27
- VariableListItem: function() {
27
+ get VariableListItem () {
28
28
  return VariableListItem;
29
29
  }
30
30
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- GRID_LAYOUT_COLS: function() {
24
+ get GRID_LAYOUT_COLS () {
25
25
  return GRID_LAYOUT_COLS;
26
26
  },
27
- GRID_LAYOUT_SMALL_BREAKPOINT: function() {
27
+ get GRID_LAYOUT_SMALL_BREAKPOINT () {
28
28
  return GRID_LAYOUT_SMALL_BREAKPOINT;
29
29
  }
30
30
  });
@@ -17,26 +17,26 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- HEADER_ACTIONS_CONTAINER_NAME: function() {
24
+ get HEADER_ACTIONS_CONTAINER_NAME () {
25
25
  return HEADER_ACTIONS_CONTAINER_NAME;
26
26
  },
27
- HEADER_MEDIUM_WIDTH: function() {
27
+ get HEADER_MEDIUM_WIDTH () {
28
28
  return HEADER_MEDIUM_WIDTH;
29
29
  },
30
- HEADER_SMALL_WIDTH: function() {
30
+ get HEADER_SMALL_WIDTH () {
31
31
  return HEADER_SMALL_WIDTH;
32
32
  },
33
- MAX_VARIABLE_WIDTH: function() {
33
+ get MAX_VARIABLE_WIDTH () {
34
34
  return MAX_VARIABLE_WIDTH;
35
35
  },
36
- MIN_VARIABLE_WIDTH: function() {
36
+ get MIN_VARIABLE_WIDTH () {
37
37
  return MIN_VARIABLE_WIDTH;
38
38
  },
39
- editButtonStyle: function() {
39
+ get editButtonStyle () {
40
40
  return editButtonStyle;
41
41
  }
42
42
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- ARIA_LABEL_TEXT: function() {
24
+ get ARIA_LABEL_TEXT () {
25
25
  return ARIA_LABEL_TEXT;
26
26
  },
27
- TOOLTIP_TEXT: function() {
27
+ get TOOLTIP_TEXT () {
28
28
  return TOOLTIP_TEXT;
29
29
  }
30
30
  });
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- DashboardContext: function() {
24
+ get DashboardContext () {
25
25
  return DashboardContext;
26
26
  },
27
- DashboardProvider: function() {
27
+ get DashboardProvider () {
28
28
  return DashboardProvider;
29
29
  },
30
- useDashboardStore: function() {
30
+ get useDashboardStore () {
31
31
  return useDashboardStore;
32
32
  }
33
33
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- createPanelDefinition: function() {
24
+ get createPanelDefinition () {
25
25
  return createPanelDefinition;
26
26
  },
27
- generateId: function() {
27
+ get generateId () {
28
28
  return generateId;
29
29
  }
30
30
  });
@@ -17,62 +17,62 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- useDashboardActions: function() {
24
+ get useDashboardActions () {
25
25
  return useDashboardActions;
26
26
  },
27
- useDashboardDuration: function() {
27
+ get useDashboardDuration () {
28
28
  return useDashboardDuration;
29
29
  },
30
- useDeletePanelDialog: function() {
30
+ get useDeletePanelDialog () {
31
31
  return useDeletePanelDialog;
32
32
  },
33
- useDeletePanelGroupDialog: function() {
33
+ get useDeletePanelGroupDialog () {
34
34
  return useDeletePanelGroupDialog;
35
35
  },
36
- useDiscardChangesConfirmationDialog: function() {
36
+ get useDiscardChangesConfirmationDialog () {
37
37
  return useDiscardChangesConfirmationDialog;
38
38
  },
39
- useEditJsonDialog: function() {
39
+ get useEditJsonDialog () {
40
40
  return useEditJsonDialog;
41
41
  },
42
- useEditMode: function() {
42
+ get useEditMode () {
43
43
  return useEditMode;
44
44
  },
45
- useListPanelGroups: function() {
45
+ get useListPanelGroups () {
46
46
  return useListPanelGroups;
47
47
  },
48
- usePanel: function() {
48
+ get usePanel () {
49
49
  return usePanel;
50
50
  },
51
- usePanelActions: function() {
51
+ get usePanelActions () {
52
52
  return usePanelActions;
53
53
  },
54
- usePanelEditor: function() {
54
+ get usePanelEditor () {
55
55
  return usePanelEditor;
56
56
  },
57
- usePanelGroup: function() {
57
+ get usePanelGroup () {
58
58
  return usePanelGroup;
59
59
  },
60
- usePanelGroupActions: function() {
60
+ get usePanelGroupActions () {
61
61
  return usePanelGroupActions;
62
62
  },
63
- usePanelGroupEditor: function() {
63
+ get usePanelGroupEditor () {
64
64
  return usePanelGroupEditor;
65
65
  },
66
- usePanelGroupIds: function() {
66
+ get usePanelGroupIds () {
67
67
  return usePanelGroupIds;
68
68
  },
69
- useSaveChangesConfirmationDialog: function() {
69
+ get useSaveChangesConfirmationDialog () {
70
70
  return useSaveChangesConfirmationDialog;
71
71
  },
72
- useViewPanel: function() {
72
+ get useViewPanel () {
73
73
  return useViewPanel;
74
74
  },
75
- useViewPanelGroup: function() {
75
+ get useViewPanelGroup () {
76
76
  return useViewPanelGroup;
77
77
  }
78
78
  });
@@ -49,7 +49,7 @@ function createDuplicatePanelSlice() {
49
49
  if (matchingLayout === undefined) {
50
50
  throw new Error(`Cannot find layout for Panel with key '${panelKey}'`);
51
51
  }
52
- const dupePanelKey = crypto.randomUUID().replaceAll('-', '');
52
+ const dupePanelKey = (0, _panelUtils.generatePanelKey)();
53
53
  state.panels[dupePanelKey] = panelToDupe;
54
54
  const duplicateLayout = {
55
55
  i: (0, _common.generateId)().toString(),
@@ -110,7 +110,7 @@ function createPanelEditorSlice() {
110
110
  panelDefinition: get().initialValues?.panelDefinition ?? (0, _common.createPanelDefinition)()
111
111
  },
112
112
  applyChanges: (next)=>{
113
- const panelKey = crypto.randomUUID().replaceAll('-', '');
113
+ const panelKey = (0, _utils.generatePanelKey)();
114
114
  set((state)=>{
115
115
  // Add a panel
116
116
  state.panels[panelKey] = next.panelDefinition;
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- addPanelGroup: function() {
24
+ get addPanelGroup () {
25
25
  return addPanelGroup;
26
26
  },
27
- convertLayoutsToPanelGroups: function() {
27
+ get convertLayoutsToPanelGroups () {
28
28
  return convertLayoutsToPanelGroups;
29
29
  },
30
- createEmptyPanelGroup: function() {
30
+ get createEmptyPanelGroup () {
31
31
  return createEmptyPanelGroup;
32
32
  },
33
- createPanelGroupSlice: function() {
33
+ get createPanelGroupSlice () {
34
34
  return createPanelGroupSlice;
35
35
  }
36
36
  });
@@ -17,14 +17,14 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- PanelEditorContext: function() {
24
+ get PanelEditorContext () {
25
25
  return PanelEditorContext;
26
26
  },
27
- PanelEditorProvider: function() {
27
+ get PanelEditorProvider () {
28
28
  return PanelEditorProvider;
29
29
  }
30
30
  });
@@ -39,8 +39,7 @@ const PanelEditorProvider = ({ children })=>{
39
39
  setPreviewPanelWidth
40
40
  }
41
41
  }), [
42
- previewPanelWidth,
43
- setPreviewPanelWidth
42
+ previewPanelWidth
44
43
  ]);
45
44
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(PanelEditorContext.Provider, {
46
45
  value: ctx,
@@ -17,32 +17,32 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- VariableProvider: function() {
24
+ get VariableProvider () {
25
25
  return VariableProvider;
26
26
  },
27
- VariableProviderWithQueryParams: function() {
27
+ get VariableProviderWithQueryParams () {
28
28
  return VariableProviderWithQueryParams;
29
29
  },
30
- useExternalVariableDefinitions: function() {
30
+ get useExternalVariableDefinitions () {
31
31
  return useExternalVariableDefinitions;
32
32
  },
33
- useVariableDefinitionActions: function() {
33
+ get useVariableDefinitionActions () {
34
34
  return useVariableDefinitionActions;
35
35
  },
36
- useVariableDefinitionAndState: function() {
36
+ get useVariableDefinitionAndState () {
37
37
  return useVariableDefinitionAndState;
38
38
  },
39
- useVariableDefinitionStates: function() {
39
+ get useVariableDefinitionStates () {
40
40
  return useVariableDefinitionStates;
41
41
  },
42
- useVariableDefinitionStoreCtx: function() {
42
+ get useVariableDefinitionStoreCtx () {
43
43
  return useVariableDefinitionStoreCtx;
44
44
  },
45
- useVariableDefinitions: function() {
45
+ get useVariableDefinitions () {
46
46
  return useVariableDefinitions;
47
47
  }
48
48
  });