@mindexec/cli 0.2.414 → 0.2.416
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/package.json +1 -1
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js +1 -1
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +79 -5
- package/wwwroot/_content/MindExecution.Shared/js/renderers/CSS3DRenderer.js +1 -1
- package/wwwroot/index.html +1 -1
- package/wwwroot/service-worker-assets.js +5 -5
- package/wwwroot/service-worker.js +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
const DEBUG = false;
|
|
6
6
|
const FPS_DEBUG = false;
|
|
7
7
|
const FRAME_PERF_DEBUG = false;
|
|
8
|
-
const MINDMAP_CORE_BUILD_ID = '20260628-
|
|
8
|
+
const MINDMAP_CORE_BUILD_ID = '20260628-css3d-display-cache-v850';
|
|
9
9
|
const CanvasPhase = Object.freeze({
|
|
10
10
|
Booting: 'booting',
|
|
11
11
|
BoardFileLoading: 'board-file-loading',
|
|
@@ -3940,10 +3940,58 @@
|
|
|
3940
3940
|
if (_cssImageDisplayQueue.length > 0) {
|
|
3941
3941
|
scheduleCssImageDisplayQueuePump();
|
|
3942
3942
|
}
|
|
3943
|
-
|
|
3943
|
+
});
|
|
3944
3944
|
}
|
|
3945
3945
|
}
|
|
3946
3946
|
|
|
3947
|
+
function hasVisibleCssImagePixels(mediaEl) {
|
|
3948
|
+
if (!mediaEl || mediaEl.tagName !== 'IMG') {
|
|
3949
|
+
return false;
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3952
|
+
if (String(mediaEl.dataset?.mediaReady || '').trim() === '1') {
|
|
3953
|
+
return true;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
return mediaEl.complete === true
|
|
3957
|
+
&& Number(mediaEl.naturalWidth || 0) > 0
|
|
3958
|
+
&& Number(mediaEl.naturalHeight || 0) > 0;
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3961
|
+
async function decodeCssImageBeforeSwap(src) {
|
|
3962
|
+
const normalized = normalizeCssMediaUrl(src);
|
|
3963
|
+
if (!normalized) {
|
|
3964
|
+
return false;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
return await new Promise((resolve) => {
|
|
3968
|
+
const image = new Image();
|
|
3969
|
+
let settled = false;
|
|
3970
|
+
const finish = (ok) => {
|
|
3971
|
+
if (settled) return;
|
|
3972
|
+
settled = true;
|
|
3973
|
+
image.onload = null;
|
|
3974
|
+
image.onerror = null;
|
|
3975
|
+
resolve(ok === true);
|
|
3976
|
+
};
|
|
3977
|
+
|
|
3978
|
+
image.decoding = 'async';
|
|
3979
|
+
image.onload = () => {
|
|
3980
|
+
if (typeof image.decode === 'function') {
|
|
3981
|
+
image.decode()
|
|
3982
|
+
.then(() => finish(true))
|
|
3983
|
+
.catch(() => finish(true));
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3987
|
+
finish(true);
|
|
3988
|
+
};
|
|
3989
|
+
image.onerror = () => finish(false);
|
|
3990
|
+
image.src = normalized;
|
|
3991
|
+
setTimeout(() => finish(false), 2500);
|
|
3992
|
+
});
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3947
3995
|
async function applyCssImageElementSource(mediaEl, normalized) {
|
|
3948
3996
|
if (String(mediaEl.dataset.mediaSourceUrl || '').trim() !== normalized) {
|
|
3949
3997
|
return false;
|
|
@@ -3957,6 +4005,16 @@
|
|
|
3957
4005
|
|
|
3958
4006
|
const currentDisplaySource = String(mediaEl.getAttribute('src') || '').trim();
|
|
3959
4007
|
if (currentDisplaySource !== resolvedDisplaySource) {
|
|
4008
|
+
if (currentDisplaySource && hasVisibleCssImagePixels(mediaEl)) {
|
|
4009
|
+
const decoded = await decodeCssImageBeforeSwap(resolvedDisplaySource);
|
|
4010
|
+
if (String(mediaEl.dataset.mediaSourceUrl || '').trim() !== normalized) {
|
|
4011
|
+
return false;
|
|
4012
|
+
}
|
|
4013
|
+
if (!decoded) {
|
|
4014
|
+
return false;
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
|
|
3960
4018
|
mediaEl.setAttribute('src', resolvedDisplaySource);
|
|
3961
4019
|
}
|
|
3962
4020
|
mediaEl.dataset.resolvedMediaSourceUrl = resolvedDisplaySource;
|
|
@@ -3968,8 +4026,10 @@
|
|
|
3968
4026
|
|
|
3969
4027
|
if (isLoopbackCssAssetUrl(normalized)) {
|
|
3970
4028
|
mediaEl.dataset.resolvedMediaSourceUrl = '';
|
|
3971
|
-
mediaEl
|
|
3972
|
-
|
|
4029
|
+
if (hasVisibleCssImagePixels(mediaEl)) {
|
|
4030
|
+
mediaEl.style.opacity = '1';
|
|
4031
|
+
} else {
|
|
4032
|
+
mediaEl.removeAttribute('src');
|
|
3973
4033
|
mediaEl.dataset.mediaReady = '0';
|
|
3974
4034
|
mediaEl.style.opacity = '0';
|
|
3975
4035
|
}
|
|
@@ -3978,6 +4038,16 @@
|
|
|
3978
4038
|
|
|
3979
4039
|
const currentDisplaySource = String(mediaEl.getAttribute('src') || '').trim();
|
|
3980
4040
|
if (currentDisplaySource !== normalized) {
|
|
4041
|
+
if (currentDisplaySource && hasVisibleCssImagePixels(mediaEl)) {
|
|
4042
|
+
const decoded = await decodeCssImageBeforeSwap(normalized);
|
|
4043
|
+
if (String(mediaEl.dataset.mediaSourceUrl || '').trim() !== normalized) {
|
|
4044
|
+
return false;
|
|
4045
|
+
}
|
|
4046
|
+
if (!decoded) {
|
|
4047
|
+
return false;
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
|
|
3981
4051
|
mediaEl.setAttribute('src', normalized);
|
|
3982
4052
|
}
|
|
3983
4053
|
mediaEl.dataset.resolvedMediaSourceUrl = normalized;
|
|
@@ -4458,8 +4528,12 @@
|
|
|
4458
4528
|
return;
|
|
4459
4529
|
}
|
|
4460
4530
|
if (contentTypeLower === 'image') {
|
|
4461
|
-
mediaEl
|
|
4462
|
-
|
|
4531
|
+
if (hasVisibleCssImagePixels(mediaEl)) {
|
|
4532
|
+
mediaEl.style.opacity = '1';
|
|
4533
|
+
} else {
|
|
4534
|
+
mediaEl.dataset.mediaReady = '0';
|
|
4535
|
+
mediaEl.style.opacity = '0';
|
|
4536
|
+
}
|
|
4463
4537
|
}
|
|
4464
4538
|
const beforeSource = getCssMediaCanonicalSource(mediaEl, nodeModel?.response || nodeModel?.Response || '');
|
|
4465
4539
|
await tryRefreshCssMediaSource(mediaEl, nodeModel, contentTypeLower);
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
this.setSize = function(width, height){ _width=width; _height=height; _widthHalf=_width/2; _heightHalf=_height/2; domElement.style.width=width+'px'; domElement.style.height=height+'px'; cameraElement.style.width=width+'px'; cameraElement.style.height=height+'px'; };
|
|
41
41
|
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])+')'; }
|
|
42
42
|
function getObjectCSSMatrix(matrix){ var e=matrix.elements; var m='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])+')'; return m; }
|
|
43
|
-
function renderObject(object, scene, camera, cameraCSSMatrix){ if (object.isCSS3DObject){ var style=getObjectCSSMatrix(object.matrixWorld); var element=object.element; var cached=cache.objects.get(object); if (cached===undefined || cached.style!==style){ element.style.webkitTransform=element.style.transform=style;
|
|
43
|
+
function renderObject(object, scene, camera, cameraCSSMatrix){ if (object.isCSS3DObject){ var style=getObjectCSSMatrix(object.matrixWorld); var display=object.visible ? '' : 'none'; var element=object.element; var cached=cache.objects.get(object); var changed=false; if (cached===undefined || cached.style!==style){ element.style.webkitTransform=element.style.transform=style; changed=true; } if (cached===undefined || cached.display!==display){ element.style.display=display; changed=true; } if (changed){ cache.objects.set(object, { style, display }); } if (element.parentNode !== cameraElement){ cameraElement.appendChild(element); } } for (var i=0,l=object.children.length;i<l;i++){ renderObject(object.children[i], scene, camera, cameraCSSMatrix); } }
|
|
44
44
|
function renderCameraOnly(renderer, camera){ var fov=camera.projectionMatrix.elements[5]*_heightHalf; if (cache.camera.fov!==fov){ renderer.domElement.style.webkitPerspective=renderer.domElement.style.perspective=fov+'px'; cache.camera.fov=fov; } if (camera.parent===null) camera.updateMatrixWorld(); var cameraCSSMatrix='translateZ('+fov+'px)'+getCameraCSSMatrix(camera.matrixWorldInverse); var style=cameraCSSMatrix+'translate('+_widthHalf+'px,'+_heightHalf+'px)'; if (cache.camera.style!==style){ cameraElement.style.webkitTransform=cameraElement.style.transform=style; cache.camera.style=style; } return cameraCSSMatrix; }
|
|
45
45
|
this.renderCamera = function(camera){ renderCameraOnly(this, camera); };
|
|
46
46
|
this.render = function(scene, camera){ if (scene.autoUpdate===true) scene.updateMatrixWorld(); var cameraCSSMatrix=renderCameraOnly(this, camera); renderObject(scene, scene, camera, cameraCSSMatrix); };
|
package/wwwroot/index.html
CHANGED
|
@@ -579,7 +579,7 @@
|
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
const base = '_content/MindExecution.Shared/js/';
|
|
582
|
-
const scriptVersion = '20260628-
|
|
582
|
+
const scriptVersion = '20260628-css3d-display-cache-v850';
|
|
583
583
|
const scriptUrl = (script) => `${base}${script}?v=${scriptVersion}`;
|
|
584
584
|
console.log(`[Script Loader] Shared JS version: ${scriptVersion}`);
|
|
585
585
|
const criticalScripts = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
self.assetsManifest = {
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "LokY+L6v",
|
|
3
3
|
"assets": [
|
|
4
4
|
{
|
|
5
5
|
"hash": "sha256-+CSYMcqLNTsq3VnH11jgYyOCCdxvHzL74CBmo4sCmMU=",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"url": "_content/MindExecution.Shared/js/marked.min.js"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
"hash": "sha256-
|
|
81
|
+
"hash": "sha256-EnIV3DhnSaO0sjXXrEpyU/oK3y8eYeGQaacLts4iHM4=",
|
|
82
82
|
"url": "_content/MindExecution.Shared/js/mind-map-core.js"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"url": "_content/MindExecution.Shared/js/mind-map-core.js.backup"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
"hash": "sha256-
|
|
89
|
+
"hash": "sha256-xGt9LTobfy8NmStfgnMGnwq4rmbMaDLpp41TSFZcxEA=",
|
|
90
90
|
"url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
"url": "_content/MindExecution.Shared/js/plan-master.js"
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
|
-
"hash": "sha256-
|
|
181
|
+
"hash": "sha256-yQfQxPDlaJfN38SmEl42Yx6az8cBxcBhHC/Zm0RFkLg=",
|
|
182
182
|
"url": "_content/MindExecution.Shared/js/renderers/CSS3DRenderer.js"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
@@ -826,7 +826,7 @@
|
|
|
826
826
|
"url": "icon-512.png"
|
|
827
827
|
},
|
|
828
828
|
{
|
|
829
|
-
"hash": "sha256-
|
|
829
|
+
"hash": "sha256-8JFKN1z79VP+PMPBbBGG4T+gYhqsjevXJy1qwGKQ/28=",
|
|
830
830
|
"url": "index.html"
|
|
831
831
|
},
|
|
832
832
|
{
|