dockview-react 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/dockview-react.amd.js +165 -66
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +164 -65
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +165 -66
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +165 -66
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +165 -66
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +164 -65
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/dist/styles/dockview.css +8 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
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
|
}));
|
|
@@ -7784,7 +7841,7 @@
|
|
|
7784
7841
|
this._window = { value: externalWindow, disposable };
|
|
7785
7842
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7786
7843
|
externalWindow.close();
|
|
7787
|
-
}),
|
|
7844
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7788
7845
|
/**
|
|
7789
7846
|
* before the main window closes we should close this popup too
|
|
7790
7847
|
* to be good citizens
|
|
@@ -7819,7 +7876,7 @@
|
|
|
7819
7876
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7820
7877
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7821
7878
|
*/
|
|
7822
|
-
|
|
7879
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7823
7880
|
/**
|
|
7824
7881
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7825
7882
|
*/
|
|
@@ -7916,7 +7973,7 @@
|
|
|
7916
7973
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7917
7974
|
this._element.appendChild(wrapper);
|
|
7918
7975
|
this._active = wrapper;
|
|
7919
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7976
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7920
7977
|
var _a;
|
|
7921
7978
|
const target = event.target;
|
|
7922
7979
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8095,6 +8152,10 @@
|
|
|
8095
8152
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8096
8153
|
this._onDidAddPanel = new Emitter();
|
|
8097
8154
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8155
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8156
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8157
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8158
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8098
8159
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8099
8160
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8100
8161
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8124,7 +8185,7 @@
|
|
|
8124
8185
|
if (options.debug) {
|
|
8125
8186
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8126
8187
|
}
|
|
8127
|
-
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(() => {
|
|
8188
|
+
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(() => {
|
|
8128
8189
|
this.updateWatermark();
|
|
8129
8190
|
}), this.onDidAdd((event) => {
|
|
8130
8191
|
if (!this._moving) {
|
|
@@ -8145,7 +8206,7 @@
|
|
|
8145
8206
|
});
|
|
8146
8207
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8147
8208
|
this.updateWatermark();
|
|
8148
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8209
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8149
8210
|
this._bufferOnDidLayoutChange.fire();
|
|
8150
8211
|
}), exports.DockviewDisposable.from(() => {
|
|
8151
8212
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8406,13 +8467,26 @@
|
|
|
8406
8467
|
},
|
|
8407
8468
|
},
|
|
8408
8469
|
};
|
|
8409
|
-
|
|
8470
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8471
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8472
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8473
|
+
width: _window.window.innerWidth,
|
|
8474
|
+
height: _window.window.innerHeight,
|
|
8475
|
+
group,
|
|
8476
|
+
});
|
|
8477
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8478
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8479
|
+
screenX: _window.window.screenX,
|
|
8480
|
+
screenY: _window.window.screenX,
|
|
8481
|
+
group,
|
|
8482
|
+
});
|
|
8483
|
+
}),
|
|
8410
8484
|
/**
|
|
8411
8485
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8412
8486
|
* since we can reply on the window resize event as we will occupy the full
|
|
8413
8487
|
* window dimensions
|
|
8414
8488
|
*/
|
|
8415
|
-
|
|
8489
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8416
8490
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8417
8491
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8418
8492
|
if (this.isDisposed) {
|
|
@@ -8626,7 +8700,7 @@
|
|
|
8626
8700
|
}
|
|
8627
8701
|
this.updateWatermark();
|
|
8628
8702
|
}
|
|
8629
|
-
orthogonalize(position) {
|
|
8703
|
+
orthogonalize(position, options) {
|
|
8630
8704
|
switch (position) {
|
|
8631
8705
|
case 'top':
|
|
8632
8706
|
case 'bottom':
|
|
@@ -8649,10 +8723,10 @@
|
|
|
8649
8723
|
case 'top':
|
|
8650
8724
|
case 'left':
|
|
8651
8725
|
case 'center':
|
|
8652
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8726
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8653
8727
|
case 'bottom':
|
|
8654
8728
|
case 'right':
|
|
8655
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8729
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8656
8730
|
default:
|
|
8657
8731
|
throw new Error(`unsupported position ${position}`);
|
|
8658
8732
|
}
|
|
@@ -9148,7 +9222,7 @@
|
|
|
9148
9222
|
}
|
|
9149
9223
|
}
|
|
9150
9224
|
else {
|
|
9151
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9225
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9152
9226
|
if (!options.skipSetActive) {
|
|
9153
9227
|
this.doSetGroupAndPanelActive(group);
|
|
9154
9228
|
}
|
|
@@ -9590,8 +9664,8 @@
|
|
|
9590
9664
|
});
|
|
9591
9665
|
return panel;
|
|
9592
9666
|
}
|
|
9593
|
-
createGroupAtLocation(location, size) {
|
|
9594
|
-
const group = this.createGroup();
|
|
9667
|
+
createGroupAtLocation(location, size, options) {
|
|
9668
|
+
const group = this.createGroup(options);
|
|
9595
9669
|
this.doAddGroup(group, location, size);
|
|
9596
9670
|
return group;
|
|
9597
9671
|
}
|
|
@@ -9925,6 +9999,9 @@
|
|
|
9925
9999
|
return this._splitview;
|
|
9926
10000
|
}
|
|
9927
10001
|
set splitview(value) {
|
|
10002
|
+
if (this._splitview) {
|
|
10003
|
+
this._splitview.dispose();
|
|
10004
|
+
}
|
|
9928
10005
|
this._splitview = value;
|
|
9929
10006
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9930
10007
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10228,9 +10305,23 @@
|
|
|
10228
10305
|
}
|
|
10229
10306
|
|
|
10230
10307
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10308
|
+
const HEADER_SIZE = 22;
|
|
10309
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10310
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10231
10311
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10232
10312
|
constructor(options) {
|
|
10233
|
-
super(
|
|
10313
|
+
super({
|
|
10314
|
+
accessor: options.accessor,
|
|
10315
|
+
id: options.id,
|
|
10316
|
+
component: options.component,
|
|
10317
|
+
headerComponent: options.headerComponent,
|
|
10318
|
+
orientation: options.orientation,
|
|
10319
|
+
isExpanded: options.isExpanded,
|
|
10320
|
+
disableDnd: options.disableDnd,
|
|
10321
|
+
headerSize: options.headerSize,
|
|
10322
|
+
minimumBodySize: options.minimumBodySize,
|
|
10323
|
+
maximumBodySize: options.maximumBodySize,
|
|
10324
|
+
});
|
|
10234
10325
|
this.options = options;
|
|
10235
10326
|
}
|
|
10236
10327
|
getBodyComponent() {
|
|
@@ -10325,7 +10416,7 @@
|
|
|
10325
10416
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10326
10417
|
}
|
|
10327
10418
|
addPanel(options) {
|
|
10328
|
-
var _a;
|
|
10419
|
+
var _a, _b;
|
|
10329
10420
|
const body = this.options.createComponent({
|
|
10330
10421
|
id: options.id,
|
|
10331
10422
|
name: options.component,
|
|
@@ -10350,12 +10441,15 @@
|
|
|
10350
10441
|
isExpanded: !!options.isExpanded,
|
|
10351
10442
|
disableDnd: !!this.options.disableDnd,
|
|
10352
10443
|
accessor: this,
|
|
10444
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10445
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10446
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10353
10447
|
});
|
|
10354
10448
|
this.doAddPanel(view);
|
|
10355
10449
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10356
10450
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10357
10451
|
view.init({
|
|
10358
|
-
params: (
|
|
10452
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10359
10453
|
minimumBodySize: options.minimumBodySize,
|
|
10360
10454
|
maximumBodySize: options.maximumBodySize,
|
|
10361
10455
|
isExpanded: options.isExpanded,
|
|
@@ -10400,6 +10494,7 @@
|
|
|
10400
10494
|
data: view.toJSON(),
|
|
10401
10495
|
minimumSize: minimum(view.minimumBodySize),
|
|
10402
10496
|
maximumSize: maximum(view.maximumBodySize),
|
|
10497
|
+
headerSize: view.headerSize,
|
|
10403
10498
|
expanded: view.isExpanded(),
|
|
10404
10499
|
};
|
|
10405
10500
|
});
|
|
@@ -10420,6 +10515,7 @@
|
|
|
10420
10515
|
descriptor: {
|
|
10421
10516
|
size,
|
|
10422
10517
|
views: views.map((view) => {
|
|
10518
|
+
var _a, _b, _c;
|
|
10423
10519
|
const data = view.data;
|
|
10424
10520
|
const body = this.options.createComponent({
|
|
10425
10521
|
id: data.id,
|
|
@@ -10446,6 +10542,9 @@
|
|
|
10446
10542
|
isExpanded: !!view.expanded,
|
|
10447
10543
|
disableDnd: !!this.options.disableDnd,
|
|
10448
10544
|
accessor: this,
|
|
10545
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10546
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10547
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10449
10548
|
});
|
|
10450
10549
|
this.doAddPanel(panel);
|
|
10451
10550
|
queue.push(() => {
|