feat: add resize handles for component size editing

Add resize handles to allow direct size editing of components.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
wtz
2026-04-02 16:15:47 +08:00
parent 1d58d40185
commit 905c7bb8dc
2 changed files with 528 additions and 50 deletions

View File

@@ -189,6 +189,8 @@ body {
border-radius: 4px;
transition: border-color 0.3s;
cursor: move;
position: relative;
overflow: visible;
}
.webbuilder-component:hover {
@@ -200,6 +202,67 @@ body {
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}
/* 尺寸控制柄容器 */
.resize-handles-container {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10;
}
/* 尺寸控制柄 */
.resize-handle {
position: absolute;
width: 8px;
height: 8px;
background: #1890ff;
border: 1px solid #fff;
border-radius: 2px;
pointer-events: auto;
z-index: 11;
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}
.resize-handle:hover {
background: #40a9ff;
transform: scale(1.2);
}
.resize-handle-nw {
cursor: nwse-resize;
}
.resize-handle-n {
cursor: ns-resize;
}
.resize-handle-ne {
cursor: nesw-resize;
}
.resize-handle-w {
cursor: ew-resize;
}
.resize-handle-e {
cursor: ew-resize;
}
.resize-handle-sw {
cursor: nesw-resize;
}
.resize-handle-s {
cursor: ns-resize;
}
.resize-handle-se {
cursor: nwse-resize;
}
/* 属性面板 */
.webbuilder-property-panel {
width: 280px;