diff --git a/config/webpack.js b/config/webpack.js index 6f86f3ade2..6a6f79b321 100644 --- a/config/webpack.js +++ b/config/webpack.js @@ -124,10 +124,6 @@ const getWebpackConfig = (name, library) => { }, ], }, - { - test: /\.png$/, - type: 'asset/inline', - }, ], }, plugins: [ diff --git a/package.json b/package.json index 0b22befefd..ca0a3a4794 100644 --- a/package.json +++ b/package.json @@ -18,55 +18,55 @@ "release:beta": "pnpm run before:release && pnpm publish --tag beta --no-git-checks -r --filter @ant-design/*" }, "devDependencies": { - "@babel/core": "^7.11.6", + "@babel/core": "^7.25.2", "@babel/polyfill": "^7.12.1", - "@babel/preset-env": "^7.13.9", - "@babel/preset-typescript": "^7.10.4", - "@changesets/cli": "^2.26.2", - "@swc/jest": "^0.2.23", - "@testing-library/jest-dom": "^5.5.0", + "@babel/preset-env": "^7.25.4", + "@babel/preset-typescript": "^7.24.7", + "@changesets/cli": "^2.27.8", + "@swc/jest": "^0.2.36", + "@testing-library/jest-dom": "^5.17.0", "@testing-library/react-hooks": "^7.0.2", - "@types/enzyme": "^3.10.5", - "@types/node": "^14.0.10", - "@types/webpack-env": "^1.14.1", - "@umijs/fabric": "^2.0.7", - "babel-loader": "^8.2.3", - "babel-plugin-named-asset-import": "^0.3.7", + "@types/enzyme": "^3.10.18", + "@types/node": "^14.18.63", + "@types/webpack-env": "^1.18.5", + "@umijs/fabric": "^2.14.1", + "babel-loader": "^8.4.1", + "babel-plugin-named-asset-import": "^0.3.8", "babel-polyfill": "^6.26.0", - "babel-preset-react-app": "^10.0.0", + "babel-preset-react-app": "^10.0.1", "babel-types": "^6.26.0", - "chalk": "^4.1.0", + "chalk": "^4.1.2", "cross-env": "^7.0.3", - "css-loader": "^6.4.0", - "ejs": "^3.0.2", + "css-loader": "^6.11.0", + "ejs": "^3.1.10", "enzyme": "^3.11.0", - "enzyme-to-json": "^3.4.4", + "enzyme-to-json": "^3.6.2", "eslint": "^7.32.0", "identity-obj-proxy": "^3.0.0", - "jest": "^26.0.1", - "jest-canvas-mock": "^2.4.0", + "jest": "^26.6.3", + "jest-canvas-mock": "^2.5.2", "jest-electron": "^0.1.12", - "jest-extended": "^1.2.0", + "jest-extended": "^1.2.1", "jest-less-loader": "^0.1.2", - "less": "^4.1.2", - "less-loader": "^10.1.0", - "np": "*", + "less": "^4.2.0", + "less-loader": "^10.2.0", + "np": "^10.0.7", "npm-run-all": "^4.1.5", - "prettier": "^2.8.7", - "prettier-plugin-organize-imports": "^4.0.0", + "prettier": "^2.8.8", + "prettier-plugin-organize-imports": "^4.1.0", "prettier-plugin-packagejson": "^2.5.2", - "pretty-quick": "^3.0.1", + "pretty-quick": "^3.3.1", "react-dev-utils": "^12.0.1", "rimraf": "^3.0.2", - "style-loader": "^3.3.0", + "style-loader": "^3.3.4", "ts-loader": "^9.5.1", - "typescript": "^5", - "vfile-reporter": "^7.0.2", + "typescript": "^5.6.2", + "vfile-reporter": "^7.0.5", "webpack": "^5.94.0", - "webpack-bundle-analyzer": "^4.5.0", + "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^5.1.4", "webpack-dev-server": "^5.1.0", - "whatwg-fetch": "^3.0.0", + "whatwg-fetch": "^3.6.20", "yorkie": "^2.0.0" }, "pnpm": { @@ -87,9 +87,9 @@ "conventional-changelog-cli": "^5.0.0", "less-plugin-npm-import": "^2.1.0", "remark-frontmatter": "^4.0.1", - "remark-parse": "^10.0.1", - "remark-stringify": "^10.0.2", - "to-vfile": "^7.2.3", + "remark-parse": "^10.0.2", + "remark-stringify": "^10.0.3", + "to-vfile": "^7.2.4", "unified": "^10.1.2" } } diff --git a/packages/graphs/package.json b/packages/graphs/package.json index 51a489baea..aba61dc932 100644 --- a/packages/graphs/package.json +++ b/packages/graphs/package.json @@ -1,6 +1,6 @@ { "name": "@ant-design/graphs", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.2", "description": "A React graph library based on Graphin", "keywords": [ "antv", @@ -44,7 +44,8 @@ "prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", "profile": "webpack --config webpack.config.js --mode production --profile --json > stats.json", "start": "npm run build:esm --w", - "test": "jest" + "test": "jest", + "prepublishOnly": "pnpm run build" }, "dependencies": { "@ant-design/charts-util": "workspace:*", @@ -60,6 +61,7 @@ "@types/lodash": "^4.17.7", "antd": "^5.20.5", "react-router-dom": "^6.26.1", + "tsconfig-paths-webpack-plugin": "^4.1.0", "vite": "^5.4.3" }, "peerDependencies": { diff --git a/packages/graphs/src/assets/arrow.png b/packages/graphs/src/assets/arrow.png deleted file mode 100644 index a22ccf777f..0000000000 Binary files a/packages/graphs/src/assets/arrow.png and /dev/null differ diff --git a/packages/graphs/src/core/base/collapse-expand-icon/arrow-count-icon.tsx b/packages/graphs/src/core/base/collapse-expand-icon/arrow-count-icon.tsx index f4580ab48b..97352dcbdd 100644 --- a/packages/graphs/src/core/base/collapse-expand-icon/arrow-count-icon.tsx +++ b/packages/graphs/src/core/base/collapse-expand-icon/arrow-count-icon.tsx @@ -1,7 +1,6 @@ import type { Graph, NodeData } from '@antv/g6'; import React, { FC } from 'react'; import styled from 'styled-components'; -import arrow from '../../../assets/arrow.png'; interface ArrowCountIconProps extends Pick, 'className' | 'style'> { /** @@ -53,15 +52,15 @@ const StyledWrapper = styled.div<{ } .indented-icon-circle { - height: 16px; width: 16px; - border-radius: 50%; - background-color: ${({ $color }) => $color}; + height: 16px; color: #fff; font-weight: 600; font-size: 10px; line-height: ${({ $isCollapsed }) => ($isCollapsed ? '16px' : '14px')}; text-align: center; + background-color: ${({ $color }) => $color}; + border-radius: 50%; } .indented-icon-circle-arrow { @@ -99,7 +98,21 @@ export const ArrowCountIcon: FC = (props) => {
- {isCollapsed ? count : icon} + {isCollapsed ? ( + count + ) : ( +
+ + + +
+ )}
); diff --git a/packages/graphs/tsconfig.prod.json b/packages/graphs/tsconfig.prod.json index 77d9ec86cd..b13549284e 100644 --- a/packages/graphs/tsconfig.prod.json +++ b/packages/graphs/tsconfig.prod.json @@ -2,7 +2,7 @@ "compilerOptions": { "baseUrl": "." }, - "include": ["src", "typing.d.ts"], + "include": ["src/**/*", "typing.d.ts"], "exclude": ["tests", "node_modules"], "extends": "../../tsconfig.json" } diff --git a/packages/graphs/webpack.config.js b/packages/graphs/webpack.config.js index 691af96c11..f235747adb 100644 --- a/packages/graphs/webpack.config.js +++ b/packages/graphs/webpack.config.js @@ -1,3 +1,13 @@ const { getWebpackConfig } = require('../../config/webpack'); +const path = require('path'); +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); -module.exports = getWebpackConfig('graphs', 'Graphs'); +const config = getWebpackConfig('graphs', 'Graphs'); + +config.resolve.plugins = [ + new TsconfigPathsPlugin({ + configFile: path.resolve(__dirname, 'tsconfig.prod.json'), + }), +]; + +module.exports = config; diff --git a/packages/util/package.json b/packages/util/package.json index 3816e3f81e..33a8680561 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -33,7 +33,8 @@ "lint:prettier": "pnpm run prettier && git diff && prettier --version && prettier --check \"src/**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto", "prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"", "test": "jest", - "test:live": "DEBUG_MODE=1 jest --watch ./tests/utils/use-chart.test.tsx --no-cache" + "test:live": "DEBUG_MODE=1 jest --watch ./tests/utils/use-chart.test.tsx --no-cache", + "prepublishOnly": "pnpm run build" }, "peerDependencies": { "react": ">=16.8.4", @@ -47,5 +48,9 @@ }, "dependencies": { "lodash": "^4.17.21" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" } } diff --git a/site/examples/relations/dendrogram/API.en.md b/site/examples/relations/dendrogram/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/dendrogram/API.zh.md b/site/examples/relations/dendrogram/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/flow-direction-graph/API.en.md b/site/examples/relations/flow-direction-graph/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/flow-direction-graph/API.zh.md b/site/examples/relations/flow-direction-graph/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/flow-graph/API.en.md b/site/examples/relations/flow-graph/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/flow-graph/API.zh.md b/site/examples/relations/flow-graph/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/indented-tree/API.en.md b/site/examples/relations/indented-tree/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/indented-tree/API.zh.md b/site/examples/relations/indented-tree/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/mind-map/API.en.md b/site/examples/relations/mind-map/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/mind-map/API.zh.md b/site/examples/relations/mind-map/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/network-graph/API.en.md b/site/examples/relations/network-graph/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/network-graph/API.zh.md b/site/examples/relations/network-graph/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/organization-chart/API.en.md b/site/examples/relations/organization-chart/API.en.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/examples/relations/organization-chart/API.zh.md b/site/examples/relations/organization-chart/API.zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/site/package.json b/site/package.json index 6375dae32f..2cb1697769 100644 --- a/site/package.json +++ b/site/package.json @@ -29,24 +29,24 @@ }, "devDependencies": { "@antv/dumi-theme-antv": "^0.5.2", - "@types/react": "^16.14.8", - "@types/react-dom": "^16.9.13", + "@types/react": "^16.14.61", + "@types/react-dom": "^16.9.24", "d3-interpolate": "^3.0.1", "d3-regression": "^1.3.10", - "dumi": "^2.1.14", + "dumi": "^2.4.10", "fecha": "^4.2.3", - "gh-pages": "^2.1.1", - "typedoc": "^0.17.6", - "typedoc-plugin-markdown": "^2.2.11" + "gh-pages": "^2.2.0", + "typedoc": "^0.17.8", + "typedoc-plugin-markdown": "^2.4.2" }, "dependencies": { "@ant-design/graphs": "workspace:*", "@ant-design/plots": "workspace:*", - "antd": "^4.16.13", + "antd": "^4.24.16", "insert-css": "^2.0.0", "lodash": "^4.17.21", - "rc-util": "^5.39.1", - "react": "^16.14.0", - "react-dom": "^16.14.0" + "rc-util": "^5.43.0", + "react": "^18.3.1", + "react-dom": "^18.3.1" } }