@gravity-ui/dashkit 6.6.0 → 6.6.1-beta-v.marginy.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.
@@ -38,6 +38,14 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
38
38
  items?: OverlayControlItem[];
39
39
  overlayControls?: Record<string, OverlayControlItem[]>;
40
40
  }
41
+ type PreparedCopyItemOptionsArg = Pick<ConfigItem, 'data' | 'type' | 'defaults' | 'namespace'> & {
42
+ timestamp: number;
43
+ layout: {
44
+ w: number;
45
+ h: number;
46
+ };
47
+ };
48
+ export type PreparedCopyItemOptions = PreparedCopyItemOptionsArg;
41
49
  type DashKitCtx = React.Context<{
42
50
  context: Record<string, any>;
43
51
  registerManager: RegisterManager;
@@ -1,3 +1,3 @@
1
1
  export * from './DashKit';
2
- export type { OverlayControlItem } from './OverlayControls/OverlayControls';
2
+ export type { OverlayControlItem, PreparedCopyItemOptions } from './OverlayControls/OverlayControls';
3
3
  export * from './ActionPanel/ActionPanel';
@@ -262,7 +262,12 @@ class UpdateManager {
262
262
  let commandUpdateParams = ((_b = itemsStateAndParams[initiatorId]) === null || _b === void 0 ? void 0 : _b.params)
263
263
  ? '$merge'
264
264
  : '$set';
265
- if (isTabSwitched) {
265
+ const initialedStateAndParams = initiatorId in itemsStateAndParams &&
266
+ itemsStateAndParams[initiatorId];
267
+ const needResetCurrentAP = initialedStateAndParams &&
268
+ Object.keys((0, shared_1.pickActionParamsFromParams)(initialedStateAndParams.params)).length &&
269
+ !Object.keys(allowableActionParams).length;
270
+ if (isTabSwitched || needResetCurrentAP) {
266
271
  commandUpdateParams = '$set';
267
272
  }
268
273
  const obj = {
@@ -39,6 +39,14 @@ interface OverlayControlsProps extends OverlayControlsDefaultProps {
39
39
  items?: OverlayControlItem[];
40
40
  overlayControls?: Record<string, OverlayControlItem[]>;
41
41
  }
42
+ type PreparedCopyItemOptionsArg = Pick<ConfigItem, 'data' | 'type' | 'defaults' | 'namespace'> & {
43
+ timestamp: number;
44
+ layout: {
45
+ w: number;
46
+ h: number;
47
+ };
48
+ };
49
+ export type PreparedCopyItemOptions = PreparedCopyItemOptionsArg;
42
50
  type DashKitCtx = React.Context<{
43
51
  context: Record<string, any>;
44
52
  registerManager: RegisterManager;
@@ -1,3 +1,3 @@
1
1
  export * from './DashKit';
2
- export type { OverlayControlItem } from './OverlayControls/OverlayControls';
2
+ export type { OverlayControlItem, PreparedCopyItemOptions } from './OverlayControls/OverlayControls';
3
3
  export * from './ActionPanel/ActionPanel';
@@ -258,7 +258,12 @@ export class UpdateManager {
258
258
  let commandUpdateParams = ((_b = itemsStateAndParams[initiatorId]) === null || _b === void 0 ? void 0 : _b.params)
259
259
  ? '$merge'
260
260
  : '$set';
261
- if (isTabSwitched) {
261
+ const initialedStateAndParams = initiatorId in itemsStateAndParams &&
262
+ itemsStateAndParams[initiatorId];
263
+ const needResetCurrentAP = initialedStateAndParams &&
264
+ Object.keys(pickActionParamsFromParams(initialedStateAndParams.params)).length &&
265
+ !Object.keys(allowableActionParams).length;
266
+ if (isTabSwitched || needResetCurrentAP) {
262
267
  commandUpdateParams = '$set';
263
268
  }
264
269
  const obj = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "6.6.0",
3
+ "version": "6.6.1-beta-v.marginy.0",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {