@basthon/gui-base 0.70.3 → 0.71.0

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.
Files changed (2) hide show
  1. package/lib/main.js +11 -6
  2. package/package.json +5 -5
package/lib/main.js CHANGED
@@ -556,14 +556,19 @@ Un lien permanant vers le contenu actuel a été créé.
556
556
  }
557
557
  };
558
558
  // wait for iframe to be ready
559
- // (contentWindow is null until iframe is added to the DOM)
560
- const iframeWindow = await new Promise((resolve, reject) => {
561
- if (iframe.contentWindow != null)
562
- return resolve(iframe.contentWindow);
563
- iframe.onload = () => resolve(iframe.contentWindow);
559
+ await new Promise((resolve, reject) => {
560
+ iframe.onload = () => resolve();
564
561
  iframe.onerror = reject;
565
562
  });
566
- iframeWindow.postMessage(port2, "*", [port2]);
563
+ iframe.contentWindow.postMessage(port2, "*", [port2]);
564
+ // refresh drawing at first display
565
+ const observer = new IntersectionObserver((entries) => {
566
+ if (entries[0].intersectionRatio > 0) {
567
+ port1.postMessage({ type: "refresh" });
568
+ observer.disconnect(); // refresh only once
569
+ }
570
+ }, { root: document.documentElement });
571
+ observer.observe(iframe);
567
572
  }
568
573
  }
569
574
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/gui-base",
3
- "version": "0.70.3",
3
+ "version": "0.71.0",
4
4
  "description": "Basthon - Base GUI",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -25,9 +25,9 @@
25
25
  "clean": "rm -rf lib/"
26
26
  },
27
27
  "dependencies": {
28
- "@basthon/checkpoints": "0.70.3",
29
- "@basthon/kernel-base": "0.70.3",
30
- "@basthon/kernel-loader": "0.70.3",
28
+ "@basthon/checkpoints": "0.71.0",
29
+ "@basthon/kernel-base": "0.71.0",
30
+ "@basthon/kernel-loader": "0.71.0",
31
31
  "js-base64": "^3.7.7",
32
32
  "pako": "^2.1.0",
33
33
  "promise-delegate": "^1.0.1"
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "ceeb9819f56beea8fb8276978079fc11628f40c1"
42
+ "gitHead": "669f1f0bb86e4829ddfd4064845f981901cf870d"
43
43
  }