@agentscope-ai/design 1.0.7 → 1.0.9
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/antd/styles/alert.style.d.ts +2 -10
- package/lib/antd/styles/alert.style.js +11 -12
- package/lib/antd/styles/breadcrumb.style.d.ts +2 -18
- package/lib/antd/styles/breadcrumb.style.js +13 -15
- package/lib/antd/styles/button.style.d.ts +2 -80
- package/lib/antd/styles/button.style.js +63 -47
- package/lib/antd/styles/dropdown.style.d.ts +2 -15
- package/lib/antd/styles/dropdown.style.js +27 -16
- package/lib/antd/styles/floatButton.style.d.ts +2 -8
- package/lib/antd/styles/floatButton.style.js +13 -12
- package/lib/antd/styles/index.style.d.ts +4 -18
- package/lib/antd/styles/index.style.js +52 -53
- package/lib/antd/styles/inputNumber.style.d.ts +2 -18
- package/lib/antd/styles/inputNumber.style.js +23 -17
- package/lib/antd/styles/message.style.d.ts +2 -5
- package/lib/antd/styles/message.style.js +9 -10
- package/lib/antd/styles/notification.style.d.ts +2 -46
- package/lib/antd/styles/notification.style.js +31 -29
- package/lib/antd/styles/popover.style.d.ts +2 -13
- package/lib/antd/styles/popover.style.js +15 -14
- package/lib/antd/styles/radio.style.d.ts +2 -24
- package/lib/antd/styles/radio.style.js +29 -18
- package/lib/antd/styles/segment.style.d.ts +2 -7
- package/lib/antd/styles/segment.style.js +11 -12
- package/lib/antd/styles/select.style.d.ts +2 -31
- package/lib/antd/styles/select.style.js +51 -28
- package/lib/antd/styles/slider.style.d.ts +2 -22
- package/lib/antd/styles/slider.style.js +19 -21
- package/lib/antd/styles/table.style.d.ts +2 -5
- package/lib/antd/styles/table.style.js +7 -10
- package/lib/antd/styles/tooltip.style.d.ts +2 -8
- package/lib/antd/styles/tooltip.style.js +13 -11
- package/lib/antd/themes/_readme.txt +1 -0
- package/lib/antd/themes/bailianTheme.json +1 -1
- package/lib/antd/themes/generateThemeByToken.d.ts +1 -1
- package/lib/antd/themes/generateThemeByToken.js +1 -1
- package/lib/components/commonComponents/AlertDialog/demo/demo1.js +13 -79
- package/lib/components/commonComponents/AlertDialog/demo/demo2.js +44 -64
- package/lib/components/commonComponents/AlertDialog/index.d.ts +14 -1
- package/lib/components/commonComponents/AlertDialog/index.js +25 -17
- package/lib/components/commonComponents/AlertDialog/index.style.d.ts +1 -17
- package/lib/components/commonComponents/AlertDialog/index.style.js +16 -30
- package/lib/components/commonComponents/Anchor/demo/demo1.d.ts +0 -4
- package/lib/components/commonComponents/Anchor/demo/demo1.js +3 -4
- package/lib/components/commonComponents/Anchor/demo/demo2.d.ts +0 -4
- package/lib/components/commonComponents/Anchor/demo/demo2.js +3 -5
- package/lib/components/commonComponents/Anchor/index.js +7 -3
- package/lib/components/commonComponents/Anchor/index.style.d.ts +1 -14
- package/lib/components/commonComponents/Anchor/index.style.js +18 -23
- package/lib/components/commonComponents/Avatar/index.js +11 -7
- package/lib/components/commonComponents/Avatar/index.style.d.ts +1 -7
- package/lib/components/commonComponents/Avatar/index.style.js +6 -21
- package/lib/components/commonComponents/Breadcrumb/index.js +10 -7
- package/lib/components/commonComponents/Breadcrumb/index.style.d.ts +1 -107
- package/lib/components/commonComponents/Breadcrumb/index.style.js +32 -60
- package/lib/components/commonComponents/Button/index.js +27 -5
- package/lib/components/commonComponents/Card/index.js +23 -20
- package/lib/components/commonComponents/Card/index.style.d.ts +1 -71
- package/lib/components/commonComponents/Card/index.style.js +24 -46
- package/lib/components/commonComponents/Checkbox/index.js +13 -10
- package/lib/components/commonComponents/Checkbox/index.style.d.ts +1 -34
- package/lib/components/commonComponents/Checkbox/index.style.js +50 -38
- package/lib/components/commonComponents/CodeBlock/index.js +16 -13
- package/lib/components/commonComponents/CodeBlock/index.style.d.ts +1 -354
- package/lib/components/commonComponents/CodeBlock/index.style.js +26 -72
- package/lib/components/commonComponents/Collapse/index.js +7 -3
- package/lib/components/commonComponents/Collapse/index.style.d.ts +1 -57
- package/lib/components/commonComponents/Collapse/index.style.js +34 -47
- package/lib/components/commonComponents/CollapsePanel/index.d.ts +10 -0
- package/lib/components/commonComponents/CollapsePanel/index.js +56 -44
- package/lib/components/commonComponents/CollapsePanel/index.style.d.ts +1 -287
- package/lib/components/commonComponents/CollapsePanel/index.style.js +42 -97
- package/lib/components/commonComponents/ConfigProvider/index.js +11 -8
- package/lib/components/commonComponents/DatePicker/index.js +45 -39
- package/lib/components/commonComponents/DatePicker/index.style.d.ts +1 -102
- package/lib/components/commonComponents/DatePicker/index.style.js +66 -61
- package/lib/components/commonComponents/Descriptions/index.js +14 -10
- package/lib/components/commonComponents/Descriptions/index.style.d.ts +1 -17
- package/lib/components/commonComponents/Descriptions/index.style.js +32 -29
- package/lib/components/commonComponents/Drawer/Confirm.d.ts +1 -1
- package/lib/components/commonComponents/Drawer/Confirm.js +26 -24
- package/lib/components/commonComponents/Drawer/index.js +15 -11
- package/lib/components/commonComponents/Drawer/index.style.d.ts +1 -84
- package/lib/components/commonComponents/Drawer/index.style.js +44 -54
- package/lib/components/commonComponents/Dropdown/index.d.ts +1 -2
- package/lib/components/commonComponents/Dropdown/index.js +15 -12
- package/lib/components/commonComponents/Dropdown/index.style.d.ts +1 -78
- package/lib/components/commonComponents/Dropdown/index.style.js +48 -40
- package/lib/components/commonComponents/EllipsisTip/index.js +14 -10
- package/lib/components/commonComponents/EllipsisTip/index.style.d.ts +1 -10
- package/lib/components/commonComponents/EllipsisTip/index.style.js +6 -24
- package/lib/components/commonComponents/Empty/index.js +46 -44
- package/lib/components/commonComponents/Empty/index.style.d.ts +1 -113
- package/lib/components/commonComponents/Empty/index.style.js +22 -51
- package/lib/components/commonComponents/Empty/svg/Illustrate.js +2 -2
- package/lib/components/commonComponents/FileIcon/index.js +27 -24
- package/lib/components/commonComponents/FileIcon/index.style.d.ts +1 -61
- package/lib/components/commonComponents/FileIcon/index.style.js +20 -42
- package/lib/components/commonComponents/FloatButton/demo/demo1.js +1 -1
- package/lib/components/commonComponents/FloatButton/demo/demo2.js +1 -1
- package/lib/components/commonComponents/Form/index.js +6 -5
- package/lib/components/commonComponents/Form/index.style.d.ts +1 -53
- package/lib/components/commonComponents/Form/index.style.js +26 -38
- package/lib/components/commonComponents/HelpIcon/index.js +25 -20
- package/lib/components/commonComponents/HelpIcon/index.style.d.ts +1 -16
- package/lib/components/commonComponents/HelpIcon/index.style.js +16 -29
- package/lib/components/commonComponents/IconButton/index.js +15 -11
- package/lib/components/commonComponents/IconButton/index.style.d.ts +1 -11
- package/lib/components/commonComponents/IconButton/index.style.js +10 -24
- package/lib/components/commonComponents/IconFont/index.d.ts +1 -2
- package/lib/components/commonComponents/IconFont/index.js +14 -9
- package/lib/components/commonComponents/IconFont/index.style.d.ts +1 -67
- package/lib/components/commonComponents/IconFont/index.style.js +14 -44
- package/lib/components/commonComponents/Image/index.js +8 -5
- package/lib/components/commonComponents/Image/index.style.d.ts +1 -22
- package/lib/components/commonComponents/Image/index.style.js +16 -30
- package/lib/components/commonComponents/Input/index.js +17 -11
- package/lib/components/commonComponents/Input/index.style.d.ts +1 -70
- package/lib/components/commonComponents/Input/index.style.js +46 -42
- package/lib/components/commonComponents/Modal/index.js +19 -16
- package/lib/components/commonComponents/Modal/index.style.d.ts +1 -111
- package/lib/components/commonComponents/Modal/index.style.js +54 -72
- package/lib/components/commonComponents/Pagination/index.d.ts +1 -1
- package/lib/components/commonComponents/Pagination/index.js +36 -31
- package/lib/components/commonComponents/Pagination/index.style.d.ts +1 -49
- package/lib/components/commonComponents/Pagination/index.style.js +26 -42
- package/lib/components/commonComponents/Popconfirm/demo/demo1.js +13 -0
- package/lib/components/commonComponents/Popconfirm/demo/demo2.d.ts +3 -0
- package/lib/components/commonComponents/Popconfirm/demo/demo2.js +49 -0
- package/lib/components/commonComponents/Popconfirm/index.d.ts +9 -2
- package/lib/components/commonComponents/Popconfirm/index.js +50 -8
- package/lib/components/commonComponents/PromptsEditor/VarRender.d.ts +6 -0
- package/lib/components/commonComponents/PromptsEditor/VarRender.js +84 -0
- package/lib/components/commonComponents/PromptsEditor/VarSelectInput.d.ts +6 -0
- package/lib/components/commonComponents/PromptsEditor/VarSelectInput.js +60 -0
- package/lib/components/commonComponents/PromptsEditor/demo/basic.d.ts +1 -0
- package/lib/components/commonComponents/PromptsEditor/demo/basic.js +30 -0
- package/lib/components/commonComponents/PromptsEditor/index.d.ts +42 -0
- package/lib/components/commonComponents/PromptsEditor/index.js +134 -0
- package/lib/components/commonComponents/RadioButton/index.js +9 -10
- package/lib/components/commonComponents/RadioButton/index.style.d.ts +1 -72
- package/lib/components/commonComponents/RadioButton/index.style.js +52 -63
- package/lib/components/commonComponents/Result/index.style.d.ts +1 -3
- package/lib/components/commonComponents/Result/index.style.js +4 -16
- package/lib/components/commonComponents/Select/demo/demo2.js +0 -1
- package/lib/components/commonComponents/SlateEditor/elements/Var.js +11 -8
- package/lib/components/commonComponents/SlateEditor/elements/index.style.d.ts +1 -14
- package/lib/components/commonComponents/SlateEditor/elements/index.style.js +4 -21
- package/lib/components/commonComponents/SlateEditor/index.js +34 -31
- package/lib/components/commonComponents/SlateEditor/index.style.d.ts +1 -28
- package/lib/components/commonComponents/SlateEditor/index.style.js +4 -36
- package/lib/components/commonComponents/Slider/{slider.input.d.ts → Input/index.d.ts} +1 -1
- package/lib/components/commonComponents/Slider/Input/index.js +91 -0
- package/lib/components/commonComponents/Slider/Input/index.style.d.ts +1 -0
- package/lib/components/commonComponents/Slider/Input/index.style.js +22 -0
- package/lib/components/commonComponents/Slider/demo/demo4.d.ts +3 -0
- package/lib/components/commonComponents/Slider/demo/demo4.js +33 -0
- package/lib/components/commonComponents/Slider/demo/demo5.d.ts +3 -0
- package/lib/components/commonComponents/Slider/demo/demo5.js +34 -0
- package/lib/components/commonComponents/Slider/index.d.ts +2 -2
- package/lib/components/commonComponents/Slider/index.js +11 -7
- package/lib/components/commonComponents/Slider/index.style.d.ts +1 -7
- package/lib/components/commonComponents/Slider/index.style.js +10 -22
- package/lib/components/commonComponents/SliderSelector/index.js +38 -35
- package/lib/components/commonComponents/SliderSelector/index.style.d.ts +1 -38
- package/lib/components/commonComponents/SliderSelector/index.style.js +20 -37
- package/lib/components/commonComponents/Spinner/index.d.ts +4 -4
- package/lib/components/commonComponents/Spinner/index.js +28 -24
- package/lib/components/commonComponents/Spinner/index.style.d.ts +1 -79
- package/lib/components/commonComponents/Spinner/index.style.js +30 -61
- package/lib/components/commonComponents/Statistic/index.js +7 -3
- package/lib/components/commonComponents/Statistic/index.style.d.ts +1 -15
- package/lib/components/commonComponents/Statistic/index.style.js +14 -26
- package/lib/components/commonComponents/Steps/index.js +10 -6
- package/lib/components/commonComponents/Steps/index.style.d.ts +1 -162
- package/lib/components/commonComponents/Steps/index.style.js +68 -78
- package/lib/components/commonComponents/Switch/index.js +13 -10
- package/lib/components/commonComponents/Switch/index.style.d.ts +1 -25
- package/lib/components/commonComponents/Switch/index.style.js +22 -33
- package/lib/components/commonComponents/Table/index.js +10 -6
- package/lib/components/commonComponents/Table/index.style.d.ts +1 -52
- package/lib/components/commonComponents/Table/index.style.js +18 -32
- package/lib/components/commonComponents/Tabs/index.js +35 -29
- package/lib/components/commonComponents/Tabs/index.style.d.ts +1 -55
- package/lib/components/commonComponents/Tabs/index.style.js +38 -44
- package/lib/components/commonComponents/Tag/demo/demo2.js +0 -1
- package/lib/components/commonComponents/Tag/demo/demo3.js +0 -2
- package/lib/components/commonComponents/Tag/index.js +14 -10
- package/lib/components/commonComponents/Tag/index.style.d.ts +1 -56
- package/lib/components/commonComponents/Tag/index.style.js +54 -58
- package/lib/components/commonComponents/TimePicker/index.js +36 -30
- package/lib/components/commonComponents/TimePicker/index.style.d.ts +1 -71
- package/lib/components/commonComponents/TimePicker/index.style.js +54 -50
- package/lib/components/commonComponents/Tooltip/index.js +14 -13
- package/lib/components/commonComponents/Tooltip/index.style.d.ts +1 -24
- package/lib/components/commonComponents/Tooltip/index.style.js +26 -32
- package/lib/components/commonComponents/Upload/index.js +15 -9
- package/lib/components/commonComponents/Upload/index.style.d.ts +1 -125
- package/lib/components/commonComponents/Upload/index.style.js +80 -90
- package/lib/index.d.ts +3 -2
- package/lib/index.js +10 -5
- package/lib/libs/env/index.js +1 -1
- package/lib/libs/newCreateStyle/index.d.ts +7 -0
- package/lib/libs/newCreateStyle/index.js +26 -0
- package/llms/index.llms.txt +43 -43
- package/package.json +11 -8
- package/lib/components/commonComponents/Popconfirm/demo/demo.js +0 -155
- package/lib/components/commonComponents/Slider/slider.input.js +0 -76
- package/lib/components/commonComponents/spark.style.d.ts +0 -45
- package/lib/components/commonComponents/spark.style.js +0 -62
- /package/lib/components/commonComponents/Popconfirm/demo/{demo.d.ts → demo1.d.ts} +0 -0
|
@@ -10,9 +10,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
10
10
|
import { Checkbox as AntCheckbox } from 'antd';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { getCommonConfig } from "../../../config";
|
|
13
|
-
import
|
|
13
|
+
import { useStyle } from "./index.style";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
17
|
var Checkbox = function Checkbox(_ref) {
|
|
17
18
|
var description = _ref.description,
|
|
18
19
|
descriptionClassName = _ref.descriptionClassName,
|
|
@@ -22,21 +23,23 @@ var Checkbox = function Checkbox(_ref) {
|
|
|
22
23
|
var _getCommonConfig = getCommonConfig(),
|
|
23
24
|
antPrefix = _getCommonConfig.antPrefix,
|
|
24
25
|
sparkPrefix = _getCommonConfig.sparkPrefix;
|
|
25
|
-
|
|
26
|
+
var Style = useStyle();
|
|
26
27
|
var defaultDescriptionStyle = {
|
|
27
28
|
marginLeft: '24px',
|
|
28
29
|
marginTop: '6px',
|
|
29
30
|
fontSize: '12px',
|
|
30
31
|
color: "var(--".concat(antPrefix, "-color-text-tertiary)")
|
|
31
32
|
};
|
|
32
|
-
return /*#__PURE__*/_jsxs(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
children:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsxs("div", {
|
|
35
|
+
className: "".concat(sparkPrefix, "-checkbox"),
|
|
36
|
+
children: [/*#__PURE__*/_jsx(AntCheckbox, _objectSpread(_objectSpread({}, restProps), {}, {
|
|
37
|
+
children: children
|
|
38
|
+
})), description && /*#__PURE__*/_jsx("div", {
|
|
39
|
+
className: descriptionClassName,
|
|
40
|
+
style: _objectSpread(_objectSpread({}, defaultDescriptionStyle), descriptionStyle),
|
|
41
|
+
children: description
|
|
42
|
+
})]
|
|
40
43
|
})]
|
|
41
44
|
});
|
|
42
45
|
};
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
[x: string]: {
|
|
3
|
-
[x: string]: {
|
|
4
|
-
[x: string]: {
|
|
5
|
-
color: string;
|
|
6
|
-
};
|
|
7
|
-
border?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
border: string;
|
|
10
|
-
} | {
|
|
11
|
-
[x: string]: {
|
|
12
|
-
borderColor: string;
|
|
13
|
-
};
|
|
14
|
-
border?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
[x: string]: {
|
|
17
|
-
borderColor: string;
|
|
18
|
-
backgroundColor: string;
|
|
19
|
-
};
|
|
20
|
-
border?: undefined;
|
|
21
|
-
} | {
|
|
22
|
-
[x: string]: {
|
|
23
|
-
backgroundColor: string;
|
|
24
|
-
borderColor: string;
|
|
25
|
-
'&::after': {
|
|
26
|
-
borderColor: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
border?: undefined;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;
|
|
34
|
-
export default useIndexStyle;
|
|
1
|
+
export declare const useStyle: () => () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,38 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import createGlobalStyle from "../../../libs/newCreateStyle";
|
|
4
|
+
export var useStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.", "-checkbox {\n .", "-checkbox-wrapper-disabled {\n .", "-checkbox-label {\n color: var(--", "-color-text);\n }\n }\n \n .", "-checkbox-inner {\n border: 1px solid var(--", "-color-border-secondary);\n }\n \n .", "-checkbox-wrapper:hover {\n .", "-checkbox-inner {\n border-color: var(--", "-color-border-secondary);\n }\n }\n \n .", "-checkbox-checked {\n .", "-checkbox-inner {\n border-color: var(--", "-color-primary);\n background-color: var(--", "-color-primary);\n }\n }\n \n .", "-checkbox-checked.", "-checkbox-disabled {\n .", "-checkbox-inner {\n background-color: var(--", "-color-fill-disable);\n border-color: var(--", "-color-fill-disable);\n \n &::after {\n border-color: var(--", "-color-text-white);\n }\n }\n }\n \n .", "-checkbox-disabled {\n .", "-checkbox-inner {\n background-color: var(--", "-color-fill-secondary);\n border-color: var(--", "-color-fill-secondary);\n }\n }\n}\n"])), function (p) {
|
|
5
|
+
return p.sparkPrefix;
|
|
6
|
+
}, function (p) {
|
|
7
|
+
return p.antPrefix;
|
|
8
|
+
}, function (p) {
|
|
9
|
+
return p.antPrefix;
|
|
10
|
+
}, function (p) {
|
|
11
|
+
return p.antPrefix;
|
|
12
|
+
}, function (p) {
|
|
13
|
+
return p.antPrefix;
|
|
14
|
+
}, function (p) {
|
|
15
|
+
return p.antPrefix;
|
|
16
|
+
}, function (p) {
|
|
17
|
+
return p.antPrefix;
|
|
18
|
+
}, function (p) {
|
|
19
|
+
return p.antPrefix;
|
|
20
|
+
}, function (p) {
|
|
21
|
+
return p.antPrefix;
|
|
22
|
+
}, function (p) {
|
|
23
|
+
return p.antPrefix;
|
|
24
|
+
}, function (p) {
|
|
25
|
+
return p.antPrefix;
|
|
26
|
+
}, function (p) {
|
|
27
|
+
return p.antPrefix;
|
|
28
|
+
}, function (p) {
|
|
29
|
+
return p.antPrefix;
|
|
30
|
+
}, function (p) {
|
|
31
|
+
return p.antPrefix;
|
|
32
|
+
}, function (p) {
|
|
33
|
+
return p.antPrefix;
|
|
34
|
+
}, function (p) {
|
|
35
|
+
return p.antPrefix;
|
|
36
|
+
}, function (p) {
|
|
37
|
+
return p.antPrefix;
|
|
38
|
+
}, function (p) {
|
|
39
|
+
return p.antPrefix;
|
|
40
|
+
}, function (p) {
|
|
41
|
+
return p.antPrefix;
|
|
42
|
+
}, function (p) {
|
|
43
|
+
return p.antPrefix;
|
|
44
|
+
}, function (p) {
|
|
45
|
+
return p.antPrefix;
|
|
46
|
+
}, function (p) {
|
|
47
|
+
return p.antPrefix;
|
|
48
|
+
}, function (p) {
|
|
49
|
+
return p.antPrefix;
|
|
50
|
+
});
|
|
@@ -18,6 +18,7 @@ import { html } from '@codemirror/lang-html';
|
|
|
18
18
|
import { java } from '@codemirror/lang-java';
|
|
19
19
|
import { javascript } from '@codemirror/lang-javascript';
|
|
20
20
|
import { json, jsonParseLinter } from '@codemirror/lang-json';
|
|
21
|
+
import { markdown } from '@codemirror/lang-markdown';
|
|
21
22
|
import { php } from '@codemirror/lang-php';
|
|
22
23
|
import { python } from '@codemirror/lang-python';
|
|
23
24
|
import { yaml } from '@codemirror/lang-yaml';
|
|
@@ -28,8 +29,10 @@ import { ConfigProvider, theme } from 'antd';
|
|
|
28
29
|
import cls from 'classnames';
|
|
29
30
|
import { omit } from 'lodash-es';
|
|
30
31
|
import React, { useMemo } from 'react';
|
|
31
|
-
import
|
|
32
|
+
import { useStyle } from "./index.style";
|
|
32
33
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
36
|
export var langExtensionsMap = {
|
|
34
37
|
javascript: [javascript()],
|
|
35
38
|
jsx: [javascript()],
|
|
@@ -42,7 +45,8 @@ export var langExtensionsMap = {
|
|
|
42
45
|
csharp: [cpp()],
|
|
43
46
|
css: [css()],
|
|
44
47
|
html: [html()],
|
|
45
|
-
curl: []
|
|
48
|
+
curl: [],
|
|
49
|
+
markdown: [markdown()]
|
|
46
50
|
};
|
|
47
51
|
var lintExtensionsMap = {
|
|
48
52
|
javascript: [lintGutter()],
|
|
@@ -64,10 +68,7 @@ var CodeMirrorWrapper = function CodeMirrorWrapper(props) {
|
|
|
64
68
|
var isDarkMode = context.theme.algorithm === theme.darkAlgorithm;
|
|
65
69
|
var sparkPrefix = commonConfig.sparkPrefix,
|
|
66
70
|
antPrefix = commonConfig.antPrefix;
|
|
67
|
-
|
|
68
|
-
sparkPrefix: sparkPrefix,
|
|
69
|
-
antPrefix: antPrefix
|
|
70
|
-
});
|
|
71
|
+
var Style = useStyle();
|
|
71
72
|
var getTheme = useMemo(function () {
|
|
72
73
|
if (props.theme === undefined) {
|
|
73
74
|
if (isDarkMode) {
|
|
@@ -80,13 +81,15 @@ var CodeMirrorWrapper = function CodeMirrorWrapper(props) {
|
|
|
80
81
|
var extensions = typeof props.language === 'string' ? [].concat(_toConsumableArray(langExtensionsMap[props.language] || []), _toConsumableArray(props.value && props.language in lintExtensionsMap ? lintExtensionsMap[props.language] : [])) : props.language.reduce(function (ext, lang) {
|
|
81
82
|
return [].concat(_toConsumableArray(ext), [langExtensionsMap[lang]]);
|
|
82
83
|
}, []);
|
|
83
|
-
return /*#__PURE__*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
85
|
+
children: [/*#__PURE__*/_jsx(Style, {}), /*#__PURE__*/_jsx("div", {
|
|
86
|
+
className: cls("".concat(sparkPrefix, "-code-block"), props.className),
|
|
87
|
+
children: /*#__PURE__*/_jsx(CodeMirror, _objectSpread({
|
|
88
|
+
extensions: extensions,
|
|
89
|
+
value: props.language === 'json' ? beautifulJson(props.value) : props.value,
|
|
90
|
+
theme: getTheme
|
|
91
|
+
}, omit(props, ['language', 'theme', 'extensions', 'value'])))
|
|
92
|
+
})]
|
|
90
93
|
});
|
|
91
94
|
};
|
|
92
95
|
export default CodeMirrorWrapper;
|
|
@@ -1,354 +1 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
[x: string]: {
|
|
3
|
-
width: string;
|
|
4
|
-
border?: undefined;
|
|
5
|
-
borderRadius?: undefined;
|
|
6
|
-
borderRight?: undefined;
|
|
7
|
-
backgroundColor?: undefined;
|
|
8
|
-
color?: undefined;
|
|
9
|
-
height?: undefined;
|
|
10
|
-
lineHeight?: undefined;
|
|
11
|
-
display?: undefined;
|
|
12
|
-
alignItems?: undefined;
|
|
13
|
-
justifyContent?: undefined;
|
|
14
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
15
|
-
padding?: undefined;
|
|
16
|
-
backgroundImage?: undefined;
|
|
17
|
-
background?: undefined;
|
|
18
|
-
'&:hover'?: undefined;
|
|
19
|
-
right?: undefined;
|
|
20
|
-
fontSize?: undefined;
|
|
21
|
-
outline?: undefined;
|
|
22
|
-
} | {
|
|
23
|
-
border: string;
|
|
24
|
-
borderRadius: string;
|
|
25
|
-
width?: undefined;
|
|
26
|
-
borderRight?: undefined;
|
|
27
|
-
backgroundColor?: undefined;
|
|
28
|
-
color?: undefined;
|
|
29
|
-
height?: undefined;
|
|
30
|
-
lineHeight?: undefined;
|
|
31
|
-
display?: undefined;
|
|
32
|
-
alignItems?: undefined;
|
|
33
|
-
justifyContent?: undefined;
|
|
34
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
35
|
-
padding?: undefined;
|
|
36
|
-
backgroundImage?: undefined;
|
|
37
|
-
background?: undefined;
|
|
38
|
-
'&:hover'?: undefined;
|
|
39
|
-
right?: undefined;
|
|
40
|
-
fontSize?: undefined;
|
|
41
|
-
outline?: undefined;
|
|
42
|
-
} | {
|
|
43
|
-
borderRight: string;
|
|
44
|
-
backgroundColor: string;
|
|
45
|
-
width?: undefined;
|
|
46
|
-
border?: undefined;
|
|
47
|
-
borderRadius?: undefined;
|
|
48
|
-
color?: undefined;
|
|
49
|
-
height?: undefined;
|
|
50
|
-
lineHeight?: undefined;
|
|
51
|
-
display?: undefined;
|
|
52
|
-
alignItems?: undefined;
|
|
53
|
-
justifyContent?: undefined;
|
|
54
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
55
|
-
padding?: undefined;
|
|
56
|
-
backgroundImage?: undefined;
|
|
57
|
-
background?: undefined;
|
|
58
|
-
'&:hover'?: undefined;
|
|
59
|
-
right?: undefined;
|
|
60
|
-
fontSize?: undefined;
|
|
61
|
-
outline?: undefined;
|
|
62
|
-
} | {
|
|
63
|
-
backgroundColor: string;
|
|
64
|
-
width?: undefined;
|
|
65
|
-
border?: undefined;
|
|
66
|
-
borderRadius?: undefined;
|
|
67
|
-
borderRight?: undefined;
|
|
68
|
-
color?: undefined;
|
|
69
|
-
height?: undefined;
|
|
70
|
-
lineHeight?: undefined;
|
|
71
|
-
display?: undefined;
|
|
72
|
-
alignItems?: undefined;
|
|
73
|
-
justifyContent?: undefined;
|
|
74
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
75
|
-
padding?: undefined;
|
|
76
|
-
backgroundImage?: undefined;
|
|
77
|
-
background?: undefined;
|
|
78
|
-
'&:hover'?: undefined;
|
|
79
|
-
right?: undefined;
|
|
80
|
-
fontSize?: undefined;
|
|
81
|
-
outline?: undefined;
|
|
82
|
-
} | {
|
|
83
|
-
color: string;
|
|
84
|
-
height: string;
|
|
85
|
-
lineHeight: string;
|
|
86
|
-
display: string;
|
|
87
|
-
alignItems: string;
|
|
88
|
-
justifyContent: string;
|
|
89
|
-
"span:not([title*=\"Unfold line\"])": {
|
|
90
|
-
height: string;
|
|
91
|
-
};
|
|
92
|
-
width?: undefined;
|
|
93
|
-
border?: undefined;
|
|
94
|
-
borderRadius?: undefined;
|
|
95
|
-
borderRight?: undefined;
|
|
96
|
-
backgroundColor?: undefined;
|
|
97
|
-
padding?: undefined;
|
|
98
|
-
backgroundImage?: undefined;
|
|
99
|
-
background?: undefined;
|
|
100
|
-
'&:hover'?: undefined;
|
|
101
|
-
right?: undefined;
|
|
102
|
-
fontSize?: undefined;
|
|
103
|
-
outline?: undefined;
|
|
104
|
-
} | {
|
|
105
|
-
height: string;
|
|
106
|
-
lineHeight: string;
|
|
107
|
-
width?: undefined;
|
|
108
|
-
border?: undefined;
|
|
109
|
-
borderRadius?: undefined;
|
|
110
|
-
borderRight?: undefined;
|
|
111
|
-
backgroundColor?: undefined;
|
|
112
|
-
color?: undefined;
|
|
113
|
-
display?: undefined;
|
|
114
|
-
alignItems?: undefined;
|
|
115
|
-
justifyContent?: undefined;
|
|
116
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
117
|
-
padding?: undefined;
|
|
118
|
-
backgroundImage?: undefined;
|
|
119
|
-
background?: undefined;
|
|
120
|
-
'&:hover'?: undefined;
|
|
121
|
-
right?: undefined;
|
|
122
|
-
fontSize?: undefined;
|
|
123
|
-
outline?: undefined;
|
|
124
|
-
} | {
|
|
125
|
-
padding: string;
|
|
126
|
-
width?: undefined;
|
|
127
|
-
border?: undefined;
|
|
128
|
-
borderRadius?: undefined;
|
|
129
|
-
borderRight?: undefined;
|
|
130
|
-
backgroundColor?: undefined;
|
|
131
|
-
color?: undefined;
|
|
132
|
-
height?: undefined;
|
|
133
|
-
lineHeight?: undefined;
|
|
134
|
-
display?: undefined;
|
|
135
|
-
alignItems?: undefined;
|
|
136
|
-
justifyContent?: undefined;
|
|
137
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
138
|
-
backgroundImage?: undefined;
|
|
139
|
-
background?: undefined;
|
|
140
|
-
'&:hover'?: undefined;
|
|
141
|
-
right?: undefined;
|
|
142
|
-
fontSize?: undefined;
|
|
143
|
-
outline?: undefined;
|
|
144
|
-
} | {
|
|
145
|
-
backgroundImage: string;
|
|
146
|
-
background: string;
|
|
147
|
-
border: string;
|
|
148
|
-
borderRadius: string;
|
|
149
|
-
'&:hover': {
|
|
150
|
-
color: string;
|
|
151
|
-
cursor: string;
|
|
152
|
-
};
|
|
153
|
-
width?: undefined;
|
|
154
|
-
borderRight?: undefined;
|
|
155
|
-
backgroundColor?: undefined;
|
|
156
|
-
color?: undefined;
|
|
157
|
-
height?: undefined;
|
|
158
|
-
lineHeight?: undefined;
|
|
159
|
-
display?: undefined;
|
|
160
|
-
alignItems?: undefined;
|
|
161
|
-
justifyContent?: undefined;
|
|
162
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
163
|
-
padding?: undefined;
|
|
164
|
-
right?: undefined;
|
|
165
|
-
fontSize?: undefined;
|
|
166
|
-
outline?: undefined;
|
|
167
|
-
} | {
|
|
168
|
-
background: string;
|
|
169
|
-
width?: undefined;
|
|
170
|
-
border?: undefined;
|
|
171
|
-
borderRadius?: undefined;
|
|
172
|
-
borderRight?: undefined;
|
|
173
|
-
backgroundColor?: undefined;
|
|
174
|
-
color?: undefined;
|
|
175
|
-
height?: undefined;
|
|
176
|
-
lineHeight?: undefined;
|
|
177
|
-
display?: undefined;
|
|
178
|
-
alignItems?: undefined;
|
|
179
|
-
justifyContent?: undefined;
|
|
180
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
181
|
-
padding?: undefined;
|
|
182
|
-
backgroundImage?: undefined;
|
|
183
|
-
'&:hover'?: undefined;
|
|
184
|
-
right?: undefined;
|
|
185
|
-
fontSize?: undefined;
|
|
186
|
-
outline?: undefined;
|
|
187
|
-
} | {
|
|
188
|
-
display: string;
|
|
189
|
-
alignItems: string;
|
|
190
|
-
width?: undefined;
|
|
191
|
-
border?: undefined;
|
|
192
|
-
borderRadius?: undefined;
|
|
193
|
-
borderRight?: undefined;
|
|
194
|
-
backgroundColor?: undefined;
|
|
195
|
-
color?: undefined;
|
|
196
|
-
height?: undefined;
|
|
197
|
-
lineHeight?: undefined;
|
|
198
|
-
justifyContent?: undefined;
|
|
199
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
200
|
-
padding?: undefined;
|
|
201
|
-
backgroundImage?: undefined;
|
|
202
|
-
background?: undefined;
|
|
203
|
-
'&:hover'?: undefined;
|
|
204
|
-
right?: undefined;
|
|
205
|
-
fontSize?: undefined;
|
|
206
|
-
outline?: undefined;
|
|
207
|
-
} | {
|
|
208
|
-
right: string;
|
|
209
|
-
background: string;
|
|
210
|
-
fontSize: string;
|
|
211
|
-
color: string;
|
|
212
|
-
width?: undefined;
|
|
213
|
-
border?: undefined;
|
|
214
|
-
borderRadius?: undefined;
|
|
215
|
-
borderRight?: undefined;
|
|
216
|
-
backgroundColor?: undefined;
|
|
217
|
-
height?: undefined;
|
|
218
|
-
lineHeight?: undefined;
|
|
219
|
-
display?: undefined;
|
|
220
|
-
alignItems?: undefined;
|
|
221
|
-
justifyContent?: undefined;
|
|
222
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
223
|
-
padding?: undefined;
|
|
224
|
-
backgroundImage?: undefined;
|
|
225
|
-
'&:hover'?: undefined;
|
|
226
|
-
outline?: undefined;
|
|
227
|
-
} | {
|
|
228
|
-
borderRadius: string;
|
|
229
|
-
width?: undefined;
|
|
230
|
-
border?: undefined;
|
|
231
|
-
borderRight?: undefined;
|
|
232
|
-
backgroundColor?: undefined;
|
|
233
|
-
color?: undefined;
|
|
234
|
-
height?: undefined;
|
|
235
|
-
lineHeight?: undefined;
|
|
236
|
-
display?: undefined;
|
|
237
|
-
alignItems?: undefined;
|
|
238
|
-
justifyContent?: undefined;
|
|
239
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
240
|
-
padding?: undefined;
|
|
241
|
-
backgroundImage?: undefined;
|
|
242
|
-
background?: undefined;
|
|
243
|
-
'&:hover'?: undefined;
|
|
244
|
-
right?: undefined;
|
|
245
|
-
fontSize?: undefined;
|
|
246
|
-
outline?: undefined;
|
|
247
|
-
} | {
|
|
248
|
-
border: string;
|
|
249
|
-
width?: undefined;
|
|
250
|
-
borderRadius?: undefined;
|
|
251
|
-
borderRight?: undefined;
|
|
252
|
-
backgroundColor?: undefined;
|
|
253
|
-
color?: undefined;
|
|
254
|
-
height?: undefined;
|
|
255
|
-
lineHeight?: undefined;
|
|
256
|
-
display?: undefined;
|
|
257
|
-
alignItems?: undefined;
|
|
258
|
-
justifyContent?: undefined;
|
|
259
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
260
|
-
padding?: undefined;
|
|
261
|
-
backgroundImage?: undefined;
|
|
262
|
-
background?: undefined;
|
|
263
|
-
'&:hover'?: undefined;
|
|
264
|
-
right?: undefined;
|
|
265
|
-
fontSize?: undefined;
|
|
266
|
-
outline?: undefined;
|
|
267
|
-
} | {
|
|
268
|
-
outline: string;
|
|
269
|
-
width?: undefined;
|
|
270
|
-
border?: undefined;
|
|
271
|
-
borderRadius?: undefined;
|
|
272
|
-
borderRight?: undefined;
|
|
273
|
-
backgroundColor?: undefined;
|
|
274
|
-
color?: undefined;
|
|
275
|
-
height?: undefined;
|
|
276
|
-
lineHeight?: undefined;
|
|
277
|
-
display?: undefined;
|
|
278
|
-
alignItems?: undefined;
|
|
279
|
-
justifyContent?: undefined;
|
|
280
|
-
"span:not([title*=\"Unfold line\"])"?: undefined;
|
|
281
|
-
padding?: undefined;
|
|
282
|
-
backgroundImage?: undefined;
|
|
283
|
-
background?: undefined;
|
|
284
|
-
'&:hover'?: undefined;
|
|
285
|
-
right?: undefined;
|
|
286
|
-
fontSize?: undefined;
|
|
287
|
-
};
|
|
288
|
-
'.cm-theme': {
|
|
289
|
-
border: string;
|
|
290
|
-
borderRadius: string;
|
|
291
|
-
};
|
|
292
|
-
'.cm-gutters': {
|
|
293
|
-
borderRight: string;
|
|
294
|
-
backgroundColor: string;
|
|
295
|
-
};
|
|
296
|
-
'.cm-editor': {
|
|
297
|
-
backgroundColor: string;
|
|
298
|
-
};
|
|
299
|
-
'.cm-gutterElement:not(:first-child)': {
|
|
300
|
-
color: string;
|
|
301
|
-
height: string;
|
|
302
|
-
lineHeight: string;
|
|
303
|
-
display: string;
|
|
304
|
-
alignItems: string;
|
|
305
|
-
justifyContent: string;
|
|
306
|
-
"span:not([title*=\"Unfold line\"])": {
|
|
307
|
-
height: string;
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
'.cm-line': {
|
|
311
|
-
height: string;
|
|
312
|
-
lineHeight: string;
|
|
313
|
-
};
|
|
314
|
-
'.cm-lineNumbers .cm-gutterElement': {
|
|
315
|
-
padding: string;
|
|
316
|
-
};
|
|
317
|
-
'.cm-activeLine, .cm-activeLineGutter': {
|
|
318
|
-
backgroundColor: string;
|
|
319
|
-
};
|
|
320
|
-
'.cm-button': {
|
|
321
|
-
backgroundImage: string;
|
|
322
|
-
background: string;
|
|
323
|
-
border: string;
|
|
324
|
-
borderRadius: string;
|
|
325
|
-
'&:hover': {
|
|
326
|
-
color: string;
|
|
327
|
-
cursor: string;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
'.cm-search': {
|
|
331
|
-
background: string;
|
|
332
|
-
};
|
|
333
|
-
'.cm-panel.cm-search label': {
|
|
334
|
-
display: string;
|
|
335
|
-
alignItems: string;
|
|
336
|
-
};
|
|
337
|
-
'.cm-panel.cm-search [name=close]': {
|
|
338
|
-
right: string;
|
|
339
|
-
background: string;
|
|
340
|
-
fontSize: string;
|
|
341
|
-
color: string;
|
|
342
|
-
};
|
|
343
|
-
'.cm-textfield': {
|
|
344
|
-
borderRadius: string;
|
|
345
|
-
};
|
|
346
|
-
'.cm-panel.cm-search input[type=checkbox]': {
|
|
347
|
-
border: string;
|
|
348
|
-
};
|
|
349
|
-
'.cm-focused': {
|
|
350
|
-
outline: string;
|
|
351
|
-
};
|
|
352
|
-
};
|
|
353
|
-
declare const useIndexStyle: (props?: {}) => import("../../../config").CommonConfig;
|
|
354
|
-
export default useIndexStyle;
|
|
1
|
+
export declare const useStyle: () => () => import("react/jsx-runtime").JSX.Element;
|