diff --git a/.dumi/pages/case/index.tsx b/.dumi/pages/case/index.tsx
index a53aaebf4..fa5daeb98 100644
--- a/.dumi/pages/case/index.tsx
+++ b/.dumi/pages/case/index.tsx
@@ -1,19 +1,22 @@
import React from 'react';
-import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
+import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
import ShowCase from 'site/components/ShowCase/ShowCase';
-import { useIntl, useLocale } from 'dumi'
-import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'
-import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'
+import { useIntl, useLocale } from 'dumi';
+import { Header } from '@antv/dumi-theme-antv/dist/slots/Header';
+import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer';
const CaseIndex: React.FC = () => {
- const locale = useLocale()
- const intl = useIntl()
+ const locale = useLocale();
+ const intl = useIntl();
return (
<>
-
+
diff --git a/.dumi/pages/quick/index.tsx b/.dumi/pages/quick/index.tsx
index cd6cfae6f..4b5f38eba 100644
--- a/.dumi/pages/quick/index.tsx
+++ b/.dumi/pages/quick/index.tsx
@@ -1,22 +1,24 @@
import React from 'react';
-import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
-import { useIntl, useLocale } from 'dumi'
-import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'
-import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'
+import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
+import { useIntl, useLocale } from 'dumi';
+import { Header } from '@antv/dumi-theme-antv/dist/slots/Header';
+import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer';
import QuickIssue from 'site/components/quickIssue/QuickIssue';
-
const QuickIssueIndex: React.FC = () => {
- const locale = useLocale()
- const intl = useIntl()
+ const locale = useLocale();
+ const intl = useIntl();
return (
<>
-
+
-
+
>
diff --git a/.dumi/theme/slots/Detail/index.tsx b/.dumi/theme/slots/Detail/index.tsx
index 482eb7ec1..6ea1da294 100644
--- a/.dumi/theme/slots/Detail/index.tsx
+++ b/.dumi/theme/slots/Detail/index.tsx
@@ -1,20 +1,13 @@
-import { debounce } from 'lodash';
+import SEO from '@antv/dumi-theme-antv/dist/common/SEO';
import { useIntl, useLocale } from 'dumi';
+import { debounce } from 'lodash';
+import React, { useEffect, useRef } from 'react';
import Banner from 'site/components/Banner/Banner';
+import { ComplexCharts } from 'site/components/ComplexCharts';
+import { FamousPersons } from 'site/components/FamousPersons';
import { LinkCharts } from 'site/components/LinkCharts';
-import { ThemeCharts } from 'site/components/ThemeCharts';
import { ProjectCard } from 'site/components/ProjectCard';
-import { SEO } from '@antv/dumi-theme-antv/dist/slots/SEO';
-import React, { useEffect, useState, useRef } from 'react';
-import { FamousPersons } from 'site/components/FamousPersons';
-import { ComplexCharts } from 'site/components/ComplexCharts';
-interface NotificationProps {
- index?: number;
- type: string;
- title: string;
- date: string;
- link: string;
-}
+import { ThemeCharts } from 'site/components/ThemeCharts';
export const Detail: React.FC = () => {
const locale = useLocale();
@@ -23,19 +16,9 @@ export const Detail: React.FC = () => {
const useT = (transformedMessage: string) => {
return intl.formatMessage({
- id: transformedMessage
- })
- }
- const notificationsUrl = `https://my-json-server.typicode.com/antvis/antvis-sites-data/notifications?lang=${locale.id}`;
- const [remoteNews, setRemoteNews] = useState([]);
- useEffect(() => {
- fetch(notificationsUrl)
- .then((res) => res.json())
- .then((data) => {
- // 根据设计,目前只取最新的两条
- setRemoteNews(data.slice(0, 2));
- });
- }, [notificationsUrl]);
+ id: transformedMessage,
+ });
+ };
useEffect(() => {
const onResize = debounce(() => {
@@ -49,11 +32,17 @@ export const Detail: React.FC = () => {
return () => {
window.removeEventListener('resize', onResize);
- }
+ };
}, []);
return (
-
+
{
)}
lang={locale.id}
/>
-
+
-
+
@@ -76,6 +62,5 @@ export const Detail: React.FC = () => {
- )
-}
-
+ );
+};
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 000000000..c4c9ecde4
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,24 @@
+name: build
+
+on:
+ push:
+
+jobs:
+ ci:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 20
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Type Check
+ run: npm run type-check
+
+ - name: Build
+ run: npm run build
\ No newline at end of file
diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml
deleted file mode 100644
index 1cebdc505..000000000
--- a/.github/workflows/mirror.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: 🤖 Sync to Gitee Mirror
-
-on: [push]
-
-jobs:
- build:
- runs-on: ubuntu-latest
- steps:
- - name: 🔁 Sync to Gitee
- uses: wearerequired/git-mirror-action@master
- env:
- # 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY
- SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
- with:
- # 注意替换为你的 GitHub 源仓库地址
- source-repo: 'git@github.com:antvis/antvis.github.io.git'
- # 注意替换为你的 Gitee 目标仓库地址
- destination-repo: 'git@gitee.com:antv/antv.git'
-
- - name: ✅ Build Gitee Pages
- uses: yanglbme/gitee-pages-action@master
- with:
- # 注意替换为你的 Gitee 用户名
- gitee-username: afc163
- # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
- gitee-password: ${{ secrets.GITEE_PASSWORD }}
- # 注意替换为你的 Gitee 仓库
- gitee-repo: antv/antv
- # 要部署的分支
- branch: master
diff --git a/README.md b/README.md
index 0d19e57c3..14e070233 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
# AntV New Site 📈
-New AntV site built on [@antv/gatsby-theme-antv](https://github.com/antvis/gatsby-theme-antv).
+New AntV site built on [@antv/dumi-theme-antv](https://github.com/antvis/dumi-theme-antv).
- [](https://david-dm.org/antvis/antvis.github.io) [](https://david-dm.org/antvis/antvis.github.io?type=dev) 
+
## Install & Preview
diff --git a/package.json b/package.json
index 43f1e6af1..dc7575678 100644
--- a/package.json
+++ b/package.json
@@ -18,12 +18,10 @@
"url": "https://github.com/antvis/antvis.github.io/issues"
},
"dependencies": {
- "@ant-design/icons": "^4.7.0",
+ "@ant-design/icons": "^4.8.3",
"@antv/dumi-theme-antv": "^0.5.2",
"@antv/g2plot": "^2.3.1",
"@antv/g6": "3.3.7",
- "@antv/knowledge": "^0.1.3-alpha.17",
- "@antv/matrix-util": "2.0.7",
"@antv/util": "^3.3.1",
"antd": "5.10.2",
"chroma-js": "^2.1.0",
@@ -36,9 +34,9 @@
"new-github-issue-url": "^1.0.0",
"prettier": "^2.0.0",
"pretty-quick": "^3.1.3",
- "react": "^18.2.0",
- "react-github-btn": "^1.4.0",
- "react-use": "^17.4.0"
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-github-btn": "^1.4.0"
},
"devDependencies": {
"@types/classnames": "^2.2.9",
@@ -46,11 +44,8 @@
"@types/lodash": "^4.14.189",
"@types/parse-github-url": "^1.0.0",
"@types/react": "^16.9.5",
- "@types/react-dom": "^16.9.1",
"@types/react-github-button": "^0.1.0",
- "@types/react-helmet": "^6.0.0",
- "i": "^0.3.7",
- "npm": "^9.1.2"
+ "@types/react-helmet": "^6.0.0"
},
"license": "MIT",
"scripts": {
@@ -63,7 +58,8 @@
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,less}\"",
"pretty-quick": "pretty-quick",
"tsc": "tsc",
- "serve": "dumi preview"
+ "serve": "dumi preview",
+ "type-check": "tsc --noEmit"
},
"husky": {
"hooks": {
diff --git a/site/components/common/OverflowedText/index.tsx b/site/components/common/OverflowedText/index.tsx
index 331115471..87a9d3355 100644
--- a/site/components/common/OverflowedText/index.tsx
+++ b/site/components/common/OverflowedText/index.tsx
@@ -1,5 +1,4 @@
import cx from 'classnames';
-import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { Tooltip, ConfigProvider } from 'antd';
import { isNumber, isString, toNumber, omit } from 'lodash';
@@ -12,32 +11,26 @@ type Props = {
maxWidth: string | number;
maxHeight?: string | number;
style?: Record;
-}
+};
const getPixel = (value: string | number) => {
if (isNumber(value)) return `${value}px`;
return value;
-}
+};
const getNumber = (value: string | number) => {
if (isString(value)) return toNumber(value.replace(/[^0-9]+/, ''));
return value;
-}
+};
// 自动省略并提示组件
export class OverflowedText extends PureComponent {
- static propTypes = {
- className: PropTypes.string,
- text: PropTypes.string,
- maxWidth: PropTypes.string,
- };
-
static defaultProps = {
className: '',
text: 'overflowed text',
maxWidth: '100px',
style: {},
- }
+ };
state = {
isOverflow: false,
@@ -60,16 +53,34 @@ export class OverflowedText extends PureComponent {
this.$text = node;
if (!node) return;
const { maxHeight } = this.props;
- this.setState({ isOverflow: maxHeight ? node.scrollHeight > node.offsetHeight : node.scrollWidth > node.offsetWidth });
+ this.setState({
+ isOverflow: maxHeight
+ ? node.scrollHeight > node.offsetHeight
+ : node.scrollWidth > node.offsetWidth,
+ });
};
render() {
const { text, className, maxWidth, maxHeight, style = {} } = this.props;
const { fontSize, lineHeight } = style;
- const props = omit(this.props, ['className', 'text', 'maxWidth', 'maxHeight', 'style', 'width']);
- const cls = cx('component-overflowed-text', className, maxHeight && 'max-height-text');
+ const props = omit(this.props, [
+ 'className',
+ 'text',
+ 'maxWidth',
+ 'maxHeight',
+ 'style',
+ 'width',
+ ]);
+ const cls = cx(
+ 'component-overflowed-text',
+ className,
+ maxHeight && 'max-height-text',
+ );
- let textStyle: Record = { maxWidth: getPixel(maxWidth), ...style };
+ let textStyle: Record = {
+ maxWidth: getPixel(maxWidth),
+ ...style,
+ };
// 最大高度 转化为 行数, 需要 fontSize, lineHeight 属性
if (maxHeight && fontSize && lineHeight) {
const lineHeightSize = getNumber(fontSize) * lineHeight;
@@ -78,20 +89,29 @@ export class OverflowedText extends PureComponent {
maxWidth: 'none',
display: '-webkit-box',
'-webkitBoxOrient': 'vertical',
- '-webkitLineClamp': (Math.max(getNumber(maxHeight), lineHeightSize) / lineHeightSize).toFixed(0),
+ '-webkitLineClamp': (
+ Math.max(getNumber(maxHeight), lineHeightSize) / lineHeightSize
+ ).toFixed(0),
};
}
- return
- {this.state.isOverflow ? (
-
-
- {text}
-
-
- ) : (
- text
- )}
-
+ return (
+
+ {this.state.isOverflow ? (
+
+
+ {text}
+
+
+ ) : (
+ text
+ )}
+
+ );
}
}
diff --git a/site/data/complex-charts.json b/site/data/complex-charts.json
index 5fd9280eb..b7c89b611 100644
--- a/site/data/complex-charts.json
+++ b/site/data/complex-charts.json
@@ -2,14 +2,14 @@
{
"text": "3D大图",
"video": "https://gw.alipayobjects.com/v/huamei_qa8qxu/afts/video/wg8jTrLg-3EAAAAAAAAAAAAAK4eUAQBr",
- "link": "https://g6-next.antv.antgroup.com/examples/feature/features#webgl3d",
+ "link": "https://g6.antv.antgroup.com/examples/feature/default/#3d-massive",
"img": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*RFK7R4TWuWQAAAAAAAAAAAAADmJ7AQ/original",
"activeImg": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*NYQ-SLUYDpMAAAAAAAAAAAAADmJ7AQ/original"
},
{
"text": "超强性能",
"video": "https://gw.alipayobjects.com/v/huamei_qa8qxu/afts/video/l9viS4v0-fgAAAAAAAAAAAAAK4eUAQBr",
- "link": "https://g6-next.antv.antgroup.com/examples/feature/features/#rendererSwitch",
+ "link": "https://g6.antv.antgroup.com/zh/examples/performance/massive-data/#20000",
"img": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*EZ7OTLICg8MAAAAAAAAAAAAADmJ7AQ/original",
"activeImg": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*2_soSbk9R-gAAAAAAAAAAAAADmJ7AQ/original"
},
diff --git a/site/data/link-charts.json b/site/data/link-charts.json
index 4664326bd..9a4a999ff 100644
--- a/site/data/link-charts.json
+++ b/site/data/link-charts.json
@@ -10,8 +10,8 @@
{
"title": "关系图",
"subTitle": "便捷的关系数据可视化引擎与图分析工具",
- "image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Ku9aQ4WJtsQAAAAAAAAAAAAADmJ7AQ/original",
- "link": "https://g6-next.antv.antgroup.com/examples/net/forceDirected#basicForce",
+ "image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7Ca9SZkhRJsAAAAAAAAAAAAADmJ7AQ/original",
+ "link": "https://g6.antv.antgroup.com/examples/layout/force-directed/#d3-force",
"antv": "G6",
"color": "rgba(249,106,65)"
},
@@ -26,8 +26,8 @@
{
"title": "关系图",
"subTitle": "便捷的关系数据可视化引擎与图分析工具",
- "image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_JGLQZl-PcQAAAAAAAAAAAAADmJ7AQ/original",
- "link": "https://g6.antv.antgroup.com/examples/case/graphDemos#decisionBubbles",
+ "image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ug4vTJA7QbMAAAAAAAAAAAAADmJ7AQ/original",
+ "link": "https://g6.antv.antgroup.com/examples/scene-case/default/#why-do-cats",
"antv": "G6",
"color": "rgba(249,106,65)"
},
@@ -75,7 +75,7 @@
"title": "树形图表",
"subTitle": "便捷的关系数据可视化引擎与图分析工具",
"image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*cEgmQov_Kf0AAAAAAAAAAAAADmJ7AQ/original",
- "link": "https://g6.antv.antgroup.com/examples/case/treeDemos/#decisionTree",
+ "link": "https://g6.antv.antgroup.com/examples/scene-case/default/#fund-flow",
"antv": "G6",
"color": "rgba(249,106,65)"
},
diff --git a/tsconfig.json b/tsconfig.json
index a6a98cbf1..0e1ec37b4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,16 +1,20 @@
{
- "include": ["site", ".dumi/theme/slots/components"],
+ "include": ["site", ".dumi/theme", ".dumi/pages", "./typing.d.ts"],
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"lib": ["dom", "es2017"],
"jsx": "react",
- "strict": true,
+ "strict": false,
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmit": true,
"resolveJsonModule": true,
- "skipLibCheck": true
+ "skipLibCheck": true,
+ "baseUrl": ".",
+ "paths": {
+ "site/*": ["./site/*"]
+ }
}
}
diff --git a/typing.d.ts b/typing.d.ts
new file mode 100644
index 000000000..2537adaaa
--- /dev/null
+++ b/typing.d.ts
@@ -0,0 +1,24 @@
+declare module '@antv/dumi-theme-antv' {
+ const exports: any;
+ export = exports;
+}
+
+declare module '@antv/dumi-theme-antv/*' {
+ const exports: {
+ useChinaMirrorHost: any;
+ Header: any;
+ Footer: any;
+ [key: string]: any;
+ };
+ export = exports;
+}
+
+declare module '@antv/dumi-theme-antv/dist/common/SEO' {
+ const SEO: any;
+ export default SEO;
+}
+
+declare module '@antv/dumi-theme-antv/dist/slots/Article' {
+ const Article: any;
+ export default Article;
+}