dockview-core 4.0.1 → 4.2.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.
- package/dist/cjs/api/component.api.d.ts +3 -1
- package/dist/cjs/api/component.api.js +14 -0
- package/dist/cjs/dockview/components/popupService.js +1 -1
- package/dist/cjs/dockview/components/titlebar/tabs.js +9 -3
- package/dist/cjs/dockview/dockviewComponent.d.ts +16 -0
- package/dist/cjs/dockview/dockviewComponent.js +27 -10
- package/dist/cjs/dockview/options.d.ts +7 -0
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.d.ts +6 -4
- package/dist/cjs/dom.js +90 -49
- package/dist/cjs/events.d.ts +1 -1
- package/dist/cjs/events.js +1 -10
- package/dist/cjs/overlay/overlay.js +4 -4
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +13 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +14 -4
- package/dist/cjs/paneview/paneviewComponent.d.ts +5 -0
- package/dist/cjs/paneview/paneviewComponent.js +25 -3
- package/dist/cjs/paneview/paneviewPanel.d.ts +13 -4
- package/dist/cjs/paneview/paneviewPanel.js +9 -13
- package/dist/cjs/popoutWindow.js +2 -2
- package/dist/cjs/splitview/splitviewComponent.js +3 -0
- package/dist/dockview-core.amd.js +165 -66
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +164 -65
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +165 -66
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +165 -66
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +165 -66
- package/dist/dockview-core.js.map +1 -1
- 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 +164 -65
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +3 -1
- package/dist/esm/api/component.api.js +6 -0
- package/dist/esm/dockview/components/popupService.js +2 -2
- package/dist/esm/dockview/components/titlebar/tabs.js +9 -3
- package/dist/esm/dockview/dockviewComponent.d.ts +16 -0
- package/dist/esm/dockview/dockviewComponent.js +29 -12
- package/dist/esm/dockview/options.d.ts +7 -0
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.d.ts +6 -4
- package/dist/esm/dom.js +65 -16
- package/dist/esm/events.d.ts +1 -1
- package/dist/esm/events.js +0 -8
- package/dist/esm/overlay/overlay.js +5 -5
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +13 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +14 -4
- package/dist/esm/paneview/paneviewComponent.d.ts +5 -0
- package/dist/esm/paneview/paneviewComponent.js +25 -3
- package/dist/esm/paneview/paneviewPanel.d.ts +13 -4
- package/dist/esm/paneview/paneviewPanel.js +9 -13
- package/dist/esm/popoutWindow.js +3 -3
- package/dist/esm/splitview/splitviewComponent.js +3 -0
- package/dist/styles/dockview.css +8 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.0
|
|
3
|
+
* @version 4.2.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -219,14 +219,6 @@
|
|
|
219
219
|
}
|
|
220
220
|
Emitter.ENABLE_TRACKING = false;
|
|
221
221
|
Emitter.MEMORY_LEAK_WATCHER = new LeakageMonitor();
|
|
222
|
-
function addDisposableWindowListener(element, type, listener, options) {
|
|
223
|
-
element.addEventListener(type, listener, options);
|
|
224
|
-
return {
|
|
225
|
-
dispose: () => {
|
|
226
|
-
element.removeEventListener(type, listener, options);
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
222
|
function addDisposableListener(element, type, listener, options) {
|
|
231
223
|
element.addEventListener(type, listener, options);
|
|
232
224
|
return {
|
|
@@ -405,9 +397,6 @@
|
|
|
405
397
|
}
|
|
406
398
|
return false;
|
|
407
399
|
}
|
|
408
|
-
function getElementsByTagName(tag) {
|
|
409
|
-
return Array.prototype.slice.call(document.getElementsByTagName(tag), 0);
|
|
410
|
-
}
|
|
411
400
|
function trackFocus(element) {
|
|
412
401
|
return new FocusTracker(element);
|
|
413
402
|
}
|
|
@@ -454,14 +443,8 @@
|
|
|
454
443
|
}
|
|
455
444
|
}
|
|
456
445
|
};
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
this.addDisposables(addDisposableWindowListener(element, 'focus', onFocus, true));
|
|
463
|
-
this.addDisposables(addDisposableWindowListener(element, 'blur', onBlur, true));
|
|
464
|
-
}
|
|
446
|
+
this.addDisposables(addDisposableListener(element, 'focus', onFocus, true));
|
|
447
|
+
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
465
448
|
}
|
|
466
449
|
refreshState() {
|
|
467
450
|
this._refreshStateHandler();
|
|
@@ -535,11 +518,30 @@
|
|
|
535
518
|
function addTestId(element, id) {
|
|
536
519
|
element.setAttribute('data-testid', id);
|
|
537
520
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
521
|
+
/**
|
|
522
|
+
* Should be more efficient than element.querySelectorAll("*") since there
|
|
523
|
+
* is no need to store every element in-memory using this approach
|
|
524
|
+
*/
|
|
525
|
+
function allTagsNamesInclusiveOfShadowDoms(tagNames) {
|
|
526
|
+
const iframes = [];
|
|
527
|
+
function findIframesInNode(node) {
|
|
528
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
529
|
+
if (tagNames.includes(node.tagName)) {
|
|
530
|
+
iframes.push(node);
|
|
531
|
+
}
|
|
532
|
+
if (node.shadowRoot) {
|
|
533
|
+
findIframesInNode(node.shadowRoot);
|
|
534
|
+
}
|
|
535
|
+
for (const child of node.children) {
|
|
536
|
+
findIframesInNode(child);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
findIframesInNode(document.documentElement);
|
|
541
|
+
return iframes;
|
|
542
|
+
}
|
|
543
|
+
function disableIframePointEvents(rootNode = document) {
|
|
544
|
+
const iframes = allTagsNamesInclusiveOfShadowDoms(['IFRAME', 'WEBVIEW']);
|
|
543
545
|
const original = new WeakMap(); // don't hold onto HTMLElement references longer than required
|
|
544
546
|
for (const iframe of iframes) {
|
|
545
547
|
original.set(iframe, iframe.style.pointerEvents);
|
|
@@ -591,6 +593,7 @@
|
|
|
591
593
|
}
|
|
592
594
|
}
|
|
593
595
|
}
|
|
596
|
+
const DEBOUCE_DELAY = 100;
|
|
594
597
|
function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
595
598
|
//
|
|
596
599
|
const childPosition = getDomNodePagePosition(child);
|
|
@@ -604,6 +607,41 @@
|
|
|
604
607
|
}
|
|
605
608
|
return true;
|
|
606
609
|
}
|
|
610
|
+
function onDidWindowMoveEnd(window) {
|
|
611
|
+
const emitter = new Emitter();
|
|
612
|
+
let previousScreenX = window.screenX;
|
|
613
|
+
let previousScreenY = window.screenY;
|
|
614
|
+
let timeout;
|
|
615
|
+
const checkMovement = () => {
|
|
616
|
+
if (window.closed) {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
const currentScreenX = window.screenX;
|
|
620
|
+
const currentScreenY = window.screenY;
|
|
621
|
+
if (currentScreenX !== previousScreenX ||
|
|
622
|
+
currentScreenY !== previousScreenY) {
|
|
623
|
+
clearTimeout(timeout);
|
|
624
|
+
timeout = setTimeout(() => {
|
|
625
|
+
emitter.fire();
|
|
626
|
+
}, DEBOUCE_DELAY);
|
|
627
|
+
previousScreenX = currentScreenX;
|
|
628
|
+
previousScreenY = currentScreenY;
|
|
629
|
+
}
|
|
630
|
+
requestAnimationFrame(checkMovement);
|
|
631
|
+
};
|
|
632
|
+
checkMovement();
|
|
633
|
+
return emitter;
|
|
634
|
+
}
|
|
635
|
+
function onDidWindowResizeEnd(element, cb) {
|
|
636
|
+
let resizeTimeout;
|
|
637
|
+
const disposable = new CompositeDisposable(addDisposableListener(element, 'resize', () => {
|
|
638
|
+
clearTimeout(resizeTimeout);
|
|
639
|
+
resizeTimeout = setTimeout(() => {
|
|
640
|
+
cb();
|
|
641
|
+
}, DEBOUCE_DELAY);
|
|
642
|
+
}));
|
|
643
|
+
return disposable;
|
|
644
|
+
}
|
|
607
645
|
|
|
608
646
|
function tail(arr) {
|
|
609
647
|
if (arr.length === 0) {
|
|
@@ -3543,6 +3581,12 @@
|
|
|
3543
3581
|
get onUnhandledDragOverEvent() {
|
|
3544
3582
|
return this.component.onUnhandledDragOverEvent;
|
|
3545
3583
|
}
|
|
3584
|
+
get onDidPopoutGroupSizeChange() {
|
|
3585
|
+
return this.component.onDidPopoutGroupSizeChange;
|
|
3586
|
+
}
|
|
3587
|
+
get onDidPopoutGroupPositionChange() {
|
|
3588
|
+
return this.component.onDidPopoutGroupPositionChange;
|
|
3589
|
+
}
|
|
3546
3590
|
/**
|
|
3547
3591
|
* All panel objects.
|
|
3548
3592
|
*/
|
|
@@ -4508,26 +4552,25 @@
|
|
|
4508
4552
|
this._headerVisible = value;
|
|
4509
4553
|
this.header.style.display = value ? '' : 'none';
|
|
4510
4554
|
}
|
|
4511
|
-
constructor(
|
|
4512
|
-
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
4513
|
-
this.headerComponent = headerComponent;
|
|
4555
|
+
constructor(options) {
|
|
4556
|
+
super(options.id, options.component, new PaneviewPanelApiImpl(options.id, options.component));
|
|
4514
4557
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4515
4558
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4516
4559
|
this._onDidChange = new Emitter();
|
|
4517
4560
|
this.onDidChange = this._onDidChange.event;
|
|
4518
|
-
this.headerSize = 22;
|
|
4519
4561
|
this._orthogonalSize = 0;
|
|
4520
4562
|
this._size = 0;
|
|
4521
|
-
this._minimumBodySize = 100;
|
|
4522
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4523
4563
|
this._isExpanded = false;
|
|
4524
|
-
this.expandedSize = 0;
|
|
4525
4564
|
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4526
4565
|
this.api.initialize(this);
|
|
4527
|
-
this.
|
|
4528
|
-
this.
|
|
4566
|
+
this.headerSize = options.headerSize;
|
|
4567
|
+
this.headerComponent = options.headerComponent;
|
|
4568
|
+
this._minimumBodySize = options.minimumBodySize;
|
|
4569
|
+
this._maximumBodySize = options.maximumBodySize;
|
|
4570
|
+
this._isExpanded = options.isExpanded;
|
|
4571
|
+
this._headerVisible = options.isHeaderVisible;
|
|
4529
4572
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4530
|
-
this._orientation = orientation;
|
|
4573
|
+
this._orientation = options.orientation;
|
|
4531
4574
|
this.element.classList.add('dv-pane');
|
|
4532
4575
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4533
4576
|
const { isVisible } = event;
|
|
@@ -4594,9 +4637,6 @@
|
|
|
4594
4637
|
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
4595
4638
|
? [size, orthogonalSize]
|
|
4596
4639
|
: [orthogonalSize, size];
|
|
4597
|
-
if (this.isExpanded()) {
|
|
4598
|
-
this.expandedSize = width;
|
|
4599
|
-
}
|
|
4600
4640
|
super.layout(width, height);
|
|
4601
4641
|
}
|
|
4602
4642
|
init(parameters) {
|
|
@@ -4653,15 +4693,25 @@
|
|
|
4653
4693
|
}
|
|
4654
4694
|
|
|
4655
4695
|
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4656
|
-
constructor(
|
|
4657
|
-
super(
|
|
4658
|
-
|
|
4696
|
+
constructor(options) {
|
|
4697
|
+
super({
|
|
4698
|
+
id: options.id,
|
|
4699
|
+
component: options.component,
|
|
4700
|
+
headerComponent: options.headerComponent,
|
|
4701
|
+
orientation: options.orientation,
|
|
4702
|
+
isExpanded: options.isExpanded,
|
|
4703
|
+
isHeaderVisible: true,
|
|
4704
|
+
headerSize: options.headerSize,
|
|
4705
|
+
minimumBodySize: options.minimumBodySize,
|
|
4706
|
+
maximumBodySize: options.maximumBodySize,
|
|
4707
|
+
});
|
|
4659
4708
|
this._onDidDrop = new Emitter();
|
|
4660
4709
|
this.onDidDrop = this._onDidDrop.event;
|
|
4661
4710
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
4662
4711
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4712
|
+
this.accessor = options.accessor;
|
|
4663
4713
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4664
|
-
if (!disableDnd) {
|
|
4714
|
+
if (!options.disableDnd) {
|
|
4665
4715
|
this.initDragFeatures();
|
|
4666
4716
|
}
|
|
4667
4717
|
}
|
|
@@ -5174,9 +5224,15 @@
|
|
|
5174
5224
|
this._tabsList = document.createElement('div');
|
|
5175
5225
|
this._tabsList.className = 'dv-tabs-container dv-horizontal';
|
|
5176
5226
|
this.showTabsOverflowControl = options.showTabsOverflowControl;
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5227
|
+
if (accessor.options.scrollbars === 'native') {
|
|
5228
|
+
this._element = this._tabsList;
|
|
5229
|
+
}
|
|
5230
|
+
else {
|
|
5231
|
+
const scrollbar = new Scrollbar(this._tabsList);
|
|
5232
|
+
this._element = scrollbar.element;
|
|
5233
|
+
this.addDisposables(scrollbar);
|
|
5234
|
+
}
|
|
5235
|
+
this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
|
|
5180
5236
|
if (event.defaultPrevented) {
|
|
5181
5237
|
return;
|
|
5182
5238
|
}
|
|
@@ -5601,6 +5657,7 @@
|
|
|
5601
5657
|
dndEdges: undefined,
|
|
5602
5658
|
theme: undefined,
|
|
5603
5659
|
disableTabsOverflowList: undefined,
|
|
5660
|
+
scrollbars: undefined,
|
|
5604
5661
|
};
|
|
5605
5662
|
return Object.keys(properties);
|
|
5606
5663
|
})();
|
|
@@ -7295,7 +7352,7 @@
|
|
|
7295
7352
|
dispose: () => {
|
|
7296
7353
|
iframes.release();
|
|
7297
7354
|
},
|
|
7298
|
-
},
|
|
7355
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7299
7356
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7300
7357
|
const x = e.clientX - containerRect.left;
|
|
7301
7358
|
const y = e.clientY - containerRect.top;
|
|
@@ -7332,7 +7389,7 @@
|
|
|
7332
7389
|
bounds.right = right;
|
|
7333
7390
|
}
|
|
7334
7391
|
this.setBounds(bounds);
|
|
7335
|
-
}),
|
|
7392
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7336
7393
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7337
7394
|
move.dispose();
|
|
7338
7395
|
this._onDidChangeEnd.fire();
|
|
@@ -7377,7 +7434,7 @@
|
|
|
7377
7434
|
e.preventDefault();
|
|
7378
7435
|
let startPosition = null;
|
|
7379
7436
|
const iframes = disableIframePointEvents();
|
|
7380
|
-
move.value = new CompositeDisposable(
|
|
7437
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7381
7438
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7382
7439
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7383
7440
|
const y = e.clientY - containerRect.top;
|
|
@@ -7501,7 +7558,7 @@
|
|
|
7501
7558
|
dispose: () => {
|
|
7502
7559
|
iframes.release();
|
|
7503
7560
|
},
|
|
7504
|
-
},
|
|
7561
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7505
7562
|
move.dispose();
|
|
7506
7563
|
this._onDidChangeEnd.fire();
|
|
7507
7564
|
}));
|
|
@@ -7807,7 +7864,7 @@
|
|
|
7807
7864
|
this._window = { value: externalWindow, disposable };
|
|
7808
7865
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7809
7866
|
externalWindow.close();
|
|
7810
|
-
}),
|
|
7867
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7811
7868
|
/**
|
|
7812
7869
|
* before the main window closes we should close this popup too
|
|
7813
7870
|
* to be good citizens
|
|
@@ -7842,7 +7899,7 @@
|
|
|
7842
7899
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7843
7900
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7844
7901
|
*/
|
|
7845
|
-
|
|
7902
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7846
7903
|
/**
|
|
7847
7904
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7848
7905
|
*/
|
|
@@ -7939,7 +7996,7 @@
|
|
|
7939
7996
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7940
7997
|
this._element.appendChild(wrapper);
|
|
7941
7998
|
this._active = wrapper;
|
|
7942
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7999
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7943
8000
|
var _a;
|
|
7944
8001
|
const target = event.target;
|
|
7945
8002
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8118,6 +8175,10 @@
|
|
|
8118
8175
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8119
8176
|
this._onDidAddPanel = new Emitter();
|
|
8120
8177
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8178
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8179
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8180
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8181
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8121
8182
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8122
8183
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8123
8184
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8147,7 +8208,7 @@
|
|
|
8147
8208
|
if (options.debug) {
|
|
8148
8209
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8149
8210
|
}
|
|
8150
|
-
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8211
|
+
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8151
8212
|
this.updateWatermark();
|
|
8152
8213
|
}), this.onDidAdd((event) => {
|
|
8153
8214
|
if (!this._moving) {
|
|
@@ -8168,7 +8229,7 @@
|
|
|
8168
8229
|
});
|
|
8169
8230
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8170
8231
|
this.updateWatermark();
|
|
8171
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8232
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8172
8233
|
this._bufferOnDidLayoutChange.fire();
|
|
8173
8234
|
}), exports.DockviewDisposable.from(() => {
|
|
8174
8235
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8429,13 +8490,26 @@
|
|
|
8429
8490
|
},
|
|
8430
8491
|
},
|
|
8431
8492
|
};
|
|
8432
|
-
|
|
8493
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8494
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8495
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8496
|
+
width: _window.window.innerWidth,
|
|
8497
|
+
height: _window.window.innerHeight,
|
|
8498
|
+
group,
|
|
8499
|
+
});
|
|
8500
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8501
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8502
|
+
screenX: _window.window.screenX,
|
|
8503
|
+
screenY: _window.window.screenX,
|
|
8504
|
+
group,
|
|
8505
|
+
});
|
|
8506
|
+
}),
|
|
8433
8507
|
/**
|
|
8434
8508
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8435
8509
|
* since we can reply on the window resize event as we will occupy the full
|
|
8436
8510
|
* window dimensions
|
|
8437
8511
|
*/
|
|
8438
|
-
|
|
8512
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8439
8513
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8440
8514
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8441
8515
|
if (this.isDisposed) {
|
|
@@ -8649,7 +8723,7 @@
|
|
|
8649
8723
|
}
|
|
8650
8724
|
this.updateWatermark();
|
|
8651
8725
|
}
|
|
8652
|
-
orthogonalize(position) {
|
|
8726
|
+
orthogonalize(position, options) {
|
|
8653
8727
|
switch (position) {
|
|
8654
8728
|
case 'top':
|
|
8655
8729
|
case 'bottom':
|
|
@@ -8672,10 +8746,10 @@
|
|
|
8672
8746
|
case 'top':
|
|
8673
8747
|
case 'left':
|
|
8674
8748
|
case 'center':
|
|
8675
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8749
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8676
8750
|
case 'bottom':
|
|
8677
8751
|
case 'right':
|
|
8678
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8752
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8679
8753
|
default:
|
|
8680
8754
|
throw new Error(`unsupported position ${position}`);
|
|
8681
8755
|
}
|
|
@@ -9171,7 +9245,7 @@
|
|
|
9171
9245
|
}
|
|
9172
9246
|
}
|
|
9173
9247
|
else {
|
|
9174
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9248
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9175
9249
|
if (!options.skipSetActive) {
|
|
9176
9250
|
this.doSetGroupAndPanelActive(group);
|
|
9177
9251
|
}
|
|
@@ -9613,8 +9687,8 @@
|
|
|
9613
9687
|
});
|
|
9614
9688
|
return panel;
|
|
9615
9689
|
}
|
|
9616
|
-
createGroupAtLocation(location, size) {
|
|
9617
|
-
const group = this.createGroup();
|
|
9690
|
+
createGroupAtLocation(location, size, options) {
|
|
9691
|
+
const group = this.createGroup(options);
|
|
9618
9692
|
this.doAddGroup(group, location, size);
|
|
9619
9693
|
return group;
|
|
9620
9694
|
}
|
|
@@ -9948,6 +10022,9 @@
|
|
|
9948
10022
|
return this._splitview;
|
|
9949
10023
|
}
|
|
9950
10024
|
set splitview(value) {
|
|
10025
|
+
if (this._splitview) {
|
|
10026
|
+
this._splitview.dispose();
|
|
10027
|
+
}
|
|
9951
10028
|
this._splitview = value;
|
|
9952
10029
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9953
10030
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10251,9 +10328,23 @@
|
|
|
10251
10328
|
}
|
|
10252
10329
|
|
|
10253
10330
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10331
|
+
const HEADER_SIZE = 22;
|
|
10332
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10333
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10254
10334
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10255
10335
|
constructor(options) {
|
|
10256
|
-
super(
|
|
10336
|
+
super({
|
|
10337
|
+
accessor: options.accessor,
|
|
10338
|
+
id: options.id,
|
|
10339
|
+
component: options.component,
|
|
10340
|
+
headerComponent: options.headerComponent,
|
|
10341
|
+
orientation: options.orientation,
|
|
10342
|
+
isExpanded: options.isExpanded,
|
|
10343
|
+
disableDnd: options.disableDnd,
|
|
10344
|
+
headerSize: options.headerSize,
|
|
10345
|
+
minimumBodySize: options.minimumBodySize,
|
|
10346
|
+
maximumBodySize: options.maximumBodySize,
|
|
10347
|
+
});
|
|
10257
10348
|
this.options = options;
|
|
10258
10349
|
}
|
|
10259
10350
|
getBodyComponent() {
|
|
@@ -10348,7 +10439,7 @@
|
|
|
10348
10439
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10349
10440
|
}
|
|
10350
10441
|
addPanel(options) {
|
|
10351
|
-
var _a;
|
|
10442
|
+
var _a, _b;
|
|
10352
10443
|
const body = this.options.createComponent({
|
|
10353
10444
|
id: options.id,
|
|
10354
10445
|
name: options.component,
|
|
@@ -10373,12 +10464,15 @@
|
|
|
10373
10464
|
isExpanded: !!options.isExpanded,
|
|
10374
10465
|
disableDnd: !!this.options.disableDnd,
|
|
10375
10466
|
accessor: this,
|
|
10467
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10468
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10469
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10376
10470
|
});
|
|
10377
10471
|
this.doAddPanel(view);
|
|
10378
10472
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10379
10473
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10380
10474
|
view.init({
|
|
10381
|
-
params: (
|
|
10475
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10382
10476
|
minimumBodySize: options.minimumBodySize,
|
|
10383
10477
|
maximumBodySize: options.maximumBodySize,
|
|
10384
10478
|
isExpanded: options.isExpanded,
|
|
@@ -10423,6 +10517,7 @@
|
|
|
10423
10517
|
data: view.toJSON(),
|
|
10424
10518
|
minimumSize: minimum(view.minimumBodySize),
|
|
10425
10519
|
maximumSize: maximum(view.maximumBodySize),
|
|
10520
|
+
headerSize: view.headerSize,
|
|
10426
10521
|
expanded: view.isExpanded(),
|
|
10427
10522
|
};
|
|
10428
10523
|
});
|
|
@@ -10443,6 +10538,7 @@
|
|
|
10443
10538
|
descriptor: {
|
|
10444
10539
|
size,
|
|
10445
10540
|
views: views.map((view) => {
|
|
10541
|
+
var _a, _b, _c;
|
|
10446
10542
|
const data = view.data;
|
|
10447
10543
|
const body = this.options.createComponent({
|
|
10448
10544
|
id: data.id,
|
|
@@ -10469,6 +10565,9 @@
|
|
|
10469
10565
|
isExpanded: !!view.expanded,
|
|
10470
10566
|
disableDnd: !!this.options.disableDnd,
|
|
10471
10567
|
accessor: this,
|
|
10568
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10569
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10570
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10472
10571
|
});
|
|
10473
10572
|
this.doAddPanel(panel);
|
|
10474
10573
|
queue.push(() => {
|