@antv/dumi-theme-antv 0.7.9 → 0.8.0-beta.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/dist/builtins/Playground/index.js +1 -1
- package/dist/common/styles/Common.js +1 -1
- package/dist/common/styles/theme.js +1 -1
- package/dist/components/AI/HomeDialog/AntVBanner/index.js +4 -0
- package/dist/components/AI/HomeDialog/AntVBanner/index.module.less +35 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.js +29 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.module.less +272 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +51 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.module.less +5 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.js +25 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.module.less +42 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.js +23 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.module.less +9 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.js +132 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +127 -0
- package/dist/components/AI/HomeDialog/RecommendCase/Card.js +70 -0
- package/dist/components/AI/HomeDialog/RecommendCase/card.module.less +131 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.js +76 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.module.less +43 -0
- package/dist/components/AI/HomeDialog/RecommendCase/recommend.json +42 -0
- package/dist/components/AI/HomeDialog/index.js +65 -0
- package/dist/components/AI/HomeDialog/index.module.less +3 -0
- package/dist/components/AI/constant.js +35 -0
- package/dist/components/AI/index.js +1 -0
- package/dist/components/AI/types.js +1 -0
- package/dist/components/AI/utils.js +38 -0
- package/dist/hooks/useProducts.js +18 -0
- package/dist/hooks/useStreamingText.js +119 -0
- package/dist/hooks/useVisionsnapSdk.js +159 -0
- package/dist/layouts/DocLayout.js +0 -1
- package/dist/layouts/GlobalLayout/index.js +15 -0
- package/dist/model/AIChat.js +214 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +146 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.module.less +44 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +65 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +47 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.js +187 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.module.less +42 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.js +25 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +34 -0
- package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +110 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.js +60 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.module.less +8 -0
- package/dist/pages/AIPlayground/demo.js +34 -0
- package/dist/pages/AIPlayground/index.js +9 -0
- package/dist/pages/AIPlayground/index.module.less +0 -0
- package/dist/pages/Examples/index.module.less +2 -2
- package/dist/pages/Index/components/Cases/index.module.less +1 -1
- package/dist/pages/Index/components/Companies/index.module.less +1 -1
- package/dist/pages/Index/components/Features/index.module.less +1 -1
- package/dist/pages/Index/index.js +1 -1
- package/dist/plugin/index.js +14 -6
- package/dist/slots/Banner/index.module.less +1 -1
- package/dist/slots/CodeEditor/Toolbar.js +6 -2
- package/dist/slots/CodeEditor/Toolbar.module.less +6 -0
- package/dist/slots/CodeEditor/index.js +28 -2
- package/dist/slots/CodeEditor/index.module.less +22 -0
- package/dist/{pages/Index/components → slots}/Detail/News.js +1 -1
- package/dist/{pages/Index/components → slots}/Detail/index.js +11 -28
- package/dist/{pages/Index/components → slots}/Detail/index.module.less +13 -7
- package/dist/slots/Footer/index.module.less +1 -1
- package/dist/slots/Header/Products/Product.module.less +1 -1
- package/dist/slots/Header/Products/getProducts.js +20 -26
- package/dist/slots/Header/Products/index.js +20 -16
- package/dist/slots/Header/Search/SearchResult.js +35 -14
- package/dist/slots/Header/Search/index.js +2 -1
- package/dist/slots/Header/index.module.less +2 -2
- package/dist/typings.d.ts +5 -0
- package/package.json +21 -2
- /package/dist/{pages/Index/components → slots}/Detail/News.module.less +0 -0
|
@@ -4,6 +4,6 @@ import { css, Global } from '@emotion/react';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
export default (function () {
|
|
6
6
|
return /*#__PURE__*/React.createElement(Global, {
|
|
7
|
-
styles: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :root {\n --container-max-width: 1440px;\n --container-padding-large: 80px;\n --container-padding-medium: 80px;\n --container-padding-small: 32px;\n --primary-color: #873bf4;\n --toc-width: 260px;\n --border-color-split: #f0f0f0;\n --text-color-secondary: rgba(0, 0, 0, 0.45);\n --text-color: rgba(0, 0, 0, 0.85);\n --font-family:
|
|
7
|
+
styles: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :root {\n --container-max-width: 1440px;\n --container-padding-large: 80px;\n --container-padding-medium: 80px;\n --container-padding-small: 32px;\n --primary-color: #873bf4;\n --toc-width: 260px;\n --border-color-split: #f0f0f0;\n --text-color-secondary: rgba(0, 0, 0, 0.45);\n --text-color: rgba(0, 0, 0, 0.85);\n --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';\n }\n\n @font-face {\n font-family: AlibabaPuHuiTiRHeavy;\n src: url(../../font/Alibaba-PuHuiTi-Heavy.otf);\n }\n\n body {\n margin: 0;\n color: rgba(0, 0, 0, 0.85);\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',\n sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';\n font-variant: tabular-nums;\n line-height: 1.5715;\n background-color: #fff;\n font-feature-settings: 'tnum';\n text-decoration: none;\n }\n\n a {\n text-decoration: none;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n transition: color 0.3s;\n -webkit-text-decoration-skip: objects;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n > a[aria-hidden]:first-child {\n float: left;\n width: 20px;\n font-size: 0;\n line-height: inherit;\n text-align: right;\n padding-inline-end: 6px;\n margin-inline-start: -20px;\n\n &:hover {\n border: 0;\n }\n\n > .icon-link::before {\n font-size: 20px;\n content: '#';\n }\n }\n\n &:not(:hover) > a[aria-hidden]:first-child > .icon-link {\n visibility: hidden;\n }\n }\n\n /* \u975E\u5E38\u5173\u952E\uFF0C\u7528\u4E8E react-split-pane \u7684\u6837\u5F0F\uFF0C\u5982\u679C\u6CA1\u6709\uFF0C\u4F1A\u6CA1\u6709\u529E\u6CD5\u9F20\u6807\u62D6\u62FD */\n /* \u53C2\u8003\uFF1Ahttps://codesandbox.io/s/mow7x4zyqx */\n .Pane1,\n .Pane2 {\n overflow: auto;\n }\n\n .Resizer {\n z-index: 1;\n box-sizing: border-box;\n background: #000;\n background-clip: padding-box;\n opacity: 0.1;\n\n &:hover {\n transition: all 2s ease;\n }\n\n &.horizontal {\n width: 100%;\n height: 11px;\n margin: -5px 0;\n border-top: 5px solid rgba(255, 255, 255, 0);\n border-bottom: 5px solid rgba(255, 255, 255, 0);\n cursor: row-resize;\n\n &:hover {\n border-top: 5px solid rgba(0, 0, 0, 0.5);\n border-bottom: 5px solid rgba(0, 0, 0, 0.5);\n }\n }\n\n &.vertical {\n width: 11px;\n margin: 0 -5px;\n border-right: 5px solid rgba(255, 255, 255, 0);\n border-left: 5px solid rgba(255, 255, 255, 0);\n cursor: col-resize;\n\n Pane2 {\n border-left: 1px solid #e6e6e6;\n }\n\n &:hover {\n border-right: 5px solid rgba(0, 0, 0, 0.5);\n border-left: 5px solid rgba(0, 0, 0, 0.5);\n }\n }\n\n &.disabled {\n cursor: not-allowed;\n\n &:hover {\n border-color: transparent;\n }\n }\n }\n\n /* \u6BB5\u843D\u53CD\u9988 Icon */\n .comment-link {\n font-size: 0.8em;\n float: right;\n color: #6d7c92;\n transform: scale(0.9);\n transition: background 0.3s, color 0.3s;\n\n &:hover {\n color: #873bf4;\n background-color: #f8f1ff;\n cursor: pointer;\n border-radius: 2px;\n }\n }\n "])))
|
|
8
8
|
});
|
|
9
9
|
});
|
|
@@ -4,7 +4,7 @@ export var defaultToken = {
|
|
|
4
4
|
colorLink: '#873bf4',
|
|
5
5
|
colorPrimary: '#873bf4',
|
|
6
6
|
colorText: 'rgba(0, 0, 0, 0.85)',
|
|
7
|
-
fontFamily: '
|
|
7
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, \'Helvetica Neue\', Arial, \'Noto Sans\', \'PingFang SC\', \'Microsoft YaHei\', sans-serif, \'Apple Color Emoji\', \'Segoe UI Emoji\' !important;',
|
|
8
8
|
fontSize: 14,
|
|
9
9
|
primaryColor: '#873bf4',
|
|
10
10
|
textColor: 'rgba(0, 0, 0, 0.85)',
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
text-align: center;
|
|
3
|
+
margin-bottom: 16px;
|
|
4
|
+
|
|
5
|
+
.sage {
|
|
6
|
+
width: 128px;
|
|
7
|
+
margin-bottom: 4px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
h1 {
|
|
11
|
+
font-size: 32px;
|
|
12
|
+
color: #1d2129;
|
|
13
|
+
line-height: 32px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
margin: 0;
|
|
16
|
+
margin-bottom: 12px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.desc {
|
|
20
|
+
font-size: 18px;
|
|
21
|
+
color: #1d2129b7;
|
|
22
|
+
line-height: 32px;
|
|
23
|
+
letter-spacing: 1.13px;
|
|
24
|
+
text-align: center;
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.slogan {
|
|
29
|
+
background: linear-gradient(to right, #6d81ba, #6475ff);
|
|
30
|
+
-webkit-background-clip: text;
|
|
31
|
+
-webkit-text-fill-color: transparent;
|
|
32
|
+
margin: 0px;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import styles from "./index.module.less";
|
|
8
|
+
import { AIMode, AIModeMeta } from "../../constant";
|
|
9
|
+
export var ModeSelector = function ModeSelector(_ref) {
|
|
10
|
+
var value = _ref.value,
|
|
11
|
+
size = _ref.size,
|
|
12
|
+
onChange = _ref.onChange;
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: classnames(styles.datasetSelector, _defineProperty({}, styles.compact, size === 'compact'))
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: styles.typeSwitcher
|
|
17
|
+
}, [AIMode.implement, AIMode.solve].map(function (mode) {
|
|
18
|
+
var meta = AIModeMeta[mode];
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
key: mode,
|
|
21
|
+
className: classnames(styles.switchBtn, _defineProperty({}, styles.active, mode === value)),
|
|
22
|
+
onClick: function onClick() {
|
|
23
|
+
if (mode !== value) {
|
|
24
|
+
onChange(mode);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, meta.icon, /*#__PURE__*/React.createElement("span", null, meta.name));
|
|
28
|
+
})));
|
|
29
|
+
};
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
.datasetSelectorModalWrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
:global {
|
|
6
|
+
.ant-modal-header {
|
|
7
|
+
padding: 16px;
|
|
8
|
+
|
|
9
|
+
.ant-modal-title {
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.typeSwitcher {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
gap: 6px;
|
|
24
|
+
|
|
25
|
+
backdrop-filter: blur(12px);
|
|
26
|
+
padding: 4px;
|
|
27
|
+
border-radius: 26px;
|
|
28
|
+
box-shadow: inset 1px -1px 0 0 rgba(255, 255, 255, 0.89);
|
|
29
|
+
|
|
30
|
+
&::before {
|
|
31
|
+
border-radius: 26px;
|
|
32
|
+
display: block;
|
|
33
|
+
content: ' ';
|
|
34
|
+
position: absolute;
|
|
35
|
+
z-index: -1;
|
|
36
|
+
left: 0;
|
|
37
|
+
right: 0;
|
|
38
|
+
top: 0;
|
|
39
|
+
bottom: 0;
|
|
40
|
+
opacity: 0.75;
|
|
41
|
+
background-image: linear-gradient(
|
|
42
|
+
90deg,
|
|
43
|
+
rgba(255, 255, 255, 0.02) 0%,
|
|
44
|
+
rgba(217, 217, 217, 0.06) 50%,
|
|
45
|
+
rgba(29, 33, 41, 0) 100%
|
|
46
|
+
);
|
|
47
|
+
box-shadow: inset 1px -1px 0 0 rgba(255, 255, 255, 0.89);
|
|
48
|
+
background: rgba(255, 255, 255, 0.5);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.switchBtn {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
|
|
57
|
+
width: 120px;
|
|
58
|
+
height: 38px;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
border-radius: 20px;
|
|
61
|
+
border: 1px solid transparent;
|
|
62
|
+
color: #1d2129cb;
|
|
63
|
+
|
|
64
|
+
span[role='img'] {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.active {
|
|
69
|
+
color: #1d2129;
|
|
70
|
+
font-weight: 500;
|
|
71
|
+
|
|
72
|
+
background: #ffffff;
|
|
73
|
+
border-color: #eeeef0;
|
|
74
|
+
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.08);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.datasetSelectorModal {
|
|
80
|
+
top: 0px;
|
|
81
|
+
padding-bottom: 0px;
|
|
82
|
+
|
|
83
|
+
.listItemContent {
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
border: none;
|
|
86
|
+
line-height: 22px;
|
|
87
|
+
&.disabled {
|
|
88
|
+
color: #86909c;
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
}
|
|
91
|
+
&:hover {
|
|
92
|
+
background: #1677ff1a;
|
|
93
|
+
}
|
|
94
|
+
&:not(.disabled):hover {
|
|
95
|
+
color: #1677ff;
|
|
96
|
+
}
|
|
97
|
+
padding: 7px 16px 7px 7px;
|
|
98
|
+
&--multiline {
|
|
99
|
+
padding: 4px 16px 4px 7px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.selected {
|
|
103
|
+
background: #1677ff1a;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
color: #1677ff;
|
|
106
|
+
}
|
|
107
|
+
.nameWrapper {
|
|
108
|
+
flex: 1 1;
|
|
109
|
+
min-width: 0;
|
|
110
|
+
|
|
111
|
+
.name {
|
|
112
|
+
font-size: 14px;
|
|
113
|
+
line-height: 22px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
|
|
118
|
+
.nameText {
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
.desc {
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
color: #86909ccc;
|
|
128
|
+
line-height: 22px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.list {
|
|
132
|
+
background: #ffffffdb;
|
|
133
|
+
padding: 10px 18px 18px 18px;
|
|
134
|
+
:global {
|
|
135
|
+
.ant-input-affix-wrapper {
|
|
136
|
+
margin-bottom: 8px;
|
|
137
|
+
border-radius: 6px;
|
|
138
|
+
color: #5a607f65;
|
|
139
|
+
.ant-input-prefix {
|
|
140
|
+
margin-right: 8px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:global {
|
|
147
|
+
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn,
|
|
148
|
+
.ant-alert-info .ant-alert-icon {
|
|
149
|
+
color: #1677ff;
|
|
150
|
+
}
|
|
151
|
+
.ant-modal-footer {
|
|
152
|
+
button {
|
|
153
|
+
box-shadow: none;
|
|
154
|
+
&.ant-btn-primary {
|
|
155
|
+
color: white;
|
|
156
|
+
background: #1677ff;
|
|
157
|
+
}
|
|
158
|
+
background: none;
|
|
159
|
+
border: none;
|
|
160
|
+
border-radius: 6px;
|
|
161
|
+
font-size: 14px;
|
|
162
|
+
width: 60px;
|
|
163
|
+
height: 32px;
|
|
164
|
+
color: #4e5969e6;
|
|
165
|
+
&:disabled {
|
|
166
|
+
background: #4e59693c;
|
|
167
|
+
color: white;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
.ant-modal-close-x {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
.ant-modal-body {
|
|
175
|
+
padding: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ant-modal-header {
|
|
179
|
+
border-radius: 8px 8px 0 0;
|
|
180
|
+
}
|
|
181
|
+
.ant-modal-content {
|
|
182
|
+
border-radius: 8px;
|
|
183
|
+
}
|
|
184
|
+
.ant-modal-content {
|
|
185
|
+
background-color: rgb(251, 252, 253);
|
|
186
|
+
}
|
|
187
|
+
.ant-tabs-nav {
|
|
188
|
+
padding-left: 18px;
|
|
189
|
+
padding-right: 18px;
|
|
190
|
+
margin-bottom: 0;
|
|
191
|
+
}
|
|
192
|
+
.ant-tabs-tab {
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
padding: 14px 0 13px 0;
|
|
195
|
+
}
|
|
196
|
+
.ant-alert {
|
|
197
|
+
padding: 4px 15px;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.datasetSelector {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
justify-content: center;
|
|
206
|
+
margin-bottom: 16px;
|
|
207
|
+
|
|
208
|
+
> div:not(:last-child) {
|
|
209
|
+
margin-right: 16px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.result {
|
|
213
|
+
flex: 1 1;
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
text-overflow: ellipsis;
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
|
|
218
|
+
font-size: 14px;
|
|
219
|
+
color: #5a607fe0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&.compact {
|
|
223
|
+
justify-content: flex-start;
|
|
224
|
+
margin-bottom: 8px;
|
|
225
|
+
|
|
226
|
+
> div:not(:last-child) {
|
|
227
|
+
margin-right: 8px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.switchBtn {
|
|
231
|
+
width: 100px;
|
|
232
|
+
border-radius: 12px;
|
|
233
|
+
background: #ffffff;
|
|
234
|
+
border: 1px solid #5a607fe0;
|
|
235
|
+
opacity: 0.4;
|
|
236
|
+
box-shadow: 0px 3px 12px 0px #0000000a;
|
|
237
|
+
font-size: 14px;
|
|
238
|
+
color: #86909c;
|
|
239
|
+
line-height: 24px;
|
|
240
|
+
height: 24px;
|
|
241
|
+
|
|
242
|
+
&.active {
|
|
243
|
+
background: #ffffff;
|
|
244
|
+
border: 1px solid #2d84ff;
|
|
245
|
+
color: #1677ff;
|
|
246
|
+
opacity: 1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.error {
|
|
253
|
+
color: #f21818;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.datasetLabel {
|
|
257
|
+
display: inline-block;
|
|
258
|
+
font-size: 12px;
|
|
259
|
+
line-height: 20px;
|
|
260
|
+
padding: 0 8px;
|
|
261
|
+
border-radius: 4px;
|
|
262
|
+
margin-left: 8px;
|
|
263
|
+
flex-shrink: 0;
|
|
264
|
+
|
|
265
|
+
color: #86909c;
|
|
266
|
+
background: rgba(0, 0, 0, 0.04);
|
|
267
|
+
|
|
268
|
+
&.primary {
|
|
269
|
+
color: #f68b02;
|
|
270
|
+
background: rgba(246, 144, 61, 0.1);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dropdown } from "antd";
|
|
3
|
+
import { useProducts } from "../../../../../hooks/useProducts";
|
|
4
|
+
import { useLocale } from "dumi";
|
|
5
|
+
import styles from "./index.module.less";
|
|
6
|
+
export function ChooseLib(props) {
|
|
7
|
+
var _data$find;
|
|
8
|
+
var value = props.value,
|
|
9
|
+
onChange = props.onChange,
|
|
10
|
+
_props$size = props.size,
|
|
11
|
+
size = _props$size === void 0 ? "default" : _props$size;
|
|
12
|
+
var isCompact = size === 'compact';
|
|
13
|
+
var locale = useLocale();
|
|
14
|
+
var lang = locale.id === 'zh' ? 'zh' : 'en';
|
|
15
|
+
var _useProducts = useProducts(),
|
|
16
|
+
_useProducts$data = _useProducts.data,
|
|
17
|
+
data = _useProducts$data === void 0 ? [] : _useProducts$data;
|
|
18
|
+
var onSelect = function onSelect(key) {
|
|
19
|
+
onChange === null || onChange === void 0 || onChange(key);
|
|
20
|
+
};
|
|
21
|
+
var items = data.filter(function (item) {
|
|
22
|
+
return item.lang === lang && ["G2", "F2", "S2", "G6", "X6", "AVA"].includes(item.title);
|
|
23
|
+
}).map(function (item) {
|
|
24
|
+
return {
|
|
25
|
+
key: item.title,
|
|
26
|
+
label: item.title,
|
|
27
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
28
|
+
src: item.icon,
|
|
29
|
+
alt: item.title,
|
|
30
|
+
className: styles.icon
|
|
31
|
+
}),
|
|
32
|
+
extra: !isCompact && item.slogan,
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
return onSelect(item.title);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
39
|
+
menu: {
|
|
40
|
+
items: items
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
43
|
+
type: "button"
|
|
44
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
45
|
+
className: styles.icon,
|
|
46
|
+
src: ((_data$find = data.find(function (item) {
|
|
47
|
+
return item.title === value;
|
|
48
|
+
})) === null || _data$find === void 0 ? void 0 : _data$find.icon) || "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original",
|
|
49
|
+
alt: "AntV"
|
|
50
|
+
}), value || !isCompact && '选择技术栈'));
|
|
51
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styles from "./index.module.less";
|
|
3
|
+
import { FileIcons } from "../../../constant";
|
|
4
|
+
function DatasourceCard(props) {
|
|
5
|
+
var type = props.type,
|
|
6
|
+
title = props.title,
|
|
7
|
+
desc = props.desc,
|
|
8
|
+
onDelete = props.onDelete;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: styles.datasourceCard
|
|
11
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
12
|
+
src: FileIcons[type],
|
|
13
|
+
alt: type
|
|
14
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: styles.title,
|
|
16
|
+
title: title
|
|
17
|
+
}, title), desc && /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: styles.desc
|
|
19
|
+
}, desc), onDelete && /*#__PURE__*/React.createElement("img", {
|
|
20
|
+
className: styles.delete,
|
|
21
|
+
onClick: onDelete,
|
|
22
|
+
src: "https://mdn.alipayobjects.com/huamei_2yzvel/afts/img/A*xfBPTJxWAjoAAAAAAAAAAAAAeriAAQ/original"
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
export { DatasourceCard };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.datasourceCard {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
height: 32px;
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
padding-left: 8px;
|
|
8
|
+
padding-right: 12px;
|
|
9
|
+
background: rgba(212, 215, 219, 0.4);
|
|
10
|
+
border: 1px solid rgba(222, 226, 241, 0.7);
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
|
|
13
|
+
img {
|
|
14
|
+
display: block;
|
|
15
|
+
width: 12px;
|
|
16
|
+
height: 12px;
|
|
17
|
+
margin-right: 6px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.title {
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
color: #4e5969;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
}
|
|
27
|
+
.desc {
|
|
28
|
+
margin-left: 16px;
|
|
29
|
+
font-size: 10px;
|
|
30
|
+
color: #86909c;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.delete {
|
|
34
|
+
display: block;
|
|
35
|
+
width: 16px;
|
|
36
|
+
height: 16px;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
position: absolute;
|
|
39
|
+
right: -12px;
|
|
40
|
+
top: -6px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import styles from "./SendButton.module.less";
|
|
7
|
+
import classnames from 'classnames';
|
|
8
|
+
import { Tooltip } from 'antd';
|
|
9
|
+
function SendButton(props) {
|
|
10
|
+
var _onClick = props.onClick,
|
|
11
|
+
disabled = props.disabled,
|
|
12
|
+
tip = props.tip;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
14
|
+
title: disabled ? tip : null
|
|
15
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
16
|
+
className: classnames(styles.actionBtn, _defineProperty({}, styles.disabled, disabled)),
|
|
17
|
+
onClick: function onClick() {
|
|
18
|
+
!disabled && _onClick();
|
|
19
|
+
},
|
|
20
|
+
src: disabled ? 'https://mdn.alipayobjects.com/huamei_2yzvel/afts/img/A*MzQBS6rzlygAAAAAJ8AAAAgAeriAAQ/original' : 'https://mdn.alipayobjects.com/huamei_2yzvel/afts/img/A*gXFNTJTBx0oAAAAANwAAAAgAeriAAQ/original'
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
export { SendButton };
|