diff --git a/.dumi/hooks/useMenu.tsx b/.dumi/hooks/useMenu.tsx index dd58d4c30b..67762dfccd 100644 --- a/.dumi/hooks/useMenu.tsx +++ b/.dumi/hooks/useMenu.tsx @@ -59,7 +59,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => }, {}); const childItems = []; childItems.push( - ...childrenGroup.default.map((item) => ({ + ...(childrenGroup.default?.map((item) => ({ label: ( {before} @@ -68,7 +68,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => ), key: item.link.replace(/(-cn$)/g, ''), - })), + })) ?? []), ); Object.entries(childrenGroup).forEach(([type, children]) => { if (type !== 'default') { diff --git a/.dumi/loading.js b/.dumi/loading.js new file mode 100644 index 0000000000..efaadee1be --- /dev/null +++ b/.dumi/loading.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-restricted-exports +export { default } from './theme/common/Loading'; diff --git a/.dumi/theme/common/Color/ColorPicker.tsx b/.dumi/theme/common/Color/ColorPicker.tsx index 1147baea93..6870ca18c3 100644 --- a/.dumi/theme/common/Color/ColorPicker.tsx +++ b/.dumi/theme/common/Color/ColorPicker.tsx @@ -25,7 +25,7 @@ const ColorPicker: React.FC = (props) => { const [displayColorPicker, setDisplayColorPicker] = useState(false); const handleClick = () => { - setDisplayColorPicker(displayColorPicker); + setDisplayColorPicker((prev) => !prev); }; const handleClose = () => { diff --git a/.dumi/theme/layouts/GlobalLayout.tsx b/.dumi/theme/layouts/GlobalLayout.tsx index 035287fee8..8e98e14737 100644 --- a/.dumi/theme/layouts/GlobalLayout.tsx +++ b/.dumi/theme/layouts/GlobalLayout.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo } from 'react'; +import React, { startTransition, useCallback, useEffect, useMemo } from 'react'; import { createSearchParams, useOutlet, useSearchParams } from 'dumi'; import { ConfigProvider, theme as antdTheme } from 'antd'; import { createCache, StyleProvider } from '@ant-design/cssinjs'; @@ -78,10 +78,13 @@ const GlobalLayout: React.FC = () => { useEffect(() => { const _theme = searchParams.getAll('theme') as ThemeName[]; const _direction = searchParams.get('direction') as DirectionType; - setSiteState({ theme: _theme, direction: _direction === 'rtl' ? 'rtl' : 'ltr' }); - // Handle isMobile - updateMobileMode(); + startTransition(() => { + setSiteState({ theme: _theme, direction: _direction === 'rtl' ? 'rtl' : 'ltr' }); + // Handle isMobile + updateMobileMode(); + }); + window.addEventListener('resize', updateMobileMode); return () => { window.removeEventListener('resize', updateMobileMode); diff --git a/docs/spec/data-list.en-US.md b/docs/spec/data-list.en-US.md index f785a30510..3db6ff3615 100644 --- a/docs/spec/data-list.en-US.md +++ b/docs/spec/data-list.en-US.md @@ -1,9 +1,9 @@ --- -group: 设计模式 -type: 全局规则 +group: Design Patterns +type: Global Rules order: 7 skip: true -title: 数据列表 +title: Data List --- ## 设计目标 diff --git a/loading.js b/loading.js deleted file mode 100644 index 495dbfe200..0000000000 --- a/loading.js +++ /dev/null @@ -1,3 +0,0 @@ -// put it into `.dumi` folder when dumi ready -// eslint-disable-next-line no-restricted-exports -export { default } from './.dumi/theme/common/Loading'; diff --git a/package.json b/package.json index d0daade93b..de0a78d4cb 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,7 @@ "cheerio": "1.0.0-rc.12", "cross-env": "^7.0.0", "dekko": "^0.2.1", - "dumi": "^2.0.2", + "dumi": "^2.0.17", "duplicate-package-checker-webpack-plugin": "^3.0.0", "esbuild-loader": "^2.13.1", "eslint": "^8.0.0",