@antv/dumi-theme-antv 0.8.3 → 0.8.4
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.
|
@@ -27,8 +27,9 @@ export function HomeDialog(props) {
|
|
|
27
27
|
_fileSummary = _useState4[0],
|
|
28
28
|
setFileSummary = _useState4[1];
|
|
29
29
|
var handleConfirm = function handleConfirm() {
|
|
30
|
-
//
|
|
31
|
-
var
|
|
30
|
+
// 在新标签页打开新站点,携带问题参数,并将选择的技术栈拼接在消息前面
|
|
31
|
+
var libPrefix = snap.lib ? lang === 'zh' ? "\u4F7F\u7528".concat(snap.lib, "\u65F6\uFF0C") : "When using ".concat(snap.lib, ", ") : '';
|
|
32
|
+
var encodedMessage = encodeURIComponent("".concat(libPrefix).concat(promptText));
|
|
32
33
|
var targetUrl = "https://sive.antv.antgroup.com/qa?message=".concat(encodedMessage);
|
|
33
34
|
window.open(targetUrl, '_blank', 'noopener,noreferrer');
|
|
34
35
|
};
|
|
@@ -13,7 +13,7 @@ var GlobalLayout = function GlobalLayout() {
|
|
|
13
13
|
if (typeof window !== 'undefined') {
|
|
14
14
|
window.antd = antd;
|
|
15
15
|
}
|
|
16
|
-
console.log("%c @antv/dumi-theme-antv %c ".concat("0.8.
|
|
16
|
+
console.log("%c @antv/dumi-theme-antv %c ".concat("0.8.4", " %c"), 'background:#35495e; padding: 1px; border-radius: 3px 0 0 3px; color: #fff;', 'background:#41b883; padding: 1px; border-radius: 0 3px 3px 0; color: #fff;', 'background:transparent;');
|
|
17
17
|
}, []);
|
|
18
18
|
return outlet && /*#__PURE__*/React.createElement(QueryClientProvider, {
|
|
19
19
|
client: queryClient
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { useIntl, useSiteData } from 'dumi';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import styles from "./SearchResult.module.less";
|
|
4
|
-
import classnames from "classnames";
|
|
5
|
-
import { AIChatStore, createNewSession } from "../../../model/AIChat";
|
|
6
|
-
import { authStore, showLoginModal } from "../../../model/auth";
|
|
7
|
-
import { useSnapshot } from "valtio";
|
|
8
3
|
var getHighlightInfo = function getHighlightInfo(textSegments) {
|
|
9
4
|
return /*#__PURE__*/React.createElement(React.Fragment, null, textSegments.map(function (segment) {
|
|
10
5
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -20,52 +15,9 @@ var getHighlightInfo = function getHighlightInfo(textSegments) {
|
|
|
20
15
|
export var SearchResult = function SearchResult(_ref) {
|
|
21
16
|
var results = _ref.results,
|
|
22
17
|
keywords = _ref.keywords;
|
|
23
|
-
var _useSiteData = useSiteData(),
|
|
24
|
-
themeConfig = _useSiteData.themeConfig;
|
|
25
|
-
var intl = useIntl();
|
|
26
|
-
var authSnap = useSnapshot(authStore);
|
|
27
|
-
function pureSearch() {
|
|
28
|
-
AIChatStore.mode = 'solve';
|
|
29
|
-
createNewSession({
|
|
30
|
-
promptText: keywords,
|
|
31
|
-
mode: 'solve',
|
|
32
|
-
lib: !themeConfig.isAntVSite ? themeConfig.title : undefined,
|
|
33
|
-
jump: true,
|
|
34
|
-
lang: intl.locale === 'zh' ? 'zh' : 'en',
|
|
35
|
-
entry_point: 'SearchResult'
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
18
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
19
|
className: styles.searchResult
|
|
40
|
-
},
|
|
41
|
-
className: styles.item
|
|
42
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: styles.subject
|
|
44
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
45
|
-
src: "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original",
|
|
46
|
-
alt: "AntV"
|
|
47
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: styles.br
|
|
49
|
-
}), /*#__PURE__*/React.createElement("a", {
|
|
50
|
-
className: styles.result,
|
|
51
|
-
onClick: function onClick() {
|
|
52
|
-
if (!authSnap.isAuthenticated) {
|
|
53
|
-
showLoginModal(pureSearch);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
pureSearch();
|
|
57
|
-
}
|
|
58
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: classnames(styles.title, styles.highlighted)
|
|
60
|
-
}, keywords), /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: styles.description
|
|
62
|
-
}, intl.formatMessage({
|
|
63
|
-
id: 'ai.search.try'
|
|
64
|
-
}), "\xA0", /*#__PURE__*/React.createElement("span", {
|
|
65
|
-
className: styles.highlighted
|
|
66
|
-
}, "AI"), "\xA0", intl.formatMessage({
|
|
67
|
-
id: 'ai.search.visualization'
|
|
68
|
-
})))), results !== null && results !== void 0 && results.length ? results.map(function (r, index) {
|
|
20
|
+
}, results !== null && results !== void 0 && results.length ? results.map(function (r, index) {
|
|
69
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
70
22
|
className: styles.item,
|
|
71
23
|
key: index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/dumi-theme-antv",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "AntV website theme based on dumi2.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dumi",
|
|
@@ -20,17 +20,6 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "npm run prepare && father build",
|
|
25
|
-
"dev": "father dev",
|
|
26
|
-
"fix": "prettier ./src --write",
|
|
27
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
28
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
29
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
30
|
-
"prepare": "father link-dev-theme",
|
|
31
|
-
"prepublishOnly": "npm run build",
|
|
32
|
-
"start": "cd example && npm run dev"
|
|
33
|
-
},
|
|
34
23
|
"commitlint": {
|
|
35
24
|
"extends": [
|
|
36
25
|
"@commitlint/config-conventional"
|
|
@@ -180,9 +169,13 @@
|
|
|
180
169
|
"overrides": {
|
|
181
170
|
"@monaco-editor/loader": "1.5.0"
|
|
182
171
|
},
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
|
|
186
|
-
|
|
172
|
+
"scripts": {
|
|
173
|
+
"build": "npm run prepare && father build",
|
|
174
|
+
"dev": "father dev",
|
|
175
|
+
"fix": "prettier ./src --write",
|
|
176
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
177
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
178
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
179
|
+
"start": "cd example && npm run dev"
|
|
187
180
|
}
|
|
188
|
-
}
|
|
181
|
+
}
|