@gravity-ui/dashkit 6.7.2 → 7.0.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.
Files changed (88) hide show
  1. package/README.md +59 -16
  2. package/build/cjs/components/ActionPanel/ActionPanel.css +48 -6
  3. package/build/cjs/components/ActionPanel/ActionPanel.d.ts +3 -1
  4. package/build/cjs/components/ActionPanel/ActionPanel.js +12 -1
  5. package/build/cjs/components/DashKit/DashKit.d.ts +2 -2
  6. package/build/cjs/components/DashKit/DashKit.js +1 -1
  7. package/build/cjs/components/DashKitView/DashKitView.js +2 -2
  8. package/build/cjs/components/GridItem/GridItem.css +24 -15
  9. package/build/cjs/components/GridItem/GridItem.d.ts +1 -1
  10. package/build/cjs/components/GridItem/GridItem.js +1 -1
  11. package/build/cjs/components/GridLayout/GridLayout.d.ts +1 -1
  12. package/build/cjs/components/GridLayout/GridLayout.js +3 -3
  13. package/build/cjs/components/Item/Item.css +2 -8
  14. package/build/cjs/components/Item/Item.d.ts +1 -0
  15. package/build/cjs/components/MobileLayout/MobileLayout.d.ts +1 -1
  16. package/build/cjs/components/MobileLayout/MobileLayout.js +2 -2
  17. package/build/cjs/components/OverlayControls/OverlayControls.d.ts +2 -2
  18. package/build/cjs/components/OverlayControls/OverlayControls.js +14 -13
  19. package/build/cjs/context/DashKitContext.d.ts +1 -1
  20. package/build/cjs/hocs/prepareItem.d.ts +1 -0
  21. package/build/cjs/hocs/prepareItem.js +1 -1
  22. package/build/cjs/hocs/withContext.js +2 -2
  23. package/build/cjs/i18n/index.d.ts +1 -4
  24. package/build/cjs/i18n/index.js +2 -13
  25. package/build/cjs/plugins/Text/Text.d.ts +1 -1
  26. package/build/cjs/plugins/Text/Text.js +3 -3
  27. package/build/cjs/plugins/Title/Title.d.ts +1 -1
  28. package/build/cjs/shared/modules/helpers.d.ts +1 -1
  29. package/build/cjs/shared/modules/helpers.js +1 -1
  30. package/build/cjs/shared/modules/state-and-params.d.ts +1 -1
  31. package/build/cjs/shared/units/datalens/index.d.ts +1 -1
  32. package/build/cjs/shared/units/datalens/index.js +1 -1
  33. package/build/cjs/typings/common.d.ts +1 -1
  34. package/build/cjs/typings/plugin.d.ts +2 -2
  35. package/build/cjs/utils/index.d.ts +0 -1
  36. package/build/cjs/utils/index.js +0 -1
  37. package/build/cjs/utils/register-manager.d.ts +1 -1
  38. package/build/cjs/utils/update-manager.d.ts +2 -2
  39. package/build/cjs/utils/update-manager.js +4 -2
  40. package/build/esm/components/ActionPanel/ActionPanel.css +48 -6
  41. package/build/esm/components/ActionPanel/ActionPanel.d.ts +3 -1
  42. package/build/esm/components/ActionPanel/ActionPanel.js +12 -1
  43. package/build/esm/components/DashKit/DashKit.d.ts +2 -2
  44. package/build/esm/components/DashKit/DashKit.js +1 -1
  45. package/build/esm/components/DashKitView/DashKitView.js +2 -2
  46. package/build/esm/components/GridItem/GridItem.css +24 -15
  47. package/build/esm/components/GridItem/GridItem.d.ts +1 -1
  48. package/build/esm/components/GridItem/GridItem.js +2 -2
  49. package/build/esm/components/GridLayout/GridLayout.d.ts +1 -1
  50. package/build/esm/components/GridLayout/GridLayout.js +4 -3
  51. package/build/esm/components/Item/Item.css +2 -8
  52. package/build/esm/components/Item/Item.d.ts +1 -0
  53. package/build/esm/components/MobileLayout/MobileLayout.d.ts +1 -1
  54. package/build/esm/components/MobileLayout/MobileLayout.js +3 -2
  55. package/build/esm/components/OverlayControls/OverlayControls.d.ts +2 -2
  56. package/build/esm/components/OverlayControls/OverlayControls.js +6 -5
  57. package/build/esm/context/DashKitContext.d.ts +1 -1
  58. package/build/esm/hocs/prepareItem.d.ts +1 -0
  59. package/build/esm/hocs/prepareItem.js +1 -1
  60. package/build/esm/hocs/withContext.js +2 -2
  61. package/build/esm/i18n/index.d.ts +1 -4
  62. package/build/esm/i18n/index.js +2 -13
  63. package/build/esm/plugins/Text/Text.d.ts +1 -1
  64. package/build/esm/plugins/Text/Text.js +2 -2
  65. package/build/esm/plugins/Title/Title.d.ts +1 -1
  66. package/build/esm/shared/modules/__tests__/uniq-id.test.js +1 -1
  67. package/build/esm/shared/modules/helpers.d.ts +1 -1
  68. package/build/esm/shared/modules/helpers.js +2 -2
  69. package/build/esm/shared/modules/state-and-params.d.ts +1 -1
  70. package/build/esm/shared/modules/state-and-params.js +1 -1
  71. package/build/esm/shared/units/datalens/index.d.ts +1 -1
  72. package/build/esm/shared/units/datalens/index.js +1 -1
  73. package/build/esm/typings/common.d.ts +1 -1
  74. package/build/esm/typings/plugin.d.ts +2 -2
  75. package/build/esm/utils/index.d.ts +0 -1
  76. package/build/esm/utils/index.js +0 -1
  77. package/build/esm/utils/register-manager.d.ts +1 -1
  78. package/build/esm/utils/update-manager.d.ts +2 -2
  79. package/build/esm/utils/update-manager.js +4 -2
  80. package/package.json +25 -19
  81. package/build/cjs/utils/configure.d.ts +0 -9
  82. package/build/cjs/utils/configure.js +0 -21
  83. package/build/cjs/utils/i18n.d.ts +0 -7
  84. package/build/cjs/utils/i18n.js +0 -13
  85. package/build/esm/utils/configure.d.ts +0 -9
  86. package/build/esm/utils/configure.js +0 -15
  87. package/build/esm/utils/i18n.d.ts +0 -7
  88. package/build/esm/utils/i18n.js +0 -9
@@ -1,5 +1,5 @@
1
- import { Plugin, PluginDefaultLayout, Settings } from '../typings';
2
1
  import type { ReactGridLayoutProps } from 'react-grid-layout';
2
+ import { Plugin, PluginDefaultLayout, Settings } from '../typings';
3
3
  interface RegisterManagerDefaultLayout {
4
4
  x: number;
5
5
  y: number;
@@ -1,5 +1,5 @@
1
- import { Config, ConfigItem, ItemsStateAndParams, ItemStateAndParams, ItemStateAndParamsChangeOptions } from '../shared';
2
- import { AddConfigItem, WidgetLayout, SetItemOptions } from '../typings';
1
+ import { Config, ConfigItem, ItemStateAndParams, ItemStateAndParamsChangeOptions, ItemsStateAndParams } from '../shared';
2
+ import { AddConfigItem, SetItemOptions, WidgetLayout } from '../typings';
3
3
  import { RegisterManagerPluginLayout } from './register-manager';
4
4
  interface RemoveItemArg {
5
5
  id: string;
@@ -1,8 +1,8 @@
1
1
  import update, { extend } from 'immutability-helper';
2
2
  import omit from 'lodash/omit';
3
3
  import pick from 'lodash/pick';
4
- import { mergeParamsWithAliases, isItemWithTabs, getCurrentVersion, META_KEY, deleteFromQueue, addToQueue, getInitialItemsStateAndParamsMeta, resolveItemInnerId, getItemsStateAndParamsMeta, pickActionParamsFromParams, transformParamsToActionParams, } from '../shared';
5
4
  import { DEFAULT_NAMESPACE } from '../constants';
5
+ import { META_KEY, addToQueue, deleteFromQueue, getCurrentVersion, getInitialItemsStateAndParamsMeta, getItemsStateAndParamsMeta, isItemWithTabs, mergeParamsWithAliases, pickActionParamsFromParams, resolveItemInnerId, transformParamsToActionParams, } from '../shared';
6
6
  import { getNewId } from './get-new-id';
7
7
  extend('$auto', (value, object) => (object ? update(object, value) : update({}, value)));
8
8
  function removeItemVersion1({ id, config, itemsStateAndParams }) {
@@ -30,7 +30,9 @@ function removeItemVersion1({ id, config, itemsStateAndParams }) {
30
30
  const item = config.items.find((configItem) => configItem.id === key);
31
31
  if (params && item) {
32
32
  const { namespace } = item;
33
- const currentUniqParamsKeys = namespace === removeItem.namespace ? uniqNamespaceParamsKeys : uniqParamsKeys;
33
+ const currentUniqParamsKeys = namespace === removeItem.namespace
34
+ ? uniqNamespaceParamsKeys
35
+ : uniqParamsKeys;
34
36
  const resultParams = omit(params, currentUniqParamsKeys);
35
37
  if (Object.keys(params).length !== Object.keys(resultParams).length) {
36
38
  acc[key] = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/dashkit",
3
- "version": "6.7.2",
3
+ "version": "7.0.0",
4
4
  "description": "Library for rendering dashboard grid layout",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,9 +21,12 @@
21
21
  "module": "build/esm/index.js",
22
22
  "types": "build/esm/index.d.ts",
23
23
  "scripts": {
24
- "lint:prettier": "prettier --check --loglevel=error '**/*.{js,jsx,ts,tsx,scss}'",
24
+ "lint:prettier": "prettier --check --log-level=error '**/*.{js,jsx,ts,tsx,scss}'",
25
+ "lint:prettier:fix": "prettier --write '**/*.md'",
25
26
  "lint:js": "eslint src --ext .js,.jsx,.ts,.tsx",
27
+ "lint:js:fix": "npm run lint:js -- --fix",
26
28
  "lint:styles": "stylelint 'src/**/*.scss'",
29
+ "lint:styles:fix": "npm run lint:styles -- --fix",
27
30
  "lint": "run-p lint:*",
28
31
  "test": "jest",
29
32
  "clean": "gulp clean",
@@ -35,31 +38,33 @@
35
38
  "prepublishOnly": "npm run lint && npm run test && npm run build"
36
39
  },
37
40
  "dependencies": {
38
- "@gravity-ui/i18n": "^1.0.0",
41
+ "@gravity-ui/icons": "^2.8.1",
39
42
  "hashids": "^2.2.8",
40
43
  "immutability-helper": "^3.1.1",
41
- "react-grid-layout": "^1.3.4"
44
+ "prop-types": "^15.8.1",
45
+ "react-grid-layout": "^1.3.4",
46
+ "react-transition-group": "^4.4.5"
42
47
  },
43
48
  "peerDependencies": {
44
49
  "@bem-react/classname": "^1.6.0",
45
- "@gravity-ui/uikit": "^5.0.0",
50
+ "@gravity-ui/uikit": "^6.0.0",
46
51
  "react": "^16.8.0 || ^17 || ^18"
47
52
  },
48
53
  "devDependencies": {
49
54
  "@bem-react/classname": "^1.6.0",
50
55
  "@commitlint/cli": "^17.0.3",
51
56
  "@commitlint/config-conventional": "^17.0.3",
52
- "@gravity-ui/eslint-config": "^1.0.2",
53
- "@gravity-ui/prettier-config": "^1.0.1",
54
- "@gravity-ui/stylelint-config": "^1.0.1",
57
+ "@gravity-ui/eslint-config": "^3.1.1",
58
+ "@gravity-ui/prettier-config": "^1.1.0",
59
+ "@gravity-ui/stylelint-config": "^4.0.1",
55
60
  "@gravity-ui/tsconfig": "^1.0.0",
56
- "@gravity-ui/uikit": "^5.9.0",
57
- "@storybook/addon-essentials": "^7.0.18",
61
+ "@gravity-ui/uikit": "^6.0.0",
62
+ "@storybook/addon-essentials": "^7.6.15",
58
63
  "@storybook/addon-knobs": "^7.0.2",
59
- "@storybook/cli": "^7.0.18",
64
+ "@storybook/cli": "^7.6.15",
60
65
  "@storybook/preset-scss": "^1.0.3",
61
- "@storybook/react": "^7.0.18",
62
- "@storybook/react-webpack5": "^7.0.18",
66
+ "@storybook/react": "^7.6.15",
67
+ "@storybook/react-webpack5": "^7.6.15",
63
68
  "@types/enzyme": "^3.10.8",
64
69
  "@types/jest": "^26.0.20",
65
70
  "@types/lodash": "^4.14.170",
@@ -70,18 +75,18 @@
70
75
  "enzyme": "^3.11.0",
71
76
  "enzyme-adapter-react-16": "^1.15.6",
72
77
  "enzyme-to-json": "^3.6.1",
73
- "eslint": "^8.11.0",
78
+ "eslint": "^8.56.0",
74
79
  "gulp": "^4.0.2",
75
80
  "gulp-cli": "^2.3.0",
76
81
  "gulp-dart-sass": "^1.0.2",
77
82
  "gulp-replace": "^1.1.3",
78
83
  "gulp-typescript": "^6.0.0-alpha.1",
79
- "husky": "^8.0.1",
84
+ "husky": "^9.0.11",
80
85
  "jest": "^26.6.3",
81
86
  "lint-staged": "^13.0.3",
82
87
  "npm-run-all": "^4.1.5",
83
88
  "postcss": "^8.4.12",
84
- "prettier": "^2.6.0",
89
+ "prettier": "^3.2.5",
85
90
  "react": "^18.2.0",
86
91
  "react-docgen-typescript": "^2.2.2",
87
92
  "react-dom": "^18.2.0",
@@ -89,12 +94,13 @@
89
94
  "sass": "^1.53.0",
90
95
  "sass-loader": "^10.3.1",
91
96
  "source-map": "^0.7.4",
92
- "storybook": "^7.0.18",
97
+ "storybook": "^7.6.15",
93
98
  "style-loader": "^3.3.3",
94
- "stylelint": "^14.6.0",
99
+ "stylelint": "^15.11.0",
95
100
  "terser-webpack-plugin": "^4.2.3",
96
101
  "ts-jest": "^26.5.3",
97
- "typescript": "^4.9.5"
102
+ "ts-node": "^10.9.2",
103
+ "typescript": "^5.3.3"
98
104
  },
99
105
  "husky": {
100
106
  "hooks": {
@@ -1,9 +0,0 @@
1
- export type Lang = 'ru' | 'en';
2
- interface Config {
3
- lang?: Lang;
4
- }
5
- type Subscriber = (config: Config) => void;
6
- export declare const configure: (newConfig: Config) => void;
7
- export declare const subscribeConfigure: (sub: Subscriber) => () => void;
8
- export declare const getConfig: () => Config;
9
- export {};
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfig = exports.subscribeConfigure = exports.configure = void 0;
4
- let subs = [];
5
- const config = {};
6
- const configure = (newConfig) => {
7
- Object.assign(config, newConfig);
8
- subs.forEach((sub) => {
9
- sub(config);
10
- });
11
- };
12
- exports.configure = configure;
13
- const subscribeConfigure = (sub) => {
14
- subs.push(sub);
15
- return () => {
16
- subs = subs.filter((item) => item !== sub);
17
- };
18
- };
19
- exports.subscribeConfigure = subscribeConfigure;
20
- const getConfig = () => config;
21
- exports.getConfig = getConfig;
@@ -1,7 +0,0 @@
1
- import { Lang } from './configure';
2
- /**
3
- * Preferred method to set language.
4
- * @param lang
5
- * @return {void}
6
- */
7
- export declare const setLang: (lang: Lang) => void;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setLang = void 0;
4
- const configure_1 = require("./configure");
5
- /**
6
- * Preferred method to set language.
7
- * @param lang
8
- * @return {void}
9
- */
10
- const setLang = (lang) => {
11
- (0, configure_1.configure)({ lang: lang });
12
- };
13
- exports.setLang = setLang;
@@ -1,9 +0,0 @@
1
- export type Lang = 'ru' | 'en';
2
- interface Config {
3
- lang?: Lang;
4
- }
5
- type Subscriber = (config: Config) => void;
6
- export declare const configure: (newConfig: Config) => void;
7
- export declare const subscribeConfigure: (sub: Subscriber) => () => void;
8
- export declare const getConfig: () => Config;
9
- export {};
@@ -1,15 +0,0 @@
1
- let subs = [];
2
- const config = {};
3
- export const configure = (newConfig) => {
4
- Object.assign(config, newConfig);
5
- subs.forEach((sub) => {
6
- sub(config);
7
- });
8
- };
9
- export const subscribeConfigure = (sub) => {
10
- subs.push(sub);
11
- return () => {
12
- subs = subs.filter((item) => item !== sub);
13
- };
14
- };
15
- export const getConfig = () => config;
@@ -1,7 +0,0 @@
1
- import { Lang } from './configure';
2
- /**
3
- * Preferred method to set language.
4
- * @param lang
5
- * @return {void}
6
- */
7
- export declare const setLang: (lang: Lang) => void;
@@ -1,9 +0,0 @@
1
- import { configure } from './configure';
2
- /**
3
- * Preferred method to set language.
4
- * @param lang
5
- * @return {void}
6
- */
7
- export const setLang = (lang) => {
8
- configure({ lang: lang });
9
- };