@skbkontur/markdown 1.3.5 → 1.4.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/index.d.ts +4 -1
- package/index.js +4 -1
- package/package.json +7 -8
- package/src/Markdown/Markdown.js +3 -3
- package/src/Markdown/Markdown.styled.d.ts +3428 -22
- package/src/Markdown/Markdown.styled.js +2 -2
- package/src/MarkdownIcons/AttachLink.d.ts +1 -0
- package/src/MarkdownIcons/AttachPaperclip.d.ts +1 -0
- package/src/MarkdownIcons/CheckedList.d.ts +1 -0
- package/src/MarkdownIcons/Collapse.d.ts +1 -0
- package/src/MarkdownIcons/Expand.d.ts +1 -0
- package/src/MarkdownIcons/EyeOpen.d.ts +1 -0
- package/src/MarkdownIcons/List.d.ts +1 -0
- package/src/MarkdownIcons/MarkdownIcons.styled.d.ts +260 -2
- package/src/MarkdownIcons/MarkdownIcons.styled.js +3 -4
- package/src/MarkdownIcons/NumberedList.d.ts +1 -0
- package/src/MarkdownIcons/Table.d.ts +1 -0
- package/src/MarkdownIcons/ToolPencil.d.ts +1 -0
- package/src/MarkdownViewer/Helpers/MarkdownLink.d.ts +1 -0
- package/src/MarkdownViewer/MarkdownViewer.styles.d.ts +1824 -7
- package/src/MarkdownViewer/MarkdownViewer.styles.js +1 -1
- package/src/styles/styled.d.ts +6 -0
- package/src/styles/types.d.ts +6 -0
- package/src/styles/styled-components.d.ts +0 -5
- package/src/styles/styled-components.js +0 -4
package/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { MarkdownThemeConsumerType, MarkdownThemeProviderType } from './src/styles/types';
|
|
2
|
+
declare const MarkdownThemeProvider: MarkdownThemeProviderType;
|
|
3
|
+
declare const MarkdownThemeConsumer: MarkdownThemeConsumerType;
|
|
1
4
|
export { Markdown, MarkdownProps } from './src/Markdown/Markdown';
|
|
2
5
|
export { MarkdownCombination } from './src/Markdown/MarkdownHelpers/MarkdownCombination';
|
|
3
6
|
export { markdownHelpItems, markdownHelpFiles, markdownHelpLists, markdownHelpOther, } from './src/Markdown/MarkdownHelpItems';
|
|
@@ -5,4 +8,4 @@ export { MarkdownViewer } from './src/MarkdownViewer/MarkdownViewer';
|
|
|
5
8
|
export { MarkdownTheme } from './src/styles/theme';
|
|
6
9
|
export { MarkdownApi, RefItem, User, Token, HorizontalPaddings, ViewMode } from '././src/Markdown/types';
|
|
7
10
|
export { ThemeMode, ColorScheme } from './src/styles/types';
|
|
8
|
-
export { MarkdownThemeProvider, MarkdownThemeConsumer }
|
|
11
|
+
export { MarkdownThemeProvider, MarkdownThemeConsumer };
|
package/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { ThemeProvider, ThemeConsumer } from 'styled-components';
|
|
2
|
+
var MarkdownThemeProvider = ThemeProvider;
|
|
3
|
+
var MarkdownThemeConsumer = ThemeConsumer;
|
|
1
4
|
export { Markdown } from './src/Markdown/Markdown';
|
|
2
5
|
export { MarkdownCombination } from './src/Markdown/MarkdownHelpers/MarkdownCombination';
|
|
3
6
|
export { markdownHelpItems, markdownHelpFiles, markdownHelpLists, markdownHelpOther, } from './src/Markdown/MarkdownHelpItems';
|
|
4
7
|
export { MarkdownViewer } from './src/MarkdownViewer/MarkdownViewer';
|
|
5
8
|
export { ViewMode } from '././src/Markdown/types';
|
|
6
|
-
export { MarkdownThemeProvider, MarkdownThemeConsumer }
|
|
9
|
+
export { MarkdownThemeProvider, MarkdownThemeConsumer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/markdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"license": "UNLICENSED",
|
|
11
11
|
"author": "tsypilov",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@types/styled-components": "5.1.26",
|
|
14
13
|
"@types/turndown": "^5.0.1",
|
|
15
14
|
"@types/uuid": "^9.0.1",
|
|
16
15
|
"react-dropzone": "^14.2.3",
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
"rehype-sanitize": "5.0.1",
|
|
21
20
|
"remark-breaks": "^3.0.3",
|
|
22
21
|
"remark-gfm": "^3.0.1",
|
|
23
|
-
"styled-components": "
|
|
22
|
+
"styled-components": "6.1.1",
|
|
24
23
|
"turndown": "^7.1.2",
|
|
25
24
|
"turndown-plugin-gfm": "^1.0.2",
|
|
26
25
|
"uuid": "^9.0.0"
|
|
@@ -32,7 +31,7 @@
|
|
|
32
31
|
"lint-staged": "lint-staged",
|
|
33
32
|
"lint": "eslint --ext=ts,tsx src && yarn stylelint",
|
|
34
33
|
"lint:fix": "eslint --ext=.ts,tsx src --fix",
|
|
35
|
-
"stylelint": "stylelint
|
|
34
|
+
"stylelint": "stylelint \"src/**/*.{tsx,ts}\"",
|
|
36
35
|
"prepare": "husky install .husky",
|
|
37
36
|
"storybook": "start-storybook -p 6007 -s public",
|
|
38
37
|
"build-storybook": "build-storybook --quiet",
|
|
@@ -94,13 +93,13 @@
|
|
|
94
93
|
"jest-teamcity-reporter": "0.9.0",
|
|
95
94
|
"lerna": "5.0.0",
|
|
96
95
|
"lint-staged": "^12.3.4",
|
|
96
|
+
"postcss": "8",
|
|
97
|
+
"postcss-styled-syntax": "0.5.0",
|
|
97
98
|
"prettier": "2.2.1",
|
|
98
99
|
"react": "16.9.0",
|
|
99
100
|
"react-dom": "16.9.0",
|
|
100
|
-
"stylelint": "
|
|
101
|
-
"stylelint-config-standard": "
|
|
102
|
-
"stylelint-config-styled-components": "^0.1.1",
|
|
103
|
-
"stylelint-processor-styled-components": "^1.10.0",
|
|
101
|
+
"stylelint": "15.11.0",
|
|
102
|
+
"stylelint-config-standard": "34.0.0",
|
|
104
103
|
"typescript": "4.9.4"
|
|
105
104
|
},
|
|
106
105
|
"files": [
|
package/src/Markdown/Markdown.js
CHANGED
|
@@ -24,6 +24,7 @@ import { SidePage, ThemeContext } from '@skbkontur/react-ui';
|
|
|
24
24
|
import { HideBodyVerticalScroll } from '@skbkontur/react-ui/internal/HideBodyVerticalScroll';
|
|
25
25
|
import React, { useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
26
26
|
import Foco from 'react-foco/lib';
|
|
27
|
+
import { ThemeConsumer, ThemeProvider } from 'styled-components';
|
|
27
28
|
import { MENTION_WRAPPER_ID_POSTFIX } from './constants';
|
|
28
29
|
import { useFileLogic } from './Files/Files.logic';
|
|
29
30
|
import { DroppablePlaceholder, getMarkdownReactUiTheme, MarkdownEditorBlock, MarkdownPreview, MentionWrapper, Wrapper, } from './Markdown.styled';
|
|
@@ -37,7 +38,6 @@ import { ViewMode } from './types';
|
|
|
37
38
|
import { Guid } from './utils/guid';
|
|
38
39
|
import { RequestStatus } from './utils/requestStatus';
|
|
39
40
|
import { MarkdownViewer } from '../MarkdownViewer';
|
|
40
|
-
import { MarkdownThemeProvider, MarkdownThemeConsumer } from '../styles/styled-components';
|
|
41
41
|
import { DEFAULT_MARKDOWN_THEME } from '../styles/theme';
|
|
42
42
|
export var Markdown = function (props) {
|
|
43
43
|
var _a;
|
|
@@ -80,10 +80,10 @@ export var Markdown = function (props) {
|
|
|
80
80
|
isEditMode && renderEditContainer(),
|
|
81
81
|
isDragActive && isEditMode && React.createElement(DroppablePlaceholder, __assign({}, horizontalPaddings))),
|
|
82
82
|
!isEditMode && (React.createElement(MarkdownPreview, __assign({}, horizontalPaddings), (markdownViewer === null || markdownViewer === void 0 ? void 0 : markdownViewer(props.value)) || (React.createElement(MarkdownViewer, { source: (_a = props.value) !== null && _a !== void 0 ? _a : '', downloadFileApi: api === null || api === void 0 ? void 0 : api.fileDownloadApi, fileApiUrl: fileApiUrl, profileUrl: profileUrl }))))));
|
|
83
|
-
return (React.createElement(
|
|
83
|
+
return (React.createElement(ThemeConsumer, null, function (theme) {
|
|
84
84
|
var defaultTheme = theme !== null && theme !== void 0 ? theme : DEFAULT_MARKDOWN_THEME;
|
|
85
85
|
var reactUiTheme = getMarkdownReactUiTheme(defaultTheme, theme === null || theme === void 0 ? void 0 : theme.reactUiTheme, panelHorizontalPadding, fullscreenTextareaPadding);
|
|
86
|
-
return (React.createElement(
|
|
86
|
+
return (React.createElement(ThemeProvider, { theme: defaultTheme },
|
|
87
87
|
React.createElement(ThemeContext.Provider, { value: reactUiTheme }, fullscreen ? renderFullScreen() : content)));
|
|
88
88
|
}));
|
|
89
89
|
function renderFullScreen() {
|