@antv/dumi-theme-antv 0.8.0-beta.19 → 0.8.0-beta.20
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/model/auth.js
CHANGED
|
@@ -6,6 +6,8 @@ import { proxy } from 'valtio';
|
|
|
6
6
|
import request from "../utils/request";
|
|
7
7
|
import { history } from 'dumi';
|
|
8
8
|
import { message } from "antd";
|
|
9
|
+
import { subscribeKey } from "valtio/utils";
|
|
10
|
+
import { trackEvent } from "../utils/analytics";
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* 检查当前 URL 是否包含 'skipLogin=1' 参数
|
|
@@ -32,6 +34,11 @@ export var authStore = proxy({
|
|
|
32
34
|
isAuthenticated: false,
|
|
33
35
|
loginCallback: function loginCallback() {}
|
|
34
36
|
});
|
|
37
|
+
subscribeKey(authStore, 'isModalOpen', function (open) {
|
|
38
|
+
if (open) {
|
|
39
|
+
trackEvent('login_modal_open');
|
|
40
|
+
}
|
|
41
|
+
});
|
|
35
42
|
|
|
36
43
|
// 2. 定义 Actions (作为独立函数)
|
|
37
44
|
export var showLoginModal = function showLoginModal(callback) {
|
|
@@ -16,7 +16,7 @@ import { useIntl } from 'dumi'; // 定义 props 类型,它将接收 react-mark
|
|
|
16
16
|
|
|
17
17
|
// 定义 props 类型,它将接收 react-markdown 传递的所有属性
|
|
18
18
|
|
|
19
|
-
export var MarkdownCodeBlock = function
|
|
19
|
+
export var MarkdownCodeBlock = /*#__PURE__*/React.memo(function (_ref) {
|
|
20
20
|
var inline = _ref.inline,
|
|
21
21
|
className = _ref.className,
|
|
22
22
|
children = _ref.children,
|
|
@@ -94,4 +94,4 @@ export var MarkdownCodeBlock = function MarkdownCodeBlock(_ref) {
|
|
|
94
94
|
background: '#fafafa'
|
|
95
95
|
}
|
|
96
96
|
}, codeString));
|
|
97
|
-
};
|
|
97
|
+
});
|
|
@@ -8,7 +8,7 @@ import rehypeRaw from 'rehype-raw';
|
|
|
8
8
|
import remarkGfm from 'remark-gfm';
|
|
9
9
|
import { MarkdownCodeBlock } from "./MarkdownCodeBlock"; // 引入我们创建的自定义组件
|
|
10
10
|
|
|
11
|
-
export var MarkdownComponent = function
|
|
11
|
+
export var MarkdownComponent = /*#__PURE__*/React.memo(function (_ref) {
|
|
12
12
|
var content = _ref.content,
|
|
13
13
|
showRunButton = _ref.showRunButton;
|
|
14
14
|
return /*#__PURE__*/React.createElement(Markdown, {
|
|
@@ -47,4 +47,4 @@ export var MarkdownComponent = function MarkdownComponent(_ref) {
|
|
|
47
47
|
// a: (props) => <a style={{ color: 'green' }} target="_blank" rel="noopener noreferrer" {...props} />,
|
|
48
48
|
}
|
|
49
49
|
}, content);
|
|
50
|
-
};
|
|
50
|
+
});
|