完美
This commit is contained in:
@@ -721,8 +721,8 @@ export const LayoutPreview: React.FC<LayoutPreviewProps> = ({
|
|||||||
<div
|
<div
|
||||||
className={
|
className={
|
||||||
isMobileVariant
|
isMobileVariant
|
||||||
? 'flex flex-col items-center space-y-4 pb-4'
|
? 'flex flex-col items-center justify-center min-h-full w-full space-y-4 pb-4'
|
||||||
: 'flex flex-wrap justify-center content-start w-full pb-8'
|
: 'flex flex-wrap justify-center content-center w-full min-h-full pb-8'
|
||||||
}
|
}
|
||||||
style={isMobileVariant ? undefined : { gap: `${previewPageGapPx}px` }}
|
style={isMobileVariant ? undefined : { gap: `${previewPageGapPx}px` }}
|
||||||
>
|
>
|
||||||
@@ -741,7 +741,7 @@ export const LayoutPreview: React.FC<LayoutPreviewProps> = ({
|
|||||||
</span> */}
|
</span> */}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="bg-white flex items-start justify-start relative select-none overflow-hidden shrink-0"
|
className="bg-white flex items-center justify-center relative select-none overflow-hidden shrink-0"
|
||||||
style={{
|
style={{
|
||||||
width: `${pageCardWidthPx}px`,
|
width: `${pageCardWidthPx}px`,
|
||||||
height: `${currentPaperH * previewScale}px`,
|
height: `${currentPaperH * previewScale}px`,
|
||||||
|
|||||||
@@ -2324,10 +2324,10 @@ export const PropSidebar: React.FC<PropSidebarProps> = ({
|
|||||||
<span>粘贴</span>
|
<span>粘贴</span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
{elementClipboard?.canCopy && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => elementClipboard?.copySelectedElements()}
|
onClick={() => elementClipboard.copySelectedElements()}
|
||||||
disabled={!elementClipboard?.canCopy}
|
|
||||||
className="mobile-design-props-nav-btn"
|
className="mobile-design-props-nav-btn"
|
||||||
aria-label="复制选中元素"
|
aria-label="复制选中元素"
|
||||||
title="复制选中元素"
|
title="复制选中元素"
|
||||||
@@ -2335,6 +2335,7 @@ export const PropSidebar: React.FC<PropSidebarProps> = ({
|
|||||||
<Copy className="w-4 h-4" />
|
<Copy className="w-4 h-4" />
|
||||||
<span>复制</span>
|
<span>复制</span>
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => void deleteSelectedElements()}
|
onClick={() => void deleteSelectedElements()}
|
||||||
|
|||||||
@@ -17,9 +17,18 @@ export function useMediaQuery(query: string): boolean {
|
|||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 与 Tailwind `md` 断点一致:< 768px 视为移动端 */
|
/** 移动端上下布局:手机窄屏,或平板竖屏(宽度 < 1024 且竖屏) */
|
||||||
|
export const MOBILE_LAYOUT_MEDIA_QUERY =
|
||||||
|
'(max-width: 767px), (max-width: 1023px) and (orientation: portrait)';
|
||||||
|
|
||||||
|
/** 移动端上下布局:手机窄屏,或平板竖屏(宽度 < 1024 且竖屏) */
|
||||||
export function useIsMobile(): boolean {
|
export function useIsMobile(): boolean {
|
||||||
return useMediaQuery('(max-width: 767px)');
|
return useMediaQuery(MOBILE_LAYOUT_MEDIA_QUERY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 语义别名:是否使用移动端上下布局 */
|
||||||
|
export function useMobileLayout(): boolean {
|
||||||
|
return useIsMobile();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 平板等窄屏:< 1024px */
|
/** 平板等窄屏:< 1024px */
|
||||||
|
|||||||
@@ -896,8 +896,8 @@ html.app-dark-shell body {
|
|||||||
background-size: 24px 24px;
|
background-size: 24px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Mobile layout (< 768px) ── */
|
/* ── Mobile layout:手机窄屏,或平板竖屏 ── */
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px), (max-width: 1023px) and (orientation: portrait) {
|
||||||
|
|
||||||
/* Mobile export flow — shares mobile-design-view shell */
|
/* Mobile export flow — shares mobile-design-view shell */
|
||||||
.mobile-export-view {
|
.mobile-export-view {
|
||||||
@@ -1740,7 +1740,8 @@ html.app-dark-shell body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
/* 桌面宽屏 / 横屏平板:隐藏仅移动端渲染的视图 */
|
||||||
|
@media (min-width: 768px) and (orientation: landscape), (min-width: 1024px) {
|
||||||
.mobile-only {
|
.mobile-only {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user