@lowdefy/blocks-markdown 3.23.3 → 4.0.0-alpha.11
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/dist/blocks/DangerousMarkdown/DangerousMarkdown.js +52 -0
- package/dist/blocks/DangerousMarkdown/schema.json +30 -0
- package/dist/blocks/Markdown/Markdown.js +38 -0
- package/dist/blocks/Markdown/schema.json +28 -0
- package/dist/blocks/MarkdownWithCode/MarkdownWithCode.js +88 -0
- package/dist/blocks/MarkdownWithCode/schema.json +28 -0
- package/dist/blocks.js +17 -0
- package/dist/codeblock.less +14 -0
- package/dist/style.less +364 -0
- package/dist/types.js +31 -0
- package/package.json +33 -40
- package/dist/106.js +0 -1
- package/dist/327.js +0 -1
- package/dist/328.js +0 -2
- package/dist/328.js.LICENSE.txt +0 -1
- package/dist/336.js +0 -1
- package/dist/443.js +0 -1
- package/dist/453.js +0 -2
- package/dist/453.js.LICENSE.txt +0 -15
- package/dist/466.js +0 -2
- package/dist/466.js.LICENSE.txt +0 -8
- package/dist/523.js +0 -2
- package/dist/523.js.LICENSE.txt +0 -43
- package/dist/621.js +0 -2
- package/dist/621.js.LICENSE.txt +0 -6
- package/dist/757.js +0 -2
- package/dist/757.js.LICENSE.txt +0 -14
- package/dist/830.js +0 -1
- package/dist/909.js +0 -1
- package/dist/main.js +0 -1
- package/dist/meta/DangerousMarkdown.json +0 -1
- package/dist/meta/Markdown.json +0 -1
- package/dist/meta/MarkdownWithCode.json +0 -1
- package/dist/remoteEntry.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import DOMPurify from 'dompurify';
|
|
17
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
+
import ReactMarkdown from 'react-markdown';
|
|
19
|
+
import gfm from 'remark-gfm';
|
|
20
|
+
import rehypeRaw from 'rehype-raw';
|
|
21
|
+
let DangerousMarkdown = class DangerousMarkdown extends React.Component {
|
|
22
|
+
render() {
|
|
23
|
+
const { blockId , properties , methods } = this.props;
|
|
24
|
+
return(/*#__PURE__*/ React.createElement("div", {
|
|
25
|
+
id: blockId,
|
|
26
|
+
className: methods.makeCssClass(properties.style)
|
|
27
|
+
}, /*#__PURE__*/ React.createElement(ReactMarkdown, {
|
|
28
|
+
className: "markdown-body markdown-default-code",
|
|
29
|
+
remarkPlugins: [
|
|
30
|
+
gfm
|
|
31
|
+
],
|
|
32
|
+
rehypePlugins: [
|
|
33
|
+
rehypeRaw
|
|
34
|
+
],
|
|
35
|
+
skipHtml: false
|
|
36
|
+
}, DOMPurify.sanitize(this.props.properties.content, this.DOMPurifyOptions))));
|
|
37
|
+
}
|
|
38
|
+
constructor(props){
|
|
39
|
+
super(props);
|
|
40
|
+
// we do not revaluate DOMPurifyOptions improve options safety by not making options dynamic.
|
|
41
|
+
this.DOMPurifyOptions = props.properties.DOMPurifyOptions;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
DangerousMarkdown.defaultProps = blockDefaultProps;
|
|
45
|
+
DangerousMarkdown.meta = {
|
|
46
|
+
category: 'container',
|
|
47
|
+
icons: [],
|
|
48
|
+
styles: [
|
|
49
|
+
'codeblock.less'
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
export default DangerousMarkdown;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"content": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Content in markdown format.",
|
|
10
|
+
"docs": {
|
|
11
|
+
"displayType": "text-area"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"DOMPurifyOptions": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"description": "Customize DOMPurify options. Options are only applied when the block is mounted, thus any parsed settings is only applied at first render.",
|
|
17
|
+
"docs": {
|
|
18
|
+
"displayType": "yaml"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"style": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"description": "Style to apply to Markdown div.",
|
|
24
|
+
"docs": {
|
|
25
|
+
"displayType": "yaml"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
|
+
import ReactMarkdown from 'react-markdown';
|
|
18
|
+
import gfm from 'remark-gfm';
|
|
19
|
+
const Markdown = ({ blockId , properties , methods })=>/*#__PURE__*/ React.createElement("div", {
|
|
20
|
+
id: blockId,
|
|
21
|
+
className: methods.makeCssClass(properties.style)
|
|
22
|
+
}, /*#__PURE__*/ React.createElement(ReactMarkdown, {
|
|
23
|
+
className: "markdown-body markdown-default-code",
|
|
24
|
+
skipHtml: properties.skipHtml,
|
|
25
|
+
remarkPlugins: [
|
|
26
|
+
gfm
|
|
27
|
+
]
|
|
28
|
+
}, properties.content))
|
|
29
|
+
;
|
|
30
|
+
Markdown.defaultProps = blockDefaultProps;
|
|
31
|
+
Markdown.meta = {
|
|
32
|
+
category: 'container',
|
|
33
|
+
icons: [],
|
|
34
|
+
styles: [
|
|
35
|
+
'codeblock.less'
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
export default Markdown;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"content": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Content in markdown format.",
|
|
10
|
+
"docs": {
|
|
11
|
+
"displayType": "text-area"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"skipHtml": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "By default, HTML in markdown is escaped. When true all HTML code in the markdown will not be rendered."
|
|
18
|
+
},
|
|
19
|
+
"style": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Style to apply to Markdown div.",
|
|
22
|
+
"docs": {
|
|
23
|
+
"displayType": "yaml"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
import { Light as SyntaxHighlighter } from 'react-syntax-highlighter';
|
|
17
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
+
import ReactMarkdown from 'react-markdown';
|
|
19
|
+
import gfm from 'remark-gfm';
|
|
20
|
+
// See https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/393 for esm issue.
|
|
21
|
+
import { github } from 'react-syntax-highlighter/dist/cjs/styles/hljs/index.js';
|
|
22
|
+
import javascript from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript.js';
|
|
23
|
+
import typescript from 'react-syntax-highlighter/dist/cjs/languages/hljs/typescript.js';
|
|
24
|
+
import python from 'react-syntax-highlighter/dist/cjs/languages/hljs/python.js';
|
|
25
|
+
import java from 'react-syntax-highlighter/dist/cjs/languages/hljs/java.js';
|
|
26
|
+
import xml from 'react-syntax-highlighter/dist/cjs/languages/hljs/xml.js';
|
|
27
|
+
import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json.js';
|
|
28
|
+
import yaml from 'react-syntax-highlighter/dist/cjs/languages/hljs/yaml.js';
|
|
29
|
+
import markdown from 'react-syntax-highlighter/dist/cjs/languages/hljs/markdown.js';
|
|
30
|
+
import handlebars from 'react-syntax-highlighter/dist/cjs/languages/hljs/handlebars.js';
|
|
31
|
+
function _extends() {
|
|
32
|
+
_extends = Object.assign || function(target) {
|
|
33
|
+
for(var i = 1; i < arguments.length; i++){
|
|
34
|
+
var source = arguments[i];
|
|
35
|
+
for(var key in source){
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
37
|
+
target[key] = source[key];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return target;
|
|
42
|
+
};
|
|
43
|
+
return _extends.apply(this, arguments);
|
|
44
|
+
}
|
|
45
|
+
SyntaxHighlighter.registerLanguage('handlebars', handlebars.default);
|
|
46
|
+
SyntaxHighlighter.registerLanguage('nunjucks', handlebars.default);
|
|
47
|
+
SyntaxHighlighter.registerLanguage('html', handlebars.default);
|
|
48
|
+
SyntaxHighlighter.registerLanguage('java', java.default);
|
|
49
|
+
SyntaxHighlighter.registerLanguage('javascript', javascript.default);
|
|
50
|
+
SyntaxHighlighter.registerLanguage('js', javascript.default);
|
|
51
|
+
SyntaxHighlighter.registerLanguage('jsx', javascript.default);
|
|
52
|
+
SyntaxHighlighter.registerLanguage('json', json.default);
|
|
53
|
+
SyntaxHighlighter.registerLanguage('markdown', markdown.default);
|
|
54
|
+
SyntaxHighlighter.registerLanguage('python', python.default);
|
|
55
|
+
SyntaxHighlighter.registerLanguage('py', python.default);
|
|
56
|
+
SyntaxHighlighter.registerLanguage('typescript', typescript.default);
|
|
57
|
+
SyntaxHighlighter.registerLanguage('ts', typescript.default);
|
|
58
|
+
SyntaxHighlighter.registerLanguage('xml', xml.default);
|
|
59
|
+
SyntaxHighlighter.registerLanguage('yaml', yaml.default);
|
|
60
|
+
const components = {
|
|
61
|
+
code ({ inline , className , children , ...props }) {
|
|
62
|
+
return !inline ? /*#__PURE__*/ React.createElement(SyntaxHighlighter, _extends({
|
|
63
|
+
style: github,
|
|
64
|
+
language: String(className).replace('language-', '')
|
|
65
|
+
}, props), children) : /*#__PURE__*/ React.createElement("code", _extends({
|
|
66
|
+
className: className
|
|
67
|
+
}, props), children);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const MarkdownWithCode = ({ blockId , properties , methods })=>/*#__PURE__*/ React.createElement("div", {
|
|
71
|
+
id: blockId,
|
|
72
|
+
className: methods.makeCssClass(properties.style)
|
|
73
|
+
}, /*#__PURE__*/ React.createElement(ReactMarkdown, {
|
|
74
|
+
className: "markdown-body",
|
|
75
|
+
skipHtml: properties.skipHtml,
|
|
76
|
+
remarkPlugins: [
|
|
77
|
+
gfm
|
|
78
|
+
],
|
|
79
|
+
components: components
|
|
80
|
+
}, properties.content))
|
|
81
|
+
;
|
|
82
|
+
MarkdownWithCode.defaultProps = blockDefaultProps;
|
|
83
|
+
MarkdownWithCode.meta = {
|
|
84
|
+
category: 'container',
|
|
85
|
+
icons: [],
|
|
86
|
+
styles: []
|
|
87
|
+
};
|
|
88
|
+
export default MarkdownWithCode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"content": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Content in markdown format.",
|
|
10
|
+
"docs": {
|
|
11
|
+
"displayType": "text-area"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"skipHtml": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false,
|
|
17
|
+
"description": "By default, HTML in markdown is escaped. When true all HTML code in the markdown will not be rendered."
|
|
18
|
+
},
|
|
19
|
+
"style": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Style to apply to Markdown div.",
|
|
22
|
+
"docs": {
|
|
23
|
+
"displayType": "yaml"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
package/dist/blocks.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export { default as DangerousMarkdown } from './blocks/DangerousMarkdown/DangerousMarkdown.js';
|
|
16
|
+
export { default as Markdown } from './blocks/Markdown/Markdown.js';
|
|
17
|
+
export { default as MarkdownWithCode } from './blocks/MarkdownWithCode/MarkdownWithCode.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
.markdown-default-code pre {
|
|
2
|
+
background-color: @background-color-base;
|
|
3
|
+
padding: 0.5em;
|
|
4
|
+
word-wrap: normal;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.markdown-default-code pre > code {
|
|
8
|
+
background: transparent;
|
|
9
|
+
border: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
white-space: pre;
|
|
13
|
+
word-break: normal;
|
|
14
|
+
}
|
package/dist/style.less
ADDED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
.markdown-body a:focus {
|
|
2
|
+
outline: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.markdown-body h1:hover a,
|
|
6
|
+
.markdown-body h2:hover a .markdown-body h3:hover a,
|
|
7
|
+
.markdown-body h4:hover a,
|
|
8
|
+
.markdown-body h5:hover a,
|
|
9
|
+
.markdown-body h6:hover a {
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
color: @heading-color;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.markdown-body {
|
|
15
|
+
-ms-text-size-adjust: 100%;
|
|
16
|
+
-webkit-text-size-adjust: 100%;
|
|
17
|
+
word-wrap: break-word;
|
|
18
|
+
font-family: @font-family;
|
|
19
|
+
color: @text-color;
|
|
20
|
+
line-height: @line-height-base;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.markdown-body details {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.markdown-body summary {
|
|
28
|
+
display: list-item;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.markdown-body a {
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.markdown-body a:active,
|
|
36
|
+
.markdown-body a:hover {
|
|
37
|
+
outline-width: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.markdown-body strong {
|
|
41
|
+
font-weight: inherit;
|
|
42
|
+
font-weight: bolder;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.markdown-body img {
|
|
46
|
+
border-style: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.markdown-body code,
|
|
50
|
+
.markdown-body kbd,
|
|
51
|
+
.markdown-body pre {
|
|
52
|
+
font-family: @code-family;
|
|
53
|
+
font-size: @font-size-base;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.markdown-body code {
|
|
57
|
+
background-color: @background-color-base;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.markdown-body pre {
|
|
61
|
+
margin-bottom: 1em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.markdown-body hr {
|
|
65
|
+
box-sizing: content-box;
|
|
66
|
+
height: 0;
|
|
67
|
+
overflow: visible;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.markdown-body * {
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.markdown-body a {
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.markdown-body a:hover {
|
|
79
|
+
text-decoration: underline;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.markdown-body strong {
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.markdown-body hr {
|
|
87
|
+
background: transparent;
|
|
88
|
+
border: 0;
|
|
89
|
+
border-bottom: 1px solid @divider-color;
|
|
90
|
+
height: 0;
|
|
91
|
+
margin: 1em 0;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.markdown-body hr:before {
|
|
96
|
+
content: '';
|
|
97
|
+
display: table;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.markdown-body hr:after {
|
|
101
|
+
clear: both;
|
|
102
|
+
content: '';
|
|
103
|
+
display: table;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.markdown-body td,
|
|
107
|
+
.markdown-body th {
|
|
108
|
+
padding: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.markdown-body details summary {
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.markdown-body blockquote {
|
|
116
|
+
margin: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.markdown-body ol,
|
|
120
|
+
.markdown-body ul {
|
|
121
|
+
margin-bottom: 0;
|
|
122
|
+
margin-top: 0;
|
|
123
|
+
padding-left: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.markdown-body ol ol,
|
|
127
|
+
.markdown-body ul ol {
|
|
128
|
+
list-style-type: lower-roman;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.markdown-body ol ol ol,
|
|
132
|
+
.markdown-body ol ul ol,
|
|
133
|
+
.markdown-body ul ol ol,
|
|
134
|
+
.markdown-body ul ul ol {
|
|
135
|
+
list-style-type: lower-alpha;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.markdown-body dd {
|
|
139
|
+
margin-left: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.markdown-body input::-webkit-inner-spin-button,
|
|
143
|
+
.markdown-body input::-webkit-outer-spin-button {
|
|
144
|
+
-webkit-appearance: none;
|
|
145
|
+
appearance: none;
|
|
146
|
+
margin: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.markdown-body:before {
|
|
150
|
+
content: '';
|
|
151
|
+
display: table;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.markdown-body:after {
|
|
155
|
+
clear: both;
|
|
156
|
+
content: '';
|
|
157
|
+
display: table;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.markdown-body > :first-child {
|
|
161
|
+
margin-top: 0 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.markdown-body > :last-child {
|
|
165
|
+
margin-bottom: 0 !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.markdown-body a:not([href]) {
|
|
169
|
+
color: inherit;
|
|
170
|
+
text-decoration: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.markdown-body blockquote,
|
|
174
|
+
.markdown-body dl,
|
|
175
|
+
.markdown-body ol,
|
|
176
|
+
.markdown-body p,
|
|
177
|
+
.markdown-body pre,
|
|
178
|
+
.markdown-body table,
|
|
179
|
+
.markdown-body ul {
|
|
180
|
+
margin-bottom: 1em;
|
|
181
|
+
margin-top: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.markdown-body hr {
|
|
185
|
+
background: transparent;
|
|
186
|
+
border: 0;
|
|
187
|
+
border-bottom: 1px solid @divider-color;
|
|
188
|
+
height: 0;
|
|
189
|
+
margin: 1em 0;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.markdown-body blockquote {
|
|
194
|
+
border-left: 0.25em solid #dfe2e5;
|
|
195
|
+
color: @text-color-secondary;
|
|
196
|
+
padding: 0 1em;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.markdown-body blockquote > :first-child {
|
|
200
|
+
margin-top: 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.markdown-body blockquote > :last-child {
|
|
204
|
+
margin-bottom: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.markdown-body kbd {
|
|
208
|
+
background-color: #fafbfc;
|
|
209
|
+
border: 1px solid #c6cbd1;
|
|
210
|
+
border-bottom-color: #959da5;
|
|
211
|
+
border-radius: 3px;
|
|
212
|
+
box-shadow: inset 0 -1px 0 #959da5;
|
|
213
|
+
color: #444d56;
|
|
214
|
+
display: inline-block;
|
|
215
|
+
line-height: 11px;
|
|
216
|
+
padding: 3px 5px;
|
|
217
|
+
vertical-align: middle;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
.markdown-body h1,
|
|
222
|
+
.markdown-body h2 {
|
|
223
|
+
border-bottom: 1px solid @divider-color;
|
|
224
|
+
padding-bottom: 0.3em;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.markdown-body h1 {
|
|
228
|
+
font-size: @heading-1-size;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.markdown-body h2 {
|
|
232
|
+
font-size: @heading-2-size;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.markdown-body h3 {
|
|
236
|
+
font-size: @heading-3-size;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.markdown-body h4 {
|
|
240
|
+
font-size: @heading-4-size;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.markdown-body h5 {
|
|
244
|
+
font-size: @heading-5-size;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.markdown-body h6 {
|
|
248
|
+
color: @text-color-secondary;
|
|
249
|
+
font-size: @font-size-base;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.markdown-body ol,
|
|
253
|
+
.markdown-body ul {
|
|
254
|
+
padding: @list-item-padding;
|
|
255
|
+
padding-left: 1em;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.markdown-body ol ol,
|
|
259
|
+
.markdown-body ol ul,
|
|
260
|
+
.markdown-body ul ol,
|
|
261
|
+
.markdown-body ul ul {
|
|
262
|
+
margin-bottom: 0;
|
|
263
|
+
margin-top: 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.markdown-body li {
|
|
267
|
+
word-wrap: break-all;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.markdown-body li > p {
|
|
271
|
+
margin-top: 1em;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.markdown-body li + li {
|
|
275
|
+
margin-top: 0.25em;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.markdown-body dl {
|
|
279
|
+
padding: 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.markdown-body dl dt {
|
|
283
|
+
font-size: 1em;
|
|
284
|
+
font-style: italic;
|
|
285
|
+
font-weight: 600;
|
|
286
|
+
margin-top: 1em;
|
|
287
|
+
padding: 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.markdown-body dl dd {
|
|
291
|
+
margin-bottom: 1em;
|
|
292
|
+
padding: 0 1em;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.markdown-body table {
|
|
296
|
+
display: block;
|
|
297
|
+
overflow: auto;
|
|
298
|
+
width: 100%;
|
|
299
|
+
font-size: @table-font-size;
|
|
300
|
+
border-collapse: collapse;
|
|
301
|
+
border-spacing: 0;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.markdown-body table th {
|
|
305
|
+
font-weight: 600;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.markdown-body table td,
|
|
309
|
+
.markdown-body table th {
|
|
310
|
+
border: 1px solid @table-border-color;
|
|
311
|
+
padding: 6px 13px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.markdown-body table tr {
|
|
315
|
+
border-top: 1px solid @table-border-color;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.markdown-body table tr:nth-child(2n) {
|
|
319
|
+
background-color: lighten(@table-border-color, 2%);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.markdown-body img {
|
|
323
|
+
box-sizing: content-box;
|
|
324
|
+
max-width: 100%;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.markdown-body img[align='right'] {
|
|
328
|
+
padding-left: 20px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.markdown-body img[align='left'] {
|
|
332
|
+
padding-right: 20px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.markdown-body code {
|
|
336
|
+
margin: 0;
|
|
337
|
+
padding: 0.2em 0.4em;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.markdown-body pre code {
|
|
341
|
+
border-radius: 3px;
|
|
342
|
+
background-color: transparent;
|
|
343
|
+
border: 0;
|
|
344
|
+
display: inline;
|
|
345
|
+
line-height: inherit;
|
|
346
|
+
margin: 0;
|
|
347
|
+
max-width: auto;
|
|
348
|
+
overflow: visible;
|
|
349
|
+
padding: 0;
|
|
350
|
+
word-wrap: normal;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.markdown-body kbd {
|
|
354
|
+
background-color: @divider-color;
|
|
355
|
+
border: 1px solid #d1d5da;
|
|
356
|
+
border-bottom-color: darken(@divider-color, 2%);
|
|
357
|
+
border-radius: 3px;
|
|
358
|
+
box-shadow: inset 0 -1px 0 darken(@divider-color, 2%);
|
|
359
|
+
color: #444d56;
|
|
360
|
+
display: inline-block;
|
|
361
|
+
font: @code-family;
|
|
362
|
+
padding: 3px 5px;
|
|
363
|
+
vertical-align: middle;
|
|
364
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable import/namespace */ /*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import * as blocks from './blocks.js';
|
|
16
|
+
const icons = {};
|
|
17
|
+
const styles = {};
|
|
18
|
+
Object.keys(blocks).forEach((block)=>{
|
|
19
|
+
icons[block] = blocks[block].meta.icons || [];
|
|
20
|
+
styles[block] = blocks[block].meta.styles || [];
|
|
21
|
+
});
|
|
22
|
+
export default {
|
|
23
|
+
blocks: Object.keys(blocks),
|
|
24
|
+
icons,
|
|
25
|
+
styles: {
|
|
26
|
+
default: [
|
|
27
|
+
'style.less'
|
|
28
|
+
],
|
|
29
|
+
...styles
|
|
30
|
+
}
|
|
31
|
+
};
|