@skbkontur/markdown 2.4.5 → 2.4.6

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": "2.4.5",
3
+ "version": "2.4.6",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const CheckboxCheckedIcon: () => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { useTheme } from '../styles/styled-components';
3
+ export var CheckboxCheckedIcon = function () {
4
+ var colors = useTheme().colors;
5
+ return (React.createElement("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
6
+ React.createElement("path", { d: "M14.7617 2C16.9709 2 18.7617 3.79086 18.7617 6V14C18.7617 16.2091 16.9709 18 14.7617 18H6.76172C4.55258 18 2.76172 16.2091 2.76172 14V6C2.76172 3.79086 4.55258 2 6.76172 2H14.7617Z", fill: colors.brand }),
7
+ React.createElement("path", { d: "M15.0905 8.25982C15.3834 7.96693 15.3834 7.49206 15.0905 7.19916C14.7976 6.90627 14.3228 6.90627 14.0299 7.19916L9.8555 11.3735C9.66024 11.5688 9.34365 11.5688 9.14839 11.3735L7.49322 9.71837C7.20032 9.42547 6.72545 9.42548 6.43256 9.71837C6.13967 10.0113 6.13967 10.4861 6.43256 10.779L8.08773 12.4342C8.86878 13.2152 10.1351 13.2152 10.9162 12.4342L15.0905 8.25982Z", fill: "white" })));
8
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const CheckboxUncheckedIcon: () => JSX.Element;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { useTheme } from '../styles/styled-components';
3
+ export var CheckboxUncheckedIcon = function () {
4
+ var colors = useTheme().colors;
5
+ return (React.createElement("svg", { width: "21", height: "20", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
6
+ React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.76172 5.73333C2.76172 3.67147 4.43319 2 6.49505 2H15.0284C17.0902 2 18.7617 3.67147 18.7617 5.73333V14.2667C18.7617 16.3285 17.0902 18 15.0284 18H6.49505C4.43319 18 2.76172 16.3285 2.76172 14.2667V5.73333ZM6.49505 3.06667C5.02229 3.06667 3.82839 4.26057 3.82839 5.73333V14.2667C3.82839 15.7394 5.02229 16.9333 6.49505 16.9333H15.0284C16.5011 16.9333 17.6951 15.7394 17.6951 14.2667V5.73333C17.6951 4.26057 16.5011 3.06667 15.0284 3.06667H6.49505Z", fill: colors.grayDefault })));
7
+ };
@@ -24,6 +24,8 @@ import { MarkdownTable } from './Helpers/MarkdownTable';
24
24
  import { BlockQuote, CheckBoxWrapper, FileButtonWrapper, FileName, getListStyle, ListItem, Paragraph, VisuallyHidden, Wrapper, } from './MarkdownViewer.styles';
25
25
  import { useFileLogic } from '../Markdown/Files/Files.logic';
26
26
  import { AttachPaperclip } from '../MarkdownIcons/AttachPaperclip';
27
+ import { CheckboxCheckedIcon } from '../MarkdownIcons/CheckboxCheckedIcon';
28
+ import { CheckboxUncheckedIcon } from '../MarkdownIcons/CheckboxUncheckedIcon';
27
29
  import { ThemeProvider } from '../styles/styled-components';
28
30
  import { DEFAULT_MARKDOWN_THEME, MarkdownThemeConsumer } from '../styles/theme';
29
31
  export var MarkdownViewer = function (_a) {
@@ -83,9 +85,7 @@ export var MarkdownViewer = function (_a) {
83
85
  return React.createElement(ListItem, null, children);
84
86
  }
85
87
  function renderInput(props) {
86
- return (React.createElement(React.Fragment, null,
87
- React.createElement(CheckBoxWrapper, { checked: props.checked }),
88
- props.children));
88
+ return React.createElement(CheckBoxWrapper, null, props.checked ? React.createElement(CheckboxCheckedIcon, null) : React.createElement(CheckboxUncheckedIcon, null));
89
89
  }
90
90
  function renderList(props) {
91
91
  return React.createElement("ul", { style: getListStyle(!!props.depth) }, props.children);
@@ -1,6 +1,5 @@
1
- import { Checkbox } from '@skbkontur/react-ui';
2
1
  import { CSSProperties } from 'react';
3
- export declare const CheckBoxWrapper: import("styled-components").StyledComponent<typeof Checkbox, import("../..").MarkdownTheme, {}, never>;
2
+ export declare const CheckBoxWrapper: import("styled-components").StyledComponent<"span", import("../..").MarkdownTheme, {}, never>;
4
3
  export declare const Wrapper: import("styled-components").StyledComponent<"div", import("../..").MarkdownTheme, {}, never>;
5
4
  export declare const ListItem: import("styled-components").StyledComponent<"li", import("../..").MarkdownTheme, {}, never>;
6
5
  export declare const Paragraph: import("styled-components").StyledComponent<"p", import("../..").MarkdownTheme, {}, never>;
@@ -2,10 +2,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
2
2
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
3
  return cooked;
4
4
  };
5
- import { Checkbox } from '@skbkontur/react-ui';
6
5
  import styled, { css } from '../styles/styled-components';
7
6
  var baseVisuallyHiddenStyle = css(templateObject_1 || (templateObject_1 = __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"])));
8
- export var CheckBoxWrapper = styled(Checkbox)(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
7
+ export var CheckBoxWrapper = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-flex;\n align-items: baseline;\n transform: translateX(-10%);\n"], ["\n display: inline-flex;\n align-items: baseline;\n transform: translateX(-10%);\n"])));
9
8
  export var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow-wrap: break-word;\n word-wrap: break-word;\n position: relative;\n\n word-break: break-word;\n\n p,\n hr,\n table,\n blockquote {\n margin-bottom: 16px;\n }\n\n ul > li > ", ", ul > li > p > ", " {\n display: inline-flex;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n padding: 0;\n }\n\n ul,\n ol,\n li {\n p {\n margin: 0;\n }\n }\n\n h1 {\n margin-top: 36px;\n margin-bottom: 28px;\n }\n\n h2 {\n margin-top: 32px;\n margin-bottom: 24px;\n }\n\n h3 {\n margin-top: 28px;\n margin-bottom: 20px;\n }\n\n h4 {\n margin-top: 24px;\n margin-bottom: 16px;\n }\n\n img {\n max-width: 100%;\n }\n\n button {\n text-align: left;\n color: ", ";\n }\n\n table {\n background: transparent;\n }\n\n blockquote {\n margin: 24px 0;\n padding-left: 16px;\n }\n\n hr {\n margin-top: 0;\n }\n\n code {\n display: inline-block;\n white-space: pre-wrap;\n padding: 4px;\n border-radius: 8px;\n border: 1px solid ", ";\n }\n\n ul,\n ol {\n padding-inline-start: 0;\n\n li {\n margin-inline-start: 0;\n margin: 8px 0 8px 20px;\n }\n }\n\n .math {\n [aria-hidden='true'] {\n ", ";\n }\n }\n\n & > *:first-child {\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n\n & > *:last-child {\n margin-bottom: 0 !important;\n padding-bottom: 0 !important;\n }\n"], ["\n overflow-wrap: break-word;\n word-wrap: break-word;\n position: relative;\n\n word-break: break-word;\n\n p,\n hr,\n table,\n blockquote {\n margin-bottom: 16px;\n }\n\n ul > li > ", ", ul > li > p > ", " {\n display: inline-flex;\n position: absolute;\n inset-inline-start: 0;\n inset-block-start: 0;\n padding: 0;\n }\n\n ul,\n ol,\n li {\n p {\n margin: 0;\n }\n }\n\n h1 {\n margin-top: 36px;\n margin-bottom: 28px;\n }\n\n h2 {\n margin-top: 32px;\n margin-bottom: 24px;\n }\n\n h3 {\n margin-top: 28px;\n margin-bottom: 20px;\n }\n\n h4 {\n margin-top: 24px;\n margin-bottom: 16px;\n }\n\n img {\n max-width: 100%;\n }\n\n button {\n text-align: left;\n color: ", ";\n }\n\n table {\n background: transparent;\n }\n\n blockquote {\n margin: 24px 0;\n padding-left: 16px;\n }\n\n hr {\n margin-top: 0;\n }\n\n code {\n display: inline-block;\n white-space: pre-wrap;\n padding: 4px;\n border-radius: 8px;\n border: 1px solid ", ";\n }\n\n ul,\n ol {\n padding-inline-start: 0;\n\n li {\n margin-inline-start: 0;\n margin: 8px 0 8px 20px;\n }\n }\n\n .math {\n [aria-hidden='true'] {\n ", ";\n }\n }\n\n & > *:first-child {\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n\n & > *:last-child {\n margin-bottom: 0 !important;\n padding-bottom: 0 !important;\n }\n"])), CheckBoxWrapper, CheckBoxWrapper, function (p) { var _a, _b; return (_b = (_a = p.theme) === null || _a === void 0 ? void 0 : _a.colors) === null || _b === void 0 ? void 0 : _b.link; }, function (p) { var _a, _b; return (_b = (_a = p.theme) === null || _a === void 0 ? void 0 : _a.colors) === null || _b === void 0 ? void 0 : _b.grayDefault; }, baseVisuallyHiddenStyle);
10
9
  export var ListItem = styled.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n list-style: none;\n margin-left: 0 !important;\n padding-inline-start: 20px;\n position: relative;\n"], ["\n list-style: none;\n margin-left: 0 !important;\n padding-inline-start: 20px;\n position: relative;\n"])));
11
10
  export var Paragraph = styled.p(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));