Feature/editor optimization (#251)

* refactor: 编辑器/运行时架构拆分与构建系统升级

* feat(core): 层级系统重构与UI变换矩阵修复

* refactor: 移除 ecs-components 聚合包并修复跨包组件查找问题

* fix(physics): 修复跨包组件类引用问题

* feat: 统一运行时架构与浏览器运行支持

* feat(asset): 实现浏览器运行时资产加载系统

* fix: 修复文档、CodeQL安全问题和CI类型检查错误

* fix: 修复文档、CodeQL安全问题和CI类型检查错误

* fix: 修复文档、CodeQL安全问题、CI类型检查和测试错误

* test: 补齐核心模块测试用例,修复CI构建配置

* fix: 修复测试用例中的类型错误和断言问题

* fix: 修复 turbo build:npm 任务的依赖顺序问题

* fix: 修复 CI 构建错误并优化构建性能
This commit is contained in:
YHH
2025-12-01 22:28:51 +08:00
committed by GitHub
parent 189714c727
commit b42a7b4e43
468 changed files with 18301 additions and 9075 deletions

View File

@@ -0,0 +1,293 @@
/* ==================== Tile Set Selector Panel Styles ==================== */
.tileset-selector-panel {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background: #252526;
user-select: none;
}
/* ==================== Tool Buttons Row ==================== */
.tileset-tools {
display: flex;
padding: 8px;
gap: 4px;
border-bottom: 1px solid #1a1a1a;
background: #2d2d30;
}
.tileset-tool-btn {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
flex: 1;
padding: 8px 4px;
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 3px;
color: #888;
cursor: pointer;
transition: all 0.15s ease;
}
.tileset-tool-btn span {
font-size: 10px;
font-weight: 500;
}
.tileset-tool-btn svg {
width: 20px;
height: 20px;
}
.tileset-tool-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
border-color: #4c4c4c;
}
.tileset-tool-btn.active {
background: linear-gradient(180deg, #ffc107 0%, #e6a800 100%);
border-color: #cc9600;
color: #1a1a1a;
}
.tileset-tool-btn.active:hover {
background: linear-gradient(180deg, #ffd54f 0%, #ffca28 100%);
}
.tileset-tool-btn.active svg {
color: #1a1a1a;
}
/* ==================== Tileset Selector Section ==================== */
.tileset-selector {
padding: 8px;
border-bottom: 1px solid #1a1a1a;
}
.tileset-selector-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.tileset-selector label {
font-size: 11px;
color: #888;
}
.tileset-selector-actions {
display: flex;
gap: 2px;
}
.tileset-action-btn {
display: flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
padding: 0;
background: transparent;
border: none;
border-radius: 2px;
color: #888;
cursor: pointer;
transition: all 0.1s ease;
}
.tileset-action-btn svg {
width: 14px;
height: 14px;
}
.tileset-action-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
}
/* ==================== Tileset Dropdown ==================== */
.tileset-dropdown-wrapper {
position: relative;
}
.tileset-dropdown-btn {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 26px;
padding: 0 8px;
background: #1e1e1e;
border: 1px solid #3c3c3c;
border-radius: 3px;
color: #c0c0c0;
font-size: 11px;
cursor: pointer;
transition: border-color 0.1s ease;
}
.tileset-dropdown-btn:hover {
border-color: #555;
}
.tileset-dropdown-btn span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tileset-dropdown-btn svg {
width: 12px;
height: 12px;
color: #888;
flex-shrink: 0;
}
.tileset-dropdown-menu {
position: absolute;
top: 100%;
left: 0;
right: 0;
margin-top: 2px;
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 3px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
z-index: 100;
max-height: 180px;
overflow-y: auto;
}
.tileset-dropdown-item {
display: block;
width: 100%;
height: 28px;
padding: 0 10px;
background: transparent;
border: none;
color: #c0c0c0;
font-size: 11px;
text-align: left;
cursor: pointer;
transition: background 0.1s ease;
line-height: 28px;
}
.tileset-dropdown-item:hover {
background: #3c3c3c;
}
.tileset-dropdown-item.selected {
background: #094771;
color: #fff;
}
.tileset-dropdown-item.add-new {
color: #4fc3f7;
}
.tileset-dropdown-divider {
height: 1px;
background: #3c3c3c;
margin: 4px 0;
}
/* ==================== Header with Zoom and Title ==================== */
.tileset-header {
display: flex;
align-items: center;
height: 28px;
padding: 0 8px;
background: #2a2a2a;
border-bottom: 1px solid #1a1a1a;
}
.tileset-zoom-label {
font-size: 10px;
color: #666;
margin-right: 8px;
font-family: 'Consolas', 'Monaco', monospace;
}
.tileset-title {
font-size: 11px;
font-weight: 500;
color: #a0a0a0;
}
/* ==================== Preview Area ==================== */
.tileset-preview-area {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
min-height: 180px;
overflow: auto;
background: #1a1a1a;
}
.tileset-empty-hint {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.tileset-select-btn {
padding: 8px 16px;
background: transparent;
border: 1px dashed #444;
border-radius: 3px;
color: #4fc3f7;
font-size: 11px;
cursor: pointer;
transition: all 0.15s ease;
}
.tileset-select-btn:hover {
background: rgba(79, 195, 247, 0.1);
border-color: #4fc3f7;
}
/* ==================== Selection Info ==================== */
.tileset-selection-info {
height: 24px;
padding: 0 8px;
font-size: 10px;
color: #888;
line-height: 24px;
text-align: center;
border-top: 1px solid #1a1a1a;
background: #2d2d30;
}
/* ==================== Scrollbar ==================== */
.tileset-preview-area::-webkit-scrollbar,
.tileset-dropdown-menu::-webkit-scrollbar {
width: 6px;
}
.tileset-preview-area::-webkit-scrollbar-track,
.tileset-dropdown-menu::-webkit-scrollbar-track {
background: transparent;
}
.tileset-preview-area::-webkit-scrollbar-thumb,
.tileset-dropdown-menu::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
.tileset-preview-area::-webkit-scrollbar-thumb:hover,
.tileset-dropdown-menu::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.2);
}

View File

@@ -0,0 +1,518 @@
/* ==================== Tilemap Details Panel Styles ==================== */
.tilemap-details-panel {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
background: #252526;
user-select: none;
}
/* ==================== Header ==================== */
.details-header {
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 10px;
background: #2d2d30;
border-bottom: 1px solid #1a1a1a;
}
.details-header-title {
font-size: 12px;
font-weight: 600;
color: #c0c0c0;
}
.details-header-actions {
display: flex;
align-items: center;
gap: 4px;
}
.details-search-inline {
display: flex;
align-items: center;
gap: 4px;
padding: 3px 8px;
background: #1e1e1e;
border: 1px solid #3c3c3c;
border-radius: 3px;
}
.details-search-inline svg {
color: #666;
flex-shrink: 0;
width: 12px;
height: 12px;
}
.details-search-inline input {
border: none;
background: transparent;
color: #c0c0c0;
font-size: 11px;
width: 60px;
outline: none;
}
.details-search-inline input::placeholder {
color: #555;
}
.details-settings-btn {
display: flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
padding: 0;
background: transparent;
border: none;
border-radius: 2px;
color: #888;
cursor: pointer;
transition: all 0.1s ease;
}
.details-settings-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
}
/* ==================== Content ==================== */
.details-content {
flex: 1;
overflow-y: auto;
}
.details-empty {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: #555;
font-size: 12px;
}
/* ==================== Section Styles ==================== */
.details-section {
border-bottom: 1px solid #1a1a1a;
}
.details-section-header {
display: flex;
align-items: center;
gap: 6px;
height: 28px;
padding: 0 10px;
font-size: 11px;
font-weight: 600;
color: #c0c0c0;
background: #2a2a2a;
cursor: pointer;
transition: background 0.1s ease;
}
.details-section-header:hover {
background: #333;
}
.details-section-header svg {
color: #888;
width: 12px;
height: 12px;
}
.details-section-content {
padding: 6px 0;
background: #252526;
}
/* ==================== Property Row ==================== */
.property-row {
display: flex;
align-items: center;
height: 26px;
padding: 0 10px 0 20px;
}
.property-row:hover {
background: #2a2a2a;
}
.property-row.indented {
padding-left: 32px;
}
.property-row label {
flex: 0 0 100px;
font-size: 11px;
color: #888;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.property-value {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
}
/* ==================== Layer Count Badge ==================== */
.layer-count-badge {
font-size: 11px;
color: #4fc3f7;
background: rgba(79, 195, 247, 0.15);
padding: 2px 8px;
border-radius: 3px;
font-weight: 500;
}
/* ==================== Input Styles ==================== */
.property-row input[type="number"],
.property-row input[type="text"],
.property-row select {
width: 100%;
height: 22px;
padding: 0 6px;
background: #1e1e1e;
border: 1px solid #3c3c3c;
border-radius: 2px;
color: #c0c0c0;
font-size: 11px;
outline: none;
}
.property-row input[type="number"]:focus,
.property-row input[type="text"]:focus,
.property-row select:focus {
border-color: #0078d4;
}
/* ==================== Toggle Row ==================== */
.toggle-row {
justify-content: space-between;
}
/* ==================== Property Toggle - Unified Style ==================== */
.property-toggle {
position: relative;
width: 36px;
height: 18px;
border-radius: 9px;
border: none;
cursor: pointer;
transition: all 0.15s ease;
flex-shrink: 0;
padding: 0;
}
.property-toggle-off {
background: #2a2a2a;
border: 1px solid #444;
}
.property-toggle-off:hover:not(:disabled) {
background: #333;
border-color: #555;
}
.property-toggle-on {
background: #3b82f6;
border: 1px solid #3b82f6;
}
.property-toggle-on:hover:not(:disabled) {
background: #2563eb;
border-color: #2563eb;
}
.property-toggle:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.property-toggle-thumb {
position: absolute;
top: 2px;
width: 12px;
height: 12px;
border-radius: 50%;
background: white;
transition: transform 0.15s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.property-toggle-off .property-toggle-thumb {
left: 2px;
transform: translateX(0);
}
.property-toggle-on .property-toggle-thumb {
left: 2px;
transform: translateX(18px);
}
/* Color Field */
.property-color-wrapper {
flex: 1;
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
position: relative;
}
.property-color-preview {
width: 32px;
height: 22px;
border-radius: 2px;
border: 1px solid #3a3a3a;
cursor: pointer;
flex-shrink: 0;
}
.property-color-preview:hover {
border-color: #555;
}
.property-input-color {
width: 0;
height: 0;
opacity: 0;
position: absolute;
pointer-events: none;
}
.property-input-color-text {
flex: 1;
min-width: 60px;
text-transform: uppercase;
letter-spacing: 0.05em;
font-family: 'Consolas', 'Monaco', monospace;
text-align: left;
}
.property-input {
background: #1a1a1a;
border: 1px solid #3a3a3a;
border-radius: 2px;
padding: 0 6px;
color: #ddd;
font-size: 11px;
height: 22px;
}
.property-input:hover {
border-color: #4a4a4a;
}
.property-input:focus {
outline: none;
border-color: #d4a029;
}
/* ==================== Asset Dropdown Button ==================== */
.asset-dropdown {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 22px;
padding: 0 6px;
background: #1e1e1e;
border: 1px solid #3c3c3c;
border-radius: 2px;
color: #c0c0c0;
font-size: 11px;
cursor: pointer;
text-align: left;
}
.asset-dropdown:hover {
border-color: #555;
}
.asset-dropdown span {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.asset-dropdown svg {
width: 10px;
height: 10px;
color: #888;
}
/* ==================== Layer List ==================== */
.layer-list-container {
margin: 4px 10px 4px 20px;
background: #1e1e1e;
border: 1px solid #3c3c3c;
border-radius: 2px;
max-height: 100px;
overflow-y: auto;
}
.layer-list-item {
display: flex;
align-items: center;
gap: 6px;
height: 24px;
padding: 0 8px;
font-size: 11px;
color: #c0c0c0;
cursor: pointer;
transition: background 0.1s ease;
}
.layer-list-item:hover {
background: #2a2a2a;
}
.layer-list-item.selected {
background: #094771;
color: #fff;
}
.layer-list-item .layer-icon {
font-size: 9px;
color: #4fc3f7;
}
/* ==================== Layer Visibility Button ==================== */
.layer-visibility-btn {
display: flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
padding: 0;
background: transparent;
border: none;
border-radius: 2px;
color: #4fc3f7;
cursor: pointer;
transition: all 0.1s ease;
flex-shrink: 0;
}
.layer-visibility-btn:hover {
background: rgba(79, 195, 247, 0.2);
}
.layer-visibility-btn.hidden {
color: #555;
}
.layer-visibility-btn.hidden:hover {
background: rgba(255, 255, 255, 0.1);
color: #888;
}
.layer-list-item.selected .layer-visibility-btn {
color: #fff;
}
.layer-list-item.selected .layer-visibility-btn.hidden {
color: rgba(255, 255, 255, 0.4);
}
/* ==================== Layer Action Buttons ==================== */
.layer-actions-row {
display: flex;
gap: 2px;
padding: 4px 10px 6px 20px;
}
.layer-action-btn {
display: flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
background: #2d2d30;
border: 1px solid #3c3c3c;
border-radius: 2px;
color: #888;
cursor: pointer;
transition: all 0.1s ease;
}
.layer-action-btn svg {
width: 12px;
height: 12px;
}
.layer-action-btn:hover:not(:disabled) {
background: #3c3c3c;
color: #e0e0e0;
}
.layer-action-btn:disabled {
opacity: 0.35;
cursor: not-allowed;
}
.layer-action-btn.add {
background: #1a3a1a;
border-color: #2a5a2a;
color: #5cb85c;
}
.layer-action-btn.add:hover {
background: #2a5a2a;
color: #7cd87c;
}
.layer-action-btn.danger:hover:not(:disabled) {
background: #5a2020;
border-color: #7a3030;
color: #f06060;
}
/* ==================== Selected Layer Name ==================== */
.selected-layer-name {
font-size: 11px;
font-weight: 500;
color: #c0c0c0;
}
/* ==================== Select Dropdown ==================== */
.property-row select {
appearance: none;
padding-right: 20px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 6px center;
cursor: pointer;
}
/* ==================== Scrollbar ==================== */
.details-content::-webkit-scrollbar,
.layer-list-container::-webkit-scrollbar {
width: 6px;
}
.details-content::-webkit-scrollbar-track,
.layer-list-container::-webkit-scrollbar-track {
background: transparent;
}
.details-content::-webkit-scrollbar-thumb,
.layer-list-container::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}
.details-content::-webkit-scrollbar-thumb:hover,
.layer-list-container::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.2);
}

View File

@@ -0,0 +1,564 @@
/* ==================== Tilemap Editor Styles ==================== */
/* Main Panel - 3-Column Layout */
.tilemap-editor-panel {
display: flex;
height: 100%;
background: #1e1e1e;
color: #e0e0e0;
}
/* ==================== Panel Divider ==================== */
.panel-divider {
flex-shrink: 0;
background: #1a1a1a;
transition: background 0.15s ease;
}
.panel-divider.horizontal {
width: 4px;
cursor: col-resize;
}
.panel-divider.vertical {
height: 4px;
cursor: row-resize;
}
.panel-divider:hover {
background: #0078d4;
}
.panel-divider:active {
background: #005a9e;
}
/* Empty state */
.tilemap-editor-panel .tilemap-editor-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: #666;
text-align: center;
}
.tilemap-editor-panel .tilemap-editor-empty svg {
margin-bottom: 16px;
opacity: 0.4;
}
.tilemap-editor-panel .tilemap-editor-empty h3 {
margin: 0 0 8px;
font-size: 16px;
color: #999;
}
.tilemap-editor-panel .tilemap-editor-empty p {
margin: 0;
font-size: 12px;
line-height: 1.5;
}
/* ==================== Center Viewport ==================== */
.tilemap-viewport {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
background: #1a1a1a;
position: relative;
}
/* ==================== Viewport Toolbar - 优化样式 ==================== */
.viewport-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 6px;
background: #2d2d30;
border-bottom: 1px solid #1a1a1a;
gap: 4px;
flex-shrink: 0;
}
.viewport-toolbar-left,
.viewport-toolbar-center,
.viewport-toolbar-right {
display: flex;
align-items: center;
gap: 2px;
}
.viewport-toolbar-center {
flex: 1;
justify-content: center;
}
.viewport-btn-group {
display: flex;
align-items: center;
gap: 1px;
background: #252526;
border-radius: 3px;
padding: 1px;
}
.viewport-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 3px;
height: 24px;
padding: 0 8px;
background: transparent;
border: none;
border-radius: 2px;
color: #a0a0a0;
font-size: 11px;
cursor: pointer;
transition: all 0.1s ease;
white-space: nowrap;
}
.viewport-btn:hover {
background: #3c3c3c;
color: #e0e0e0;
}
.viewport-btn.active {
background: #094771;
color: #fff;
}
.viewport-btn.icon {
width: 24px;
padding: 0;
}
.viewport-btn.snap-btn {
padding: 0 6px;
gap: 2px;
font-size: 10px;
font-family: 'Consolas', 'Monaco', monospace;
}
.viewport-btn.snap-btn svg {
width: 11px;
height: 11px;
}
.viewport-separator {
width: 1px;
height: 18px;
background: #3c3c3c;
margin: 0 4px;
}
.zoom-display {
min-width: 36px;
text-align: center;
font-size: 11px;
color: #a0a0a0;
font-family: 'Consolas', 'Monaco', monospace;
}
/* Exit fullscreen button */
.viewport-btn.exit-fullscreen {
background: linear-gradient(180deg, #e05a50 0%, #c0443a 100%);
color: #fff;
padding: 0 10px;
gap: 4px;
font-weight: 500;
border: 1px solid #a03028;
}
.viewport-btn.exit-fullscreen:hover {
background: linear-gradient(180deg, #f06a60 0%, #d0544a 100%);
color: #fff;
}
/* ==================== Info Overlay ==================== */
.viewport-info-overlay {
position: absolute;
top: 40px;
left: 8px;
z-index: 10;
display: flex;
flex-direction: column;
gap: 1px;
padding: 6px 8px;
background: rgba(30, 30, 30, 0.95);
border: 1px solid #3c3c3c;
border-radius: 3px;
font-size: 11px;
pointer-events: none;
}
.viewport-info-overlay .info-item {
display: flex;
align-items: center;
gap: 6px;
color: #888;
line-height: 1.4;
}
.viewport-info-overlay .info-item strong {
color: #c0c0c0;
font-weight: 600;
}
.viewport-info-overlay .info-item.warning {
color: #e6a700;
}
.viewport-info-overlay .info-item.warning svg {
flex-shrink: 0;
color: #e6a700;
}
/* ==================== Canvas Container ==================== */
.viewport-canvas-container {
flex: 1;
position: relative;
overflow: hidden;
min-height: 0;
background:
linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
background-size: 20px 20px;
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
background-color: #222;
}
.tilemap-canvas-container {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
}
.tilemap-canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* ==================== Ruler ==================== */
.viewport-ruler {
position: absolute;
bottom: 40px;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: flex-end;
pointer-events: none;
}
.ruler-marker {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
}
.ruler-line {
width: 100px;
height: 2px;
background: #555;
position: relative;
}
.ruler-line::before,
.ruler-line::after {
content: '';
position: absolute;
top: -4px;
width: 2px;
height: 10px;
background: #555;
}
.ruler-line::before {
left: 0;
}
.ruler-line::after {
right: 0;
}
.ruler-marker span {
font-size: 10px;
color: #555;
}
/* ==================== Watermark ==================== */
.viewport-watermark {
position: absolute;
bottom: 8px;
right: 8px;
font-size: 20px;
font-weight: 600;
color: rgba(255, 255, 255, 0.08);
pointer-events: none;
user-select: none;
letter-spacing: 1px;
}
/* ==================== Icon Buttons ==================== */
.icon-button {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border: none;
border-radius: 3px;
background: transparent;
color: #999;
cursor: pointer;
transition: all 0.1s ease;
}
.icon-button:hover {
background: #3c3c3c;
color: #e0e0e0;
}
.icon-button:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.icon-button.small {
width: 20px;
height: 20px;
}
.icon-button.danger:hover {
background: #5a1d1d;
color: #f48771;
}
/* ==================== Asset Picker Dialog ==================== */
.asset-picker-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.asset-picker-dialog {
width: 500px;
max-height: 600px;
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 6px;
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.asset-picker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-bottom: 1px solid #3c3c3c;
}
.asset-picker-header h3 {
margin: 0;
font-size: 14px;
font-weight: 600;
color: #e0e0e0;
}
.asset-picker-close {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border: none;
border-radius: 4px;
background: transparent;
color: #999;
cursor: pointer;
}
.asset-picker-close:hover {
background: #3c3c3c;
color: #e0e0e0;
}
.asset-picker-search {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
border-bottom: 1px solid #3c3c3c;
color: #999;
}
.asset-picker-search input {
flex: 1;
border: none;
background: transparent;
color: #e0e0e0;
font-size: 13px;
outline: none;
}
.asset-picker-search input::placeholder {
color: #666;
}
.asset-picker-content {
flex: 1;
overflow-y: auto;
min-height: 300px;
max-height: 400px;
}
.asset-picker-tree {
padding: 8px;
}
.asset-picker-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 8px;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
color: #e0e0e0;
}
.asset-picker-item:hover {
background: #2d2d30;
}
.asset-picker-item.selected {
background: #094771;
}
.asset-picker-item-icon {
display: flex;
align-items: center;
color: #999;
}
.asset-picker-item-name {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.asset-picker-loading,
.asset-picker-empty {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color: #666;
font-size: 13px;
}
.asset-picker-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
border-top: 1px solid #3c3c3c;
}
.asset-picker-selected {
flex: 1;
font-size: 12px;
color: #999;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.asset-picker-selected .placeholder {
font-style: italic;
}
.asset-picker-actions {
display: flex;
gap: 8px;
}
.asset-picker-actions button {
padding: 6px 12px;
border: none;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
}
.asset-picker-actions .btn-cancel {
background: #3c3c3c;
color: #e0e0e0;
}
.asset-picker-actions .btn-cancel:hover {
background: #4c4c4c;
}
.asset-picker-actions .btn-confirm {
background: #0078d4;
color: #fff;
}
.asset-picker-actions .btn-confirm:hover:not(:disabled) {
background: #106ebe;
}
.asset-picker-actions .btn-confirm:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.asset-picker-preview {
position: fixed;
z-index: 1001;
background: #252526;
border: 1px solid #3c3c3c;
border-radius: 4px;
padding: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
pointer-events: none;
}
.asset-picker-preview img {
display: block;
max-width: 150px;
max-height: 150px;
image-rendering: pixelated;
}
/* ==================== Tileset Canvas ==================== */
.tileset-canvas {
cursor: crosshair;
image-rendering: pixelated;
}