dockview-core 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/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/dockviewComponent.d.ts +16 -0
- package/dist/cjs/dockview/dockviewComponent.js +27 -10
- 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 +154 -62
- 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 +154 -62
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +154 -62
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +154 -62
- 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 +154 -62
- 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 +154 -62
- 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/dockviewComponent.d.ts +16 -0
- package/dist/esm/dockview/dockviewComponent.js +29 -12
- 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/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.0
|
|
3
|
+
* @version 4.1.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -243,14 +243,6 @@ class Emitter {
|
|
|
243
243
|
}
|
|
244
244
|
Emitter.ENABLE_TRACKING = false;
|
|
245
245
|
Emitter.MEMORY_LEAK_WATCHER = new LeakageMonitor();
|
|
246
|
-
function addDisposableWindowListener(element, type, listener, options) {
|
|
247
|
-
element.addEventListener(type, listener, options);
|
|
248
|
-
return {
|
|
249
|
-
dispose: () => {
|
|
250
|
-
element.removeEventListener(type, listener, options);
|
|
251
|
-
},
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
246
|
function addDisposableListener(element, type, listener, options) {
|
|
255
247
|
element.addEventListener(type, listener, options);
|
|
256
248
|
return {
|
|
@@ -429,9 +421,6 @@ function isAncestor(testChild, testAncestor) {
|
|
|
429
421
|
}
|
|
430
422
|
return false;
|
|
431
423
|
}
|
|
432
|
-
function getElementsByTagName(tag) {
|
|
433
|
-
return Array.prototype.slice.call(document.getElementsByTagName(tag), 0);
|
|
434
|
-
}
|
|
435
424
|
function trackFocus(element) {
|
|
436
425
|
return new FocusTracker(element);
|
|
437
426
|
}
|
|
@@ -478,14 +467,8 @@ class FocusTracker extends CompositeDisposable {
|
|
|
478
467
|
}
|
|
479
468
|
}
|
|
480
469
|
};
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
484
|
-
}
|
|
485
|
-
else {
|
|
486
|
-
this.addDisposables(addDisposableWindowListener(element, 'focus', onFocus, true));
|
|
487
|
-
this.addDisposables(addDisposableWindowListener(element, 'blur', onBlur, true));
|
|
488
|
-
}
|
|
470
|
+
this.addDisposables(addDisposableListener(element, 'focus', onFocus, true));
|
|
471
|
+
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
489
472
|
}
|
|
490
473
|
refreshState() {
|
|
491
474
|
this._refreshStateHandler();
|
|
@@ -559,11 +542,30 @@ function isInDocument(element) {
|
|
|
559
542
|
function addTestId(element, id) {
|
|
560
543
|
element.setAttribute('data-testid', id);
|
|
561
544
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
545
|
+
/**
|
|
546
|
+
* Should be more efficient than element.querySelectorAll("*") since there
|
|
547
|
+
* is no need to store every element in-memory using this approach
|
|
548
|
+
*/
|
|
549
|
+
function allTagsNamesInclusiveOfShadowDoms(tagNames) {
|
|
550
|
+
const iframes = [];
|
|
551
|
+
function findIframesInNode(node) {
|
|
552
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
553
|
+
if (tagNames.includes(node.tagName)) {
|
|
554
|
+
iframes.push(node);
|
|
555
|
+
}
|
|
556
|
+
if (node.shadowRoot) {
|
|
557
|
+
findIframesInNode(node.shadowRoot);
|
|
558
|
+
}
|
|
559
|
+
for (const child of node.children) {
|
|
560
|
+
findIframesInNode(child);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
findIframesInNode(document.documentElement);
|
|
565
|
+
return iframes;
|
|
566
|
+
}
|
|
567
|
+
function disableIframePointEvents(rootNode = document) {
|
|
568
|
+
const iframes = allTagsNamesInclusiveOfShadowDoms(['IFRAME', 'WEBVIEW']);
|
|
567
569
|
const original = new WeakMap(); // don't hold onto HTMLElement references longer than required
|
|
568
570
|
for (const iframe of iframes) {
|
|
569
571
|
original.set(iframe, iframe.style.pointerEvents);
|
|
@@ -615,6 +617,7 @@ class Classnames {
|
|
|
615
617
|
}
|
|
616
618
|
}
|
|
617
619
|
}
|
|
620
|
+
const DEBOUCE_DELAY = 100;
|
|
618
621
|
function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
619
622
|
//
|
|
620
623
|
const childPosition = getDomNodePagePosition(child);
|
|
@@ -628,6 +631,41 @@ function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
|
628
631
|
}
|
|
629
632
|
return true;
|
|
630
633
|
}
|
|
634
|
+
function onDidWindowMoveEnd(window) {
|
|
635
|
+
const emitter = new Emitter();
|
|
636
|
+
let previousScreenX = window.screenX;
|
|
637
|
+
let previousScreenY = window.screenY;
|
|
638
|
+
let timeout;
|
|
639
|
+
const checkMovement = () => {
|
|
640
|
+
if (window.closed) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
const currentScreenX = window.screenX;
|
|
644
|
+
const currentScreenY = window.screenY;
|
|
645
|
+
if (currentScreenX !== previousScreenX ||
|
|
646
|
+
currentScreenY !== previousScreenY) {
|
|
647
|
+
clearTimeout(timeout);
|
|
648
|
+
timeout = setTimeout(() => {
|
|
649
|
+
emitter.fire();
|
|
650
|
+
}, DEBOUCE_DELAY);
|
|
651
|
+
previousScreenX = currentScreenX;
|
|
652
|
+
previousScreenY = currentScreenY;
|
|
653
|
+
}
|
|
654
|
+
requestAnimationFrame(checkMovement);
|
|
655
|
+
};
|
|
656
|
+
checkMovement();
|
|
657
|
+
return emitter;
|
|
658
|
+
}
|
|
659
|
+
function onDidWindowResizeEnd(element, cb) {
|
|
660
|
+
let resizeTimeout;
|
|
661
|
+
const disposable = new CompositeDisposable(addDisposableListener(element, 'resize', () => {
|
|
662
|
+
clearTimeout(resizeTimeout);
|
|
663
|
+
resizeTimeout = setTimeout(() => {
|
|
664
|
+
cb();
|
|
665
|
+
}, DEBOUCE_DELAY);
|
|
666
|
+
}));
|
|
667
|
+
return disposable;
|
|
668
|
+
}
|
|
631
669
|
|
|
632
670
|
function tail(arr) {
|
|
633
671
|
if (arr.length === 0) {
|
|
@@ -3567,6 +3605,12 @@ class DockviewApi {
|
|
|
3567
3605
|
get onUnhandledDragOverEvent() {
|
|
3568
3606
|
return this.component.onUnhandledDragOverEvent;
|
|
3569
3607
|
}
|
|
3608
|
+
get onDidPopoutGroupSizeChange() {
|
|
3609
|
+
return this.component.onDidPopoutGroupSizeChange;
|
|
3610
|
+
}
|
|
3611
|
+
get onDidPopoutGroupPositionChange() {
|
|
3612
|
+
return this.component.onDidPopoutGroupPositionChange;
|
|
3613
|
+
}
|
|
3570
3614
|
/**
|
|
3571
3615
|
* All panel objects.
|
|
3572
3616
|
*/
|
|
@@ -4532,26 +4576,25 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4532
4576
|
this._headerVisible = value;
|
|
4533
4577
|
this.header.style.display = value ? '' : 'none';
|
|
4534
4578
|
}
|
|
4535
|
-
constructor(
|
|
4536
|
-
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
4537
|
-
this.headerComponent = headerComponent;
|
|
4579
|
+
constructor(options) {
|
|
4580
|
+
super(options.id, options.component, new PaneviewPanelApiImpl(options.id, options.component));
|
|
4538
4581
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4539
4582
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4540
4583
|
this._onDidChange = new Emitter();
|
|
4541
4584
|
this.onDidChange = this._onDidChange.event;
|
|
4542
|
-
this.headerSize = 22;
|
|
4543
4585
|
this._orthogonalSize = 0;
|
|
4544
4586
|
this._size = 0;
|
|
4545
|
-
this._minimumBodySize = 100;
|
|
4546
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4547
4587
|
this._isExpanded = false;
|
|
4548
|
-
this.expandedSize = 0;
|
|
4549
4588
|
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4550
4589
|
this.api.initialize(this);
|
|
4551
|
-
this.
|
|
4552
|
-
this.
|
|
4590
|
+
this.headerSize = options.headerSize;
|
|
4591
|
+
this.headerComponent = options.headerComponent;
|
|
4592
|
+
this._minimumBodySize = options.minimumBodySize;
|
|
4593
|
+
this._maximumBodySize = options.maximumBodySize;
|
|
4594
|
+
this._isExpanded = options.isExpanded;
|
|
4595
|
+
this._headerVisible = options.isHeaderVisible;
|
|
4553
4596
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4554
|
-
this._orientation = orientation;
|
|
4597
|
+
this._orientation = options.orientation;
|
|
4555
4598
|
this.element.classList.add('dv-pane');
|
|
4556
4599
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4557
4600
|
const { isVisible } = event;
|
|
@@ -4618,9 +4661,6 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4618
4661
|
const [width, height] = this.orientation === Orientation.HORIZONTAL
|
|
4619
4662
|
? [size, orthogonalSize]
|
|
4620
4663
|
: [orthogonalSize, size];
|
|
4621
|
-
if (this.isExpanded()) {
|
|
4622
|
-
this.expandedSize = width;
|
|
4623
|
-
}
|
|
4624
4664
|
super.layout(width, height);
|
|
4625
4665
|
}
|
|
4626
4666
|
init(parameters) {
|
|
@@ -4677,15 +4717,25 @@ class PaneviewPanel extends BasePanelView {
|
|
|
4677
4717
|
}
|
|
4678
4718
|
|
|
4679
4719
|
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4680
|
-
constructor(
|
|
4681
|
-
super(
|
|
4682
|
-
|
|
4720
|
+
constructor(options) {
|
|
4721
|
+
super({
|
|
4722
|
+
id: options.id,
|
|
4723
|
+
component: options.component,
|
|
4724
|
+
headerComponent: options.headerComponent,
|
|
4725
|
+
orientation: options.orientation,
|
|
4726
|
+
isExpanded: options.isExpanded,
|
|
4727
|
+
isHeaderVisible: true,
|
|
4728
|
+
headerSize: options.headerSize,
|
|
4729
|
+
minimumBodySize: options.minimumBodySize,
|
|
4730
|
+
maximumBodySize: options.maximumBodySize,
|
|
4731
|
+
});
|
|
4683
4732
|
this._onDidDrop = new Emitter();
|
|
4684
4733
|
this.onDidDrop = this._onDidDrop.event;
|
|
4685
4734
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
4686
4735
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4736
|
+
this.accessor = options.accessor;
|
|
4687
4737
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4688
|
-
if (!disableDnd) {
|
|
4738
|
+
if (!options.disableDnd) {
|
|
4689
4739
|
this.initDragFeatures();
|
|
4690
4740
|
}
|
|
4691
4741
|
}
|
|
@@ -7319,7 +7369,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7319
7369
|
dispose: () => {
|
|
7320
7370
|
iframes.release();
|
|
7321
7371
|
},
|
|
7322
|
-
},
|
|
7372
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7323
7373
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7324
7374
|
const x = e.clientX - containerRect.left;
|
|
7325
7375
|
const y = e.clientY - containerRect.top;
|
|
@@ -7356,7 +7406,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7356
7406
|
bounds.right = right;
|
|
7357
7407
|
}
|
|
7358
7408
|
this.setBounds(bounds);
|
|
7359
|
-
}),
|
|
7409
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7360
7410
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7361
7411
|
move.dispose();
|
|
7362
7412
|
this._onDidChangeEnd.fire();
|
|
@@ -7401,7 +7451,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7401
7451
|
e.preventDefault();
|
|
7402
7452
|
let startPosition = null;
|
|
7403
7453
|
const iframes = disableIframePointEvents();
|
|
7404
|
-
move.value = new CompositeDisposable(
|
|
7454
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7405
7455
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7406
7456
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7407
7457
|
const y = e.clientY - containerRect.top;
|
|
@@ -7525,7 +7575,7 @@ class Overlay extends CompositeDisposable {
|
|
|
7525
7575
|
dispose: () => {
|
|
7526
7576
|
iframes.release();
|
|
7527
7577
|
},
|
|
7528
|
-
},
|
|
7578
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7529
7579
|
move.dispose();
|
|
7530
7580
|
this._onDidChangeEnd.fire();
|
|
7531
7581
|
}));
|
|
@@ -7831,7 +7881,7 @@ class PopoutWindow extends CompositeDisposable {
|
|
|
7831
7881
|
this._window = { value: externalWindow, disposable };
|
|
7832
7882
|
disposable.addDisposables(Disposable.from(() => {
|
|
7833
7883
|
externalWindow.close();
|
|
7834
|
-
}),
|
|
7884
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7835
7885
|
/**
|
|
7836
7886
|
* before the main window closes we should close this popup too
|
|
7837
7887
|
* to be good citizens
|
|
@@ -7866,7 +7916,7 @@ class PopoutWindow extends CompositeDisposable {
|
|
|
7866
7916
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7867
7917
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7868
7918
|
*/
|
|
7869
|
-
|
|
7919
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7870
7920
|
/**
|
|
7871
7921
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7872
7922
|
*/
|
|
@@ -7963,7 +8013,7 @@ class PopupService extends CompositeDisposable {
|
|
|
7963
8013
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7964
8014
|
this._element.appendChild(wrapper);
|
|
7965
8015
|
this._active = wrapper;
|
|
7966
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
8016
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7967
8017
|
var _a;
|
|
7968
8018
|
const target = event.target;
|
|
7969
8019
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8142,6 +8192,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
8142
8192
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8143
8193
|
this._onDidAddPanel = new Emitter();
|
|
8144
8194
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8195
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8196
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8197
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8198
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8145
8199
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8146
8200
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8147
8201
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8171,7 +8225,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8171
8225
|
if (options.debug) {
|
|
8172
8226
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8173
8227
|
}
|
|
8174
|
-
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(() => {
|
|
8228
|
+
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(() => {
|
|
8175
8229
|
this.updateWatermark();
|
|
8176
8230
|
}), this.onDidAdd((event) => {
|
|
8177
8231
|
if (!this._moving) {
|
|
@@ -8192,7 +8246,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8192
8246
|
});
|
|
8193
8247
|
}), Event.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8194
8248
|
this.updateWatermark();
|
|
8195
|
-
}), Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8249
|
+
}), Event.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8196
8250
|
this._bufferOnDidLayoutChange.fire();
|
|
8197
8251
|
}), Disposable.from(() => {
|
|
8198
8252
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8453,13 +8507,26 @@ class DockviewComponent extends BaseGrid {
|
|
|
8453
8507
|
},
|
|
8454
8508
|
},
|
|
8455
8509
|
};
|
|
8456
|
-
|
|
8510
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8511
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8512
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8513
|
+
width: _window.window.innerWidth,
|
|
8514
|
+
height: _window.window.innerHeight,
|
|
8515
|
+
group,
|
|
8516
|
+
});
|
|
8517
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8518
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8519
|
+
screenX: _window.window.screenX,
|
|
8520
|
+
screenY: _window.window.screenX,
|
|
8521
|
+
group,
|
|
8522
|
+
});
|
|
8523
|
+
}),
|
|
8457
8524
|
/**
|
|
8458
8525
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8459
8526
|
* since we can reply on the window resize event as we will occupy the full
|
|
8460
8527
|
* window dimensions
|
|
8461
8528
|
*/
|
|
8462
|
-
|
|
8529
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8463
8530
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8464
8531
|
}), overlayRenderContainer, Disposable.from(() => {
|
|
8465
8532
|
if (this.isDisposed) {
|
|
@@ -8673,7 +8740,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
8673
8740
|
}
|
|
8674
8741
|
this.updateWatermark();
|
|
8675
8742
|
}
|
|
8676
|
-
orthogonalize(position) {
|
|
8743
|
+
orthogonalize(position, options) {
|
|
8677
8744
|
switch (position) {
|
|
8678
8745
|
case 'top':
|
|
8679
8746
|
case 'bottom':
|
|
@@ -8696,10 +8763,10 @@ class DockviewComponent extends BaseGrid {
|
|
|
8696
8763
|
case 'top':
|
|
8697
8764
|
case 'left':
|
|
8698
8765
|
case 'center':
|
|
8699
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8766
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8700
8767
|
case 'bottom':
|
|
8701
8768
|
case 'right':
|
|
8702
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8769
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8703
8770
|
default:
|
|
8704
8771
|
throw new Error(`unsupported position ${position}`);
|
|
8705
8772
|
}
|
|
@@ -9195,7 +9262,7 @@ class DockviewComponent extends BaseGrid {
|
|
|
9195
9262
|
}
|
|
9196
9263
|
}
|
|
9197
9264
|
else {
|
|
9198
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9265
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9199
9266
|
if (!options.skipSetActive) {
|
|
9200
9267
|
this.doSetGroupAndPanelActive(group);
|
|
9201
9268
|
}
|
|
@@ -9637,8 +9704,8 @@ class DockviewComponent extends BaseGrid {
|
|
|
9637
9704
|
});
|
|
9638
9705
|
return panel;
|
|
9639
9706
|
}
|
|
9640
|
-
createGroupAtLocation(location, size) {
|
|
9641
|
-
const group = this.createGroup();
|
|
9707
|
+
createGroupAtLocation(location, size, options) {
|
|
9708
|
+
const group = this.createGroup(options);
|
|
9642
9709
|
this.doAddGroup(group, location, size);
|
|
9643
9710
|
return group;
|
|
9644
9711
|
}
|
|
@@ -9972,6 +10039,9 @@ class SplitviewComponent extends Resizable {
|
|
|
9972
10039
|
return this._splitview;
|
|
9973
10040
|
}
|
|
9974
10041
|
set splitview(value) {
|
|
10042
|
+
if (this._splitview) {
|
|
10043
|
+
this._splitview.dispose();
|
|
10044
|
+
}
|
|
9975
10045
|
this._splitview = value;
|
|
9976
10046
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9977
10047
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10275,9 +10345,23 @@ class DefaultHeader extends CompositeDisposable {
|
|
|
10275
10345
|
}
|
|
10276
10346
|
|
|
10277
10347
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10348
|
+
const HEADER_SIZE = 22;
|
|
10349
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10350
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10278
10351
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10279
10352
|
constructor(options) {
|
|
10280
|
-
super(
|
|
10353
|
+
super({
|
|
10354
|
+
accessor: options.accessor,
|
|
10355
|
+
id: options.id,
|
|
10356
|
+
component: options.component,
|
|
10357
|
+
headerComponent: options.headerComponent,
|
|
10358
|
+
orientation: options.orientation,
|
|
10359
|
+
isExpanded: options.isExpanded,
|
|
10360
|
+
disableDnd: options.disableDnd,
|
|
10361
|
+
headerSize: options.headerSize,
|
|
10362
|
+
minimumBodySize: options.minimumBodySize,
|
|
10363
|
+
maximumBodySize: options.maximumBodySize,
|
|
10364
|
+
});
|
|
10281
10365
|
this.options = options;
|
|
10282
10366
|
}
|
|
10283
10367
|
getBodyComponent() {
|
|
@@ -10372,7 +10456,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10372
10456
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10373
10457
|
}
|
|
10374
10458
|
addPanel(options) {
|
|
10375
|
-
var _a;
|
|
10459
|
+
var _a, _b;
|
|
10376
10460
|
const body = this.options.createComponent({
|
|
10377
10461
|
id: options.id,
|
|
10378
10462
|
name: options.component,
|
|
@@ -10397,12 +10481,15 @@ class PaneviewComponent extends Resizable {
|
|
|
10397
10481
|
isExpanded: !!options.isExpanded,
|
|
10398
10482
|
disableDnd: !!this.options.disableDnd,
|
|
10399
10483
|
accessor: this,
|
|
10484
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10485
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10486
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10400
10487
|
});
|
|
10401
10488
|
this.doAddPanel(view);
|
|
10402
10489
|
const size = typeof options.size === 'number' ? options.size : Sizing.Distribute;
|
|
10403
10490
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10404
10491
|
view.init({
|
|
10405
|
-
params: (
|
|
10492
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10406
10493
|
minimumBodySize: options.minimumBodySize,
|
|
10407
10494
|
maximumBodySize: options.maximumBodySize,
|
|
10408
10495
|
isExpanded: options.isExpanded,
|
|
@@ -10447,6 +10534,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10447
10534
|
data: view.toJSON(),
|
|
10448
10535
|
minimumSize: minimum(view.minimumBodySize),
|
|
10449
10536
|
maximumSize: maximum(view.maximumBodySize),
|
|
10537
|
+
headerSize: view.headerSize,
|
|
10450
10538
|
expanded: view.isExpanded(),
|
|
10451
10539
|
};
|
|
10452
10540
|
});
|
|
@@ -10467,6 +10555,7 @@ class PaneviewComponent extends Resizable {
|
|
|
10467
10555
|
descriptor: {
|
|
10468
10556
|
size,
|
|
10469
10557
|
views: views.map((view) => {
|
|
10558
|
+
var _a, _b, _c;
|
|
10470
10559
|
const data = view.data;
|
|
10471
10560
|
const body = this.options.createComponent({
|
|
10472
10561
|
id: data.id,
|
|
@@ -10493,6 +10582,9 @@ class PaneviewComponent extends Resizable {
|
|
|
10493
10582
|
isExpanded: !!view.expanded,
|
|
10494
10583
|
disableDnd: !!this.options.disableDnd,
|
|
10495
10584
|
accessor: this,
|
|
10585
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10586
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10587
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10496
10588
|
});
|
|
10497
10589
|
this.doAddPanel(panel);
|
|
10498
10590
|
queue.push(() => {
|