@arcblock/ux 2.4.42 → 2.4.44
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.
@@ -13,6 +13,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
13
13
|
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
15
15
|
|
16
|
-
const LightBox = (0, _styled.default)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n }\n code.hljs {\n padding: 3px 5px;\n }\n .hljs {\n color: #383a42;\n background: #fafafa;\n }\n .hljs-comment,\n .hljs-quote {\n color: #a0a1a7;\n font-style: italic;\n }\n .hljs-doctag,\n .hljs-formula,\n .hljs-keyword {\n color: #a626a4;\n }\n .hljs-deletion,\n .hljs-name,\n .hljs-section,\n .hljs-selector-tag,\n .hljs-subst {\n color: #e45649;\n }\n .hljs-literal {\n color: #0184bb;\n }\n .hljs-addition,\n .hljs-attribute,\n .hljs-meta .hljs-string,\n .hljs-regexp,\n .hljs-string {\n color: #50a14f;\n }\n .hljs-attr,\n .hljs-number,\n .hljs-selector-attr,\n .hljs-selector-class,\n .hljs-selector-pseudo,\n .hljs-template-variable,\n .hljs-type,\n .hljs-variable {\n color: #986801;\n }\n .hljs-bullet,\n .hljs-link,\n .hljs-meta,\n .hljs-selector-id,\n .hljs-symbol,\n .hljs-title {\n color: #4078f2;\n }\n .hljs-built_in,\n .hljs-class .hljs-title,\n .hljs-title.class_ {\n color: #c18401;\n }\n .hljs-emphasis {\n font-style: italic;\n }\n .hljs-strong {\n font-weight: 700;\n }\n .hljs-link {\n text-decoration: underline;\n }\n\n .copy-button {\n
|
16
|
+
const LightBox = (0, _styled.default)('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n pre code.hljs {\n display: block;\n overflow-x: auto;\n padding: 1em;\n }\n code.hljs {\n padding: 3px 5px;\n }\n .hljs {\n color: #383a42;\n background: #fafafa;\n }\n .hljs-comment,\n .hljs-quote {\n color: #a0a1a7;\n font-style: italic;\n }\n .hljs-doctag,\n .hljs-formula,\n .hljs-keyword {\n color: #a626a4;\n }\n .hljs-deletion,\n .hljs-name,\n .hljs-section,\n .hljs-selector-tag,\n .hljs-subst {\n color: #e45649;\n }\n .hljs-literal {\n color: #0184bb;\n }\n .hljs-addition,\n .hljs-attribute,\n .hljs-meta .hljs-string,\n .hljs-regexp,\n .hljs-string {\n color: #50a14f;\n }\n .hljs-attr,\n .hljs-number,\n .hljs-selector-attr,\n .hljs-selector-class,\n .hljs-selector-pseudo,\n .hljs-template-variable,\n .hljs-type,\n .hljs-variable {\n color: #986801;\n }\n .hljs-bullet,\n .hljs-link,\n .hljs-meta,\n .hljs-selector-id,\n .hljs-symbol,\n .hljs-title {\n color: #4078f2;\n }\n .hljs-built_in,\n .hljs-class .hljs-title,\n .hljs-title.class_ {\n color: #c18401;\n }\n .hljs-emphasis {\n font-style: italic;\n }\n .hljs-strong {\n font-weight: 700;\n }\n .hljs-link {\n text-decoration: underline;\n }\n\n pre {\n .copy-button {\n > .default-text {\n color: #222;\n }\n }\n }\n"])));
|
17
17
|
var _default = LightBox;
|
18
18
|
exports.default = _default;
|
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.44",
|
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": "83a9031c15ca6eca79656f0fb76d4ed2c44cf041",
|
51
51
|
"dependencies": {
|
52
|
-
"@arcblock/icons": "^2.4.
|
53
|
-
"@arcblock/react-hooks": "^2.4.
|
52
|
+
"@arcblock/icons": "^2.4.44",
|
53
|
+
"@arcblock/react-hooks": "^2.4.44",
|
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
|
}
|