@skbkontur/markdown 1.1.2 → 1.2.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/markdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"author": "tsypilov",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@types/styled-components": "5.1.0",
|
|
14
|
+
"@types/turndown": "^5.0.1",
|
|
15
|
+
"@types/uuid": "^9.0.1",
|
|
13
16
|
"react-dropzone": "^14.2.3",
|
|
14
17
|
"react-foco": "^1.3.1",
|
|
15
18
|
"react-markdown": "^8.0.7",
|
|
@@ -31,7 +34,7 @@
|
|
|
31
34
|
"lint:fix": "eslint --ext=.ts,tsx src --fix",
|
|
32
35
|
"stylelint": "stylelint 'src/**/*.{tsx,ts}'",
|
|
33
36
|
"prepare": "husky install .husky",
|
|
34
|
-
"storybook": "start-storybook -p
|
|
37
|
+
"storybook": "start-storybook -p 6007 -s public",
|
|
35
38
|
"build-storybook": "build-storybook --quiet",
|
|
36
39
|
"test-storybook": "test-storybook",
|
|
37
40
|
"test": "jest test",
|
|
@@ -69,9 +72,6 @@
|
|
|
69
72
|
"@types/node": "12.0.0",
|
|
70
73
|
"@types/react": "16.9.0",
|
|
71
74
|
"@types/react-dom": "16.9.0",
|
|
72
|
-
"@types/styled-components": "5.1.0",
|
|
73
|
-
"@types/turndown": "^5.0.1",
|
|
74
|
-
"@types/uuid": "^9.0.1",
|
|
75
75
|
"@typescript-eslint/eslint-plugin": "5.57.0",
|
|
76
76
|
"@typescript-eslint/parser": "5.57.0",
|
|
77
77
|
"axe-playwright": "1.2.3",
|
|
@@ -14,9 +14,8 @@ export function setMarkdown(textareaNode, text, format, selectionStart, selectio
|
|
|
14
14
|
var _b = checkSpaceSymbol(prevCommentPart, markdownHelpItem.checkLength), value = _b.value, spaces = _b.spaces;
|
|
15
15
|
var nextCommentPart = markdownHelpItem.wrapContent(value) + spaces;
|
|
16
16
|
document.execCommand('insertText', false, nextCommentPart);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
((markdownHelpItem === null || markdownHelpItem === void 0 ? void 0 : markdownHelpItem.format) === MarkdownFormat.ref ? 4 : ((_a = markdownHelpItem === null || markdownHelpItem === void 0 ? void 0 : markdownHelpItem.checkLength) !== null && _a !== void 0 ? _a : 0) * 2) -
|
|
17
|
+
setTextareaCursor(format, prevCommentPart.length, nextCommentPart.length, textareaNode, (selectionEnd !== null && selectionEnd !== void 0 ? selectionEnd : 0) +
|
|
18
|
+
((markdownHelpItem === null || markdownHelpItem === void 0 ? void 0 : markdownHelpItem.format) === MarkdownFormat.ref ? 0 : (_a = markdownHelpItem === null || markdownHelpItem === void 0 ? void 0 : markdownHelpItem.checkLength) !== null && _a !== void 0 ? _a : 0) -
|
|
20
19
|
spaces.length);
|
|
21
20
|
}
|
|
22
21
|
}
|
|
@@ -3,7 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
5
|
import styled from '../styles/styled-components';
|
|
6
|
-
export var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-wrap: break-word;\n word-wrap: break-word;\n\n word-break: break-word;\n\n p,\n table,\n blockquote {\n margin-bottom:
|
|
6
|
+
export var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-wrap: break-word;\n word-wrap: break-word;\n\n word-break: break-word;\n\n p,\n table,\n blockquote {\n margin-bottom: 16px;\n }\n\n ul,\n ol {\n p {\n margin-bottom: 0;\n }\n }\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n margin-bottom: 8px;\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 overflow-wrap: break-word;\n word-wrap: break-word;\n\n word-break: break-word;\n\n p,\n table,\n blockquote {\n margin-bottom: 16px;\n }\n\n ul,\n ol {\n p {\n margin-bottom: 0;\n }\n }\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n margin-bottom: 8px;\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"])), 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; });
|
|
7
7
|
export var ListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n list-style: none;\n margin-inline-start: -20px;\n"], ["\n list-style: none;\n margin-inline-start: -20px;\n"])));
|
|
8
8
|
export var Paragraph = styled.p(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0;\n"], ["\n margin: 0;\n"])));
|
|
9
9
|
export var BlockQuote = styled.blockquote(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0;\n padding-left: 8px;\n border-left: 4px solid ", ";\n"], ["\n margin: 0;\n padding-left: 8px;\n border-left: 4px solid ", ";\n"])), 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; });
|