@mindexec/cli 0.2.414 → 0.2.415

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindexec/cli",
3
- "version": "0.2.414",
3
+ "version": "0.2.415",
4
4
  "description": "MindExec local runtime and bridge CLI",
5
5
  "main": "server.js",
6
6
  "type": "module",
@@ -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-generated-image-asset-verify-v848';
8
+ const MINDMAP_CORE_BUILD_ID = '20260628-css3d-image-no-white-swap-v849';
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.removeAttribute('src');
3972
- if (mediaEl.tagName === 'IMG') {
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.dataset.mediaReady = '0';
4462
- mediaEl.style.opacity = '0';
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);
@@ -579,7 +579,7 @@
579
579
  }
580
580
 
581
581
  const base = '_content/MindExecution.Shared/js/';
582
- const scriptVersion = '20260628-generated-image-asset-verify-v848';
582
+ const scriptVersion = '20260628-css3d-image-no-white-swap-v849';
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": "LiAiTcYR",
2
+ "version": "lQ3nc/Eh",
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-i9ro6kKWzS56xpp7W+T6sjPWRPnXUUyUFdz4nQCcVAU=",
81
+ "hash": "sha256-Q2t05E/3SF8P/mdMscHaKggULfWx9RUH6xlALwiHwoc=",
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-cW1g2pILfT1P5dAvJHSXx3CD3fnfNIpCPiOhpYEP3/E=",
89
+ "hash": "sha256-xGt9LTobfy8NmStfgnMGnwq4rmbMaDLpp41TSFZcxEA=",
90
90
  "url": "_content/MindExecution.Shared/js/mind-map-css3d-manager.js"
91
91
  },
92
92
  {
@@ -826,7 +826,7 @@
826
826
  "url": "icon-512.png"
827
827
  },
828
828
  {
829
- "hash": "sha256-wyzu4wKETBaXMK4kgUSfYeaLxNd4bjhNty+/ah8ieCs=",
829
+ "hash": "sha256-Vo6ziORXr502mT1zJ+Etx5OZMxgV3o4zfPyasUaL9SI=",
830
830
  "url": "index.html"
831
831
  },
832
832
  {
@@ -1,4 +1,4 @@
1
- /* Manifest version: LiAiTcYR */
1
+ /* Manifest version: lQ3nc/Eh */
2
2
  // Hosted deployments should prefer the network over stale offline caches.
3
3
  // This service worker immediately clears old Blazor offline caches and unregisters itself.
4
4