mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 03:22:59 +08:00
fix: Image operation can not hide & export default seedToken (#38494)
* chore: export defaultSeed * fix: image motion operation miss
This commit is contained in:
parent
e130dc105f
commit
0741f59216
@ -279,7 +279,7 @@ const genPreviewMotion: GenerateStyle<ImageToken> = token => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
[`${previewCls}-root`]: initZoomMotion(token, 'zoom'),
|
[`${previewCls}-root`]: initZoomMotion(token, 'zoom'),
|
||||||
'&': initFadeMotion(token),
|
[`&`]: initFadeMotion(token, true),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,22 +22,26 @@ export const fadeOut = new Keyframes('antFadeOut', {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const initFadeMotion = (token: TokenWithCommonCls<AliasToken>): CSSInterpolation => {
|
export const initFadeMotion = (
|
||||||
|
token: TokenWithCommonCls<AliasToken>,
|
||||||
|
sameLevel = false,
|
||||||
|
): CSSInterpolation => {
|
||||||
const { antCls } = token;
|
const { antCls } = token;
|
||||||
const motionCls = `${antCls}-fade`;
|
const motionCls = `${antCls}-fade`;
|
||||||
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
initMotion(motionCls, fadeIn, fadeOut, token.motionDurationMid),
|
initMotion(motionCls, fadeIn, fadeOut, token.motionDurationMid, sameLevel),
|
||||||
{
|
{
|
||||||
[`
|
[`
|
||||||
${motionCls}-enter,
|
${sameLevelPrefix}${motionCls}-enter,
|
||||||
${motionCls}-appear
|
${sameLevelPrefix}${motionCls}-appear
|
||||||
`]: {
|
`]: {
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
animationTimingFunction: 'linear',
|
animationTimingFunction: 'linear',
|
||||||
},
|
},
|
||||||
|
|
||||||
[`${motionCls}-leave`]: {
|
[`${sameLevelPrefix}${motionCls}-leave`]: {
|
||||||
animationTimingFunction: 'linear',
|
animationTimingFunction: 'linear',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -17,31 +17,36 @@ export const initMotion = (
|
|||||||
inKeyframes: Keyframes,
|
inKeyframes: Keyframes,
|
||||||
outKeyframes: Keyframes,
|
outKeyframes: Keyframes,
|
||||||
duration: string,
|
duration: string,
|
||||||
): CSSObject => ({
|
sameLevel = false,
|
||||||
|
): CSSObject => {
|
||||||
|
const sameLevelPrefix = sameLevel ? '&' : '';
|
||||||
|
|
||||||
|
return {
|
||||||
[`
|
[`
|
||||||
${motionCls}-enter,
|
${sameLevelPrefix}${motionCls}-enter,
|
||||||
${motionCls}-appear
|
${sameLevelPrefix}${motionCls}-appear
|
||||||
`]: {
|
`]: {
|
||||||
...initMotionCommon(duration),
|
...initMotionCommon(duration),
|
||||||
animationPlayState: 'paused',
|
animationPlayState: 'paused',
|
||||||
},
|
},
|
||||||
|
|
||||||
[`${motionCls}-leave`]: {
|
[`${sameLevelPrefix}${motionCls}-leave`]: {
|
||||||
...initMotionCommonLeave(duration),
|
...initMotionCommonLeave(duration),
|
||||||
animationPlayState: 'paused',
|
animationPlayState: 'paused',
|
||||||
},
|
},
|
||||||
|
|
||||||
[`
|
[`
|
||||||
${motionCls}-enter${motionCls}-enter-active,
|
${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active,
|
||||||
${motionCls}-appear${motionCls}-appear-active
|
${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active
|
||||||
`]: {
|
`]: {
|
||||||
animationName: inKeyframes,
|
animationName: inKeyframes,
|
||||||
animationPlayState: 'running',
|
animationPlayState: 'running',
|
||||||
},
|
},
|
||||||
|
|
||||||
[`${motionCls}-leave${motionCls}-leave-active`]: {
|
[`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: {
|
||||||
animationName: outKeyframes,
|
animationName: outKeyframes,
|
||||||
animationPlayState: 'running',
|
animationPlayState: 'running',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
};
|
||||||
|
@ -18,6 +18,9 @@ export default {
|
|||||||
/** @private Test Usage. Do not use in production. */
|
/** @private Test Usage. Do not use in production. */
|
||||||
defaultConfig,
|
defaultConfig,
|
||||||
|
|
||||||
|
/** Default seedToken */
|
||||||
|
defaultSeed: defaultConfig.token,
|
||||||
|
|
||||||
useToken,
|
useToken,
|
||||||
defaultAlgorithm,
|
defaultAlgorithm,
|
||||||
darkAlgorithm,
|
darkAlgorithm,
|
||||||
|
@ -126,7 +126,7 @@
|
|||||||
"rc-drawer": "~6.0.0",
|
"rc-drawer": "~6.0.0",
|
||||||
"rc-dropdown": "~4.0.0",
|
"rc-dropdown": "~4.0.0",
|
||||||
"rc-field-form": "~1.27.0",
|
"rc-field-form": "~1.27.0",
|
||||||
"rc-image": "~5.10.2",
|
"rc-image": "~5.11.0",
|
||||||
"rc-input": "~0.1.4",
|
"rc-input": "~0.1.4",
|
||||||
"rc-input-number": "~7.3.9",
|
"rc-input-number": "~7.3.9",
|
||||||
"rc-mentions": "~1.10.0",
|
"rc-mentions": "~1.10.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user