@skbkontur/markdown 1.3.0 → 1.3.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/markdown",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -1,4 +1,4 @@
1
- import { Checkbox } from '@skbkontur/react-ui';
1
+ import { Button, Checkbox } from '@skbkontur/react-ui';
2
2
  import React from 'react';
3
3
  import ReactMarkdown from 'react-markdown';
4
4
  import rehypeRaw from 'rehype-raw';
@@ -7,7 +7,7 @@ import remarkBreaks from 'remark-breaks';
7
7
  import gfm from 'remark-gfm';
8
8
  import { MarkdownImage } from './Helpers/MarkdownImage';
9
9
  import { MarkdownLink } from './Helpers/MarkdownLink';
10
- import { BlockQuote, FileButtonWrapper, getListStyle, ListItem, Paragraph, Wrapper } from './MarkdownViewer.styles';
10
+ import { BlockQuote, FileButtonWrapper, getListStyle, ListItem, Paragraph, VisuallyHidden, Wrapper, } from './MarkdownViewer.styles';
11
11
  import { useFileLogic } from '../Markdown/Files/Files.logic';
12
12
  import { AttachPaperclip } from '../MarkdownIcons/AttachPaperclip';
13
13
  export var MarkdownViewer = function (_a) {
@@ -41,9 +41,11 @@ export var MarkdownViewer = function (_a) {
41
41
  if (fileApiUrl && href.startsWith(fileApiUrl)) {
42
42
  var id_1 = href.replace(fileApiUrl, '');
43
43
  return (React.createElement(FileButtonWrapper, null,
44
- React.createElement(AttachPaperclip, null),
45
- "\u00A0",
46
- React.createElement("button", { "aria-label": "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0444\u0430\u0439\u043B ".concat(children), onClick: function () { return downloadFile(id_1); } }, children)));
44
+ React.createElement(Button, { use: "link", icon: React.createElement(AttachPaperclip, null), onClick: function () { return downloadFile(id_1); } },
45
+ children,
46
+ React.createElement(VisuallyHidden, null,
47
+ "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0444\u0430\u0439\u043B $",
48
+ children))));
47
49
  }
48
50
  return href.startsWith('@') ? (React.createElement(MarkdownLink, { href: profileUrl + href.replace('@', '/') }, children)) : (React.createElement(MarkdownLink, { href: href }, children));
49
51
  }
@@ -5,3 +5,4 @@ export declare const Paragraph: import("styled-components").StyledComponent<"p",
5
5
  export declare const BlockQuote: import("styled-components").StyledComponent<"blockquote", import("../..").MarkdownTheme, {}, never>;
6
6
  export declare const FileButtonWrapper: import("styled-components").StyledComponent<"div", import("../..").MarkdownTheme, {}, never>;
7
7
  export declare function getListStyle(depth: boolean): CSSProperties;
8
+ export declare const VisuallyHidden: import("styled-components").StyledComponent<"span", import("../..").MarkdownTheme, {}, never>;
@@ -11,4 +11,5 @@ export var FileButtonWrapper = styled.div(templateObject_5 || (templateObject_5
11
11
  export function getListStyle(depth) {
12
12
  return depth ? { marginTop: 4 } : { marginBottom: 16 };
13
13
  }
14
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
14
+ export var VisuallyHidden = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n"])));
15
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;