@arcblock/ux 2.4.42 → 2.4.43
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/lib/CodeBlock/index.js +5 -1
- package/package.json +4 -4
- package/src/CodeBlock/index.js +3 -0
package/lib/CodeBlock/index.js
CHANGED
@@ -43,6 +43,8 @@ var _diff = _interopRequireDefault(require("highlight.js/lib/languages/diff"));
|
|
43
43
|
|
44
44
|
var _plaintext = _interopRequireDefault(require("highlight.js/lib/languages/plaintext"));
|
45
45
|
|
46
|
+
var _markdown = _interopRequireDefault(require("highlight.js/lib/languages/markdown"));
|
47
|
+
|
46
48
|
require("highlight.js/styles/atom-one-dark.css");
|
47
49
|
|
48
50
|
var _FileCopy = _interopRequireDefault(require("@mui/icons-material/FileCopy"));
|
@@ -127,6 +129,8 @@ _core.default.registerLanguage('objectivec', _objectivec.default);
|
|
127
129
|
|
128
130
|
_core.default.registerLanguage('oc', _objectivec.default);
|
129
131
|
|
132
|
+
_core.default.registerLanguage('markdown', _markdown.default);
|
133
|
+
|
130
134
|
function CodeBlock(_ref) {
|
131
135
|
let {
|
132
136
|
code,
|
@@ -213,4 +217,4 @@ CodeBlock.defaultProps = {
|
|
213
217
|
dark: true
|
214
218
|
};
|
215
219
|
const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important';
|
216
|
-
const Pre = (0, _Theme.styled)('pre')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n display: block;\n font-size: 14px;\n line-height: 1.42857143;\n margin: 0 0 32px;\n word-break: break-word;\n word-wrap: break-word;\n text-align: left;\n border-radius: 5px;\n border: 1px solid #dedede;\n background: #222;\n color: ", ";\n position: relative;\n\n .codeblock__inner {\n display: block;\n width: 100%;\n max-height: 46.25rem;\n overflow: scroll;\n }\n\n .copy-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 8px;\n right: 24px;\n padding: 4px;\n min-width: 72px;\n height: 24px;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n transition: all ease 0.2s;\n\n .copy-icon {\n font-size: 16px;\n color: ", ";\n }\n\n .hover-text {\n display: none;\n }\n .default-text {\n font-size: 12px;\n color: ", ";\n }\n }\n\n &:hover {\n .copy-button {\n display: flex;\n background: ", ";\n\n .hover-text {\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n }\n .default-text {\n display: none;\n font-size: 12px;\n }\n }\n }\n\n .button-lang-text {\n margin-left: 4px;\n font-size: 12px;\n color: ", ";\n }\n\n code {\n counter-reset: line;\n counter-increment: line;\n padding: 16px;\n font-family: ", ";\n * {\n font-family: ", ";\n }\n }\n\n .hljs * {\n white-space: normal; // autowrap\n }\n"])), fontFamily, _Colors.default.common.white, _Colors.default.common.white, _Colors.default.common.white, _Colors.default.primary.main, _Colors.default.common.white, _Colors.default.common.white, fontFamily, fontFamily);
|
220
|
+
const Pre = (0, _Theme.styled)('pre')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: ", ";\n display: block;\n font-size: 14px;\n line-height: 1.42857143;\n margin: 0 0 32px;\n word-break: break-word;\n word-wrap: break-word;\n text-align: left;\n border-radius: 5px;\n border: 1px solid #dedede;\n background: #222;\n color: ", ";\n position: relative;\n\n .codeblock__inner {\n display: block;\n width: 100%;\n max-height: 46.25rem;\n overflow: scroll;\n }\n\n .copy-button {\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n top: 8px;\n right: 24px;\n padding: 4px;\n min-width: 72px;\n height: 24px;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n transition: all ease 0.2s;\n\n .copy-icon {\n font-size: 16px;\n color: ", ";\n }\n\n .hover-text {\n display: none;\n }\n .default-text {\n font-size: 12px;\n color: ", ";\n }\n }\n\n &:hover {\n .copy-button {\n display: flex;\n background: ", ";\n\n .hover-text {\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n }\n .default-text {\n display: none;\n font-size: 12px;\n }\n }\n }\n\n .button-lang-text {\n margin-left: 4px;\n font-size: 12px;\n color: ", ";\n }\n\n code {\n counter-reset: line;\n counter-increment: line;\n padding: 16px;\n font-family: ", ";\n color: ", ";\n * {\n font-family: ", ";\n }\n }\n\n .hljs * {\n white-space: normal; // autowrap\n }\n"])), fontFamily, _Colors.default.common.white, _Colors.default.common.white, _Colors.default.common.white, _Colors.default.primary.main, _Colors.default.common.white, _Colors.default.common.white, fontFamily, _Colors.default.common.white, fontFamily);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.4.
|
3
|
+
"version": "2.4.43",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -47,10 +47,10 @@
|
|
47
47
|
"react": ">=18.1.0",
|
48
48
|
"react-ga": "^2.7.0"
|
49
49
|
},
|
50
|
-
"gitHead": "
|
50
|
+
"gitHead": "ff9bef3207c2d77f08267dc1e9e886eedd236370",
|
51
51
|
"dependencies": {
|
52
|
-
"@arcblock/icons": "^2.4.
|
53
|
-
"@arcblock/react-hooks": "^2.4.
|
52
|
+
"@arcblock/icons": "^2.4.43",
|
53
|
+
"@arcblock/react-hooks": "^2.4.43",
|
54
54
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
55
55
|
"@emotion/react": "^11.10.4",
|
56
56
|
"@emotion/styled": "^11.10.4",
|
package/src/CodeBlock/index.js
CHANGED
@@ -19,6 +19,7 @@ import yaml from 'highlight.js/lib/languages/yaml';
|
|
19
19
|
import shell from 'highlight.js/lib/languages/shell';
|
20
20
|
import diff from 'highlight.js/lib/languages/diff';
|
21
21
|
import plaintext from 'highlight.js/lib/languages/plaintext';
|
22
|
+
import markdown from 'highlight.js/lib/languages/markdown';
|
22
23
|
|
23
24
|
import 'highlight.js/styles/atom-one-dark.css';
|
24
25
|
|
@@ -54,6 +55,7 @@ hljs.registerLanguage('diff', diff);
|
|
54
55
|
hljs.registerLanguage('swift', swift);
|
55
56
|
hljs.registerLanguage('objectivec', objectivec);
|
56
57
|
hljs.registerLanguage('oc', objectivec);
|
58
|
+
hljs.registerLanguage('markdown', markdown);
|
57
59
|
|
58
60
|
export default function CodeBlock({ code, language, children, dark, ...rest }) {
|
59
61
|
const [copied, setCopied] = useState(false);
|
@@ -203,6 +205,7 @@ const Pre = styled('pre')`
|
|
203
205
|
counter-increment: line;
|
204
206
|
padding: 16px;
|
205
207
|
font-family: ${fontFamily};
|
208
|
+
color: ${colors.common.white};
|
206
209
|
* {
|
207
210
|
font-family: ${fontFamily};
|
208
211
|
}
|