@antv/dumi-theme-antv 0.8.0-beta.1 → 0.8.0-beta.10

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.
Files changed (80) hide show
  1. package/dist/builtins/Playground/index.module.less +0 -1
  2. package/dist/components/AI/HomeDialog/AntVBanner/index.module.less +2 -2
  3. package/dist/components/AI/HomeDialog/ModeSelector/index.js +4 -1
  4. package/dist/components/AI/HomeDialog/ModeSelector/index.module.less +39 -22
  5. package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +5 -2
  6. package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.module.less +0 -1
  7. package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.module.less +3 -3
  8. package/dist/components/AI/HomeDialog/PromptTextarea/Uploader/DataUploader.js +225 -0
  9. package/dist/components/AI/HomeDialog/PromptTextarea/index.js +61 -36
  10. package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +9 -8
  11. package/dist/components/AI/HomeDialog/RecommendCase/Card.js +13 -8
  12. package/dist/components/AI/HomeDialog/RecommendCase/card.module.less +1 -1
  13. package/dist/components/AI/HomeDialog/RecommendCase/index.js +45 -13
  14. package/dist/components/AI/HomeDialog/RecommendCase/index.module.less +3 -2
  15. package/dist/components/AI/HomeDialog/index.js +17 -4
  16. package/dist/components/AI/constant.js +2 -2
  17. package/dist/components/Login/Captcha/index.js +185 -0
  18. package/dist/components/Login/Captcha/index.less +91 -0
  19. package/dist/components/Login/CheckCode/index.js +244 -0
  20. package/dist/components/Login/CheckCode/index.less +137 -0
  21. package/dist/components/Login/CountDownButton/index.js +109 -0
  22. package/dist/components/Login/CountDownButton/index.less +8 -0
  23. package/dist/components/Login/LoginForm.js +239 -0
  24. package/dist/components/Login/LoginForm.less +409 -0
  25. package/dist/components/Login/index.js +24 -0
  26. package/dist/components/Login/openAuthWindow.js +54 -0
  27. package/dist/components/Login/types.js +5 -0
  28. package/dist/components/Login/utils.js +47 -0
  29. package/dist/layouts/DocLayout.js +2 -1
  30. package/dist/layouts/GlobalLayout/index.js +10 -4
  31. package/dist/locales/en.json +121 -1
  32. package/dist/locales/zh.json +121 -1
  33. package/dist/model/AIChat.js +65 -7
  34. package/dist/model/auth.js +133 -0
  35. package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +28 -10
  36. package/dist/pages/AIPlayground/components/ConversationsMenu/index.module.less +2 -0
  37. package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +25 -11
  38. package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.module.less +1 -2
  39. package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +5 -2
  40. package/dist/pages/AIPlayground/components/MsgBox/index.js +198 -136
  41. package/dist/pages/AIPlayground/components/MsgBox/index.module.less +3 -2
  42. package/dist/pages/AIPlayground/components/MsgBox/useAutoScroll.js +46 -0
  43. package/dist/pages/AIPlayground/components/SessionLayout/index.js +18 -10
  44. package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +3 -1
  45. package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +7 -1
  46. package/dist/pages/AIPlayground/components/TaskBox/index.js +79 -55
  47. package/dist/pages/AIPlayground/components/TaskBox/index.module.less +1 -0
  48. package/dist/pages/Examples/components/Accouncement/index.module.less +1 -1
  49. package/dist/pages/Examples/index.module.less +11 -11
  50. package/dist/pages/Index/components/Cases/index.module.less +8 -8
  51. package/dist/pages/Index/components/Companies/index.module.less +4 -3
  52. package/dist/pages/Index/components/Features/FeatureCard.module.less +4 -5
  53. package/dist/pages/Index/components/Features/index.module.less +5 -5
  54. package/dist/pages/Index/components/_.less +9 -9
  55. package/dist/plugin/index.js +2 -2
  56. package/dist/slots/Banner/Notification.module.less +8 -8
  57. package/dist/slots/Banner/index.module.less +10 -9
  58. package/dist/slots/CodeEditor/Toolbar.js +15 -9
  59. package/dist/slots/CodeEditor/index.js +19 -10
  60. package/dist/slots/CodeEditor/index.module.less +3 -0
  61. package/dist/slots/CodePreview/index.module.less +0 -3
  62. package/dist/slots/CodeRunner/index.js +5 -2
  63. package/dist/slots/ContentTable/index.module.less +2 -1
  64. package/dist/slots/Detail/News.module.less +9 -9
  65. package/dist/slots/Detail/index.module.less +11 -14
  66. package/dist/slots/ExampleSider/index.module.less +3 -4
  67. package/dist/slots/Footer/index.module.less +2 -2
  68. package/dist/slots/Header/Products/Product.module.less +2 -2
  69. package/dist/slots/Header/Search/SearchResult.js +23 -8
  70. package/dist/slots/Header/Search/SearchResult.module.less +1 -0
  71. package/dist/slots/Header/index.js +56 -11
  72. package/dist/slots/Header/index.module.less +13 -5
  73. package/dist/slots/LiveExample/index.module.less +1 -1
  74. package/dist/slots/Loading/index.module.less +30 -28
  75. package/dist/slots/ManualContent/index.module.less +14 -17
  76. package/dist/slots/_.less +9 -9
  77. package/dist/static/user.svg +3 -0
  78. package/dist/utils/env.js +37 -0
  79. package/dist/utils/request.js +42 -0
  80. package/package.json +7 -2
@@ -1,61 +1,85 @@
1
- import React from 'react';
2
- import { Sandpack } from "@codesandbox/sandpack-react";
3
- import styles from "./index.module.less";
1
+ import { useSiteData } from 'dumi';
2
+ import React, { useMemo } from 'react';
3
+ import { useSnapshot } from 'valtio';
4
4
  import { AIChatStore } from "../../../../model/AIChat";
5
- import { useSnapshot } from "valtio";
6
- import { wrap2Sandpack } from "./generateCode";
7
- // import {code} from "../../demo";
8
- // import {requestProxy, useVisionsnapSdk} from "../../../../hooks/useVisionsnapSdk";
9
-
5
+ import CodeRunner from "dumi/theme/slots/CodeRunner";
6
+ import { wrap2VisionSnap } from "./generateCode";
7
+ import { requestProxy, useVisionsnapSdk } from "../../../../hooks/useVisionsnapSdk";
8
+ import { ErrorBoundary } from 'react-error-boundary';
9
+ import Loading from "dumi/theme/slots/Loading";
10
+ import { ErrorFallback } from "../../../../builtins/Playground";
10
11
  function TaskBox() {
12
+ var _themeConfig$ai, _themeConfig$ai2;
11
13
  var snap = useSnapshot(AIChatStore);
12
-
13
- // const { sdk, loading } = useVisionsnapSdk('3.2.4');
14
- //
15
- // if (loading) {
16
- // return <div>Loading...</div>;
17
- // }
18
- //
19
- // return (
20
- // <sdk.VisionPreview id="visionIframe"
21
- // bizCode="vision-preview-demo"
22
- // style={{ height: '100vh' }}
23
- // userId="263347"
24
- // displayMode="preview-only"
25
- // editable={false}
26
- // code={code}
27
- // // requestProxy={requestProxy}
28
- // isStreaming={false} />
29
- // );
30
-
31
- return /*#__PURE__*/React.createElement(Sandpack, {
32
- template: "vanilla" // 指定项目模板,Sandpack 会据此配置环境
33
- ,
34
- files: wrap2Sandpack(snap.codeBlock),
35
- options: {
36
- showLineNumbers: true,
37
- // 显示行号
38
- showTabs: true,
39
- closableTabs: false,
40
- editorHeight: 'calc(100vh - 150px)',
41
- rtl: true,
42
- classes: {
43
- 'sp-layout': styles['antv-sp-layout']
44
- }
45
- },
46
- theme: "light" // 主题:dark, light, auto
47
- ,
48
- customSetup: {
49
- entry: "/index.tsx",
50
- npmRegistries: [{
51
- limitToScopes: false,
52
- // 设为 false 使所有包都从自定义 registry 获取
53
- registryUrl: 'https://registry.npmmirror.com',
54
- // 使用淘宝镜像
55
- enabledScopes: [],
56
- proxyEnabled: false
14
+ var _useSiteData = useSiteData(),
15
+ themeConfig = _useSiteData.themeConfig;
16
+ var demoId = useMemo(function () {
17
+ return crypto.randomUUID();
18
+ }, [snap.codeBlock]);
19
+ var exampleTopics = useMemo(function () {
20
+ return [{
21
+ icon: '',
22
+ title: {},
23
+ id: snap.anonymousUserId,
24
+ examples: [
25
+ // 这是一个 Example 对象
26
+ {
27
+ icon: '',
28
+ title: {},
29
+ id: snap.activeSessionId,
30
+ api: 'https://example.com/api/pie-chart',
31
+ // 必须的 api 属性
32
+ demos: [
33
+ // 这是一个 Demo 对象
34
+ {
35
+ id: demoId,
36
+ screenshot: '',
37
+ title: {},
38
+ filename: 'index.tsx',
39
+ // 必须的 filename 属性
40
+ source: snap.codeBlock
41
+ }]
57
42
  }]
58
- }
59
- });
43
+ }];
44
+ }, [demoId, snap.activeSessionId, snap.anonymousUserId, snap.codeBlock]);
45
+ var _useVisionsnapSdk = useVisionsnapSdk('3.2.15'),
46
+ sdk = _useVisionsnapSdk.sdk,
47
+ loading = _useVisionsnapSdk.loading;
48
+ if (loading) {
49
+ return /*#__PURE__*/React.createElement(Loading, null);
50
+ }
51
+ if (themeConfig.isAntVSite || ((_themeConfig$ai = themeConfig.ai) === null || _themeConfig$ai === void 0 ? void 0 : _themeConfig$ai.codeRunner) === "VisionSnap" || !((_themeConfig$ai2 = themeConfig.ai) !== null && _themeConfig$ai2 !== void 0 && _themeConfig$ai2.codeRunner)) {
52
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
53
+ FallbackComponent: ErrorFallback
54
+ }, /*#__PURE__*/React.createElement(sdk.VisionPreview, {
55
+ id: "visionIframe",
56
+ bizCode: "vision-preview-demo",
57
+ style: {
58
+ height: '100vh'
59
+ },
60
+ userId: "263347",
61
+ displayMode: "code-and-preview",
62
+ initialView: "preview",
63
+ theme: "light",
64
+ editable: true,
65
+ code: wrap2VisionSnap(snap.codeBlock),
66
+ requestProxy: requestProxy,
67
+ isStreaming: false,
68
+ proxyOptions: {
69
+ isWAN: true
70
+ },
71
+ src: "https://www.weavefox.cn/_visionsnap_render/index.html?version=3.2.15&enableInspector=1"
72
+ }));
73
+ } else {
74
+ return /*#__PURE__*/React.createElement(CodeRunner, {
75
+ isPlayground: true,
76
+ showAI: false,
77
+ size: 0.5,
78
+ topic: snap.anonymousUserId,
79
+ example: snap.activeSessionId,
80
+ demo: demoId,
81
+ exampleTopics: exampleTopics
82
+ });
83
+ }
60
84
  }
61
85
  export default TaskBox;
@@ -1,5 +1,6 @@
1
1
  div.antv-sp-layout {
2
2
  border: unset;
3
+
3
4
  :global {
4
5
  .sp-c-hluGOI:has(button:focus) {
5
6
  outline: none !important;
@@ -1,6 +1,6 @@
1
1
  .bannerAnnouncement {
2
2
  background: #e6f7ff;
3
- border-color: rgba(71, 118, 232, 0.65);
3
+ border-color: rgba(71, 118, 232, 65%);
4
4
  color: #4776e8;
5
5
 
6
6
  a {
@@ -77,7 +77,7 @@
77
77
  }
78
78
 
79
79
  pre[class*='language-'] {
80
- background-color: rgba(0, 0, 0, 0.03);
80
+ background-color: rgba(0, 0, 0, 3%);
81
81
  }
82
82
 
83
83
  code[class*='language-'] {
@@ -155,7 +155,7 @@
155
155
  table th {
156
156
  color: #5c6b77;
157
157
  font-weight: 500;
158
- background: rgba(0, 0, 0, 0.02);
158
+ background: rgba(0, 0, 0, 2%);
159
159
  }
160
160
 
161
161
  table th,
@@ -174,7 +174,7 @@
174
174
  width: 20%;
175
175
  font-weight: 500;
176
176
  background: #fcfcfc;
177
- color: rgba(0, 0, 0, 0.85);
177
+ color: rgba(0, 0, 0, 85%);
178
178
  }
179
179
 
180
180
  blockquote {
@@ -197,15 +197,16 @@
197
197
 
198
198
  .layout {
199
199
  margin: 24px 0 32px;
200
+
200
201
  :global {
201
202
  .ant-layout-content {
202
- background-color: #ffffff;
203
+ background-color: #fff;
203
204
  }
204
205
  }
205
206
  }
206
207
 
207
208
  .main {
208
- background-color: #ffffff;
209
+ background-color: #fff;
209
210
  width: calc(100% - @toc-width);
210
211
  padding-left: 48px;
211
212
  padding-right: 24px;
@@ -248,7 +249,6 @@
248
249
  background: #fff;
249
250
  max-height: 100vh;
250
251
  overflow: hidden;
251
-
252
252
  position: sticky;
253
253
  top: 0;
254
254
  padding: 8px 0;
@@ -288,6 +288,7 @@
288
288
 
289
289
  .affix {
290
290
  background-color: #fff;
291
+
291
292
  & > div {
292
293
  height: 100%;
293
294
  }
@@ -325,7 +326,7 @@
325
326
  justify-content: center;
326
327
  align-items: center;
327
328
  background: #fff;
328
- box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
329
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 15%);
329
330
  border-radius: 0 4px 4px 0;
330
331
  }
331
332
  }
@@ -401,7 +402,7 @@
401
402
  &:hover > div {
402
403
  transform: translateY(-4px);
403
404
  border-color: transparent;
404
- box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
405
+ box-shadow: 0 6px 16px rgba(107, 147, 224, 14%);
405
406
  }
406
407
 
407
408
  h4 {
@@ -455,7 +456,7 @@
455
456
  :global {
456
457
  .SplitPane {
457
458
  overflow: auto;
458
- left: 0px;
459
+ left: 0;
459
460
  height: calc(100vh - 64px) !important;
460
461
  }
461
462
 
@@ -603,10 +604,9 @@
603
604
  }
604
605
 
605
606
  .backTop {
606
- transition: color 0.3s;
607
607
  color: #868484;
608
608
  background-color: #fff;
609
- box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
609
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 12%), 0 6px 16px 0 rgba(0, 0, 0, 8%), 0 9px 28px 8px rgba(0, 0, 0, 5%);
610
610
  transition: color 0.3s;
611
611
  width: 44px;
612
612
  height: 44px;
@@ -6,7 +6,7 @@
6
6
  position: relative;
7
7
  padding: 0;
8
8
  overflow: hidden;
9
- background: rgba(250, 251, 252, 1);
9
+ background: rgba(250, 251, 252, 100%);
10
10
 
11
11
  .slider {
12
12
  .container1440();
@@ -38,22 +38,22 @@
38
38
  .appTitle {
39
39
  font-size: 1.2857em;
40
40
  font-weight: 500;
41
- margin: 48px 0 0 0;
41
+ margin: 48px 0 0;
42
42
  position: relative;
43
43
  height: min-content;
44
- color: rgba(0, 0, 0, 1);
44
+ color: rgba(0, 0, 0, 100%);
45
45
  user-select: text;
46
46
  }
47
47
 
48
48
  .appDescription {
49
- color: rgba(105, 123, 140, 0.6);
49
+ color: rgba(105, 123, 140, 60%);
50
50
  font-size: 1em;
51
- margin: 16px 0 0 0;
51
+ margin: 16px 0 0;
52
52
  user-select: text;
53
53
  }
54
54
 
55
55
  .detailWrapper {
56
- margin: 20px 0 0 0;
56
+ margin: 20px 0 0;
57
57
 
58
58
  .detail {
59
59
  color: var(--primary-color);
@@ -81,7 +81,7 @@
81
81
 
82
82
  &:hover {
83
83
  border: 1px solid #ced4d9;
84
- fill: #000000;
84
+ fill: #000;
85
85
  }
86
86
 
87
87
  &:hover :only-child {
@@ -228,7 +228,7 @@
228
228
  bottom: 100px;
229
229
  }
230
230
 
231
- .slick-dots li.slick-active button:before {
231
+ .slick-dots li.slick-active button::before {
232
232
  opacity: 1;
233
233
  color: #1890ff;
234
234
  }
@@ -14,17 +14,18 @@
14
14
  margin-bottom: 5%;
15
15
  position: relative;
16
16
  .container1440();
17
+
17
18
  padding-left: 4.5%;
18
19
  }
19
20
 
20
21
  .title {
21
22
  font-size: 2.714em;
22
23
  font-weight: 500;
23
- margin: 118px 0 0 0;
24
+ margin: 118px 0 0;
24
25
  position: relative;
25
26
  height: min-content;
26
27
  text-align: center;
27
- color: rgba(0, 0, 0, 1);
28
+ color: rgba(0, 0, 0, 100%);
28
29
  }
29
30
 
30
31
  .companiesContainer {
@@ -73,7 +74,7 @@
73
74
  .wrapper {
74
75
  .title {
75
76
  font-size: 1.9rem;
76
- margin: 98px 0 0 0;
77
+ margin: 98px 0 0;
77
78
  }
78
79
 
79
80
  .content {
@@ -17,7 +17,6 @@
17
17
 
18
18
  .title {
19
19
  font-size: 1.714em;
20
- color: #000;
21
20
  margin-top: 28px;
22
21
  margin-bottom: 11px;
23
22
  font-family: AlibabaPuHuiTiM;
@@ -29,7 +28,7 @@
29
28
  .description {
30
29
  opacity: 0.6;
31
30
  width: 100%;
32
- color: rgba(105, 123, 140, 1);
31
+ color: rgba(105, 123, 140, 100%);
33
32
  font-size: 1em;
34
33
  line-height: 1.8em;
35
34
  margin-top: 11px;
@@ -42,7 +41,7 @@
42
41
  .cards {
43
42
  .cardWrapper {
44
43
  .card {
45
- margin: 84px 19px 80px 19px;
44
+ margin: 84px 19px 80px;
46
45
 
47
46
  .content {
48
47
  .icon {
@@ -56,8 +55,8 @@
56
55
 
57
56
  .description {
58
57
  font-size: 1em;
59
- padding-bottom: 0px;
60
- padding-top: 0px;
58
+ padding-bottom: 0;
59
+ padding-top: 0;
61
60
  margin-top: 12px;
62
61
  }
63
62
  }
@@ -21,7 +21,7 @@
21
21
 
22
22
  .title {
23
23
  font-weight: 500;
24
- margin: 17px 0 0 0;
24
+ margin: 17px 0 0;
25
25
  position: relative;
26
26
  font-family: AlibabaPuHuiTiB;
27
27
  font-size: 40px;
@@ -52,9 +52,9 @@
52
52
  display: flex;
53
53
  justify-content: center;
54
54
  width: 100%;
55
- background-color: #ffffff;
55
+ background-color: #fff;
56
56
  border: 1px solid #e5e8ef;
57
- box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.03);
57
+ box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 3%);
58
58
  border-radius: 16px;
59
59
  overflow: hidden;
60
60
  }
@@ -77,12 +77,12 @@
77
77
 
78
78
  .cardWrapper {
79
79
  flex: none;
80
- margin: 0 0 28px 0;
80
+ margin: 0 0 28px;
81
81
  width: 100%;
82
82
  max-width: 100%;
83
83
 
84
84
  &:last-child {
85
- margin: 0 0 30px 0;
85
+ margin: 0 0 30px;
86
86
  }
87
87
  }
88
88
  }
@@ -81,30 +81,30 @@ h6 {
81
81
  width: 100%;
82
82
  height: 11px;
83
83
  margin: -5px 0;
84
- border-top: 5px solid rgba(255, 255, 255, 0);
85
- border-bottom: 5px solid rgba(255, 255, 255, 0);
84
+ border-top: 5px solid rgba(255, 255, 255, 0%);
85
+ border-bottom: 5px solid rgba(255, 255, 255, 0%);
86
86
  cursor: row-resize;
87
87
 
88
88
  &:hover {
89
- border-top: 5px solid rgba(0, 0, 0, 0.5);
90
- border-bottom: 5px solid rgba(0, 0, 0, 0.5);
89
+ border-top: 5px solid rgba(0, 0, 0, 50%);
90
+ border-bottom: 5px solid rgba(0, 0, 0, 50%);
91
91
  }
92
92
  }
93
93
 
94
94
  &.vertical {
95
95
  width: 11px;
96
96
  margin: 0 -5px;
97
- border-right: 5px solid rgba(255, 255, 255, 0);
98
- border-left: 5px solid rgba(255, 255, 255, 0);
97
+ border-right: 5px solid rgba(255, 255, 255, 0%);
98
+ border-left: 5px solid rgba(255, 255, 255, 0%);
99
99
  cursor: col-resize;
100
100
 
101
- Pane2 {
101
+ pane2 {
102
102
  border-left: 1px solid #e6e6e6;
103
103
  }
104
104
 
105
105
  &:hover {
106
- border-right: 5px solid rgba(0, 0, 0, 0.5);
107
- border-left: 5px solid rgba(0, 0, 0, 0.5);
106
+ border-right: 5px solid rgba(0, 0, 0, 50%);
107
+ border-left: 5px solid rgba(0, 0, 0, 50%);
108
108
  }
109
109
  }
110
110
 
@@ -168,8 +168,8 @@ export default function ThemeAntVContextWrapper() {
168
168
  },
169
169
  {
170
170
  id: "dumi-theme-antv-ai-playground-lang",
171
- absPath: "/:language/ai-playground/:id",
172
- path: ":language/ai-playground/:id",
171
+ absPath: "/:language/ai-playground",
172
+ path: ":language/ai-playground",
173
173
  file: `${PAGES_DIR}/AIPlayground`
174
174
  }
175
175
  ];
@@ -17,7 +17,7 @@
17
17
 
18
18
  .content {
19
19
  padding-left: 20px;
20
- color: rgba(49, 70, 89, 1);
20
+ color: rgba(49, 70, 89, 100%);
21
21
  text-align: left;
22
22
 
23
23
  .description {
@@ -28,7 +28,7 @@
28
28
  }
29
29
 
30
30
  .date {
31
- color: rgba(216, 203, 249, 1);
31
+ color: rgba(216, 203, 249, 100%);
32
32
  bottom: 0;
33
33
  font-size: 1em;
34
34
  margin-top: 4px;
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  &:hover .description {
41
- color: rgba(89, 126, 247, 1);
41
+ color: rgba(89, 126, 247, 100%);
42
42
  }
43
43
  }
44
44
 
@@ -67,12 +67,12 @@
67
67
  @keyframes showAndHide0 {
68
68
  0% {
69
69
  opacity: 1;
70
- top: 0px;
70
+ top: 0;
71
71
  }
72
72
 
73
73
  33.3% {
74
74
  opacity: 1;
75
- top: 0px;
75
+ top: 0;
76
76
  }
77
77
 
78
78
  50% {
@@ -87,7 +87,7 @@
87
87
 
88
88
  100% {
89
89
  opacity: 1;
90
- top: 0px;
90
+ top: 0;
91
91
  }
92
92
  }
93
93
 
@@ -105,12 +105,12 @@
105
105
 
106
106
  50% {
107
107
  opacity: 1;
108
- top: 0px;
108
+ top: 0;
109
109
  }
110
110
 
111
111
  83.3% {
112
112
  opacity: 1;
113
- top: 0px;
113
+ top: 0;
114
114
  }
115
115
 
116
116
  100% {
@@ -3,13 +3,14 @@
3
3
  .wrapper {
4
4
  min-height: 650px;
5
5
  max-height: 803px;
6
- background: linear-gradient(225deg, #ffffff, #f0f5ff);
6
+ background: linear-gradient(225deg, #fff, #f0f5ff);
7
7
  height: calc(94vh);
8
8
  position: relative;
9
9
  overflow: hidden;
10
10
 
11
11
  .content {
12
12
  .container1440();
13
+
13
14
  height: 100%;
14
15
  position: relative;
15
16
  }
@@ -23,14 +24,14 @@
23
24
  .title {
24
25
  font-size: 3.4em; //2.875em;
25
26
  font-weight: 800;
26
- color: rgba(0, 0, 0, 1);
27
+ color: rgba(0, 0, 0, 100%);
27
28
  position: relative;
28
29
  }
29
30
 
30
31
  .description {
31
32
  margin-top: 0.83%; //12px;
32
- margin-bottom: 0px;
33
- color: rgba(106, 123, 140, 1);
33
+ margin-bottom: 0;
34
+ color: rgba(106, 123, 140, 100%);
34
35
  font-size: 1.14em;
35
36
  font-weight: 200;
36
37
  position: relative;
@@ -162,6 +163,7 @@
162
163
  .gh-count {
163
164
  position: relative;
164
165
  display: none;
166
+
165
167
  /* hidden to start */
166
168
  margin-left: 52px;
167
169
  margin-top: 7px;
@@ -183,8 +185,8 @@
183
185
  color: #4183c4;
184
186
  }
185
187
 
186
- .gh-count:before,
187
- .gh-count:after {
188
+ .gh-count::before,
189
+ .gh-count::after {
188
190
  content: '';
189
191
  position: absolute;
190
192
  display: inline-block;
@@ -194,7 +196,7 @@
194
196
  border-style: solid;
195
197
  }
196
198
 
197
- .gh-count:before {
199
+ .gh-count::before {
198
200
  top: 50%;
199
201
  left: -3px;
200
202
  margin-top: -5px;
@@ -202,7 +204,7 @@
202
204
  border-right-color: #fafafa;
203
205
  }
204
206
 
205
- .gh-count:after {
207
+ .gh-count::after {
206
208
  top: 50%;
207
209
  border-width: 5px 5px 5px 0;
208
210
  border-right-color: #d4d4d4;
@@ -228,7 +230,6 @@
228
230
  display: flex;
229
231
  position: absolute;
230
232
  right: 0;
231
- margin-top: -300px;
232
233
  width: 52%;
233
234
  max-width: 598px;
234
235
  height: 324px;
@@ -44,7 +44,9 @@ export var Toolbar = function Toolbar(_ref) {
44
44
  onToggleFullscreen = _ref$onToggleFullscre === void 0 ? null : _ref$onToggleFullscre,
45
45
  onExecuteCode = _ref.onExecuteCode,
46
46
  onClickAI = _ref.onClickAI,
47
- onReload = _ref.onReload;
47
+ onReload = _ref.onReload,
48
+ _ref$showAI = _ref.showAI,
49
+ showAI = _ref$showAI === void 0 ? true : _ref$showAI;
48
50
  var locale = useLocale();
49
51
  var exampleTitle = _typeof(title) === 'object' ? title[locale.id] : title;
50
52
 
@@ -80,15 +82,19 @@ export var Toolbar = function Toolbar(_ref) {
80
82
  return onEditorTabChange(tab);
81
83
  }
82
84
  }, tab, " ", slot && slot);
83
- })), /*#__PURE__*/React.createElement("a", {
85
+ })), showAI ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("a", {
84
86
  className: styles.ai,
85
87
  onClick: onClickAI
86
- }, "AI \u52A9\u624B"), /*#__PURE__*/React.createElement(Tooltip, {
87
- title: "\u8FD8\u539F"
88
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
89
+ id: "ai.toolbar.assistant"
90
+ })), /*#__PURE__*/React.createElement(Tooltip, {
91
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
92
+ id: "ai.toolbar.restore"
93
+ })
88
94
  }, /*#__PURE__*/React.createElement("span", {
89
95
  className: styles.ai,
90
96
  onClick: onReload
91
- }, /*#__PURE__*/React.createElement(ReloadOutlined, null))), riddleVisible ? /*#__PURE__*/React.createElement("form", {
97
+ }, /*#__PURE__*/React.createElement(ReloadOutlined, null)))) : null, riddleVisible ? /*#__PURE__*/React.createElement("form", {
92
98
  action: "//riddle.alibaba-inc.com/riddles/define",
93
99
  method: "POST",
94
100
  target: "_blank"
@@ -98,7 +104,7 @@ export var Toolbar = function Toolbar(_ref) {
98
104
  value: JSON.stringify(riddlePrefillConfig)
99
105
  }), /*#__PURE__*/React.createElement(Tooltip, {
100
106
  title: /*#__PURE__*/React.createElement(FormattedMessage, {
101
- id: "\u5728 Riddle \u4E2D\u6253\u5F00"
107
+ id: "ai.toolbar.open.riddle"
102
108
  })
103
109
  }, /*#__PURE__*/React.createElement("input", {
104
110
  type: "submit",
@@ -106,7 +112,7 @@ export var Toolbar = function Toolbar(_ref) {
106
112
  className: styles.riddle
107
113
  }))) : null, /*#__PURE__*/React.createElement(Tooltip, {
108
114
  title: /*#__PURE__*/React.createElement(FormattedMessage, {
109
- id: "\u5728 StackBlitz \u4E2D\u6253\u5F00"
115
+ id: "ai.toolbar.open.stackblitz"
110
116
  })
111
117
  }, /*#__PURE__*/React.createElement(ThunderboltOutlined, {
112
118
  className: styles.stackblitz,
@@ -115,7 +121,7 @@ export var Toolbar = function Toolbar(_ref) {
115
121
  }
116
122
  })), /*#__PURE__*/React.createElement(Tooltip, {
117
123
  title: /*#__PURE__*/React.createElement(FormattedMessage, {
118
- id: "\u5728 CodeSandbox \u4E2D\u6253\u5F00"
124
+ id: "ai.toolbar.open.codesandbox"
119
125
  })
120
126
  }, /*#__PURE__*/React.createElement("form", {
121
127
  action: "https://codesandbox.io/api/v1/sandboxes/define",
@@ -141,7 +147,7 @@ export var Toolbar = function Toolbar(_ref) {
141
147
  }
142
148
  }), /*#__PURE__*/React.createElement(Tooltip, {
143
149
  title: /*#__PURE__*/React.createElement(FormattedMessage, {
144
- id: "\u6267\u884C\u4EE3\u7801"
150
+ id: "ai.toolbar.execute"
145
151
  })
146
152
  }, /*#__PURE__*/React.createElement(PlayCircleOutlined, {
147
153
  onClick: onExecuteCode,