diff --git a/.changeset/cool-comics-crash.md b/.changeset/cool-comics-crash.md new file mode 100644 index 000000000..97ffdba6d --- /dev/null +++ b/.changeset/cool-comics-crash.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/env": patch +--- + +fix: 添加依赖兼容之前组件 diff --git a/.changeset/four-ducks-admire.md b/.changeset/four-ducks-admire.md new file mode 100644 index 000000000..459b1a288 --- /dev/null +++ b/.changeset/four-ducks-admire.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(env): 添加依赖兼容之前组件 diff --git a/packages/ui/form/stories/validate-message.stories.tsx b/packages/ui/form/stories/validate-message.stories.tsx index bb544a521..cbf0bfe21 100644 --- a/packages/ui/form/stories/validate-message.stories.tsx +++ b/packages/ui/form/stories/validate-message.stories.tsx @@ -16,7 +16,12 @@ export const ValidateMessage = () => {

ValidateMessage

-
+ diff --git a/packages/ui/preview/src/Preview.tsx b/packages/ui/preview/src/Preview.tsx index 32f89a6b1..8f7bf5ae1 100644 --- a/packages/ui/preview/src/Preview.tsx +++ b/packages/ui/preview/src/Preview.tsx @@ -53,7 +53,6 @@ export const Preview = forwardRef( const [active, setActive] = useUncontrolledState(defaultCurrent || 0, current, onPreviewChange) - const [isLoaded, setIsLoaded] = useState(false) const [isMoving, setIsMoving] = useState(false) const [imgTransform, updateImgTransform] = useState(defaultTransform) const movingPosition = useRef({ @@ -69,7 +68,7 @@ export const Preview = forwardRef( const isMultiple = useMemo(() => Array.isArray(src) && src.length > 1, [src]) // 图片加水印 - const [watermarkContainerRef, setWatermarkContainerRef] = useState(null) + const [watermarkContainer, setWatermarkContainer] = useState(null) const handleContextMenu = useLatestCallback((evt: React.MouseEvent) => { evt.preventDefault() @@ -239,7 +238,7 @@ export const Preview = forwardRef(
{ - setWatermarkContainerRef(e) + setWatermarkContainer(e) }} style={{ transform: `scale(${imgTransform.scale}, ${imgTransform.scale}) translate(${imgTransform.translateX}px,${imgTransform.translateY}px) rotate(${imgTransform.rotate}deg)`, @@ -247,9 +246,6 @@ export const Preview = forwardRef( > { - setIsLoaded(true) - }} onError={onError} onMouseDown={onMoveStart} onMouseUp={onMoveEnd} @@ -304,8 +300,8 @@ export const Preview = forwardRef( )}
- {watermarkProps && ( - + {watermarkProps && watermarkContainer && ( + )} )} diff --git a/packages/utils/env/package.json b/packages/utils/env/package.json index d91bea637..fd361c2dc 100644 --- a/packages/utils/env/package.json +++ b/packages/utils/env/package.json @@ -1,6 +1,6 @@ { "name": "@hi-ui/env", - "version": "4.0.5", + "version": "4.0.6", "description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM", "keywords": [], "author": "Flcwl ", @@ -36,6 +36,8 @@ }, "homepage": "https://github.com/XiaoMi/hiui#readme", "dependencies": { - "@hi-ui/style-inject": "^4.0.0" + "@hi-ui/style-inject": "^4.0.0", + "inject-head-style": "^1.0.0", + "style-inject": "^0.3.0" } }