dockview-react 1.17.1 → 2.0.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 +243 -188
- 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 +242 -187
- package/dist/dockview-react.amd.noStyle.js.map +1 -1
- package/dist/dockview-react.cjs.js +243 -188
- package/dist/dockview-react.cjs.js.map +1 -1
- package/dist/dockview-react.esm.js +244 -187
- 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 +243 -188
- 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 +242 -187
- package/dist/dockview-react.noStyle.js.map +1 -1
- package/dist/styles/dockview.css +133 -135
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-react
|
|
3
|
-
* @version
|
|
3
|
+
* @version 2.0.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -328,31 +328,6 @@
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
332
|
-
const Component = typeof componentName === 'string'
|
|
333
|
-
? components[componentName]
|
|
334
|
-
: undefined;
|
|
335
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
336
|
-
? frameworkComponents[componentName]
|
|
337
|
-
: undefined;
|
|
338
|
-
if (Component && FrameworkComponent) {
|
|
339
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
340
|
-
}
|
|
341
|
-
if (FrameworkComponent) {
|
|
342
|
-
if (!createFrameworkComponent) {
|
|
343
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
344
|
-
}
|
|
345
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
346
|
-
}
|
|
347
|
-
if (!Component) {
|
|
348
|
-
if (fallback) {
|
|
349
|
-
return fallback();
|
|
350
|
-
}
|
|
351
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
352
|
-
}
|
|
353
|
-
return new Component(id, componentName);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
331
|
function watchElementResize(element, cb) {
|
|
357
332
|
const observer = new ResizeObserver((entires) => {
|
|
358
333
|
/**
|
|
@@ -821,10 +796,10 @@
|
|
|
821
796
|
const tmp = this.size;
|
|
822
797
|
this.size = this.orthogonalSize;
|
|
823
798
|
this.orthogonalSize = tmp;
|
|
824
|
-
removeClasses(this.element, 'horizontal', 'vertical');
|
|
799
|
+
removeClasses(this.element, 'dv-horizontal', 'dv-vertical');
|
|
825
800
|
this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
|
|
826
|
-
? 'horizontal'
|
|
827
|
-
: 'vertical');
|
|
801
|
+
? 'dv-horizontal'
|
|
802
|
+
: 'dv-vertical');
|
|
828
803
|
}
|
|
829
804
|
get minimumSize() {
|
|
830
805
|
return this.viewItems.reduce((r, item) => r + item.minimumSize, 0);
|
|
@@ -1002,11 +977,11 @@
|
|
|
1002
977
|
}
|
|
1003
978
|
style(styles) {
|
|
1004
979
|
if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
|
|
1005
|
-
removeClasses(this.element, 'separator-border');
|
|
980
|
+
removeClasses(this.element, 'dv-separator-border');
|
|
1006
981
|
this.element.style.removeProperty('--dv-separator-border');
|
|
1007
982
|
}
|
|
1008
983
|
else {
|
|
1009
|
-
addClasses(this.element, 'separator-border');
|
|
984
|
+
addClasses(this.element, 'dv-separator-border');
|
|
1010
985
|
if (styles === null || styles === void 0 ? void 0 : styles.separatorBorder) {
|
|
1011
986
|
this.element.style.setProperty('--dv-separator-border', styles.separatorBorder);
|
|
1012
987
|
}
|
|
@@ -1076,7 +1051,7 @@
|
|
|
1076
1051
|
}
|
|
1077
1052
|
addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
|
|
1078
1053
|
const container = document.createElement('div');
|
|
1079
|
-
container.className = 'view';
|
|
1054
|
+
container.className = 'dv-view';
|
|
1080
1055
|
container.appendChild(view.element);
|
|
1081
1056
|
let viewSize;
|
|
1082
1057
|
if (typeof size === 'number') {
|
|
@@ -1108,7 +1083,7 @@
|
|
|
1108
1083
|
if (this.viewItems.length > 1) {
|
|
1109
1084
|
//add sash
|
|
1110
1085
|
const sash = document.createElement('div');
|
|
1111
|
-
sash.className = 'sash';
|
|
1086
|
+
sash.className = 'dv-sash';
|
|
1112
1087
|
const onPointerStart = (event) => {
|
|
1113
1088
|
for (const item of this.viewItems) {
|
|
1114
1089
|
item.enabled = false;
|
|
@@ -1367,7 +1342,8 @@
|
|
|
1367
1342
|
const offset = i === 0 || visiblePanelsBeforeThisView === 0
|
|
1368
1343
|
? 0
|
|
1369
1344
|
: viewLeftOffsets[i - 1] +
|
|
1370
|
-
(visiblePanelsBeforeThisView / sashCount) *
|
|
1345
|
+
(visiblePanelsBeforeThisView / sashCount) *
|
|
1346
|
+
marginReducedSize;
|
|
1371
1347
|
if (i < this.viewItems.length - 1) {
|
|
1372
1348
|
// calculate sash position
|
|
1373
1349
|
const newSize = view.visible
|
|
@@ -1478,27 +1454,27 @@
|
|
|
1478
1454
|
}
|
|
1479
1455
|
}
|
|
1480
1456
|
updateSash(sash, state) {
|
|
1481
|
-
toggleClass(sash.container, 'disabled', state === exports.SashState.DISABLED);
|
|
1482
|
-
toggleClass(sash.container, 'enabled', state === exports.SashState.ENABLED);
|
|
1483
|
-
toggleClass(sash.container, 'maximum', state === exports.SashState.MAXIMUM);
|
|
1484
|
-
toggleClass(sash.container, 'minimum', state === exports.SashState.MINIMUM);
|
|
1457
|
+
toggleClass(sash.container, 'dv-disabled', state === exports.SashState.DISABLED);
|
|
1458
|
+
toggleClass(sash.container, 'dv-enabled', state === exports.SashState.ENABLED);
|
|
1459
|
+
toggleClass(sash.container, 'dv-maximum', state === exports.SashState.MAXIMUM);
|
|
1460
|
+
toggleClass(sash.container, 'dv-minimum', state === exports.SashState.MINIMUM);
|
|
1485
1461
|
}
|
|
1486
1462
|
createViewContainer() {
|
|
1487
1463
|
const element = document.createElement('div');
|
|
1488
|
-
element.className = 'view-container';
|
|
1464
|
+
element.className = 'dv-view-container';
|
|
1489
1465
|
return element;
|
|
1490
1466
|
}
|
|
1491
1467
|
createSashContainer() {
|
|
1492
1468
|
const element = document.createElement('div');
|
|
1493
|
-
element.className = 'sash-container';
|
|
1469
|
+
element.className = 'dv-sash-container';
|
|
1494
1470
|
return element;
|
|
1495
1471
|
}
|
|
1496
1472
|
createContainer() {
|
|
1497
1473
|
const element = document.createElement('div');
|
|
1498
1474
|
const orientationClassname = this._orientation === exports.Orientation.HORIZONTAL
|
|
1499
|
-
? 'horizontal'
|
|
1500
|
-
: 'vertical';
|
|
1501
|
-
element.className = `split-view-container ${orientationClassname}`;
|
|
1475
|
+
? 'dv-horizontal'
|
|
1476
|
+
: 'dv-vertical';
|
|
1477
|
+
element.className = `dv-split-view-container ${orientationClassname}`;
|
|
1502
1478
|
return element;
|
|
1503
1479
|
}
|
|
1504
1480
|
dispose() {
|
|
@@ -1549,7 +1525,7 @@
|
|
|
1549
1525
|
this.onDidChange = this._onDidChange.event;
|
|
1550
1526
|
this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
|
|
1551
1527
|
this.element = document.createElement('div');
|
|
1552
|
-
this.element.className = 'pane-container';
|
|
1528
|
+
this.element.className = 'dv-pane-container';
|
|
1553
1529
|
container.appendChild(this.element);
|
|
1554
1530
|
this.splitview = new Splitview(this.element, {
|
|
1555
1531
|
orientation: this._orientation,
|
|
@@ -1641,10 +1617,10 @@
|
|
|
1641
1617
|
clearTimeout(this.animationTimer);
|
|
1642
1618
|
this.animationTimer = undefined;
|
|
1643
1619
|
}
|
|
1644
|
-
addClasses(this.element, 'animated');
|
|
1620
|
+
addClasses(this.element, 'dv-animated');
|
|
1645
1621
|
this.animationTimer = setTimeout(() => {
|
|
1646
1622
|
this.animationTimer = undefined;
|
|
1647
|
-
removeClasses(this.element, 'animated');
|
|
1623
|
+
removeClasses(this.element, 'dv-animated');
|
|
1648
1624
|
}, 200);
|
|
1649
1625
|
}
|
|
1650
1626
|
dispose() {
|
|
@@ -1869,7 +1845,7 @@
|
|
|
1869
1845
|
this._orthogonalSize = orthogonalSize;
|
|
1870
1846
|
this._size = size;
|
|
1871
1847
|
this.element = document.createElement('div');
|
|
1872
|
-
this.element.className = 'branch-node';
|
|
1848
|
+
this.element.className = 'dv-branch-node';
|
|
1873
1849
|
if (!childDescriptors) {
|
|
1874
1850
|
this.splitview = new Splitview(this.element, {
|
|
1875
1851
|
orientation: this.orientation,
|
|
@@ -2080,7 +2056,7 @@
|
|
|
2080
2056
|
if (!parentElement) {
|
|
2081
2057
|
throw new Error('Invalid grid element');
|
|
2082
2058
|
}
|
|
2083
|
-
if (/\
|
|
2059
|
+
if (/\bdv-grid-view\b/.test(parentElement.className)) {
|
|
2084
2060
|
return [];
|
|
2085
2061
|
}
|
|
2086
2062
|
const index = indexInParent(parentElement);
|
|
@@ -2428,7 +2404,7 @@
|
|
|
2428
2404
|
this._onDidMaximizedNodeChange = new Emitter();
|
|
2429
2405
|
this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
|
|
2430
2406
|
this.element = document.createElement('div');
|
|
2431
|
-
this.element.className = 'grid-view';
|
|
2407
|
+
this.element.className = 'dv-grid-view';
|
|
2432
2408
|
this._locked = locked !== null && locked !== void 0 ? locked : false;
|
|
2433
2409
|
this._margin = margin !== null && margin !== void 0 ? margin : 0;
|
|
2434
2410
|
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this.locked, this.margin);
|
|
@@ -3650,7 +3626,7 @@
|
|
|
3650
3626
|
* dnd logic. You can see the code at
|
|
3651
3627
|
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
3652
3628
|
*/
|
|
3653
|
-
event.dataTransfer.setData('text/plain', '
|
|
3629
|
+
event.dataTransfer.setData('text/plain', '');
|
|
3654
3630
|
}
|
|
3655
3631
|
}
|
|
3656
3632
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
@@ -3824,12 +3800,12 @@
|
|
|
3824
3800
|
this.markAsUsed(e);
|
|
3825
3801
|
if (!this.targetElement) {
|
|
3826
3802
|
this.targetElement = document.createElement('div');
|
|
3827
|
-
this.targetElement.className = 'drop-target-dropzone';
|
|
3803
|
+
this.targetElement.className = 'dv-drop-target-dropzone';
|
|
3828
3804
|
this.overlayElement = document.createElement('div');
|
|
3829
|
-
this.overlayElement.className = 'drop-target-selection';
|
|
3805
|
+
this.overlayElement.className = 'dv-drop-target-selection';
|
|
3830
3806
|
this._state = 'center';
|
|
3831
3807
|
this.targetElement.appendChild(this.overlayElement);
|
|
3832
|
-
this.element.classList.add('drop-target');
|
|
3808
|
+
this.element.classList.add('dv-drop-target');
|
|
3833
3809
|
this.element.append(this.targetElement);
|
|
3834
3810
|
}
|
|
3835
3811
|
this.toggleClasses(quadrant, width, height);
|
|
@@ -3967,7 +3943,7 @@
|
|
|
3967
3943
|
this.element.removeChild(this.targetElement);
|
|
3968
3944
|
this.targetElement = undefined;
|
|
3969
3945
|
this.overlayElement = undefined;
|
|
3970
|
-
this.element.classList.remove('drop-target');
|
|
3946
|
+
this.element.classList.remove('dv-drop-target');
|
|
3971
3947
|
}
|
|
3972
3948
|
}
|
|
3973
3949
|
}
|
|
@@ -4304,7 +4280,7 @@
|
|
|
4304
4280
|
this._headerVisible = isHeaderVisible;
|
|
4305
4281
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4306
4282
|
this._orientation = orientation;
|
|
4307
|
-
this.element.classList.add('pane');
|
|
4283
|
+
this.element.classList.add('dv-pane');
|
|
4308
4284
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4309
4285
|
const { isVisible } = event;
|
|
4310
4286
|
const { accessor } = this._params;
|
|
@@ -4401,14 +4377,14 @@
|
|
|
4401
4377
|
renderOnce() {
|
|
4402
4378
|
this.header = document.createElement('div');
|
|
4403
4379
|
this.header.tabIndex = 0;
|
|
4404
|
-
this.header.className = 'pane-header';
|
|
4380
|
+
this.header.className = 'dv-pane-header';
|
|
4405
4381
|
this.header.style.height = `${this.headerSize}px`;
|
|
4406
4382
|
this.header.style.lineHeight = `${this.headerSize}px`;
|
|
4407
4383
|
this.header.style.minHeight = `${this.headerSize}px`;
|
|
4408
4384
|
this.header.style.maxHeight = `${this.headerSize}px`;
|
|
4409
4385
|
this.element.appendChild(this.header);
|
|
4410
4386
|
this.body = document.createElement('div');
|
|
4411
|
-
this.body.className = 'pane-body';
|
|
4387
|
+
this.body.className = 'dv-pane-body';
|
|
4412
4388
|
this.element.appendChild(this.body);
|
|
4413
4389
|
}
|
|
4414
4390
|
// TODO slightly hacky by-pass of the component to create a body and header component
|
|
@@ -4529,7 +4505,7 @@
|
|
|
4529
4505
|
this._onDidBlur = new Emitter();
|
|
4530
4506
|
this.onDidBlur = this._onDidBlur.event;
|
|
4531
4507
|
this._element = document.createElement('div');
|
|
4532
|
-
this._element.className = 'content-container';
|
|
4508
|
+
this._element.className = 'dv-content-container';
|
|
4533
4509
|
this._element.tabIndex = -1;
|
|
4534
4510
|
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
4535
4511
|
this.dropTarget = new Droptarget(this.element, {
|
|
@@ -4602,6 +4578,8 @@
|
|
|
4602
4578
|
referenceContainer: this,
|
|
4603
4579
|
});
|
|
4604
4580
|
break;
|
|
4581
|
+
default:
|
|
4582
|
+
throw new Error(`dockview: invalid renderer type '${panel.api.renderer}'`);
|
|
4605
4583
|
}
|
|
4606
4584
|
if (doRender) {
|
|
4607
4585
|
const focusTracker = trackFocus(container);
|
|
@@ -4668,10 +4646,10 @@
|
|
|
4668
4646
|
this._onDragStart = new Emitter();
|
|
4669
4647
|
this.onDragStart = this._onDragStart.event;
|
|
4670
4648
|
this._element = document.createElement('div');
|
|
4671
|
-
this._element.className = 'tab';
|
|
4649
|
+
this._element.className = 'dv-tab';
|
|
4672
4650
|
this._element.tabIndex = 0;
|
|
4673
4651
|
this._element.draggable = true;
|
|
4674
|
-
toggleClass(this.element, 'inactive-tab', true);
|
|
4652
|
+
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
4675
4653
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
4676
4654
|
this.dropTarget = new Droptarget(this._element, {
|
|
4677
4655
|
acceptedTargetZones: ['center'],
|
|
@@ -4704,8 +4682,8 @@
|
|
|
4704
4682
|
}), this.dropTarget);
|
|
4705
4683
|
}
|
|
4706
4684
|
setActive(isActive) {
|
|
4707
|
-
toggleClass(this.element, 'active-tab', isActive);
|
|
4708
|
-
toggleClass(this.element, 'inactive-tab', !isActive);
|
|
4685
|
+
toggleClass(this.element, 'dv-active-tab', isActive);
|
|
4686
|
+
toggleClass(this.element, 'dv-inactive-tab', !isActive);
|
|
4709
4687
|
}
|
|
4710
4688
|
setContent(part) {
|
|
4711
4689
|
if (this.content) {
|
|
@@ -4793,7 +4771,7 @@
|
|
|
4793
4771
|
this._onDragStart = new Emitter();
|
|
4794
4772
|
this.onDragStart = this._onDragStart.event;
|
|
4795
4773
|
this._element = document.createElement('div');
|
|
4796
|
-
this._element.className = 'void-container';
|
|
4774
|
+
this._element.className = 'dv-void-container';
|
|
4797
4775
|
this._element.tabIndex = 0;
|
|
4798
4776
|
this._element.draggable = true;
|
|
4799
4777
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
@@ -4913,16 +4891,16 @@
|
|
|
4913
4891
|
this._onWillShowOverlay = new Emitter();
|
|
4914
4892
|
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
4915
4893
|
this._element = document.createElement('div');
|
|
4916
|
-
this._element.className = 'tabs-and-actions-container';
|
|
4894
|
+
this._element.className = 'dv-tabs-and-actions-container';
|
|
4917
4895
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
4918
4896
|
this.rightActionsContainer = document.createElement('div');
|
|
4919
|
-
this.rightActionsContainer.className = 'right-actions-container';
|
|
4897
|
+
this.rightActionsContainer.className = 'dv-right-actions-container';
|
|
4920
4898
|
this.leftActionsContainer = document.createElement('div');
|
|
4921
|
-
this.leftActionsContainer.className = 'left-actions-container';
|
|
4899
|
+
this.leftActionsContainer.className = 'dv-left-actions-container';
|
|
4922
4900
|
this.preActionsContainer = document.createElement('div');
|
|
4923
|
-
this.preActionsContainer.className = 'pre-actions-container';
|
|
4901
|
+
this.preActionsContainer.className = 'dv-pre-actions-container';
|
|
4924
4902
|
this.tabContainer = document.createElement('div');
|
|
4925
|
-
this.tabContainer.className = 'tabs-container';
|
|
4903
|
+
this.tabContainer.className = 'dv-tabs-container';
|
|
4926
4904
|
this.voidContainer = new VoidContainer(this.accessor, this.group);
|
|
4927
4905
|
this._element.appendChild(this.preActionsContainer);
|
|
4928
4906
|
this._element.appendChild(this.tabContainer);
|
|
@@ -5011,14 +4989,10 @@
|
|
|
5011
4989
|
});
|
|
5012
4990
|
}
|
|
5013
4991
|
openPanel(panel, index = this.tabs.length) {
|
|
5014
|
-
var _a;
|
|
5015
4992
|
if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
|
|
5016
4993
|
return;
|
|
5017
4994
|
}
|
|
5018
4995
|
const tab = new Tab(panel, this.accessor, this.group);
|
|
5019
|
-
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
5020
|
-
throw new Error('invalid header component');
|
|
5021
|
-
}
|
|
5022
4996
|
tab.setContent(panel.view.tab);
|
|
5023
4997
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
5024
4998
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
@@ -5208,7 +5182,7 @@
|
|
|
5208
5182
|
}
|
|
5209
5183
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
5210
5184
|
get element() {
|
|
5211
|
-
throw new Error('not supported');
|
|
5185
|
+
throw new Error('dockview: not supported');
|
|
5212
5186
|
}
|
|
5213
5187
|
get activePanel() {
|
|
5214
5188
|
return this._activePanel;
|
|
@@ -5218,7 +5192,7 @@
|
|
|
5218
5192
|
}
|
|
5219
5193
|
set locked(value) {
|
|
5220
5194
|
this._locked = value;
|
|
5221
|
-
toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
|
|
5195
|
+
toggleClass(this.container, 'dv-locked-groupview', value === 'no-drop-target' || value);
|
|
5222
5196
|
}
|
|
5223
5197
|
get isActive() {
|
|
5224
5198
|
return this._isGroupActive;
|
|
@@ -5289,6 +5263,7 @@
|
|
|
5289
5263
|
this._locked = false;
|
|
5290
5264
|
this._location = { type: 'grid' };
|
|
5291
5265
|
this.mostRecentlyUsed = [];
|
|
5266
|
+
this._overwriteRenderContainer = null;
|
|
5292
5267
|
this._onDidChange = new Emitter();
|
|
5293
5268
|
this.onDidChange = this._onDidChange.event;
|
|
5294
5269
|
this._width = 0;
|
|
@@ -5319,8 +5294,7 @@
|
|
|
5319
5294
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
5320
5295
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
5321
5296
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
5322
|
-
this.
|
|
5323
|
-
toggleClass(this.container, 'groupview', true);
|
|
5297
|
+
toggleClass(this.container, 'dv-groupview', true);
|
|
5324
5298
|
this._api = new DockviewApi(this.accessor);
|
|
5325
5299
|
this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
|
|
5326
5300
|
this.contentContainer = new ContentContainer(this.accessor, this);
|
|
@@ -5565,8 +5539,8 @@
|
|
|
5565
5539
|
return;
|
|
5566
5540
|
}
|
|
5567
5541
|
this._isGroupActive = isGroupActive;
|
|
5568
|
-
toggleClass(this.container, 'active-group', isGroupActive);
|
|
5569
|
-
toggleClass(this.container, 'inactive-group', !isGroupActive);
|
|
5542
|
+
toggleClass(this.container, 'dv-active-group', isGroupActive);
|
|
5543
|
+
toggleClass(this.container, 'dv-inactive-group', !isGroupActive);
|
|
5570
5544
|
this.tabsContainer.setActive(this.isActive);
|
|
5571
5545
|
if (!this._activePanel && this.panels.length > 0) {
|
|
5572
5546
|
this.doSetActivePanel(this.panels[0]);
|
|
@@ -5658,7 +5632,7 @@
|
|
|
5658
5632
|
}
|
|
5659
5633
|
updateContainer() {
|
|
5660
5634
|
var _a, _b;
|
|
5661
|
-
toggleClass(this.container, 'empty', this.isEmpty);
|
|
5635
|
+
toggleClass(this.container, 'dv-empty', this.isEmpty);
|
|
5662
5636
|
this.panels.forEach((panel) => panel.runEvents());
|
|
5663
5637
|
if (this.isEmpty && !this.watermark) {
|
|
5664
5638
|
const watermark = this.accessor.createWatermarkComponent();
|
|
@@ -5799,6 +5773,34 @@
|
|
|
5799
5773
|
return this._snap;
|
|
5800
5774
|
}
|
|
5801
5775
|
get minimumWidth() {
|
|
5776
|
+
/**
|
|
5777
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5778
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5779
|
+
*/
|
|
5780
|
+
return this.__minimumWidth();
|
|
5781
|
+
}
|
|
5782
|
+
get minimumHeight() {
|
|
5783
|
+
/**
|
|
5784
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5785
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5786
|
+
*/
|
|
5787
|
+
return this.__minimumHeight();
|
|
5788
|
+
}
|
|
5789
|
+
get maximumHeight() {
|
|
5790
|
+
/**
|
|
5791
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5792
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5793
|
+
*/
|
|
5794
|
+
return this.__maximumHeight();
|
|
5795
|
+
}
|
|
5796
|
+
get maximumWidth() {
|
|
5797
|
+
/**
|
|
5798
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5799
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5800
|
+
*/
|
|
5801
|
+
return this.__maximumWidth();
|
|
5802
|
+
}
|
|
5803
|
+
__minimumWidth() {
|
|
5802
5804
|
const width = typeof this._minimumWidth === 'function'
|
|
5803
5805
|
? this._minimumWidth()
|
|
5804
5806
|
: this._minimumWidth;
|
|
@@ -5808,7 +5810,17 @@
|
|
|
5808
5810
|
}
|
|
5809
5811
|
return width;
|
|
5810
5812
|
}
|
|
5811
|
-
|
|
5813
|
+
__maximumWidth() {
|
|
5814
|
+
const width = typeof this._maximumWidth === 'function'
|
|
5815
|
+
? this._maximumWidth()
|
|
5816
|
+
: this._maximumWidth;
|
|
5817
|
+
if (width !== this._evaluatedMaximumWidth) {
|
|
5818
|
+
this._evaluatedMaximumWidth = width;
|
|
5819
|
+
this.updateConstraints();
|
|
5820
|
+
}
|
|
5821
|
+
return width;
|
|
5822
|
+
}
|
|
5823
|
+
__minimumHeight() {
|
|
5812
5824
|
const height = typeof this._minimumHeight === 'function'
|
|
5813
5825
|
? this._minimumHeight()
|
|
5814
5826
|
: this._minimumHeight;
|
|
@@ -5818,7 +5830,7 @@
|
|
|
5818
5830
|
}
|
|
5819
5831
|
return height;
|
|
5820
5832
|
}
|
|
5821
|
-
|
|
5833
|
+
__maximumHeight() {
|
|
5822
5834
|
const height = typeof this._maximumHeight === 'function'
|
|
5823
5835
|
? this._maximumHeight()
|
|
5824
5836
|
: this._maximumHeight;
|
|
@@ -5828,16 +5840,6 @@
|
|
|
5828
5840
|
}
|
|
5829
5841
|
return height;
|
|
5830
5842
|
}
|
|
5831
|
-
get maximumWidth() {
|
|
5832
|
-
const width = typeof this._maximumWidth === 'function'
|
|
5833
|
-
? this._maximumWidth()
|
|
5834
|
-
: this._maximumWidth;
|
|
5835
|
-
if (width !== this._evaluatedMaximumWidth) {
|
|
5836
|
-
this._evaluatedMaximumWidth = width;
|
|
5837
|
-
this.updateConstraints();
|
|
5838
|
-
}
|
|
5839
|
-
return width;
|
|
5840
|
-
}
|
|
5841
5843
|
get isActive() {
|
|
5842
5844
|
return this.api.isActive;
|
|
5843
5845
|
}
|
|
@@ -5988,6 +5990,7 @@
|
|
|
5988
5990
|
position: options.group
|
|
5989
5991
|
? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
|
|
5990
5992
|
: 'center',
|
|
5993
|
+
index: options.index,
|
|
5991
5994
|
},
|
|
5992
5995
|
});
|
|
5993
5996
|
}
|
|
@@ -6039,30 +6042,34 @@
|
|
|
6039
6042
|
get minimumWidth() {
|
|
6040
6043
|
var _a;
|
|
6041
6044
|
const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
+
if (typeof activePanelMinimumWidth === 'number') {
|
|
6046
|
+
return activePanelMinimumWidth;
|
|
6047
|
+
}
|
|
6048
|
+
return super.__minimumWidth();
|
|
6045
6049
|
}
|
|
6046
6050
|
get minimumHeight() {
|
|
6047
6051
|
var _a;
|
|
6048
6052
|
const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6053
|
+
if (typeof activePanelMinimumHeight === 'number') {
|
|
6054
|
+
return activePanelMinimumHeight;
|
|
6055
|
+
}
|
|
6056
|
+
return super.__minimumHeight();
|
|
6052
6057
|
}
|
|
6053
6058
|
get maximumWidth() {
|
|
6054
6059
|
var _a;
|
|
6055
6060
|
const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6061
|
+
if (typeof activePanelMaximumWidth === 'number') {
|
|
6062
|
+
return activePanelMaximumWidth;
|
|
6063
|
+
}
|
|
6064
|
+
return super.__maximumWidth();
|
|
6059
6065
|
}
|
|
6060
6066
|
get maximumHeight() {
|
|
6061
6067
|
var _a;
|
|
6062
6068
|
const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6069
|
+
if (typeof activePanelMaximumHeight === 'number') {
|
|
6070
|
+
return activePanelMaximumHeight;
|
|
6071
|
+
}
|
|
6072
|
+
return super.__maximumHeight();
|
|
6066
6073
|
}
|
|
6067
6074
|
get panels() {
|
|
6068
6075
|
return this._model.panels;
|
|
@@ -6176,12 +6183,14 @@
|
|
|
6176
6183
|
return this.group.api.getWindow();
|
|
6177
6184
|
}
|
|
6178
6185
|
moveTo(options) {
|
|
6179
|
-
var _a;
|
|
6186
|
+
var _a, _b;
|
|
6180
6187
|
this.accessor.moveGroupOrPanel({
|
|
6181
6188
|
from: { groupId: this._group.id, panelId: this.panel.id },
|
|
6182
6189
|
to: {
|
|
6183
|
-
group: options.group,
|
|
6184
|
-
position:
|
|
6190
|
+
group: (_a = options.group) !== null && _a !== void 0 ? _a : this._group,
|
|
6191
|
+
position: options.group
|
|
6192
|
+
? (_b = options.position) !== null && _b !== void 0 ? _b : 'center'
|
|
6193
|
+
: 'center',
|
|
6185
6194
|
index: options.index,
|
|
6186
6195
|
},
|
|
6187
6196
|
});
|
|
@@ -6400,7 +6409,7 @@
|
|
|
6400
6409
|
svg.setAttributeNS(null, 'viewBox', params.viewbox);
|
|
6401
6410
|
svg.setAttributeNS(null, 'aria-hidden', 'false');
|
|
6402
6411
|
svg.setAttributeNS(null, 'focusable', 'false');
|
|
6403
|
-
svg.classList.add('
|
|
6412
|
+
svg.classList.add('dv-svg');
|
|
6404
6413
|
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
6405
6414
|
path.setAttributeNS(null, 'd', params.path);
|
|
6406
6415
|
svg.appendChild(path);
|
|
@@ -6571,19 +6580,19 @@
|
|
|
6571
6580
|
constructor() {
|
|
6572
6581
|
super();
|
|
6573
6582
|
this._element = document.createElement('div');
|
|
6574
|
-
this._element.className = 'watermark';
|
|
6583
|
+
this._element.className = 'dv-watermark';
|
|
6575
6584
|
const title = document.createElement('div');
|
|
6576
|
-
title.className = 'watermark-title';
|
|
6585
|
+
title.className = 'dv-watermark-title';
|
|
6577
6586
|
const emptySpace = document.createElement('span');
|
|
6578
6587
|
emptySpace.style.flexGrow = '1';
|
|
6579
6588
|
const content = document.createElement('div');
|
|
6580
|
-
content.className = 'watermark-content';
|
|
6589
|
+
content.className = 'dv-watermark-content';
|
|
6581
6590
|
this._element.appendChild(title);
|
|
6582
6591
|
this._element.appendChild(content);
|
|
6583
6592
|
const actionsContainer = document.createElement('div');
|
|
6584
|
-
actionsContainer.className = 'actions-container';
|
|
6593
|
+
actionsContainer.className = 'dv-actions-container';
|
|
6585
6594
|
const closeAnchor = document.createElement('div');
|
|
6586
|
-
closeAnchor.className = 'close-action';
|
|
6595
|
+
closeAnchor.className = 'dv-close-action';
|
|
6587
6596
|
closeAnchor.appendChild(createCloseButton());
|
|
6588
6597
|
actionsContainer.appendChild(closeAnchor);
|
|
6589
6598
|
title.appendChild(emptySpace);
|
|
@@ -6603,11 +6612,10 @@
|
|
|
6603
6612
|
}
|
|
6604
6613
|
render() {
|
|
6605
6614
|
const isOneGroup = !!(this._api && this._api.size <= 1);
|
|
6606
|
-
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
6615
|
+
toggleClass(this.element, 'dv-has-actions', isOneGroup);
|
|
6607
6616
|
}
|
|
6608
6617
|
}
|
|
6609
6618
|
|
|
6610
|
-
const DEFAULT_OVERLAY_Z_INDEX = 999;
|
|
6611
6619
|
class AriaLevelTracker {
|
|
6612
6620
|
constructor() {
|
|
6613
6621
|
this._orderedList = [];
|
|
@@ -6626,7 +6634,7 @@
|
|
|
6626
6634
|
update() {
|
|
6627
6635
|
for (let i = 0; i < this._orderedList.length; i++) {
|
|
6628
6636
|
this._orderedList[i].setAttribute('aria-level', `${i}`);
|
|
6629
|
-
this._orderedList[i].style.zIndex =
|
|
6637
|
+
this._orderedList[i].style.zIndex = `calc(var(--dv-overlay-z-index, 999) + ${i * 2})`;
|
|
6630
6638
|
}
|
|
6631
6639
|
}
|
|
6632
6640
|
}
|
|
@@ -7083,7 +7091,7 @@
|
|
|
7083
7091
|
const element = floatingGroup.overlay.element;
|
|
7084
7092
|
const update = () => {
|
|
7085
7093
|
const level = Number(element.getAttribute('aria-level'));
|
|
7086
|
-
focusContainer.style.zIndex =
|
|
7094
|
+
focusContainer.style.zIndex = `calc(var(--dv-overlay-z-index, 999) + ${level * 2 + 1})`;
|
|
7087
7095
|
};
|
|
7088
7096
|
const observer = new MutationObserver(() => {
|
|
7089
7097
|
update();
|
|
@@ -7215,7 +7223,6 @@
|
|
|
7215
7223
|
window: this._window.value,
|
|
7216
7224
|
});
|
|
7217
7225
|
this._window.disposable.dispose();
|
|
7218
|
-
this._window.value.close();
|
|
7219
7226
|
this._window = null;
|
|
7220
7227
|
this._onDidClose.fire();
|
|
7221
7228
|
}
|
|
@@ -7247,7 +7254,9 @@
|
|
|
7247
7254
|
}
|
|
7248
7255
|
const disposable = new CompositeDisposable();
|
|
7249
7256
|
this._window = { value: externalWindow, disposable };
|
|
7250
|
-
disposable.addDisposables(
|
|
7257
|
+
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7258
|
+
externalWindow.close();
|
|
7259
|
+
}), addDisposableWindowListener(window, 'beforeunload', () => {
|
|
7251
7260
|
/**
|
|
7252
7261
|
* before the main window closes we should close this popup too
|
|
7253
7262
|
* to be good citizens
|
|
@@ -7264,7 +7273,7 @@
|
|
|
7264
7273
|
id: this.target,
|
|
7265
7274
|
window: externalWindow,
|
|
7266
7275
|
});
|
|
7267
|
-
return new Promise((resolve) => {
|
|
7276
|
+
return new Promise((resolve, reject) => {
|
|
7268
7277
|
externalWindow.addEventListener('unload', (e) => {
|
|
7269
7278
|
// if page fails to load before unloading
|
|
7270
7279
|
// this.close();
|
|
@@ -7273,21 +7282,27 @@
|
|
|
7273
7282
|
/**
|
|
7274
7283
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
7275
7284
|
*/
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
* beforeunload must be registered after load for reasons I could not determine
|
|
7282
|
-
* otherwise the beforeunload event will not fire when the window is closed
|
|
7283
|
-
*/
|
|
7284
|
-
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7285
|
+
try {
|
|
7286
|
+
const externalDocument = externalWindow.document;
|
|
7287
|
+
externalDocument.title = document.title;
|
|
7288
|
+
externalDocument.body.appendChild(container);
|
|
7289
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
7285
7290
|
/**
|
|
7286
|
-
*
|
|
7291
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
7292
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
7287
7293
|
*/
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7294
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7295
|
+
/**
|
|
7296
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7297
|
+
*/
|
|
7298
|
+
this.close();
|
|
7299
|
+
});
|
|
7300
|
+
resolve(container);
|
|
7301
|
+
}
|
|
7302
|
+
catch (err) {
|
|
7303
|
+
// only except this is the DOM isn't setup. e.g. in a in correctly configured test
|
|
7304
|
+
reject(err);
|
|
7305
|
+
}
|
|
7291
7306
|
});
|
|
7292
7307
|
});
|
|
7293
7308
|
});
|
|
@@ -7540,9 +7555,6 @@
|
|
|
7540
7555
|
}
|
|
7541
7556
|
const box = getBox();
|
|
7542
7557
|
const groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
|
|
7543
|
-
if (itemToPopout.api.location.type === 'grid') {
|
|
7544
|
-
itemToPopout.api.setVisible(false);
|
|
7545
|
-
}
|
|
7546
7558
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7547
7559
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
7548
7560
|
url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
|
|
@@ -7561,11 +7573,11 @@
|
|
|
7561
7573
|
.then((popoutContainer) => {
|
|
7562
7574
|
var _a;
|
|
7563
7575
|
if (_window.isDisposed) {
|
|
7564
|
-
return;
|
|
7576
|
+
return false;
|
|
7565
7577
|
}
|
|
7566
7578
|
if (popoutContainer === null) {
|
|
7567
7579
|
popoutWindowDisposable.dispose();
|
|
7568
|
-
return;
|
|
7580
|
+
return false;
|
|
7569
7581
|
}
|
|
7570
7582
|
const gready = document.createElement('div');
|
|
7571
7583
|
gready.className = 'dv-overlay-render-container';
|
|
@@ -7574,30 +7586,40 @@
|
|
|
7574
7586
|
? itemToPopout.group
|
|
7575
7587
|
: itemToPopout;
|
|
7576
7588
|
const referenceLocation = itemToPopout.api.location.type;
|
|
7577
|
-
|
|
7589
|
+
/**
|
|
7590
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurance
|
|
7591
|
+
* of this case is when being called from the `fromJSON(...)` method
|
|
7592
|
+
*/
|
|
7593
|
+
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
7594
|
+
const group = !isGroupAddedToDom
|
|
7595
|
+
? referenceGroup
|
|
7596
|
+
: (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
|
|
7578
7597
|
group.model.renderContainer = overlayRenderContainer;
|
|
7579
|
-
|
|
7598
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7599
|
+
if (!this._groups.has(group.api.id)) {
|
|
7580
7600
|
this._onDidAddGroup.fire(group);
|
|
7581
7601
|
}
|
|
7582
|
-
if (
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7602
|
+
if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup) && isGroupAddedToDom) {
|
|
7603
|
+
if (itemToPopout instanceof DockviewPanel) {
|
|
7604
|
+
this.movingLock(() => {
|
|
7605
|
+
const panel = referenceGroup.model.removePanel(itemToPopout);
|
|
7606
|
+
group.model.openPanel(panel);
|
|
7607
|
+
});
|
|
7608
|
+
}
|
|
7609
|
+
else {
|
|
7610
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7611
|
+
from: referenceGroup,
|
|
7612
|
+
to: group,
|
|
7613
|
+
}));
|
|
7614
|
+
switch (referenceLocation) {
|
|
7615
|
+
case 'grid':
|
|
7616
|
+
referenceGroup.api.setVisible(false);
|
|
7617
|
+
break;
|
|
7618
|
+
case 'floating':
|
|
7619
|
+
case 'popout':
|
|
7620
|
+
this.removeGroup(referenceGroup);
|
|
7621
|
+
break;
|
|
7622
|
+
}
|
|
7601
7623
|
}
|
|
7602
7624
|
}
|
|
7603
7625
|
popoutContainer.classList.add('dv-dockview');
|
|
@@ -7608,6 +7630,10 @@
|
|
|
7608
7630
|
type: 'popout',
|
|
7609
7631
|
getWindow: () => _window.window,
|
|
7610
7632
|
};
|
|
7633
|
+
if (isGroupAddedToDom &&
|
|
7634
|
+
itemToPopout.api.location.type === 'grid') {
|
|
7635
|
+
itemToPopout.api.setVisible(false);
|
|
7636
|
+
}
|
|
7611
7637
|
this.doSetGroupAndPanelActive(group);
|
|
7612
7638
|
popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
|
|
7613
7639
|
var _a;
|
|
@@ -7622,9 +7648,13 @@
|
|
|
7622
7648
|
const value = {
|
|
7623
7649
|
window: _window,
|
|
7624
7650
|
popoutGroup: group,
|
|
7625
|
-
referenceGroup:
|
|
7626
|
-
?
|
|
7627
|
-
:
|
|
7651
|
+
referenceGroup: !isGroupAddedToDom
|
|
7652
|
+
? undefined
|
|
7653
|
+
: referenceGroup
|
|
7654
|
+
? this.getPanel(referenceGroup.id)
|
|
7655
|
+
? referenceGroup.id
|
|
7656
|
+
: undefined
|
|
7657
|
+
: undefined,
|
|
7628
7658
|
disposable: {
|
|
7629
7659
|
dispose: () => {
|
|
7630
7660
|
popoutWindowDisposable.dispose();
|
|
@@ -7639,9 +7669,10 @@
|
|
|
7639
7669
|
* window dimensions
|
|
7640
7670
|
*/
|
|
7641
7671
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7642
|
-
group.layout(window.innerWidth, window.innerHeight);
|
|
7672
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7643
7673
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7644
|
-
if (
|
|
7674
|
+
if (isGroupAddedToDom &&
|
|
7675
|
+
this.getPanel(referenceGroup.id)) {
|
|
7645
7676
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7646
7677
|
from: group,
|
|
7647
7678
|
to: referenceGroup,
|
|
@@ -7656,21 +7687,27 @@
|
|
|
7656
7687
|
}
|
|
7657
7688
|
}
|
|
7658
7689
|
else if (this.getPanel(group.id)) {
|
|
7659
|
-
|
|
7690
|
+
this.doRemoveGroup(group, {
|
|
7660
7691
|
skipDispose: true,
|
|
7661
7692
|
skipActive: true,
|
|
7693
|
+
skipPopoutReturn: true,
|
|
7662
7694
|
});
|
|
7695
|
+
const removedGroup = group;
|
|
7663
7696
|
removedGroup.model.renderContainer =
|
|
7664
7697
|
this.overlayRenderContainer;
|
|
7665
7698
|
removedGroup.model.location = { type: 'grid' };
|
|
7666
7699
|
returnedGroup = removedGroup;
|
|
7700
|
+
this.doAddGroup(removedGroup, [0]);
|
|
7701
|
+
this.doSetGroupAndPanelActive(removedGroup);
|
|
7667
7702
|
}
|
|
7668
7703
|
}));
|
|
7669
7704
|
this._popoutGroups.push(value);
|
|
7670
7705
|
this.updateWatermark();
|
|
7706
|
+
return true;
|
|
7671
7707
|
})
|
|
7672
7708
|
.catch((err) => {
|
|
7673
7709
|
console.error('dockview: failed to create popout window', err);
|
|
7710
|
+
return false;
|
|
7674
7711
|
});
|
|
7675
7712
|
}
|
|
7676
7713
|
addFloatingGroup(item, options) {
|
|
@@ -7774,7 +7811,7 @@
|
|
|
7774
7811
|
: (_c = (_b = this.options.floatingGroupBounds) === null || _b === void 0 ? void 0 : _b.minimumWidthWithinViewport) !== null && _c !== void 0 ? _c : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE, minimumInViewportHeight: this.options.floatingGroupBounds === 'boundedWithinViewport'
|
|
7775
7812
|
? undefined
|
|
7776
7813
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
7777
|
-
const el = group.element.querySelector('.void-container');
|
|
7814
|
+
const el = group.element.querySelector('.dv-void-container');
|
|
7778
7815
|
if (!el) {
|
|
7779
7816
|
throw new Error('failed to find drag handle');
|
|
7780
7817
|
}
|
|
@@ -8057,7 +8094,6 @@
|
|
|
8057
8094
|
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
8058
8095
|
? this.getPanel(gridReferenceGroup)
|
|
8059
8096
|
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
8060
|
-
skipRemoveGroup: true,
|
|
8061
8097
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
8062
8098
|
overridePopoutGroup: gridReferenceGroup
|
|
8063
8099
|
? group
|
|
@@ -8075,6 +8111,7 @@
|
|
|
8075
8111
|
}
|
|
8076
8112
|
}
|
|
8077
8113
|
catch (err) {
|
|
8114
|
+
console.error('dockview: failed to deserialize layout. Reverting changes', err);
|
|
8078
8115
|
/**
|
|
8079
8116
|
* Takes all the successfully created groups and remove all of their panels.
|
|
8080
8117
|
*/
|
|
@@ -8142,11 +8179,13 @@
|
|
|
8142
8179
|
width: options.initialWidth,
|
|
8143
8180
|
height: options.initialHeight,
|
|
8144
8181
|
};
|
|
8182
|
+
let index;
|
|
8145
8183
|
if (options.position) {
|
|
8146
8184
|
if (isPanelOptionsWithPanel(options.position)) {
|
|
8147
8185
|
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
8148
8186
|
? this.getGroupPanel(options.position.referencePanel)
|
|
8149
8187
|
: options.position.referencePanel;
|
|
8188
|
+
index = options.position.index;
|
|
8150
8189
|
if (!referencePanel) {
|
|
8151
8190
|
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
8152
8191
|
}
|
|
@@ -8157,6 +8196,7 @@
|
|
|
8157
8196
|
typeof options.position.referenceGroup === 'string'
|
|
8158
8197
|
? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
8159
8198
|
: options.position.referenceGroup;
|
|
8199
|
+
index = options.position.index;
|
|
8160
8200
|
if (!referenceGroup) {
|
|
8161
8201
|
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
8162
8202
|
}
|
|
@@ -8167,6 +8207,7 @@
|
|
|
8167
8207
|
group.model.openPanel(panel, {
|
|
8168
8208
|
skipSetActive: options.inactive,
|
|
8169
8209
|
skipSetGroupActive: options.inactive,
|
|
8210
|
+
index,
|
|
8170
8211
|
});
|
|
8171
8212
|
if (!options.inactive) {
|
|
8172
8213
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8196,6 +8237,7 @@
|
|
|
8196
8237
|
group.model.openPanel(panel, {
|
|
8197
8238
|
skipSetActive: options.inactive,
|
|
8198
8239
|
skipSetGroupActive: options.inactive,
|
|
8240
|
+
index,
|
|
8199
8241
|
});
|
|
8200
8242
|
}
|
|
8201
8243
|
else if (referenceGroup.api.location.type === 'floating' ||
|
|
@@ -8204,6 +8246,7 @@
|
|
|
8204
8246
|
referenceGroup.model.openPanel(panel, {
|
|
8205
8247
|
skipSetActive: options.inactive,
|
|
8206
8248
|
skipSetGroupActive: options.inactive,
|
|
8249
|
+
index,
|
|
8207
8250
|
});
|
|
8208
8251
|
referenceGroup.api.setSize({
|
|
8209
8252
|
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
@@ -8224,6 +8267,7 @@
|
|
|
8224
8267
|
group.model.openPanel(panel, {
|
|
8225
8268
|
skipSetActive: options.inactive,
|
|
8226
8269
|
skipSetGroupActive: options.inactive,
|
|
8270
|
+
index,
|
|
8227
8271
|
});
|
|
8228
8272
|
if (!options.inactive) {
|
|
8229
8273
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8242,6 +8286,7 @@
|
|
|
8242
8286
|
group.model.openPanel(panel, {
|
|
8243
8287
|
skipSetActive: options.inactive,
|
|
8244
8288
|
skipSetGroupActive: options.inactive,
|
|
8289
|
+
index,
|
|
8245
8290
|
});
|
|
8246
8291
|
}
|
|
8247
8292
|
else {
|
|
@@ -8252,6 +8297,7 @@
|
|
|
8252
8297
|
group.model.openPanel(panel, {
|
|
8253
8298
|
skipSetActive: options.inactive,
|
|
8254
8299
|
skipSetGroupActive: options.inactive,
|
|
8300
|
+
index,
|
|
8255
8301
|
});
|
|
8256
8302
|
if (!options.inactive) {
|
|
8257
8303
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8792,6 +8838,31 @@
|
|
|
8792
8838
|
}
|
|
8793
8839
|
}
|
|
8794
8840
|
|
|
8841
|
+
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8842
|
+
const Component = typeof componentName === 'string'
|
|
8843
|
+
? components[componentName]
|
|
8844
|
+
: undefined;
|
|
8845
|
+
const FrameworkComponent = typeof componentName === 'string'
|
|
8846
|
+
? frameworkComponents[componentName]
|
|
8847
|
+
: undefined;
|
|
8848
|
+
if (Component && FrameworkComponent) {
|
|
8849
|
+
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
8850
|
+
}
|
|
8851
|
+
if (FrameworkComponent) {
|
|
8852
|
+
if (!createFrameworkComponent) {
|
|
8853
|
+
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
8854
|
+
}
|
|
8855
|
+
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
8856
|
+
}
|
|
8857
|
+
if (!Component) {
|
|
8858
|
+
if (fallback) {
|
|
8859
|
+
return fallback();
|
|
8860
|
+
}
|
|
8861
|
+
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
8862
|
+
}
|
|
8863
|
+
return new Component(id, componentName);
|
|
8864
|
+
}
|
|
8865
|
+
|
|
8795
8866
|
class GridviewComponent extends BaseGrid {
|
|
8796
8867
|
get orientation() {
|
|
8797
8868
|
return this.gridview.orientation;
|
|
@@ -9340,12 +9411,14 @@
|
|
|
9340
9411
|
this._expandedIcon = createExpandMoreButton();
|
|
9341
9412
|
this._collapsedIcon = createChevronRightButton();
|
|
9342
9413
|
this.disposable = new MutableDisposable();
|
|
9343
|
-
this.apiRef = {
|
|
9414
|
+
this.apiRef = {
|
|
9415
|
+
api: null,
|
|
9416
|
+
};
|
|
9344
9417
|
this._element = document.createElement('div');
|
|
9345
|
-
this.element.className = 'default-header';
|
|
9418
|
+
this.element.className = 'dv-default-header';
|
|
9346
9419
|
this._content = document.createElement('span');
|
|
9347
9420
|
this._expander = document.createElement('div');
|
|
9348
|
-
this._expander.className = '
|
|
9421
|
+
this._expander.className = 'dv-pane-header-icon';
|
|
9349
9422
|
this.element.appendChild(this._expander);
|
|
9350
9423
|
this.element.appendChild(this._content);
|
|
9351
9424
|
this.addDisposables(addDisposableListener(this._element, 'click', () => {
|
|
@@ -10202,22 +10275,6 @@
|
|
|
10202
10275
|
disposable.dispose();
|
|
10203
10276
|
};
|
|
10204
10277
|
}, [props.onDidDrop]);
|
|
10205
|
-
React.useEffect(() => {
|
|
10206
|
-
if (!dockviewRef.current) {
|
|
10207
|
-
return () => {
|
|
10208
|
-
// noop
|
|
10209
|
-
};
|
|
10210
|
-
}
|
|
10211
|
-
const disposable = dockviewRef.current.onUnhandledDragOverEvent((event) => {
|
|
10212
|
-
var _a;
|
|
10213
|
-
if ((_a = props.showDndOverlay) === null || _a === void 0 ? void 0 : _a.call(props, event)) {
|
|
10214
|
-
event.accept();
|
|
10215
|
-
}
|
|
10216
|
-
});
|
|
10217
|
-
return () => {
|
|
10218
|
-
disposable.dispose();
|
|
10219
|
-
};
|
|
10220
|
-
}, [props.showDndOverlay]);
|
|
10221
10278
|
React.useEffect(() => {
|
|
10222
10279
|
if (!dockviewRef.current) {
|
|
10223
10280
|
return () => {
|
|
@@ -10635,7 +10692,6 @@
|
|
|
10635
10692
|
exports.GridviewComponent = GridviewComponent;
|
|
10636
10693
|
exports.GridviewPanel = GridviewPanel;
|
|
10637
10694
|
exports.GridviewReact = GridviewReact;
|
|
10638
|
-
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
10639
10695
|
exports.PROPERTY_KEYS = PROPERTY_KEYS;
|
|
10640
10696
|
exports.PaneFramework = PaneFramework;
|
|
10641
10697
|
exports.PaneTransfer = PaneTransfer;
|
|
@@ -10654,7 +10710,6 @@
|
|
|
10654
10710
|
exports.SplitviewReact = SplitviewReact;
|
|
10655
10711
|
exports.Tab = Tab;
|
|
10656
10712
|
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
10657
|
-
exports.createComponent = createComponent;
|
|
10658
10713
|
exports.createDockview = createDockview;
|
|
10659
10714
|
exports.createGridview = createGridview;
|
|
10660
10715
|
exports.createPaneview = createPaneview;
|