@gravity-ui/page-constructor 5.17.2 → 5.18.1-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 (67) hide show
  1. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.css +2 -0
  2. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -1
  3. package/build/cjs/blocks/HeaderSlider/HeaderSlider.js +2 -2
  4. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +4 -1
  5. package/build/cjs/blocks/SliderNew/Slider.css +15 -4
  6. package/build/cjs/blocks/SliderNew/useSlider.d.ts +1 -0
  7. package/build/cjs/blocks/SliderNew/useSlider.js +1 -0
  8. package/build/cjs/components/DefaultVideo/DefaultVideo.js +2 -0
  9. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -1
  10. package/build/cjs/components/HeaderBreadcrumbs/i18n/en.json +3 -0
  11. package/build/cjs/components/HeaderBreadcrumbs/i18n/index.d.ts +1 -0
  12. package/build/cjs/components/HeaderBreadcrumbs/i18n/index.js +9 -0
  13. package/build/cjs/components/HeaderBreadcrumbs/i18n/ru.json +3 -0
  14. package/build/cjs/components/ImageBase/ImageBase.js +1 -0
  15. package/build/cjs/components/Media/Image/Image.js +2 -2
  16. package/build/cjs/components/OutsideClick/OutsideClick.js +3 -0
  17. package/build/cjs/components/ReactPlayer/ReactPlayer.js +3 -0
  18. package/build/cjs/components/Title/TitleItem.js +3 -0
  19. package/build/cjs/components/VideoBlock/VideoBlock.js +3 -0
  20. package/build/cjs/editor/components/AddBlock/AddBlock.js +3 -0
  21. package/build/cjs/editor/components/EditBlock/EditBlock.js +3 -0
  22. package/build/cjs/models/navigation.d.ts +1 -0
  23. package/build/cjs/navigation/components/Logo/Logo.d.ts +1 -0
  24. package/build/cjs/navigation/components/Logo/Logo.js +5 -1
  25. package/build/cjs/navigation/components/Logo/i18n/en.json +3 -0
  26. package/build/cjs/navigation/components/Logo/i18n/index.d.ts +1 -0
  27. package/build/cjs/navigation/components/Logo/i18n/index.js +9 -0
  28. package/build/cjs/navigation/components/Logo/i18n/ru.json +3 -0
  29. package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +16 -0
  30. package/build/cjs/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +2 -2
  31. package/build/cjs/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +7 -0
  32. package/build/cjs/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +1 -1
  33. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.css +2 -0
  34. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -1
  35. package/build/esm/blocks/HeaderSlider/HeaderSlider.js +1 -1
  36. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +4 -1
  37. package/build/esm/blocks/SliderNew/Slider.css +15 -4
  38. package/build/esm/blocks/SliderNew/useSlider.d.ts +1 -0
  39. package/build/esm/blocks/SliderNew/useSlider.js +1 -0
  40. package/build/esm/components/DefaultVideo/DefaultVideo.js +2 -0
  41. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +2 -1
  42. package/build/esm/components/HeaderBreadcrumbs/i18n/en.json +3 -0
  43. package/build/esm/components/HeaderBreadcrumbs/i18n/index.d.ts +1 -0
  44. package/build/esm/components/HeaderBreadcrumbs/i18n/index.js +5 -0
  45. package/build/esm/components/HeaderBreadcrumbs/i18n/ru.json +3 -0
  46. package/build/esm/components/ImageBase/ImageBase.js +1 -0
  47. package/build/esm/components/Media/Image/Image.js +1 -1
  48. package/build/esm/components/OutsideClick/OutsideClick.js +3 -0
  49. package/build/esm/components/ReactPlayer/ReactPlayer.js +3 -0
  50. package/build/esm/components/Title/TitleItem.js +3 -0
  51. package/build/esm/components/VideoBlock/VideoBlock.js +3 -0
  52. package/build/esm/editor/components/AddBlock/AddBlock.js +3 -0
  53. package/build/esm/editor/components/EditBlock/EditBlock.js +3 -0
  54. package/build/esm/models/navigation.d.ts +1 -0
  55. package/build/esm/navigation/components/Logo/Logo.d.ts +1 -0
  56. package/build/esm/navigation/components/Logo/Logo.js +6 -1
  57. package/build/esm/navigation/components/Logo/i18n/en.json +3 -0
  58. package/build/esm/navigation/components/Logo/i18n/index.d.ts +1 -0
  59. package/build/esm/navigation/components/Logo/i18n/index.js +5 -0
  60. package/build/esm/navigation/components/Logo/i18n/ru.json +3 -0
  61. package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.css +16 -0
  62. package/build/esm/navigation/components/NavigationItem/components/NavigationDropdown/NavigationDropdown.js +2 -2
  63. package/build/esm/navigation/components/NavigationItem/components/NavigationLink/NavigationLink.css +7 -0
  64. package/build/esm/sub-blocks/PriceDetailed/PriceDetails/Details/List.js +1 -1
  65. package/package.json +4 -4
  66. package/server/models/navigation.d.ts +1 -0
  67. package/widget/index.js +1 -1
@@ -1,3 +1,4 @@
1
+ import { __rest } from "tslib";
1
2
  import React, { Fragment, useContext } from 'react';
2
3
  import { Image } from '../../../components';
3
4
  import { getMediaImage } from '../../../components/Media/Image/utils';
@@ -5,13 +6,17 @@ import RouterLink from '../../../components/RouterLink/RouterLink';
5
6
  import { LocationContext } from '../../../context/locationContext';
6
7
  import { useTheme } from '../../../context/theme';
7
8
  import { block, getLinkProps, getThemedValue } from '../../../utils';
9
+ import { i18n } from './i18n';
8
10
  import './Logo.css';
9
11
  const b = block('logo');
10
- const Logo = (props) => {
12
+ const Logo = (_a) => {
13
+ var { alt = i18n('image-alt') } = _a, restProps = __rest(_a, ["alt"]);
14
+ const props = Object.assign(Object.assign({}, restProps), { alt });
11
15
  const { hostname, Link } = useContext(LocationContext);
12
16
  const theme = useTheme();
13
17
  const themedLogoProps = getThemedValue(props, theme) || props;
14
18
  const imageData = getMediaImage(themedLogoProps.icon || props.icon);
19
+ imageData.alt = alt;
15
20
  const textData = themedLogoProps.text || props.text;
16
21
  const url = themedLogoProps.url || props.url || '/';
17
22
  const urlTitle = themedLogoProps.urlTitle || props.urlTitle || textData;
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Logo icon"
3
+ }
@@ -0,0 +1 @@
1
+ export declare const i18n: (key: "image-alt", params?: import("@gravity-ui/i18n").Params | undefined) => string;
@@ -0,0 +1,5 @@
1
+ import { addComponentKeysets } from '@gravity-ui/uikit/i18n';
2
+ import { NAMESPACE } from '../../../../utils/cn';
3
+ import en from './en.json';
4
+ import ru from './ru.json';
5
+ export const i18n = addComponentKeysets({ en, ru }, `${NAMESPACE}Logo`);
@@ -0,0 +1,3 @@
1
+ {
2
+ "image-alt": "Иконка лого"
3
+ }
@@ -1,8 +1,24 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
1
3
  .pc-navigation-dropdown {
2
4
  position: relative;
3
5
  display: flex;
4
6
  align-items: center;
5
7
  white-space: nowrap;
8
+ display: flex;
9
+ align-items: center;
10
+ height: 100%;
11
+ background: inherit;
12
+ font: inherit;
13
+ color: var(--g-color-text-primary);
14
+ border: none;
15
+ }
16
+ .pc-navigation-dropdown:focus {
17
+ outline: 2px solid var(--g-color-line-focus);
18
+ outline-offset: 0;
19
+ }
20
+ .pc-navigation-dropdown:focus:not(:focus-visible) {
21
+ outline: 0;
6
22
  }
7
23
  .pc-navigation-dropdown__arrow {
8
24
  margin-left: 7px;
@@ -13,8 +13,8 @@ export const NavigationDropdown = (_a) => {
13
13
  const iconData = icon && getMediaImage(icon);
14
14
  const anchorRef = useRef(null);
15
15
  return (React.createElement(Fragment, null,
16
- React.createElement("span", Object.assign({ ref: anchorRef }, props, { className: b(null, className) }),
17
- React.createElement(ContentWrapper, { text: text, icon: iconData, iconSize: iconSize }),
16
+ React.createElement("button", Object.assign({ ref: anchorRef }, props, { type: "button", className: b(null, className), "aria-expanded": isActive }),
17
+ React.createElement(ContentWrapper, { text: text, icon: iconData, iconSize: iconSize, "aria-expanded": isActive }),
18
18
  React.createElement(ToggleArrow, { className: b('arrow'), size: TOGGLE_ARROW_SIZE, type: 'vertical', iconType: "navigation", open: isActive })),
19
19
  React.createElement(NavigationPopup, { open: isActive, onClose: hidePopup, items: items, anchorRef: anchorRef })));
20
20
  };
@@ -16,6 +16,13 @@ unpredictable css rules order in build */
16
16
  .pc-navigation-link:hover, .pc-navigation-link_active {
17
17
  color: var(--g-color-text-link);
18
18
  }
19
+ .pc-navigation-link:focus {
20
+ outline: 2px solid var(--g-color-line-focus);
21
+ outline-offset: 0;
22
+ }
23
+ .pc-navigation-link:focus:not(:focus-visible) {
24
+ outline: 0;
25
+ }
19
26
  .pc-navigation-link__arrow {
20
27
  position: relative;
21
28
  top: -2px;
@@ -6,7 +6,7 @@ const b = block('marked-list');
6
6
  const List = (props) => {
7
7
  const { items = [], titleSize = 's' } = props;
8
8
  return (React.createElement(Fragment, null, items.map((item, id) => (React.createElement("div", { key: id, className: b('list-item') },
9
- React.createElement("img", { className: b('img') }),
9
+ React.createElement("img", { className: b('img'), alt: "" }),
10
10
  React.createElement("div", { className: b('text', { size: titleSize }) },
11
11
  React.createElement(YFMWrapper, { content: item.text, modifiers: { constructor: true } })))))));
12
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.17.2",
3
+ "version": "5.18.1-alpha.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -124,14 +124,14 @@
124
124
  "@commitlint/cli": "^17.1.2",
125
125
  "@commitlint/config-conventional": "^17.1.0",
126
126
  "@diplodoc/transform": "^4.10.8",
127
- "@gravity-ui/eslint-config": "^2.0.0",
127
+ "@gravity-ui/eslint-config": "^2.2.0",
128
128
  "@gravity-ui/icons": "^2.8.1",
129
129
  "@gravity-ui/prettier-config": "^1.0.1",
130
130
  "@gravity-ui/stylelint-config": "^1.0.0",
131
131
  "@gravity-ui/tsconfig": "^1.0.0",
132
132
  "@gravity-ui/uikit": "^6.2.0",
133
- "@playwright/experimental-ct-react": "^1.38.1",
134
- "@playwright/test": "^1.38.1",
133
+ "@playwright/experimental-ct-react": "^1.45.3",
134
+ "@playwright/test": "^1.45.3",
135
135
  "@storybook/addon-actions": "8.0.5",
136
136
  "@storybook/addon-essentials": "8.0.5",
137
137
  "@storybook/addon-knobs": "^7.0.2",
@@ -63,6 +63,7 @@ export interface NavigationLogoData {
63
63
  text?: string;
64
64
  url?: string;
65
65
  urlTitle?: string;
66
+ alt?: string;
66
67
  }
67
68
  export type ThemedNavigationLogoData = NavigationLogoData & ThemeSupporting<NavigationLogoData>;
68
69
  export interface HeaderData {