Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: feature merge master #38851

Merged
merged 60 commits into from Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
598b522
docs: remove ie (#38681)
yoyo837 Nov 18, 2022
4ab8693
docs: fix gfm
MadCcc Nov 18, 2022
e399a96
docs: update config-provider theme demo
MadCcc Nov 18, 2022
c47b4e5
fix(dumi): update dumi theme (#38684)
LuciNyan Nov 18, 2022
4f3b257
docs: tweak home banner height (#38688)
afc163 Nov 18, 2022
9dc33bd
chore: set default value for style (#38689)
li-jia-nan Nov 18, 2022
b0961b9
Update index.tsx (#38690)
fyzhu Nov 18, 2022
fa7da01
docs: update introduce.md
afc163 Nov 18, 2022
def5960
docs: fix edit button position (#38696)
afc163 Nov 18, 2022
a552a5e
type: fix type (#38697)
li-jia-nan Nov 18, 2022
c39e122
chore: type optimization (#38698)
li-jia-nan Nov 18, 2022
421c60f
docs: fix typo in use-custom-date-library.en-US.md (#38710)
nicolabosco87 Nov 18, 2022
c5fe4ca
docs: improve home page text (#38705)
afc163 Nov 18, 2022
c53f48b
chore: update workflow for 4.x-stable branch (#38706)
afc163 Nov 18, 2022
e601663
docs: update changelog
afc163 Nov 18, 2022
c2fb6f4
chore: fix lgtm errors (#38711)
afc163 Nov 18, 2022
7cfe13f
docs: fix customize theme doc url (#38703)
afc163 Nov 18, 2022
52d2b41
chore: Update message hooks demo (#38707)
hms181231 Nov 18, 2022
a8fc788
fix(dumi): get contributor error on 404 page (#38708)
LuciNyan Nov 18, 2022
30fb068
fix: submenu margin (#38714)
JarvisArt Nov 18, 2022
919f7f9
docs: update document format (#38725)
zqran Nov 19, 2022
cd52a3d
site: remove pointerEvents (#38726)
li-jia-nan Nov 19, 2022
52cb37f
chore: remove throttleByAnimationFrameDecorator (#38693)
li-jia-nan Nov 19, 2022
77ea403
chore: remo format and remove prettierrc arrowParens (#38722)
hengkx Nov 19, 2022
39689bd
chore: Definition message.config type (#38723)
hms181231 Nov 19, 2022
017f3ac
fix: ssr keyframes (#38729)
zombieJ Nov 19, 2022
d32a1fe
fix(types): external module type error (CompoundedComponent) (#38666)
wangcch Nov 19, 2022
ff73eb9
chore: simplify strokeWidth code (#38733)
li-jia-nan Nov 19, 2022
712f189
docs: remove iconPicSearcher (#38738)
afc163 Nov 19, 2022
68b1062
docs: update zhihu blog url (#38737)
afc163 Nov 19, 2022
5fa55e2
chore: improve gh-pages workflow (#38739)
afc163 Nov 19, 2022
c511557
fix: style parse error (#38742)
zombieJ Nov 19, 2022
7728eec
docs: spelling and grammar fix (#38743)
echosonusharma Nov 19, 2022
c51bba2
fix: menu expansion submenu jitter (#38748)
JarvisArt Nov 19, 2022
eef96d7
chore: adjust deploy token (#38746)
zombieJ Nov 19, 2022
3184448
Update README.md (#38744)
afc163 Nov 19, 2022
cef8bf8
fix: bump rc-picker to remove moment (#38762)
zombieJ Nov 20, 2022
f9ef37e
test: Update message test case (#38766)
hms181231 Nov 20, 2022
153f232
test: Update button test case (#38768)
hms181231 Nov 21, 2022
e92cb1a
fix: back-top animation error (#38770)
li-jia-nan Nov 21, 2022
68b88d9
fix(menu): menu horizontal border bottom when dark (#38741)
LuciNyan Nov 21, 2022
bac4178
chore: change dumi dev port to 8001 (#38773)
afc163 Nov 21, 2022
0c446bc
docs: auto use Chinese mirror if in mirror (#38776)
zombieJ Nov 21, 2022
14316b3
fix: delete Chinese locale (#38781)
li-jia-nan Nov 21, 2022
588a912
fix: fix OverviewPage style (#38782)
li-jia-nan Nov 21, 2022
33776d0
fix: delete Chinese locale (#38790)
li-jia-nan Nov 21, 2022
2de26c0
fix: collapsed inline menu style (#38791)
KarasuShin Nov 21, 2022
91b25d5
feat: empty simple in dark theme (#38785)
MadCcc Nov 21, 2022
a1e14f6
docs: guide about where config (#38764)
zombieJ Nov 21, 2022
59772e9
docs: update document Table style (#38727)
zqran Nov 21, 2022
f11d628
docs(Badge): change file name (#38801)
Hazel-Lin Nov 21, 2022
c7a1074
docs(Tabs): fix markdown format (#38810)
isaced Nov 21, 2022
c3fa08c
docs: remove releasly url (#38815)
afc163 Nov 21, 2022
b87b956
docs: Update v5 res & adjust cssinjs doc (#38799)
zombieJ Nov 21, 2022
882b874
docs: improve icon copied style (#38809)
Greedy1997 Nov 21, 2022
3040ed7
site: fix site style (#38819)
li-jia-nan Nov 21, 2022
b9cab0f
chore: add FormItemInputContext for v3 compatible usage
zombieJ Nov 22, 2022
870080b
fix: expand icon row-indentation issue (#38823)
turdiyev Nov 22, 2022
b22ab1a
chore: revert compile with lib (#38832)
chunsch Nov 22, 2022
5ec1808
Merge branch 'master' into feature-merge-master
MadCcc Nov 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 8 additions & 10 deletions .antd-tools.config.js
@@ -1,23 +1,21 @@
const fs = require('fs');
const path = require('path');

const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css');

function finalizeCompile() {
if (fs.existsSync(path.join(__dirname, './es'))) {
// Build less entry file: dist/antd.less
fs.copyFileSync(
path.join(process.cwd(), 'components', 'style', 'reset.css'),
path.join(process.cwd(), 'es', 'style', 'reset.css'),
);
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css'));
}

if (fs.existsSync(path.join(__dirname, './lib'))) {
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', 'style', 'reset.css'));
}
}

function finalizeDist() {
if (fs.existsSync(path.join(__dirname, './dist'))) {
// Build less entry file: dist/antd.less
fs.copyFileSync(
path.join(process.cwd(), 'components', 'style', 'reset.css'),
path.join(process.cwd(), 'dist', 'reset.css'),
);
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'dist', 'reset.css'));
}
}

Expand Down
8 changes: 4 additions & 4 deletions .dumi/hooks/useMenu.tsx
Expand Up @@ -58,7 +58,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] =>
}, {});
const childItems = [];
childItems.push(
...childrenGroup.default.map(item => ({
...childrenGroup.default.map((item) => ({
label: (
<Link to={item.link}>
{before}
Expand All @@ -75,7 +75,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] =>
type: 'group',
label: type,
key: type,
children: children?.map(item => ({
children: children?.map((item) => ({
label: (
<Link to={item.link}>
{before}
Expand All @@ -98,7 +98,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] =>
type: 'group',
label: group.title,
key: group.title,
children: group.children?.map(item => ({
children: group.children?.map((item) => ({
label: (
<Link to={item.link}>
{before}
Expand All @@ -115,7 +115,7 @@ const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] =>
}
} else {
result.push(
...group.children?.map(item => ({
...group.children?.map((item) => ({
label: (
<Link to={item.link}>
{before}
Expand Down
2 changes: 1 addition & 1 deletion .dumi/hooks/useSiteToken.ts
Expand Up @@ -26,7 +26,7 @@ const useSiteToken = () => {
/** 80 */
marginFarSM: (token.marginXXL / 3) * 5,
/** 96 */
marginFar: token.marginXXL * 1.8,
marginFar: token.marginXXL * 2,
codeFamily: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
},
};
Expand Down
18 changes: 7 additions & 11 deletions .dumi/pages/index/components/Banner.tsx
Expand Up @@ -8,14 +8,14 @@ import * as utils from '../../../theme/utils';

const locales = {
cn: {
slogan: '助力设计开发者「更灵活」的搭建出「更美」的产品,让用户「快乐工作」~',
slogan: '助力设计开发者「更灵活」地搭建出「更美」的产品,让用户「快乐工作」~',
start: '开始使用',
designLanguage: '设计语言',
},
en: {
slogan:
'Help design developers "more flexible" to build "more beautiful" products, helping users to "work happily"~',
start: 'Get Start',
'Help designers/developers building beautiful products more flexible and working with happiness',
start: 'Getting Started',
designLanguage: 'Design Language',
},
};
Expand All @@ -36,7 +36,7 @@ export default function Banner({ children }: BannerProps) {
{/* Banner Placeholder Motion */}
<div
style={{
height: 240,
height: 320,
background: '#77C6FF',
display: 'flex',
flexWrap: 'nowrap',
Expand All @@ -53,12 +53,7 @@ export default function Banner({ children }: BannerProps) {
}}
/>

<video
style={{ height: '100%', objectFit: 'contain' }}
autoPlay
muted
loop
>
<video style={{ height: '100%', objectFit: 'contain' }} autoPlay muted loop>
<source
src="https://mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*uYT7SZwhJnUAAAAAAAAAAAAADgCCAQ"
type="video/webm"
Expand All @@ -76,6 +71,7 @@ export default function Banner({ children }: BannerProps) {
backgroundRepeat: 'repeat-x',
backgroundPosition: '0 0',
backgroundSize: 'auto 100%',
marginLeft: -1,
}}
/>
</div>
Expand All @@ -91,7 +87,7 @@ export default function Banner({ children }: BannerProps) {
<GroupMask
style={{
textAlign: 'center',
paddingTop: token.marginFar,
paddingTop: token.marginFar - 16,
paddingBottom: token.marginFarSM,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion .dumi/pages/index/components/BannerRecommends.tsx
Expand Up @@ -54,7 +54,7 @@ export default function BannerRecommends({ extras = [], icons = [] }: BannerReco
>
{first3.map((extra, index) => {
if (!extra) {
return <Skeleton />;
return <Skeleton key={index} />;
}
const icon = icons.find((icon) => icon.name === extra.source);
return (
Expand Down
3 changes: 1 addition & 2 deletions .dumi/pages/index/components/ComponentsList.tsx
Expand Up @@ -10,7 +10,6 @@ import {
Modal,
FloatButton,
Progress,
ConfigProvider,
} from 'antd';
import dayjs from 'dayjs';
import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons';
Expand Down Expand Up @@ -222,7 +221,7 @@ export default function ComponentsList() {
const tagText = type === 'new' ? locale.new : locale.update;

return (
<div key={index} css={styles.card} style={{ pointerEvents: 'none' }}>
<div key={index} css={styles.card}>
{/* Decorator */}
<div
css={styles.cardCircle}
Expand Down
9 changes: 6 additions & 3 deletions .dumi/pages/index/components/Theme/ColorPicker.tsx
Expand Up @@ -54,7 +54,7 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) {
const valueStr = new TinyColor(value).toRgbString();
let existActive = false;

const colors = PRESET_COLORS.map(color => {
const colors = PRESET_COLORS.map((color) => {
const colorStr = new TinyColor(color).toRgbString();
const active = colorStr === valueStr;
existActive = existActive || active;
Expand All @@ -80,7 +80,7 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) {
<Space size="large">
<Input
value={value}
onChange={event => {
onChange={(event) => {
onChange?.(event.target.value);
}}
style={{ width: 120 }}
Expand Down Expand Up @@ -109,7 +109,10 @@ export default function ColorPicker({ value, onChange }: RadiusPickerProps) {
key={color}
overlayInnerStyle={{ padding: 0 }}
content={
<DebouncedColorPanel color={value || ''} onChange={color => onChange?.(color)} />
<DebouncedColorPanel
color={value || ''}
onChange={(color) => onChange?.(color)}
/>
}
trigger="click"
showArrow={false}
Expand Down
4 changes: 2 additions & 2 deletions .dumi/pages/index/components/Theme/RadiusPicker.tsx
Expand Up @@ -14,8 +14,8 @@ export default function RadiusPicker({ value, onChange }: RadiusPickerProps) {
onChange={onChange}
style={{ width: 120 }}
min={0}
formatter={val => `${val}px`}
parser={str => (str ? parseFloat(str) : (str as any))}
formatter={(val) => `${val}px`}
parser={(str) => (str ? parseFloat(str) : (str as any))}
/>

<Slider
Expand Down
2 changes: 1 addition & 1 deletion .dumi/pages/index/components/Theme/ThemePicker.tsx
Expand Up @@ -74,7 +74,7 @@ export default function ThemePicker({ value, onChange }: ThemePickerProps) {

return (
<Space size={token.paddingLG}>
{Object.keys(THEMES).map(theme => {
{Object.keys(THEMES).map((theme) => {
const url = THEMES[theme as THEME];

return (
Expand Down
2 changes: 1 addition & 1 deletion .dumi/pages/index/components/Theme/colorUtil.ts
Expand Up @@ -73,7 +73,7 @@ export function getAvatarURL(color?: string | null) {
}

return (
COLOR_IMAGES.find(obj => obj.color === closestColor)?.url ||
COLOR_IMAGES.find((obj) => obj.color === closestColor)?.url ||
'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*CLp0Qqc11AkAAAAAAAAAAAAAARQnAQ'
);
}
6 changes: 3 additions & 3 deletions .dumi/pages/index/components/util.tsx
Expand Up @@ -72,7 +72,7 @@ export function preLoad(list: string[]) {
const div = document.createElement('div');
div.style.display = 'none';
document.body.appendChild(div);
list.forEach(src => {
list.forEach((src) => {
const img = new Image();
img.src = src;
div.appendChild(img);
Expand All @@ -88,8 +88,8 @@ export function useSiteData(): [Partial<SiteData>, boolean] {
if (Object.keys(data ?? {}).length === 0 && typeof fetch !== 'undefined') {
setLoading(true);
fetch(`https://render.alipay.com/p/h5data/antd4-config_website-h5data.json`)
.then(res => res.json())
.then(result => {
.then((res) => res.json())
.then((result) => {
setData(result);
setLoading(false);
});
Expand Down
2 changes: 1 addition & 1 deletion .dumi/pages/theme-editor/index.tsx
Expand Up @@ -24,7 +24,7 @@ const CustomTheme = () => {
theme={{ name: 'test', key: 'test', config: theme }}
simple
style={{ height: 'calc(100vh - 64px)' }}
onThemeChange={newTheme => {
onThemeChange={(newTheme) => {
setTheme(newTheme.config);
}}
/>
Expand Down
14 changes: 11 additions & 3 deletions .dumi/rehypeAntd.ts
Expand Up @@ -6,6 +6,8 @@ import { type HastRoot, type UnifiedTransformer, unistUtilVisit } from 'dumi';
*/
function rehypeAntd(): UnifiedTransformer<HastRoot> {
return (tree, vFile) => {
const filename = (vFile.data.frontmatter as any).filename;

unistUtilVisit.visit(tree, 'element', (node) => {
if (node.tagName === 'DumiDemoGrid') {
// replace DumiDemoGrid to DemoWrapper, to implement demo toolbar
Expand All @@ -16,9 +18,7 @@ function rehypeAntd(): UnifiedTransformer<HastRoot> {

assert(
contentNode.type === 'text',
`ResourceCards content must be plain text!\nat ${
(vFile.data.frontmatter as any).filename
}`,
`ResourceCards content must be plain text!\nat ${filename}`,
);

// clear children
Expand Down Expand Up @@ -52,6 +52,14 @@ function rehypeAntd(): UnifiedTransformer<HastRoot> {
),
},
];
} else if (
node.type === 'element' &&
node.tagName === 'Table' &&
/^components/.test(filename)
) {
if (!node.properties) return;
node.properties.className ??= [];
(node.properties.className as string[]).push('component-api-table');
}
});
};
Expand Down
26 changes: 14 additions & 12 deletions .dumi/theme/builtins/ComponentOverview/index.tsx
Expand Up @@ -29,7 +29,6 @@ const useStyle = () => {
align-items: center;
justify-content: center;
height: 152px;
background-color: ${token.colorBgElevated};
`,
componentsOverviewCard: css`
cursor: pointer;
Expand Down Expand Up @@ -68,7 +67,7 @@ const onClickCard = (pathname: string) => {
}
};

const reportSearch = debounce<(value: string) => void>(value => {
const reportSearch = debounce<(value: string) => void>((value) => {
if (window.gtag) {
window.gtag('event', '搜索', {
event_category: '组件总览卡片',
Expand All @@ -91,19 +90,19 @@ const Overview: React.FC = () => {

const sectionRef = React.useRef<HTMLElement>(null);

const onKeyDown: React.KeyboardEventHandler<HTMLInputElement> = event => {
const onKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
if (event.keyCode === 13 && search.trim().length) {
sectionRef.current?.querySelector<HTMLElement>('.components-overview-card')?.click();
}
};

const groups = useMemo<{ title: string; children: Component[] }[]>(() => {
return data
.filter(item => item.title)
.map<{ title: string; children: Component[] }>(item => {
.filter((item) => item.title)
.map<{ title: string; children: Component[] }>((item) => {
return {
title: item.title!,
children: item.children.map(child => ({
children: item.children.map((child) => ({
title: child.frontmatter.title,
subtitle: child.frontmatter.subtitle,
cover: child.frontmatter.cover,
Expand All @@ -114,7 +113,10 @@ const Overview: React.FC = () => {
.concat([
{
title: locale === 'zh-CN' ? '重型组件' : 'Others',
children: proComponentsList,
children:
locale === 'zh-CN'
? proComponentsList
: proComponentsList.map((component) => ({ ...component, subtitle: '' })),
},
]);
}, [data, locale]);
Expand All @@ -126,7 +128,7 @@ const Overview: React.FC = () => {
value={search}
placeholder={formatMessage({ id: 'app.components.overview.search' })}
css={style.componentsOverviewSearch}
onChange={e => {
onChange={(e) => {
setSearch(e.target.value);
reportSearch(e.target.value);
}}
Expand All @@ -136,10 +138,10 @@ const Overview: React.FC = () => {
/>
<Divider />
{groups
.filter(i => i.title)
.map(group => {
.filter((i) => i.title)
.map((group) => {
const components = group?.children?.filter(
component =>
(component) =>
!search.trim() ||
component.title.toLowerCase().includes(search.trim().toLowerCase()) ||
(component?.subtitle || '').toLowerCase().includes(search.trim().toLowerCase()),
Expand All @@ -153,7 +155,7 @@ const Overview: React.FC = () => {
</Space>
</Title>
<Row gutter={[24, 24]}>
{components.map(component => {
{components.map((component) => {
const url = `${component.link}/`;

/** Link 不能跳转到外链 */
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/builtins/IconSearch/Category.tsx
Expand Up @@ -12,7 +12,7 @@ interface CategoryProps {
newIcons: string[];
}

const Category: React.FC<CategoryProps> = props => {
const Category: React.FC<CategoryProps> = (props) => {
const { icons, title, newIcons, theme } = props;
const intl = useIntl();
const [justCopied, setJustCopied] = React.useState<string | null>(null);
Expand Down Expand Up @@ -40,7 +40,7 @@ const Category: React.FC<CategoryProps> = props => {
<div>
<h3>{intl.formatMessage({ id: `app.docs.components.icon.category.${title}` })}</h3>
<ul className="anticons-list">
{icons.map(name => (
{icons.map((name) => (
<CopyableIcon
key={name}
name={name}
Expand Down