feat(editor): 优化编辑器UI和改进核心功能 (#234)
* feat(editor): 优化编辑器UI和改进核心功能 * feat(editor): 优化编辑器UI和改进核心功能
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
background-color: var(--color-bg-base);
|
||||
background-color: #1a1a1f;
|
||||
color: var(--color-text-primary);
|
||||
position: relative;
|
||||
}
|
||||
@@ -10,11 +10,11 @@
|
||||
.inspector-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
height: var(--layout-panel-header);
|
||||
padding: 0 var(--spacing-md);
|
||||
border-bottom: 1px solid var(--color-border-default);
|
||||
background-color: var(--color-bg-elevated);
|
||||
gap: 8px;
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background-color: #252529;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,11 @@
|
||||
|
||||
.inspector-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
padding: var(--spacing-md);
|
||||
padding: 8px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@@ -63,10 +65,10 @@
|
||||
}
|
||||
|
||||
.inspector-section {
|
||||
margin-bottom: 20px;
|
||||
padding: 12px;
|
||||
background-color: rgba(255, 255, 255, 0.02);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.inspector-section:last-child {
|
||||
@@ -306,32 +308,34 @@
|
||||
}
|
||||
|
||||
.entity-name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: var(--color-text-secondary);
|
||||
color: #888;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin: -4px -4px 12px -4px;
|
||||
padding-bottom: 8px;
|
||||
border-bottom: 1px solid var(--color-border-subtle);
|
||||
letter-spacing: 0.08em;
|
||||
margin: 0 0 6px 0;
|
||||
padding: 6px 8px;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.property-field {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
padding: 8px 6px;
|
||||
font-size: 12px;
|
||||
gap: 16px;
|
||||
background-color: rgba(255, 255, 255, 0.01);
|
||||
border-radius: 4px;
|
||||
margin-bottom: 4px;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
font-size: 11px;
|
||||
gap: 8px;
|
||||
background-color: transparent;
|
||||
border-radius: 0;
|
||||
margin-bottom: 1px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
.property-field:last-child {
|
||||
@@ -343,19 +347,20 @@
|
||||
}
|
||||
|
||||
.property-label {
|
||||
color: var(--color-text-secondary);
|
||||
font-weight: 500;
|
||||
color: #888;
|
||||
font-weight: 400;
|
||||
flex-shrink: 0;
|
||||
min-width: 80px;
|
||||
font-size: 12px;
|
||||
min-width: 70px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.property-value-text {
|
||||
color: var(--color-text-primary);
|
||||
color: #ccc;
|
||||
text-align: right;
|
||||
word-break: break-word;
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
flex: 1;
|
||||
font-family: var(--font-family-mono);
|
||||
}
|
||||
|
||||
.component-remove-btn {
|
||||
@@ -480,26 +485,24 @@
|
||||
.add-component-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 4px 8px;
|
||||
background: var(--color-primary);
|
||||
gap: 3px;
|
||||
padding: 3px 6px;
|
||||
background: #3b82f6;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: var(--color-text-inverse);
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
transition: all 0.15s ease;
|
||||
transition: all 0.1s ease;
|
||||
}
|
||||
|
||||
.add-component-trigger:hover {
|
||||
background: var(--color-primary-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
|
||||
background: #2563eb;
|
||||
}
|
||||
|
||||
.add-component-trigger:active {
|
||||
transform: translateY(0);
|
||||
background: #1d4ed8;
|
||||
}
|
||||
|
||||
.component-dropdown-overlay {
|
||||
@@ -630,55 +633,73 @@
|
||||
|
||||
/* 组件列表项样式 */
|
||||
.component-item-card {
|
||||
margin-bottom: 4px;
|
||||
background: var(--color-bg-elevated);
|
||||
border: 1px solid var(--color-border-default);
|
||||
border-radius: 6px;
|
||||
margin-bottom: 2px;
|
||||
background: #2a2a2f;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
transition: all 0.15s ease;
|
||||
transition: none;
|
||||
border-left: 3px solid #4a4a50;
|
||||
}
|
||||
|
||||
.component-item-card:hover {
|
||||
border-color: var(--color-border-strong);
|
||||
background: #2e2e33;
|
||||
}
|
||||
|
||||
.component-item-card.expanded {
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
|
||||
border-left-color: #3b82f6;
|
||||
background: #252529;
|
||||
}
|
||||
|
||||
.component-item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 10px;
|
||||
background: var(--color-bg-base);
|
||||
padding: 6px 8px;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: background 0.1s ease;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
.component-item-header:hover {
|
||||
background: var(--color-bg-hover);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.component-expand-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--color-text-tertiary);
|
||||
color: #666;
|
||||
transition: color 0.1s ease;
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
.component-item-card:hover .component-expand-icon,
|
||||
.component-item-card.expanded .component-expand-icon {
|
||||
color: var(--color-primary);
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.component-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
margin-left: 4px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.component-item-card.expanded .component-icon {
|
||||
color: #3b82f6;
|
||||
}
|
||||
|
||||
.component-item-name {
|
||||
flex: 1;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: var(--color-text-primary);
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.component-item-card.expanded .component-item-name {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.component-item-card .component-remove-btn {
|
||||
@@ -687,10 +708,10 @@
|
||||
justify-content: center;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--color-text-tertiary);
|
||||
color: #555;
|
||||
cursor: pointer;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
padding: 3px;
|
||||
border-radius: 2px;
|
||||
opacity: 0;
|
||||
transition: all 0.1s ease;
|
||||
}
|
||||
@@ -700,14 +721,55 @@
|
||||
}
|
||||
|
||||
.component-item-card .component-remove-btn:hover {
|
||||
background: var(--color-error);
|
||||
color: var(--color-text-inverse);
|
||||
background: #ef4444;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.component-item-content {
|
||||
padding: 8px 10px;
|
||||
border-top: 1px solid var(--color-border-default);
|
||||
background: var(--color-bg-base);
|
||||
padding: 6px 8px 8px 8px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
||||
background: #1e1e23;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Property rows inside component */
|
||||
.component-item-content .property-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 22px;
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.component-item-content .property-row:hover {
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
|
||||
/* Code Preview */
|
||||
.code-preview-section {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.code-preview-section .code-preview-container {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.code-preview-container {
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.code-preview-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user