Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/x-card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"prestart": "echo \"true\" && exit 0",
"pretest": "echo \"true\" && exit 0",
"precompile": "echo \"true\" && exit 0",
"lint:deps": "antd-tools run deps-lint",
"lint:md": "remark . -f -q",
"lint:script": "biome lint",
"test": "jest --config .jest.js --no-cache --collect-coverage",
Expand All @@ -35,7 +34,6 @@
"react-dom": "^19.0.0"
},
"peerDependencies": {
"antd": "^5.20.3",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
Expand Down
2 changes: 0 additions & 2 deletions packages/x-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"compile": "father build",
"tsc": "tsc --noEmit",
"lint": "npm run tsc && npm run lint:script && npm run lint:md",
"lint:deps": "antd-tools run deps-lint",
"precompile": "echo \"true\" && exit 0",
"lint:md": "remark . -f -q",
"lint:script": "biome lint",
Expand Down Expand Up @@ -35,7 +34,6 @@
"react-dom": "^19.0.0"
},
"peerDependencies": {
"antd": "^5.20.3",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
Expand Down
2 changes: 0 additions & 2 deletions packages/x-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"compile": "father build",
"tsc": "tsc --noEmit",
"lint": "npm run tsc && npm run lint:script && npm run lint:md",
"lint:deps": "antd-tools run deps-lint",
"lint:md": "remark . -f -q",
"prestart": "echo \"true\" && exit 0",
"pretest": "echo \"true\" && exit 0",
Expand Down Expand Up @@ -34,7 +33,6 @@
"react-dom": "^19.0.0"
},
"peerDependencies": {
"antd": "^5.20.3",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
Expand Down
3 changes: 0 additions & 3 deletions packages/x/.dumi/pages/theme-editor-cn/index.ts

This file was deleted.

94 changes: 0 additions & 94 deletions packages/x/.dumi/pages/theme-editor/index.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions packages/x/.dumi/theme/SiteThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigProvider, theme as antdTheme } from 'antd';
import type { ThemeConfig } from 'antd';
import { theme as antdTheme, ConfigProvider } from 'antd';
import type { ThemeConfig } from 'antd/es/config-provider';
import type { ThemeProviderProps } from 'antd-style';
import { ThemeProvider } from 'antd-style';
import React, { useContext } from 'react';
Expand Down
4 changes: 2 additions & 2 deletions packages/x/.dumi/theme/builtins/DemoWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BugOutlined, CodeOutlined, ExperimentOutlined } from '@ant-design/icons';
import { XProvider } from '@ant-design/x';
import { Global, css } from '@emotion/react';
import { css, Global } from '@emotion/react';
import { Button, Tooltip } from 'antd';
import { DumiDemo, DumiDemoGrid, FormattedMessage } from 'dumi';
import React, { Suspense } from 'react';
Expand Down Expand Up @@ -112,7 +112,7 @@ const DemoWrapper: typeof DumiDemoGrid = ({ items }) => {
/>
</Tooltip>
</span>
<XProvider theme={{ cssVar: enableCssVar, hashed: !enableCssVar }}>
<XProvider theme={{ hashed: !enableCssVar }}>
<DumiDemoGrid
items={demos}
demoRender={(item) => (
Expand Down
18 changes: 0 additions & 18 deletions packages/x/.dumi/theme/common/PeterCat.tsx

This file was deleted.

27 changes: 8 additions & 19 deletions packages/x/.dumi/theme/layouts/GlobalLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import {
NaNLinter,
StyleProvider,
createCache,
extractStyle,
legacyNotSelectorLinter,
NaNLinter,
parentSelectorLinter,
StyleProvider,
} from '@ant-design/cssinjs';
import { getSandpackCssText } from '@codesandbox/sandpack-react';
import { App, theme as antdTheme } from 'antd';
import { createSearchParams, useOutlet, useSearchParams, useServerInsertedHTML } from 'dumi';
import React, { useCallback, useEffect, Suspense } from 'react';

import type { MappingAlgorithm } from 'antd';
import { App, theme as antdTheme } from 'antd';
import type { DirectionType, ThemeConfig } from 'antd/es/config-provider';
import { createSearchParams, useOutlet, useSearchParams, useServerInsertedHTML } from 'dumi';
import React, { useCallback, useEffect } from 'react';

import { DarkContext } from '../../hooks/useDark';
import useLayoutState from '../../hooks/useLayoutState';
import useLocation from '../../hooks/useLocation';
import SiteThemeProvider from '../SiteThemeProvider';
import PeterCat from '../common/PeterCat';
import type { ThemeName } from '../common/ThemeSwitch';
import SiteThemeProvider from '../SiteThemeProvider';
import type { SiteContextProps } from '../slots/SiteContext';
import SiteContext from '../slots/SiteContext';

Expand All @@ -31,11 +29,6 @@ type SiteState = Partial<Omit<SiteContextProps, 'updateSiteContext'>>;
const RESPONSIVE_MOBILE = 768;
export const ANT_DESIGN_NOT_SHOW_BANNER = 'ANT_DESIGN_NOT_SHOW_BANNER';

// const styleCache = createCache();
// if (typeof global !== 'undefined') {
// (global as any).styleCache = styleCache;
// }

const getAlgorithm = (themes: ThemeName[] = []) =>
themes
.map((theme) => {
Expand Down Expand Up @@ -150,10 +143,9 @@ const GlobalLayout: React.FC = () => {
// index page should always use dark theme
algorithm: isIndexPage ? getAlgorithm(['dark']) : getAlgorithm(theme),
token: { motion: !theme.includes('motion-off') },
cssVar: true,
hashed: false,
}),
[theme, pathname],
[theme, pathname, isIndexPage],
);

const [styleCache] = React.useState(() => createCache());
Expand Down Expand Up @@ -200,10 +192,7 @@ const GlobalLayout: React.FC = () => {
>
<SiteContext value={siteContextValue}>
<SiteThemeProvider theme={themeConfig}>
<App>
{outlet}
<Suspense>{pathname.startsWith('/~demos') ? <PeterCat /> : null}</Suspense>
</App>
<App>{outlet}</App>
</SiteThemeProvider>
</SiteContext>
</StyleProvider>
Expand Down
6 changes: 3 additions & 3 deletions packages/x/.dumi/theme/slots/Header/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import * as utils from '../../utils';
import { getThemeConfig } from '../../utils';
import type { SiteContextProps } from '../SiteContext';
import SiteContext from '../SiteContext';
import SwitchBtn from './SwitchBtn';
import type { SharedProps } from './interface';
import SwitchBtn from './SwitchBtn';

const useStyle = createStyles(({ css, token }) => {
return {
Expand Down Expand Up @@ -112,13 +112,13 @@ const HeaderActions: React.FC<HeaderActionsProps> = (props) => {
variant="borderless"
defaultValue={pkg.version}
onChange={handleVersionChange}
popupMatchSelectWidth={false}
options={versionOptions}
styles={{
popup: {
root: getDropdownStyle,
},
}}
popupMatchSelectWidth={false}
options={versionOptions}
/>
</Button>,
<SwitchBtn
Expand Down
4 changes: 2 additions & 2 deletions packages/x/components/actions/ActionMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EllipsisOutlined } from '@ant-design/icons';
import { Dropdown, MenuProps } from 'antd';
import React from 'react';
import { ActionsProps } from '.';
import { useXProviderContext } from '../x-provider';
import { ActionsProps } from '.';
import { ActionItem, ItemType } from './interface';

export const findItem = (keyPath: string[], items: ActionItem[]): ActionItem | null => {
Expand Down Expand Up @@ -49,7 +49,7 @@ const ActionMenu = (props: { item: ItemType } & Pick<ActionsProps, 'prefixCls' |
return (
<Dropdown
menu={menuProps}
overlayClassName={`${prefixCls}-sub-item`}
classNames={{ root: `${prefixCls}-sub-item` }}
arrow
trigger={[triggerSubMenuAction]}
>
Expand Down
Loading
Loading