dockview-react 4.0.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dockview-react.amd.js +165 -66
- package/dist/dockview-react.amd.js.map +1 -1
- package/dist/dockview-react.amd.min.js +2 -2
- package/dist/dockview-react.amd.min.js.map +1 -1
- package/dist/dockview-react.amd.min.noStyle.js +2 -2
- package/dist/dockview-react.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-react.amd.noStyle.js +164 -65
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +165 -66
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +165 -66
- package/dist/dockview-react.esm.js.map +1 -1
- package/dist/dockview-react.esm.min.js +2 -2
- package/dist/dockview-react.esm.min.js.map +1 -1
- package/dist/dockview-react.js +165 -66
- package/dist/dockview-react.js.map +1 -1
- package/dist/dockview-react.min.js +2 -2
- package/dist/dockview-react.min.js.map +1 -1
- package/dist/dockview-react.min.noStyle.js +2 -2
- package/dist/dockview-react.min.noStyle.js.map +1 -1
- package/dist/dockview-react.noStyle.js +164 -65
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/dist/styles/dockview.css +8 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version 4.0
|
|
3
|
+
* @version 4.2.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -215,14 +215,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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
|
}
|
|
@@ -5170,9 +5220,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5170
5220
|
this._tabsList = document.createElement('div');
|
|
5171
5221
|
this._tabsList.className = 'dv-tabs-container dv-horizontal';
|
|
5172
5222
|
this.showTabsOverflowControl = options.showTabsOverflowControl;
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5223
|
+
if (accessor.options.scrollbars === 'native') {
|
|
5224
|
+
this._element = this._tabsList;
|
|
5225
|
+
}
|
|
5226
|
+
else {
|
|
5227
|
+
const scrollbar = new Scrollbar(this._tabsList);
|
|
5228
|
+
this._element = scrollbar.element;
|
|
5229
|
+
this.addDisposables(scrollbar);
|
|
5230
|
+
}
|
|
5231
|
+
this.addDisposables(this._onOverflowTabsChange, this._observerDisposable, this._onWillShowOverlay, this._onDrop, this._onTabDragStart, addDisposableListener(this.element, 'pointerdown', (event) => {
|
|
5176
5232
|
if (event.defaultPrevented) {
|
|
5177
5233
|
return;
|
|
5178
5234
|
}
|
|
@@ -5597,6 +5653,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5597
5653
|
dndEdges: undefined,
|
|
5598
5654
|
theme: undefined,
|
|
5599
5655
|
disableTabsOverflowList: undefined,
|
|
5656
|
+
scrollbars: undefined,
|
|
5600
5657
|
};
|
|
5601
5658
|
return Object.keys(properties);
|
|
5602
5659
|
})();
|
|
@@ -7291,7 +7348,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7291
7348
|
dispose: () => {
|
|
7292
7349
|
iframes.release();
|
|
7293
7350
|
},
|
|
7294
|
-
},
|
|
7351
|
+
}, addDisposableListener(window, 'pointermove', (e) => {
|
|
7295
7352
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7296
7353
|
const x = e.clientX - containerRect.left;
|
|
7297
7354
|
const y = e.clientY - containerRect.top;
|
|
@@ -7328,7 +7385,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7328
7385
|
bounds.right = right;
|
|
7329
7386
|
}
|
|
7330
7387
|
this.setBounds(bounds);
|
|
7331
|
-
}),
|
|
7388
|
+
}), addDisposableListener(window, 'pointerup', () => {
|
|
7332
7389
|
toggleClass(this._element, 'dv-resize-container-dragging', false);
|
|
7333
7390
|
move.dispose();
|
|
7334
7391
|
this._onDidChangeEnd.fire();
|
|
@@ -7373,7 +7430,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7373
7430
|
e.preventDefault();
|
|
7374
7431
|
let startPosition = null;
|
|
7375
7432
|
const iframes = disableIframePointEvents();
|
|
7376
|
-
move.value = new CompositeDisposable(
|
|
7433
|
+
move.value = new CompositeDisposable(addDisposableListener(window, 'pointermove', (e) => {
|
|
7377
7434
|
const containerRect = this.options.container.getBoundingClientRect();
|
|
7378
7435
|
const overlayRect = this._element.getBoundingClientRect();
|
|
7379
7436
|
const y = e.clientY - containerRect.top;
|
|
@@ -7497,7 +7554,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7497
7554
|
dispose: () => {
|
|
7498
7555
|
iframes.release();
|
|
7499
7556
|
},
|
|
7500
|
-
},
|
|
7557
|
+
}, addDisposableListener(window, 'pointerup', () => {
|
|
7501
7558
|
move.dispose();
|
|
7502
7559
|
this._onDidChangeEnd.fire();
|
|
7503
7560
|
}));
|
|
@@ -7780,7 +7837,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7780
7837
|
this._window = { value: externalWindow, disposable };
|
|
7781
7838
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7782
7839
|
externalWindow.close();
|
|
7783
|
-
}),
|
|
7840
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7784
7841
|
/**
|
|
7785
7842
|
* before the main window closes we should close this popup too
|
|
7786
7843
|
* to be good citizens
|
|
@@ -7815,7 +7872,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7815
7872
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7816
7873
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7817
7874
|
*/
|
|
7818
|
-
|
|
7875
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7819
7876
|
/**
|
|
7820
7877
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7821
7878
|
*/
|
|
@@ -7912,7 +7969,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7912
7969
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7913
7970
|
this._element.appendChild(wrapper);
|
|
7914
7971
|
this._active = wrapper;
|
|
7915
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7972
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7916
7973
|
var _a;
|
|
7917
7974
|
const target = event.target;
|
|
7918
7975
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8091,6 +8148,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8091
8148
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8092
8149
|
this._onDidAddPanel = new Emitter();
|
|
8093
8150
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8151
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8152
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8153
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8154
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8094
8155
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8095
8156
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8096
8157
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8120,7 +8181,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8120
8181
|
if (options.debug) {
|
|
8121
8182
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8122
8183
|
}
|
|
8123
|
-
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(() => {
|
|
8184
|
+
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(() => {
|
|
8124
8185
|
this.updateWatermark();
|
|
8125
8186
|
}), this.onDidAdd((event) => {
|
|
8126
8187
|
if (!this._moving) {
|
|
@@ -8141,7 +8202,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8141
8202
|
});
|
|
8142
8203
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8143
8204
|
this.updateWatermark();
|
|
8144
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8205
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8145
8206
|
this._bufferOnDidLayoutChange.fire();
|
|
8146
8207
|
}), exports.DockviewDisposable.from(() => {
|
|
8147
8208
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8402,13 +8463,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8402
8463
|
},
|
|
8403
8464
|
},
|
|
8404
8465
|
};
|
|
8405
|
-
|
|
8466
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8467
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8468
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8469
|
+
width: _window.window.innerWidth,
|
|
8470
|
+
height: _window.window.innerHeight,
|
|
8471
|
+
group,
|
|
8472
|
+
});
|
|
8473
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8474
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8475
|
+
screenX: _window.window.screenX,
|
|
8476
|
+
screenY: _window.window.screenX,
|
|
8477
|
+
group,
|
|
8478
|
+
});
|
|
8479
|
+
}),
|
|
8406
8480
|
/**
|
|
8407
8481
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8408
8482
|
* since we can reply on the window resize event as we will occupy the full
|
|
8409
8483
|
* window dimensions
|
|
8410
8484
|
*/
|
|
8411
|
-
|
|
8485
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8412
8486
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8413
8487
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8414
8488
|
if (this.isDisposed) {
|
|
@@ -8622,7 +8696,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8622
8696
|
}
|
|
8623
8697
|
this.updateWatermark();
|
|
8624
8698
|
}
|
|
8625
|
-
orthogonalize(position) {
|
|
8699
|
+
orthogonalize(position, options) {
|
|
8626
8700
|
switch (position) {
|
|
8627
8701
|
case 'top':
|
|
8628
8702
|
case 'bottom':
|
|
@@ -8645,10 +8719,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8645
8719
|
case 'top':
|
|
8646
8720
|
case 'left':
|
|
8647
8721
|
case 'center':
|
|
8648
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8722
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8649
8723
|
case 'bottom':
|
|
8650
8724
|
case 'right':
|
|
8651
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8725
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8652
8726
|
default:
|
|
8653
8727
|
throw new Error(`unsupported position ${position}`);
|
|
8654
8728
|
}
|
|
@@ -9144,7 +9218,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9144
9218
|
}
|
|
9145
9219
|
}
|
|
9146
9220
|
else {
|
|
9147
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9221
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9148
9222
|
if (!options.skipSetActive) {
|
|
9149
9223
|
this.doSetGroupAndPanelActive(group);
|
|
9150
9224
|
}
|
|
@@ -9586,8 +9660,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9586
9660
|
});
|
|
9587
9661
|
return panel;
|
|
9588
9662
|
}
|
|
9589
|
-
createGroupAtLocation(location, size) {
|
|
9590
|
-
const group = this.createGroup();
|
|
9663
|
+
createGroupAtLocation(location, size, options) {
|
|
9664
|
+
const group = this.createGroup(options);
|
|
9591
9665
|
this.doAddGroup(group, location, size);
|
|
9592
9666
|
return group;
|
|
9593
9667
|
}
|
|
@@ -9921,6 +9995,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9921
9995
|
return this._splitview;
|
|
9922
9996
|
}
|
|
9923
9997
|
set splitview(value) {
|
|
9998
|
+
if (this._splitview) {
|
|
9999
|
+
this._splitview.dispose();
|
|
10000
|
+
}
|
|
9924
10001
|
this._splitview = value;
|
|
9925
10002
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9926
10003
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10224,9 +10301,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10224
10301
|
}
|
|
10225
10302
|
|
|
10226
10303
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10304
|
+
const HEADER_SIZE = 22;
|
|
10305
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10306
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10227
10307
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10228
10308
|
constructor(options) {
|
|
10229
|
-
super(
|
|
10309
|
+
super({
|
|
10310
|
+
accessor: options.accessor,
|
|
10311
|
+
id: options.id,
|
|
10312
|
+
component: options.component,
|
|
10313
|
+
headerComponent: options.headerComponent,
|
|
10314
|
+
orientation: options.orientation,
|
|
10315
|
+
isExpanded: options.isExpanded,
|
|
10316
|
+
disableDnd: options.disableDnd,
|
|
10317
|
+
headerSize: options.headerSize,
|
|
10318
|
+
minimumBodySize: options.minimumBodySize,
|
|
10319
|
+
maximumBodySize: options.maximumBodySize,
|
|
10320
|
+
});
|
|
10230
10321
|
this.options = options;
|
|
10231
10322
|
}
|
|
10232
10323
|
getBodyComponent() {
|
|
@@ -10321,7 +10412,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10321
10412
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10322
10413
|
}
|
|
10323
10414
|
addPanel(options) {
|
|
10324
|
-
var _a;
|
|
10415
|
+
var _a, _b;
|
|
10325
10416
|
const body = this.options.createComponent({
|
|
10326
10417
|
id: options.id,
|
|
10327
10418
|
name: options.component,
|
|
@@ -10346,12 +10437,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10346
10437
|
isExpanded: !!options.isExpanded,
|
|
10347
10438
|
disableDnd: !!this.options.disableDnd,
|
|
10348
10439
|
accessor: this,
|
|
10440
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10441
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10442
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10349
10443
|
});
|
|
10350
10444
|
this.doAddPanel(view);
|
|
10351
10445
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10352
10446
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10353
10447
|
view.init({
|
|
10354
|
-
params: (
|
|
10448
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10355
10449
|
minimumBodySize: options.minimumBodySize,
|
|
10356
10450
|
maximumBodySize: options.maximumBodySize,
|
|
10357
10451
|
isExpanded: options.isExpanded,
|
|
@@ -10396,6 +10490,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10396
10490
|
data: view.toJSON(),
|
|
10397
10491
|
minimumSize: minimum(view.minimumBodySize),
|
|
10398
10492
|
maximumSize: maximum(view.maximumBodySize),
|
|
10493
|
+
headerSize: view.headerSize,
|
|
10399
10494
|
expanded: view.isExpanded(),
|
|
10400
10495
|
};
|
|
10401
10496
|
});
|
|
@@ -10416,6 +10511,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10416
10511
|
descriptor: {
|
|
10417
10512
|
size,
|
|
10418
10513
|
views: views.map((view) => {
|
|
10514
|
+
var _a, _b, _c;
|
|
10419
10515
|
const data = view.data;
|
|
10420
10516
|
const body = this.options.createComponent({
|
|
10421
10517
|
id: data.id,
|
|
@@ -10442,6 +10538,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10442
10538
|
isExpanded: !!view.expanded,
|
|
10443
10539
|
disableDnd: !!this.options.disableDnd,
|
|
10444
10540
|
accessor: this,
|
|
10541
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10542
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10543
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10445
10544
|
});
|
|
10446
10545
|
this.doAddPanel(panel);
|
|
10447
10546
|
queue.push(() => {
|