Files
esengine/packages/editor-app/src/styles/EntityInspector.css

831 lines
15 KiB
CSS

.entity-inspector {
display: flex;
flex-direction: column;
height: 100%;
background-color: #1a1a1f;
color: var(--color-text-primary);
position: relative;
}
.inspector-header {
display: flex;
align-items: center;
gap: 8px;
height: 32px;
padding: 0 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
background-color: #252529;
flex-shrink: 0;
}
.inspector-header-icon {
color: var(--color-text-secondary);
flex-shrink: 0;
}
.inspector-header h3 {
margin: 0;
font-size: var(--font-size-sm);
font-weight: var(--font-weight-semibold);
color: var(--color-text-primary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.inspector-content {
flex: 1;
display: flex;
flex-direction: column;
overflow-y: scroll;
overflow-x: hidden;
padding: 8px;
min-height: 0;
}
.inspector-content::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.inspector-content::-webkit-scrollbar-track {
background: var(--color-bg-base);
}
.inspector-content::-webkit-scrollbar-thumb {
background: rgba(121, 121, 121, 0.4);
border-radius: 4px;
}
.inspector-content::-webkit-scrollbar-thumb:hover {
background: rgba(100, 100, 100, 0.7);
}
.inspector-content::-webkit-scrollbar-corner {
background: transparent;
}
.inspector-section {
margin-bottom: 8px;
padding: 0;
background-color: transparent;
border-radius: 0;
}
.inspector-section:last-child {
margin-bottom: 0;
}
.section-header {
display: flex;
align-items: center;
gap: var(--spacing-sm);
font-size: var(--font-size-xs);
font-weight: var(--font-weight-semibold);
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: var(--spacing-sm);
padding-bottom: var(--spacing-xs);
border-bottom: 1px solid var(--color-border-subtle);
}
.section-icon {
color: var(--color-text-tertiary);
flex-shrink: 0;
}
.section-header span {
flex: 1;
}
.add-component-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
background-color: var(--color-primary);
color: var(--color-text-inverse);
border: none;
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition-fast);
}
.add-component-btn:hover {
background-color: var(--color-primary-hover);
transform: scale(1.1);
}
.add-component-btn:active {
transform: scale(0.95);
}
.section-content {
padding: var(--spacing-sm) 0;
}
.info-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--spacing-xs) var(--spacing-sm);
font-size: var(--font-size-base);
border-radius: var(--radius-sm);
transition: background-color var(--transition-fast);
}
.info-row:hover {
background-color: var(--color-bg-hover);
}
.info-label {
color: var(--color-text-secondary);
font-weight: var(--font-weight-medium);
font-size: var(--font-size-sm);
}
.info-value {
color: var(--color-text-primary);
font-size: var(--font-size-sm);
font-family: var(--font-family-mono);
}
.component-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
min-height: min-content;
}
.component-item {
background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-base) 100%);
border: 1px solid var(--color-border-default);
border-radius: var(--radius-md);
overflow: visible;
transition: all var(--transition-base);
display: flex;
flex-direction: column;
min-height: min-content;
}
.component-item:hover {
border-color: var(--color-border-strong);
box-shadow: var(--shadow-sm);
}
.component-item.expanded {
background: var(--color-bg-overlay);
box-shadow: var(--shadow-md);
overflow: visible;
}
.component-header {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
cursor: pointer;
transition: background-color var(--transition-fast);
user-select: none;
}
.component-header:hover {
background-color: var(--color-bg-hover);
}
.component-expand-btn {
display: inline-flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: var(--color-text-secondary);
padding: 0;
cursor: pointer;
transition: all var(--transition-fast);
flex-shrink: 0;
}
.component-expand-btn:hover {
color: var(--color-primary);
transform: scale(1.1);
}
.component-icon {
display: flex;
align-items: center;
color: var(--color-text-secondary);
flex-shrink: 0;
transition: color var(--transition-fast);
}
.component-item:hover .component-icon,
.component-item.expanded .component-icon {
color: var(--color-primary);
}
.component-name {
flex: 1;
color: var(--color-text-primary);
font-size: var(--font-size-base);
font-weight: var(--font-weight-medium);
}
.remove-component-btn {
display: inline-flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: var(--color-text-tertiary);
padding: var(--spacing-xs);
cursor: pointer;
border-radius: var(--radius-sm);
transition: all var(--transition-fast);
flex-shrink: 0;
opacity: 0;
}
.component-header:hover .remove-component-btn {
opacity: 1;
}
.remove-component-btn:hover {
background-color: var(--color-error);
color: var(--color-text-inverse);
transform: scale(1.1);
}
.remove-component-btn:active {
transform: scale(0.95);
}
.component-properties {
border-top: 1px solid var(--color-border-default);
background-color: var(--color-bg-base);
overflow: visible;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: var(--spacing-4xl) var(--spacing-lg);
text-align: center;
color: var(--color-text-secondary);
height: 100%;
}
.empty-icon {
color: var(--color-text-tertiary);
margin-bottom: var(--spacing-md);
opacity: 0.5;
}
.empty-title {
font-size: var(--font-size-base);
font-weight: var(--font-weight-medium);
color: var(--color-text-secondary);
margin-bottom: var(--spacing-xs);
}
.empty-hint {
font-size: var(--font-size-sm);
color: var(--color-text-tertiary);
}
.empty-state-small {
padding: var(--spacing-lg);
text-align: center;
color: var(--color-text-tertiary);
font-size: var(--font-size-sm);
font-style: italic;
}
.entity-name {
font-size: 12px;
font-weight: 500;
color: var(--color-text-primary);
}
.section-title {
font-size: 10px;
font-weight: 600;
color: #888;
text-transform: uppercase;
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: 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 {
margin-bottom: 0;
}
.property-field:hover {
background-color: rgba(255, 255, 255, 0.03);
}
.property-label {
color: #888;
font-weight: 400;
flex-shrink: 0;
min-width: 70px;
font-size: 11px;
}
.property-value-text {
color: #ccc;
text-align: right;
word-break: break-word;
font-size: 11px;
flex: 1;
font-family: var(--font-family-mono);
}
.component-remove-btn {
display: inline-flex;
align-items: center;
justify-content: center;
background: none;
border: none;
color: var(--color-text-tertiary);
padding: 4px;
cursor: pointer;
border-radius: 3px;
transition: all 0.15s;
flex-shrink: 0;
opacity: 0;
margin-left: auto;
}
.component-header:hover .component-remove-btn {
opacity: 1;
}
.component-remove-btn:hover {
background-color: var(--color-error);
color: white;
}
.empty-inspector {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 24px;
text-align: center;
height: 100%;
}
.child-node-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 10px;
background-color: rgba(255, 255, 255, 0.03);
border-radius: 4px;
font-size: 12px;
transition: background-color 0.15s;
cursor: default;
}
.child-node-item:hover {
background-color: rgba(255, 255, 255, 0.05);
}
.child-node-index {
color: #666;
min-width: 20px;
font-size: 12px;
}
.child-node-name {
color: #ccc;
flex: 1;
font-size: 12px;
}
.file-preview-content {
background: #1e1e1e;
border: 1px solid #3e3e3e;
border-radius: 4px;
padding: 12px;
max-height: 400px;
overflow-y: auto;
font-family: Consolas, Monaco, monospace;
font-size: 12px;
line-height: 1.6;
color: #d4d4d4;
white-space: pre-wrap;
word-break: break-word;
}
.file-preview-content::-webkit-scrollbar {
width: 10px;
}
.file-preview-content::-webkit-scrollbar-track {
background: #1e1e1e;
}
.file-preview-content::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 5px;
}
.file-preview-content::-webkit-scrollbar-thumb:hover {
background: #4e4e4e;
}
.spin-slow {
animation: spin 2s linear infinite;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* 添加组件菜单样式 */
.section-title-with-action {
display: flex;
justify-content: space-between;
align-items: center;
}
.component-menu-container {
position: relative;
}
.add-component-trigger {
display: flex;
align-items: center;
gap: 3px;
padding: 3px 6px;
background: #3b82f6;
border: none;
border-radius: 2px;
color: #fff;
cursor: pointer;
font-size: 10px;
font-weight: 500;
transition: all 0.1s ease;
}
.add-component-trigger:hover {
background: #2563eb;
}
.add-component-trigger:active {
background: #1d4ed8;
}
.component-dropdown-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999;
}
.component-dropdown {
position: fixed;
min-width: 220px;
max-height: 320px;
background: var(--color-bg-elevated);
border: 1px solid var(--color-border-strong);
border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
z-index: 1000;
overflow: hidden;
animation: dropdownSlide 0.15s ease;
}
@keyframes dropdownSlide {
from {
opacity: 0;
transform: translateY(-8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.component-dropdown-search {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid var(--color-border-default);
background: var(--color-bg-base);
}
.component-dropdown-search svg {
color: var(--color-text-tertiary);
flex-shrink: 0;
}
.component-dropdown-search input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--color-text-primary);
font-size: 12px;
}
.component-dropdown-search input::placeholder {
color: var(--color-text-tertiary);
}
.component-dropdown-empty {
padding: 16px 12px;
text-align: center;
color: var(--color-text-tertiary);
font-size: 12px;
}
.component-dropdown-list {
max-height: 260px;
overflow-y: auto;
padding: 4px 0;
}
.component-dropdown-list::-webkit-scrollbar {
width: 6px;
}
.component-dropdown-list::-webkit-scrollbar-track {
background: transparent;
}
.component-dropdown-list::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.15);
border-radius: 3px;
}
.component-dropdown-list::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.25);
}
.component-category-group {
margin-bottom: 4px;
}
.component-category-group:last-child {
margin-bottom: 0;
}
.component-category-header {
display: flex;
align-items: center;
gap: 6px;
width: 100%;
padding: 8px 12px;
background: var(--color-bg-base);
border: none;
color: var(--color-text-secondary);
font-size: 11px;
font-weight: 600;
cursor: pointer;
text-align: left;
transition: all var(--transition-fast);
}
.component-category-header:hover {
background: var(--color-bg-hover);
color: var(--color-text-primary);
}
.component-category-header svg {
color: var(--color-text-tertiary);
}
.component-category-count {
margin-left: auto;
padding: 1px 6px;
background: var(--color-bg-inset);
border-radius: 10px;
font-size: 10px;
font-weight: 500;
color: var(--color-text-tertiary);
}
.component-category-label {
padding: 6px 12px 4px;
font-size: 10px;
font-weight: 600;
color: var(--color-text-tertiary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.component-dropdown-item {
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
width: 100%;
padding: 6px 12px 6px 28px;
background: transparent;
border: none;
color: var(--color-text-primary);
cursor: pointer;
text-align: left;
transition: all 0.1s ease;
}
.component-dropdown-item svg {
color: var(--color-text-tertiary);
flex-shrink: 0;
}
.component-dropdown-item:hover {
background: var(--color-bg-hover);
}
.component-dropdown-item:active {
background: var(--color-primary);
}
.component-dropdown-item-name {
font-size: 12px;
font-weight: 500;
}
.component-dropdown-item-desc {
font-size: 10px;
color: var(--color-text-tertiary);
margin-top: 2px;
}
/* 组件列表项样式 */
.component-item-card {
margin-bottom: 2px;
background: #2a2a2f;
border: none;
border-radius: 0;
overflow: visible;
transition: none;
border-left: 3px solid #4a4a50;
}
.component-item-card:hover {
background: #2e2e33;
}
.component-item-card.expanded {
border-left-color: #3b82f6;
background: #252529;
}
.component-item-header {
display: flex;
align-items: center;
padding: 6px 8px;
background: transparent;
cursor: pointer;
user-select: none;
transition: background 0.1s ease;
min-height: 28px;
}
.component-item-header:hover {
background: rgba(255, 255, 255, 0.03);
}
.component-expand-icon {
display: flex;
align-items: center;
color: #666;
transition: color 0.1s ease;
width: 14px;
}
.component-item-card:hover .component-expand-icon,
.component-item-card.expanded .component-expand-icon {
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;
font-size: 11px;
font-weight: 500;
color: #ccc;
}
.component-item-card.expanded .component-item-name {
color: #fff;
}
.component-item-card .component-remove-btn {
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
color: #555;
cursor: pointer;
padding: 3px;
border-radius: 2px;
opacity: 0;
transition: all 0.1s ease;
}
.component-item-header:hover .component-remove-btn {
opacity: 1;
}
.component-item-card .component-remove-btn:hover {
background: #ef4444;
color: #fff;
}
.component-item-content {
padding: 6px 8px 8px 8px;
border-top: 1px solid rgba(255, 255, 255, 0.05);
background: #1e1e23;
overflow: visible;
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;
}