dockview-core 6.1.1 → 6.2.2

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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview-core
3
- * @version 6.1.1
3
+ * @version 6.2.2
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -11386,10 +11386,20 @@ class OverlayRenderContainer extends CompositeDisposable {
11386
11386
  focusContainer.style.top = `${top}px`;
11387
11387
  focusContainer.style.width = `${width}px`;
11388
11388
  focusContainer.style.height = `${height}px`;
11389
- // Reveal after the first position is applied (was hidden to
11390
- // prevent a flash at 0,0 before the initial layout fires).
11391
- if (focusContainer.style.visibility === 'hidden') {
11389
+ // Sync visibility/pointer-events with the panel's current
11390
+ // visibility at paint time. visibilityChanged() may have
11391
+ // flipped to hidden between scheduling this rAF and now;
11392
+ // unconditionally clearing `visibility:hidden` here would
11393
+ // leave a hidden panel visually visible at a stale position,
11394
+ // because onDidDimensionsChange skips non-visible panels and
11395
+ // never recomputes their box on subsequent resizes.
11396
+ if (panel.api.isVisible) {
11392
11397
  focusContainer.style.visibility = '';
11398
+ focusContainer.style.pointerEvents = '';
11399
+ }
11400
+ else {
11401
+ focusContainer.style.visibility = 'hidden';
11402
+ focusContainer.style.pointerEvents = 'none';
11393
11403
  }
11394
11404
  toggleClass(focusContainer, 'dv-render-overlay-float', panel.group.api.location.type === 'floating');
11395
11405
  });
@@ -11533,6 +11543,25 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
11533
11543
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
11534
11544
  };
11535
11545
 
11546
+ /**
11547
+ * Reject popout URLs that aren't same-origin http(s). Blocks `javascript:`,
11548
+ * `data:`, `blob:`, `vbscript:`, and cross-origin URLs that would otherwise
11549
+ * execute in a context the browser still associates with the opener via
11550
+ * `window.opener`.
11551
+ */
11552
+ function assertSameOriginPopoutUrl(url) {
11553
+ let resolved;
11554
+ try {
11555
+ resolved = new URL(url, window.location.href);
11556
+ }
11557
+ catch (_a) {
11558
+ throw new Error(`dockview: invalid popout URL: ${url}`);
11559
+ }
11560
+ const protocolOk = resolved.protocol === 'http:' || resolved.protocol === 'https:';
11561
+ if (!protocolOk || resolved.origin !== window.location.origin) {
11562
+ throw new Error(`dockview: popout URL must be same-origin http(s); got: ${url}`);
11563
+ }
11564
+ }
11536
11565
  class PopoutWindow extends CompositeDisposable {
11537
11566
  get window() {
11538
11567
  var _a, _b;
@@ -11584,6 +11613,7 @@ class PopoutWindow extends CompositeDisposable {
11584
11613
  throw new Error('instance of popout window is already open');
11585
11614
  }
11586
11615
  const url = `${this.options.url}`;
11616
+ assertSameOriginPopoutUrl(url);
11587
11617
  const features = Object.entries({
11588
11618
  top: this.options.top,
11589
11619
  left: this.options.left,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview-core",
3
- "version": "6.1.1",
3
+ "version": "6.2.2",
4
4
  "description": "Zero dependency layout manager supporting tabs, groups, grids and splitviews for vanilla TypeScript",
5
5
  "keywords": [
6
6
  "splitview",