dockview-react 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-react.amd.js +154 -62
- 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 +154 -62
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +154 -62
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +154 -62
- 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 +154 -62
- 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 +154 -62
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.0
|
|
3
|
+
* @version 4.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -248,14 +248,6 @@ class Emitter {
|
|
|
248
248
|
}
|
|
249
249
|
Emitter.ENABLE_TRACKING = false;
|
|
250
250
|
Emitter.MEMORY_LEAK_WATCHER = new LeakageMonitor();
|
|
251
|
-
function addDisposableWindowListener(element, type, listener, options) {
|
|
252
|
-
element.addEventListener(type, listener, options);
|
|
253
|
-
return {
|
|
254
|
-
dispose: () => {
|
|
255
|
-
element.removeEventListener(type, listener, options);
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
251
|
function addDisposableListener(element, type, listener, options) {
|
|
260
252
|
element.addEventListener(type, listener, options);
|
|
261
253
|
return {
|
|
@@ -434,9 +426,6 @@ function isAncestor(testChild, testAncestor) {
|
|
|
434
426
|
}
|
|
435
427
|
return false;
|
|
436
428
|
}
|
|
437
|
-
function getElementsByTagName(tag) {
|
|
438
|
-
return Array.prototype.slice.call(document.getElementsByTagName(tag), 0);
|
|
439
|
-
}
|
|
440
429
|
function trackFocus(element) {
|
|
441
430
|
return new FocusTracker(element);
|
|
442
431
|
}
|
|
@@ -483,14 +472,8 @@ class FocusTracker extends CompositeDisposable {
|
|
|
483
472
|
}
|
|
484
473
|
}
|
|
485
474
|
};
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
489
|
-
}
|
|
490
|
-
else {
|
|
491
|
-
this.addDisposables(addDisposableWindowListener(element, 'focus', onFocus, true));
|
|
492
|
-
this.addDisposables(addDisposableWindowListener(element, 'blur', onBlur, true));
|
|
493
|
-
}
|
|
475
|
+
this.addDisposables(addDisposableListener(element, 'focus', onFocus, true));
|
|
476
|
+
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
494
477
|
}
|
|
495
478
|
refreshState() {
|
|
496
479
|
this._refreshStateHandler();
|
|
@@ -564,11 +547,30 @@ function isInDocument(element) {
|
|
|
564
547
|
function addTestId(element, id) {
|
|
565
548
|
element.setAttribute('data-testid', id);
|
|
566
549
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
550
|
+
/**
|
|
551
|
+
* Should be more efficient than element.querySelectorAll("*") since there
|
|
552
|
+
* is no need to store every element in-memory using this approach
|
|
553
|
+
*/
|
|
554
|
+
function allTagsNamesInclusiveOfShadowDoms(tagNames) {
|
|
555
|
+
const iframes = [];
|
|
556
|
+
function findIframesInNode(node) {
|
|
557
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
558
|
+
if (tagNames.includes(node.tagName)) {
|
|
559
|
+
iframes.push(node);
|
|
560
|
+
}
|
|
561
|
+
if (node.shadowRoot) {
|
|
562
|
+
findIframesInNode(node.shadowRoot);
|
|
563
|
+
}
|
|
564
|
+
for (const child of node.children) {
|
|
565
|
+
findIframesInNode(child);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
findIframesInNode(document.documentElement);
|
|
570
|
+
return iframes;
|
|
571
|
+
}
|
|
572
|
+
function disableIframePointEvents(rootNode = document) {
|
|
573
|
+
const iframes = allTagsNamesInclusiveOfShadowDoms(['IFRAME', 'WEBVIEW']);
|
|
572
574
|
const original = new WeakMap(); // don't hold onto HTMLElement references longer than required
|
|
573
575
|
for (const iframe of iframes) {
|
|
574
576
|
original.set(iframe, iframe.style.pointerEvents);
|
|
@@ -620,6 +622,7 @@ class Classnames {
|
|
|
620
622
|
}
|
|
621
623
|
}
|
|
622
624
|
}
|
|
625
|
+
const DEBOUCE_DELAY = 100;
|
|
623
626
|
function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
624
627
|
//
|
|
625
628
|
const childPosition = getDomNodePagePosition(child);
|
|
@@ -633,6 +636,41 @@ function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
|
633
636
|
}
|
|
634
637
|
return true;
|
|
635
638
|
}
|
|
639
|
+
function onDidWindowMoveEnd(window) {
|
|
640
|
+
const emitter = new Emitter();
|
|
641
|
+
let previousScreenX = window.screenX;
|
|
642
|
+
let previousScreenY = window.screenY;
|
|
643
|
+
let timeout;
|
|
644
|
+
const checkMovement = () => {
|
|
645
|
+
if (window.closed) {
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
const currentScreenX = window.screenX;
|
|
649
|
+
const currentScreenY = window.screenY;
|
|
650
|
+
if (currentScreenX !== previousScreenX ||
|
|
651
|
+
currentScreenY !== previousScreenY) {
|
|
652
|
+
clearTimeout(timeout);
|
|
653
|
+
timeout = setTimeout(() => {
|
|
654
|
+
emitter.fire();
|
|
655
|
+
}, DEBOUCE_DELAY);
|
|
656
|
+
previousScreenX = currentScreenX;
|
|
657
|
+
previousScreenY = currentScreenY;
|
|
658
|
+
}
|
|
659
|
+
requestAnimationFrame(checkMovement);
|
|
660
|
+
};
|
|
661
|
+
checkMovement();
|
|
662
|
+
return emitter;
|
|
663
|
+
}
|
|
664
|
+
function onDidWindowResizeEnd(element, cb) {
|
|
665
|
+
let resizeTimeout;
|
|
666
|
+
const disposable = new CompositeDisposable(addDisposableListener(element, 'resize', () => {
|
|
667
|
+
clearTimeout(resizeTimeout);
|
|
668
|
+
resizeTimeout = setTimeout(() => {
|
|
669
|
+
cb();
|
|
670
|
+
}, DEBOUCE_DELAY);
|
|
671
|
+
}));
|
|
672
|
+
return disposable;
|
|
673
|
+
}
|
|
636
674
|
|
|
637
675
|
function tail(arr) {
|
|
638
676
|
if (arr.length === 0) {
|
|
@@ -3572,6 +3610,12 @@ class DockviewApi {
|
|
|
3572
3610
|
get onUnhandledDragOverEvent() {
|
|
3573
3611
|
return this.component.onUnhandledDragOverEvent;
|
|
3574
3612
|
}
|
|
3613
|
+
get onDidPopoutGroupSizeChange() {
|
|
3614
|
+
return this.component.onDidPopoutGroupSizeChange;
|
|
3615
|
+
}
|
|
3616
|
+
get onDidPopoutGroupPositionChange() {
|
|
3617
|
+
return this.component.onDidPopoutGroupPositionChange;
|
|
3618
|
+
}
|
|
3575
3619
|
/**
|
|
3576
3620
|
* All panel objects.
|
|
3577
3621
|
*/
|
|
@@ -4537,26 +4581,25 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4537
4581
|
this._headerVisible = value;
|
|
4538
4582
|
this.header.style.display = value ? '' : 'none';
|
|
4539
4583
|
}
|
|
4540
|
-
constructor(
|
|
4541
|
-
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
4542
|
-
this.headerComponent = headerComponent;
|
|
4584
|
+
constructor(options) {
|
|
4585
|
+
super(options.id, options.component, new PaneviewPanelApiImpl(options.id, options.component));
|
|
4543
4586
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4544
4587
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4545
4588
|
this._onDidChange = new Emitter();
|
|
4546
4589
|
this.onDidChange = this._onDidChange.event;
|
|
4547
|
-
this.headerSize = 22;
|
|
4548
4590
|
this._orthogonalSize = 0;
|
|
4549
4591
|
this._size = 0;
|
|
4550
|
-
this._minimumBodySize = 100;
|
|
4551
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4552
4592
|
this._isExpanded = false;
|
|
4553
|
-
this.expandedSize = 0;
|
|
4554
4593
|
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4555
4594
|
this.api.initialize(this);
|
|
4556
|
-
this.
|
|
4557
|
-
this.
|
|
4595
|
+
this.headerSize = options.headerSize;
|
|
4596
|
+
this.headerComponent = options.headerComponent;
|
|
4597
|
+
this._minimumBodySize = options.minimumBodySize;
|
|
4598
|
+
this._maximumBodySize = options.maximumBodySize;
|
|
4599
|
+
this._isExpanded = options.isExpanded;
|
|
4600
|
+
this._headerVisible = options.isHeaderVisible;
|
|
4558
4601
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4559
|
-
this._orientation = orientation;
|
|
4602
|
+
this._orientation = options.orientation;
|
|
4560
4603
|
this.element.classList.add('dv-pane');
|
|
4561
4604
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4562
4605
|
const { isVisible } = event;
|
|
@@ -4623,9 +4666,6 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4623
4666
|
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
4624
4667
|
? [size, orthogonalSize]
|
|
4625
4668
|
: [orthogonalSize, size];
|
|
4626
|
-
if (this.isExpanded()) {
|
|
4627
|
-
this.expandedSize = width;
|
|
4628
|
-
}
|
|
4629
4669
|
super.layout(width, height);
|
|
4630
4670
|
}
|
|
4631
4671
|
init(parameters) {
|
|
@@ -4682,15 +4722,25 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4682
4722
|
}
|
|
4683
4723
|
|
|
4684
4724
|
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4685
|
-
constructor(
|
|
4686
|
-
super(
|
|
4687
|
-
|
|
4725
|
+
constructor(options) {
|
|
4726
|
+
super({
|
|
4727
|
+
id: options.id,
|
|
4728
|
+
component: options.component,
|
|
4729
|
+
headerComponent: options.headerComponent,
|
|
4730
|
+
orientation: options.orientation,
|
|
4731
|
+
isExpanded: options.isExpanded,
|
|
4732
|
+
isHeaderVisible: true,
|
|
4733
|
+
headerSize: options.headerSize,
|
|
4734
|
+
minimumBodySize: options.minimumBodySize,
|
|
4735
|
+
maximumBodySize: options.maximumBodySize,
|
|
4736
|
+
});
|
|
4688
4737
|
this._onDidDrop = new Emitter();
|
|
4689
4738
|
this.onDidDrop = this._onDidDrop.event;
|
|
4690
4739
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
4691
4740
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4741
|
+
this.accessor = options.accessor;
|
|
4692
4742
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4693
|
-
if (!disableDnd) {
|
|
4743
|
+
if (!options.disableDnd) {
|
|
4694
4744
|
this.initDragFeatures();
|
|
4695
4745
|
}
|
|
4696
4746
|
}
|
|
@@ -7324,7 +7374,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7324
7374
|
dispose: () => {
|
|
7325
7375
|
iframes.release();
|
|
7326
7376
|
},
|
|
7327
|
-
},
|
|
7377
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7328
7378
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7329
7379
|
const x = e.clientX - containerRect.left;
|
|
7330
7380
|
const y = e.clientY - containerRect.top;
|
|
@@ -7361,7 +7411,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7361
7411
|
bounds.right = right;
|
|
7362
7412
|
}
|
|
7363
7413
|
this.setBounds(bounds);
|
|
7364
|
-
}),
|
|
7414
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7365
7415
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7366
7416
|
move.dispose();
|
|
7367
7417
|
this._onDidChangeEnd.fire();
|
|
@@ -7406,7 +7456,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7406
7456
|
e.preventDefault();
|
|
7407
7457
|
let startPosition = null;
|
|
7408
7458
|
const iframes = disableIframePointEvents();
|
|
7409
|
-
move.value = new CompositeDisposable(
|
|
7459
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7410
7460
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7411
7461
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7412
7462
|
const y = e.clientY - containerRect.top;
|
|
@@ -7530,7 +7580,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7530
7580
|
dispose: () => {
|
|
7531
7581
|
iframes.release();
|
|
7532
7582
|
},
|
|
7533
|
-
},
|
|
7583
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7534
7584
|
move.dispose();
|
|
7535
7585
|
this._onDidChangeEnd.fire();
|
|
7536
7586
|
}));
|
|
@@ -7813,7 +7863,7 @@ class PopoutWindow extends CompositeDisposable {
|
|
|
7813
7863
|
this._window = { value: externalWindow, disposable };
|
|
7814
7864
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7815
7865
|
externalWindow.close();
|
|
7816
|
-
}),
|
|
7866
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7817
7867
|
/**
|
|
7818
7868
|
* before the main window closes we should close this popup too
|
|
7819
7869
|
* to be good citizens
|
|
@@ -7848,7 +7898,7 @@ class PopoutWindow extends CompositeDisposable {
|
|
|
7848
7898
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7849
7899
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7850
7900
|
*/
|
|
7851
|
-
|
|
7901
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7852
7902
|
/**
|
|
7853
7903
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7854
7904
|
*/
|
|
@@ -7945,7 +7995,7 @@ class PopupService extends CompositeDisposable {
|
|
|
7945
7995
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7946
7996
|
this._element.appendChild(wrapper);
|
|
7947
7997
|
this._active = wrapper;
|
|
7948
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7998
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7949
7999
|
var _a;
|
|
7950
8000
|
const target = event.target;
|
|
7951
8001
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8124,6 +8174,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
8124
8174
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8125
8175
|
this._onDidAddPanel = new Emitter();
|
|
8126
8176
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8177
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8178
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8179
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8180
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8127
8181
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8128
8182
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8129
8183
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8153,7 +8207,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8153
8207
|
if (options.debug) {
|
|
8154
8208
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8155
8209
|
}
|
|
8156
|
-
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(() => {
|
|
8210
|
+
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(() => {
|
|
8157
8211
|
this.updateWatermark();
|
|
8158
8212
|
}), this.onDidAdd((event) => {
|
|
8159
8213
|
if (!this._moving) {
|
|
@@ -8174,7 +8228,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8174
8228
|
});
|
|
8175
8229
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8176
8230
|
this.updateWatermark();
|
|
8177
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8231
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8178
8232
|
this._bufferOnDidLayoutChange.fire();
|
|
8179
8233
|
}), exports.DockviewDisposable.from(() => {
|
|
8180
8234
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8435,13 +8489,26 @@ class DockviewComponent extends BaseGrid {
|
|
|
8435
8489
|
},
|
|
8436
8490
|
},
|
|
8437
8491
|
};
|
|
8438
|
-
|
|
8492
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8493
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8494
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8495
|
+
width: _window.window.innerWidth,
|
|
8496
|
+
height: _window.window.innerHeight,
|
|
8497
|
+
group,
|
|
8498
|
+
});
|
|
8499
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8500
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8501
|
+
screenX: _window.window.screenX,
|
|
8502
|
+
screenY: _window.window.screenX,
|
|
8503
|
+
group,
|
|
8504
|
+
});
|
|
8505
|
+
}),
|
|
8439
8506
|
/**
|
|
8440
8507
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8441
8508
|
* since we can reply on the window resize event as we will occupy the full
|
|
8442
8509
|
* window dimensions
|
|
8443
8510
|
*/
|
|
8444
|
-
|
|
8511
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8445
8512
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8446
8513
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8447
8514
|
if (this.isDisposed) {
|
|
@@ -8655,7 +8722,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8655
8722
|
}
|
|
8656
8723
|
this.updateWatermark();
|
|
8657
8724
|
}
|
|
8658
|
-
orthogonalize(position) {
|
|
8725
|
+
orthogonalize(position, options) {
|
|
8659
8726
|
switch (position) {
|
|
8660
8727
|
case 'top':
|
|
8661
8728
|
case 'bottom':
|
|
@@ -8678,10 +8745,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
8678
8745
|
case 'top':
|
|
8679
8746
|
case 'left':
|
|
8680
8747
|
case 'center':
|
|
8681
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8748
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8682
8749
|
case 'bottom':
|
|
8683
8750
|
case 'right':
|
|
8684
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8751
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8685
8752
|
default:
|
|
8686
8753
|
throw new Error(`unsupported position ${position}`);
|
|
8687
8754
|
}
|
|
@@ -9177,7 +9244,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9177
9244
|
}
|
|
9178
9245
|
}
|
|
9179
9246
|
else {
|
|
9180
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9247
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9181
9248
|
if (!options.skipSetActive) {
|
|
9182
9249
|
this.doSetGroupAndPanelActive(group);
|
|
9183
9250
|
}
|
|
@@ -9619,8 +9686,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
9619
9686
|
});
|
|
9620
9687
|
return panel;
|
|
9621
9688
|
}
|
|
9622
|
-
createGroupAtLocation(location, size) {
|
|
9623
|
-
const group = this.createGroup();
|
|
9689
|
+
createGroupAtLocation(location, size, options) {
|
|
9690
|
+
const group = this.createGroup(options);
|
|
9624
9691
|
this.doAddGroup(group, location, size);
|
|
9625
9692
|
return group;
|
|
9626
9693
|
}
|
|
@@ -9954,6 +10021,9 @@ class SplitviewComponent extends Resizable {
|
|
|
9954
10021
|
return this._splitview;
|
|
9955
10022
|
}
|
|
9956
10023
|
set splitview(value) {
|
|
10024
|
+
if (this._splitview) {
|
|
10025
|
+
this._splitview.dispose();
|
|
10026
|
+
}
|
|
9957
10027
|
this._splitview = value;
|
|
9958
10028
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9959
10029
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10257,9 +10327,23 @@ class DefaultHeader extends CompositeDisposable {
|
|
|
10257
10327
|
}
|
|
10258
10328
|
|
|
10259
10329
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10330
|
+
const HEADER_SIZE = 22;
|
|
10331
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10332
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10260
10333
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10261
10334
|
constructor(options) {
|
|
10262
|
-
super(
|
|
10335
|
+
super({
|
|
10336
|
+
accessor: options.accessor,
|
|
10337
|
+
id: options.id,
|
|
10338
|
+
component: options.component,
|
|
10339
|
+
headerComponent: options.headerComponent,
|
|
10340
|
+
orientation: options.orientation,
|
|
10341
|
+
isExpanded: options.isExpanded,
|
|
10342
|
+
disableDnd: options.disableDnd,
|
|
10343
|
+
headerSize: options.headerSize,
|
|
10344
|
+
minimumBodySize: options.minimumBodySize,
|
|
10345
|
+
maximumBodySize: options.maximumBodySize,
|
|
10346
|
+
});
|
|
10263
10347
|
this.options = options;
|
|
10264
10348
|
}
|
|
10265
10349
|
getBodyComponent() {
|
|
@@ -10354,7 +10438,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10354
10438
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10355
10439
|
}
|
|
10356
10440
|
addPanel(options) {
|
|
10357
|
-
var _a;
|
|
10441
|
+
var _a, _b;
|
|
10358
10442
|
const body = this.options.createComponent({
|
|
10359
10443
|
id: options.id,
|
|
10360
10444
|
name: options.component,
|
|
@@ -10379,12 +10463,15 @@ class PaneviewComponent extends Resizable {
|
|
|
10379
10463
|
isExpanded: !!options.isExpanded,
|
|
10380
10464
|
disableDnd: !!this.options.disableDnd,
|
|
10381
10465
|
accessor: this,
|
|
10466
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10467
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10468
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10382
10469
|
});
|
|
10383
10470
|
this.doAddPanel(view);
|
|
10384
10471
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10385
10472
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10386
10473
|
view.init({
|
|
10387
|
-
params: (
|
|
10474
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10388
10475
|
minimumBodySize: options.minimumBodySize,
|
|
10389
10476
|
maximumBodySize: options.maximumBodySize,
|
|
10390
10477
|
isExpanded: options.isExpanded,
|
|
@@ -10429,6 +10516,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10429
10516
|
data: view.toJSON(),
|
|
10430
10517
|
minimumSize: minimum(view.minimumBodySize),
|
|
10431
10518
|
maximumSize: maximum(view.maximumBodySize),
|
|
10519
|
+
headerSize: view.headerSize,
|
|
10432
10520
|
expanded: view.isExpanded(),
|
|
10433
10521
|
};
|
|
10434
10522
|
});
|
|
@@ -10449,6 +10537,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10449
10537
|
descriptor: {
|
|
10450
10538
|
size,
|
|
10451
10539
|
views: views.map((view) => {
|
|
10540
|
+
var _a, _b, _c;
|
|
10452
10541
|
const data = view.data;
|
|
10453
10542
|
const body = this.options.createComponent({
|
|
10454
10543
|
id: data.id,
|
|
@@ -10475,6 +10564,9 @@ class PaneviewComponent extends Resizable {
|
|
|
10475
10564
|
isExpanded: !!view.expanded,
|
|
10476
10565
|
disableDnd: !!this.options.disableDnd,
|
|
10477
10566
|
accessor: this,
|
|
10567
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10568
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10569
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10478
10570
|
});
|
|
10479
10571
|
this.doAddPanel(panel);
|
|
10480
10572
|
queue.push(() => {
|