feat: add image handling capabilities to rich text editor with drag-and-drop support, resizing, and markdown integration

This commit is contained in:
2025-10-22 17:38:06 +08:00
parent 3491ae339d
commit 79fe02e307
10 changed files with 1287 additions and 1 deletions

View File

@@ -246,3 +246,91 @@
padding-left: 24px;
padding-right: 24px;
}
/* Image */
.editor-image {
cursor: default;
display: inline-block;
position: relative;
user-select: none;
}
.editor-image img {
max-width: 100%;
cursor: default;
}
.editor-image img.focused {
outline: 2px solid rgb(60, 132, 244);
user-select: none;
}
.editor-image img.focused.draggable {
cursor: grab;
}
.editor-image img.focused.draggable:active {
cursor: grabbing;
}
.image-control-wrapper--resizing {
touch-action: none;
}
/* Image Resizer */
.image-resizer {
display: block;
width: 7px;
height: 7px;
position: absolute;
background-color: rgb(60, 132, 244);
border: 1px solid #fff;
}
.image-resizer.image-resizer-n {
top: -6px;
left: 48%;
cursor: n-resize;
}
.image-resizer.image-resizer-ne {
top: -6px;
right: -6px;
cursor: ne-resize;
}
.image-resizer.image-resizer-e {
bottom: 48%;
right: -6px;
cursor: e-resize;
}
.image-resizer.image-resizer-se {
bottom: -2px;
right: -6px;
cursor: nwse-resize;
}
.image-resizer.image-resizer-s {
bottom: -2px;
left: 48%;
cursor: s-resize;
}
.image-resizer.image-resizer-sw {
bottom: -2px;
left: -6px;
cursor: sw-resize;
}
.image-resizer.image-resizer-w {
bottom: 48%;
left: -6px;
cursor: w-resize;
}
.image-resizer.image-resizer-nw {
top: -6px;
left: -6px;
cursor: nw-resize;
}