@gravity-ui/dashkit 6.8.0 → 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.
- package/README.md +21 -35
- package/build/cjs/components/DashKit/DashKit.d.ts +2 -2
- package/build/cjs/components/DashKit/DashKit.js +1 -1
- package/build/cjs/components/DashKitView/DashKitView.js +2 -2
- package/build/cjs/components/GridItem/GridItem.css +2 -8
- package/build/cjs/components/GridItem/GridItem.d.ts +1 -1
- package/build/cjs/components/GridItem/GridItem.js +1 -1
- package/build/cjs/components/GridLayout/GridLayout.d.ts +1 -1
- package/build/cjs/components/GridLayout/GridLayout.js +3 -3
- package/build/cjs/components/Item/Item.css +2 -8
- package/build/cjs/components/Item/Item.d.ts +1 -0
- package/build/cjs/components/MobileLayout/MobileLayout.d.ts +1 -1
- package/build/cjs/components/MobileLayout/MobileLayout.js +2 -2
- package/build/cjs/components/OverlayControls/OverlayControls.d.ts +2 -2
- package/build/cjs/components/OverlayControls/OverlayControls.js +14 -13
- package/build/cjs/context/DashKitContext.d.ts +1 -1
- package/build/cjs/hocs/prepareItem.d.ts +1 -0
- package/build/cjs/hocs/prepareItem.js +1 -1
- package/build/cjs/hocs/withContext.js +2 -2
- package/build/cjs/i18n/index.d.ts +1 -4
- package/build/cjs/i18n/index.js +2 -13
- package/build/cjs/plugins/Text/Text.d.ts +1 -1
- package/build/cjs/plugins/Text/Text.js +3 -3
- package/build/cjs/plugins/Title/Title.d.ts +1 -1
- package/build/cjs/shared/modules/helpers.d.ts +1 -1
- package/build/cjs/shared/modules/helpers.js +1 -1
- package/build/cjs/shared/modules/state-and-params.d.ts +1 -1
- package/build/cjs/shared/units/datalens/index.d.ts +1 -1
- package/build/cjs/shared/units/datalens/index.js +1 -1
- package/build/cjs/typings/common.d.ts +1 -1
- package/build/cjs/typings/plugin.d.ts +2 -2
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +0 -1
- package/build/cjs/utils/register-manager.d.ts +1 -1
- package/build/cjs/utils/update-manager.d.ts +2 -2
- package/build/cjs/utils/update-manager.js +4 -2
- package/build/esm/components/DashKit/DashKit.d.ts +2 -2
- package/build/esm/components/DashKit/DashKit.js +1 -1
- package/build/esm/components/DashKitView/DashKitView.js +2 -2
- package/build/esm/components/GridItem/GridItem.css +2 -8
- package/build/esm/components/GridItem/GridItem.d.ts +1 -1
- package/build/esm/components/GridItem/GridItem.js +2 -2
- package/build/esm/components/GridLayout/GridLayout.d.ts +1 -1
- package/build/esm/components/GridLayout/GridLayout.js +4 -3
- package/build/esm/components/Item/Item.css +2 -8
- package/build/esm/components/Item/Item.d.ts +1 -0
- package/build/esm/components/MobileLayout/MobileLayout.d.ts +1 -1
- package/build/esm/components/MobileLayout/MobileLayout.js +3 -2
- package/build/esm/components/OverlayControls/OverlayControls.d.ts +2 -2
- package/build/esm/components/OverlayControls/OverlayControls.js +6 -5
- package/build/esm/context/DashKitContext.d.ts +1 -1
- package/build/esm/hocs/prepareItem.d.ts +1 -0
- package/build/esm/hocs/prepareItem.js +1 -1
- package/build/esm/hocs/withContext.js +2 -2
- package/build/esm/i18n/index.d.ts +1 -4
- package/build/esm/i18n/index.js +2 -13
- package/build/esm/plugins/Text/Text.d.ts +1 -1
- package/build/esm/plugins/Text/Text.js +2 -2
- package/build/esm/plugins/Title/Title.d.ts +1 -1
- package/build/esm/shared/modules/__tests__/uniq-id.test.js +1 -1
- package/build/esm/shared/modules/helpers.d.ts +1 -1
- package/build/esm/shared/modules/helpers.js +2 -2
- package/build/esm/shared/modules/state-and-params.d.ts +1 -1
- package/build/esm/shared/modules/state-and-params.js +1 -1
- package/build/esm/shared/units/datalens/index.d.ts +1 -1
- package/build/esm/shared/units/datalens/index.js +1 -1
- package/build/esm/typings/common.d.ts +1 -1
- package/build/esm/typings/plugin.d.ts +2 -2
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
- package/build/esm/utils/register-manager.d.ts +1 -1
- package/build/esm/utils/update-manager.d.ts +2 -2
- package/build/esm/utils/update-manager.js +4 -2
- package/package.json +23 -18
- package/build/cjs/utils/configure.d.ts +0 -9
- package/build/cjs/utils/configure.js +0 -21
- package/build/cjs/utils/i18n.d.ts +0 -7
- package/build/cjs/utils/i18n.js +0 -13
- package/build/esm/utils/configure.d.ts +0 -9
- package/build/esm/utils/configure.js +0 -15
- package/build/esm/utils/i18n.d.ts +0 -7
- package/build/esm/utils/i18n.js +0 -9
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
3px
|
|
11
11
|
);
|
|
12
12
|
position: absolute;
|
|
13
|
-
|
|
14
|
-
bottom: 0;
|
|
15
|
-
left: 0;
|
|
16
|
-
right: 0;
|
|
13
|
+
inset: 0;
|
|
17
14
|
border-radius: var(--_-dashkit-overlay-border-radius);
|
|
18
15
|
background-color: var(--_-dashkit-overlay-color);
|
|
19
16
|
border: solid 1px var(--_-dashkit-overlay-border-color);
|
|
@@ -26,10 +23,7 @@
|
|
|
26
23
|
);
|
|
27
24
|
--_-dashkit-grid-item-edit-opacity: var(--dashkit-grid-item-edit-opacity, 0.5);
|
|
28
25
|
position: absolute;
|
|
29
|
-
|
|
30
|
-
bottom: 0;
|
|
31
|
-
left: 0;
|
|
32
|
-
right: 0;
|
|
26
|
+
inset: 0;
|
|
33
27
|
border-radius: var(--_-dashkit-grid-item-border-radius);
|
|
34
28
|
}
|
|
35
29
|
.dashkit-grid-item__item_editMode {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import Item from '../Item/Item';
|
|
4
3
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
4
|
import { cn } from '../../utils/cn';
|
|
6
|
-
import '
|
|
5
|
+
import Item from '../Item/Item';
|
|
7
6
|
import OverlayControls from '../OverlayControls/OverlayControls';
|
|
7
|
+
import './GridItem.css';
|
|
8
8
|
const b = cn('dashkit-grid-item');
|
|
9
9
|
class GridItem extends React.PureComponent {
|
|
10
10
|
renderOverlay() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactGridLayout, { WidthProvider } from 'react-grid-layout';
|
|
3
|
-
import GridItem from '../GridItem/GridItem';
|
|
4
|
-
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
3
|
import { OVERLAY_CONTROLS_CLASS_NAME } from '../../constants';
|
|
4
|
+
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
|
+
import GridItem from '../GridItem/GridItem';
|
|
6
6
|
const Layout = WidthProvider(ReactGridLayout); // eslint-disable-line new-cap
|
|
7
|
-
|
|
7
|
+
class GridLayout extends React.PureComponent {
|
|
8
8
|
constructor(props, context) {
|
|
9
9
|
super(props, context);
|
|
10
10
|
this.onVisibilityChange = () => {
|
|
@@ -81,3 +81,4 @@ export default class GridLayout extends React.PureComponent {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
GridLayout.contextType = DashKitContext;
|
|
84
|
+
export default GridLayout;
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
.dashkit-item__renderer {
|
|
2
2
|
position: absolute;
|
|
3
|
-
|
|
4
|
-
bottom: 0;
|
|
5
|
-
left: 0;
|
|
6
|
-
right: 0;
|
|
3
|
+
inset: 0;
|
|
7
4
|
}
|
|
8
5
|
.dashkit-item__loader {
|
|
9
6
|
position: absolute;
|
|
10
|
-
|
|
11
|
-
bottom: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
right: 0;
|
|
7
|
+
inset: 0;
|
|
14
8
|
display: flex;
|
|
15
9
|
align-items: center;
|
|
16
10
|
justify-content: center;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Item from '../Item/Item';
|
|
3
2
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
4
3
|
import { cn } from '../../utils/cn';
|
|
4
|
+
import Item from '../Item/Item';
|
|
5
5
|
import { getSortedConfigItems } from './helpers';
|
|
6
6
|
import './MobileLayout.css';
|
|
7
7
|
const b = cn('dashkit-mobile-layout');
|
|
8
|
-
|
|
8
|
+
class MobileLayout extends React.PureComponent {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
11
|
this.pluginsRefs = [];
|
|
@@ -49,3 +49,4 @@ export default class MobileLayout extends React.PureComponent {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
MobileLayout.contextType = DashKitContext;
|
|
52
|
+
export default MobileLayout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ButtonSize, ButtonView, IconProps, MenuItemProps } from '@gravity-ui/uikit';
|
|
3
|
+
import { Config, ConfigItem, ItemState, PluginBase, StringParams } from '../../shared';
|
|
4
4
|
import type { RegisterManager } from '../../utils/register-manager';
|
|
5
5
|
import './OverlayControls.css';
|
|
6
6
|
export declare enum OverlayControlsPosition {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Button, DropdownMenu, Icon, } from '@gravity-ui/uikit';
|
|
3
3
|
import noop from 'lodash/noop';
|
|
4
|
+
import { COPIED_WIDGET_STORE_KEY, MenuItems, OVERLAY_CONTROLS_CLASS_NAME } from '../../constants';
|
|
4
5
|
import { DashKitContext } from '../../context/DashKitContext';
|
|
5
|
-
import {
|
|
6
|
-
import { COPIED_WIDGET_STORE_KEY, OVERLAY_CONTROLS_CLASS_NAME, MenuItems } from '../../constants';
|
|
7
|
-
import { DotsIcon } from '../../icons/DotsIcon';
|
|
8
|
-
import { CogIcon } from '../../icons/CogIcon';
|
|
6
|
+
import { i18n } from '../../i18n';
|
|
9
7
|
import { CloseIcon } from '../../icons/CloseIcon';
|
|
8
|
+
import { CogIcon } from '../../icons/CogIcon';
|
|
9
|
+
import { DotsIcon } from '../../icons/DotsIcon';
|
|
10
10
|
import { cn } from '../../utils/cn';
|
|
11
11
|
import './OverlayControls.css';
|
|
12
12
|
const b = cn(OVERLAY_CONTROLS_CLASS_NAME);
|
|
@@ -171,6 +171,7 @@ class OverlayControls extends React.Component {
|
|
|
171
171
|
? () => itemHandler(configItem, itemParams, itemState)
|
|
172
172
|
: ((_a = this.getDropDownMenuItemConfig(item.id)) === null || _a === void 0 ? void 0 : _a.action) || (() => { });
|
|
173
173
|
return {
|
|
174
|
+
// @ts-expect-error
|
|
174
175
|
text: item.title || i18n(item.id),
|
|
175
176
|
icon: item.icon,
|
|
176
177
|
action: itemAction,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const DashKitContext: React.Context<any>;
|
|
2
|
-
import React from
|
|
2
|
+
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DashKitContext } from '../context/DashKitContext';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { DashKitContext } from '../context/DashKitContext';
|
|
4
4
|
export function prepareItem(Component) {
|
|
5
5
|
var _a;
|
|
6
6
|
return _a = class PrepareItem extends React.Component {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
2
3
|
import { DashKitContext } from '../context/DashKitContext';
|
|
3
|
-
import { UpdateManager } from '../utils';
|
|
4
4
|
import { getItemsParams, getItemsState } from '../shared';
|
|
5
|
-
import
|
|
5
|
+
import { UpdateManager } from '../utils';
|
|
6
6
|
function useMemoStateContext(props) {
|
|
7
7
|
// так как мы не хотим хранить параметры виджета с активированной автовысотой в сторе и на сервере, актуальный
|
|
8
8
|
// (видимый юзером в конкретный момент времени) лэйаут (массив объектов с данными о ширине, высоте,
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const i18n: I18N;
|
|
3
|
-
declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
4
|
-
export default _default;
|
|
1
|
+
export declare const i18n: (key: "button_retry" | "label_render-markdown-error" | "label_settings" | "label_copy" | "label_delete" | "label_error", params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
package/build/esm/i18n/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getConfig, subscribeConfigure } from '../utils/configure';
|
|
1
|
+
import { addComponentKeysets } from '@gravity-ui/uikit/i18n';
|
|
3
2
|
import en from './en.json';
|
|
4
3
|
import ru from './ru.json';
|
|
5
|
-
export const i18n =
|
|
6
|
-
const COMPONENT = 'dashkit';
|
|
7
|
-
i18n.registerKeyset('en', COMPONENT, en);
|
|
8
|
-
i18n.registerKeyset('ru', COMPONENT, ru);
|
|
9
|
-
i18n.setLang(getConfig().lang || 'en');
|
|
10
|
-
subscribeConfigure((config) => {
|
|
11
|
-
if (config.lang) {
|
|
12
|
-
i18n.setLang(config.lang);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
export default i18n.keyset(COMPONENT);
|
|
4
|
+
export const i18n = addComponentKeysets({ en, ru }, 'dashkit');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import i18n from '../../i18n';
|
|
2
|
+
import { Button, Loader } from '@gravity-ui/uikit';
|
|
3
|
+
import { i18n } from '../../i18n';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
5
|
import './Text.css';
|
|
6
6
|
// need to set markdown styles separately
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config, ConfigAliases, ConfigConnection, ConfigItem, ConfigItemWithTabs, ItemStateAndParams, ItemsStateAndParams, PluginBase, StateAndParamsMetaData, StringParams } from '../types';
|
|
2
2
|
export declare function prerenderItems({ items, plugins, }: {
|
|
3
3
|
items: ConfigItem[];
|
|
4
4
|
plugins: PluginBase[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import keyBy from 'lodash/keyBy';
|
|
2
1
|
import get from 'lodash/get';
|
|
3
2
|
import invert from 'lodash/invert';
|
|
4
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
|
+
import keyBy from 'lodash/keyBy';
|
|
5
5
|
import pick from 'lodash/pick';
|
|
6
|
-
import {
|
|
6
|
+
import { ACTION_PARAM_PREFIX, CURRENT_VERSION, META_KEY } from '../constants';
|
|
7
7
|
function getNormalizedPlugins(plugins) {
|
|
8
8
|
return keyBy(plugins, 'type');
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalParams,
|
|
1
|
+
import { Config, GlobalParams, ItemState, ItemsStateAndParams, PluginBase, StringParams } from '../types';
|
|
2
2
|
export interface GetItemsParamsArg {
|
|
3
3
|
defaultGlobalParams: GlobalParams;
|
|
4
4
|
globalParams: GlobalParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import groupBy from 'lodash/groupBy';
|
|
2
2
|
import { META_KEY } from '../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { formQueueData, getCurrentVersion, getMapItemsIgnores, hasActionParam, isItemWithTabs, mergeParamsWithAliases, pickActionParamsFromParams, pickExceptActionParamsFromParams, prerenderItems, resolveItemInnerId, } from './helpers';
|
|
4
4
|
export function getItemsParams({ defaultGlobalParams = {}, globalParams = {}, config, itemsStateAndParams, plugins, }) {
|
|
5
5
|
const { aliases, connections } = config;
|
|
6
6
|
const items = prerenderItems({ items: config.items, plugins });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetItemsParamsArg } from '../../modules';
|
|
2
|
-
import {
|
|
2
|
+
import { ItemsStateAndParamsBase, PluginBase } from '../../types';
|
|
3
3
|
export declare const pluginControlBaseDL: PluginBase;
|
|
4
4
|
export declare const pluginWidgetBaseDL: PluginBase;
|
|
5
5
|
export declare function getItemsStateAndParamsDL(data: Omit<GetItemsParamsArg, 'plugins'>): ItemsStateAndParamsBase;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ReactGridLayoutProps } from 'react-grid-layout';
|
|
1
2
|
import { OverlayCustomControlItem } from '../components/OverlayControls/OverlayControls';
|
|
2
3
|
import { MenuItems } from '../constants';
|
|
3
|
-
import type { ReactGridLayoutProps } from 'react-grid-layout';
|
|
4
4
|
export interface Settings {
|
|
5
5
|
gridLayout?: ReactGridLayoutProps;
|
|
6
6
|
theme?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ContextProps, SettingsProps, WidgetLayout } from './common';
|
|
3
|
-
import { StringParams, ConfigItem, ItemState, ItemStateAndParams, PluginBase, ItemStateAndParamsChangeOptions } from '../shared';
|
|
4
2
|
import type { ReactGridLayoutProps } from 'react-grid-layout';
|
|
3
|
+
import { ConfigItem, ItemState, ItemStateAndParams, ItemStateAndParamsChangeOptions, PluginBase, StringParams } from '../shared';
|
|
4
|
+
import { ContextProps, SettingsProps, WidgetLayout } from './common';
|
|
5
5
|
export interface PluginWidgetProps {
|
|
6
6
|
id: string;
|
|
7
7
|
editMode: boolean;
|
package/build/esm/utils/index.js
CHANGED
|
@@ -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,
|
|
2
|
-
import { AddConfigItem,
|
|
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
|
|
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": "
|
|
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 --
|
|
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,32 +38,33 @@
|
|
|
35
38
|
"prepublishOnly": "npm run lint && npm run test && npm run build"
|
|
36
39
|
},
|
|
37
40
|
"dependencies": {
|
|
38
|
-
"@gravity-ui/
|
|
41
|
+
"@gravity-ui/icons": "^2.8.1",
|
|
39
42
|
"hashids": "^2.2.8",
|
|
40
43
|
"immutability-helper": "^3.1.1",
|
|
44
|
+
"prop-types": "^15.8.1",
|
|
41
45
|
"react-grid-layout": "^1.3.4",
|
|
42
46
|
"react-transition-group": "^4.4.5"
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
45
49
|
"@bem-react/classname": "^1.6.0",
|
|
46
|
-
"@gravity-ui/uikit": "^
|
|
50
|
+
"@gravity-ui/uikit": "^6.0.0",
|
|
47
51
|
"react": "^16.8.0 || ^17 || ^18"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@bem-react/classname": "^1.6.0",
|
|
51
55
|
"@commitlint/cli": "^17.0.3",
|
|
52
56
|
"@commitlint/config-conventional": "^17.0.3",
|
|
53
|
-
"@gravity-ui/eslint-config": "^1.
|
|
54
|
-
"@gravity-ui/prettier-config": "^1.0
|
|
55
|
-
"@gravity-ui/stylelint-config": "^
|
|
57
|
+
"@gravity-ui/eslint-config": "^3.1.1",
|
|
58
|
+
"@gravity-ui/prettier-config": "^1.1.0",
|
|
59
|
+
"@gravity-ui/stylelint-config": "^4.0.1",
|
|
56
60
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
57
|
-
"@gravity-ui/uikit": "^
|
|
58
|
-
"@storybook/addon-essentials": "^7.
|
|
61
|
+
"@gravity-ui/uikit": "^6.0.0",
|
|
62
|
+
"@storybook/addon-essentials": "^7.6.15",
|
|
59
63
|
"@storybook/addon-knobs": "^7.0.2",
|
|
60
|
-
"@storybook/cli": "^7.
|
|
64
|
+
"@storybook/cli": "^7.6.15",
|
|
61
65
|
"@storybook/preset-scss": "^1.0.3",
|
|
62
|
-
"@storybook/react": "^7.
|
|
63
|
-
"@storybook/react-webpack5": "^7.
|
|
66
|
+
"@storybook/react": "^7.6.15",
|
|
67
|
+
"@storybook/react-webpack5": "^7.6.15",
|
|
64
68
|
"@types/enzyme": "^3.10.8",
|
|
65
69
|
"@types/jest": "^26.0.20",
|
|
66
70
|
"@types/lodash": "^4.14.170",
|
|
@@ -71,18 +75,18 @@
|
|
|
71
75
|
"enzyme": "^3.11.0",
|
|
72
76
|
"enzyme-adapter-react-16": "^1.15.6",
|
|
73
77
|
"enzyme-to-json": "^3.6.1",
|
|
74
|
-
"eslint": "^8.
|
|
78
|
+
"eslint": "^8.56.0",
|
|
75
79
|
"gulp": "^4.0.2",
|
|
76
80
|
"gulp-cli": "^2.3.0",
|
|
77
81
|
"gulp-dart-sass": "^1.0.2",
|
|
78
82
|
"gulp-replace": "^1.1.3",
|
|
79
83
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
80
|
-
"husky": "^
|
|
84
|
+
"husky": "^9.0.11",
|
|
81
85
|
"jest": "^26.6.3",
|
|
82
86
|
"lint-staged": "^13.0.3",
|
|
83
87
|
"npm-run-all": "^4.1.5",
|
|
84
88
|
"postcss": "^8.4.12",
|
|
85
|
-
"prettier": "^2.
|
|
89
|
+
"prettier": "^3.2.5",
|
|
86
90
|
"react": "^18.2.0",
|
|
87
91
|
"react-docgen-typescript": "^2.2.2",
|
|
88
92
|
"react-dom": "^18.2.0",
|
|
@@ -90,12 +94,13 @@
|
|
|
90
94
|
"sass": "^1.53.0",
|
|
91
95
|
"sass-loader": "^10.3.1",
|
|
92
96
|
"source-map": "^0.7.4",
|
|
93
|
-
"storybook": "^7.
|
|
97
|
+
"storybook": "^7.6.15",
|
|
94
98
|
"style-loader": "^3.3.3",
|
|
95
|
-
"stylelint": "^
|
|
99
|
+
"stylelint": "^15.11.0",
|
|
96
100
|
"terser-webpack-plugin": "^4.2.3",
|
|
97
101
|
"ts-jest": "^26.5.3",
|
|
98
|
-
"
|
|
102
|
+
"ts-node": "^10.9.2",
|
|
103
|
+
"typescript": "^5.3.3"
|
|
99
104
|
},
|
|
100
105
|
"husky": {
|
|
101
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;
|
package/build/cjs/utils/i18n.js
DELETED
|
@@ -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;
|