@antv/dumi-theme-antv 0.8.0-beta.0 → 0.8.0-beta.2
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/components/AI/HomeDialog/ModeSelector/index.js +4 -1
- package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +5 -2
- package/dist/components/AI/HomeDialog/PromptTextarea/Uploader/DataUploader.js +225 -0
- package/dist/components/AI/HomeDialog/PromptTextarea/index.js +62 -24
- package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +1 -0
- package/dist/components/AI/HomeDialog/RecommendCase/Card.js +10 -3
- package/dist/components/AI/HomeDialog/RecommendCase/index.js +8 -3
- package/dist/components/AI/HomeDialog/index.js +12 -3
- package/dist/components/AI/constant.js +2 -2
- package/dist/hooks/useStreamingText.js +38 -18
- package/dist/hooks/useTypewriter.js +69 -0
- package/dist/locales/en.json +91 -1
- package/dist/locales/zh.json +91 -1
- package/dist/model/AIChat.js +20 -8
- package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +29 -7
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +41 -18
- package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.module.less +14 -0
- package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +1 -1
- package/dist/pages/AIPlayground/components/MsgBox/index.js +149 -47
- package/dist/pages/AIPlayground/components/SessionLayout/index.js +18 -10
- package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +3 -0
- package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +3 -4
- package/dist/pages/AIPlayground/components/TaskBox/index.js +1 -0
- package/dist/plugin/index.js +2 -2
- package/dist/slots/CodeEditor/Toolbar.js +17 -7
- package/dist/slots/CodeEditor/Toolbar.module.less +1 -0
- package/dist/slots/CodeEditor/index.js +18 -4
- package/dist/slots/CodeRunner/index.js +2 -1
- package/dist/slots/Header/Search/SearchResult.js +9 -3
- package/dist/slots/Header/index.js +24 -8
- package/dist/static/SearchAiIcon.svg +14 -0
- package/dist/utils/code.js +35 -0
- package/package.json +1 -1
|
@@ -195,7 +195,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
195
195
|
href: href,
|
|
196
196
|
target: "_blank",
|
|
197
197
|
rel: "noreferrer"
|
|
198
|
-
},
|
|
198
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
199
|
+
id: "header.ai.code"
|
|
200
|
+
})));
|
|
199
201
|
}, [isInternalUser, showWeavefox]);
|
|
200
202
|
var menu = /*#__PURE__*/React.createElement("ul", {
|
|
201
203
|
className: cx(styles.menu, _defineProperty(_defineProperty({}, styles.popup, !isWide), styles.popupHidden, !popupMenuVisible))
|
|
@@ -235,7 +237,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
235
237
|
style: {
|
|
236
238
|
marginRight: '8px'
|
|
237
239
|
}
|
|
238
|
-
}, "\uD83C\uDDE8\uD83C\uDDF3"),
|
|
240
|
+
}, "\uD83C\uDDE8\uD83C\uDDF3"), /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
241
|
+
id: "header.china.mirror.title"
|
|
242
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
239
243
|
style: {
|
|
240
244
|
marginTop: 16,
|
|
241
245
|
textAlign: 'right'
|
|
@@ -248,14 +252,18 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
248
252
|
style: {
|
|
249
253
|
marginRight: 8
|
|
250
254
|
}
|
|
251
|
-
},
|
|
255
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
256
|
+
id: "header.china.mirror.temp.close"
|
|
257
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
252
258
|
type: "primary",
|
|
253
259
|
size: "small",
|
|
254
260
|
onClick: function onClick() {
|
|
255
261
|
localStorage.setItem('china-mirror-no-more-hint', Date.now().toString());
|
|
256
262
|
updateChinaMirrorHintVisible(false);
|
|
257
263
|
}
|
|
258
|
-
},
|
|
264
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
265
|
+
id: "header.china.mirror.no.more"
|
|
266
|
+
})))),
|
|
259
267
|
open: chinaMirrorHintVisible,
|
|
260
268
|
placement: "bottomRight",
|
|
261
269
|
align: {
|
|
@@ -273,8 +281,12 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
273
281
|
}
|
|
274
282
|
})))) : null, showChinaMirror && !isWide && /*#__PURE__*/React.createElement(Modal, {
|
|
275
283
|
open: chinaMirrorHintVisible,
|
|
276
|
-
cancelText:
|
|
277
|
-
|
|
284
|
+
cancelText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
285
|
+
id: "header.china.mirror.no.more"
|
|
286
|
+
}),
|
|
287
|
+
okText: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
288
|
+
id: "header.china.mirror.temp.close"
|
|
289
|
+
}),
|
|
278
290
|
onCancel: function onCancel() {
|
|
279
291
|
updateChinaMirrorHintVisible(false);
|
|
280
292
|
},
|
|
@@ -292,7 +304,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
292
304
|
}, /*#__PURE__*/React.createElement("span", {
|
|
293
305
|
role: "img",
|
|
294
306
|
"aria-labelledby": "\u4E2D\u56FD"
|
|
295
|
-
}, "\uD83C\uDDE8\uD83C\uDDF3"),
|
|
307
|
+
}, "\uD83C\uDDE8\uD83C\uDDF3"), /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
308
|
+
id: "header.china.mirror.title"
|
|
309
|
+
}), /*#__PURE__*/React.createElement("a", {
|
|
296
310
|
href: chinaMirrorUrl,
|
|
297
311
|
onClick: function onClick(e) {
|
|
298
312
|
e.preventDefault();
|
|
@@ -370,7 +384,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
|
|
|
370
384
|
src: "https://gw.alipayobjects.com/zos/antfincdn/ZKlx96dsfs/qrcode_for_gh_f52d8b6aa591_258.jpg",
|
|
371
385
|
alt: "wx-qrcode"
|
|
372
386
|
}),
|
|
373
|
-
title:
|
|
387
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
388
|
+
id: "header.wx.qrcode.title"
|
|
389
|
+
}),
|
|
374
390
|
styles: {
|
|
375
391
|
body: {
|
|
376
392
|
padding: 2
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
|
|
2
|
+
<g
|
|
3
|
+
fill="none"
|
|
4
|
+
stroke="currentColor"
|
|
5
|
+
stroke-width="65"
|
|
6
|
+
stroke-linecap="round"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
>
|
|
9
|
+
<circle cx="448" cy="447" r="380" />
|
|
10
|
+
<line x1="715" y1="715" x2="900" y2="900" />
|
|
11
|
+
<path d="M 290 605 L 382 290 L 475 605 M 320 500 L 445 500" />
|
|
12
|
+
<line x1="600" y1="290" x2="600" y2="605" />
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,35 @@
|
|
|
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 _wrapRegExp() { _wrapRegExp = function _wrapRegExp(e, r) { return new BabelRegExp(e, void 0, r); }; var e = RegExp.prototype, r = new WeakMap(); function BabelRegExp(e, t, p) { var o = new RegExp(e, t); return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype); } function buildGroups(e, t) { var p = r.get(t); return Object.keys(p).reduce(function (r, t) { var o = p[t]; if ("number" == typeof o) r[t] = e[o];else { for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++; r[t] = e[o[i]]; } return r; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) { var t = e.exec.call(this, r); if (t) { t.groups = buildGroups(t, this); var p = t.indices; p && (p.groups = buildGroups(p, this)); } return t; }, BabelRegExp.prototype[Symbol.replace] = function (t, p) { if ("string" == typeof p) { var o = r.get(this); return e[Symbol.replace].call(this, t, p.replace(/\$<([^>]+)>/g, function (e, r) { var t = o[r]; return "$" + (Array.isArray(t) ? t.join("$") : t); })); } if ("function" == typeof p) { var i = this; return e[Symbol.replace].call(this, t, function () { var e = arguments; return "object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e); }); } return e[Symbol.replace].call(this, t, p); }, _wrapRegExp.apply(this, arguments); }
|
|
3
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
4
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5
|
+
export function isPreviewable(str) {
|
|
6
|
+
if (typeof str !== 'string') {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
var trimmedStr = str.trim();
|
|
10
|
+
|
|
11
|
+
// \b 是一个“单词边界”,确保我们匹配的是完整的 "import" 单词
|
|
12
|
+
// 而不是 "important" 的一部分
|
|
13
|
+
var hasImportStatement = /\bimport\b/.test(trimmedStr);
|
|
14
|
+
if (trimmedStr.startsWith('```') && trimmedStr.endsWith('```') && hasImportStatement) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
export function getCodeFromMarkdown() {
|
|
20
|
+
var md = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
21
|
+
var regex = /*#__PURE__*/_wrapRegExp(/```(\w*)\n?([\s\S]*?)```/, {
|
|
22
|
+
lang: 1,
|
|
23
|
+
code: 2
|
|
24
|
+
});
|
|
25
|
+
var match = md.match(regex);
|
|
26
|
+
if (match) {
|
|
27
|
+
return {
|
|
28
|
+
lang: match.groups.lang || 'plaintext',
|
|
29
|
+
code: match.groups.code.trim()
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
code: ''
|
|
34
|
+
};
|
|
35
|
+
}
|