完善图片画布素材与上下文操作
添加素材拖拽上传遮罩、素材移动和默认文件夹归一 补齐画布右键菜单、复制剪切粘贴、层级和翻转操作 补齐生成图入库、项目返回入口和项目名称标题 扩展画布测试覆盖素材、右键菜单、生成图和布局交互
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import type {
|
import type {
|
||||||
ComponentType,
|
ComponentType,
|
||||||
DragEventHandler,
|
DragEventHandler,
|
||||||
|
MouseEventHandler,
|
||||||
PointerEventHandler,
|
PointerEventHandler,
|
||||||
ReactNode,
|
ReactNode,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
@@ -68,9 +69,14 @@ export type SidebarMediaItemProps = {
|
|||||||
primaryClassName?: string;
|
primaryClassName?: string;
|
||||||
actions?: ReactNode;
|
actions?: ReactNode;
|
||||||
titleNode?: ReactNode;
|
titleNode?: ReactNode;
|
||||||
|
draggable?: boolean;
|
||||||
|
onDragStart?: DragEventHandler<HTMLDivElement>;
|
||||||
|
onDragEnd?: DragEventHandler<HTMLDivElement>;
|
||||||
onDragOver?: DragEventHandler<HTMLDivElement>;
|
onDragOver?: DragEventHandler<HTMLDivElement>;
|
||||||
onDrop?: DragEventHandler<HTMLDivElement>;
|
onDrop?: DragEventHandler<HTMLDivElement>;
|
||||||
|
onPointerDown?: PointerEventHandler<HTMLDivElement>;
|
||||||
onPointerEnter?: PointerEventHandler<HTMLDivElement>;
|
onPointerEnter?: PointerEventHandler<HTMLDivElement>;
|
||||||
|
onContextMenu?: MouseEventHandler<HTMLDivElement>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function SidebarMediaItem({
|
export function SidebarMediaItem({
|
||||||
@@ -87,16 +93,26 @@ export function SidebarMediaItem({
|
|||||||
primaryClassName,
|
primaryClassName,
|
||||||
actions,
|
actions,
|
||||||
titleNode,
|
titleNode,
|
||||||
|
draggable,
|
||||||
|
onDragStart,
|
||||||
|
onDragEnd,
|
||||||
onDragOver,
|
onDragOver,
|
||||||
onDrop,
|
onDrop,
|
||||||
|
onPointerDown,
|
||||||
onPointerEnter,
|
onPointerEnter,
|
||||||
|
onContextMenu,
|
||||||
}: SidebarMediaItemProps) {
|
}: SidebarMediaItemProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`${rowClassName} ${selected ? `${rowClassName}--selected` : ''}`}
|
className={`${rowClassName} ${selected ? `${rowClassName}--selected` : ''}`}
|
||||||
|
draggable={draggable}
|
||||||
|
onDragStart={onDragStart}
|
||||||
|
onDragEnd={onDragEnd}
|
||||||
onDragOver={onDragOver}
|
onDragOver={onDragOver}
|
||||||
onDrop={onDrop}
|
onDrop={onDrop}
|
||||||
|
onPointerDown={onPointerDown}
|
||||||
onPointerEnter={onPointerEnter}
|
onPointerEnter={onPointerEnter}
|
||||||
|
onContextMenu={onContextMenu}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
111
src/index.css
111
src/index.css
@@ -3328,6 +3328,7 @@ html[data-mobile-keyboard-open='true'] .platform-mobile-bottom-dock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.image-canvas-editor__icon-button,
|
.image-canvas-editor__icon-button,
|
||||||
|
.image-canvas-editor__project-back-button,
|
||||||
.image-canvas-editor__floating-toolbar button,
|
.image-canvas-editor__floating-toolbar button,
|
||||||
.image-canvas-editor__bottom-toolbar button,
|
.image-canvas-editor__bottom-toolbar button,
|
||||||
.image-canvas-editor__reset-button {
|
.image-canvas-editor__reset-button {
|
||||||
@@ -3345,6 +3346,7 @@ html[data-mobile-keyboard-open='true'] .platform-mobile-bottom-dock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.image-canvas-editor__icon-button:hover,
|
.image-canvas-editor__icon-button:hover,
|
||||||
|
.image-canvas-editor__project-back-button:hover,
|
||||||
.image-canvas-editor__floating-toolbar button:hover,
|
.image-canvas-editor__floating-toolbar button:hover,
|
||||||
.image-canvas-editor__bottom-toolbar button:hover,
|
.image-canvas-editor__bottom-toolbar button:hover,
|
||||||
.image-canvas-editor__reset-button:hover {
|
.image-canvas-editor__reset-button:hover {
|
||||||
@@ -3487,6 +3489,40 @@ html[data-mobile-keyboard-open='true'] .platform-mobile-bottom-dock {
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__upload-drop-overlay {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 30;
|
||||||
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
|
gap: 0.3rem;
|
||||||
|
border: 1.5px dashed rgba(37, 99, 235, 0.72);
|
||||||
|
background: rgba(239, 246, 255, 0.78);
|
||||||
|
color: #1d4ed8;
|
||||||
|
pointer-events: none;
|
||||||
|
text-align: center;
|
||||||
|
backdrop-filter: blur(2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__upload-drop-overlay span {
|
||||||
|
font-size: 0.82rem;
|
||||||
|
font-weight: 820;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__upload-drop-overlay strong {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 920;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__upload-drop-overlay--assets {
|
||||||
|
inset: 0.45rem;
|
||||||
|
border-radius: 0.55rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__upload-drop-overlay--canvas {
|
||||||
|
inset: 0.85rem;
|
||||||
|
border-radius: 0.65rem;
|
||||||
|
}
|
||||||
|
|
||||||
.image-canvas-editor__canvas-marquee {
|
.image-canvas-editor__canvas-marquee {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
@@ -3701,6 +3737,24 @@ html[data-mobile-keyboard-open='true'] .platform-mobile-bottom-dock {
|
|||||||
padding: 0.55rem 0.7rem;
|
padding: 0.55rem 0.7rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__topbar-title {
|
||||||
|
display: inline-flex;
|
||||||
|
min-width: 0;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.55rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__project-back-button {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 2.15rem;
|
||||||
|
height: 2.15rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border-radius: 0.45rem;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
.image-canvas-editor__zoom-menu-wrap {
|
.image-canvas-editor__zoom-menu-wrap {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
@@ -3799,6 +3853,63 @@ html[data-mobile-keyboard-open='true'] .platform-mobile-bottom-dock {
|
|||||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
|
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__layer--locked {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 80;
|
||||||
|
display: grid;
|
||||||
|
min-width: 168px;
|
||||||
|
max-height: calc(100vh - 16px);
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0.35rem;
|
||||||
|
border: 1px solid rgba(148, 163, 184, 0.32);
|
||||||
|
border-radius: 0.45rem;
|
||||||
|
background: rgba(255, 255, 255, 0.96);
|
||||||
|
box-shadow: 0 18px 52px rgba(15, 23, 42, 0.18);
|
||||||
|
color: #172033;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 2rem;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0.32rem;
|
||||||
|
background: transparent;
|
||||||
|
padding: 0 0.65rem;
|
||||||
|
color: inherit;
|
||||||
|
font-size: 0.86rem;
|
||||||
|
font-weight: 720;
|
||||||
|
text-align: left;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu button:hover:not(:disabled),
|
||||||
|
.image-canvas-editor__context-menu button:focus-visible:not(:disabled) {
|
||||||
|
background: rgba(37, 99, 235, 0.1);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu button:disabled {
|
||||||
|
color: rgba(100, 116, 139, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu hr {
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
background: rgba(148, 163, 184, 0.25);
|
||||||
|
margin: 0.3rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-canvas-editor__context-menu-danger {
|
||||||
|
color: #b42318 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.image-canvas-editor__generation-frame {
|
.image-canvas-editor__generation-frame {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
|
|||||||
Reference in New Issue
Block a user