feat(editor): 新增视频上传功能并优化编辑器体验

- 添加视频上传功能,支持提取视频第一帧作为封面
- 优化图片和视频上传的数量限制检查
- 修复编辑器内容为空判断逻辑,增加视频元素检测
- 改进链接插入功能,自动填充选中文本
- 调整表情选择插入方式,使用execCommand实现
- 优化附件提取逻辑,支持视频元素解析
- 添加编辑器点击事件处理,更新选区状态
- 修复样式问题,调整按钮悬停效果
This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-11-18 19:20:31 +08:00
parent 16f45c4466
commit f49d937f19
12 changed files with 873 additions and 344 deletions

View File

@@ -172,6 +172,7 @@
}
#details .matter .matter-left .html img {
max-width: 100%;
display: block;
}
#details .matter .matter-left .html video {
margin: 0 auto;

View File

@@ -198,6 +198,7 @@
img {
max-width: 100%;
display: block;
}
video {

View File

@@ -77,6 +77,9 @@
height: 36px;
background-color: #fbfbfb;
padding-left: 25px;
position: sticky;
top: 0;
z-index: 10;
}
#edit .edit-container .editor-toolbar .toolbar-item {
cursor: pointer;
@@ -132,7 +135,6 @@
width: 100%;
height: 100%;
z-index: 1;
background-color: rgba(0, 0, 0, 0.20392157);
display: none;
}
#edit .edit-container .editor-toolbar .toolbar-item .link-box-mask {
@@ -227,7 +229,7 @@
margin-top: 8px;
}
#edit .edit-container .editor-toolbar .toolbar-item.link .link-box .btn:hover {
background-color: #c2eff6;
background-color: #23e0b6;
}
#edit .edit-container .editor-toolbar .toolbar-item.h2.pitch {
background-color: #f6f6bd;
@@ -334,12 +336,16 @@
color: #7f7f7f;
font-size: 14px;
margin-right: 15px;
transition: background-color 0.3s ease;
}
#edit .edit-container .action-buttons .right-section .draft-btn .icon {
width: 20px;
height: 20px;
margin-right: 6px;
}
#edit .edit-container .action-buttons .right-section .draft-btn:hover {
background-color: #ebebeb;
}
#edit .edit-container .action-buttons .right-section .publish-btn {
width: 150px;
height: 40px;
@@ -350,4 +356,8 @@
font-size: 16px;
color: #000000;
background-color: #50e3c2;
transition: background-color 0.3s ease;
}
#edit .edit-container .action-buttons .right-section .publish-btn:hover {
background-color: #40d1aa;
}

View File

@@ -86,6 +86,10 @@
height: 36px;
background-color: rgba(251, 251, 251, 1);
padding-left: 25px;
position: sticky;
top: 0;
z-index: 10;
.toolbar-item {
.icon {
width: 16px;
@@ -146,7 +150,7 @@
width: 100%;
height: 100%;
z-index: 1;
background-color: rgba(0, 0, 0, 0.20392157);
// background-color: rgba(0, 0, 0, 0.20392157);
display: none;
}
@@ -254,7 +258,7 @@
color: #000000;
margin-top: 8px;
&:hover {
background-color: rgba(194, 239, 246, 1);
background-color: rgb(35, 224, 182);
}
}
}
@@ -382,12 +386,17 @@
color: #7f7f7f;
font-size: 14px;
margin-right: 15px;
transition: background-color 0.3s ease;
.icon {
width: 20px;
height: 20px;
margin-right: 6px;
}
&:hover {
background-color: rgb(235, 235, 235);
}
}
.publish-btn {
width: 150px;
@@ -399,6 +408,11 @@
font-size: 16px;
color: #000000;
background-color: rgba(80, 227, 194, 1);
transition: background-color 0.3s ease;
&:hover {
background-color: rgba(64, 209, 170, 1);
}
}
}
}