diff --git a/package-lock.json b/package-lock.json index f088a8c3..07a18c39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@gravity-ui/icons": "^2.5.0", - "@gravity-ui/uikit": "^5.12.2", + "@gravity-ui/uikit": "^5.19.0", "@popperjs/core": "^2.11.2", "bem-cn-lite": "4.1.0", "i18next": "^19.9.2", @@ -1828,9 +1828,9 @@ "dev": true }, "node_modules/@gravity-ui/uikit": { - "version": "5.12.2", - "resolved": "https://registry.npmjs.org/@gravity-ui/uikit/-/uikit-5.12.2.tgz", - "integrity": "sha512-wb7WfGs8wPGi1e38+axczHGa738fkwR9Z4+o6p3Yuq5rdAb+b1vzVvNVKJQjNWpOpIasBXGZmysct2cEDElbrw==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/@gravity-ui/uikit/-/uikit-5.19.0.tgz", + "integrity": "sha512-fZoGjkbOMngv6tfHroTmipa8shjYaeSGlqUIn16csDp0SUyF75e6TlJBHdnHxSvl0S4InCGPjNlvPEiwcp/Wvw==", "dependencies": { "@bem-react/classname": "^1.6.0", "@gravity-ui/i18n": "^1.1.0", @@ -10069,9 +10069,9 @@ "dev": true }, "@gravity-ui/uikit": { - "version": "5.12.2", - "resolved": "https://registry.npmjs.org/@gravity-ui/uikit/-/uikit-5.12.2.tgz", - "integrity": "sha512-wb7WfGs8wPGi1e38+axczHGa738fkwR9Z4+o6p3Yuq5rdAb+b1vzVvNVKJQjNWpOpIasBXGZmysct2cEDElbrw==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/@gravity-ui/uikit/-/uikit-5.19.0.tgz", + "integrity": "sha512-fZoGjkbOMngv6tfHroTmipa8shjYaeSGlqUIn16csDp0SUyF75e6TlJBHdnHxSvl0S4InCGPjNlvPEiwcp/Wvw==", "requires": { "@bem-react/classname": "^1.6.0", "@gravity-ui/i18n": "^1.1.0", diff --git a/package.json b/package.json index 1493d072..8f93c4ed 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ }, "dependencies": { "@gravity-ui/icons": "^2.5.0", - "@gravity-ui/uikit": "^5.12.2", + "@gravity-ui/uikit": "^5.19.0", "@popperjs/core": "^2.11.2", "bem-cn-lite": "4.1.0", "i18next": "^19.9.2", diff --git a/src/components/MiniToc/MiniToc.tsx b/src/components/MiniToc/MiniToc.tsx index 311efaae..72d97919 100644 --- a/src/components/MiniToc/MiniToc.tsx +++ b/src/components/MiniToc/MiniToc.tsx @@ -57,6 +57,7 @@ const MiniToc = memo(({headings, router, headerHeight, onItemClick router={router} headerHeight={headerHeight} onSectionClick={onItemClick} + aria-label={t('description')} > {flatHeadings.map(({href, title, isChild}) => (
  • diff --git a/src/components/Scrollspy/Scrollspy.tsx b/src/components/Scrollspy/Scrollspy.tsx index e18aa85e..6b93e29e 100644 --- a/src/components/Scrollspy/Scrollspy.tsx +++ b/src/components/Scrollspy/Scrollspy.tsx @@ -1,4 +1,4 @@ -import React, {ReactElement} from 'react'; +import React, {HTMLProps, ReactElement} from 'react'; import {debounce, isEqual} from 'lodash'; import scrollIntoView from 'scroll-into-view-if-needed'; @@ -12,7 +12,9 @@ interface ScrollspyDefaultProps { headerHeight: number; } -export interface ScrollspyProps extends Partial { +export interface ScrollspyProps + extends Partial, + Partial> { items: string[]; children: ReactElement[]; router: Router; @@ -93,7 +95,7 @@ export class Scrollspy extends React.Component { @@ -124,7 +126,7 @@ export class Scrollspy extends React.Component +
      {items}
    ); diff --git a/src/components/Toc/Toc.tsx b/src/components/Toc/Toc.tsx index 19c0b5b7..35eebf8c 100644 --- a/src/components/Toc/Toc.tsx +++ b/src/components/Toc/Toc.tsx @@ -1,5 +1,6 @@ import React from 'react'; +import {getUniqId} from '@gravity-ui/uikit'; import block from 'bem-cn-lite'; import {omit} from 'lodash'; @@ -45,11 +46,13 @@ class Toc extends React.Component { containerEl: HTMLElement | null = null; footerEl: HTMLElement | null = null; + tocTopId: string; constructor(props: TocProps) { super(props); this.state = this.computeState(this.getInitialState()); + this.tocTopId = getUniqId(); } getInitialState() { @@ -162,7 +165,7 @@ class Toc extends React.Component { : {}; return ( -
      +
        {items.map((item, index) => { const main = !this.state.registry.getParentId(item.id); const active = @@ -233,8 +236,12 @@ class Toc extends React.Component { } return ( -
        - {tocTitleIcon ?
        {tocTitleIcon}
        : null} +
        + {tocTitleIcon ? ( +
        + {tocTitleIcon} +
        + ) : null} {topHeader}
        ); diff --git a/src/i18n/en.json b/src/i18n/en.json index 0dc609c3..336defac 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -46,7 +46,8 @@ "lang-control-text-en": "English" }, "mini-toc": { - "title": "In this article" + "title": "In this article", + "description": "Current article contents" }, "toc-nav-panel": { "hint_previous": "Previous", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index fe6fb021..874fff15 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -46,7 +46,8 @@ "lang-control-text-en": "English" }, "mini-toc": { - "title": "В этой статье" + "title": "В этой статье", + "description": "Содержание текущей статьи" }, "toc-nav-panel": { "hint_previous": "Предыдущая",