@mindexec/cli 0.2.478 → 0.2.479
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +323 -323
- package/codex-model-catalog.js +202 -202
- package/codex-runtime.js +1608 -1608
- package/desktop-workspace-state.cjs +120 -120
- package/electron/main.cjs +517 -517
- package/electron/preload.cjs +17 -17
- package/electron/recurring-update-owner-smoke.mjs +55 -55
- package/electron/recurring-update-owner.cjs +97 -97
- package/electron/source-smoke.mjs +108 -108
- package/electron/update-feed-resolver.cjs +79 -79
- package/electron/update-feed.json +10 -10
- package/electron/update-manager-smoke.mjs +146 -146
- package/electron/update-manager.cjs +297 -297
- package/electron/windows-package-smoke.mjs +156 -156
- package/launch-bridge.cjs +236 -236
- package/lzo1x.js +110 -110
- package/mode4-atlas-worker.js +440 -440
- package/mode4-atlas.js +130 -130
- package/package.json +1 -1
- package/port-guard.cjs +285 -285
- package/remote-fast/osx-arm64/MacScreenCaptureKitH264.swift +339 -339
- package/remote-fast/osx-arm64/MacSystemAudioCapture.swift +214 -214
- package/remote-fast/osx-arm64/UnixRawCaptureHelper.mjs +80 -80
- package/remote-fast/osx-arm64/livedesk-raw-capture-resampler.mjs +73 -73
- package/remote-fast/osx-arm64/mindexec-remote-fast.dll +0 -0
- package/remote-fast/osx-x64/MacScreenCaptureKitH264.swift +339 -339
- package/remote-fast/osx-x64/MacSystemAudioCapture.swift +214 -214
- package/remote-fast/osx-x64/UnixRawCaptureHelper.mjs +80 -80
- package/remote-fast/osx-x64/livedesk-raw-capture-resampler.mjs +73 -73
- package/remote-fast/osx-x64/mindexec-remote-fast.dll +0 -0
- package/remote-fast/win-x64/mindexec-remote-fast.dll +0 -0
- package/remote-hub.js +3698 -3698
- package/scripts/auth-session-smoke.mjs +262 -262
- package/scripts/board-render-ownership-smoke.mjs +85 -85
- package/scripts/codex-model-catalog-smoke.mjs +150 -150
- package/scripts/codex-runtime-home-smoke.mjs +58 -58
- package/scripts/codex-sdk-image-live-smoke.mjs +43 -43
- package/scripts/codex-sdk-image-runtime-smoke.mjs +122 -122
- package/scripts/codex-sdk-runtime-smoke.mjs +89 -89
- package/scripts/desktop-update-publisher-smoke.mjs +89 -89
- package/scripts/desktop-update-worker-smoke.mjs +72 -72
- package/scripts/desktop-workspace-state-smoke.mjs +81 -81
- package/scripts/drive-installed-update-smoke.mjs +67 -67
- package/scripts/npm-fresh-install-smoke.mjs +216 -216
- package/scripts/publish-mindexec-desktop-updates.mjs +224 -224
- package/scripts/remote-agent-managed-smoke.mjs +318 -318
- package/scripts/remote-agent-package-smoke.mjs +64 -64
- package/scripts/remote-agent-ws-smoke.mjs +269 -269
- package/scripts/remote-fast-live-rate-smoke.mjs +343 -343
- package/scripts/remote-fast-mdm-browser-smoke.mjs +453 -453
- package/scripts/remote-fleet-render-smoke.mjs +1350 -1350
- package/scripts/remote-frame-ws-smoke.mjs +234 -234
- package/scripts/remote-http-smoke.mjs +592 -592
- package/scripts/remote-hub-identity-smoke.mjs +146 -146
- package/scripts/remote-hub-scale-smoke.mjs +124 -124
- package/scripts/remote-hub-smoke.mjs +699 -699
- package/scripts/remote-input-ws-smoke.mjs +263 -263
- package/scripts/remote-registry-follower-smoke.mjs +815 -815
- package/scripts/setup-tree-sitter-grammars.mjs +59 -59
- package/server.js +7510 -7510
- package/start-bridge.bat +32 -32
- package/start-bridge.sh +81 -81
- package/tree-sitter-grammars/README.md +18 -0
- package/tree-sitter-grammars/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-go.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-java.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-python.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-rust.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-typescript.wasm +0 -0
- package/wwwroot/_content/MindExecution.Plugins.Admin/css/admin-dashboard.css +546 -546
- package/wwwroot/_content/MindExecution.Plugins.Directory/background.png +0 -0
- package/wwwroot/_content/MindExecution.Plugins.YouTube/css/youtube-search.css +251 -251
- package/wwwroot/_content/MindExecution.Shared/css/mind-map-overrides.css +3789 -3789
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Bold.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Regular.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/js/agent-visualization.js +27 -27
- package/wwwroot/_content/MindExecution.Shared/js/background-themes.js +1449 -1449
- package/wwwroot/_content/MindExecution.Shared/js/code-master.js +8316 -8316
- package/wwwroot/_content/MindExecution.Shared/js/file-system-helper.js +338 -338
- package/wwwroot/_content/MindExecution.Shared/js/marked.min.js +69 -69
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-animated-image-preview.js +270 -270
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-automation-edge-motion.js +170 -170
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-board-render-ownership.js +81 -81
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js +10506 -10506
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js.backup +1059 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-hotpath.js +902 -902
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +24637 -24637
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dev-guards.js +325 -325
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js +1491 -1491
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js.bak +434 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-glow-shader.js +70 -70
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-image-policy.js +218 -218
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-interactions.js +7078 -7078
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-plan-worker.js +160 -160
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-renderer.js +9958 -9958
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-video-placeholder.js +107 -107
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-logic-workers.js +1004 -1004
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-menu-manager.js +1351 -1351
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-multi-select.js +865 -865
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-node-search-worker.js +554 -554
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-nodes.js +4744 -4744
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-normal-boundary-optimizer.js +624 -624
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js +241 -241
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js.backup +372 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-pipeline.js +2290 -2290
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-remote-codecs.js +202 -202
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-render-plan.js +1971 -1971
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-text-lod-system.js +93 -93
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js +2391 -2391
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js.backup +1258 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-video-playback-controls.js +95 -95
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-visibility-worker.js +895 -895
- package/wwwroot/_content/MindExecution.Shared/js/mindmap-toolbar.js +636 -636
- package/wwwroot/_content/MindExecution.Shared/js/native-drop-handler.js +45 -45
- package/wwwroot/_content/MindExecution.Shared/js/plan-master.js +117 -117
- package/wwwroot/_content/MindExecution.Shared/js/renderers/CSS3DRenderer.js +114 -114
- package/wwwroot/_content/MindExecution.Shared/js/texture-worker-manager.js +10 -10
- package/wwwroot/_content/MindExecution.Shared/js/three.min.js +6 -6
- package/wwwroot/_content/MindExecution.Shared/js/token-manager.js +7 -7
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js +6 -6
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js.map +2 -2
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/css/all.min.css +8 -8
- package/wwwroot/_content/MindExecution.Shared/models/vocab.txt +30522 -30522
- package/wwwroot/_framework/{Google.Protobuf.33g2gb5is0.dll → Google.Protobuf.9h59ukbel7.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Core.z100xo4mg0.dll → MindExecution.Core.xxsj2s456b.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Kernel.i9cldrx8yc.dll → MindExecution.Kernel.5jofnc0wrd.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Admin.48lzqddb0a.dll → MindExecution.Plugins.Admin.t7m4jnqjg3.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Business.7m8u1q142p.dll → MindExecution.Plugins.Business.6yjlhhavap.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Concept.cl5wmr53od.dll → MindExecution.Plugins.Concept.iikqq5zxu0.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.Directory.slipi39041.dll → MindExecution.Plugins.Directory.c5ribyne4m.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.PlanMaster.qfge05l671.dll → MindExecution.Plugins.PlanMaster.365bbuifr9.dll} +0 -0
- package/wwwroot/_framework/{MindExecution.Plugins.YouTube.tn7v29ut77.dll → MindExecution.Plugins.YouTube.ax415cilpk.dll} +0 -0
- package/wwwroot/_framework/MindExecution.Shared.21e2nvf86u.dll +0 -0
- package/wwwroot/_framework/{MindExecution.Web.rwawrxxk38.dll → MindExecution.Web.ppgm8rey59.dll} +0 -0
- package/wwwroot/_framework/{System.Collections.23yxgetbju.dll → System.Collections.zyvbaq6mpd.dll} +0 -0
- package/wwwroot/_framework/blazor.boot.json +25 -25
- package/wwwroot/_headers +40 -40
- package/wwwroot/_redirects +1 -1
- package/wwwroot/index.html +772 -772
- package/wwwroot/js/marketing-tool.js +180 -180
- package/wwwroot/manifest.webmanifest +23 -23
- package/wwwroot/service-worker-assets.js +109 -81
- package/wwwroot/service-worker.js +33 -33
- package/wwwroot/_framework/MindExecution.Shared.rjqlf0umjn.dll +0 -0
|
@@ -50,35 +50,35 @@
|
|
|
50
50
|
|
|
51
51
|
const nodesToAdd = [];
|
|
52
52
|
let index = 0;
|
|
53
|
-
let nextLeftX = null; // Track left edge so each node starts after the previous width + gap
|
|
54
|
-
|
|
55
|
-
for (const file of processedFiles) {
|
|
56
|
-
let width = 400;
|
|
57
|
-
let height = 300;
|
|
58
|
-
|
|
59
|
-
if (file.contentType === 'image') {
|
|
60
|
-
try {
|
|
61
|
-
const size = await window.mindMap.measureImageSize(file.response);
|
|
62
|
-
const fittedSize = window.mindMap.computeImageNodeSize(size[0], size[1], {
|
|
63
|
-
gridSnap: 10,
|
|
64
|
-
minWidth: 100,
|
|
65
|
-
minHeight: 100,
|
|
66
|
-
maxWidth: 4000,
|
|
67
|
-
maxHeight: 4000,
|
|
68
|
-
fallbackWidth: 470,
|
|
69
|
-
fallbackHeight: 350
|
|
70
|
-
});
|
|
71
|
-
width = fittedSize.width;
|
|
72
|
-
height = fittedSize.height;
|
|
73
|
-
} catch (e) {
|
|
74
|
-
console.warn(`[NativeDropHandler] Failed to measure image: ${e}`);
|
|
75
|
-
}
|
|
76
|
-
} else if (file.contentType === 'pdf') {
|
|
77
|
-
height = 56; // Fixed height for PDF
|
|
78
|
-
} else if (file.contentType === 'video') {
|
|
79
|
-
width = 470;
|
|
80
|
-
height = 264;
|
|
81
|
-
} else if (file.contentType === 'text') {
|
|
53
|
+
let nextLeftX = null; // Track left edge so each node starts after the previous width + gap
|
|
54
|
+
|
|
55
|
+
for (const file of processedFiles) {
|
|
56
|
+
let width = 400;
|
|
57
|
+
let height = 300;
|
|
58
|
+
|
|
59
|
+
if (file.contentType === 'image') {
|
|
60
|
+
try {
|
|
61
|
+
const size = await window.mindMap.measureImageSize(file.response);
|
|
62
|
+
const fittedSize = window.mindMap.computeImageNodeSize(size[0], size[1], {
|
|
63
|
+
gridSnap: 10,
|
|
64
|
+
minWidth: 100,
|
|
65
|
+
minHeight: 100,
|
|
66
|
+
maxWidth: 4000,
|
|
67
|
+
maxHeight: 4000,
|
|
68
|
+
fallbackWidth: 470,
|
|
69
|
+
fallbackHeight: 350
|
|
70
|
+
});
|
|
71
|
+
width = fittedSize.width;
|
|
72
|
+
height = fittedSize.height;
|
|
73
|
+
} catch (e) {
|
|
74
|
+
console.warn(`[NativeDropHandler] Failed to measure image: ${e}`);
|
|
75
|
+
}
|
|
76
|
+
} else if (file.contentType === 'pdf') {
|
|
77
|
+
height = 56; // Fixed height for PDF
|
|
78
|
+
} else if (file.contentType === 'video') {
|
|
79
|
+
width = 470;
|
|
80
|
+
height = 264;
|
|
81
|
+
} else if (file.contentType === 'text') {
|
|
82
82
|
// For large text, cap height to a fixed value
|
|
83
83
|
if (file.isChunkedText) {
|
|
84
84
|
height = 400; // Chunk-loading nodes use the default height
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// ▼▼▼ [Fix] Use cumulative X offset for proper spacing ▼▼▼
|
|
95
|
-
if (nextLeftX === null) {
|
|
96
|
-
nextLeftX = Math.round((worldX - (width / 2)) / 10) * 10;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const nodeX = nextLeftX;
|
|
100
|
-
const nodeY = worldY + height / 2;
|
|
101
|
-
nextLeftX = nodeX + width + 30; // previous right edge + fixed gap
|
|
102
|
-
// ▲▲▲ [Fix] ▲▲▲
|
|
95
|
+
if (nextLeftX === null) {
|
|
96
|
+
nextLeftX = Math.round((worldX - (width / 2)) / 10) * 10;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const nodeX = nextLeftX;
|
|
100
|
+
const nodeY = worldY + height / 2;
|
|
101
|
+
nextLeftX = nodeX + width + 30; // previous right edge + fixed gap
|
|
102
|
+
// ▲▲▲ [Fix] ▲▲▲
|
|
103
103
|
|
|
104
104
|
// Base node data
|
|
105
105
|
const nodeData = {
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
positionZ: 0,
|
|
113
113
|
width: width,
|
|
114
114
|
height: height,
|
|
115
|
-
isLoading: false,
|
|
116
|
-
metadata: file.metadata || file.Metadata || {},
|
|
117
|
-
// Chunk-loading related fields
|
|
118
|
-
isChunkedText: file.isChunkedText || false,
|
|
115
|
+
isLoading: false,
|
|
116
|
+
metadata: file.metadata || file.Metadata || {},
|
|
117
|
+
// Chunk-loading related fields
|
|
118
|
+
isChunkedText: file.isChunkedText || false,
|
|
119
119
|
totalLineCount: file.totalLineCount || 0,
|
|
120
120
|
sourceFilePath: file.sourceFilePath || null // [New] Source file path
|
|
121
121
|
};
|
|
@@ -145,10 +145,10 @@
|
|
|
145
145
|
FileIndex: i,
|
|
146
146
|
// Pass chunk-loading fields
|
|
147
147
|
IsChunkedText: n.isChunkedText || false,
|
|
148
|
-
TotalLineCount: n.totalLineCount || 0,
|
|
149
|
-
SourceFilePath: n.sourceFilePath || null, // [New] Source file path
|
|
150
|
-
Metadata: n.metadata || {}
|
|
151
|
-
}));
|
|
148
|
+
TotalLineCount: n.totalLineCount || 0,
|
|
149
|
+
SourceFilePath: n.sourceFilePath || null, // [New] Source file path
|
|
150
|
+
Metadata: n.metadata || {}
|
|
151
|
+
}));
|
|
152
152
|
|
|
153
153
|
console.log('[NativeDropHandler] Calling AddFileNodesFromJs with:', JSON.stringify(fileNodes.map(f => ({ TempId: f.TempId, ContentType: f.ContentType, IsChunkedText: f.IsChunkedText }))));
|
|
154
154
|
const result = await window.dotNetHelper.invokeMethodAsync('AddFileNodesFromJs', fileNodes);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// File: X:\Dev@Work\MindExecution\wwwroot\js\plan-master.js
|
|
2
2
|
// PlanAgent 3D graph agent surface (copied from code-master.js)
|
|
3
|
-
(function () {
|
|
4
|
-
// Module instance storage
|
|
5
|
-
let moduleInstance = null;
|
|
6
|
-
let pendingSettings = null;
|
|
3
|
+
(function () {
|
|
4
|
+
// Module instance storage
|
|
5
|
+
let moduleInstance = null;
|
|
6
|
+
let pendingSettings = null;
|
|
7
7
|
|
|
8
8
|
// PlanMaster module class (kept for backward compatibility)
|
|
9
9
|
class PlanMasterModule {
|
|
@@ -91,9 +91,9 @@
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// Ensure THREE and CSS3D are loaded
|
|
94
|
-
ensureThree() {
|
|
95
|
-
const hasThree = typeof globalThis.THREE !== 'undefined';
|
|
96
|
-
const hasCSS3D = typeof globalThis.CSS3DRenderer !== 'undefined';
|
|
94
|
+
ensureThree() {
|
|
95
|
+
const hasThree = typeof globalThis.THREE !== 'undefined';
|
|
96
|
+
const hasCSS3D = typeof globalThis.CSS3DRenderer !== 'undefined';
|
|
97
97
|
if (!hasThree) {
|
|
98
98
|
console.error('[plan-master.js] THREE not loaded');
|
|
99
99
|
return false;
|
|
@@ -101,49 +101,49 @@
|
|
|
101
101
|
if (!hasCSS3D) {
|
|
102
102
|
console.error('[plan-master.js] CSS3DRenderer not loaded');
|
|
103
103
|
return false;
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
resolveThemeNameFromGridType(gridType) {
|
|
109
|
-
const map = {
|
|
110
|
-
space3d: 'Space3D',
|
|
111
|
-
spirit: 'SpiritFlow',
|
|
112
|
-
default: 'XYGrid',
|
|
113
|
-
dot: 'SpatialGrid2D'
|
|
114
|
-
};
|
|
115
|
-
const key = String(gridType || 'dot').toLowerCase();
|
|
116
|
-
return map[key] || 'SpatialGrid2D';
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
resolveThemeFromGeneralSettings() {
|
|
120
|
-
try {
|
|
121
|
-
const raw = localStorage.getItem('GeneralSettings');
|
|
122
|
-
if (!raw) {
|
|
123
|
-
return 'SpatialGrid2D';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const settings = JSON.parse(raw);
|
|
127
|
-
return this.resolveThemeNameFromGridType(settings?.gridType);
|
|
128
|
-
} catch {
|
|
129
|
-
return 'SpatialGrid2D';
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
applySettings(settings) {
|
|
134
|
-
if (!settings || typeof settings !== 'object') {
|
|
135
|
-
this.setBackgroundTheme(this.resolveThemeFromGeneralSettings());
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (settings.gridType) {
|
|
140
|
-
this.setBackgroundTheme(this.resolveThemeNameFromGridType(settings.gridType));
|
|
141
|
-
} else {
|
|
142
|
-
this.setBackgroundTheme(this.resolveThemeFromGeneralSettings());
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// --- Event handlers ---
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
resolveThemeNameFromGridType(gridType) {
|
|
109
|
+
const map = {
|
|
110
|
+
space3d: 'Space3D',
|
|
111
|
+
spirit: 'SpiritFlow',
|
|
112
|
+
default: 'XYGrid',
|
|
113
|
+
dot: 'SpatialGrid2D'
|
|
114
|
+
};
|
|
115
|
+
const key = String(gridType || 'dot').toLowerCase();
|
|
116
|
+
return map[key] || 'SpatialGrid2D';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
resolveThemeFromGeneralSettings() {
|
|
120
|
+
try {
|
|
121
|
+
const raw = localStorage.getItem('GeneralSettings');
|
|
122
|
+
if (!raw) {
|
|
123
|
+
return 'SpatialGrid2D';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const settings = JSON.parse(raw);
|
|
127
|
+
return this.resolveThemeNameFromGridType(settings?.gridType);
|
|
128
|
+
} catch {
|
|
129
|
+
return 'SpatialGrid2D';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
applySettings(settings) {
|
|
134
|
+
if (!settings || typeof settings !== 'object') {
|
|
135
|
+
this.setBackgroundTheme(this.resolveThemeFromGeneralSettings());
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (settings.gridType) {
|
|
140
|
+
this.setBackgroundTheme(this.resolveThemeNameFromGridType(settings.gridType));
|
|
141
|
+
} else {
|
|
142
|
+
this.setBackgroundTheme(this.resolveThemeFromGeneralSettings());
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// --- Event handlers ---
|
|
147
147
|
|
|
148
148
|
onMouseDown(e) {
|
|
149
149
|
if (e.button === 1 || e.button === 2 || (e.button === 0 && e.ctrlKey)) {
|
|
@@ -323,33 +323,33 @@
|
|
|
323
323
|
this.cssRenderer.setSize(width, height);
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
// --- Animation loop ---
|
|
327
|
-
animate() {
|
|
328
|
-
this.animationFrameId = requestAnimationFrame(() => this.animate());
|
|
329
|
-
const smoothingFactor = 0.25;
|
|
330
|
-
const dx = this.targetX - this.camera.position.x;
|
|
331
|
-
const dy = this.targetY - this.camera.position.y;
|
|
332
|
-
const dz = this.targetZ - this.camera.position.z;
|
|
333
|
-
const isCameraMoving = Math.abs(dx) > 0.01 || Math.abs(dy) > 0.01 || Math.abs(dz) > 0.01;
|
|
334
|
-
this.camera.position.x += dx * smoothingFactor;
|
|
335
|
-
this.camera.position.y += dy * smoothingFactor;
|
|
336
|
-
this.camera.position.z += dz * smoothingFactor;
|
|
337
|
-
if (this.isOptimizationActive && Math.abs(dx) < 0.1 && Math.abs(dy) < 0.1 && Math.abs(dz) < 0.1) {
|
|
338
|
-
this.deactivateOptimization();
|
|
339
|
-
}
|
|
340
|
-
if (this.currentThemeObject && typeof this.currentThemeObject.animate === 'function') {
|
|
341
|
-
const themeRunner = window.MindMapThemes?.runAnimationIfNeeded;
|
|
342
|
-
if (typeof themeRunner === 'function') {
|
|
343
|
-
themeRunner(this.currentThemeName, this.currentThemeObject, this.camera, {
|
|
344
|
-
isCameraMoving
|
|
345
|
-
});
|
|
346
|
-
} else {
|
|
347
|
-
this.currentThemeObject.animate(this.camera);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
this.renderer.render(this.scene, this.camera);
|
|
351
|
-
this.cssRenderer.render(this.scene, this.camera);
|
|
352
|
-
}
|
|
326
|
+
// --- Animation loop ---
|
|
327
|
+
animate() {
|
|
328
|
+
this.animationFrameId = requestAnimationFrame(() => this.animate());
|
|
329
|
+
const smoothingFactor = 0.25;
|
|
330
|
+
const dx = this.targetX - this.camera.position.x;
|
|
331
|
+
const dy = this.targetY - this.camera.position.y;
|
|
332
|
+
const dz = this.targetZ - this.camera.position.z;
|
|
333
|
+
const isCameraMoving = Math.abs(dx) > 0.01 || Math.abs(dy) > 0.01 || Math.abs(dz) > 0.01;
|
|
334
|
+
this.camera.position.x += dx * smoothingFactor;
|
|
335
|
+
this.camera.position.y += dy * smoothingFactor;
|
|
336
|
+
this.camera.position.z += dz * smoothingFactor;
|
|
337
|
+
if (this.isOptimizationActive && Math.abs(dx) < 0.1 && Math.abs(dy) < 0.1 && Math.abs(dz) < 0.1) {
|
|
338
|
+
this.deactivateOptimization();
|
|
339
|
+
}
|
|
340
|
+
if (this.currentThemeObject && typeof this.currentThemeObject.animate === 'function') {
|
|
341
|
+
const themeRunner = window.MindMapThemes?.runAnimationIfNeeded;
|
|
342
|
+
if (typeof themeRunner === 'function') {
|
|
343
|
+
themeRunner(this.currentThemeName, this.currentThemeObject, this.camera, {
|
|
344
|
+
isCameraMoving
|
|
345
|
+
});
|
|
346
|
+
} else {
|
|
347
|
+
this.currentThemeObject.animate(this.camera);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
this.renderer.render(this.scene, this.camera);
|
|
351
|
+
this.cssRenderer.render(this.scene, this.camera);
|
|
352
|
+
}
|
|
353
353
|
|
|
354
354
|
// --- Text update processing ---
|
|
355
355
|
processPendingTextUpdates() {
|
|
@@ -402,19 +402,19 @@
|
|
|
402
402
|
target.style.display = 'block';
|
|
403
403
|
// Trigger resize handler
|
|
404
404
|
this.onResize();
|
|
405
|
-
// Restart animation loop if it was stopped
|
|
406
|
-
if (!this.animationFrameId) {
|
|
407
|
-
this.animate();
|
|
408
|
-
}
|
|
409
|
-
if (pendingSettings) {
|
|
410
|
-
this.applySettings(pendingSettings);
|
|
411
|
-
} else {
|
|
412
|
-
this.applySettings({});
|
|
413
|
-
}
|
|
414
|
-
console.log(`[plan-master.js] Re-activated and animation loop resumed for container #${containerId}.`);
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
405
|
+
// Restart animation loop if it was stopped
|
|
406
|
+
if (!this.animationFrameId) {
|
|
407
|
+
this.animate();
|
|
408
|
+
}
|
|
409
|
+
if (pendingSettings) {
|
|
410
|
+
this.applySettings(pendingSettings);
|
|
411
|
+
} else {
|
|
412
|
+
this.applySettings({});
|
|
413
|
+
}
|
|
414
|
+
console.log(`[plan-master.js] Re-activated and animation loop resumed for container #${containerId}.`);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
418
|
|
|
419
419
|
// First-time init
|
|
420
420
|
if (!this.ensureThree() || !window.MindMapThemes) {
|
|
@@ -464,12 +464,12 @@
|
|
|
464
464
|
this.cssRenderer.domElement.style.zIndex = 1;
|
|
465
465
|
this.container.appendChild(this.cssRenderer.domElement);
|
|
466
466
|
|
|
467
|
-
// Background theme (sync with MindCanvas GeneralSettings)
|
|
468
|
-
if (pendingSettings) {
|
|
469
|
-
this.applySettings(pendingSettings);
|
|
470
|
-
} else {
|
|
471
|
-
this.applySettings({});
|
|
472
|
-
}
|
|
467
|
+
// Background theme (sync with MindCanvas GeneralSettings)
|
|
468
|
+
if (pendingSettings) {
|
|
469
|
+
this.applySettings(pendingSettings);
|
|
470
|
+
} else {
|
|
471
|
+
this.applySettings({});
|
|
472
|
+
}
|
|
473
473
|
|
|
474
474
|
// Register event listeners
|
|
475
475
|
this.cssRenderer.domElement.addEventListener('mousedown', this.boundOnMouseDown);
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
}
|
|
503
503
|
|
|
504
504
|
// Create and attach new theme
|
|
505
|
-
this.currentThemeObject = newTheme.create(this.scene, this.renderer);
|
|
505
|
+
this.currentThemeObject = newTheme.create(this.scene, this.renderer);
|
|
506
506
|
if (this.currentThemeObject) this.scene.add(this.currentThemeObject);
|
|
507
507
|
this.currentThemeName = themeName;
|
|
508
508
|
console.log(`[plan-master.js] Background theme set to: ${themeName}`);
|
|
@@ -730,18 +730,18 @@
|
|
|
730
730
|
updateNodeContent: function (nodeId, markdownContent) {
|
|
731
731
|
if (moduleInstance) moduleInstance.updateNodeContent(nodeId, markdownContent);
|
|
732
732
|
},
|
|
733
|
-
updateNodeSelection: function (oldNodeId, newNodeId) {
|
|
734
|
-
if (moduleInstance) moduleInstance.updateNodeSelection(oldNodeId, newNodeId);
|
|
735
|
-
},
|
|
736
|
-
applySettings: function (settings) {
|
|
737
|
-
pendingSettings = Object.assign({}, pendingSettings || {}, settings || {});
|
|
738
|
-
if (moduleInstance) {
|
|
739
|
-
moduleInstance.applySettings(pendingSettings);
|
|
740
|
-
}
|
|
741
|
-
},
|
|
742
|
-
setBackgroundTheme: function (themeName) {
|
|
743
|
-
if (moduleInstance) moduleInstance.setBackgroundTheme(themeName);
|
|
744
|
-
},
|
|
733
|
+
updateNodeSelection: function (oldNodeId, newNodeId) {
|
|
734
|
+
if (moduleInstance) moduleInstance.updateNodeSelection(oldNodeId, newNodeId);
|
|
735
|
+
},
|
|
736
|
+
applySettings: function (settings) {
|
|
737
|
+
pendingSettings = Object.assign({}, pendingSettings || {}, settings || {});
|
|
738
|
+
if (moduleInstance) {
|
|
739
|
+
moduleInstance.applySettings(pendingSettings);
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
setBackgroundTheme: function (themeName) {
|
|
743
|
+
if (moduleInstance) moduleInstance.setBackgroundTheme(themeName);
|
|
744
|
+
},
|
|
745
745
|
hide: function () {
|
|
746
746
|
if (moduleInstance) moduleInstance.hide();
|
|
747
747
|
},
|
|
@@ -771,14 +771,14 @@
|
|
|
771
771
|
console.log('[planAgent] All nodes cleared');
|
|
772
772
|
}
|
|
773
773
|
},
|
|
774
|
-
cleanupAndDispose: function () {
|
|
775
|
-
if (moduleInstance) {
|
|
776
|
-
moduleInstance.cleanupAndDispose();
|
|
777
|
-
moduleInstance = null;
|
|
778
|
-
}
|
|
779
|
-
pendingSettings = null;
|
|
780
|
-
}
|
|
781
|
-
};
|
|
774
|
+
cleanupAndDispose: function () {
|
|
775
|
+
if (moduleInstance) {
|
|
776
|
+
moduleInstance.cleanupAndDispose();
|
|
777
|
+
moduleInstance = null;
|
|
778
|
+
}
|
|
779
|
+
pendingSettings = null;
|
|
780
|
+
}
|
|
781
|
+
};
|
|
782
782
|
|
|
783
783
|
// Backward-compatible alias: PlanAgent is the new page/internal name.
|
|
784
784
|
window.planAgent = window.planMaster;
|
|
@@ -30,120 +30,120 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function CSS3DRenderer(){
|
|
34
|
-
var _width, _height, _widthHalf, _heightHalf;
|
|
35
|
-
var cache = { camera:{ fov:0, style:'' }, objects: new WeakMap() };
|
|
36
|
-
var debugCounters = { sceneObjectsVisited:0, visibilityPatchEntered:0, visibilityPatchExited:0 };
|
|
37
|
-
var domElement = document.createElement('div');
|
|
38
|
-
domElement.style.overflow = 'hidden';
|
|
39
|
-
domElement.style.contain = 'layout style';
|
|
40
|
-
this.domElement = domElement;
|
|
41
|
-
var cameraElement = document.createElement('div');
|
|
42
|
-
cameraElement.style.webkitTransformStyle = cameraElement.style.transformStyle = 'preserve-3d';
|
|
43
|
-
cameraElement.style.pointerEvents = 'none';
|
|
44
|
-
cameraElement.style.contain = 'layout style';
|
|
45
|
-
domElement.appendChild(cameraElement);
|
|
46
|
-
|
|
47
|
-
this.getSize = function(){ return { width:_width, height:_height }; };
|
|
48
|
-
this.getCameraElement = function(){ return cameraElement; };
|
|
49
|
-
this.setSize = function(width, height){
|
|
50
|
-
_width=width; _height=height; _widthHalf=_width/2; _heightHalf=_height/2;
|
|
51
|
-
domElement.style.width=width+'px'; domElement.style.height=height+'px';
|
|
52
|
-
cameraElement.style.width=width+'px'; cameraElement.style.height=height+'px';
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
function getCameraCSSMatrix(matrix){ var e=matrix.elements; return 'matrix3d('+epsilon(e[0])+','+epsilon(-e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(e[4])+','+epsilon(-e[5])+','+epsilon(e[6])+','+epsilon(e[7])+','+epsilon(e[8])+','+epsilon(-e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(-e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; }
|
|
56
|
-
function getObjectCSSMatrix(matrix){ var e=matrix.elements; return 'matrix3d('+epsilon(e[0])+','+epsilon(e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(-e[4])+','+epsilon(-e[5])+','+epsilon(-e[6])+','+epsilon(-e[7])+','+epsilon(e[8])+','+epsilon(e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; }
|
|
57
|
-
function hasMatrixChanged(elements, values){
|
|
58
|
-
if (!values) return true;
|
|
59
|
-
for (var i=0;i<16;i++) if (epsilon(elements[i])!==values[i]) return true;
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
function copyMatrix(elements, values){
|
|
63
|
-
var next=values || new Float64Array(16);
|
|
64
|
-
for (var i=0;i<16;i++) next[i]=epsilon(elements[i]);
|
|
65
|
-
return next;
|
|
66
|
-
}
|
|
67
|
-
function renderCssObject(object){
|
|
68
|
-
if (object?.isCSS3DObject){
|
|
69
|
-
var visible=object.visible===true;
|
|
70
|
-
var layoutPrepared=object.userData?._residentTransitionPrepared===true || object.userData?._fullResFringePrepared===true;
|
|
71
|
-
var display=(visible || layoutPrepared) ? '' : 'none';
|
|
72
|
-
var element=object.element;
|
|
73
|
-
var cached=cache.objects.get(object);
|
|
74
|
-
if (cached===undefined){
|
|
75
|
-
cached={ element:null, matrix:null, display:null };
|
|
76
|
-
cache.objects.set(object,cached);
|
|
77
|
-
}
|
|
78
|
-
var elementChanged=cached.element!==element;
|
|
79
|
-
if ((visible || layoutPrepared) && (elementChanged || hasMatrixChanged(object.matrixWorld.elements,cached.matrix))){
|
|
80
|
-
var style=getObjectCSSMatrix(object.matrixWorld);
|
|
81
|
-
element.style.webkitTransform=element.style.transform=style;
|
|
82
|
-
cached.matrix=copyMatrix(object.matrixWorld.elements,cached.matrix);
|
|
83
|
-
}
|
|
84
|
-
if (elementChanged || cached.display!==display) element.style.display=display;
|
|
85
|
-
cached.element=element;
|
|
86
|
-
cached.display=display;
|
|
87
|
-
if (element.parentNode!==cameraElement) cameraElement.appendChild(element);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function renderObject(object){
|
|
91
|
-
debugCounters.sceneObjectsVisited++;
|
|
92
|
-
renderCssObject(object);
|
|
93
|
-
for (var i=0,l=object.children.length;i<l;i++) renderObject(object.children[i]);
|
|
94
|
-
}
|
|
95
|
-
function renderCameraOnly(renderer, camera, matrixWorldIsCurrent){
|
|
96
|
-
var fov=camera.projectionMatrix.elements[5]*_heightHalf;
|
|
97
|
-
if (cache.camera.fov!==fov){
|
|
98
|
-
renderer.domElement.style.webkitPerspective=renderer.domElement.style.perspective=fov+'px';
|
|
99
|
-
cache.camera.fov=fov;
|
|
100
|
-
}
|
|
101
|
-
if (matrixWorldIsCurrent!==true && camera.parent===null) camera.updateMatrixWorld();
|
|
102
|
-
var cameraCSSMatrix='translateZ('+fov+'px)'+getCameraCSSMatrix(camera.matrixWorldInverse);
|
|
103
|
-
var style=cameraCSSMatrix+'translate('+_widthHalf+'px,'+_heightHalf+'px)';
|
|
104
|
-
if (cache.camera.style!==style){
|
|
105
|
-
cameraElement.style.webkitTransform=cameraElement.style.transform=style;
|
|
106
|
-
cache.camera.style=style;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
this.renderCamera = function(camera, matrixWorldIsCurrent){ renderCameraOnly(this, camera, matrixWorldIsCurrent); };
|
|
110
|
-
this.prepareObjectLayout = function(object){
|
|
111
|
-
if (!object || object.isCSS3DObject!==true) return false;
|
|
112
|
-
object.updateMatrixWorld(true);
|
|
113
|
-
renderObject(object);
|
|
114
|
-
object.element?.getBoundingClientRect?.();
|
|
115
|
-
return true;
|
|
116
|
-
};
|
|
117
|
-
this.applyVisibilityDiff = function(enteredObjects, exitedObjects){
|
|
118
|
-
var entered=Array.isArray(enteredObjects) ? enteredObjects : [];
|
|
119
|
-
var exited=Array.isArray(exitedObjects) ? exitedObjects : [];
|
|
120
|
-
var visited=0;
|
|
121
|
-
try {
|
|
122
|
-
for (var i=0;i<exited.length;i++){
|
|
123
|
-
var exitedObject=exited[i];
|
|
124
|
-
if (!exitedObject || exitedObject.isCSS3DObject!==true) continue;
|
|
125
|
-
exitedObject.updateMatrixWorld(true);
|
|
126
|
-
renderCssObject(exitedObject);
|
|
127
|
-
visited++;
|
|
128
|
-
}
|
|
129
|
-
for (var j=0;j<entered.length;j++){
|
|
130
|
-
var enteredObject=entered[j];
|
|
131
|
-
if (!enteredObject || enteredObject.isCSS3DObject!==true) continue;
|
|
132
|
-
enteredObject.updateMatrixWorld(true);
|
|
133
|
-
renderCssObject(enteredObject);
|
|
134
|
-
visited++;
|
|
135
|
-
}
|
|
136
|
-
} catch (error) {
|
|
137
|
-
return { complete:false, reason:'visibility-diff-exception', visited:visited, error:error };
|
|
138
|
-
}
|
|
139
|
-
debugCounters.visibilityPatchEntered+=entered.length;
|
|
140
|
-
debugCounters.visibilityPatchExited+=exited.length;
|
|
141
|
-
return { complete:true, entered:entered.length, exited:exited.length, visited:visited };
|
|
142
|
-
};
|
|
143
|
-
this.getDebugCounters = function(){ return { ...debugCounters }; };
|
|
144
|
-
this.resetDebugCounters = function(){ debugCounters={ sceneObjectsVisited:0, visibilityPatchEntered:0, visibilityPatchExited:0 }; };
|
|
145
|
-
this.render = function(scene, camera){ if (scene.autoUpdate===true) scene.updateMatrixWorld(); renderCameraOnly(this, camera, false); renderObject(scene); };
|
|
146
|
-
}
|
|
33
|
+
function CSS3DRenderer(){
|
|
34
|
+
var _width, _height, _widthHalf, _heightHalf;
|
|
35
|
+
var cache = { camera:{ fov:0, style:'' }, objects: new WeakMap() };
|
|
36
|
+
var debugCounters = { sceneObjectsVisited:0, visibilityPatchEntered:0, visibilityPatchExited:0 };
|
|
37
|
+
var domElement = document.createElement('div');
|
|
38
|
+
domElement.style.overflow = 'hidden';
|
|
39
|
+
domElement.style.contain = 'layout style';
|
|
40
|
+
this.domElement = domElement;
|
|
41
|
+
var cameraElement = document.createElement('div');
|
|
42
|
+
cameraElement.style.webkitTransformStyle = cameraElement.style.transformStyle = 'preserve-3d';
|
|
43
|
+
cameraElement.style.pointerEvents = 'none';
|
|
44
|
+
cameraElement.style.contain = 'layout style';
|
|
45
|
+
domElement.appendChild(cameraElement);
|
|
46
|
+
|
|
47
|
+
this.getSize = function(){ return { width:_width, height:_height }; };
|
|
48
|
+
this.getCameraElement = function(){ return cameraElement; };
|
|
49
|
+
this.setSize = function(width, height){
|
|
50
|
+
_width=width; _height=height; _widthHalf=_width/2; _heightHalf=_height/2;
|
|
51
|
+
domElement.style.width=width+'px'; domElement.style.height=height+'px';
|
|
52
|
+
cameraElement.style.width=width+'px'; cameraElement.style.height=height+'px';
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
function getCameraCSSMatrix(matrix){ var e=matrix.elements; return 'matrix3d('+epsilon(e[0])+','+epsilon(-e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(e[4])+','+epsilon(-e[5])+','+epsilon(e[6])+','+epsilon(e[7])+','+epsilon(e[8])+','+epsilon(-e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(-e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; }
|
|
56
|
+
function getObjectCSSMatrix(matrix){ var e=matrix.elements; return 'matrix3d('+epsilon(e[0])+','+epsilon(e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(-e[4])+','+epsilon(-e[5])+','+epsilon(-e[6])+','+epsilon(-e[7])+','+epsilon(e[8])+','+epsilon(e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; }
|
|
57
|
+
function hasMatrixChanged(elements, values){
|
|
58
|
+
if (!values) return true;
|
|
59
|
+
for (var i=0;i<16;i++) if (epsilon(elements[i])!==values[i]) return true;
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
function copyMatrix(elements, values){
|
|
63
|
+
var next=values || new Float64Array(16);
|
|
64
|
+
for (var i=0;i<16;i++) next[i]=epsilon(elements[i]);
|
|
65
|
+
return next;
|
|
66
|
+
}
|
|
67
|
+
function renderCssObject(object){
|
|
68
|
+
if (object?.isCSS3DObject){
|
|
69
|
+
var visible=object.visible===true;
|
|
70
|
+
var layoutPrepared=object.userData?._residentTransitionPrepared===true || object.userData?._fullResFringePrepared===true;
|
|
71
|
+
var display=(visible || layoutPrepared) ? '' : 'none';
|
|
72
|
+
var element=object.element;
|
|
73
|
+
var cached=cache.objects.get(object);
|
|
74
|
+
if (cached===undefined){
|
|
75
|
+
cached={ element:null, matrix:null, display:null };
|
|
76
|
+
cache.objects.set(object,cached);
|
|
77
|
+
}
|
|
78
|
+
var elementChanged=cached.element!==element;
|
|
79
|
+
if ((visible || layoutPrepared) && (elementChanged || hasMatrixChanged(object.matrixWorld.elements,cached.matrix))){
|
|
80
|
+
var style=getObjectCSSMatrix(object.matrixWorld);
|
|
81
|
+
element.style.webkitTransform=element.style.transform=style;
|
|
82
|
+
cached.matrix=copyMatrix(object.matrixWorld.elements,cached.matrix);
|
|
83
|
+
}
|
|
84
|
+
if (elementChanged || cached.display!==display) element.style.display=display;
|
|
85
|
+
cached.element=element;
|
|
86
|
+
cached.display=display;
|
|
87
|
+
if (element.parentNode!==cameraElement) cameraElement.appendChild(element);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function renderObject(object){
|
|
91
|
+
debugCounters.sceneObjectsVisited++;
|
|
92
|
+
renderCssObject(object);
|
|
93
|
+
for (var i=0,l=object.children.length;i<l;i++) renderObject(object.children[i]);
|
|
94
|
+
}
|
|
95
|
+
function renderCameraOnly(renderer, camera, matrixWorldIsCurrent){
|
|
96
|
+
var fov=camera.projectionMatrix.elements[5]*_heightHalf;
|
|
97
|
+
if (cache.camera.fov!==fov){
|
|
98
|
+
renderer.domElement.style.webkitPerspective=renderer.domElement.style.perspective=fov+'px';
|
|
99
|
+
cache.camera.fov=fov;
|
|
100
|
+
}
|
|
101
|
+
if (matrixWorldIsCurrent!==true && camera.parent===null) camera.updateMatrixWorld();
|
|
102
|
+
var cameraCSSMatrix='translateZ('+fov+'px)'+getCameraCSSMatrix(camera.matrixWorldInverse);
|
|
103
|
+
var style=cameraCSSMatrix+'translate('+_widthHalf+'px,'+_heightHalf+'px)';
|
|
104
|
+
if (cache.camera.style!==style){
|
|
105
|
+
cameraElement.style.webkitTransform=cameraElement.style.transform=style;
|
|
106
|
+
cache.camera.style=style;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
this.renderCamera = function(camera, matrixWorldIsCurrent){ renderCameraOnly(this, camera, matrixWorldIsCurrent); };
|
|
110
|
+
this.prepareObjectLayout = function(object){
|
|
111
|
+
if (!object || object.isCSS3DObject!==true) return false;
|
|
112
|
+
object.updateMatrixWorld(true);
|
|
113
|
+
renderObject(object);
|
|
114
|
+
object.element?.getBoundingClientRect?.();
|
|
115
|
+
return true;
|
|
116
|
+
};
|
|
117
|
+
this.applyVisibilityDiff = function(enteredObjects, exitedObjects){
|
|
118
|
+
var entered=Array.isArray(enteredObjects) ? enteredObjects : [];
|
|
119
|
+
var exited=Array.isArray(exitedObjects) ? exitedObjects : [];
|
|
120
|
+
var visited=0;
|
|
121
|
+
try {
|
|
122
|
+
for (var i=0;i<exited.length;i++){
|
|
123
|
+
var exitedObject=exited[i];
|
|
124
|
+
if (!exitedObject || exitedObject.isCSS3DObject!==true) continue;
|
|
125
|
+
exitedObject.updateMatrixWorld(true);
|
|
126
|
+
renderCssObject(exitedObject);
|
|
127
|
+
visited++;
|
|
128
|
+
}
|
|
129
|
+
for (var j=0;j<entered.length;j++){
|
|
130
|
+
var enteredObject=entered[j];
|
|
131
|
+
if (!enteredObject || enteredObject.isCSS3DObject!==true) continue;
|
|
132
|
+
enteredObject.updateMatrixWorld(true);
|
|
133
|
+
renderCssObject(enteredObject);
|
|
134
|
+
visited++;
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
return { complete:false, reason:'visibility-diff-exception', visited:visited, error:error };
|
|
138
|
+
}
|
|
139
|
+
debugCounters.visibilityPatchEntered+=entered.length;
|
|
140
|
+
debugCounters.visibilityPatchExited+=exited.length;
|
|
141
|
+
return { complete:true, entered:entered.length, exited:exited.length, visited:visited };
|
|
142
|
+
};
|
|
143
|
+
this.getDebugCounters = function(){ return { ...debugCounters }; };
|
|
144
|
+
this.resetDebugCounters = function(){ debugCounters={ sceneObjectsVisited:0, visibilityPatchEntered:0, visibilityPatchExited:0 }; };
|
|
145
|
+
this.render = function(scene, camera){ if (scene.autoUpdate===true) scene.updateMatrixWorld(); renderCameraOnly(this, camera, false); renderObject(scene); };
|
|
146
|
+
}
|
|
147
147
|
|
|
148
148
|
window.CSS3DObject = CSS3DObject; window.CSS3DSprite = CSS3DSprite; window.CSS3DRenderer = CSS3DRenderer;
|
|
149
149
|
})();
|