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

@@ -586,9 +586,44 @@
.profiler-table-cell.name .expand-icon {
color: #666;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 14px;
height: 14px;
}
.profiler-table-cell.name .expand-icon.clickable {
cursor: pointer;
}
.profiler-table-cell.name .expand-icon.clickable:hover {
color: #fff;
background: rgba(255, 255, 255, 0.1);
border-radius: 2px;
}
.profiler-table-cell.name .expand-icon.placeholder {
visibility: hidden;
}
/* 层级行的背景色变化 */
.profiler-table-row.depth-1 {
background: rgba(255, 255, 255, 0.02);
}
.profiler-table-row.depth-2 {
background: rgba(255, 255, 255, 0.04);
}
.profiler-table-row.depth-3 {
background: rgba(255, 255, 255, 0.06);
}
.profiler-table-row.depth-4 {
background: rgba(255, 255, 255, 0.08);
}
.profiler-table-cell.name .category-dot {
width: 6px;
height: 6px;

View File

@@ -1,445 +0,0 @@
.console-panel {
display: flex;
flex-direction: column;
height: 100%;
background: var(--color-bg-base);
position: relative;
}
.console-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
background: var(--color-bg-elevated);
border-bottom: 1px solid var(--color-border-default);
flex-shrink: 0;
gap: 8px;
height: 26px;
}
.console-toolbar-left {
display: flex;
align-items: center;
gap: 8px;
flex: 1;
}
.console-toolbar-right {
display: flex;
align-items: center;
gap: 4px;
}
.console-btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 6px;
background: transparent;
border: none;
border-radius: var(--radius-sm);
color: var(--color-text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
}
.console-btn:hover {
background: var(--color-bg-hover);
color: var(--color-text-primary);
}
.console-search {
display: flex;
align-items: center;
gap: 6px;
flex: 1;
max-width: 300px;
background: var(--color-bg-inset);
border: 1px solid var(--color-border-default);
border-radius: var(--radius-sm);
padding: 4px 8px;
color: var(--color-text-tertiary);
}
.console-search:focus-within {
border-color: var(--color-primary);
color: var(--color-text-primary);
}
.console-search input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--color-text-primary);
font-size: var(--font-size-xs);
font-family: var(--font-family-mono);
}
.console-search input::placeholder {
color: var(--color-text-tertiary);
}
.console-filter-btn {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 8px;
background: transparent;
border: 1px solid transparent;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: var(--font-size-xs);
font-weight: 500;
transition: all var(--transition-fast);
opacity: 0.5;
}
.console-filter-btn:hover {
opacity: 1;
background: var(--color-bg-hover);
}
.console-filter-btn.active {
opacity: 1;
border-color: currentColor;
background: rgba(255, 255, 255, 0.05);
}
.console-filter-btn:nth-child(1) {
color: #10b981;
}
.console-filter-btn:nth-child(1).active {
color: #34d399;
border-color: #10b981;
}
.console-filter-btn:nth-child(2) {
color: #858585;
}
.console-filter-btn:nth-child(2).active {
color: #a0a0a0;
border-color: #858585;
}
.console-filter-btn:nth-child(3) {
color: #4a9eff;
}
.console-filter-btn:nth-child(3).active {
color: #6eb3ff;
border-color: #4a9eff;
}
.console-filter-btn:nth-child(4) {
color: #ffc107;
}
.console-filter-btn:nth-child(4).active {
color: #ffd54f;
border-color: #ffc107;
}
.console-filter-btn:nth-child(5) {
color: #f44336;
}
.console-filter-btn:nth-child(5).active {
color: #ef5350;
border-color: #f44336;
}
.console-filter-btn span {
font-size: var(--font-size-xs);
font-family: var(--font-family-mono);
}
.console-content {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
font-family: var(--font-family-mono);
font-size: var(--font-size-xs);
line-height: 1.4;
}
.console-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: var(--color-text-tertiary);
gap: 8px;
}
.console-empty p {
margin: 0;
font-size: var(--font-size-sm);
}
.log-entry {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 4px 12px;
border-bottom: 1px solid var(--color-border-subtle);
transition: background-color var(--transition-fast);
}
.log-entry:hover {
background: rgba(255, 255, 255, 0.02);
}
.log-entry-icon {
display: flex;
align-items: center;
padding-top: 2px;
flex-shrink: 0;
}
.log-entry-time {
color: var(--color-text-tertiary);
font-size: var(--font-size-xs);
white-space: nowrap;
padding-top: 2px;
flex-shrink: 0;
font-variant-numeric: tabular-nums;
}
.log-entry-source {
color: var(--color-text-secondary);
font-size: var(--font-size-xs);
white-space: nowrap;
padding-top: 2px;
flex-shrink: 0;
opacity: 0.7;
}
.log-entry-source.source-remote {
color: #4a9eff;
opacity: 1;
font-weight: 600;
}
.log-entry-client {
color: #10b981;
font-size: calc(var(--font-size-xs) - 2px);
white-space: nowrap;
padding: 1px 6px;
flex-shrink: 0;
background: rgba(16, 185, 129, 0.15);
border: 1px solid rgba(16, 185, 129, 0.4);
border-radius: var(--radius-sm);
font-weight: 600;
font-family: var(--font-family-mono);
}
.log-entry-remote {
border-left: 2px solid #4a9eff;
background: rgba(74, 158, 255, 0.05);
}
.log-entry-expander {
display: flex;
align-items: center;
padding-top: 2px;
cursor: pointer;
color: var(--color-text-secondary);
flex-shrink: 0;
transition: color var(--transition-fast);
}
.log-entry-expander:hover {
color: var(--color-text-primary);
}
.log-entry-expanded {
flex-direction: column;
align-items: flex-start;
}
.log-entry-expanded .log-entry-message {
padding-left: 22px;
width: 100%;
}
.log-entry-message {
flex: 1;
color: var(--color-text-primary);
word-break: break-word;
padding-top: 2px;
}
.log-message-container {
display: flex;
align-items: flex-start;
gap: 8px;
width: 100%;
}
.log-message-preview {
opacity: 0.9;
flex: 1;
}
.log-open-json-btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 4px;
background: var(--color-primary);
border: none;
border-radius: var(--radius-sm);
color: white;
cursor: pointer;
opacity: 0.7;
transition: all var(--transition-fast);
flex-shrink: 0;
}
.log-open-json-btn:hover {
opacity: 1;
transform: scale(1.1);
}
.log-expand-btn {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 8px;
padding: 2px 6px;
background: var(--color-bg-elevated);
border: 1px solid var(--color-border-default);
border-radius: var(--radius-sm);
color: var(--color-primary);
cursor: pointer;
font-size: var(--font-size-xs);
font-family: var(--font-family-mono);
transition: all var(--transition-fast);
}
.log-expand-btn:hover {
background: var(--color-bg-hover);
border-color: var(--color-primary);
}
.log-message-json {
margin: 4px 0 0 0;
padding: 8px;
background: rgba(0, 0, 0, 0.3);
border-radius: var(--radius-sm);
border: 1px solid var(--color-border-default);
font-family: var(--font-family-mono);
font-size: var(--font-size-xs);
line-height: 1.5;
overflow: auto;
white-space: pre;
color: #a0e7a0;
max-height: 400px;
}
.log-message-json::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.log-message-json::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.2);
border-radius: 4px;
}
.log-message-json::-webkit-scrollbar-thumb {
background: rgba(160, 231, 160, 0.3);
border-radius: 4px;
}
.log-message-json::-webkit-scrollbar-thumb:hover {
background: rgba(160, 231, 160, 0.5);
}
.log-entry-debug {
color: var(--color-text-tertiary);
}
.log-entry-debug .log-entry-icon {
color: #858585;
}
.log-entry-info .log-entry-icon {
color: #4a9eff;
}
.log-entry-warn {
background: rgba(255, 193, 7, 0.05);
}
.log-entry-warn .log-entry-icon {
color: #ffc107;
}
.log-entry-error {
background: rgba(244, 67, 54, 0.05);
}
.log-entry-error .log-entry-icon {
color: #f44336;
}
.console-scroll-to-bottom {
position: absolute;
bottom: 12px;
left: 50%;
transform: translateX(-50%);
padding: 6px 12px;
background: var(--color-primary);
color: var(--color-text-inverse);
border: none;
border-radius: var(--radius-sm);
font-size: var(--font-size-xs);
font-weight: 500;
cursor: pointer;
box-shadow: var(--shadow-md);
transition: all var(--transition-fast);
z-index: var(--z-index-above);
}
.console-scroll-to-bottom:hover {
background: var(--color-primary-hover);
transform: translateX(-50%) translateY(-2px);
box-shadow: var(--shadow-lg);
}
.console-scroll-to-bottom:active {
transform: translateX(-50%) translateY(0);
}
/* Scrollbar */
.console-content::-webkit-scrollbar {
width: 10px;
}
.console-content::-webkit-scrollbar-track {
background: var(--color-bg-elevated);
}
.console-content::-webkit-scrollbar-thumb {
background: var(--color-border-default);
border-radius: 5px;
}
.console-content::-webkit-scrollbar-thumb:hover {
background: var(--color-text-secondary);
}
@media (prefers-reduced-motion: reduce) {
.console-btn,
.console-filter-btn,
.log-entry,
.console-scroll-to-bottom {
transition: none;
}
}

View File

@@ -5,24 +5,30 @@
border-radius: 4px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
padding: 4px 0;
min-width: 180px;
min-width: 200px;
z-index: var(--z-index-popover);
font-size: 13px;
}
.context-menu.submenu {
position: fixed;
}
.context-menu-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
padding-right: 24px;
color: #cccccc;
cursor: pointer;
transition: background-color 0.1s ease;
user-select: none;
position: relative;
}
.context-menu-item:hover:not(.disabled) {
background-color: #383838;
background-color: #094771;
color: #ffffff;
}
@@ -32,6 +38,10 @@
opacity: 0.5;
}
.context-menu-item.has-submenu {
padding-right: 28px;
}
.context-menu-icon {
display: flex;
align-items: center;
@@ -51,8 +61,41 @@
white-space: nowrap;
}
.context-menu-shortcut {
color: #888888;
font-size: 11px;
margin-left: 24px;
white-space: nowrap;
}
.context-menu-item:hover:not(.disabled) .context-menu-shortcut {
color: #aaaaaa;
}
.context-menu-arrow {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
color: #888888;
}
.context-menu-item:hover:not(.disabled) .context-menu-arrow {
color: #ffffff;
}
.context-menu-separator {
height: 1px;
background-color: #3e3e42;
margin: 4px 0;
}
/* Section header in submenu */
.context-menu-section-header {
padding: 4px 12px;
color: #888888;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
cursor: default;
}

View File

@@ -318,15 +318,6 @@
background: #5a5a5a;
}
/* Hide timestamp/source based on settings */
.output-log-content.hide-timestamp .output-log-entry-time {
display: none;
}
.output-log-content.hide-source .output-log-entry-source {
display: none;
}
/* Empty State */
.output-log-empty {
display: flex;
@@ -345,12 +336,7 @@
/* ==================== Log Entry ==================== */
.output-log-entry {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 4px 12px;
border-bottom: 1px solid #2a2a2a;
line-height: 1.4;
transition: background 0.1s ease;
}
@@ -358,6 +344,19 @@
background: rgba(255, 255, 255, 0.02);
}
.output-log-entry.expanded {
background: rgba(255, 255, 255, 0.03);
}
.output-log-entry-main {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 6px 12px;
line-height: 1.4;
cursor: pointer;
}
.output-log-entry-icon {
display: flex;
align-items: center;
@@ -389,78 +388,69 @@
font-weight: 600;
}
.output-log-entry-client {
color: #10b981;
font-size: 10px;
white-space: nowrap;
padding: 1px 6px;
flex-shrink: 0;
background: rgba(16, 185, 129, 0.15);
border: 1px solid rgba(16, 185, 129, 0.4);
border-radius: 3px;
font-weight: 600;
}
.output-log-entry-message {
flex: 1;
color: #e0e0e0;
word-break: break-word;
padding-top: 2px;
white-space: pre-wrap;
}
.output-log-message-container {
display: flex;
align-items: flex-start;
gap: 8px;
}
.output-log-message-text {
flex: 1;
}
.output-log-message-preview {
opacity: 0.9;
}
.output-log-expand-btn {
display: inline;
margin-left: 8px;
padding: 2px 6px;
background: #3c3c3c;
border: 1px solid #4a4a4a;
border-radius: 3px;
color: #3b82f6;
font-size: 10px;
cursor: pointer;
transition: all 0.1s ease;
}
.output-log-expand-btn:hover {
background: #4a4a4a;
border-color: #3b82f6;
}
.output-log-json-btn {
.output-log-entry-copy {
display: flex;
align-items: center;
justify-content: center;
padding: 2px 6px;
background: #3b82f6;
border: none;
border-radius: 3px;
color: #fff;
font-size: 10px;
font-weight: 600;
width: 22px;
height: 22px;
padding: 0;
background: transparent;
border: 1px solid transparent;
border-radius: 4px;
color: #666;
cursor: pointer;
opacity: 0.8;
transition: all 0.1s ease;
opacity: 0;
transition: all 0.15s ease;
flex-shrink: 0;
}
.output-log-json-btn:hover {
.output-log-entry:hover .output-log-entry-copy {
opacity: 1;
}
.output-log-entry-copy:hover {
background: #3c3c3c;
border-color: #5a5a5a;
color: #e0e0e0;
}
/* Stack Trace (expanded) */
.output-log-entry-stack {
padding: 8px 12px 12px 42px;
background: rgba(0, 0, 0, 0.2);
border-top: 1px solid #2a2a2a;
}
.output-log-stack-header {
color: #888;
font-size: 11px;
margin-bottom: 6px;
font-weight: 600;
}
.output-log-stack-line {
color: #888;
font-size: 11px;
line-height: 1.6;
white-space: pre;
padding-left: 12px;
}
.output-log-stack-line:hover {
color: #4a9eff;
background: rgba(74, 158, 255, 0.1);
cursor: pointer;
}
/* Log Level Styles */
.output-log-entry-debug {
color: #858585;
@@ -470,10 +460,18 @@
color: #858585;
}
.output-log-entry-debug .output-log-entry-message {
color: #858585;
}
.output-log-entry-info .output-log-entry-icon {
color: #4a9eff;
}
.output-log-entry-info .output-log-entry-message {
color: #e0e0e0;
}
.output-log-entry-warn {
background: rgba(255, 193, 7, 0.05);
}
@@ -482,6 +480,10 @@
color: #ffc107;
}
.output-log-entry-warn .output-log-entry-message {
color: #ffc107;
}
.output-log-entry-error {
background: rgba(244, 67, 54, 0.08);
}
@@ -490,6 +492,10 @@
color: #f44336;
}
.output-log-entry-error .output-log-entry-message {
color: #f44336;
}
.log-entry-remote {
border-left: 2px solid #4a9eff;
background: rgba(74, 158, 255, 0.03);

View File

@@ -88,6 +88,30 @@
}
}
.profiler-window-controls {
display: flex;
align-items: center;
gap: 4px;
}
.profiler-window-btn {
padding: 6px;
background: transparent;
border: none;
border-radius: var(--radius-sm);
color: var(--color-text-secondary);
cursor: pointer;
transition: all var(--transition-fast);
display: flex;
align-items: center;
justify-content: center;
}
.profiler-window-btn:hover {
background: var(--color-bg-hover);
color: var(--color-text-primary);
}
.profiler-window-close {
padding: 6px;
background: transparent;
@@ -106,6 +130,24 @@
color: var(--color-text-primary);
}
/* Fullscreen styles */
.profiler-window-overlay.fullscreen {
background: rgba(0, 0, 0, 0.95);
}
.profiler-window.fullscreen {
border: none;
border-radius: 0;
max-height: none;
height: 100vh;
width: 100vw;
max-width: none;
}
.profiler-window.fullscreen .profiler-window-header {
border-radius: 0;
}
.profiler-window-toolbar {
display: flex;
align-items: center;

View File

@@ -243,10 +243,20 @@
opacity: 0.5;
}
.outliner-item.drop-target {
/* Drop Indicators */
.outliner-item.drop-before {
border-top: 2px solid #4a9eff;
}
.outliner-item.drop-after {
border-bottom: 2px solid #4a9eff;
}
.outliner-item.drop-inside {
background: rgba(74, 158, 255, 0.2);
box-shadow: inset 0 0 0 1px #4a9eff;
}
.outliner-item.disabled {
opacity: 0.5;
}
@@ -291,6 +301,17 @@
flex-shrink: 0;
}
.outliner-item-expand.clickable {
cursor: pointer;
border-radius: 3px;
transition: background 0.15s ease, color 0.15s ease;
}
.outliner-item-expand.clickable:hover {
color: #fff;
background: rgba(255, 255, 255, 0.1);
}
.outliner-item-expand:hover {
color: #ccc;
}