@gravity-ui/page-constructor 2.12.0-alpha → 2.13.0-alpha.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 (104) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/cjs/blocks/index.d.ts +0 -1
  3. package/build/cjs/blocks/index.js +1 -3
  4. package/build/cjs/blocks/validators.d.ts +0 -1
  5. package/build/cjs/blocks/validators.js +0 -1
  6. package/build/cjs/components/Button/Button.js +2 -2
  7. package/build/cjs/components/Button/i18n/en.json +3 -0
  8. package/build/cjs/components/Button/i18n/index.d.ts +2 -0
  9. package/build/cjs/components/Button/i18n/index.js +8 -0
  10. package/build/cjs/components/Button/i18n/ru.json +3 -0
  11. package/build/cjs/components/Control/Control.js +2 -1
  12. package/build/cjs/components/Control/i18n/en.json +3 -0
  13. package/build/cjs/components/Control/i18n/index.d.ts +2 -0
  14. package/build/cjs/components/Control/i18n/index.js +8 -0
  15. package/build/cjs/components/Control/i18n/ru.json +3 -0
  16. package/build/cjs/components/FullscreenImage/FullscreenImage.js +3 -2
  17. package/build/cjs/components/FullscreenImage/i18n/en.json +3 -0
  18. package/build/cjs/components/FullscreenImage/i18n/index.d.ts +2 -0
  19. package/build/cjs/components/FullscreenImage/i18n/index.js +8 -0
  20. package/build/cjs/components/FullscreenImage/i18n/ru.json +3 -0
  21. package/build/cjs/components/Image/Image.js +2 -1
  22. package/build/cjs/components/Image/i18n/en.json +3 -0
  23. package/build/cjs/components/Image/i18n/index.d.ts +2 -0
  24. package/build/cjs/components/Image/i18n/index.js +8 -0
  25. package/build/cjs/components/Image/i18n/ru.json +3 -0
  26. package/build/cjs/components/Map/GoogleMap.js +1 -1
  27. package/build/cjs/components/Media/DataLens/DataLens.js +2 -1
  28. package/build/cjs/components/Media/DataLens/i18n/en.json +3 -0
  29. package/build/cjs/components/Media/DataLens/i18n/index.d.ts +2 -0
  30. package/build/cjs/components/Media/DataLens/i18n/index.js +8 -0
  31. package/build/cjs/components/Media/DataLens/i18n/ru.json +3 -0
  32. package/build/cjs/components/OverflowScroller/OverflowScroller.d.ts +0 -2
  33. package/build/cjs/components/OverflowScroller/OverflowScroller.js +3 -4
  34. package/build/cjs/components/VideoBlock/VideoBlock.js +3 -0
  35. package/build/cjs/components/VideoBlock/i18n/en.json +3 -0
  36. package/build/cjs/components/VideoBlock/i18n/index.d.ts +2 -0
  37. package/build/cjs/components/VideoBlock/i18n/index.js +8 -0
  38. package/build/cjs/components/VideoBlock/i18n/ru.json +3 -0
  39. package/build/cjs/components/YandexForm/YandexForm.js +1 -0
  40. package/build/cjs/constructor-items.d.ts +0 -1
  41. package/build/cjs/constructor-items.js +0 -1
  42. package/build/cjs/models/constructor-items/blocks.d.ts +1 -20
  43. package/build/cjs/models/constructor-items/blocks.js +0 -1
  44. package/build/cjs/schema/index.js +1 -1
  45. package/build/cjs/schema/validators/blocks.d.ts +0 -1
  46. package/build/cjs/schema/validators/blocks.js +0 -1
  47. package/build/esm/blocks/index.d.ts +0 -1
  48. package/build/esm/blocks/index.js +0 -1
  49. package/build/esm/blocks/validators.d.ts +0 -1
  50. package/build/esm/blocks/validators.js +0 -1
  51. package/build/esm/components/Button/Button.js +2 -2
  52. package/build/esm/components/Button/i18n/en.json +3 -0
  53. package/build/esm/components/Button/i18n/index.d.ts +2 -0
  54. package/build/esm/components/Button/i18n/index.js +5 -0
  55. package/build/esm/components/Button/i18n/ru.json +3 -0
  56. package/build/esm/components/Control/Control.js +2 -1
  57. package/build/esm/components/Control/i18n/en.json +3 -0
  58. package/build/esm/components/Control/i18n/index.d.ts +2 -0
  59. package/build/esm/components/Control/i18n/index.js +5 -0
  60. package/build/esm/components/Control/i18n/ru.json +3 -0
  61. package/build/esm/components/FullscreenImage/FullscreenImage.js +3 -2
  62. package/build/esm/components/FullscreenImage/i18n/en.json +3 -0
  63. package/build/esm/components/FullscreenImage/i18n/index.d.ts +2 -0
  64. package/build/esm/components/FullscreenImage/i18n/index.js +5 -0
  65. package/build/esm/components/FullscreenImage/i18n/ru.json +3 -0
  66. package/build/esm/components/Image/Image.js +2 -1
  67. package/build/esm/components/Image/i18n/en.json +3 -0
  68. package/build/esm/components/Image/i18n/index.d.ts +2 -0
  69. package/build/esm/components/Image/i18n/index.js +5 -0
  70. package/build/esm/components/Image/i18n/ru.json +3 -0
  71. package/build/esm/components/Map/GoogleMap.js +1 -1
  72. package/build/esm/components/Media/DataLens/DataLens.js +2 -1
  73. package/build/esm/components/Media/DataLens/i18n/en.json +3 -0
  74. package/build/esm/components/Media/DataLens/i18n/index.d.ts +2 -0
  75. package/build/esm/components/Media/DataLens/i18n/index.js +5 -0
  76. package/build/esm/components/Media/DataLens/i18n/ru.json +3 -0
  77. package/build/esm/components/OverflowScroller/OverflowScroller.d.ts +0 -2
  78. package/build/esm/components/OverflowScroller/OverflowScroller.js +3 -4
  79. package/build/esm/components/VideoBlock/VideoBlock.js +3 -0
  80. package/build/esm/components/VideoBlock/i18n/en.json +3 -0
  81. package/build/esm/components/VideoBlock/i18n/index.d.ts +2 -0
  82. package/build/esm/components/VideoBlock/i18n/index.js +5 -0
  83. package/build/esm/components/VideoBlock/i18n/ru.json +3 -0
  84. package/build/esm/components/YandexForm/YandexForm.js +1 -0
  85. package/build/esm/constructor-items.d.ts +0 -1
  86. package/build/esm/constructor-items.js +1 -2
  87. package/build/esm/models/constructor-items/blocks.d.ts +1 -20
  88. package/build/esm/models/constructor-items/blocks.js +0 -1
  89. package/build/esm/schema/index.js +2 -2
  90. package/build/esm/schema/validators/blocks.d.ts +0 -1
  91. package/build/esm/schema/validators/blocks.js +0 -1
  92. package/package.json +4 -1
  93. package/server/models/constructor-items/blocks.d.ts +1 -20
  94. package/server/models/constructor-items/blocks.js +0 -1
  95. package/build/cjs/blocks/Security/Security.css +0 -142
  96. package/build/cjs/blocks/Security/Security.d.ts +0 -3
  97. package/build/cjs/blocks/Security/Security.js +0 -28
  98. package/build/cjs/blocks/Security/schema.d.ts +0 -170
  99. package/build/cjs/blocks/Security/schema.js +0 -32
  100. package/build/esm/blocks/Security/Security.css +0 -142
  101. package/build/esm/blocks/Security/Security.d.ts +0 -4
  102. package/build/esm/blocks/Security/Security.js +0 -24
  103. package/build/esm/blocks/Security/schema.d.ts +0 -170
  104. package/build/esm/blocks/Security/schema.js +0 -28
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.12.0](https://github.com/gravity-ui/page-constructor/compare/v2.11.0...v2.12.0) (2023-04-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * add alt to img ([#309](https://github.com/gravity-ui/page-constructor/issues/309)) ([a1e5587](https://github.com/gravity-ui/page-constructor/commit/a1e5587ada92b53097ac77f16c1cdad7a4899219))
9
+
3
10
  ## [2.11.0](https://github.com/gravity-ui/page-constructor/compare/v2.10.0...v2.11.0) (2023-04-25)
4
11
 
5
12
 
@@ -5,7 +5,6 @@ export { default as InfoBlock } from './Info/Info';
5
5
  export { default as MediaBlock } from './Media/Media';
6
6
  export { default as MapBlock } from './Map/Map';
7
7
  export { default as PreviewBlock } from './Preview/Preview';
8
- export { default as SecurityBlock } from './Security/Security';
9
8
  export { default as SliderBlock } from './Slider/Slider';
10
9
  export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
11
10
  export { default as PromoFeaturesBlock } from './PromoFeaturesBlock/PromoFeaturesBlock';
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.LinkTableBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.SecurityBlock = exports.PreviewBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.SimpleBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
6
+ exports.FilterBlock = exports.ShareBlock = exports.ContentLayoutBlock = exports.CardLayoutBlock = exports.HeaderSliderBlock = exports.IconsBlock = exports.HeaderBlock = exports.LinkTableBlock = exports.TabsBlock = exports.TableBlock = exports.QuestionsBlock = exports.PromoFeaturesBlock = exports.ExtendedFeaturesBlock = exports.SliderBlock = exports.PreviewBlock = exports.MapBlock = exports.MediaBlock = exports.InfoBlock = exports.SimpleBlock = exports.CompaniesBlock = exports.BannerBlock = void 0;
7
7
  var Banner_1 = require("./Banner/Banner");
8
8
  Object.defineProperty(exports, "BannerBlock", { enumerable: true, get: function () { return __importDefault(Banner_1).default; } });
9
9
  var Companies_1 = require("./Companies/Companies");
@@ -18,8 +18,6 @@ var Map_1 = require("./Map/Map");
18
18
  Object.defineProperty(exports, "MapBlock", { enumerable: true, get: function () { return __importDefault(Map_1).default; } });
19
19
  var Preview_1 = require("./Preview/Preview");
20
20
  Object.defineProperty(exports, "PreviewBlock", { enumerable: true, get: function () { return __importDefault(Preview_1).default; } });
21
- var Security_1 = require("./Security/Security");
22
- Object.defineProperty(exports, "SecurityBlock", { enumerable: true, get: function () { return __importDefault(Security_1).default; } });
23
21
  var Slider_1 = require("./Slider/Slider");
24
22
  Object.defineProperty(exports, "SliderBlock", { enumerable: true, get: function () { return __importDefault(Slider_1).default; } });
25
23
  var ExtendedFeatures_1 = require("./ExtendedFeatures/ExtendedFeatures");
@@ -12,7 +12,6 @@ export * from './Media/schema';
12
12
  export * from './Preview/schema';
13
13
  export * from './PromoFeaturesBlock/schema';
14
14
  export * from './Questions/schema';
15
- export * from './Security/schema';
16
15
  export * from './Simple/schema';
17
16
  export * from './Slider/schema';
18
17
  export * from './Table/schema';
@@ -15,7 +15,6 @@ tslib_1.__exportStar(require("./Media/schema"), exports);
15
15
  tslib_1.__exportStar(require("./Preview/schema"), exports);
16
16
  tslib_1.__exportStar(require("./PromoFeaturesBlock/schema"), exports);
17
17
  tslib_1.__exportStar(require("./Questions/schema"), exports);
18
- tslib_1.__exportStar(require("./Security/schema"), exports);
19
18
  tslib_1.__exportStar(require("./Simple/schema"), exports);
20
19
  tslib_1.__exportStar(require("./Slider/schema"), exports);
21
20
  tslib_1.__exportStar(require("./Table/schema"), exports);
@@ -9,7 +9,7 @@ const useMetrika_1 = require("../../hooks/useMetrika");
9
9
  const icons_1 = require("../../icons");
10
10
  const models_1 = require("../../models");
11
11
  const utils_1 = require("../../utils");
12
- const ImageBase_1 = tslib_1.__importDefault(require("../ImageBase/ImageBase"));
12
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
13
13
  const utils_2 = require("./utils");
14
14
  const b = (0, utils_1.block)('button-block');
15
15
  const Button = (props) => {
@@ -37,7 +37,7 @@ const Button = (props) => {
37
37
  return react_1.default.createElement(uikit_1.StoreBadge, { className: buttonClass, platform: platform, lang: lang, url: url });
38
38
  }
39
39
  let icon;
40
- let image = img && react_1.default.createElement(ImageBase_1.default, { className: b('image'), src: buttonImg.url, alt: buttonImg.alt });
40
+ let image = img && (react_1.default.createElement("img", { className: b('image'), src: buttonImg.url, alt: buttonImg.alt || (0, i18n_1.default)('image-alt') }));
41
41
  if (theme === 'github') {
42
42
  icon = react_1.default.createElement(uikit_1.Icon, { className: b('icon'), data: icons_1.Github, size: 24, qa: utils_2.ICON_QA });
43
43
  image = undefined;
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Button image"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'Button';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Иконка кнопки"
3
+ }
@@ -4,10 +4,11 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const uikit_1 = require("@gravity-ui/uikit");
6
6
  const utils_1 = require("../../utils");
7
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
7
8
  const b = (0, utils_1.block)('control');
8
9
  const Control = (props) => {
9
10
  const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, } = props;
10
- return (react_1.default.createElement("button", { type: "button", className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
11
+ return (react_1.default.createElement("button", { type: "button", "aria-label": (0, i18n_1.default)('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
11
12
  react_1.default.createElement(uikit_1.Icon, { data: icon, size: iconSize })));
12
13
  };
13
14
  exports.default = Control;
@@ -0,0 +1,3 @@
1
+ {
2
+ "aria-label": "Button label"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'Control';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "aria-label": "Лейбл кнопки"
3
+ }
@@ -6,11 +6,12 @@ const uikit_1 = require("@gravity-ui/uikit");
6
6
  const icons_1 = require("../../icons");
7
7
  const utils_1 = require("../../utils");
8
8
  const Image_1 = tslib_1.__importDefault(require("../Image/Image"));
9
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
9
10
  const b = (0, utils_1.block)('FullScreenImage');
10
11
  const FULL_SCREEN_ICON_SIZE = 18;
11
12
  const CLOSE_ICON_SIZE = 30;
12
13
  const FullScreenImage = (props) => {
13
- const { imageClassName, modalImageClass, imageStyle } = props;
14
+ const { imageClassName, modalImageClass, imageStyle, alt = (0, i18n_1.default)('img-alt') } = props;
14
15
  const [isOpened, setIsOpened] = (0, react_1.useState)(false);
15
16
  const [isMouseEnter, setIsMouseEnter] = (0, react_1.useState)(false);
16
17
  const openModal = () => setIsOpened(true);
@@ -19,7 +20,7 @@ const FullScreenImage = (props) => {
19
20
  const hideFullScreenIcon = () => setIsMouseEnter(false);
20
21
  return (react_1.default.createElement("div", { className: b() },
21
22
  react_1.default.createElement("div", { className: b('image-wrapper'), onMouseEnter: showFullScreenIcon, onMouseLeave: hideFullScreenIcon },
22
- react_1.default.createElement(Image_1.default, Object.assign({}, props, { className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
23
+ react_1.default.createElement(Image_1.default, Object.assign({}, props, { alt: alt, className: b('image', imageClassName), onClick: openModal, style: imageStyle })),
23
24
  react_1.default.createElement("div", { className: b('icon-wrapper', { visible: isMouseEnter }), onClick: openModal },
24
25
  react_1.default.createElement(uikit_1.Icon, { data: icons_1.FullScreen, width: FULL_SCREEN_ICON_SIZE, height: FULL_SCREEN_ICON_SIZE, className: b('icon') }))),
25
26
  isOpened && (react_1.default.createElement(uikit_1.Modal, { open: isOpened, onClose: closeModal, className: b('modal') },
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Full screen image"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'FullScreenImage';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Полноэкранное изображение"
3
+ }
@@ -6,12 +6,13 @@ const constants_1 = require("../../constants");
6
6
  const projectSettingsContext_1 = require("../../context/projectSettingsContext");
7
7
  const imageCompress_1 = require("../../utils/imageCompress");
8
8
  const ImageBase_1 = tslib_1.__importDefault(require("../ImageBase/ImageBase"));
9
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
9
10
  const checkWebP = (src) => {
10
11
  return src.endsWith('.webp') ? src : src + '.webp';
11
12
  };
12
13
  const Image = (props) => {
13
14
  const projectSettings = (0, react_1.useContext)(projectSettingsContext_1.ProjectSettingsContext);
14
- const { src: imageSrc, alt, disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
15
+ const { src: imageSrc, alt = (0, i18n_1.default)('img-alt'), disableCompress, tablet, desktop, mobile, style, className, onClick, containerClassName, } = props;
15
16
  const [imgLoadingError, setImgLoadingError] = (0, react_1.useState)(false);
16
17
  const src = imageSrc || desktop;
17
18
  if (!src) {
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Image alt"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'Image';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "img-alt": "Альтернатива изображению"
3
+ }
@@ -39,6 +39,6 @@ const GoogleMap = (props) => {
39
39
  }
40
40
  return (react_1.default.createElement("iframe", { className: b(), ref: ref, style: {
41
41
  height,
42
- }, loading: "lazy", allowFullScreen: true, referrerPolicy: "no-referrer-when-downgrade", src: src }));
42
+ }, title: "Google Map", loading: "lazy", allowFullScreen: true, referrerPolicy: "no-referrer-when-downgrade", src: src }));
43
43
  };
44
44
  exports.default = GoogleMap;
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importDefault(require("react"));
5
5
  const utils_1 = require("../../../utils");
6
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
6
7
  const utils_2 = require("./utils");
7
8
  const b = (0, utils_1.block)('media-component-data-lens');
8
9
  const DataLens = (props) => {
9
10
  const { dataLens } = props;
10
11
  const dataLensData = (0, utils_2.unifyDataLensToObject)(dataLens);
11
12
  return dataLens ? (react_1.default.createElement("div", { className: b('wrap') },
12
- react_1.default.createElement("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}`, className: b('iframe'), frameBorder: 0 }))) : null;
13
+ react_1.default.createElement("iframe", { src: `https://datalens.yandex/${dataLensData.id}?_embedded=1&_theme=${dataLensData.theme}`, className: b('iframe'), loading: "lazy", title: (0, i18n_1.default)('iframe-title'), frameBorder: 0 }))) : null;
13
14
  };
14
15
  exports.default = DataLens;
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Datalens frame"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'DataLens';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Фрейм данных"
3
+ }
@@ -4,8 +4,6 @@ export interface OverflowScrollerProps {
4
4
  className?: string;
5
5
  onScrollStart?: () => void;
6
6
  onScrollEnd?: () => void;
7
- arrowSize?: number;
8
- arrowClassName?: string;
9
7
  }
10
8
  export interface OverflowScrollerState {
11
9
  arrows: Arrow[];
@@ -8,7 +8,6 @@ const utils_1 = require("../../utils");
8
8
  const b = (0, utils_1.block)('overflow-scroller');
9
9
  const TRANSITION_TIME = 300;
10
10
  const PADDING_SIZE = 24;
11
- const DEFAULT_ARROW_SIZE = 18;
12
11
  class OverflowScroller extends react_1.default.Component {
13
12
  constructor() {
14
13
  super(...arguments);
@@ -73,7 +72,7 @@ class OverflowScroller extends react_1.default.Component {
73
72
  window.removeEventListener('resize', this.checkOverflow);
74
73
  }
75
74
  render() {
76
- const { className, arrowClassName, children, arrowSize = DEFAULT_ARROW_SIZE } = this.props;
75
+ const { className, children } = this.props;
77
76
  const { arrows, scrollValue } = this.state;
78
77
  const wrapperStyle = arrows.length ? { left: -scrollValue } : { left: 0 };
79
78
  const paddingLeft = arrows.includes('left');
@@ -84,8 +83,8 @@ class OverflowScroller extends react_1.default.Component {
84
83
  }) },
85
84
  react_1.default.createElement("div", { className: b(null, className), ref: this.containerRef },
86
85
  react_1.default.createElement("div", { className: b('wrapper'), style: wrapperStyle, ref: this.wrapperRef }, children)),
87
- arrows.map((direction) => (react_1.default.createElement("div", { key: direction, className: b('arrow', { type: direction }, arrowClassName), onClick: (e) => this.handleScrollClick(e, direction) },
88
- react_1.default.createElement(__1.ToggleArrow, { size: arrowSize, type: 'horizontal', iconType: "navigation" }))))));
86
+ arrows.map((direction) => (react_1.default.createElement("div", { key: direction, className: b('arrow', { type: direction }), onClick: (e) => this.handleScrollClick(e, direction) },
87
+ react_1.default.createElement(__1.ToggleArrow, { size: 18, type: 'horizontal', iconType: "navigation" }))))));
89
88
  }
90
89
  }
91
90
  exports.default = OverflowScroller;
@@ -9,6 +9,7 @@ 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"));
12
+ const i18n_1 = tslib_1.__importDefault(require("./i18n"));
12
13
  const RECORD_URL = 'https://www.youtube.com/embed/';
13
14
  const STREAM_URL = 'https://www.youtube.com/embed/live_stream?channel=';
14
15
  const RECORD_RE = /[0-9A-Za-z_-]{11}/;
@@ -73,9 +74,11 @@ const VideoBlock = (props) => {
73
74
  iframe.src = fullSrc;
74
75
  iframe.width = '100%';
75
76
  iframe.height = '100%';
77
+ iframe.title = (0, i18n_1.default)('iframe-title');
76
78
  iframe.frameBorder = '0';
77
79
  iframe.setAttribute('allowfullscreen', 'true');
78
80
  iframe.setAttribute('allow', 'autoplay');
81
+ iframe.setAttribute('loading', 'lazy');
79
82
  ref.current.appendChild(iframe);
80
83
  iframeRef.current = iframe;
81
84
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Video frame"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const registerKeyset_1 = require("../../../utils/registerKeyset");
5
+ const en_json_1 = tslib_1.__importDefault(require("./en.json"));
6
+ const ru_json_1 = tslib_1.__importDefault(require("./ru.json"));
7
+ const COMPONENT = 'VideoBlock';
8
+ exports.default = (0, registerKeyset_1.registerKeyset)({ en: en_json_1.default, ru: ru_json_1.default }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "iframe-title": "Фрейм видеоблока"
3
+ }
@@ -48,6 +48,7 @@ const YandexForm = (props) => {
48
48
  iframeRef.current.src = src;
49
49
  iframeRef.current.id = containerId;
50
50
  iframeRef.current.name = `form${id}`;
51
+ iframeRef.current.setAttribute('loading', 'lazy');
51
52
  iframeRef.current.frameBorder = '0';
52
53
  iframeRef.current.scrolling = 'no';
53
54
  iframeRef.current.width = '100%';
@@ -9,7 +9,6 @@ export declare const blockMap: {
9
9
  "media-block": (props: import("./models").MediaBlockProps) => JSX.Element;
10
10
  "preview-block": (props: import("./models").PreviewBlockProps) => JSX.Element;
11
11
  "info-block": (props: import("./models").InfoBlockProps) => JSX.Element;
12
- "security-block": (props: import("./models").SecurityBlockProps) => JSX.Element;
13
12
  "table-block": (props: import("./models").TableBlockProps) => JSX.Element;
14
13
  "tabs-block": ({ items, title, description, animated, tabsColSizes, centered, direction, }: import("./models").TabsBlockProps) => JSX.Element;
15
14
  "link-table-block": ({ items, title, description, linkTheme }: import("./models").LinkTableBlockProps) => JSX.Element;
@@ -15,7 +15,6 @@ exports.blockMap = {
15
15
  [models_1.BlockType.MediaBlock]: blocks_1.MediaBlock,
16
16
  [models_1.BlockType.PreviewBlock]: blocks_1.PreviewBlock,
17
17
  [models_1.BlockType.InfoBlock]: blocks_1.InfoBlock,
18
- [models_1.BlockType.SecurityBlock]: blocks_1.SecurityBlock,
19
18
  [models_1.BlockType.TableBlock]: blocks_1.TableBlock,
20
19
  [models_1.BlockType.TabsBlock]: blocks_1.TabsBlock,
21
20
  [models_1.BlockType.LinkTableBlock]: blocks_1.LinkTableBlock,
@@ -16,7 +16,6 @@ export declare enum BlockType {
16
16
  MediaBlock = "media-block",
17
17
  PreviewBlock = "preview-block",
18
18
  InfoBlock = "info-block",
19
- SecurityBlock = "security-block",
20
19
  TableBlock = "table-block",
21
20
  TabsBlock = "tabs-block",
22
21
  SimpleBlock = "simple-block",
@@ -204,21 +203,6 @@ export interface InfoBlockProps {
204
203
  leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
205
204
  rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
206
205
  }
207
- export interface SecurityBlockPoint {
208
- img: string;
209
- text: string;
210
- link: {
211
- text: string;
212
- url: string;
213
- };
214
- }
215
- export interface SecurityBlockProps extends Animatable {
216
- theme?: TextTheme;
217
- backgroundColor?: string;
218
- title: string;
219
- points?: SecurityBlockPoint[];
220
- media: MediaProps;
221
- }
222
206
  export interface TableProps {
223
207
  content: string[][];
224
208
  legend?: string[];
@@ -353,9 +337,6 @@ export type PreviewBlockModel = {
353
337
  export type InfoBlockModel = {
354
338
  type: BlockType.InfoBlock;
355
339
  } & InfoBlockProps;
356
- export type SecurityBlockModel = {
357
- type: BlockType.SecurityBlock;
358
- } & SecurityBlockProps;
359
340
  export type TableBlockModel = {
360
341
  type: BlockType.TableBlock;
361
342
  } & TableBlockProps;
@@ -386,6 +367,6 @@ export type ContentLayoutBlockModel = {
386
367
  export type ShareBLockModel = {
387
368
  type: BlockType.ShareBlock;
388
369
  } & ShareBlockProps;
389
- type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | SecurityBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
370
+ type BlockModels = SliderBlockModel | ServiceDemoBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | CalculatorBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | SimpleBlockModel | LinkTableBlockModel | HeaderBlockModel | PreviewBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel;
390
371
  export type Block = BlockModels & BlockBaseProps;
391
372
  export {};
@@ -14,7 +14,6 @@ var BlockType;
14
14
  BlockType["MediaBlock"] = "media-block";
15
15
  BlockType["PreviewBlock"] = "preview-block";
16
16
  BlockType["InfoBlock"] = "info-block";
17
- BlockType["SecurityBlock"] = "security-block";
18
17
  BlockType["TableBlock"] = "table-block";
19
18
  BlockType["TabsBlock"] = "tabs-block";
20
19
  BlockType["SimpleBlock"] = "simple-block";
@@ -14,7 +14,7 @@ const getBlocksCases = (blocks) => {
14
14
  exports.getBlocksCases = getBlocksCases;
15
15
  function generateDefaultSchema(config) {
16
16
  const { cards = {}, blocks = {}, extensions = {} } = config !== null && config !== void 0 ? config : {};
17
- const blockValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.SecurityBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.SimpleBlock), blocks_1.LinkTableBlock), blocks_1.PreviewBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock);
17
+ const blockValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.Divider), blocks_1.ExtendedFeaturesBlock), blocks_1.PromoFeaturesBlock), blocks_1.SliderBlock), blocks_1.QuestionsBlock), blocks_1.HeaderBlock), blocks_1.BannerBlock), blocks_1.CompaniesBlock), blocks_1.MediaBlock), blocks_1.MapBlock), blocks_1.InfoBlock), blocks_1.TableBlock), blocks_1.TabsBlock), blocks_1.SimpleBlock), blocks_1.LinkTableBlock), blocks_1.PreviewBlock), blocks_1.HeaderSliderBlock), blocks_1.IconsBlock), blocks_1.CardLayoutBlock), blocks_1.ContentLayoutBlock), blocks_1.ShareBlock), blocks_1.FilterBlock);
18
18
  const cardValidators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sub_blocks_1.PartnerBlock), sub_blocks_1.MediaCardBlock), blocks_1.BannerCard), sub_blocks_1.PriceDetailedBlock), sub_blocks_1.TutorialCard), sub_blocks_1.BackgroundCard), sub_blocks_1.NewsCard), sub_blocks_1.CardWithImage), sub_blocks_1.Quote), sub_blocks_1.BasicCard);
19
19
  const constructorBlockSchemaNames = [
20
20
  'divider',
@@ -8,7 +8,6 @@ export * from '../../blocks/Info/schema';
8
8
  export * from '../../blocks/Media/schema';
9
9
  export * from '../../blocks/Map/schema';
10
10
  export * from '../../blocks/Questions/schema';
11
- export * from '../../blocks/Security/schema';
12
11
  export * from '../../blocks/Slider/schema';
13
12
  export * from '../../blocks/Table/schema';
14
13
  export * from '../../blocks/LinkTable/schema';
@@ -11,7 +11,6 @@ tslib_1.__exportStar(require("../../blocks/Info/schema"), exports);
11
11
  tslib_1.__exportStar(require("../../blocks/Media/schema"), exports);
12
12
  tslib_1.__exportStar(require("../../blocks/Map/schema"), exports);
13
13
  tslib_1.__exportStar(require("../../blocks/Questions/schema"), exports);
14
- tslib_1.__exportStar(require("../../blocks/Security/schema"), exports);
15
14
  tslib_1.__exportStar(require("../../blocks/Slider/schema"), exports);
16
15
  tslib_1.__exportStar(require("../../blocks/Table/schema"), exports);
17
16
  tslib_1.__exportStar(require("../../blocks/LinkTable/schema"), exports);
@@ -5,7 +5,6 @@ export { default as InfoBlock } from './Info/Info';
5
5
  export { default as MediaBlock } from './Media/Media';
6
6
  export { default as MapBlock } from './Map/Map';
7
7
  export { default as PreviewBlock } from './Preview/Preview';
8
- export { default as SecurityBlock } from './Security/Security';
9
8
  export { default as SliderBlock } from './Slider/Slider';
10
9
  export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
11
10
  export { default as PromoFeaturesBlock } from './PromoFeaturesBlock/PromoFeaturesBlock';
@@ -5,7 +5,6 @@ export { default as InfoBlock } from './Info/Info';
5
5
  export { default as MediaBlock } from './Media/Media';
6
6
  export { default as MapBlock } from './Map/Map';
7
7
  export { default as PreviewBlock } from './Preview/Preview';
8
- export { default as SecurityBlock } from './Security/Security';
9
8
  export { default as SliderBlock } from './Slider/Slider';
10
9
  export { default as ExtendedFeaturesBlock } from './ExtendedFeatures/ExtendedFeatures';
11
10
  export { default as PromoFeaturesBlock } from './PromoFeaturesBlock/PromoFeaturesBlock';
@@ -12,7 +12,6 @@ export * from './Media/schema';
12
12
  export * from './Preview/schema';
13
13
  export * from './PromoFeaturesBlock/schema';
14
14
  export * from './Questions/schema';
15
- export * from './Security/schema';
16
15
  export * from './Simple/schema';
17
16
  export * from './Slider/schema';
18
17
  export * from './Table/schema';
@@ -12,7 +12,6 @@ export * from './Media/schema';
12
12
  export * from './Preview/schema';
13
13
  export * from './PromoFeaturesBlock/schema';
14
14
  export * from './Questions/schema';
15
- export * from './Security/schema';
16
15
  export * from './Simple/schema';
17
16
  export * from './Slider/schema';
18
17
  export * from './Table/schema';
@@ -7,7 +7,7 @@ import { useMetrika } from '../../hooks/useMetrika';
7
7
  import { Github } from '../../icons';
8
8
  import { DefaultEventNames } from '../../models';
9
9
  import { block, setUrlTld } from '../../utils';
10
- import ImageBase from '../ImageBase/ImageBase';
10
+ import i18n from './i18n';
11
11
  import { ICON_QA, toCommonSize, toCommonView } from './utils';
12
12
  import './Button.css';
13
13
  const b = block('button-block');
@@ -36,7 +36,7 @@ const Button = (props) => {
36
36
  return React.createElement(StoreBadge, { className: buttonClass, platform: platform, lang: lang, url: url });
37
37
  }
38
38
  let icon;
39
- let image = img && React.createElement(ImageBase, { className: b('image'), src: buttonImg.url, alt: buttonImg.alt });
39
+ let image = img && (React.createElement("img", { className: b('image'), src: buttonImg.url, alt: buttonImg.alt || i18n('image-alt') }));
40
40
  if (theme === 'github') {
41
41
  icon = React.createElement(Icon, { className: b('icon'), data: Github, size: 24, qa: ICON_QA });
42
42
  image = undefined;
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Button image"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'Button';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Иконка кнопки"
3
+ }
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Icon } from '@gravity-ui/uikit';
3
3
  import { block } from '../../utils';
4
+ import i18n from './i18n';
4
5
  import './Control.css';
5
6
  const b = block('control');
6
7
  const Control = (props) => {
7
8
  const { icon, theme = 'primary', size = 's', iconSize = 16, disabled = false, onClick, className, } = props;
8
- return (React.createElement("button", { type: "button", className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
9
+ return (React.createElement("button", { type: "button", "aria-label": i18n('aria-label'), className: b({ size, theme, disabled }, className), onClick: disabled ? undefined : onClick, disabled: disabled },
9
10
  React.createElement(Icon, { data: icon, size: iconSize })));
10
11
  };
11
12
  export default Control;
@@ -0,0 +1,3 @@
1
+ {
2
+ "aria-label": "Button label"
3
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { registerKeyset } from '../../../utils/registerKeyset';
2
+ import en from './en.json';
3
+ import ru from './ru.json';
4
+ const COMPONENT = 'Control';
5
+ export default registerKeyset({ en, ru }, COMPONENT);
@@ -0,0 +1,3 @@
1
+ {
2
+ "aria-label": "Лейбл кнопки"
3
+ }