@gravity-ui/page-constructor 2.16.0 → 2.17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.17.0](https://github.com/gravity-ui/page-constructor/compare/v2.16.0...v2.17.0) (2023-05-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * drop rules overriding ([#303](https://github.com/gravity-ui/page-constructor/issues/303)) ([0c13398](https://github.com/gravity-ui/page-constructor/commit/0c1339885ce3b930ab9428b585aa6dd020b0d298))
9
+
3
10
  ## [2.16.0](https://github.com/gravity-ui/page-constructor/compare/v2.15.0...v2.16.0) (2023-05-11)
4
11
 
5
12
 
@@ -1,5 +1,93 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
+ .pc-slick-origin.slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ -webkit-touch-callout: none;
8
+ user-select: none;
9
+ touch-action: pan-y;
10
+ -webkit-tap-highlight-color: transparent;
11
+ }
12
+ .pc-slick-origin.slick-slider .slick-track,
13
+ .pc-slick-origin.slick-slider .slick-list {
14
+ transform: translate3d(0, 0, 0);
15
+ }
16
+ .pc-slick-origin .slick-list {
17
+ position: relative;
18
+ overflow: hidden;
19
+ display: block;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+ .pc-slick-origin .slick-list:focus {
24
+ outline: none;
25
+ }
26
+ .pc-slick-origin .slick-list.dragging {
27
+ cursor: hand;
28
+ }
29
+ .pc-slick-origin .slick-track {
30
+ position: relative;
31
+ left: 0;
32
+ top: 0;
33
+ display: block;
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ }
37
+ .pc-slick-origin .slick-track::before, .pc-slick-origin .slick-track::after {
38
+ content: "";
39
+ display: table;
40
+ }
41
+ .pc-slick-origin .slick-track:after {
42
+ clear: both;
43
+ }
44
+ .slick-loading .pc-slick-origin .slick-track {
45
+ visibility: hidden;
46
+ }
47
+ .pc-slick-origin .slick-slide {
48
+ float: left;
49
+ height: 100%;
50
+ min-height: 1px;
51
+ display: none;
52
+ }
53
+ [dir=rtl] .pc-slick-origin .slick-slide {
54
+ float: right;
55
+ }
56
+ .pc-slick-origin .slick-slide img {
57
+ display: block;
58
+ }
59
+ .pc-slick-origin .slick-slide.slick-loading img {
60
+ display: none;
61
+ }
62
+ .pc-slick-origin .slick-slide.dragging img {
63
+ pointer-events: none;
64
+ }
65
+ .slick-initialized .pc-slick-origin .slick-slide {
66
+ display: block;
67
+ }
68
+ .slick-loading .pc-slick-origin .slick-slide {
69
+ visibility: hidden;
70
+ }
71
+ .slick-vertical .pc-slick-origin .slick-slide {
72
+ display: block;
73
+ height: auto;
74
+ border: 1px solid transparent;
75
+ }
76
+ .pc-slick-origin.slick-initialized .slick-slide {
77
+ display: block;
78
+ }
79
+ .pc-slick-origin.slick-loading .slick-slide {
80
+ visibility: hidden;
81
+ }
82
+ .pc-slick-origin.slick-vertical .slick-slide {
83
+ display: block;
84
+ height: auto;
85
+ border: 1px solid transparent;
86
+ }
87
+ .pc-slick-origin .slick-arrow.slick-hidden {
88
+ display: none;
89
+ }
90
+
3
91
  .pc-SliderBlock .slick-list {
4
92
  padding: 24px 0 20px;
5
93
  margin: 0 -8px;
@@ -18,8 +18,6 @@ const models_1 = require("../../models");
18
18
  const utils_1 = require("../../utils");
19
19
  const Arrow_1 = tslib_1.__importDefault(require("./Arrow/Arrow"));
20
20
  const utils_2 = require("./utils");
21
- // Cause Slider.css should override slick.css
22
- // eslint-disable-next-line import/order
23
21
  const b = (0, utils_1.block)('SliderBlock');
24
22
  const slick = (0, utils_1.block)('slick-origin');
25
23
  const DOT_WIDTH = 8;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
5
  const uikit_1 = require("@gravity-ui/uikit");
6
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
7
  const localeContext_1 = require("../../../context/localeContext/localeContext");
8
8
  const mapsContext_1 = require("../../../context/mapsContext/mapsContext");
9
9
  const mobileContext_1 = require("../../../context/mobileContext");
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReactPlayerBlock = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
+ const uikit_1 = require("@gravity-ui/uikit");
6
7
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
8
  const react_player_1 = tslib_1.__importDefault(require("react-player"));
8
- const uikit_1 = require("@gravity-ui/uikit");
9
9
  const metrikaContext_1 = require("../../context/metrikaContext");
10
10
  const mobileContext_1 = require("../../context/mobileContext");
11
11
  const videoContext_1 = require("../../context/videoContext");
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getHeight = exports.AUTOPLAY_ATTRIBUTES = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
+ const uikit_1 = require("@gravity-ui/uikit");
6
7
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
7
8
  const uuid_1 = require("uuid");
8
- const uikit_1 = require("@gravity-ui/uikit");
9
9
  const icons_1 = require("../../icons");
10
10
  const utils_1 = require("../../utils");
11
11
  const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
5
4
  /* we won't use 'pc' class prefix here to let you opportunity to define yfm styles
6
5
  in your project via global 'yfm' class */
6
+ const react_1 = tslib_1.__importDefault(require("react"));
7
7
  const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
8
8
  const snakecase_keys_1 = tslib_1.__importDefault(require("snakecase-keys"));
9
9
  const components_1 = require("../../components");
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
- const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
6
5
  const uikit_1 = require("@gravity-ui/uikit");
6
+ const bem_cn_lite_1 = tslib_1.__importDefault(require("bem-cn-lite"));
7
7
  const ErrorWrapper_1 = tslib_1.__importDefault(require("../../components/ErrorWrapper/ErrorWrapper"));
8
8
  const i18n_1 = tslib_1.__importDefault(require("./i18n"));
9
9
  const b = (0, bem_cn_lite_1.default)('loadable-block');
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformFootnotes = exports.transformBlocks = exports.typografTransformer = exports.yfmTransformer = exports.createItemsParser = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ /* eslint-disable no-param-reassign */
6
+ /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
5
7
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
6
8
  const models_1 = require("../models");
7
9
  const utils_1 = require("./utils");
@@ -47,7 +49,6 @@ const parseItemsTitle = (transformer, items) => items.map((_a) => {
47
49
  });
48
50
  function parsePriceDetailedBlock(transformer, block) {
49
51
  const { priceType } = block;
50
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
51
52
  block.items = block.items.map((item) => {
52
53
  const { description, items: details = [] } = item;
53
54
  if (priceType === 'marked-list') {
@@ -65,27 +66,23 @@ function parsePriceDetailedBlock(transformer, block) {
65
66
  item.description = transformer(description);
66
67
  return item;
67
68
  });
68
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
69
69
  return block;
70
70
  }
71
71
  const parseContentLayout = (transformer, content) => {
72
72
  if (content) {
73
73
  const { text, additionalInfo } = content;
74
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
75
74
  if (text) {
76
75
  content.text = transformer(text);
77
76
  }
78
77
  if (additionalInfo) {
79
78
  content.additionalInfo = transformer(additionalInfo);
80
79
  }
81
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
82
80
  }
83
81
  return content;
84
82
  };
85
83
  function parseContentLayoutTitle(transformer, content) {
86
84
  if (content === null || content === void 0 ? void 0 : content.title) {
87
85
  const { title } = content;
88
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
89
86
  content.title = title && parseTitle(transformer, title);
90
87
  }
91
88
  return content;
@@ -361,7 +358,6 @@ const config = {
361
358
  function addRandomOrder(block) {
362
359
  if (block) {
363
360
  if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {
364
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
365
361
  block.children = lodash_1.default.shuffle(block.children);
366
362
  }
367
363
  }
@@ -376,7 +372,6 @@ function transformBlock(lang, blocksConfig, block) {
376
372
  const transformer = transformerRaw.bind(null, lang);
377
373
  if (fields) {
378
374
  fields.forEach((field) => {
379
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
380
375
  if (block[field]) {
381
376
  if (parser) {
382
377
  block[field] = parser(transformer, block[field]);
@@ -385,7 +380,6 @@ function transformBlock(lang, blocksConfig, block) {
385
380
  block[field] = transformer(block[field]);
386
381
  }
387
382
  }
388
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
389
383
  });
390
384
  }
391
385
  else if (parser) {
@@ -1,5 +1,5 @@
1
- import sanitize from 'sanitize-html';
2
1
  import { Options, Output } from '@doc-tools/transform';
2
+ import sanitize from 'sanitize-html';
3
3
  import { Lang } from '../utils/configure';
4
4
  export declare enum TransformType {
5
5
  Text = "text",
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const transform_1 = tslib_1.__importDefault(require("@doc-tools/transform"));
5
6
  const sanitize_html_1 = tslib_1.__importDefault(require("sanitize-html"));
6
7
  const typograf_1 = tslib_1.__importDefault(require("typograf"));
7
- const transform_1 = tslib_1.__importDefault(require("@doc-tools/transform"));
8
8
  const configure_1 = require("../utils/configure");
9
9
  var TransformType;
10
10
  (function (TransformType) {
@@ -107,7 +107,7 @@ function typografEntity({ entity, fields, lang = configure_1.Lang.Ru, transformT
107
107
  const transformer = transformTypeMap[transformType];
108
108
  fields.forEach((fieldName) => {
109
109
  if (entity[fieldName]) {
110
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
110
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
111
111
  entity[fieldName] = transformer(entity[fieldName], lang);
112
112
  }
113
113
  });
@@ -22,7 +22,7 @@ function doSmoothScroll(element, startPosition, scrollOptions) {
22
22
  exports.doSmoothScroll = doSmoothScroll;
23
23
  function getChangeScrollFunction(direction, isReverse) {
24
24
  return (element, scrollPosition, startPosition) => {
25
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
25
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
26
26
  element[direction] = isReverse
27
27
  ? startPosition - scrollPosition
28
28
  : startPosition + scrollPosition;
@@ -1,5 +1,93 @@
1
1
  /* use this for style redefinitions to awoid problems with
2
2
  unpredictable css rules order in build */
3
+ .pc-slick-origin.slick-slider {
4
+ position: relative;
5
+ display: block;
6
+ box-sizing: border-box;
7
+ -webkit-touch-callout: none;
8
+ user-select: none;
9
+ touch-action: pan-y;
10
+ -webkit-tap-highlight-color: transparent;
11
+ }
12
+ .pc-slick-origin.slick-slider .slick-track,
13
+ .pc-slick-origin.slick-slider .slick-list {
14
+ transform: translate3d(0, 0, 0);
15
+ }
16
+ .pc-slick-origin .slick-list {
17
+ position: relative;
18
+ overflow: hidden;
19
+ display: block;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+ .pc-slick-origin .slick-list:focus {
24
+ outline: none;
25
+ }
26
+ .pc-slick-origin .slick-list.dragging {
27
+ cursor: hand;
28
+ }
29
+ .pc-slick-origin .slick-track {
30
+ position: relative;
31
+ left: 0;
32
+ top: 0;
33
+ display: block;
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ }
37
+ .pc-slick-origin .slick-track::before, .pc-slick-origin .slick-track::after {
38
+ content: "";
39
+ display: table;
40
+ }
41
+ .pc-slick-origin .slick-track:after {
42
+ clear: both;
43
+ }
44
+ .slick-loading .pc-slick-origin .slick-track {
45
+ visibility: hidden;
46
+ }
47
+ .pc-slick-origin .slick-slide {
48
+ float: left;
49
+ height: 100%;
50
+ min-height: 1px;
51
+ display: none;
52
+ }
53
+ [dir=rtl] .pc-slick-origin .slick-slide {
54
+ float: right;
55
+ }
56
+ .pc-slick-origin .slick-slide img {
57
+ display: block;
58
+ }
59
+ .pc-slick-origin .slick-slide.slick-loading img {
60
+ display: none;
61
+ }
62
+ .pc-slick-origin .slick-slide.dragging img {
63
+ pointer-events: none;
64
+ }
65
+ .slick-initialized .pc-slick-origin .slick-slide {
66
+ display: block;
67
+ }
68
+ .slick-loading .pc-slick-origin .slick-slide {
69
+ visibility: hidden;
70
+ }
71
+ .slick-vertical .pc-slick-origin .slick-slide {
72
+ display: block;
73
+ height: auto;
74
+ border: 1px solid transparent;
75
+ }
76
+ .pc-slick-origin.slick-initialized .slick-slide {
77
+ display: block;
78
+ }
79
+ .pc-slick-origin.slick-loading .slick-slide {
80
+ visibility: hidden;
81
+ }
82
+ .pc-slick-origin.slick-vertical .slick-slide {
83
+ display: block;
84
+ height: auto;
85
+ border: 1px solid transparent;
86
+ }
87
+ .pc-slick-origin .slick-arrow.slick-hidden {
88
+ display: none;
89
+ }
90
+
3
91
  .pc-SliderBlock .slick-list {
4
92
  padding: 24px 0 20px;
5
93
  margin: 0 -8px;
@@ -1,6 +1,5 @@
1
1
  import { Settings } from 'react-slick';
2
2
  import { ClassNameProps, Refable, SliderProps as SliderParams, WithChildren } from '../../models';
3
- import './slick.css';
4
3
  import './Slider.css';
5
4
  export interface SliderProps extends Omit<SliderParams, 'children'>, Refable<HTMLDivElement>, ClassNameProps, Pick<Settings, 'lazyLoad'> {
6
5
  type?: string;
@@ -14,9 +14,6 @@ import { SliderType, } from '../../models';
14
14
  import { block } from '../../utils';
15
15
  import Arrow from './Arrow/Arrow';
16
16
  import { getSliderResponsiveParams, getSlidesCountByBreakpoint, getSlidesToShowCount, getSlidesToShowWithDefaults, } from './utils';
17
- import './slick.css';
18
- // Cause Slider.css should override slick.css
19
- // eslint-disable-next-line import/order
20
17
  import './Slider.css';
21
18
  const b = block('SliderBlock');
22
19
  const slick = block('slick-origin');
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
2
- import _ from 'lodash';
3
2
  import { Spin } from '@gravity-ui/uikit';
3
+ import _ from 'lodash';
4
4
  import { LocaleContext } from '../../../context/localeContext/localeContext';
5
5
  import { MapsContext } from '../../../context/mapsContext/mapsContext';
6
6
  import { MobileContext } from '../../../context/mobileContext';
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, } from 'react';
2
+ import { Icon } from '@gravity-ui/uikit';
2
3
  import _ from 'lodash';
3
4
  import ReactPlayer from 'react-player';
4
- import { Icon } from '@gravity-ui/uikit';
5
5
  import { MetrikaContext } from '../../context/metrikaContext';
6
6
  import { MobileContext } from '../../context/mobileContext';
7
7
  import { VideoContext } from '../../context/videoContext';
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { Icon } from '@gravity-ui/uikit';
2
3
  import _ from 'lodash';
3
4
  import { v4 as uuidv4 } from 'uuid';
4
- import { Icon } from '@gravity-ui/uikit';
5
5
  import { PlayVideo } from '../../icons';
6
6
  import { block, getPageSearchParams } from '../../utils';
7
7
  import Image from '../Image/Image';
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
1
  /* we won't use 'pc' class prefix here to let you opportunity to define yfm styles
3
2
  in your project via global 'yfm' class */
3
+ import React from 'react';
4
4
  import block from 'bem-cn-lite';
5
5
  import toSnakeCase from 'snakecase-keys';
6
6
  import { HTML } from '../../components';
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
- import blockCn from 'bem-cn-lite';
3
2
  import { Spin } from '@gravity-ui/uikit';
3
+ import blockCn from 'bem-cn-lite';
4
4
  import ErrorWrapper from '../../components/ErrorWrapper/ErrorWrapper';
5
5
  import i18n from './i18n';
6
6
  import './Loadable.css';
@@ -1,4 +1,6 @@
1
1
  import { __rest } from "tslib";
2
+ /* eslint-disable no-param-reassign */
3
+ /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
2
4
  import _ from 'lodash';
3
5
  import { BlockType, SubBlockType, } from '../models';
4
6
  import { fullTransform, typografToHTML } from './utils';
@@ -43,7 +45,6 @@ const parseItemsTitle = (transformer, items) => items.map((_a) => {
43
45
  });
44
46
  function parsePriceDetailedBlock(transformer, block) {
45
47
  const { priceType } = block;
46
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
47
48
  block.items = block.items.map((item) => {
48
49
  const { description, items: details = [] } = item;
49
50
  if (priceType === 'marked-list') {
@@ -61,27 +62,23 @@ function parsePriceDetailedBlock(transformer, block) {
61
62
  item.description = transformer(description);
62
63
  return item;
63
64
  });
64
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
65
65
  return block;
66
66
  }
67
67
  const parseContentLayout = (transformer, content) => {
68
68
  if (content) {
69
69
  const { text, additionalInfo } = content;
70
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
71
70
  if (text) {
72
71
  content.text = transformer(text);
73
72
  }
74
73
  if (additionalInfo) {
75
74
  content.additionalInfo = transformer(additionalInfo);
76
75
  }
77
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
78
76
  }
79
77
  return content;
80
78
  };
81
79
  function parseContentLayoutTitle(transformer, content) {
82
80
  if (content === null || content === void 0 ? void 0 : content.title) {
83
81
  const { title } = content;
84
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
85
82
  content.title = title && parseTitle(transformer, title);
86
83
  }
87
84
  return content;
@@ -355,7 +352,6 @@ const config = {
355
352
  function addRandomOrder(block) {
356
353
  if (block) {
357
354
  if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {
358
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
359
355
  block.children = _.shuffle(block.children);
360
356
  }
361
357
  }
@@ -370,7 +366,6 @@ function transformBlock(lang, blocksConfig, block) {
370
366
  const transformer = transformerRaw.bind(null, lang);
371
367
  if (fields) {
372
368
  fields.forEach((field) => {
373
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
374
369
  if (block[field]) {
375
370
  if (parser) {
376
371
  block[field] = parser(transformer, block[field]);
@@ -379,7 +374,6 @@ function transformBlock(lang, blocksConfig, block) {
379
374
  block[field] = transformer(block[field]);
380
375
  }
381
376
  }
382
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
383
377
  });
384
378
  }
385
379
  else if (parser) {
@@ -1,5 +1,5 @@
1
- import sanitize from 'sanitize-html';
2
1
  import { Options, Output } from '@doc-tools/transform';
2
+ import sanitize from 'sanitize-html';
3
3
  import { Lang } from '../utils/configure';
4
4
  export declare enum TransformType {
5
5
  Text = "text",
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
+ import transformYFM from '@doc-tools/transform';
2
3
  import sanitize from 'sanitize-html';
3
4
  import Typograf from 'typograf';
4
- import transformYFM from '@doc-tools/transform';
5
5
  import { Lang } from '../utils/configure';
6
6
  export var TransformType;
7
7
  (function (TransformType) {
@@ -98,7 +98,7 @@ export function typografEntity({ entity, fields, lang = Lang.Ru, transformType =
98
98
  const transformer = transformTypeMap[transformType];
99
99
  fields.forEach((fieldName) => {
100
100
  if (entity[fieldName]) {
101
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
101
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
102
102
  entity[fieldName] = transformer(entity[fieldName], lang);
103
103
  }
104
104
  });
@@ -18,7 +18,7 @@ export function doSmoothScroll(element, startPosition, scrollOptions) {
18
18
  }
19
19
  function getChangeScrollFunction(direction, isReverse) {
20
20
  return (element, scrollPosition, startPosition) => {
21
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
21
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
22
22
  element[direction] = isReverse
23
23
  ? startPosition - scrollPosition
24
24
  : startPosition + scrollPosition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,6 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.transformFootnotes = exports.transformBlocks = exports.typografTransformer = exports.yfmTransformer = exports.createItemsParser = void 0;
18
+ /* eslint-disable no-param-reassign */
19
+ /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
18
20
  const lodash_1 = __importDefault(require("lodash"));
19
21
  const models_1 = require("../models");
20
22
  const utils_1 = require("./utils");
@@ -60,7 +62,6 @@ const parseItemsTitle = (transformer, items) => items.map((_a) => {
60
62
  });
61
63
  function parsePriceDetailedBlock(transformer, block) {
62
64
  const { priceType } = block;
63
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
64
65
  block.items = block.items.map((item) => {
65
66
  const { description, items: details = [] } = item;
66
67
  if (priceType === 'marked-list') {
@@ -78,27 +79,23 @@ function parsePriceDetailedBlock(transformer, block) {
78
79
  item.description = transformer(description);
79
80
  return item;
80
81
  });
81
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
82
82
  return block;
83
83
  }
84
84
  const parseContentLayout = (transformer, content) => {
85
85
  if (content) {
86
86
  const { text, additionalInfo } = content;
87
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
88
87
  if (text) {
89
88
  content.text = transformer(text);
90
89
  }
91
90
  if (additionalInfo) {
92
91
  content.additionalInfo = transformer(additionalInfo);
93
92
  }
94
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
95
93
  }
96
94
  return content;
97
95
  };
98
96
  function parseContentLayoutTitle(transformer, content) {
99
97
  if (content === null || content === void 0 ? void 0 : content.title) {
100
98
  const { title } = content;
101
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
102
99
  content.title = title && parseTitle(transformer, title);
103
100
  }
104
101
  return content;
@@ -374,7 +371,6 @@ const config = {
374
371
  function addRandomOrder(block) {
375
372
  if (block) {
376
373
  if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {
377
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
378
374
  block.children = lodash_1.default.shuffle(block.children);
379
375
  }
380
376
  }
@@ -389,7 +385,6 @@ function transformBlock(lang, blocksConfig, block) {
389
385
  const transformer = transformerRaw.bind(null, lang);
390
386
  if (fields) {
391
387
  fields.forEach((field) => {
392
- /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */
393
388
  if (block[field]) {
394
389
  if (parser) {
395
390
  block[field] = parser(transformer, block[field]);
@@ -398,7 +393,6 @@ function transformBlock(lang, blocksConfig, block) {
398
393
  block[field] = transformer(block[field]);
399
394
  }
400
395
  }
401
- /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */
402
396
  });
403
397
  }
404
398
  else if (parser) {
@@ -1,5 +1,5 @@
1
- import sanitize from 'sanitize-html';
2
1
  import { Options, Output } from '@doc-tools/transform';
2
+ import sanitize from 'sanitize-html';
3
3
  import { Lang } from '../utils/configure';
4
4
  export declare enum TransformType {
5
5
  Text = "text",
@@ -15,9 +15,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.typografEntity = exports.fullTransform = exports.transformMarkdown = exports.typografToText = exports.typografToHTML = exports.sanitizeHtml = exports.typograf = exports.sanitizeStripOptions = exports.typografConfig = exports.DEFAULT_ALLOWED_TAGS = exports.TransformType = void 0;
18
+ const transform_1 = __importDefault(require("@doc-tools/transform"));
18
19
  const sanitize_html_1 = __importDefault(require("sanitize-html"));
19
20
  const typograf_1 = __importDefault(require("typograf"));
20
- const transform_1 = __importDefault(require("@doc-tools/transform"));
21
21
  const configure_1 = require("../utils/configure");
22
22
  var TransformType;
23
23
  (function (TransformType) {
@@ -120,7 +120,7 @@ function typografEntity({ entity, fields, lang = configure_1.Lang.Ru, transformT
120
120
  const transformer = transformTypeMap[transformType];
121
121
  fields.forEach((fieldName) => {
122
122
  if (entity[fieldName]) {
123
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
123
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
124
124
  entity[fieldName] = transformer(entity[fieldName], lang);
125
125
  }
126
126
  });
@@ -22,7 +22,7 @@ function doSmoothScroll(element, startPosition, scrollOptions) {
22
22
  exports.doSmoothScroll = doSmoothScroll;
23
23
  function getChangeScrollFunction(direction, isReverse) {
24
24
  return (element, scrollPosition, startPosition) => {
25
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
25
+ // eslint-disable-next-line no-param-reassign, no-not-accumulator-reassign/no-not-accumulator-reassign
26
26
  element[direction] = isReverse
27
27
  ? startPosition - scrollPosition
28
28
  : startPosition + scrollPosition;