dockview-core 7.0.2 → 7.0.3
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/dist/cjs/api/dockviewGroupPanelApi.js +1 -1
- package/dist/cjs/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/cjs/dnd/pointer/longPress.js +1 -1
- package/dist/cjs/dnd/pointer/pointerDragController.js +9 -7
- package/dist/cjs/dnd/pointer/pointerDragSource.js +4 -2
- package/dist/cjs/dockview/components/panel/content.js +6 -6
- package/dist/cjs/dockview/components/popupService.js +1 -1
- package/dist/cjs/dockview/components/tab/tab.js +2 -2
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +1 -2
- package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +1 -2
- package/dist/cjs/dockview/components/titlebar/groupDragSource.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +5 -6
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +104 -54
- package/dist/cjs/dockview/components/titlebar/tabs.js +16 -23
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/cjs/dockview/dndCapabilities.js +3 -3
- package/dist/cjs/dockview/dockviewComponent.d.ts +5 -5
- package/dist/cjs/dockview/dockviewComponent.js +140 -122
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +19 -25
- package/dist/cjs/dockview/dockviewPanel.js +4 -5
- package/dist/cjs/dockview/dockviewShell.d.ts +29 -7
- package/dist/cjs/dockview/dockviewShell.js +94 -36
- package/dist/cjs/dockview/strictEventsSequencing.js +6 -6
- package/dist/cjs/dockview/tabGroup.js +3 -3
- package/dist/cjs/dockview/tabGroupAccent.js +1 -3
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/events.js +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +3 -8
- package/dist/cjs/gridview/branchNode.js +13 -17
- package/dist/cjs/gridview/gridview.js +8 -8
- package/dist/cjs/gridview/gridviewComponent.js +1 -6
- package/dist/cjs/overlay/overlay.js +25 -28
- package/dist/cjs/overlay/overlayRenderContainer.js +3 -4
- package/dist/cjs/paneview/draggablePaneviewPanel.js +1 -1
- package/dist/cjs/paneview/paneviewComponent.js +2 -6
- package/dist/cjs/popoutWindow.js +4 -4
- package/dist/cjs/scrollbar.d.ts +1 -1
- package/dist/cjs/scrollbar.js +7 -6
- package/dist/cjs/splitview/splitview.d.ts +1 -1
- package/dist/cjs/splitview/splitview.js +21 -20
- package/dist/cjs/splitview/viewItem.js +1 -1
- package/dist/dockview-core.js +413 -330
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +412 -329
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -1
- package/dist/esm/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/esm/dnd/pointer/longPress.js +1 -1
- package/dist/esm/dnd/pointer/pointerDragController.js +9 -7
- package/dist/esm/dnd/pointer/pointerDragSource.js +4 -2
- package/dist/esm/dockview/components/panel/content.js +6 -6
- package/dist/esm/dockview/components/popupService.js +1 -1
- package/dist/esm/dockview/components/tab/tab.js +2 -2
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +1 -2
- package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +1 -2
- package/dist/esm/dockview/components/titlebar/groupDragSource.js +1 -1
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +5 -6
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/esm/dockview/components/titlebar/tabGroups.js +91 -42
- package/dist/esm/dockview/components/titlebar/tabs.js +17 -24
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/esm/dockview/dndCapabilities.js +3 -3
- package/dist/esm/dockview/dockviewComponent.d.ts +5 -5
- package/dist/esm/dockview/dockviewComponent.js +61 -51
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.js +19 -25
- package/dist/esm/dockview/dockviewPanel.js +1 -2
- package/dist/esm/dockview/dockviewShell.d.ts +29 -7
- package/dist/esm/dockview/dockviewShell.js +89 -37
- package/dist/esm/dockview/strictEventsSequencing.js +6 -6
- package/dist/esm/dockview/tabGroup.js +3 -3
- package/dist/esm/dockview/tabGroupAccent.js +1 -3
- package/dist/esm/dom.js +1 -1
- package/dist/esm/events.js +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +3 -8
- package/dist/esm/gridview/branchNode.js +13 -15
- package/dist/esm/gridview/gridview.js +8 -8
- package/dist/esm/gridview/gridviewComponent.js +1 -6
- package/dist/esm/overlay/overlay.js +25 -28
- package/dist/esm/overlay/overlayRenderContainer.js +3 -4
- package/dist/esm/paneview/draggablePaneviewPanel.js +1 -1
- package/dist/esm/paneview/paneviewComponent.js +2 -6
- package/dist/esm/popoutWindow.js +4 -4
- package/dist/esm/scrollbar.d.ts +1 -1
- package/dist/esm/scrollbar.js +7 -6
- package/dist/esm/splitview/splitview.d.ts +1 -1
- package/dist/esm/splitview/splitview.js +21 -20
- package/dist/esm/splitview/viewItem.js +1 -1
- package/dist/package/main.cjs.js +412 -329
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +412 -329
- package/dist/styles/dockview.css +8 -8
- package/package.json +1 -1
package/dist/esm/popoutWindow.js
CHANGED
|
@@ -19,13 +19,13 @@ import { CompositeDisposable, Disposable } from './lifecycle';
|
|
|
19
19
|
export function assertSameOriginPopoutUrl(url) {
|
|
20
20
|
let resolved;
|
|
21
21
|
try {
|
|
22
|
-
resolved = new URL(url,
|
|
22
|
+
resolved = new URL(url, globalThis.location.href);
|
|
23
23
|
}
|
|
24
24
|
catch (_a) {
|
|
25
25
|
throw new Error(`dockview: invalid popout URL: ${url}`);
|
|
26
26
|
}
|
|
27
27
|
const protocolOk = resolved.protocol === 'http:' || resolved.protocol === 'https:';
|
|
28
|
-
if (!protocolOk || resolved.origin !==
|
|
28
|
+
if (!protocolOk || resolved.origin !== globalThis.location.origin) {
|
|
29
29
|
throw new Error(`dockview: popout URL must be same-origin http(s); got: ${url}`);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -103,7 +103,7 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
103
103
|
this._window = { value: externalWindow, disposable };
|
|
104
104
|
disposable.addDisposables(Disposable.from(() => {
|
|
105
105
|
externalWindow.close();
|
|
106
|
-
}), addDisposableListener(window, 'beforeunload', () => {
|
|
106
|
+
}), addDisposableListener(globalThis.window, 'beforeunload', () => {
|
|
107
107
|
/**
|
|
108
108
|
* before the main window closes we should close this popup too
|
|
109
109
|
* to be good citizens
|
|
@@ -133,7 +133,7 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
133
133
|
const externalDocument = externalWindow.document;
|
|
134
134
|
externalDocument.title = document.title;
|
|
135
135
|
externalDocument.body.appendChild(container);
|
|
136
|
-
addStyles(externalDocument,
|
|
136
|
+
addStyles(externalDocument, globalThis.document.styleSheets, {
|
|
137
137
|
nonce: this.options.nonce,
|
|
138
138
|
});
|
|
139
139
|
/**
|
package/dist/esm/scrollbar.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class Scrollbar extends CompositeDisposable {
|
|
|
6
6
|
private _scrollOffset;
|
|
7
7
|
private _animationTimer;
|
|
8
8
|
private _orientation;
|
|
9
|
-
static MouseWheelSpeed
|
|
9
|
+
static readonly MouseWheelSpeed = 1;
|
|
10
10
|
get element(): HTMLElement;
|
|
11
11
|
get orientation(): 'horizontal' | 'vertical';
|
|
12
12
|
set orientation(value: 'horizontal' | 'vertical');
|
package/dist/esm/scrollbar.js
CHANGED
|
@@ -58,15 +58,16 @@ export class Scrollbar extends CompositeDisposable {
|
|
|
58
58
|
this._scrollOffset = originalScrollOffset + delta / p;
|
|
59
59
|
this.calculateScrollbarStyles();
|
|
60
60
|
};
|
|
61
|
+
const doc = this.element.ownerDocument;
|
|
61
62
|
const onEnd = () => {
|
|
62
63
|
toggleClass(this.element, 'dv-scrollable-scrolling', false);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
doc.removeEventListener('pointermove', onPointerMove);
|
|
65
|
+
doc.removeEventListener('pointerup', onEnd);
|
|
66
|
+
doc.removeEventListener('pointercancel', onEnd);
|
|
66
67
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
doc.addEventListener('pointermove', onPointerMove);
|
|
69
|
+
doc.addEventListener('pointerup', onEnd);
|
|
70
|
+
doc.addEventListener('pointercancel', onEnd);
|
|
70
71
|
}), addDisposableListener(this.element, 'scroll', () => {
|
|
71
72
|
this.calculateScrollbarStyles();
|
|
72
73
|
}), addDisposableListener(this.scrollableElement, 'scroll', () => {
|
|
@@ -137,7 +137,7 @@ export declare class Splitview {
|
|
|
137
137
|
private findFirstSnapIndex;
|
|
138
138
|
private updateSashEnablement;
|
|
139
139
|
private updateSash;
|
|
140
|
-
private resize;
|
|
140
|
+
private readonly resize;
|
|
141
141
|
private createViewContainer;
|
|
142
142
|
private createSashContainer;
|
|
143
143
|
private createContainer;
|
|
@@ -342,7 +342,7 @@ export class Splitview {
|
|
|
342
342
|
const viewItem = new ViewItem(container, view, viewSize, {
|
|
343
343
|
dispose: () => {
|
|
344
344
|
disposable.dispose();
|
|
345
|
-
|
|
345
|
+
container.remove();
|
|
346
346
|
},
|
|
347
347
|
});
|
|
348
348
|
if (index === this.viewItems.length) {
|
|
@@ -418,29 +418,30 @@ export class Splitview {
|
|
|
418
418
|
this.distributeEmptySpace();
|
|
419
419
|
this.layoutViews();
|
|
420
420
|
};
|
|
421
|
+
const doc = sash.ownerDocument;
|
|
421
422
|
const end = () => {
|
|
422
423
|
for (const item of this.viewItems) {
|
|
423
424
|
item.enabled = true;
|
|
424
425
|
}
|
|
425
426
|
iframes.release();
|
|
426
427
|
this.saveProportions();
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
428
|
+
doc.removeEventListener('pointermove', onPointerMove);
|
|
429
|
+
doc.removeEventListener('pointerup', end);
|
|
430
|
+
doc.removeEventListener('pointercancel', end);
|
|
431
|
+
doc.removeEventListener('contextmenu', end);
|
|
431
432
|
this._onDidSashEnd.fire(undefined);
|
|
432
433
|
};
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
doc.addEventListener('pointermove', onPointerMove);
|
|
435
|
+
doc.addEventListener('pointerup', end);
|
|
436
|
+
doc.addEventListener('pointercancel', end);
|
|
437
|
+
doc.addEventListener('contextmenu', end);
|
|
437
438
|
};
|
|
438
439
|
sash.addEventListener('pointerdown', onPointerStart);
|
|
439
440
|
const sashItem = {
|
|
440
441
|
container: sash,
|
|
441
442
|
disposable: () => {
|
|
442
443
|
sash.removeEventListener('pointerdown', onPointerStart);
|
|
443
|
-
|
|
444
|
+
sash.remove();
|
|
444
445
|
},
|
|
445
446
|
};
|
|
446
447
|
this.sashContainer.appendChild(sash);
|
|
@@ -487,7 +488,7 @@ export class Splitview {
|
|
|
487
488
|
if (!skipLayout) {
|
|
488
489
|
this.relayout();
|
|
489
490
|
}
|
|
490
|
-
if (sizing
|
|
491
|
+
if ((sizing === null || sizing === void 0 ? void 0 : sizing.type) === 'distribute') {
|
|
491
492
|
this.distributeViewSizes();
|
|
492
493
|
}
|
|
493
494
|
this._onDidRemoveView.fire(viewItem.view);
|
|
@@ -502,7 +503,7 @@ export class Splitview {
|
|
|
502
503
|
}
|
|
503
504
|
moveView(from, to) {
|
|
504
505
|
const cachedVisibleSize = this.getViewCachedVisibleSize(from);
|
|
505
|
-
const sizing =
|
|
506
|
+
const sizing = cachedVisibleSize === undefined
|
|
506
507
|
? this.getViewSize(from)
|
|
507
508
|
: Sizing.Invisible(cachedVisibleSize);
|
|
508
509
|
const view = this.removeView(from, undefined, true);
|
|
@@ -512,13 +513,7 @@ export class Splitview {
|
|
|
512
513
|
const previousSize = Math.max(this.size, this._contentSize);
|
|
513
514
|
this.size = size;
|
|
514
515
|
this.orthogonalSize = orthogonalSize;
|
|
515
|
-
if (
|
|
516
|
-
const indexes = range(this.viewItems.length);
|
|
517
|
-
const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.Low);
|
|
518
|
-
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.High);
|
|
519
|
-
this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
|
|
520
|
-
}
|
|
521
|
-
else {
|
|
516
|
+
if (this.proportions) {
|
|
522
517
|
let total = 0;
|
|
523
518
|
for (let i = 0; i < this.viewItems.length; i++) {
|
|
524
519
|
const item = this.viewItems[i];
|
|
@@ -538,6 +533,12 @@ export class Splitview {
|
|
|
538
533
|
}
|
|
539
534
|
}
|
|
540
535
|
}
|
|
536
|
+
else {
|
|
537
|
+
const indexes = range(this.viewItems.length);
|
|
538
|
+
const lowPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.Low);
|
|
539
|
+
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.High);
|
|
540
|
+
this.resize(this.viewItems.length - 1, size - previousSize, undefined, lowPriorityIndexes, highPriorityIndexes);
|
|
541
|
+
}
|
|
541
542
|
this.distributeEmptySpace();
|
|
542
543
|
this.layoutViews();
|
|
543
544
|
}
|
|
@@ -757,7 +758,7 @@ export class Splitview {
|
|
|
757
758
|
this._onDidRemoveView.dispose();
|
|
758
759
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
759
760
|
if (this.element.children.item(i) === this.element) {
|
|
760
|
-
this.element.
|
|
761
|
+
this.element.remove();
|
|
761
762
|
break;
|
|
762
763
|
}
|
|
763
764
|
}
|
|
@@ -10,7 +10,7 @@ export class ViewItem {
|
|
|
10
10
|
return this._cachedVisibleSize;
|
|
11
11
|
}
|
|
12
12
|
get visible() {
|
|
13
|
-
return
|
|
13
|
+
return this._cachedVisibleSize === undefined;
|
|
14
14
|
}
|
|
15
15
|
get minimumSize() {
|
|
16
16
|
return this.visible ? this.view.minimumSize : 0;
|