@gravity-ui/dashkit 6.5.0-beta.1 → 6.5.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,10 +21,6 @@ interface DashKitDefaultProps {
21
21
  settings: SettingsProps;
22
22
  context: ContextProps;
23
23
  noOverlay: boolean;
24
- hideWidgetOverlayControl: (args: {
25
- id: string;
26
- controlId: string;
27
- }) => void;
28
24
  }
29
25
  export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
30
26
  }
@@ -50,14 +46,5 @@ export declare class DashKit extends React.PureComponent<DashKitInnerProps> {
50
46
  metaRef: React.RefObject<GridLayout>;
51
47
  render(): JSX.Element;
52
48
  getItemsMeta(): any;
53
- /**
54
- * public method for hiding overlayControl item by id
55
- * for ex. can be triggered after data render
56
- * @param args
57
- */
58
- hideWidgetOverlayControl(args: {
59
- id: string;
60
- controlId: string;
61
- }): any;
62
49
  }
63
50
  export {};
@@ -54,21 +54,11 @@ class DashKit extends react_1.default.PureComponent {
54
54
  var _a;
55
55
  return (_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.getItemsMeta();
56
56
  }
57
- /**
58
- * public method for hiding overlayControl item by id
59
- * for ex. can be triggered after data render
60
- * @param args
61
- */
62
- hideWidgetOverlayControl(args) {
63
- var _a;
64
- return (_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.hideWidgetOverlayControl(args);
65
- }
66
57
  }
67
58
  exports.DashKit = DashKit;
68
59
  DashKit.defaultProps = {
69
60
  onItemEdit: noop_1.default,
70
61
  onChange: noop_1.default,
71
- hideWidgetOverlayControl: noop_1.default,
72
62
  defaultGlobalParams: {},
73
63
  globalParams: {},
74
64
  itemsStateAndParams: {},
@@ -18,7 +18,9 @@ export default class GridLayout extends React.PureComponent<any, any, any> {
18
18
  adjustedWidgetLayout: any;
19
19
  }) => void;
20
20
  getItemsMeta: () => any;
21
- hideWidgetOverlayControl: (args: any) => any;
21
+ getAutoupdateIntervalMs(): number;
22
+ getReloadIntervalRemains(): number;
23
+ startReloadItems(): any;
22
24
  reloadItems(): void;
23
25
  _onStart: () => void;
24
26
  _onStop: (newLayout: any) => void;
@@ -5,6 +5,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const react_grid_layout_1 = tslib_1.__importStar(require("react-grid-layout"));
6
6
  const GridItem_1 = tslib_1.__importDefault(require("../GridItem/GridItem"));
7
7
  const DashKitContext_1 = require("../../context/DashKitContext");
8
+ const constants_1 = require("../../constants");
8
9
  const Layout = (0, react_grid_layout_1.WidthProvider)(react_grid_layout_1.default); // eslint-disable-line new-cap
9
10
  class GridLayout extends react_1.default.PureComponent {
10
11
  constructor(props, context) {
@@ -30,11 +31,6 @@ class GridLayout extends react_1.default.PureComponent {
30
31
  const { getItemsMeta } = this.context;
31
32
  return getItemsMeta(this.pluginsRefs);
32
33
  };
33
- this.hideWidgetOverlayControl = (args) => {
34
- const { hideWidgetOverlayControl } = this.context;
35
- const plugin = this.pluginsRefs.find((item) => item.props.id);
36
- return hideWidgetOverlayControl(Object.assign(Object.assign({}, args), { plugin }));
37
- };
38
34
  this._onStart = () => {
39
35
  this.setState({ isDragging: true });
40
36
  };
@@ -61,16 +57,37 @@ class GridLayout extends react_1.default.PureComponent {
61
57
  clearTimeout(this._timeout);
62
58
  document.removeEventListener('visibilitychange', this.onVisibilityChange);
63
59
  }
64
- reloadItems() {
65
- const { editMode, settings: { autoupdateInterval, silentLoading } = {}, reloadItems, } = this.context;
66
- const { isPageHidden } = this.state;
60
+ getAutoupdateIntervalMs() {
61
+ const { settings: { autoupdateInterval } = {} } = this.context;
67
62
  const autoupdateIntervalMs = Number(autoupdateInterval) * 1000;
63
+ return autoupdateIntervalMs;
64
+ }
65
+ getReloadIntervalRemains() {
66
+ const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
67
+ const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0);
68
+ const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload;
69
+ return reloadIntervalRemains;
70
+ }
71
+ startReloadItems() {
72
+ const { editMode, settings: { silentLoading } = {}, reloadItems } = this.context;
73
+ const { isPageHidden } = this.state;
74
+ if (!isPageHidden && !editMode) {
75
+ this._lastReloadAt = new Date().getTime();
76
+ return reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
77
+ }
78
+ return Promise.resolve();
79
+ }
80
+ reloadItems() {
81
+ const { settings: { realtimeMode } = {} } = this.context;
82
+ if (realtimeMode) {
83
+ this.startReloadItems().then(() => this.reloadItems());
84
+ return;
85
+ }
86
+ const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
87
+ const reloadIntervalRemains = this.getReloadIntervalRemains();
68
88
  if (autoupdateIntervalMs) {
69
- const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0);
70
- const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload;
71
- if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) {
72
- this._lastReloadAt = new Date().getTime();
73
- reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
89
+ if (reloadIntervalRemains <= 0) {
90
+ this.startReloadItems();
74
91
  }
75
92
  this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains);
76
93
  }
@@ -80,7 +97,7 @@ class GridLayout extends react_1.default.PureComponent {
80
97
  this.pluginsRefs.length = config.items.length;
81
98
  return (react_1.default.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
82
99
  ? { draggableHandle: `.${draggableHandleClassName}` }
83
- : null)), config.items.map((item, i) => {
100
+ : null), { draggableCancel: `.${constants_1.OVERLAY_CONTROLS_CLASS_NAME}` }), config.items.map((item, i) => {
84
101
  return (react_1.default.createElement(GridItem_1.default, { forwardedPluginRef: (pluginRef) => {
85
102
  this.pluginsRefs[i] = pluginRef;
86
103
  }, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
@@ -12,7 +12,7 @@ const DotsIcon_1 = require("../../icons/DotsIcon");
12
12
  const CogIcon_1 = require("../../icons/CogIcon");
13
13
  const CloseIcon_1 = require("../../icons/CloseIcon");
14
14
  const cn_1 = require("../../utils/cn");
15
- const b = (0, cn_1.cn)('dashkit-overlay-controls');
15
+ const b = (0, cn_1.cn)(constants_1.OVERLAY_CONTROLS_CLASS_NAME);
16
16
  var OverlayControlsPosition;
17
17
  (function (OverlayControlsPosition) {
18
18
  OverlayControlsPosition["TopRight"] = "top_right";
@@ -1,5 +1,6 @@
1
1
  export declare const COPIED_WIDGET_STORE_KEY = "dashCopiedItem";
2
2
  export declare const DEFAULT_NAMESPACE = "default";
3
+ export declare const OVERLAY_CONTROLS_CLASS_NAME = "dashkit-overlay-controls";
3
4
  export declare const MenuItems: {
4
5
  readonly Copy: "copy";
5
6
  readonly Delete: "delete";
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MenuItems = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
3
+ exports.MenuItems = exports.OVERLAY_CONTROLS_CLASS_NAME = exports.DEFAULT_NAMESPACE = exports.COPIED_WIDGET_STORE_KEY = void 0;
4
4
  exports.COPIED_WIDGET_STORE_KEY = 'dashCopiedItem';
5
5
  exports.DEFAULT_NAMESPACE = 'default';
6
+ exports.OVERLAY_CONTROLS_CLASS_NAME = 'dashkit-overlay-controls';
6
7
  exports.MenuItems = {
7
8
  Copy: 'copy',
8
9
  Delete: 'delete',
@@ -15,7 +15,6 @@ function useMemoStateContext(props) {
15
15
  // (высота) из конфига будет запоминаться в originalLayouts, новое значение высоты в adjustedLayouts
16
16
  const originalLayouts = react_1.default.useRef({});
17
17
  const adjustedLayouts = react_1.default.useRef({});
18
- const [filteredOverlayControls, setFilteredOverlayControls] = react_1.default.useState(props.overlayControls || []);
19
18
  // TODO: need move originalLayouts, adjustedLayouts to state
20
19
  const [layoutUpdateCounter, forceUpdateLayout] = react_1.default.useState(0);
21
20
  const onChange = react_1.default.useCallback(({ config = props.config, itemsStateAndParams = props.itemsStateAndParams }) => {
@@ -111,10 +110,6 @@ function useMemoStateContext(props) {
111
110
  })
112
111
  .filter(Boolean);
113
112
  }, []);
114
- const hideWidgetOverlayControl = react_1.default.useCallback((args) => {
115
- const newOverlayControls = props.overlayControls.allWidgetsControls.filter((item) => item.id !== args.controlId);
116
- setFilteredOverlayControls(Object.assign(Object.assign({}, props.overlayControls), { allWidgetsControls: newOverlayControls }));
117
- }, [props.overlayControls]);
118
113
  const resultLayout = react_1.default.useMemo(() => {
119
114
  return props.layout.map((item) => {
120
115
  if (item.i in adjustedLayouts.current) {
@@ -126,7 +121,8 @@ function useMemoStateContext(props) {
126
121
  });
127
122
  }, [props.layout, layoutUpdateCounter]);
128
123
  const reloadItems = react_1.default.useCallback((pluginsRefs, data) => {
129
- pluginsRefs.forEach((ref) => ref && ref.reload && ref.reload(data));
124
+ const promises = pluginsRefs.map((ref) => ref && ref.reload && ref.reload(data));
125
+ return Promise.all(promises);
130
126
  }, []);
131
127
  return react_1.default.useMemo(() => ({
132
128
  layout: resultLayout,
@@ -145,8 +141,6 @@ function useMemoStateContext(props) {
145
141
  editItem: props.onItemEdit,
146
142
  layoutChange: onLayoutChange,
147
143
  getItemsMeta,
148
- hideWidgetOverlayControl,
149
- filteredOverlayControls,
150
144
  reloadItems,
151
145
  memorizeOriginalLayout,
152
146
  revertToOriginalLayout,
@@ -168,8 +162,6 @@ function useMemoStateContext(props) {
168
162
  props.onItemEdit,
169
163
  onLayoutChange,
170
164
  getItemsMeta,
171
- hideWidgetOverlayControl,
172
- filteredOverlayControls,
173
165
  reloadItems,
174
166
  memorizeOriginalLayout,
175
167
  revertToOriginalLayout,
@@ -180,9 +172,8 @@ function useMemoStateContext(props) {
180
172
  function withContext(Component) {
181
173
  const WithContext = (props) => {
182
174
  const contextValue = useMemoStateContext(props);
183
- const overlayControls = contextValue.filteredOverlayControls;
184
175
  return (react_1.default.createElement(DashKitContext_1.DashKitContext.Provider, { value: contextValue },
185
- react_1.default.createElement(Component, { overlayControls: overlayControls })));
176
+ react_1.default.createElement(Component, { overlayControls: props.overlayControls })));
186
177
  };
187
178
  WithContext.displayName = `withContext(${Component.displayName || Component.name || 'Component'}`;
188
179
  return WithContext;
@@ -11,6 +11,7 @@ export type MenuItem = (typeof MenuItems)[keyof typeof MenuItems] | OverlayCusto
11
11
  export interface SettingsProps {
12
12
  autoupdateInterval: number;
13
13
  silentLoading: boolean;
14
+ realtimeMode?: boolean;
14
15
  }
15
16
  export interface ContextProps {
16
17
  [key: string]: any;
@@ -21,10 +21,6 @@ interface DashKitDefaultProps {
21
21
  settings: SettingsProps;
22
22
  context: ContextProps;
23
23
  noOverlay: boolean;
24
- hideWidgetOverlayControl: (args: {
25
- id: string;
26
- controlId: string;
27
- }) => void;
28
24
  }
29
25
  export interface DashKitProps extends DashKitGeneralProps, Partial<DashKitDefaultProps> {
30
26
  }
@@ -50,14 +46,5 @@ export declare class DashKit extends React.PureComponent<DashKitInnerProps> {
50
46
  metaRef: React.RefObject<GridLayout>;
51
47
  render(): JSX.Element;
52
48
  getItemsMeta(): any;
53
- /**
54
- * public method for hiding overlayControl item by id
55
- * for ex. can be triggered after data render
56
- * @param args
57
- */
58
- hideWidgetOverlayControl(args: {
59
- id: string;
60
- controlId: string;
61
- }): any;
62
49
  }
63
50
  export {};
@@ -50,20 +50,10 @@ export class DashKit extends React.PureComponent {
50
50
  var _a;
51
51
  return (_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.getItemsMeta();
52
52
  }
53
- /**
54
- * public method for hiding overlayControl item by id
55
- * for ex. can be triggered after data render
56
- * @param args
57
- */
58
- hideWidgetOverlayControl(args) {
59
- var _a;
60
- return (_a = this.metaRef.current) === null || _a === void 0 ? void 0 : _a.hideWidgetOverlayControl(args);
61
- }
62
53
  }
63
54
  DashKit.defaultProps = {
64
55
  onItemEdit: noop,
65
56
  onChange: noop,
66
- hideWidgetOverlayControl: noop,
67
57
  defaultGlobalParams: {},
68
58
  globalParams: {},
69
59
  itemsStateAndParams: {},
@@ -18,7 +18,9 @@ export default class GridLayout extends React.PureComponent<any, any, any> {
18
18
  adjustedWidgetLayout: any;
19
19
  }) => void;
20
20
  getItemsMeta: () => any;
21
- hideWidgetOverlayControl: (args: any) => any;
21
+ getAutoupdateIntervalMs(): number;
22
+ getReloadIntervalRemains(): number;
23
+ startReloadItems(): any;
22
24
  reloadItems(): void;
23
25
  _onStart: () => void;
24
26
  _onStop: (newLayout: any) => void;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import ReactGridLayout, { WidthProvider } from 'react-grid-layout';
3
3
  import GridItem from '../GridItem/GridItem';
4
4
  import { DashKitContext } from '../../context/DashKitContext';
5
+ import { OVERLAY_CONTROLS_CLASS_NAME } from '../../constants';
5
6
  const Layout = WidthProvider(ReactGridLayout); // eslint-disable-line new-cap
6
7
  export default class GridLayout extends React.PureComponent {
7
8
  constructor(props, context) {
@@ -27,11 +28,6 @@ export default class GridLayout extends React.PureComponent {
27
28
  const { getItemsMeta } = this.context;
28
29
  return getItemsMeta(this.pluginsRefs);
29
30
  };
30
- this.hideWidgetOverlayControl = (args) => {
31
- const { hideWidgetOverlayControl } = this.context;
32
- const plugin = this.pluginsRefs.find((item) => item.props.id);
33
- return hideWidgetOverlayControl(Object.assign(Object.assign({}, args), { plugin }));
34
- };
35
31
  this._onStart = () => {
36
32
  this.setState({ isDragging: true });
37
33
  };
@@ -58,16 +54,37 @@ export default class GridLayout extends React.PureComponent {
58
54
  clearTimeout(this._timeout);
59
55
  document.removeEventListener('visibilitychange', this.onVisibilityChange);
60
56
  }
61
- reloadItems() {
62
- const { editMode, settings: { autoupdateInterval, silentLoading } = {}, reloadItems, } = this.context;
63
- const { isPageHidden } = this.state;
57
+ getAutoupdateIntervalMs() {
58
+ const { settings: { autoupdateInterval } = {} } = this.context;
64
59
  const autoupdateIntervalMs = Number(autoupdateInterval) * 1000;
60
+ return autoupdateIntervalMs;
61
+ }
62
+ getReloadIntervalRemains() {
63
+ const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
64
+ const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0);
65
+ const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload;
66
+ return reloadIntervalRemains;
67
+ }
68
+ startReloadItems() {
69
+ const { editMode, settings: { silentLoading } = {}, reloadItems } = this.context;
70
+ const { isPageHidden } = this.state;
71
+ if (!isPageHidden && !editMode) {
72
+ this._lastReloadAt = new Date().getTime();
73
+ return reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
74
+ }
75
+ return Promise.resolve();
76
+ }
77
+ reloadItems() {
78
+ const { settings: { realtimeMode } = {} } = this.context;
79
+ if (realtimeMode) {
80
+ this.startReloadItems().then(() => this.reloadItems());
81
+ return;
82
+ }
83
+ const autoupdateIntervalMs = this.getAutoupdateIntervalMs();
84
+ const reloadIntervalRemains = this.getReloadIntervalRemains();
65
85
  if (autoupdateIntervalMs) {
66
- const timeSinceLastReload = new Date().getTime() - (this._lastReloadAt || 0);
67
- const reloadIntervalRemains = autoupdateIntervalMs - timeSinceLastReload;
68
- if (!isPageHidden && !editMode && reloadIntervalRemains <= 0) {
69
- this._lastReloadAt = new Date().getTime();
70
- reloadItems(this.pluginsRefs, { silentLoading, noVeil: true });
86
+ if (reloadIntervalRemains <= 0) {
87
+ this.startReloadItems();
71
88
  }
72
89
  this._timeout = setTimeout(() => this.reloadItems(), reloadIntervalRemains <= 0 ? autoupdateIntervalMs : reloadIntervalRemains);
73
90
  }
@@ -77,7 +94,7 @@ export default class GridLayout extends React.PureComponent {
77
94
  this.pluginsRefs.length = config.items.length;
78
95
  return (React.createElement(Layout, Object.assign({}, registerManager.gridLayout, { layout: layout, isDraggable: editMode, isResizable: editMode, onDragStart: this._onStart, onDragStop: this._onStop, onResizeStart: this._onStart, onResizeStop: this._onStop }, (draggableHandleClassName
79
96
  ? { draggableHandle: `.${draggableHandleClassName}` }
80
- : null)), config.items.map((item, i) => {
97
+ : null), { draggableCancel: `.${OVERLAY_CONTROLS_CLASS_NAME}` }), config.items.map((item, i) => {
81
98
  return (React.createElement(GridItem, { forwardedPluginRef: (pluginRef) => {
82
99
  this.pluginsRefs[i] = pluginRef;
83
100
  }, key: item.id, id: item.id, item: item, layout: layout, adjustWidgetLayout: this.adjustWidgetLayout, isDragging: this.state.isDragging, noOverlay: noOverlay, withCustomHandle: Boolean(draggableHandleClassName), overlayControls: this.props.overlayControls }));
@@ -3,13 +3,13 @@ import i18n from '../../i18n';
3
3
  import noop from 'lodash/noop';
4
4
  import { DashKitContext } from '../../context/DashKitContext';
5
5
  import { Icon, DropdownMenu, Button, } from '@gravity-ui/uikit';
6
- import { COPIED_WIDGET_STORE_KEY, MenuItems } from '../../constants';
6
+ import { COPIED_WIDGET_STORE_KEY, OVERLAY_CONTROLS_CLASS_NAME, MenuItems } from '../../constants';
7
7
  import { DotsIcon } from '../../icons/DotsIcon';
8
8
  import { CogIcon } from '../../icons/CogIcon';
9
9
  import { CloseIcon } from '../../icons/CloseIcon';
10
10
  import { cn } from '../../utils/cn';
11
11
  import './OverlayControls.css';
12
- const b = cn('dashkit-overlay-controls');
12
+ const b = cn(OVERLAY_CONTROLS_CLASS_NAME);
13
13
  export var OverlayControlsPosition;
14
14
  (function (OverlayControlsPosition) {
15
15
  OverlayControlsPosition["TopRight"] = "top_right";
@@ -1,5 +1,6 @@
1
1
  export declare const COPIED_WIDGET_STORE_KEY = "dashCopiedItem";
2
2
  export declare const DEFAULT_NAMESPACE = "default";
3
+ export declare const OVERLAY_CONTROLS_CLASS_NAME = "dashkit-overlay-controls";
3
4
  export declare const MenuItems: {
4
5
  readonly Copy: "copy";
5
6
  readonly Delete: "delete";
@@ -1,5 +1,6 @@
1
1
  export const COPIED_WIDGET_STORE_KEY = 'dashCopiedItem';
2
2
  export const DEFAULT_NAMESPACE = 'default';
3
+ export const OVERLAY_CONTROLS_CLASS_NAME = 'dashkit-overlay-controls';
3
4
  export const MenuItems = {
4
5
  Copy: 'copy',
5
6
  Delete: 'delete',
@@ -11,7 +11,6 @@ function useMemoStateContext(props) {
11
11
  // (высота) из конфига будет запоминаться в originalLayouts, новое значение высоты в adjustedLayouts
12
12
  const originalLayouts = React.useRef({});
13
13
  const adjustedLayouts = React.useRef({});
14
- const [filteredOverlayControls, setFilteredOverlayControls] = React.useState(props.overlayControls || []);
15
14
  // TODO: need move originalLayouts, adjustedLayouts to state
16
15
  const [layoutUpdateCounter, forceUpdateLayout] = React.useState(0);
17
16
  const onChange = React.useCallback(({ config = props.config, itemsStateAndParams = props.itemsStateAndParams }) => {
@@ -107,10 +106,6 @@ function useMemoStateContext(props) {
107
106
  })
108
107
  .filter(Boolean);
109
108
  }, []);
110
- const hideWidgetOverlayControl = React.useCallback((args) => {
111
- const newOverlayControls = props.overlayControls.allWidgetsControls.filter((item) => item.id !== args.controlId);
112
- setFilteredOverlayControls(Object.assign(Object.assign({}, props.overlayControls), { allWidgetsControls: newOverlayControls }));
113
- }, [props.overlayControls]);
114
109
  const resultLayout = React.useMemo(() => {
115
110
  return props.layout.map((item) => {
116
111
  if (item.i in adjustedLayouts.current) {
@@ -122,7 +117,8 @@ function useMemoStateContext(props) {
122
117
  });
123
118
  }, [props.layout, layoutUpdateCounter]);
124
119
  const reloadItems = React.useCallback((pluginsRefs, data) => {
125
- pluginsRefs.forEach((ref) => ref && ref.reload && ref.reload(data));
120
+ const promises = pluginsRefs.map((ref) => ref && ref.reload && ref.reload(data));
121
+ return Promise.all(promises);
126
122
  }, []);
127
123
  return React.useMemo(() => ({
128
124
  layout: resultLayout,
@@ -141,8 +137,6 @@ function useMemoStateContext(props) {
141
137
  editItem: props.onItemEdit,
142
138
  layoutChange: onLayoutChange,
143
139
  getItemsMeta,
144
- hideWidgetOverlayControl,
145
- filteredOverlayControls,
146
140
  reloadItems,
147
141
  memorizeOriginalLayout,
148
142
  revertToOriginalLayout,
@@ -164,8 +158,6 @@ function useMemoStateContext(props) {
164
158
  props.onItemEdit,
165
159
  onLayoutChange,
166
160
  getItemsMeta,
167
- hideWidgetOverlayControl,
168
- filteredOverlayControls,
169
161
  reloadItems,
170
162
  memorizeOriginalLayout,
171
163
  revertToOriginalLayout,
@@ -176,9 +168,8 @@ function useMemoStateContext(props) {
176
168
  export function withContext(Component) {
177
169
  const WithContext = (props) => {
178
170
  const contextValue = useMemoStateContext(props);
179
- const overlayControls = contextValue.filteredOverlayControls;
180
171
  return (React.createElement(DashKitContext.Provider, { value: contextValue },
181
- React.createElement(Component, { overlayControls: overlayControls })));
172
+ React.createElement(Component, { overlayControls: props.overlayControls })));
182
173
  };
183
174
  WithContext.displayName = `withContext(${Component.displayName || Component.name || 'Component'}`;
184
175
  return WithContext;
@@ -11,6 +11,7 @@ export type MenuItem = (typeof MenuItems)[keyof typeof MenuItems] | OverlayCusto
11
11
  export interface SettingsProps {
12
12
  autoupdateInterval: number;
13
13
  silentLoading: boolean;
14
+ realtimeMode?: boolean;
14
15
  }
15
16
  export interface ContextProps {
16
17
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "6.5.0-beta.1",
3
+ "version": "6.5.1-beta.0",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {