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
|
*/
|
|
@@ -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
|
}
|
|
@@ -7291,7 +7341,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
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
|
}));
|
|
@@ -7780,7 +7830,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7780
7830
|
this._window = { value: externalWindow, disposable };
|
|
7781
7831
|
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7782
7832
|
externalWindow.close();
|
|
7783
|
-
}),
|
|
7833
|
+
}), addDisposableListener(window, 'beforeunload', () => {
|
|
7784
7834
|
/**
|
|
7785
7835
|
* before the main window closes we should close this popup too
|
|
7786
7836
|
* to be good citizens
|
|
@@ -7815,7 +7865,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7815
7865
|
* beforeunload must be registered after load for reasons I could not determine
|
|
7816
7866
|
* otherwise the beforeunload event will not fire when the window is closed
|
|
7817
7867
|
*/
|
|
7818
|
-
|
|
7868
|
+
addDisposableListener(externalWindow, 'beforeunload', () => {
|
|
7819
7869
|
/**
|
|
7820
7870
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7821
7871
|
*/
|
|
@@ -7912,7 +7962,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7912
7962
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
7913
7963
|
this._element.appendChild(wrapper);
|
|
7914
7964
|
this._active = wrapper;
|
|
7915
|
-
this._activeDisposable.value = new CompositeDisposable(
|
|
7965
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(window, 'pointerdown', (event) => {
|
|
7916
7966
|
var _a;
|
|
7917
7967
|
const target = event.target;
|
|
7918
7968
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -8091,6 +8141,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8091
8141
|
this.onDidRemovePanel = this._onDidRemovePanel.event;
|
|
8092
8142
|
this._onDidAddPanel = new Emitter();
|
|
8093
8143
|
this.onDidAddPanel = this._onDidAddPanel.event;
|
|
8144
|
+
this._onDidPopoutGroupSizeChange = new Emitter();
|
|
8145
|
+
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8146
|
+
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8147
|
+
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8094
8148
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8095
8149
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8096
8150
|
this._onDidActivePanelChange = new Emitter();
|
|
@@ -8120,7 +8174,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8120
8174
|
if (options.debug) {
|
|
8121
8175
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8122
8176
|
}
|
|
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(() => {
|
|
8177
|
+
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
8178
|
this.updateWatermark();
|
|
8125
8179
|
}), this.onDidAdd((event) => {
|
|
8126
8180
|
if (!this._moving) {
|
|
@@ -8141,7 +8195,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8141
8195
|
});
|
|
8142
8196
|
}), exports.DockviewEvent.any(this.onDidAdd, this.onDidRemove)(() => {
|
|
8143
8197
|
this.updateWatermark();
|
|
8144
|
-
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange)(() => {
|
|
8198
|
+
}), exports.DockviewEvent.any(this.onDidAddPanel, this.onDidRemovePanel, this.onDidAddGroup, this.onDidRemove, this.onDidMovePanel, this.onDidActivePanelChange, this.onDidPopoutGroupPositionChange, this.onDidPopoutGroupSizeChange)(() => {
|
|
8145
8199
|
this._bufferOnDidLayoutChange.fire();
|
|
8146
8200
|
}), exports.DockviewDisposable.from(() => {
|
|
8147
8201
|
// iterate over a copy of the array since .dispose() mutates the original array
|
|
@@ -8402,13 +8456,26 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8402
8456
|
},
|
|
8403
8457
|
},
|
|
8404
8458
|
};
|
|
8405
|
-
|
|
8459
|
+
const _onDidWindowPositionChange = onDidWindowMoveEnd(_window.window);
|
|
8460
|
+
popoutWindowDisposable.addDisposables(_onDidWindowPositionChange, onDidWindowResizeEnd(_window.window, () => {
|
|
8461
|
+
this._onDidPopoutGroupSizeChange.fire({
|
|
8462
|
+
width: _window.window.innerWidth,
|
|
8463
|
+
height: _window.window.innerHeight,
|
|
8464
|
+
group,
|
|
8465
|
+
});
|
|
8466
|
+
}), _onDidWindowPositionChange.event(() => {
|
|
8467
|
+
this._onDidPopoutGroupPositionChange.fire({
|
|
8468
|
+
screenX: _window.window.screenX,
|
|
8469
|
+
screenY: _window.window.screenX,
|
|
8470
|
+
group,
|
|
8471
|
+
});
|
|
8472
|
+
}),
|
|
8406
8473
|
/**
|
|
8407
8474
|
* ResizeObserver seems slow here, I do not know why but we don't need it
|
|
8408
8475
|
* since we can reply on the window resize event as we will occupy the full
|
|
8409
8476
|
* window dimensions
|
|
8410
8477
|
*/
|
|
8411
|
-
|
|
8478
|
+
addDisposableListener(_window.window, 'resize', () => {
|
|
8412
8479
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8413
8480
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
8414
8481
|
if (this.isDisposed) {
|
|
@@ -8622,7 +8689,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8622
8689
|
}
|
|
8623
8690
|
this.updateWatermark();
|
|
8624
8691
|
}
|
|
8625
|
-
orthogonalize(position) {
|
|
8692
|
+
orthogonalize(position, options) {
|
|
8626
8693
|
switch (position) {
|
|
8627
8694
|
case 'top':
|
|
8628
8695
|
case 'bottom':
|
|
@@ -8645,10 +8712,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8645
8712
|
case 'top':
|
|
8646
8713
|
case 'left':
|
|
8647
8714
|
case 'center':
|
|
8648
|
-
return this.createGroupAtLocation([0]); // insert into first position
|
|
8715
|
+
return this.createGroupAtLocation([0], undefined, options); // insert into first position
|
|
8649
8716
|
case 'bottom':
|
|
8650
8717
|
case 'right':
|
|
8651
|
-
return this.createGroupAtLocation([this.gridview.length]); // insert into last position
|
|
8718
|
+
return this.createGroupAtLocation([this.gridview.length], undefined, options); // insert into last position
|
|
8652
8719
|
default:
|
|
8653
8720
|
throw new Error(`unsupported position ${position}`);
|
|
8654
8721
|
}
|
|
@@ -9144,7 +9211,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9144
9211
|
}
|
|
9145
9212
|
}
|
|
9146
9213
|
else {
|
|
9147
|
-
const group = this.orthogonalize(directionToPosition(options.direction));
|
|
9214
|
+
const group = this.orthogonalize(directionToPosition(options.direction), options);
|
|
9148
9215
|
if (!options.skipSetActive) {
|
|
9149
9216
|
this.doSetGroupAndPanelActive(group);
|
|
9150
9217
|
}
|
|
@@ -9586,8 +9653,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9586
9653
|
});
|
|
9587
9654
|
return panel;
|
|
9588
9655
|
}
|
|
9589
|
-
createGroupAtLocation(location, size) {
|
|
9590
|
-
const group = this.createGroup();
|
|
9656
|
+
createGroupAtLocation(location, size, options) {
|
|
9657
|
+
const group = this.createGroup(options);
|
|
9591
9658
|
this.doAddGroup(group, location, size);
|
|
9592
9659
|
return group;
|
|
9593
9660
|
}
|
|
@@ -9921,6 +9988,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9921
9988
|
return this._splitview;
|
|
9922
9989
|
}
|
|
9923
9990
|
set splitview(value) {
|
|
9991
|
+
if (this._splitview) {
|
|
9992
|
+
this._splitview.dispose();
|
|
9993
|
+
}
|
|
9924
9994
|
this._splitview = value;
|
|
9925
9995
|
this._splitviewChangeDisposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
9926
9996
|
this._onDidLayoutChange.fire(undefined);
|
|
@@ -10224,9 +10294,23 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10224
10294
|
}
|
|
10225
10295
|
|
|
10226
10296
|
const nextLayoutId = sequentialNumberGenerator();
|
|
10297
|
+
const HEADER_SIZE = 22;
|
|
10298
|
+
const MINIMUM_BODY_SIZE = 0;
|
|
10299
|
+
const MAXIMUM_BODY_SIZE = Number.MAX_SAFE_INTEGER;
|
|
10227
10300
|
class PaneFramework extends DraggablePaneviewPanel {
|
|
10228
10301
|
constructor(options) {
|
|
10229
|
-
super(
|
|
10302
|
+
super({
|
|
10303
|
+
accessor: options.accessor,
|
|
10304
|
+
id: options.id,
|
|
10305
|
+
component: options.component,
|
|
10306
|
+
headerComponent: options.headerComponent,
|
|
10307
|
+
orientation: options.orientation,
|
|
10308
|
+
isExpanded: options.isExpanded,
|
|
10309
|
+
disableDnd: options.disableDnd,
|
|
10310
|
+
headerSize: options.headerSize,
|
|
10311
|
+
minimumBodySize: options.minimumBodySize,
|
|
10312
|
+
maximumBodySize: options.maximumBodySize,
|
|
10313
|
+
});
|
|
10230
10314
|
this.options = options;
|
|
10231
10315
|
}
|
|
10232
10316
|
getBodyComponent() {
|
|
@@ -10321,7 +10405,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10321
10405
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
10322
10406
|
}
|
|
10323
10407
|
addPanel(options) {
|
|
10324
|
-
var _a;
|
|
10408
|
+
var _a, _b;
|
|
10325
10409
|
const body = this.options.createComponent({
|
|
10326
10410
|
id: options.id,
|
|
10327
10411
|
name: options.component,
|
|
@@ -10346,12 +10430,15 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10346
10430
|
isExpanded: !!options.isExpanded,
|
|
10347
10431
|
disableDnd: !!this.options.disableDnd,
|
|
10348
10432
|
accessor: this,
|
|
10433
|
+
headerSize: (_a = options.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10434
|
+
minimumBodySize: MINIMUM_BODY_SIZE,
|
|
10435
|
+
maximumBodySize: MAXIMUM_BODY_SIZE,
|
|
10349
10436
|
});
|
|
10350
10437
|
this.doAddPanel(view);
|
|
10351
10438
|
const size = typeof options.size === 'number' ? options.size : exports.Sizing.Distribute;
|
|
10352
10439
|
const index = typeof options.index === 'number' ? options.index : undefined;
|
|
10353
10440
|
view.init({
|
|
10354
|
-
params: (
|
|
10441
|
+
params: (_b = options.params) !== null && _b !== void 0 ? _b : {},
|
|
10355
10442
|
minimumBodySize: options.minimumBodySize,
|
|
10356
10443
|
maximumBodySize: options.maximumBodySize,
|
|
10357
10444
|
isExpanded: options.isExpanded,
|
|
@@ -10396,6 +10483,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10396
10483
|
data: view.toJSON(),
|
|
10397
10484
|
minimumSize: minimum(view.minimumBodySize),
|
|
10398
10485
|
maximumSize: maximum(view.maximumBodySize),
|
|
10486
|
+
headerSize: view.headerSize,
|
|
10399
10487
|
expanded: view.isExpanded(),
|
|
10400
10488
|
};
|
|
10401
10489
|
});
|
|
@@ -10416,6 +10504,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10416
10504
|
descriptor: {
|
|
10417
10505
|
size,
|
|
10418
10506
|
views: views.map((view) => {
|
|
10507
|
+
var _a, _b, _c;
|
|
10419
10508
|
const data = view.data;
|
|
10420
10509
|
const body = this.options.createComponent({
|
|
10421
10510
|
id: data.id,
|
|
@@ -10442,6 +10531,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10442
10531
|
isExpanded: !!view.expanded,
|
|
10443
10532
|
disableDnd: !!this.options.disableDnd,
|
|
10444
10533
|
accessor: this,
|
|
10534
|
+
headerSize: (_a = view.headerSize) !== null && _a !== void 0 ? _a : HEADER_SIZE,
|
|
10535
|
+
minimumBodySize: (_b = view.minimumSize) !== null && _b !== void 0 ? _b : MINIMUM_BODY_SIZE,
|
|
10536
|
+
maximumBodySize: (_c = view.maximumSize) !== null && _c !== void 0 ? _c : MAXIMUM_BODY_SIZE,
|
|
10445
10537
|
});
|
|
10446
10538
|
this.doAddPanel(panel);
|
|
10447
10539
|
queue.push(() => {
|