@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.
Files changed (113) hide show
  1. package/dist/builtins/Playground/index.js +1 -1
  2. package/dist/builtins/Playground/index.module.less +0 -1
  3. package/dist/common/styles/Common.js +1 -1
  4. package/dist/common/styles/theme.js +1 -1
  5. package/dist/components/AI/HomeDialog/AntVBanner/index.js +4 -0
  6. package/dist/components/AI/HomeDialog/AntVBanner/index.module.less +35 -0
  7. package/dist/components/AI/HomeDialog/ModeSelector/ModeSelectorDropdown.js +42 -0
  8. package/dist/components/AI/HomeDialog/ModeSelector/index.js +32 -0
  9. package/dist/components/AI/HomeDialog/ModeSelector/index.module.less +289 -0
  10. package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.js +62 -0
  11. package/dist/components/AI/HomeDialog/PromptTextarea/ChooseLib/index.module.less +4 -0
  12. package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.js +25 -0
  13. package/dist/components/AI/HomeDialog/PromptTextarea/DatasourceCard/index.module.less +42 -0
  14. package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.js +23 -0
  15. package/dist/components/AI/HomeDialog/PromptTextarea/SendButton.module.less +9 -0
  16. package/dist/components/AI/HomeDialog/PromptTextarea/Uploader/DataUploader.js +225 -0
  17. package/dist/components/AI/HomeDialog/PromptTextarea/index.js +172 -0
  18. package/dist/components/AI/HomeDialog/PromptTextarea/index.module.less +128 -0
  19. package/dist/components/AI/HomeDialog/RecommendCase/Card.js +80 -0
  20. package/dist/components/AI/HomeDialog/RecommendCase/card.module.less +131 -0
  21. package/dist/components/AI/HomeDialog/RecommendCase/index.js +130 -0
  22. package/dist/components/AI/HomeDialog/RecommendCase/index.module.less +45 -0
  23. package/dist/components/AI/HomeDialog/RecommendCase/recommend.json +66 -0
  24. package/dist/components/AI/HomeDialog/index.js +62 -0
  25. package/dist/components/AI/HomeDialog/index.module.less +3 -0
  26. package/dist/components/AI/constant.js +37 -0
  27. package/dist/components/AI/index.js +1 -0
  28. package/dist/components/AI/types.js +1 -0
  29. package/dist/components/AI/utils.js +38 -0
  30. package/dist/components/Login/Captcha/index.js +185 -0
  31. package/dist/components/Login/Captcha/index.less +91 -0
  32. package/dist/components/Login/CheckCode/index.js +244 -0
  33. package/dist/components/Login/CheckCode/index.less +137 -0
  34. package/dist/components/Login/CountDownButton/index.js +109 -0
  35. package/dist/components/Login/CountDownButton/index.less +8 -0
  36. package/dist/components/Login/LoginForm.js +239 -0
  37. package/dist/components/Login/LoginForm.less +408 -0
  38. package/dist/components/Login/index.js +24 -0
  39. package/dist/components/Login/openAuthWindow.js +54 -0
  40. package/dist/components/Login/types.js +5 -0
  41. package/dist/components/Login/utils.js +47 -0
  42. package/dist/hooks/useProducts.js +39 -0
  43. package/dist/hooks/useStreamingText.js +139 -0
  44. package/dist/hooks/useTypewriter.js +69 -0
  45. package/dist/hooks/useVisionsnapSdk.js +159 -0
  46. package/dist/layouts/DocLayout.js +2 -2
  47. package/dist/layouts/GlobalLayout/index.js +22 -0
  48. package/dist/locales/en.json +132 -1
  49. package/dist/locales/zh.json +132 -1
  50. package/dist/model/AIChat.js +313 -0
  51. package/dist/model/auth.js +147 -0
  52. package/dist/pages/AIPlayground/components/ConversationsMenu/index.js +176 -0
  53. package/dist/pages/AIPlayground/components/ConversationsMenu/index.module.less +46 -0
  54. package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.js +97 -0
  55. package/dist/pages/AIPlayground/components/MarkdownComponent/MarkdownCodeBlock.module.less +13 -0
  56. package/dist/pages/AIPlayground/components/MarkdownComponent/index.js +50 -0
  57. package/dist/pages/AIPlayground/components/MsgBox/index.js +407 -0
  58. package/dist/pages/AIPlayground/components/MsgBox/index.module.less +43 -0
  59. package/dist/pages/AIPlayground/components/MsgBox/useAutoScroll.js +46 -0
  60. package/dist/pages/AIPlayground/components/SessionLayout/index.js +62 -0
  61. package/dist/pages/AIPlayground/components/SessionLayout/index.module.less +37 -0
  62. package/dist/pages/AIPlayground/components/TaskBox/generateCode.js +230 -0
  63. package/dist/pages/AIPlayground/components/TaskBox/index.js +101 -0
  64. package/dist/pages/AIPlayground/components/TaskBox/index.module.less +9 -0
  65. package/dist/pages/AIPlayground/demo.js +34 -0
  66. package/dist/pages/AIPlayground/index.js +12 -0
  67. package/dist/pages/AIPlayground/index.module.less +5 -0
  68. package/dist/pages/Examples/components/Accouncement/index.module.less +1 -1
  69. package/dist/pages/Examples/index.module.less +13 -13
  70. package/dist/pages/Index/components/Cases/index.module.less +9 -9
  71. package/dist/pages/Index/components/Companies/index.module.less +5 -4
  72. package/dist/pages/Index/components/Features/FeatureCard.module.less +4 -5
  73. package/dist/pages/Index/components/Features/index.module.less +6 -6
  74. package/dist/pages/Index/components/_.less +9 -9
  75. package/dist/pages/Index/index.js +1 -1
  76. package/dist/plugin/index.js +14 -6
  77. package/dist/slots/Banner/Notification.module.less +8 -8
  78. package/dist/slots/Banner/index.module.less +11 -10
  79. package/dist/slots/CodeEditor/Toolbar.js +23 -27
  80. package/dist/slots/CodeEditor/Toolbar.module.less +7 -0
  81. package/dist/slots/CodeEditor/index.js +67 -5
  82. package/dist/slots/CodeEditor/index.module.less +24 -0
  83. package/dist/slots/CodeEditor/utils.js +2 -1
  84. package/dist/slots/CodePreview/index.module.less +0 -3
  85. package/dist/slots/CodeRunner/index.js +24 -11
  86. package/dist/slots/ContentTable/index.module.less +2 -1
  87. package/dist/{pages/Index/components → slots}/Detail/News.js +1 -1
  88. package/dist/{pages/Index/components → slots}/Detail/News.module.less +9 -9
  89. package/dist/{pages/Index/components → slots}/Detail/index.js +13 -29
  90. package/dist/{pages/Index/components → slots}/Detail/index.module.less +24 -21
  91. package/dist/slots/ExampleSider/index.module.less +3 -4
  92. package/dist/slots/Footer/index.module.less +3 -3
  93. package/dist/slots/Header/Products/Product.module.less +3 -3
  94. package/dist/slots/Header/Products/getProducts.js +20 -26
  95. package/dist/slots/Header/Products/index.js +20 -16
  96. package/dist/slots/Header/Search/SearchResult.js +53 -14
  97. package/dist/slots/Header/Search/SearchResult.module.less +1 -0
  98. package/dist/slots/Header/Search/index.js +2 -1
  99. package/dist/slots/Header/index.js +72 -30
  100. package/dist/slots/Header/index.module.less +15 -7
  101. package/dist/slots/LiveExample/index.js +1 -1
  102. package/dist/slots/LiveExample/index.module.less +1 -1
  103. package/dist/slots/Loading/index.module.less +30 -28
  104. package/dist/slots/ManualContent/index.module.less +14 -17
  105. package/dist/slots/_.less +9 -9
  106. package/dist/static/user.svg +3 -0
  107. package/dist/typings.d.ts +11 -0
  108. package/dist/utils/analytics.js +16 -0
  109. package/dist/utils/code.js +35 -0
  110. package/dist/utils/env.js +63 -0
  111. package/dist/utils/index.js +7 -0
  112. package/dist/utils/request.js +42 -0
  113. package/package.json +33 -17
@@ -13,12 +13,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  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; }
14
14
  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; } }
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
- import { CaretDownFilled, DownOutlined, GithubOutlined, LinkOutlined, MenuOutlined, WechatOutlined } from '@ant-design/icons';
16
+ import { CaretDownFilled, DownOutlined, GithubOutlined, LinkOutlined, LogoutOutlined, MenuOutlined, MessageOutlined, UserDeleteOutlined, WechatOutlined } from '@ant-design/icons';
17
17
  import { Alert, Button, Dropdown, Menu, Modal, Popover } from 'antd';
18
18
  import cx from 'classnames';
19
- import { FormattedMessage, Link, useLocale, useSiteData } from 'dumi';
19
+ import { FormattedMessage, Link, useLocale, useSiteData, useIntl, history } from 'dumi';
20
20
  import { get, map, size } from 'lodash-es';
21
- import React, { useEffect, useMemo, useState } from 'react';
21
+ import React, { useEffect, useState } from 'react';
22
22
  import { useMedia } from 'react-use';
23
23
  import { getPurePathname } from "../../utils/location";
24
24
  import { ic, icWithLocale } from "../hooks";
@@ -26,11 +26,15 @@ import { Navs } from "./Navs";
26
26
  import { Products } from "./Products";
27
27
  import { Search } from "./Search";
28
28
  import { findVersion } from "./utils";
29
+ import { ReactComponent as UserIcon } from "../../static/user.svg";
29
30
  import { Assistant } from '@petercatai/assistant';
30
31
  import '@petercatai/assistant/style';
31
32
  import { useLocation } from 'react-router-dom';
32
33
  import { determineUserType } from "../../utils/user";
33
34
  import styles from "./index.module.less";
35
+ import { useSnapshot } from "valtio";
36
+ import { authStore, logout } from "../../model/auth";
37
+ import { clearAllChatData } from "../../model/AIChat";
34
38
  function redirectChinaMirror(chinaMirrorOrigin) {
35
39
  window.location.href = window.location.href.replace(window.location.origin, chinaMirrorOrigin);
36
40
  }
@@ -53,9 +57,6 @@ var HeaderComponent = function HeaderComponent(_ref) {
53
57
  showAntVProductsCard = _ref$showAntVProducts === void 0 ? true : _ref$showAntVProducts,
54
58
  _ref$showLanguageSwit = _ref.showLanguageSwitcher,
55
59
  showLanguageSwitcher = _ref$showLanguageSwit === void 0 ? true : _ref$showLanguageSwit,
56
- _ref$showWeavefox = _ref.showWeavefox,
57
- showWeavefox = _ref$showWeavefox === void 0 ? {} : _ref$showWeavefox,
58
- isInternalUser = _ref.isInternalUser,
59
60
  logo = _ref.logo,
60
61
  onLanguageChange = _ref.onLanguageChange,
61
62
  _ref$showWxQrcode = _ref.showWxQrcode,
@@ -76,11 +77,12 @@ var HeaderComponent = function HeaderComponent(_ref) {
76
77
  ecosystems = _ref.ecosystems,
77
78
  announcement = _ref.announcement;
78
79
  var isAntVHome = isAntVSite && isHomePage; // 是否为AntV官网首页
79
-
80
+ var authSnap = useSnapshot(authStore);
80
81
  var _useState = useState(false),
81
82
  _useState2 = _slicedToArray(_useState, 2),
82
83
  bannerVisible = _useState2[0],
83
84
  setBannerVisible = _useState2[1];
85
+ var intl = useIntl();
84
86
  var showChinaMirror = !!internalSite;
85
87
  var chinaMirrorUrl = get(internalSite, 'url');
86
88
  var _useState3 = useState(false),
@@ -149,8 +151,7 @@ var HeaderComponent = function HeaderComponent(_ref) {
149
151
  }),
150
152
  link: ''
151
153
  }, logo),
152
- img = _img$link$logo.img,
153
- link = _img$link$logo.link;
154
+ img = _img$link$logo.img;
154
155
  var _useLocation = useLocation(),
155
156
  pathname = _useLocation.pathname;
156
157
  useEffect(function () {
@@ -185,25 +186,13 @@ var HeaderComponent = function HeaderComponent(_ref) {
185
186
  var handleSwitchLanguage = function handleSwitchLanguage() {
186
187
  onLanguageChange === null || onLanguageChange === void 0 || onLanguageChange(lang);
187
188
  };
188
- var weavefox = useMemo(function () {
189
- var configKey = isInternalUser ? 'internal' : 'public';
190
- var configValue = showWeavefox[configKey];
191
- if (!configValue) return /*#__PURE__*/React.createElement(React.Fragment, null);
192
- var defaultLink = isInternalUser ? 'https://weavefox.antgroup-inc.cn/agent/@huiyu.zjt/AntV' : 'https://weavefox.alipay.com/agent/@ufox-b8tydq-0758/202505AP7vfl00422922';
193
- var href = typeof configValue === 'string' ? configValue : defaultLink;
194
- return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("a", {
195
- href: href,
196
- target: "_blank",
197
- rel: "noreferrer"
198
- }, "AI\u751F\u7801"));
199
- }, [isInternalUser, showWeavefox]);
200
189
  var menu = /*#__PURE__*/React.createElement("ul", {
201
190
  className: cx(styles.menu, _defineProperty(_defineProperty({}, styles.popup, !isWide), styles.popupHidden, !popupMenuVisible))
202
191
  }, /** 最左侧的菜单,一般是 教程、API、示例,或者其他自定义,有配置文件中的 `navs` 决定 */
203
192
  size(navs) ? /*#__PURE__*/React.createElement(Navs, {
204
193
  navs: navs,
205
194
  path: pathname
206
- }) : null, weavefox, /** 生态产品 */
195
+ }) : null, /** 生态产品 */
207
196
  size(ecosystems) ? /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(Dropdown, {
208
197
  className: styles.ecoSystems,
209
198
  overlay: /*#__PURE__*/React.createElement(Menu, null, map(ecosystems, function (_ref2) {
@@ -235,7 +224,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
235
224
  style: {
236
225
  marginRight: '8px'
237
226
  }
238
- }, "\uD83C\uDDE8\uD83C\uDDF3"), "AntV \u7CFB\u5217\u7F51\u7AD9\u90E8\u7F72\u5728 gh-pages \u4E0A\uFF0C\u82E5\u8BBF\u95EE\u901F\u5EA6\u4E0D\u4F73\uFF0C\u53EF\u4EE5\u524D\u5F80\u56FD\u5185\u955C\u50CF\u7AD9\u70B9\u3002"), /*#__PURE__*/React.createElement("div", {
227
+ }, "\uD83C\uDDE8\uD83C\uDDF3"), /*#__PURE__*/React.createElement(FormattedMessage, {
228
+ id: "header.china.mirror.title"
229
+ })), /*#__PURE__*/React.createElement("div", {
239
230
  style: {
240
231
  marginTop: 16,
241
232
  textAlign: 'right'
@@ -248,14 +239,18 @@ var HeaderComponent = function HeaderComponent(_ref) {
248
239
  style: {
249
240
  marginRight: 8
250
241
  }
251
- }, "\u6682\u65F6\u5173\u95ED"), /*#__PURE__*/React.createElement(Button, {
242
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
243
+ id: "header.china.mirror.temp.close"
244
+ })), /*#__PURE__*/React.createElement(Button, {
252
245
  type: "primary",
253
246
  size: "small",
254
247
  onClick: function onClick() {
255
248
  localStorage.setItem('china-mirror-no-more-hint', Date.now().toString());
256
249
  updateChinaMirrorHintVisible(false);
257
250
  }
258
- }, "\u4E0D\u518D\u63D0\u9192"))),
251
+ }, /*#__PURE__*/React.createElement(FormattedMessage, {
252
+ id: "header.china.mirror.no.more"
253
+ })))),
259
254
  open: chinaMirrorHintVisible,
260
255
  placement: "bottomRight",
261
256
  align: {
@@ -273,8 +268,12 @@ var HeaderComponent = function HeaderComponent(_ref) {
273
268
  }
274
269
  })))) : null, showChinaMirror && !isWide && /*#__PURE__*/React.createElement(Modal, {
275
270
  open: chinaMirrorHintVisible,
276
- cancelText: "\u4E0D\u518D\u63D0\u9192",
277
- okText: "\u7ACB\u5373\u524D\u5F80",
271
+ cancelText: /*#__PURE__*/React.createElement(FormattedMessage, {
272
+ id: "header.china.mirror.no.more"
273
+ }),
274
+ okText: /*#__PURE__*/React.createElement(FormattedMessage, {
275
+ id: "header.china.mirror.temp.close"
276
+ }),
278
277
  onCancel: function onCancel() {
279
278
  updateChinaMirrorHintVisible(false);
280
279
  },
@@ -292,7 +291,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
292
291
  }, /*#__PURE__*/React.createElement("span", {
293
292
  role: "img",
294
293
  "aria-labelledby": "\u4E2D\u56FD"
295
- }, "\uD83C\uDDE8\uD83C\uDDF3"), "AntV \u7CFB\u5217\u7F51\u7AD9\u90E8\u7F72\u5728 gh-pages \u4E0A\uFF0C\u82E5\u8BBF\u95EE\u901F\u5EA6\u4E0D\u4F73\uFF0C\u53EF\u4EE5\u524D\u5F80", /*#__PURE__*/React.createElement("a", {
294
+ }, "\uD83C\uDDE8\uD83C\uDDF3"), /*#__PURE__*/React.createElement(FormattedMessage, {
295
+ id: "header.china.mirror.title"
296
+ }), /*#__PURE__*/React.createElement("a", {
296
297
  href: chinaMirrorUrl,
297
298
  onClick: function onClick(e) {
298
299
  e.preventDefault();
@@ -370,7 +371,9 @@ var HeaderComponent = function HeaderComponent(_ref) {
370
371
  src: "https://gw.alipayobjects.com/zos/antfincdn/ZKlx96dsfs/qrcode_for_gh_f52d8b6aa591_258.jpg",
371
372
  alt: "wx-qrcode"
372
373
  }),
373
- title: "\u5FAE\u4FE1\u626B\u4E00\u626B\u5173\u6CE8",
374
+ title: /*#__PURE__*/React.createElement(FormattedMessage, {
375
+ id: "header.wx.qrcode.title"
376
+ }),
374
377
  styles: {
375
378
  body: {
376
379
  padding: 2
@@ -387,7 +390,46 @@ var HeaderComponent = function HeaderComponent(_ref) {
387
390
  href: githubUrl,
388
391
  target: "_blank",
389
392
  rel: "noreferrer"
390
- }, /*#__PURE__*/React.createElement(GithubOutlined, null))));
393
+ }, /*#__PURE__*/React.createElement(GithubOutlined, null))), authSnap.isAuthenticated && /*#__PURE__*/React.createElement("li", {
394
+ className: cx(styles.navIcon, styles.githubCorner)
395
+ }, /*#__PURE__*/React.createElement(Dropdown, {
396
+ menu: {
397
+ items: [{
398
+ key: 'history',
399
+ label: /*#__PURE__*/React.createElement("a", {
400
+ onClick: function onClick() {
401
+ return history.push("/".concat(lang || 'zh', "/ai-playground"));
402
+ }
403
+ }, intl.formatMessage({
404
+ id: 'header.user.history'
405
+ })),
406
+ icon: /*#__PURE__*/React.createElement(MessageOutlined, null)
407
+ }, {
408
+ key: 'logout',
409
+ label: /*#__PURE__*/React.createElement("a", {
410
+ onClick: function onClick() {
411
+ return logout();
412
+ }
413
+ }, intl.formatMessage({
414
+ id: 'header.user.logout'
415
+ })),
416
+ icon: /*#__PURE__*/React.createElement(LogoutOutlined, null)
417
+ }, {
418
+ key: 'deleteAccount',
419
+ label: /*#__PURE__*/React.createElement("a", {
420
+ onClick: function onClick() {
421
+ logout();
422
+ clearAllChatData();
423
+ }
424
+ }, intl.formatMessage({
425
+ id: 'header.user.deleteAccount'
426
+ })),
427
+ icon: /*#__PURE__*/React.createElement(UserDeleteOutlined, null)
428
+ }]
429
+ }
430
+ }, /*#__PURE__*/React.createElement("a", null, /*#__PURE__*/React.createElement(UserIcon, {
431
+ className: styles.userIcon
432
+ })))));
391
433
  return /*#__PURE__*/React.createElement("header", {
392
434
  className: cx(styles.header, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.transparent, !!transparent && !productMenuVisible), styles.isHomePage, !!isHomePage && !isAntVHome), styles.lightTheme, !!isAntVHome && !productMenuVisible && isWide), styles.isAntVHome, !!isAntVHome), styles.fixed, popupMenuVisible))
393
435
  }, bannerVisible && announcementTitle && /*#__PURE__*/React.createElement(Alert, {
@@ -39,7 +39,7 @@
39
39
  margin-bottom: -@nav-height;
40
40
 
41
41
  .container {
42
- .container1440;
42
+ .container1440();
43
43
  }
44
44
  }
45
45
 
@@ -65,7 +65,7 @@
65
65
  .container {
66
66
  max-width: 100%;
67
67
  padding: 0 20px;
68
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
68
+ border-bottom: 1px solid rgba(0, 0, 0, 10%);
69
69
  }
70
70
 
71
71
  .nav {
@@ -87,7 +87,7 @@
87
87
 
88
88
  &:hover {
89
89
  background: #fff;
90
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
90
+ box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 10%);
91
91
  }
92
92
  }
93
93
  }
@@ -108,7 +108,7 @@
108
108
 
109
109
  .languageSwitcher {
110
110
  position: relative;
111
- top: 1px;
111
+ top: 9px;
112
112
  }
113
113
 
114
114
  .wxQrcode {
@@ -174,11 +174,11 @@
174
174
  font-size: 18px;
175
175
 
176
176
  a {
177
- color: rgba(0, 0, 0, 0.85);
177
+ color: rgba(0, 0, 0, 85%);
178
178
  transition: all 0.3s;
179
179
 
180
180
  &:hover {
181
- color: rgba(0, 0, 0, 1);
181
+ color: rgba(0, 0, 0, 100%);
182
182
  }
183
183
  }
184
184
  }
@@ -400,7 +400,7 @@
400
400
  }
401
401
 
402
402
  .remindHref {
403
- margin: 0px 6px 0px 5px;
403
+ margin: 0 6px 0 5px;
404
404
  }
405
405
 
406
406
  .modalContent {
@@ -460,3 +460,11 @@
460
460
  }
461
461
  }
462
462
  }
463
+
464
+ .userIcon {
465
+ font-size: 16px;
466
+ width: 1em;
467
+ height: 1em;
468
+ vertical-align: -0.2em;
469
+ fill: currentColor;
470
+ }
@@ -93,7 +93,7 @@ export default function LiveExample(props) {
93
93
  var executionId = "exec-".concat(Date.now(), "-").concat(Math.random().toString(36).substr(2, 9));
94
94
  var script = document.createElement('script');
95
95
  var modifiedCode = compiledCode.replace(/'container'|"container"/g, "'".concat(containerId, "'"));
96
- script.textContent = "\n try {\n ".concat(modifiedCode, "\n const successElement = document.createElement('div');\n successElement.id = 'execution-success-").concat(executionId, "';\n successElement.style.display = 'none';\n document.body.appendChild(successElement);\n } catch (error) {\n console.error('\u811A\u672C\u6267\u884C\u65F6\u53D1\u751F\u9519\u8BEF:', error);\n const errorElement = document.createElement('div');\n errorElement.id = 'execution-error-").concat(executionId, "';\n errorElement.textContent = error.message;\n errorElement.style.display = 'none';\n document.body.appendChild(errorElement);\n\n if (!").concat(hasSuccessfulRender, ") {\n const errorContainer = document.getElementById('").concat(containerId, "');\n if (errorContainer) {\n errorContainer.innerHTML = '<div style=\"color: #fb1716; padding: 8px; border-left: 3px solid #ff0000; padding-left: 12px;\">Runtime Error: ' + error.message + '</div>';\n }\n }\n }\n ");
96
+ script.textContent = "\n // Can only have one anonymous define call per script file\n // \u548C monaco loader \u52A0\u8F7D\u51B2\u7A81\n var __runnerDefine = window['define'];\n window['define'] = null;\n try {\n ".concat(modifiedCode, "\n const successElement = document.createElement('div');\n successElement.id = 'execution-success-").concat(executionId, "';\n successElement.style.display = 'none';\n document.body.appendChild(successElement);\n } catch (error) {\n console.error('\u811A\u672C\u6267\u884C\u65F6\u53D1\u751F\u9519\u8BEF:', error);\n const errorElement = document.createElement('div');\n errorElement.id = 'execution-error-").concat(executionId, "';\n errorElement.textContent = error.message;\n errorElement.style.display = 'none';\n document.body.appendChild(errorElement);\n\n if (!").concat(hasSuccessfulRender, ") {\n const errorContainer = document.getElementById('").concat(containerId, "');\n if (errorContainer) {\n errorContainer.innerHTML = '<div style=\"color: #fb1716; padding: 8px; border-left: 3px solid #ff0000; padding-left: 12px;\">Runtime Error: ' + error.message + '</div>';\n }\n }\n } finally {\n window['define'] = __runnerDefine;\n }\n ");
97
97
  document.head.appendChild(script);
98
98
 
99
99
  // 检查执行结果并清理
@@ -54,7 +54,7 @@
54
54
  display: block;
55
55
  color: #fb1716;
56
56
  padding: 0.25rem 0;
57
- border-left: 3px solid #ff0000;
57
+ border-left: 3px solid #f00;
58
58
  padding-left: 12px;
59
59
  }
60
60
  }
@@ -15,8 +15,10 @@
15
15
  top: 50%;
16
16
  margin: -50px 0 0 -120px;
17
17
  }
18
+
18
19
  .loader {
19
20
  --duration: 3s;
21
+
20
22
  width: 44px;
21
23
  height: 44px;
22
24
  position: relative;
@@ -24,7 +26,7 @@
24
26
  margin: 0 16px;
25
27
  }
26
28
 
27
- .loader:before {
29
+ .loader::before {
28
30
  content: ' ';
29
31
  width: 6px;
30
32
  height: 6px;
@@ -34,9 +36,9 @@
34
36
  background: #ff700a;
35
37
  top: 37px;
36
38
  left: 19px;
37
- -webkit-transform: translate(-18px, -18px);
38
39
  transform: translate(-18px, -18px);
39
- -webkit-animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
40
+ transform: translate(-18px, -18px);
41
+ animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
40
42
  animation: dotRect var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
41
43
  }
42
44
 
@@ -58,21 +60,21 @@
58
60
  .loader svg polygon {
59
61
  stroke-dasharray: 145 76 145 76;
60
62
  stroke-dashoffset: 0;
61
- -webkit-animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
63
+ animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
62
64
  animation: pathTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
63
65
  }
64
66
 
65
67
  .loader svg rect {
66
68
  stroke-dasharray: 192 64 192 64;
67
69
  stroke-dashoffset: 0;
68
- -webkit-animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
70
+ animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
69
71
  animation: pathRect 3s cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
70
72
  }
71
73
 
72
74
  .loader svg circle {
73
75
  stroke-dasharray: 150 50 150 50;
74
76
  stroke-dashoffset: 75;
75
- -webkit-animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
77
+ animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
76
78
  animation: pathCircle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
77
79
  }
78
80
 
@@ -80,11 +82,11 @@
80
82
  width: 48px;
81
83
  }
82
84
 
83
- .loader.triangle:before {
85
+ .loader.triangle::before {
84
86
  left: 21px;
85
- -webkit-transform: translate(-10px, -18px);
86
87
  transform: translate(-10px, -18px);
87
- -webkit-animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
88
+ transform: translate(-10px, -18px);
89
+ animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
88
90
  animation: dotTriangle var(--duration) cubic-bezier(0.785, 0.135, 0.15, 0.86) infinite;
89
91
  }
90
92
 
@@ -99,7 +101,7 @@
99
101
  }
100
102
  }
101
103
 
102
- @-webkit-keyframes ~":global(pathTriangle)" {
104
+ @keyframes ~":global(pathTriangle)" {
103
105
  33% {
104
106
  stroke-dashoffset: 74;
105
107
  }
@@ -127,41 +129,41 @@
127
129
  }
128
130
  }
129
131
 
130
- @-webkit-keyframes ~":global(dotTriangle)" {
132
+ @keyframes ~":global(dotTriangle)" {
131
133
  33% {
132
- -webkit-transform: translate(0, 0);
134
+ transform: translate(0, 0);
133
135
  transform: translate(0, 0);
134
136
  }
135
137
 
136
138
  66% {
137
- -webkit-transform: translate(10px, -18px);
139
+ transform: translate(10px, -18px);
138
140
  transform: translate(10px, -18px);
139
141
  }
140
142
 
141
143
  100% {
142
- -webkit-transform: translate(-10px, -18px);
144
+ transform: translate(-10px, -18px);
143
145
  transform: translate(-10px, -18px);
144
146
  }
145
147
  }
146
148
 
147
149
  @keyframes ~":global(dotTriangle)" {
148
150
  33% {
149
- -webkit-transform: translate(0, 0);
151
+ transform: translate(0, 0);
150
152
  transform: translate(0, 0);
151
153
  }
152
154
 
153
155
  66% {
154
- -webkit-transform: translate(10px, -18px);
156
+ transform: translate(10px, -18px);
155
157
  transform: translate(10px, -18px);
156
158
  }
157
159
 
158
160
  100% {
159
- -webkit-transform: translate(-10px, -18px);
161
+ transform: translate(-10px, -18px);
160
162
  transform: translate(-10px, -18px);
161
163
  }
162
164
  }
163
165
 
164
- @-webkit-keyframes ~":global(pathRect)" {
166
+ @keyframes ~":global(pathRect)" {
165
167
  25% {
166
168
  stroke-dashoffset: 64;
167
169
  }
@@ -197,51 +199,51 @@
197
199
  }
198
200
  }
199
201
 
200
- @-webkit-keyframes ~":global(dotRect)" {
202
+ @keyframes ~":global(dotRect)" {
201
203
  25% {
202
- -webkit-transform: translate(0, 0);
204
+ transform: translate(0, 0);
203
205
  transform: translate(0, 0);
204
206
  }
205
207
 
206
208
  50% {
207
- -webkit-transform: translate(18px, -18px);
209
+ transform: translate(18px, -18px);
208
210
  transform: translate(18px, -18px);
209
211
  }
210
212
 
211
213
  75% {
212
- -webkit-transform: translate(0, -36px);
214
+ transform: translate(0, -36px);
213
215
  transform: translate(0, -36px);
214
216
  }
215
217
 
216
218
  100% {
217
- -webkit-transform: translate(-18px, -18px);
219
+ transform: translate(-18px, -18px);
218
220
  transform: translate(-18px, -18px);
219
221
  }
220
222
  }
221
223
 
222
224
  @keyframes ~":global(dotRect)" {
223
225
  25% {
224
- -webkit-transform: translate(0, 0);
226
+ transform: translate(0, 0);
225
227
  transform: translate(0, 0);
226
228
  }
227
229
 
228
230
  50% {
229
- -webkit-transform: translate(18px, -18px);
231
+ transform: translate(18px, -18px);
230
232
  transform: translate(18px, -18px);
231
233
  }
232
234
 
233
235
  75% {
234
- -webkit-transform: translate(0, -36px);
236
+ transform: translate(0, -36px);
235
237
  transform: translate(0, -36px);
236
238
  }
237
239
 
238
240
  100% {
239
- -webkit-transform: translate(-18px, -18px);
241
+ transform: translate(-18px, -18px);
240
242
  transform: translate(-18px, -18px);
241
243
  }
242
244
  }
243
245
 
244
- @-webkit-keyframes ~":global(pathCircle)" {
246
+ @keyframes ~":global(pathCircle)" {
245
247
  25% {
246
248
  stroke-dashoffset: 125;
247
249
  }
@@ -87,7 +87,7 @@
87
87
  }
88
88
 
89
89
  pre[class*='language-'] {
90
- background-color: rgba(0, 0, 0, 0.03);
90
+ background-color: rgba(0, 0, 0, 3%);
91
91
  width: 100%;
92
92
  }
93
93
 
@@ -95,7 +95,7 @@
95
95
  padding: 0.2em 0.4em;
96
96
  margin: 0;
97
97
  font-size: 85%;
98
- background-color: rgba(175, 184, 193, 0.2);
98
+ background-color: rgba(175, 184, 193, 20%);
99
99
  border-radius: 6px;
100
100
  }
101
101
 
@@ -174,7 +174,7 @@
174
174
  table th {
175
175
  color: #5c6b77;
176
176
  font-weight: 500;
177
- background: rgba(0, 0, 0, 0.02);
177
+ background: rgba(0, 0, 0, 2%);
178
178
  }
179
179
 
180
180
  table th,
@@ -193,7 +193,7 @@
193
193
  width: 20%;
194
194
  font-weight: 500;
195
195
  background: #fcfcfc;
196
- color: rgba(0, 0, 0, 0.85);
196
+ color: rgba(0, 0, 0, 85%);
197
197
  }
198
198
 
199
199
  blockquote {
@@ -256,7 +256,6 @@
256
256
  background: #fff;
257
257
  max-height: 100vh;
258
258
  overflow: auto;
259
-
260
259
  position: sticky;
261
260
  top: 0;
262
261
 
@@ -281,8 +280,8 @@
281
280
  margin-bottom: 20px;
282
281
  font-weight: 500;
283
282
  font-size: 30px;
284
- font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei,
285
- Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
283
+ font-family: Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
284
+ "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
286
285
  line-height: 38px;
287
286
  }
288
287
 
@@ -358,7 +357,7 @@
358
357
  justify-content: center;
359
358
  align-items: center;
360
359
  background: #fff;
361
- box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
360
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 15%);
362
361
  border-radius: 0 4px 4px 0;
363
362
  }
364
363
  }
@@ -428,7 +427,7 @@
428
427
  &:hover > div {
429
428
  transform: translateY(-4px);
430
429
  border-color: transparent;
431
- box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
430
+ box-shadow: 0 6px 16px rgba(107, 147, 224, 14%);
432
431
  }
433
432
 
434
433
  h4 {
@@ -482,7 +481,7 @@
482
481
  :global {
483
482
  .SplitPane {
484
483
  overflow: auto;
485
- left: 0px;
484
+ left: 0;
486
485
  height: calc(100vh - 64px) !important;
487
486
  }
488
487
 
@@ -623,10 +622,9 @@
623
622
  }
624
623
 
625
624
  .backTop {
626
- transition: color 0.3s;
627
625
  color: #868484;
628
626
  background-color: #fff;
629
- 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);
627
+ 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%);
630
628
  transition: color 0.3s;
631
629
  width: 44px;
632
630
  height: 44px;
@@ -667,7 +665,7 @@
667
665
  justify-content: center;
668
666
  align-items: center;
669
667
  background: #fff;
670
- box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
668
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 15%);
671
669
  border-radius: 0 4px 4px 0;
672
670
  }
673
671
 
@@ -677,9 +675,8 @@
677
675
 
678
676
  .readtime {
679
677
  color: #0d1a26;
680
- line-height: 1.5715;
681
678
  list-style: none;
682
- -webkit-font-feature-settings: 'tnum';
679
+ font-feature-settings: 'tnum';
683
680
  font-feature-settings: 'tnum';
684
681
  display: inline-block;
685
682
  height: auto;
@@ -694,6 +691,6 @@
694
691
  opacity: 1;
695
692
  transition: all 0.3s;
696
693
  background-color: #fff;
697
- font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei,
698
- Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
694
+ font-family: Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
695
+ "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
699
696
  }
package/dist/slots/_.less CHANGED
@@ -95,30 +95,30 @@ h6 {
95
95
  width: 100%;
96
96
  height: 11px;
97
97
  margin: -5px 0;
98
- border-top: 5px solid rgba(255, 255, 255, 0);
99
- border-bottom: 5px solid rgba(255, 255, 255, 0);
98
+ border-top: 5px solid rgba(255, 255, 255, 0%);
99
+ border-bottom: 5px solid rgba(255, 255, 255, 0%);
100
100
  cursor: row-resize;
101
101
 
102
102
  &:hover {
103
- border-top: 5px solid rgba(0, 0, 0, 0.5);
104
- border-bottom: 5px solid rgba(0, 0, 0, 0.5);
103
+ border-top: 5px solid rgba(0, 0, 0, 50%);
104
+ border-bottom: 5px solid rgba(0, 0, 0, 50%);
105
105
  }
106
106
  }
107
107
 
108
108
  &.vertical {
109
109
  width: 11px;
110
110
  margin: 0 -5px;
111
- border-right: 5px solid rgba(255, 255, 255, 0);
112
- border-left: 5px solid rgba(255, 255, 255, 0);
111
+ border-right: 5px solid rgba(255, 255, 255, 0%);
112
+ border-left: 5px solid rgba(255, 255, 255, 0%);
113
113
  cursor: col-resize;
114
114
 
115
- Pane2 {
115
+ pane2 {
116
116
  border-left: 1px solid #e6e6e6;
117
117
  }
118
118
 
119
119
  &:hover {
120
- border-right: 5px solid rgba(0, 0, 0, 0.5);
121
- border-left: 5px solid rgba(0, 0, 0, 0.5);
120
+ border-right: 5px solid rgba(0, 0, 0, 50%);
121
+ border-left: 5px solid rgba(0, 0, 0, 50%);
122
122
  }
123
123
  }
124
124
 
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667z m0 160c70.4 0 128 57.6 128 128s-57.6 128-128 128-128-57.6-128-128 57.6-128 128-128z m236.8 507.733333c-23.466667 32-117.333333 100.266667-236.8 100.266667s-213.333333-68.266667-236.8-100.266667c-8.533333-10.666667-10.666667-21.333333-8.533333-32 29.866667-110.933333 130.133333-187.733333 245.333333-187.733333s215.466667 76.8 245.333333 187.733333c2.133333 10.666667 0 21.333333-8.533333 32z" fill="currentColor"></path>
3
+ </svg>
package/dist/typings.d.ts CHANGED
@@ -13,6 +13,11 @@ declare module '*.json' {
13
13
  export default content;
14
14
  }
15
15
 
16
+ declare module '*.module.less' {
17
+ const classes: any;
18
+ export default classes;
19
+ }
20
+
16
21
  declare module '*.less' {
17
22
  const content: any;
18
23
  export default content;
@@ -22,3 +27,9 @@ declare module '*.svg' {
22
27
  const content: any;
23
28
  export default content;
24
29
  }
30
+
31
+ /**
32
+ * 由构建工具注入的包版本号。
33
+ * @see fatherrc.ts
34
+ */
35
+ declare const __PACKAGE_VERSION__: string;