dockview 4.0.1 → 4.1.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.amd.js +154 -62
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +154 -62
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +154 -62
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +154 -62
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +154 -62
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +154 -62
- package/dist/dockview.noStyle.js.map +1 -1
- package/package.json +2 -2
package/dist/dockview.amd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview
|
|
3
|
-
* @version 4.0
|
|
3
|
+
* @version 4.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -245,14 +245,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
245
245
|
}
|
|
246
246
|
Emitter.ENABLE_TRACKING = false;
|
|
247
247
|
Emitter.MEMORY_LEAK_WATCHER = new LeakageMonitor();
|
|
248
|
-
function addDisposableWindowListener(element, type, listener, options) {
|
|
249
|
-
element.addEventListener(type, listener, options);
|
|
250
|
-
return {
|
|
251
|
-
dispose: () => {
|
|
252
|
-
element.removeEventListener(type, listener, options);
|
|
253
|
-
},
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
248
|
function addDisposableListener(element, type, listener, options) {
|
|
257
249
|
element.addEventListener(type, listener, options);
|
|
258
250
|
return {
|
|
@@ -431,9 +423,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
431
423
|
}
|
|
432
424
|
return false;
|
|
433
425
|
}
|
|
434
|
-
function getElementsByTagName(tag) {
|
|
435
|
-
return Array.prototype.slice.call(document.getElementsByTagName(tag), 0);
|
|
436
|
-
}
|
|
437
426
|
function trackFocus(element) {
|
|
438
427
|
return new FocusTracker(element);
|
|
439
428
|
}
|
|
@@ -480,14 +469,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
480
469
|
}
|
|
481
470
|
}
|
|
482
471
|
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
486
|
-
}
|
|
487
|
-
else {
|
|
488
|
-
this.addDisposables(addDisposableWindowListener(element, 'focus', onFocus, true));
|
|
489
|
-
this.addDisposables(addDisposableWindowListener(element, 'blur', onBlur, true));
|
|
490
|
-
}
|
|
472
|
+
this.addDisposables(addDisposableListener(element, 'focus', onFocus, true));
|
|
473
|
+
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
491
474
|
}
|
|
492
475
|
refreshState() {
|
|
493
476
|
this._refreshStateHandler();
|
|
@@ -561,11 +544,30 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
561
544
|
function addTestId(element, id) {
|
|
562
545
|
element.setAttribute('data-testid', id);
|
|
563
546
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
547
|
+
/**
|
|
548
|
+
* Should be more efficient than element.querySelectorAll("*") since there
|
|
549
|
+
* is no need to store every element in-memory using this approach
|
|
550
|
+
*/
|
|
551
|
+
function allTagsNamesInclusiveOfShadowDoms(tagNames) {
|
|
552
|
+
const iframes = [];
|
|
553
|
+
function findIframesInNode(node) {
|
|
554
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
555
|
+
if (tagNames.includes(node.tagName)) {
|
|
556
|
+
iframes.push(node);
|
|
557
|
+
}
|
|
558
|
+
if (node.shadowRoot) {
|
|
559
|
+
findIframesInNode(node.shadowRoot);
|
|
560
|
+
}
|
|
561
|
+
for (const child of node.children) {
|
|
562
|
+
findIframesInNode(child);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
findIframesInNode(document.documentElement);
|
|
567
|
+
return iframes;
|
|
568
|
+
}
|
|
569
|
+
function disableIframePointEvents(rootNode = document) {
|
|
570
|
+
const iframes = allTagsNamesInclusiveOfShadowDoms(['IFRAME', 'WEBVIEW']);
|
|
569
571
|
const original = new WeakMap(); // don't hold onto HTMLElement references longer than required
|
|
570
572
|
for (const iframe of iframes) {
|
|
571
573
|
original.set(iframe, iframe.style.pointerEvents);
|
|
@@ -617,6 +619,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
617
619
|
}
|
|
618
620
|
}
|
|
619
621
|
}
|
|
622
|
+
const DEBOUCE_DELAY = 100;
|
|
620
623
|
function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
621
624
|
//
|
|
622
625
|
const childPosition = getDomNodePagePosition(child);
|
|
@@ -630,6 +633,41 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
630
633
|
}
|
|
631
634
|
return true;
|
|
632
635
|
}
|
|
636
|
+
function onDidWindowMoveEnd(window) {
|
|
637
|
+
const emitter = new Emitter();
|
|
638
|
+
let previousScreenX = window.screenX;
|
|
639
|
+
let previousScreenY = window.screenY;
|
|
640
|
+
let timeout;
|
|
641
|
+
const checkMovement = () => {
|
|
642
|
+
if (window.closed) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
const currentScreenX = window.screenX;
|
|
646
|
+
const currentScreenY = window.screenY;
|
|
647
|
+
if (currentScreenX !== previousScreenX ||
|
|
648
|
+
currentScreenY !== previousScreenY) {
|
|
649
|
+
clearTimeout(timeout);
|
|
650
|
+
timeout = setTimeout(() => {
|
|
651
|
+
emitter.fire();
|
|
652
|
+
}, DEBOUCE_DELAY);
|
|
653
|
+
previousScreenX = currentScreenX;
|
|
654
|
+
previousScreenY = currentScreenY;
|
|
655
|
+
}
|
|
656
|
+
requestAnimationFrame(checkMovement);
|
|
657
|
+
};
|
|
658
|
+
checkMovement();
|
|
659
|
+
return emitter;
|
|
660
|
+
}
|
|
661
|
+
function onDidWindowResizeEnd(element, cb) {
|
|
662
|
+
let resizeTimeout;
|
|
663
|
+
const disposable = new CompositeDisposable(addDisposableListener(element, 'resize', () => {
|
|
664
|
+
clearTimeout(resizeTimeout);
|
|
665
|
+
resizeTimeout = setTimeout(() => {
|
|
666
|
+
cb();
|
|
667
|
+
}, DEBOUCE_DELAY);
|
|
668
|
+
}));
|
|
669
|
+
return disposable;
|
|
670
|
+
}
|
|
633
671
|
|
|
634
672
|
function tail(arr) {
|
|
635
673
|
if (arr.length === 0) {
|
|
@@ -3569,6 +3607,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3569
3607
|
get onUnhandledDragOverEvent() {
|
|
3570
3608
|
return this.component.onUnhandledDragOverEvent;
|
|
3571
3609
|
}
|
|
3610
|
+
get onDidPopoutGroupSizeChange() {
|
|
3611
|
+
return this.component.onDidPopoutGroupSizeChange;
|
|
3612
|
+
}
|
|
3613
|
+
get onDidPopoutGroupPositionChange() {
|
|
3614
|
+
return this.component.onDidPopoutGroupPositionChange;
|
|
3615
|
+
}
|
|
3572
3616
|
/**
|
|
3573
3617
|
* All panel objects.
|
|
3574
3618
|
*/
|
|
@@ -4534,26 +4578,25 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4534
4578
|
this._headerVisible = value;
|
|
4535
4579
|
this.header.style.display = value ? '' : 'none';
|
|
4536
4580
|
}
|
|
4537
|
-
constructor(
|
|
4538
|
-
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
4539
|
-
this.headerComponent = headerComponent;
|
|
4581
|
+
constructor(options) {
|
|
4582
|
+
super(options.id, options.component, new PaneviewPanelApiImpl(options.id, options.component));
|
|
4540
4583
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4541
4584
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4542
4585
|
this._onDidChange = new Emitter();
|
|
4543
4586
|
this.onDidChange = this._onDidChange.event;
|
|
4544
|
-
this.headerSize = 22;
|
|
4545
4587
|
this._orthogonalSize = 0;
|
|
4546
4588
|
this._size = 0;
|
|
4547
|
-
this._minimumBodySize = 100;
|
|
4548
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4549
4589
|
this._isExpanded = false;
|
|
4550
|
-
this.expandedSize = 0;
|
|
4551
4590
|
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4552
4591
|
this.api.initialize(this);
|
|
4553
|
-
this.
|
|
4554
|
-
this.
|
|
4592
|
+
this.headerSize = options.headerSize;
|
|
4593
|
+
this.headerComponent = options.headerComponent;
|
|
4594
|
+
this._minimumBodySize = options.minimumBodySize;
|
|
4595
|
+
this._maximumBodySize = options.maximumBodySize;
|
|
4596
|
+
this._isExpanded = options.isExpanded;
|
|
4597
|
+
this._headerVisible = options.isHeaderVisible;
|
|
4555
4598
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4556
|
-
this._orientation = orientation;
|
|
4599
|
+
this._orientation = options.orientation;
|
|
4557
4600
|
this.element.classList.add('dv-pane');
|
|
4558
4601
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4559
4602
|
const { isVisible } = event;
|
|
@@ -4620,9 +4663,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4620
4663
|
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
4621
4664
|
? [size, orthogonalSize]
|
|
4622
4665
|
: [orthogonalSize, size];
|
|
4623
|
-
if (this.isExpanded()) {
|
|
4624
|
-
this.expandedSize = width;
|
|
4625
|
-
}
|
|
4626
4666
|
super.layout(width, height);
|
|
4627
4667
|
}
|
|
4628
4668
|
init(parameters) {
|
|
@@ -4679,15 +4719,25 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4679
4719
|
}
|
|
4680
4720
|
|
|
4681
4721
|
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4682
|
-
constructor(
|
|
4683
|
-
super(
|
|
4684
|
-
|
|
4722
|
+
constructor(options) {
|
|
4723
|
+
super({
|
|
4724
|
+
id: options.id,
|
|
4725
|
+
component: options.component,
|
|
4726
|
+
headerComponent: options.headerComponent,
|
|
4727
|
+
orientation: options.orientation,
|
|
4728
|
+
isExpanded: options.isExpanded,
|
|
4729
|
+
isHeaderVisible: true,
|
|
4730
|
+
headerSize: options.headerSize,
|
|
4731
|
+
minimumBodySize: options.minimumBodySize,
|
|
4732
|
+
maximumBodySize: options.maximumBodySize,
|
|
4733
|
+
});
|
|
4685
4734
|
this._onDidDrop = new Emitter();
|
|
4686
4735
|
this.onDidDrop = this._onDidDrop.event;
|
|
4687
4736
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
4688
4737
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4738
|
+
this.accessor = options.accessor;
|
|
4689
4739
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4690
|
-
if (!disableDnd) {
|
|
4740
|
+
if (!options.disableDnd) {
|
|
4691
4741
|
this.initDragFeatures();
|
|
4692
4742
|
}
|
|
4693
4743
|
}
|
|
@@ -7321,7 +7371,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7321
7371
|
dispose: () => {
|
|
7322
7372
|
iframes.release();
|
|
7323
7373
|
},
|
|
7324
|
-
},
|
|
7374
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7325
7375
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7326
7376
|
const x = e.clientX - containerRect.left;
|
|
7327
7377
|
const y = e.clientY - containerRect.top;
|
|
@@ -7358,7 +7408,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7358
7408
|
bounds.right = right;
|
|
7359
7409
|
}
|
|
7360
7410
|
this.setBounds(bounds);
|
|
7361
|
-
}),
|
|
7411
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7362
7412
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7363
7413
|
move.dispose();
|
|
7364
7414
|
this._onDidChangeEnd.fire();
|
|
@@ -7403,7 +7453,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7403
7453
|
e.preventDefault();
|
|
7404
7454
|
let startPosition = null;
|
|
7405
7455
|
const iframes = disableIframePointEvents();
|
|
7406
|
-
move.value = new CompositeDisposable(
|
|
7456
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7407
7457
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7408
7458
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7409
7459
|
const y = e.clientY - containerRect.top;
|
|
@@ -7527,7 +7577,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7527
7577
|
dispose: () => {
|
|
7528
7578
|
iframes.release();
|
|
7529
7579
|
},
|
|
7530
|
-
},
|
|
7580
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7531
7581
|
move.dispose();
|
|
7532
7582
|
this._onDidChangeEnd.fire();
|
|
7533
7583
|
}));
|
|
@@ -7810,7 +7860,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7810
7860
|
this._window = { value: externalWindow, disposable };
|
|
7811
7861
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7812
7862
|
externalWindow.close();
|
|
7813
|
-
}),
|
|
7863
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7814
7864
|
/**
|
|
7815
7865
|
* before the main window closes we should close this popup too
|
|
7816
7866
|
* to be good citizens
|
|
@@ -7845,7 +7895,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7845
7895
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7846
7896
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7847
7897
|
*/
|
|
7848
|
-
|
|
7898
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7849
7899
|
/**
|
|
7850
7900
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7851
7901
|
*/
|
|
@@ -7942,7 +7992,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7942
7992
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7943
7993
|
this._element.appendChild(wrapper);
|
|
7944
7994
|
this._active = wrapper;
|
|
7945
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7995
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7946
7996
|
var _a;
|
|
7947
7997
|
const target = event.target;
|
|
7948
7998
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8121,6 +8171,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8121
8171
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8122
8172
|
this._onDidAddPanel = new Emitter();
|
|
8123
8173
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8174
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8175
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8176
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8177
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8124
8178
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8125
8179
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8126
8180
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8150,7 +8204,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8150
8204
|
if (options.debug) {
|
|
8151
8205
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8152
8206
|
}
|
|
8153
|
-
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(() => {
|
|
8207
|
+
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(() => {
|
|
8154
8208
|
this.updateWatermark();
|
|
8155
8209
|
}), this.onDidAdd((event) => {
|
|
8156
8210
|
if (!this._moving) {
|
|
@@ -8171,7 +8225,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8171
8225
|
});
|
|
8172
8226
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8173
8227
|
this.updateWatermark();
|
|
8174
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8228
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8175
8229
|
this._bufferOnDidLayoutChange.fire();
|
|
8176
8230
|
}), exports.DockviewDisposable.from(() => {
|
|
8177
8231
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8432,13 +8486,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8432
8486
|
},
|
|
8433
8487
|
},
|
|
8434
8488
|
};
|
|
8435
|
-
|
|
8489
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8490
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8491
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8492
|
+
width: _window.window.innerWidth,
|
|
8493
|
+
height: _window.window.innerHeight,
|
|
8494
|
+
group,
|
|
8495
|
+
});
|
|
8496
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8497
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8498
|
+
screenX: _window.window.screenX,
|
|
8499
|
+
screenY: _window.window.screenX,
|
|
8500
|
+
group,
|
|
8501
|
+
});
|
|
8502
|
+
}),
|
|
8436
8503
|
/**
|
|
8437
8504
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8438
8505
|
* since we can reply on the window resize event as we will occupy the full
|
|
8439
8506
|
* window dimensions
|
|
8440
8507
|
*/
|
|
8441
|
-
|
|
8508
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8442
8509
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8443
8510
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8444
8511
|
if (this.isDisposed) {
|
|
@@ -8652,7 +8719,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8652
8719
|
}
|
|
8653
8720
|
this.updateWatermark();
|
|
8654
8721
|
}
|
|
8655
|
-
orthogonalize(position) {
|
|
8722
|
+
orthogonalize(position, options) {
|
|
8656
8723
|
switch (position) {
|
|
8657
8724
|
case 'top':
|
|
8658
8725
|
case 'bottom':
|
|
@@ -8675,10 +8742,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8675
8742
|
case 'top':
|
|
8676
8743
|
case 'left':
|
|
8677
8744
|
case 'center':
|
|
8678
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8745
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8679
8746
|
case 'bottom':
|
|
8680
8747
|
case 'right':
|
|
8681
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8748
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8682
8749
|
default:
|
|
8683
8750
|
throw new Error(`unsupported position ${position}`);
|
|
8684
8751
|
}
|
|
@@ -9174,7 +9241,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9174
9241
|
}
|
|
9175
9242
|
}
|
|
9176
9243
|
else {
|
|
9177
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9244
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9178
9245
|
if (!options.skipSetActive) {
|
|
9179
9246
|
this.doSetGroupAndPanelActive(group);
|
|
9180
9247
|
}
|
|
@@ -9616,8 +9683,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9616
9683
|
});
|
|
9617
9684
|
return panel;
|
|
9618
9685
|
}
|
|
9619
|
-
createGroupAtLocation(location, size) {
|
|
9620
|
-
const group = this.createGroup();
|
|
9686
|
+
createGroupAtLocation(location, size, options) {
|
|
9687
|
+
const group = this.createGroup(options);
|
|
9621
9688
|
this.doAddGroup(group, location, size);
|
|
9622
9689
|
return group;
|
|
9623
9690
|
}
|
|
@@ -9951,6 +10018,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9951
10018
|
return this._splitview;
|
|
9952
10019
|
}
|
|
9953
10020
|
set splitview(value) {
|
|
10021
|
+
if (this._splitview) {
|
|
10022
|
+
this._splitview.dispose();
|
|
10023
|
+
}
|
|
9954
10024
|
this._splitview = value;
|
|
9955
10025
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9956
10026
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10254,9 +10324,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10254
10324
|
}
|
|
10255
10325
|
|
|
10256
10326
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10327
|
+
const HEADER_SIZE = 22;
|
|
10328
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10329
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10257
10330
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10258
10331
|
constructor(options) {
|
|
10259
|
-
super(
|
|
10332
|
+
super({
|
|
10333
|
+
accessor: options.accessor,
|
|
10334
|
+
id: options.id,
|
|
10335
|
+
component: options.component,
|
|
10336
|
+
headerComponent: options.headerComponent,
|
|
10337
|
+
orientation: options.orientation,
|
|
10338
|
+
isExpanded: options.isExpanded,
|
|
10339
|
+
disableDnd: options.disableDnd,
|
|
10340
|
+
headerSize: options.headerSize,
|
|
10341
|
+
minimumBodySize: options.minimumBodySize,
|
|
10342
|
+
maximumBodySize: options.maximumBodySize,
|
|
10343
|
+
});
|
|
10260
10344
|
this.options = options;
|
|
10261
10345
|
}
|
|
10262
10346
|
getBodyComponent() {
|
|
@@ -10351,7 +10435,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10351
10435
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10352
10436
|
}
|
|
10353
10437
|
addPanel(options) {
|
|
10354
|
-
var _a;
|
|
10438
|
+
var _a, _b;
|
|
10355
10439
|
const body = this.options.createComponent({
|
|
10356
10440
|
id: options.id,
|
|
10357
10441
|
name: options.component,
|
|
@@ -10376,12 +10460,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10376
10460
|
isExpanded: !!options.isExpanded,
|
|
10377
10461
|
disableDnd: !!this.options.disableDnd,
|
|
10378
10462
|
accessor: this,
|
|
10463
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10464
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10465
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10379
10466
|
});
|
|
10380
10467
|
this.doAddPanel(view);
|
|
10381
10468
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10382
10469
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10383
10470
|
view.init({
|
|
10384
|
-
params: (
|
|
10471
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10385
10472
|
minimumBodySize: options.minimumBodySize,
|
|
10386
10473
|
maximumBodySize: options.maximumBodySize,
|
|
10387
10474
|
isExpanded: options.isExpanded,
|
|
@@ -10426,6 +10513,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10426
10513
|
data: view.toJSON(),
|
|
10427
10514
|
minimumSize: minimum(view.minimumBodySize),
|
|
10428
10515
|
maximumSize: maximum(view.maximumBodySize),
|
|
10516
|
+
headerSize: view.headerSize,
|
|
10429
10517
|
expanded: view.isExpanded(),
|
|
10430
10518
|
};
|
|
10431
10519
|
});
|
|
@@ -10446,6 +10534,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10446
10534
|
descriptor: {
|
|
10447
10535
|
size,
|
|
10448
10536
|
views: views.map((view) => {
|
|
10537
|
+
var _a, _b, _c;
|
|
10449
10538
|
const data = view.data;
|
|
10450
10539
|
const body = this.options.createComponent({
|
|
10451
10540
|
id: data.id,
|
|
@@ -10472,6 +10561,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10472
10561
|
isExpanded: !!view.expanded,
|
|
10473
10562
|
disableDnd: !!this.options.disableDnd,
|
|
10474
10563
|
accessor: this,
|
|
10564
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10565
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10566
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10475
10567
|
});
|
|
10476
10568
|
this.doAddPanel(panel);
|
|
10477
10569
|
queue.push(() => {
|