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
|
*/
|
|
@@ -215,14 +215,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
215
215
|
}
|
|
216
216
|
Emitter.ENABLE_TRACKING = false;
|
|
217
217
|
Emitter.MEMORY_LEAK_WATCHER = new LeakageMonitor();
|
|
218
|
-
function addDisposableWindowListener(element, type, listener, options) {
|
|
219
|
-
element.addEventListener(type, listener, options);
|
|
220
|
-
return {
|
|
221
|
-
dispose: () => {
|
|
222
|
-
element.removeEventListener(type, listener, options);
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
218
|
function addDisposableListener(element, type, listener, options) {
|
|
227
219
|
element.addEventListener(type, listener, options);
|
|
228
220
|
return {
|
|
@@ -401,9 +393,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
401
393
|
}
|
|
402
394
|
return false;
|
|
403
395
|
}
|
|
404
|
-
function getElementsByTagName(tag) {
|
|
405
|
-
return Array.prototype.slice.call(document.getElementsByTagName(tag), 0);
|
|
406
|
-
}
|
|
407
396
|
function trackFocus(element) {
|
|
408
397
|
return new FocusTracker(element);
|
|
409
398
|
}
|
|
@@ -450,14 +439,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
450
439
|
}
|
|
451
440
|
}
|
|
452
441
|
};
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
this.addDisposables(addDisposableWindowListener(element, 'focus', onFocus, true));
|
|
459
|
-
this.addDisposables(addDisposableWindowListener(element, 'blur', onBlur, true));
|
|
460
|
-
}
|
|
442
|
+
this.addDisposables(addDisposableListener(element, 'focus', onFocus, true));
|
|
443
|
+
this.addDisposables(addDisposableListener(element, 'blur', onBlur, true));
|
|
461
444
|
}
|
|
462
445
|
refreshState() {
|
|
463
446
|
this._refreshStateHandler();
|
|
@@ -531,11 +514,30 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
531
514
|
function addTestId(element, id) {
|
|
532
515
|
element.setAttribute('data-testid', id);
|
|
533
516
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
517
|
+
/**
|
|
518
|
+
* Should be more efficient than element.querySelectorAll("*") since there
|
|
519
|
+
* is no need to store every element in-memory using this approach
|
|
520
|
+
*/
|
|
521
|
+
function allTagsNamesInclusiveOfShadowDoms(tagNames) {
|
|
522
|
+
const iframes = [];
|
|
523
|
+
function findIframesInNode(node) {
|
|
524
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
525
|
+
if (tagNames.includes(node.tagName)) {
|
|
526
|
+
iframes.push(node);
|
|
527
|
+
}
|
|
528
|
+
if (node.shadowRoot) {
|
|
529
|
+
findIframesInNode(node.shadowRoot);
|
|
530
|
+
}
|
|
531
|
+
for (const child of node.children) {
|
|
532
|
+
findIframesInNode(child);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
findIframesInNode(document.documentElement);
|
|
537
|
+
return iframes;
|
|
538
|
+
}
|
|
539
|
+
function disableIframePointEvents(rootNode = document) {
|
|
540
|
+
const iframes = allTagsNamesInclusiveOfShadowDoms(['IFRAME', 'WEBVIEW']);
|
|
539
541
|
const original = new WeakMap(); // don't hold onto HTMLElement references longer than required
|
|
540
542
|
for (const iframe of iframes) {
|
|
541
543
|
original.set(iframe, iframe.style.pointerEvents);
|
|
@@ -587,6 +589,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
587
589
|
}
|
|
588
590
|
}
|
|
589
591
|
}
|
|
592
|
+
const DEBOUCE_DELAY = 100;
|
|
590
593
|
function isChildEntirelyVisibleWithinParent(child, parent) {
|
|
591
594
|
//
|
|
592
595
|
const childPosition = getDomNodePagePosition(child);
|
|
@@ -600,6 +603,41 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
600
603
|
}
|
|
601
604
|
return true;
|
|
602
605
|
}
|
|
606
|
+
function onDidWindowMoveEnd(window) {
|
|
607
|
+
const emitter = new Emitter();
|
|
608
|
+
let previousScreenX = window.screenX;
|
|
609
|
+
let previousScreenY = window.screenY;
|
|
610
|
+
let timeout;
|
|
611
|
+
const checkMovement = () => {
|
|
612
|
+
if (window.closed) {
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
const currentScreenX = window.screenX;
|
|
616
|
+
const currentScreenY = window.screenY;
|
|
617
|
+
if (currentScreenX !== previousScreenX ||
|
|
618
|
+
currentScreenY !== previousScreenY) {
|
|
619
|
+
clearTimeout(timeout);
|
|
620
|
+
timeout = setTimeout(() => {
|
|
621
|
+
emitter.fire();
|
|
622
|
+
}, DEBOUCE_DELAY);
|
|
623
|
+
previousScreenX = currentScreenX;
|
|
624
|
+
previousScreenY = currentScreenY;
|
|
625
|
+
}
|
|
626
|
+
requestAnimationFrame(checkMovement);
|
|
627
|
+
};
|
|
628
|
+
checkMovement();
|
|
629
|
+
return emitter;
|
|
630
|
+
}
|
|
631
|
+
function onDidWindowResizeEnd(element, cb) {
|
|
632
|
+
let resizeTimeout;
|
|
633
|
+
const disposable = new CompositeDisposable(addDisposableListener(element, 'resize', () => {
|
|
634
|
+
clearTimeout(resizeTimeout);
|
|
635
|
+
resizeTimeout = setTimeout(() => {
|
|
636
|
+
cb();
|
|
637
|
+
}, DEBOUCE_DELAY);
|
|
638
|
+
}));
|
|
639
|
+
return disposable;
|
|
640
|
+
}
|
|
603
641
|
|
|
604
642
|
function tail(arr) {
|
|
605
643
|
if (arr.length === 0) {
|
|
@@ -3539,6 +3577,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3539
3577
|
get onUnhandledDragOverEvent() {
|
|
3540
3578
|
return this.component.onUnhandledDragOverEvent;
|
|
3541
3579
|
}
|
|
3580
|
+
get onDidPopoutGroupSizeChange() {
|
|
3581
|
+
return this.component.onDidPopoutGroupSizeChange;
|
|
3582
|
+
}
|
|
3583
|
+
get onDidPopoutGroupPositionChange() {
|
|
3584
|
+
return this.component.onDidPopoutGroupPositionChange;
|
|
3585
|
+
}
|
|
3542
3586
|
/**
|
|
3543
3587
|
* All panel objects.
|
|
3544
3588
|
*/
|
|
@@ -4504,26 +4548,25 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4504
4548
|
this._headerVisible = value;
|
|
4505
4549
|
this.header.style.display = value ? '' : 'none';
|
|
4506
4550
|
}
|
|
4507
|
-
constructor(
|
|
4508
|
-
super(id, component, new PaneviewPanelApiImpl(id, component));
|
|
4509
|
-
this.headerComponent = headerComponent;
|
|
4551
|
+
constructor(options) {
|
|
4552
|
+
super(options.id, options.component, new PaneviewPanelApiImpl(options.id, options.component));
|
|
4510
4553
|
this._onDidChangeExpansionState = new Emitter({ replay: true });
|
|
4511
4554
|
this.onDidChangeExpansionState = this._onDidChangeExpansionState.event;
|
|
4512
4555
|
this._onDidChange = new Emitter();
|
|
4513
4556
|
this.onDidChange = this._onDidChange.event;
|
|
4514
|
-
this.headerSize = 22;
|
|
4515
4557
|
this._orthogonalSize = 0;
|
|
4516
4558
|
this._size = 0;
|
|
4517
|
-
this._minimumBodySize = 100;
|
|
4518
|
-
this._maximumBodySize = Number.POSITIVE_INFINITY;
|
|
4519
4559
|
this._isExpanded = false;
|
|
4520
|
-
this.expandedSize = 0;
|
|
4521
4560
|
this.api.pane = this; // TODO cannot use 'this' before 'super'
|
|
4522
4561
|
this.api.initialize(this);
|
|
4523
|
-
this.
|
|
4524
|
-
this.
|
|
4562
|
+
this.headerSize = options.headerSize;
|
|
4563
|
+
this.headerComponent = options.headerComponent;
|
|
4564
|
+
this._minimumBodySize = options.minimumBodySize;
|
|
4565
|
+
this._maximumBodySize = options.maximumBodySize;
|
|
4566
|
+
this._isExpanded = options.isExpanded;
|
|
4567
|
+
this._headerVisible = options.isHeaderVisible;
|
|
4525
4568
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4526
|
-
this._orientation = orientation;
|
|
4569
|
+
this._orientation = options.orientation;
|
|
4527
4570
|
this.element.classList.add('dv-pane');
|
|
4528
4571
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4529
4572
|
const { isVisible } = event;
|
|
@@ -4590,9 +4633,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4590
4633
|
const [width, height] = this.orientation === exports.Orientation.HORIZONTAL
|
|
4591
4634
|
? [size, orthogonalSize]
|
|
4592
4635
|
: [orthogonalSize, size];
|
|
4593
|
-
if (this.isExpanded()) {
|
|
4594
|
-
this.expandedSize = width;
|
|
4595
|
-
}
|
|
4596
4636
|
super.layout(width, height);
|
|
4597
4637
|
}
|
|
4598
4638
|
init(parameters) {
|
|
@@ -4649,15 +4689,25 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
4649
4689
|
}
|
|
4650
4690
|
|
|
4651
4691
|
class DraggablePaneviewPanel extends PaneviewPanel {
|
|
4652
|
-
constructor(
|
|
4653
|
-
super(
|
|
4654
|
-
|
|
4692
|
+
constructor(options) {
|
|
4693
|
+
super({
|
|
4694
|
+
id: options.id,
|
|
4695
|
+
component: options.component,
|
|
4696
|
+
headerComponent: options.headerComponent,
|
|
4697
|
+
orientation: options.orientation,
|
|
4698
|
+
isExpanded: options.isExpanded,
|
|
4699
|
+
isHeaderVisible: true,
|
|
4700
|
+
headerSize: options.headerSize,
|
|
4701
|
+
minimumBodySize: options.minimumBodySize,
|
|
4702
|
+
maximumBodySize: options.maximumBodySize,
|
|
4703
|
+
});
|
|
4655
4704
|
this._onDidDrop = new Emitter();
|
|
4656
4705
|
this.onDidDrop = this._onDidDrop.event;
|
|
4657
4706
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
4658
4707
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
4708
|
+
this.accessor = options.accessor;
|
|
4659
4709
|
this.addDisposables(this._onDidDrop, this._onUnhandledDragOverEvent);
|
|
4660
|
-
if (!disableDnd) {
|
|
4710
|
+
if (!options.disableDnd) {
|
|
4661
4711
|
this.initDragFeatures();
|
|
4662
4712
|
}
|
|
4663
4713
|
}
|
|
@@ -7291,7 +7341,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7291
7341
|
dispose: () => {
|
|
7292
7342
|
iframes.release();
|
|
7293
7343
|
},
|
|
7294
|
-
},
|
|
7344
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7295
7345
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7296
7346
|
const x = e.clientX - containerRect.left;
|
|
7297
7347
|
const y = e.clientY - containerRect.top;
|
|
@@ -7328,7 +7378,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7328
7378
|
bounds.right = right;
|
|
7329
7379
|
}
|
|
7330
7380
|
this.setBounds(bounds);
|
|
7331
|
-
}),
|
|
7381
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7332
7382
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7333
7383
|
move.dispose();
|
|
7334
7384
|
this._onDidChangeEnd.fire();
|
|
@@ -7373,7 +7423,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7373
7423
|
e.preventDefault();
|
|
7374
7424
|
let startPosition = null;
|
|
7375
7425
|
const iframes = disableIframePointEvents();
|
|
7376
|
-
move.value = new CompositeDisposable(
|
|
7426
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7377
7427
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7378
7428
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7379
7429
|
const y = e.clientY - containerRect.top;
|
|
@@ -7497,7 +7547,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7497
7547
|
dispose: () => {
|
|
7498
7548
|
iframes.release();
|
|
7499
7549
|
},
|
|
7500
|
-
},
|
|
7550
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7501
7551
|
move.dispose();
|
|
7502
7552
|
this._onDidChangeEnd.fire();
|
|
7503
7553
|
}));
|
|
@@ -7803,7 +7853,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7803
7853
|
this._window = { value: externalWindow, disposable };
|
|
7804
7854
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7805
7855
|
externalWindow.close();
|
|
7806
|
-
}),
|
|
7856
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7807
7857
|
/**
|
|
7808
7858
|
* before the main window closes we should close this popup too
|
|
7809
7859
|
* to be good citizens
|
|
@@ -7838,7 +7888,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7838
7888
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7839
7889
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7840
7890
|
*/
|
|
7841
|
-
|
|
7891
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7842
7892
|
/**
|
|
7843
7893
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7844
7894
|
*/
|
|
@@ -7935,7 +7985,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7935
7985
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7936
7986
|
this._element.appendChild(wrapper);
|
|
7937
7987
|
this._active = wrapper;
|
|
7938
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7988
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7939
7989
|
var _a;
|
|
7940
7990
|
const target = event.target;
|
|
7941
7991
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8114,6 +8164,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8114
8164
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8115
8165
|
this._onDidAddPanel = new Emitter();
|
|
8116
8166
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8167
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8168
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8169
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8170
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8117
8171
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8118
8172
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8119
8173
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8143,7 +8197,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8143
8197
|
if (options.debug) {
|
|
8144
8198
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8145
8199
|
}
|
|
8146
|
-
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(() => {
|
|
8200
|
+
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(() => {
|
|
8147
8201
|
this.updateWatermark();
|
|
8148
8202
|
}), this.onDidAdd((event) => {
|
|
8149
8203
|
if (!this._moving) {
|
|
@@ -8164,7 +8218,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8164
8218
|
});
|
|
8165
8219
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8166
8220
|
this.updateWatermark();
|
|
8167
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8221
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8168
8222
|
this._bufferOnDidLayoutChange.fire();
|
|
8169
8223
|
}), exports.DockviewDisposable.from(() => {
|
|
8170
8224
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8425,13 +8479,26 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8425
8479
|
},
|
|
8426
8480
|
},
|
|
8427
8481
|
};
|
|
8428
|
-
|
|
8482
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8483
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8484
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8485
|
+
width: _window.window.innerWidth,
|
|
8486
|
+
height: _window.window.innerHeight,
|
|
8487
|
+
group,
|
|
8488
|
+
});
|
|
8489
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8490
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8491
|
+
screenX: _window.window.screenX,
|
|
8492
|
+
screenY: _window.window.screenX,
|
|
8493
|
+
group,
|
|
8494
|
+
});
|
|
8495
|
+
}),
|
|
8429
8496
|
/**
|
|
8430
8497
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8431
8498
|
* since we can reply on the window resize event as we will occupy the full
|
|
8432
8499
|
* window dimensions
|
|
8433
8500
|
*/
|
|
8434
|
-
|
|
8501
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8435
8502
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8436
8503
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8437
8504
|
if (this.isDisposed) {
|
|
@@ -8645,7 +8712,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8645
8712
|
}
|
|
8646
8713
|
this.updateWatermark();
|
|
8647
8714
|
}
|
|
8648
|
-
orthogonalize(position) {
|
|
8715
|
+
orthogonalize(position, options) {
|
|
8649
8716
|
switch (position) {
|
|
8650
8717
|
case 'top':
|
|
8651
8718
|
case 'bottom':
|
|
@@ -8668,10 +8735,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8668
8735
|
case 'top':
|
|
8669
8736
|
case 'left':
|
|
8670
8737
|
case 'center':
|
|
8671
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8738
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8672
8739
|
case 'bottom':
|
|
8673
8740
|
case 'right':
|
|
8674
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8741
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8675
8742
|
default:
|
|
8676
8743
|
throw new Error(`unsupported position ${position}`);
|
|
8677
8744
|
}
|
|
@@ -9167,7 +9234,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9167
9234
|
}
|
|
9168
9235
|
}
|
|
9169
9236
|
else {
|
|
9170
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9237
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9171
9238
|
if (!options.skipSetActive) {
|
|
9172
9239
|
this.doSetGroupAndPanelActive(group);
|
|
9173
9240
|
}
|
|
@@ -9609,8 +9676,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9609
9676
|
});
|
|
9610
9677
|
return panel;
|
|
9611
9678
|
}
|
|
9612
|
-
createGroupAtLocation(location, size) {
|
|
9613
|
-
const group = this.createGroup();
|
|
9679
|
+
createGroupAtLocation(location, size, options) {
|
|
9680
|
+
const group = this.createGroup(options);
|
|
9614
9681
|
this.doAddGroup(group, location, size);
|
|
9615
9682
|
return group;
|
|
9616
9683
|
}
|
|
@@ -9944,6 +10011,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9944
10011
|
return this._splitview;
|
|
9945
10012
|
}
|
|
9946
10013
|
set splitview(value) {
|
|
10014
|
+
if (this._splitview) {
|
|
10015
|
+
this._splitview.dispose();
|
|
10016
|
+
}
|
|
9947
10017
|
this._splitview = value;
|
|
9948
10018
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9949
10019
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10247,9 +10317,23 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10247
10317
|
}
|
|
10248
10318
|
|
|
10249
10319
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10320
|
+
const HEADER_SIZE = 22;
|
|
10321
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10322
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10250
10323
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10251
10324
|
constructor(options) {
|
|
10252
|
-
super(
|
|
10325
|
+
super({
|
|
10326
|
+
accessor: options.accessor,
|
|
10327
|
+
id: options.id,
|
|
10328
|
+
component: options.component,
|
|
10329
|
+
headerComponent: options.headerComponent,
|
|
10330
|
+
orientation: options.orientation,
|
|
10331
|
+
isExpanded: options.isExpanded,
|
|
10332
|
+
disableDnd: options.disableDnd,
|
|
10333
|
+
headerSize: options.headerSize,
|
|
10334
|
+
minimumBodySize: options.minimumBodySize,
|
|
10335
|
+
maximumBodySize: options.maximumBodySize,
|
|
10336
|
+
});
|
|
10253
10337
|
this.options = options;
|
|
10254
10338
|
}
|
|
10255
10339
|
getBodyComponent() {
|
|
@@ -10344,7 +10428,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10344
10428
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10345
10429
|
}
|
|
10346
10430
|
addPanel(options) {
|
|
10347
|
-
var _a;
|
|
10431
|
+
var _a, _b;
|
|
10348
10432
|
const body = this.options.createComponent({
|
|
10349
10433
|
id: options.id,
|
|
10350
10434
|
name: options.component,
|
|
@@ -10369,12 +10453,15 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10369
10453
|
isExpanded: !!options.isExpanded,
|
|
10370
10454
|
disableDnd: !!this.options.disableDnd,
|
|
10371
10455
|
accessor: this,
|
|
10456
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10457
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10458
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10372
10459
|
});
|
|
10373
10460
|
this.doAddPanel(view);
|
|
10374
10461
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10375
10462
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10376
10463
|
view.init({
|
|
10377
|
-
params: (
|
|
10464
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10378
10465
|
minimumBodySize: options.minimumBodySize,
|
|
10379
10466
|
maximumBodySize: options.maximumBodySize,
|
|
10380
10467
|
isExpanded: options.isExpanded,
|
|
@@ -10419,6 +10506,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10419
10506
|
data: view.toJSON(),
|
|
10420
10507
|
minimumSize: minimum(view.minimumBodySize),
|
|
10421
10508
|
maximumSize: maximum(view.maximumBodySize),
|
|
10509
|
+
headerSize: view.headerSize,
|
|
10422
10510
|
expanded: view.isExpanded(),
|
|
10423
10511
|
};
|
|
10424
10512
|
});
|
|
@@ -10439,6 +10527,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10439
10527
|
descriptor: {
|
|
10440
10528
|
size,
|
|
10441
10529
|
views: views.map((view) => {
|
|
10530
|
+
var _a, _b, _c;
|
|
10442
10531
|
const data = view.data;
|
|
10443
10532
|
const body = this.options.createComponent({
|
|
10444
10533
|
id: data.id,
|
|
@@ -10465,6 +10554,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
10465
10554
|
isExpanded: !!view.expanded,
|
|
10466
10555
|
disableDnd: !!this.options.disableDnd,
|
|
10467
10556
|
accessor: this,
|
|
10557
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10558
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10559
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10468
10560
|
});
|
|
10469
10561
|
this.doAddPanel(panel);
|
|
10470
10562
|
queue.push(() => {
|