@antv/dumi-theme-antv 0.7.9 → 0.8.0-alpha.3
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/builtins/Playground/index.module.less +0 -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/ModeSelectorDropdown.js +42 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.js +32 -0
- package/dist/components/AI/HomeDialog/ModeSelector/index.module.less +289 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +62 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.module.less +4 -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/Uploader/DataUploader.js +225 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.js +172 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +128 -0
- package/dist/components/AI/HomeDialog/RecommendCase/Card.js +80 -0
- package/dist/components/AI/HomeDialog/RecommendCase/card.module.less +131 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.js +130 -0
- package/dist/components/AI/HomeDialog/RecommendCase/index.module.less +45 -0
- package/dist/components/AI/HomeDialog/RecommendCase/recommend.json +66 -0
- package/dist/components/AI/HomeDialog/index.js +62 -0
- package/dist/components/AI/HomeDialog/index.module.less +3 -0
- package/dist/components/AI/constant.js +37 -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/components/Login/Captcha/index.js +185 -0
- package/dist/components/Login/Captcha/index.less +91 -0
- package/dist/components/Login/CheckCode/index.js +244 -0
- package/dist/components/Login/CheckCode/index.less +137 -0
- package/dist/components/Login/CountDownButton/index.js +109 -0
- package/dist/components/Login/CountDownButton/index.less +8 -0
- package/dist/components/Login/LoginForm.js +239 -0
- package/dist/components/Login/LoginForm.less +408 -0
- package/dist/components/Login/index.js +24 -0
- package/dist/components/Login/openAuthWindow.js +54 -0
- package/dist/components/Login/types.js +5 -0
- package/dist/components/Login/utils.js +47 -0
- package/dist/hooks/useProducts.js +39 -0
- package/dist/hooks/useStreamingText.js +139 -0
- package/dist/hooks/useTypewriter.js +69 -0
- package/dist/hooks/useVisionsnapSdk.js +159 -0
- package/dist/layouts/DocLayout.js +2 -2
- package/dist/layouts/GlobalLayout/index.js +22 -0
- package/dist/locales/en.json +132 -1
- package/dist/locales/zh.json +132 -1
- package/dist/model/AIChat.js +313 -0
- package/dist/model/auth.js +147 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +176 -0
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.module.less +46 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +97 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.module.less +13 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +50 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.js +407 -0
- package/dist/pages/AIPlayground/components/MsgBox/index.module.less +43 -0
- package/dist/pages/AIPlayground/components/MsgBox/useAutoScroll.js +46 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.js +62 -0
- package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +37 -0
- package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +230 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.js +101 -0
- package/dist/pages/AIPlayground/components/TaskBox/index.module.less +9 -0
- package/dist/pages/AIPlayground/demo.js +34 -0
- package/dist/pages/AIPlayground/index.js +12 -0
- package/dist/pages/AIPlayground/index.module.less +5 -0
- package/dist/pages/Examples/components/Accouncement/index.module.less +1 -1
- package/dist/pages/Examples/index.module.less +13 -13
- package/dist/pages/Index/components/Cases/index.module.less +9 -9
- package/dist/pages/Index/components/Companies/index.module.less +5 -4
- package/dist/pages/Index/components/Features/FeatureCard.module.less +4 -5
- package/dist/pages/Index/components/Features/index.module.less +6 -6
- package/dist/pages/Index/components/_.less +9 -9
- package/dist/pages/Index/index.js +1 -1
- package/dist/plugin/index.js +14 -6
- package/dist/slots/Banner/Notification.module.less +8 -8
- package/dist/slots/Banner/index.module.less +11 -10
- package/dist/slots/CodeEditor/Toolbar.js +23 -27
- package/dist/slots/CodeEditor/Toolbar.module.less +7 -0
- package/dist/slots/CodeEditor/index.js +67 -5
- package/dist/slots/CodeEditor/index.module.less +24 -0
- package/dist/slots/CodeEditor/utils.js +2 -1
- package/dist/slots/CodePreview/index.module.less +0 -3
- package/dist/slots/CodeRunner/index.js +24 -11
- package/dist/slots/ContentTable/index.module.less +2 -1
- package/dist/{pages/Index/components → slots}/Detail/News.js +1 -1
- package/dist/{pages/Index/components → slots}/Detail/News.module.less +9 -9
- package/dist/{pages/Index/components → slots}/Detail/index.js +13 -29
- package/dist/{pages/Index/components → slots}/Detail/index.module.less +24 -21
- package/dist/slots/ExampleSider/index.module.less +3 -4
- package/dist/slots/Footer/index.module.less +3 -3
- package/dist/slots/Header/Products/Product.module.less +3 -3
- 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 +53 -14
- package/dist/slots/Header/Search/SearchResult.module.less +1 -0
- package/dist/slots/Header/Search/index.js +2 -1
- package/dist/slots/Header/index.js +72 -30
- package/dist/slots/Header/index.module.less +15 -7
- package/dist/slots/LiveExample/index.js +1 -1
- package/dist/slots/LiveExample/index.module.less +1 -1
- package/dist/slots/Loading/index.module.less +30 -28
- package/dist/slots/ManualContent/index.module.less +14 -17
- package/dist/slots/_.less +9 -9
- package/dist/static/user.svg +3 -0
- package/dist/typings.d.ts +11 -0
- package/dist/utils/analytics.js +16 -0
- package/dist/utils/code.js +35 -0
- package/dist/utils/env.js +63 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/request.js +42 -0
- package/package.json +33 -17
|
@@ -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
|
+
background-clip: text;
|
|
31
|
+
-webkit-text-fill-color: transparent;
|
|
32
|
+
margin: 0;
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Dropdown, Space } from 'antd';
|
|
8
|
+
import { useIntl } from 'dumi';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { useSnapshot } from 'valtio';
|
|
11
|
+
import { AIChatStore } from "../../../../model/AIChat";
|
|
12
|
+
import { AIModeMeta } from "../../constant";
|
|
13
|
+
export function ModeSelectorDropdown() {
|
|
14
|
+
var _useIntl = useIntl(),
|
|
15
|
+
formatMessage = _useIntl.formatMessage;
|
|
16
|
+
var snap = useSnapshot(AIChatStore);
|
|
17
|
+
var items = Object.entries(AIModeMeta).map(function (_ref) {
|
|
18
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
19
|
+
key = _ref2[0],
|
|
20
|
+
value = _ref2[1];
|
|
21
|
+
return {
|
|
22
|
+
key: key,
|
|
23
|
+
label: formatMessage({
|
|
24
|
+
id: value.shortName
|
|
25
|
+
}),
|
|
26
|
+
icon: value.icon,
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
return AIChatStore.mode = key;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
34
|
+
menu: {
|
|
35
|
+
items: items
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
38
|
+
type: "button"
|
|
39
|
+
}, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(Space, null, AIModeMeta[snap.mode].icon, formatMessage({
|
|
40
|
+
id: AIModeMeta[snap.mode].shortName
|
|
41
|
+
})))));
|
|
42
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import { FormattedMessage } from 'dumi';
|
|
10
|
+
export var ModeSelector = function ModeSelector(_ref) {
|
|
11
|
+
var value = _ref.value,
|
|
12
|
+
size = _ref.size,
|
|
13
|
+
onChange = _ref.onChange;
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: classnames(styles.datasetSelector, _defineProperty({}, styles.compact, size === 'compact'))
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: styles.typeSwitcher
|
|
18
|
+
}, [AIMode.implement, AIMode.solve].map(function (mode) {
|
|
19
|
+
var meta = AIModeMeta[mode];
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
key: mode,
|
|
22
|
+
className: classnames(styles.switchBtn, _defineProperty({}, styles.active, mode === value)),
|
|
23
|
+
onClick: function onClick() {
|
|
24
|
+
if (mode !== value) {
|
|
25
|
+
onChange(mode);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, meta.icon, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
29
|
+
id: meta.name
|
|
30
|
+
}));
|
|
31
|
+
})));
|
|
32
|
+
};
|
|
@@ -0,0 +1,289 @@
|
|
|
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
|
+
backdrop-filter: blur(12px);
|
|
25
|
+
padding: 4px;
|
|
26
|
+
border-radius: 26px;
|
|
27
|
+
box-shadow: inset 1px -1px 0 0 rgba(255, 255, 255, 89%);
|
|
28
|
+
|
|
29
|
+
&::before {
|
|
30
|
+
border-radius: 26px;
|
|
31
|
+
display: block;
|
|
32
|
+
content: ' ';
|
|
33
|
+
position: absolute;
|
|
34
|
+
z-index: -1;
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
top: 0;
|
|
38
|
+
bottom: 0;
|
|
39
|
+
opacity: 0.75;
|
|
40
|
+
background-image: linear-gradient(
|
|
41
|
+
90deg,
|
|
42
|
+
rgba(255, 255, 255, 2%) 0%,
|
|
43
|
+
rgba(217, 217, 217, 6%) 50%,
|
|
44
|
+
rgba(29, 33, 41, 0%) 100%
|
|
45
|
+
);
|
|
46
|
+
box-shadow: inset 1px -1px 0 0 rgba(255, 255, 255, 89%);
|
|
47
|
+
background: rgba(255, 255, 255, 50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.switchBtn {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
gap: 8px;
|
|
55
|
+
width: 120px;
|
|
56
|
+
height: 38px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
border-radius: 20px;
|
|
59
|
+
border: 1px solid transparent;
|
|
60
|
+
color: #1d2129cb;
|
|
61
|
+
|
|
62
|
+
span[role='img'] {
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.active {
|
|
67
|
+
color: #1d2129;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
background: #fff;
|
|
70
|
+
border-color: #eeeef0;
|
|
71
|
+
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 8%);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.datasetSelectorModal {
|
|
77
|
+
top: 0;
|
|
78
|
+
padding-bottom: 0;
|
|
79
|
+
|
|
80
|
+
.listItemContent {
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
border: none;
|
|
83
|
+
line-height: 22px;
|
|
84
|
+
|
|
85
|
+
&.disabled {
|
|
86
|
+
color: #86909c;
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&:hover {
|
|
91
|
+
background: #1677ff1a;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:not(.disabled):hover {
|
|
95
|
+
color: #1677ff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
padding: 7px 16px 7px 7px;
|
|
99
|
+
|
|
100
|
+
&--multiline {
|
|
101
|
+
padding: 4px 16px 4px 7px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.selected {
|
|
106
|
+
background: #1677ff1a;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
color: #1677ff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.nameWrapper {
|
|
112
|
+
flex: 1 1;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
|
|
115
|
+
.name {
|
|
116
|
+
font-size: 14px;
|
|
117
|
+
line-height: 22px;
|
|
118
|
+
width: 100%;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
|
|
122
|
+
.nameText {
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
text-overflow: ellipsis;
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.desc {
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
color: #86909ccc;
|
|
133
|
+
line-height: 22px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.list {
|
|
138
|
+
background: #ffffffdb;
|
|
139
|
+
padding: 10px 18px 18px;
|
|
140
|
+
|
|
141
|
+
:global {
|
|
142
|
+
.ant-input-affix-wrapper {
|
|
143
|
+
margin-bottom: 8px;
|
|
144
|
+
border-radius: 6px;
|
|
145
|
+
color: #5a607f65;
|
|
146
|
+
|
|
147
|
+
.ant-input-prefix {
|
|
148
|
+
margin-right: 8px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:global {
|
|
155
|
+
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn,
|
|
156
|
+
.ant-alert-info .ant-alert-icon {
|
|
157
|
+
color: #1677ff;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ant-modal-footer {
|
|
161
|
+
button {
|
|
162
|
+
box-shadow: none;
|
|
163
|
+
|
|
164
|
+
&.ant-btn-primary {
|
|
165
|
+
color: white;
|
|
166
|
+
background: #1677ff;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
background: none;
|
|
170
|
+
border: none;
|
|
171
|
+
border-radius: 6px;
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
width: 60px;
|
|
174
|
+
height: 32px;
|
|
175
|
+
color: #4e5969e6;
|
|
176
|
+
|
|
177
|
+
&:disabled {
|
|
178
|
+
background: #4e59693c;
|
|
179
|
+
color: white;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ant-modal-close-x {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ant-modal-body {
|
|
189
|
+
padding: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ant-modal-header {
|
|
193
|
+
border-radius: 8px 8px 0 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ant-modal-content {
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ant-modal-content {
|
|
201
|
+
background-color: rgb(251, 252, 253);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ant-tabs-nav {
|
|
205
|
+
padding-left: 18px;
|
|
206
|
+
padding-right: 18px;
|
|
207
|
+
margin-bottom: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ant-tabs-tab {
|
|
211
|
+
font-size: 14px;
|
|
212
|
+
padding: 14px 0 13px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.ant-alert {
|
|
216
|
+
padding: 4px 15px;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.datasetSelector {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
justify-content: center;
|
|
225
|
+
margin-bottom: 16px;
|
|
226
|
+
|
|
227
|
+
> div:not(:last-child) {
|
|
228
|
+
margin-right: 16px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.result {
|
|
232
|
+
flex: 1 1;
|
|
233
|
+
white-space: nowrap;
|
|
234
|
+
text-overflow: ellipsis;
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
font-size: 14px;
|
|
237
|
+
color: #5a607fe0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&.compact {
|
|
241
|
+
justify-content: flex-start;
|
|
242
|
+
margin-bottom: 8px;
|
|
243
|
+
|
|
244
|
+
> div:not(:last-child) {
|
|
245
|
+
margin-right: 8px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.switchBtn {
|
|
249
|
+
width: 100px;
|
|
250
|
+
border-radius: 12px;
|
|
251
|
+
background: #fff;
|
|
252
|
+
border: 1px solid #5a607fe0;
|
|
253
|
+
opacity: 0.4;
|
|
254
|
+
box-shadow: 0 3px 12px 0 #0000000a;
|
|
255
|
+
font-size: 14px;
|
|
256
|
+
color: #86909c;
|
|
257
|
+
line-height: 24px;
|
|
258
|
+
height: 24px;
|
|
259
|
+
|
|
260
|
+
&.active {
|
|
261
|
+
background: #fff;
|
|
262
|
+
border: 1px solid #2d84ff;
|
|
263
|
+
color: #1677ff;
|
|
264
|
+
opacity: 1;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.error {
|
|
271
|
+
color: #f21818;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.datasetLabel {
|
|
275
|
+
display: inline-block;
|
|
276
|
+
font-size: 12px;
|
|
277
|
+
line-height: 20px;
|
|
278
|
+
padding: 0 8px;
|
|
279
|
+
border-radius: 4px;
|
|
280
|
+
margin-left: 8px;
|
|
281
|
+
flex-shrink: 0;
|
|
282
|
+
color: #86909c;
|
|
283
|
+
background: rgba(0, 0, 0, 4%);
|
|
284
|
+
|
|
285
|
+
&.primary {
|
|
286
|
+
color: #f68b02;
|
|
287
|
+
background: rgba(246, 144, 61, 10%);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dropdown } from "antd";
|
|
3
|
+
import { useAntVConfig, useProducts } from "../../../../../hooks/useProducts";
|
|
4
|
+
import { useLocale, FormattedMessage } 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 _useAntVConfig = useAntVConfig(),
|
|
19
|
+
_useAntVConfig$data = _useAntVConfig.data,
|
|
20
|
+
_useAntVConfig$data2 = _useAntVConfig$data === void 0 ? {
|
|
21
|
+
library: []
|
|
22
|
+
} : _useAntVConfig$data,
|
|
23
|
+
_useAntVConfig$data2$ = _useAntVConfig$data2.library,
|
|
24
|
+
library = _useAntVConfig$data2$ === void 0 ? [] : _useAntVConfig$data2$;
|
|
25
|
+
var onSelect = function onSelect(key) {
|
|
26
|
+
onChange === null || onChange === void 0 || onChange(key);
|
|
27
|
+
};
|
|
28
|
+
var items = data.filter(function (item) {
|
|
29
|
+
return item.lang === lang && library.map(function (l) {
|
|
30
|
+
return l.toUpperCase();
|
|
31
|
+
}).includes(item.title);
|
|
32
|
+
}).map(function (item) {
|
|
33
|
+
return {
|
|
34
|
+
key: item.title,
|
|
35
|
+
label: item.title,
|
|
36
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
37
|
+
src: item.icon,
|
|
38
|
+
alt: item.title,
|
|
39
|
+
className: styles.icon
|
|
40
|
+
}),
|
|
41
|
+
extra: !isCompact && item.slogan,
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return onSelect(item.title);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
48
|
+
menu: {
|
|
49
|
+
items: items
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
52
|
+
type: "button"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
className: styles.icon,
|
|
55
|
+
src: ((_data$find = data.find(function (item) {
|
|
56
|
+
return item.title === value;
|
|
57
|
+
})) === null || _data$find === void 0 ? void 0 : _data$find.icon) || "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original",
|
|
58
|
+
alt: "AntV"
|
|
59
|
+
}), value || !isCompact && /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
60
|
+
id: "ai.chooseLib.placeholder"
|
|
61
|
+
})));
|
|
62
|
+
}
|
|
@@ -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
|
+
padding-left: 8px;
|
|
7
|
+
padding-right: 12px;
|
|
8
|
+
background: rgba(212, 215, 219, 40%);
|
|
9
|
+
border: 1px solid rgba(222, 226, 241, 70%);
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
|
|
12
|
+
img {
|
|
13
|
+
display: block;
|
|
14
|
+
width: 12px;
|
|
15
|
+
height: 12px;
|
|
16
|
+
margin-right: 6px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.title {
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
color: #4e5969;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
}
|
|
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 };
|