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
|
*/
|
|
@@ -324,31 +324,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
328
|
-
const Component = typeof componentName === 'string'
|
|
329
|
-
? components[componentName]
|
|
330
|
-
: undefined;
|
|
331
|
-
const FrameworkComponent = typeof componentName === 'string'
|
|
332
|
-
? frameworkComponents[componentName]
|
|
333
|
-
: undefined;
|
|
334
|
-
if (Component && FrameworkComponent) {
|
|
335
|
-
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
336
|
-
}
|
|
337
|
-
if (FrameworkComponent) {
|
|
338
|
-
if (!createFrameworkComponent) {
|
|
339
|
-
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
340
|
-
}
|
|
341
|
-
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
342
|
-
}
|
|
343
|
-
if (!Component) {
|
|
344
|
-
if (fallback) {
|
|
345
|
-
return fallback();
|
|
346
|
-
}
|
|
347
|
-
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
348
|
-
}
|
|
349
|
-
return new Component(id, componentName);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
327
|
function watchElementResize(element, cb) {
|
|
353
328
|
const observer = new ResizeObserver((entires) => {
|
|
354
329
|
/**
|
|
@@ -817,10 +792,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
817
792
|
const tmp = this.size;
|
|
818
793
|
this.size = this.orthogonalSize;
|
|
819
794
|
this.orthogonalSize = tmp;
|
|
820
|
-
removeClasses(this.element, 'horizontal', 'vertical');
|
|
795
|
+
removeClasses(this.element, 'dv-horizontal', 'dv-vertical');
|
|
821
796
|
this.element.classList.add(this.orientation == exports.Orientation.HORIZONTAL
|
|
822
|
-
? 'horizontal'
|
|
823
|
-
: 'vertical');
|
|
797
|
+
? 'dv-horizontal'
|
|
798
|
+
: 'dv-vertical');
|
|
824
799
|
}
|
|
825
800
|
get minimumSize() {
|
|
826
801
|
return this.viewItems.reduce((r, item) => r + item.minimumSize, 0);
|
|
@@ -998,11 +973,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
998
973
|
}
|
|
999
974
|
style(styles) {
|
|
1000
975
|
if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
|
|
1001
|
-
removeClasses(this.element, 'separator-border');
|
|
976
|
+
removeClasses(this.element, 'dv-separator-border');
|
|
1002
977
|
this.element.style.removeProperty('--dv-separator-border');
|
|
1003
978
|
}
|
|
1004
979
|
else {
|
|
1005
|
-
addClasses(this.element, 'separator-border');
|
|
980
|
+
addClasses(this.element, 'dv-separator-border');
|
|
1006
981
|
if (styles === null || styles === void 0 ? void 0 : styles.separatorBorder) {
|
|
1007
982
|
this.element.style.setProperty('--dv-separator-border', styles.separatorBorder);
|
|
1008
983
|
}
|
|
@@ -1072,7 +1047,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1072
1047
|
}
|
|
1073
1048
|
addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
|
|
1074
1049
|
const container = document.createElement('div');
|
|
1075
|
-
container.className = 'view';
|
|
1050
|
+
container.className = 'dv-view';
|
|
1076
1051
|
container.appendChild(view.element);
|
|
1077
1052
|
let viewSize;
|
|
1078
1053
|
if (typeof size === 'number') {
|
|
@@ -1104,7 +1079,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1104
1079
|
if (this.viewItems.length > 1) {
|
|
1105
1080
|
//add sash
|
|
1106
1081
|
const sash = document.createElement('div');
|
|
1107
|
-
sash.className = 'sash';
|
|
1082
|
+
sash.className = 'dv-sash';
|
|
1108
1083
|
const onPointerStart = (event) => {
|
|
1109
1084
|
for (const item of this.viewItems) {
|
|
1110
1085
|
item.enabled = false;
|
|
@@ -1363,7 +1338,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1363
1338
|
const offset = i === 0 || visiblePanelsBeforeThisView === 0
|
|
1364
1339
|
? 0
|
|
1365
1340
|
: viewLeftOffsets[i - 1] +
|
|
1366
|
-
(visiblePanelsBeforeThisView / sashCount) *
|
|
1341
|
+
(visiblePanelsBeforeThisView / sashCount) *
|
|
1342
|
+
marginReducedSize;
|
|
1367
1343
|
if (i < this.viewItems.length - 1) {
|
|
1368
1344
|
// calculate sash position
|
|
1369
1345
|
const newSize = view.visible
|
|
@@ -1474,27 +1450,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1474
1450
|
}
|
|
1475
1451
|
}
|
|
1476
1452
|
updateSash(sash, state) {
|
|
1477
|
-
toggleClass(sash.container, 'disabled', state === exports.SashState.DISABLED);
|
|
1478
|
-
toggleClass(sash.container, 'enabled', state === exports.SashState.ENABLED);
|
|
1479
|
-
toggleClass(sash.container, 'maximum', state === exports.SashState.MAXIMUM);
|
|
1480
|
-
toggleClass(sash.container, 'minimum', state === exports.SashState.MINIMUM);
|
|
1453
|
+
toggleClass(sash.container, 'dv-disabled', state === exports.SashState.DISABLED);
|
|
1454
|
+
toggleClass(sash.container, 'dv-enabled', state === exports.SashState.ENABLED);
|
|
1455
|
+
toggleClass(sash.container, 'dv-maximum', state === exports.SashState.MAXIMUM);
|
|
1456
|
+
toggleClass(sash.container, 'dv-minimum', state === exports.SashState.MINIMUM);
|
|
1481
1457
|
}
|
|
1482
1458
|
createViewContainer() {
|
|
1483
1459
|
const element = document.createElement('div');
|
|
1484
|
-
element.className = 'view-container';
|
|
1460
|
+
element.className = 'dv-view-container';
|
|
1485
1461
|
return element;
|
|
1486
1462
|
}
|
|
1487
1463
|
createSashContainer() {
|
|
1488
1464
|
const element = document.createElement('div');
|
|
1489
|
-
element.className = 'sash-container';
|
|
1465
|
+
element.className = 'dv-sash-container';
|
|
1490
1466
|
return element;
|
|
1491
1467
|
}
|
|
1492
1468
|
createContainer() {
|
|
1493
1469
|
const element = document.createElement('div');
|
|
1494
1470
|
const orientationClassname = this._orientation === exports.Orientation.HORIZONTAL
|
|
1495
|
-
? 'horizontal'
|
|
1496
|
-
: 'vertical';
|
|
1497
|
-
element.className = `split-view-container ${orientationClassname}`;
|
|
1471
|
+
? 'dv-horizontal'
|
|
1472
|
+
: 'dv-vertical';
|
|
1473
|
+
element.className = `dv-split-view-container ${orientationClassname}`;
|
|
1498
1474
|
return element;
|
|
1499
1475
|
}
|
|
1500
1476
|
dispose() {
|
|
@@ -1545,7 +1521,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1545
1521
|
this.onDidChange = this._onDidChange.event;
|
|
1546
1522
|
this._orientation = (_a = options.orientation) !== null && _a !== void 0 ? _a : exports.Orientation.VERTICAL;
|
|
1547
1523
|
this.element = document.createElement('div');
|
|
1548
|
-
this.element.className = 'pane-container';
|
|
1524
|
+
this.element.className = 'dv-pane-container';
|
|
1549
1525
|
container.appendChild(this.element);
|
|
1550
1526
|
this.splitview = new Splitview(this.element, {
|
|
1551
1527
|
orientation: this._orientation,
|
|
@@ -1637,10 +1613,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1637
1613
|
clearTimeout(this.animationTimer);
|
|
1638
1614
|
this.animationTimer = undefined;
|
|
1639
1615
|
}
|
|
1640
|
-
addClasses(this.element, 'animated');
|
|
1616
|
+
addClasses(this.element, 'dv-animated');
|
|
1641
1617
|
this.animationTimer = setTimeout(() => {
|
|
1642
1618
|
this.animationTimer = undefined;
|
|
1643
|
-
removeClasses(this.element, 'animated');
|
|
1619
|
+
removeClasses(this.element, 'dv-animated');
|
|
1644
1620
|
}, 200);
|
|
1645
1621
|
}
|
|
1646
1622
|
dispose() {
|
|
@@ -1865,7 +1841,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
1865
1841
|
this._orthogonalSize = orthogonalSize;
|
|
1866
1842
|
this._size = size;
|
|
1867
1843
|
this.element = document.createElement('div');
|
|
1868
|
-
this.element.className = 'branch-node';
|
|
1844
|
+
this.element.className = 'dv-branch-node';
|
|
1869
1845
|
if (!childDescriptors) {
|
|
1870
1846
|
this.splitview = new Splitview(this.element, {
|
|
1871
1847
|
orientation: this.orientation,
|
|
@@ -2076,7 +2052,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2076
2052
|
if (!parentElement) {
|
|
2077
2053
|
throw new Error('Invalid grid element');
|
|
2078
2054
|
}
|
|
2079
|
-
if (/\
|
|
2055
|
+
if (/\bdv-grid-view\b/.test(parentElement.className)) {
|
|
2080
2056
|
return [];
|
|
2081
2057
|
}
|
|
2082
2058
|
const index = indexInParent(parentElement);
|
|
@@ -2424,7 +2400,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
2424
2400
|
this._onDidMaximizedNodeChange = new Emitter();
|
|
2425
2401
|
this.onDidMaximizedNodeChange = this._onDidMaximizedNodeChange.event;
|
|
2426
2402
|
this.element = document.createElement('div');
|
|
2427
|
-
this.element.className = 'grid-view';
|
|
2403
|
+
this.element.className = 'dv-grid-view';
|
|
2428
2404
|
this._locked = locked !== null && locked !== void 0 ? locked : false;
|
|
2429
2405
|
this._margin = margin !== null && margin !== void 0 ? margin : 0;
|
|
2430
2406
|
this.root = new BranchNode(orientation, proportionalLayout, styles, 0, 0, this.locked, this.margin);
|
|
@@ -3646,7 +3622,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3646
3622
|
* dnd logic. You can see the code at
|
|
3647
3623
|
* https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
3648
3624
|
*/
|
|
3649
|
-
event.dataTransfer.setData('text/plain', '
|
|
3625
|
+
event.dataTransfer.setData('text/plain', '');
|
|
3650
3626
|
}
|
|
3651
3627
|
}
|
|
3652
3628
|
}), addDisposableListener(this.el, 'dragend', () => {
|
|
@@ -3820,12 +3796,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3820
3796
|
this.markAsUsed(e);
|
|
3821
3797
|
if (!this.targetElement) {
|
|
3822
3798
|
this.targetElement = document.createElement('div');
|
|
3823
|
-
this.targetElement.className = 'drop-target-dropzone';
|
|
3799
|
+
this.targetElement.className = 'dv-drop-target-dropzone';
|
|
3824
3800
|
this.overlayElement = document.createElement('div');
|
|
3825
|
-
this.overlayElement.className = 'drop-target-selection';
|
|
3801
|
+
this.overlayElement.className = 'dv-drop-target-selection';
|
|
3826
3802
|
this._state = 'center';
|
|
3827
3803
|
this.targetElement.appendChild(this.overlayElement);
|
|
3828
|
-
this.element.classList.add('drop-target');
|
|
3804
|
+
this.element.classList.add('dv-drop-target');
|
|
3829
3805
|
this.element.append(this.targetElement);
|
|
3830
3806
|
}
|
|
3831
3807
|
this.toggleClasses(quadrant, width, height);
|
|
@@ -3963,7 +3939,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
3963
3939
|
this.element.removeChild(this.targetElement);
|
|
3964
3940
|
this.targetElement = undefined;
|
|
3965
3941
|
this.overlayElement = undefined;
|
|
3966
|
-
this.element.classList.remove('drop-target');
|
|
3942
|
+
this.element.classList.remove('dv-drop-target');
|
|
3967
3943
|
}
|
|
3968
3944
|
}
|
|
3969
3945
|
}
|
|
@@ -4300,7 +4276,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4300
4276
|
this._headerVisible = isHeaderVisible;
|
|
4301
4277
|
this._onDidChangeExpansionState.fire(this.isExpanded()); // initialize value
|
|
4302
4278
|
this._orientation = orientation;
|
|
4303
|
-
this.element.classList.add('pane');
|
|
4279
|
+
this.element.classList.add('dv-pane');
|
|
4304
4280
|
this.addDisposables(this.api.onWillVisibilityChange((event) => {
|
|
4305
4281
|
const { isVisible } = event;
|
|
4306
4282
|
const { accessor } = this._params;
|
|
@@ -4397,14 +4373,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4397
4373
|
renderOnce() {
|
|
4398
4374
|
this.header = document.createElement('div');
|
|
4399
4375
|
this.header.tabIndex = 0;
|
|
4400
|
-
this.header.className = 'pane-header';
|
|
4376
|
+
this.header.className = 'dv-pane-header';
|
|
4401
4377
|
this.header.style.height = `${this.headerSize}px`;
|
|
4402
4378
|
this.header.style.lineHeight = `${this.headerSize}px`;
|
|
4403
4379
|
this.header.style.minHeight = `${this.headerSize}px`;
|
|
4404
4380
|
this.header.style.maxHeight = `${this.headerSize}px`;
|
|
4405
4381
|
this.element.appendChild(this.header);
|
|
4406
4382
|
this.body = document.createElement('div');
|
|
4407
|
-
this.body.className = 'pane-body';
|
|
4383
|
+
this.body.className = 'dv-pane-body';
|
|
4408
4384
|
this.element.appendChild(this.body);
|
|
4409
4385
|
}
|
|
4410
4386
|
// TODO slightly hacky by-pass of the component to create a body and header component
|
|
@@ -4525,7 +4501,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4525
4501
|
this._onDidBlur = new Emitter();
|
|
4526
4502
|
this.onDidBlur = this._onDidBlur.event;
|
|
4527
4503
|
this._element = document.createElement('div');
|
|
4528
|
-
this._element.className = 'content-container';
|
|
4504
|
+
this._element.className = 'dv-content-container';
|
|
4529
4505
|
this._element.tabIndex = -1;
|
|
4530
4506
|
this.addDisposables(this._onDidFocus, this._onDidBlur);
|
|
4531
4507
|
this.dropTarget = new Droptarget(this.element, {
|
|
@@ -4598,6 +4574,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4598
4574
|
referenceContainer: this,
|
|
4599
4575
|
});
|
|
4600
4576
|
break;
|
|
4577
|
+
default:
|
|
4578
|
+
throw new Error(`dockview: invalid renderer type '${panel.api.renderer}'`);
|
|
4601
4579
|
}
|
|
4602
4580
|
if (doRender) {
|
|
4603
4581
|
const focusTracker = trackFocus(container);
|
|
@@ -4664,10 +4642,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4664
4642
|
this._onDragStart = new Emitter();
|
|
4665
4643
|
this.onDragStart = this._onDragStart.event;
|
|
4666
4644
|
this._element = document.createElement('div');
|
|
4667
|
-
this._element.className = 'tab';
|
|
4645
|
+
this._element.className = 'dv-tab';
|
|
4668
4646
|
this._element.tabIndex = 0;
|
|
4669
4647
|
this._element.draggable = true;
|
|
4670
|
-
toggleClass(this.element, 'inactive-tab', true);
|
|
4648
|
+
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
4671
4649
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
4672
4650
|
this.dropTarget = new Droptarget(this._element, {
|
|
4673
4651
|
acceptedTargetZones: ['center'],
|
|
@@ -4700,8 +4678,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4700
4678
|
}), this.dropTarget);
|
|
4701
4679
|
}
|
|
4702
4680
|
setActive(isActive) {
|
|
4703
|
-
toggleClass(this.element, 'active-tab', isActive);
|
|
4704
|
-
toggleClass(this.element, 'inactive-tab', !isActive);
|
|
4681
|
+
toggleClass(this.element, 'dv-active-tab', isActive);
|
|
4682
|
+
toggleClass(this.element, 'dv-inactive-tab', !isActive);
|
|
4705
4683
|
}
|
|
4706
4684
|
setContent(part) {
|
|
4707
4685
|
if (this.content) {
|
|
@@ -4789,7 +4767,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4789
4767
|
this._onDragStart = new Emitter();
|
|
4790
4768
|
this.onDragStart = this._onDragStart.event;
|
|
4791
4769
|
this._element = document.createElement('div');
|
|
4792
|
-
this._element.className = 'void-container';
|
|
4770
|
+
this._element.className = 'dv-void-container';
|
|
4793
4771
|
this._element.tabIndex = 0;
|
|
4794
4772
|
this._element.draggable = true;
|
|
4795
4773
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
@@ -4909,16 +4887,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
4909
4887
|
this._onWillShowOverlay = new Emitter();
|
|
4910
4888
|
this.onWillShowOverlay = this._onWillShowOverlay.event;
|
|
4911
4889
|
this._element = document.createElement('div');
|
|
4912
|
-
this._element.className = 'tabs-and-actions-container';
|
|
4890
|
+
this._element.className = 'dv-tabs-and-actions-container';
|
|
4913
4891
|
toggleClass(this._element, 'dv-full-width-single-tab', this.accessor.options.singleTabMode === 'fullwidth');
|
|
4914
4892
|
this.rightActionsContainer = document.createElement('div');
|
|
4915
|
-
this.rightActionsContainer.className = 'right-actions-container';
|
|
4893
|
+
this.rightActionsContainer.className = 'dv-right-actions-container';
|
|
4916
4894
|
this.leftActionsContainer = document.createElement('div');
|
|
4917
|
-
this.leftActionsContainer.className = 'left-actions-container';
|
|
4895
|
+
this.leftActionsContainer.className = 'dv-left-actions-container';
|
|
4918
4896
|
this.preActionsContainer = document.createElement('div');
|
|
4919
|
-
this.preActionsContainer.className = 'pre-actions-container';
|
|
4897
|
+
this.preActionsContainer.className = 'dv-pre-actions-container';
|
|
4920
4898
|
this.tabContainer = document.createElement('div');
|
|
4921
|
-
this.tabContainer.className = 'tabs-container';
|
|
4899
|
+
this.tabContainer.className = 'dv-tabs-container';
|
|
4922
4900
|
this.voidContainer = new VoidContainer(this.accessor, this.group);
|
|
4923
4901
|
this._element.appendChild(this.preActionsContainer);
|
|
4924
4902
|
this._element.appendChild(this.tabContainer);
|
|
@@ -5007,14 +4985,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5007
4985
|
});
|
|
5008
4986
|
}
|
|
5009
4987
|
openPanel(panel, index = this.tabs.length) {
|
|
5010
|
-
var _a;
|
|
5011
4988
|
if (this.tabs.find((tab) => tab.value.panel.id === panel.id)) {
|
|
5012
4989
|
return;
|
|
5013
4990
|
}
|
|
5014
4991
|
const tab = new Tab(panel, this.accessor, this.group);
|
|
5015
|
-
if (!((_a = panel.view) === null || _a === void 0 ? void 0 : _a.tab)) {
|
|
5016
|
-
throw new Error('invalid header component');
|
|
5017
|
-
}
|
|
5018
4992
|
tab.setContent(panel.view.tab);
|
|
5019
4993
|
const disposable = new CompositeDisposable(tab.onDragStart((event) => {
|
|
5020
4994
|
this._onTabDragStart.fire({ nativeEvent: event, panel });
|
|
@@ -5204,7 +5178,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5204
5178
|
}
|
|
5205
5179
|
class DockviewGroupPanelModel extends CompositeDisposable {
|
|
5206
5180
|
get element() {
|
|
5207
|
-
throw new Error('not supported');
|
|
5181
|
+
throw new Error('dockview: not supported');
|
|
5208
5182
|
}
|
|
5209
5183
|
get activePanel() {
|
|
5210
5184
|
return this._activePanel;
|
|
@@ -5214,7 +5188,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5214
5188
|
}
|
|
5215
5189
|
set locked(value) {
|
|
5216
5190
|
this._locked = value;
|
|
5217
|
-
toggleClass(this.container, 'locked-groupview', value === 'no-drop-target' || value);
|
|
5191
|
+
toggleClass(this.container, 'dv-locked-groupview', value === 'no-drop-target' || value);
|
|
5218
5192
|
}
|
|
5219
5193
|
get isActive() {
|
|
5220
5194
|
return this._isGroupActive;
|
|
@@ -5285,6 +5259,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5285
5259
|
this._locked = false;
|
|
5286
5260
|
this._location = { type: 'grid' };
|
|
5287
5261
|
this.mostRecentlyUsed = [];
|
|
5262
|
+
this._overwriteRenderContainer = null;
|
|
5288
5263
|
this._onDidChange = new Emitter();
|
|
5289
5264
|
this.onDidChange = this._onDidChange.event;
|
|
5290
5265
|
this._width = 0;
|
|
@@ -5315,8 +5290,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5315
5290
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
5316
5291
|
this._onUnhandledDragOverEvent = new Emitter();
|
|
5317
5292
|
this.onUnhandledDragOverEvent = this._onUnhandledDragOverEvent.event;
|
|
5318
|
-
this.
|
|
5319
|
-
toggleClass(this.container, 'groupview', true);
|
|
5293
|
+
toggleClass(this.container, 'dv-groupview', true);
|
|
5320
5294
|
this._api = new DockviewApi(this.accessor);
|
|
5321
5295
|
this.tabsContainer = new TabsContainer(this.accessor, this.groupPanel);
|
|
5322
5296
|
this.contentContainer = new ContentContainer(this.accessor, this);
|
|
@@ -5561,8 +5535,8 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5561
5535
|
return;
|
|
5562
5536
|
}
|
|
5563
5537
|
this._isGroupActive = isGroupActive;
|
|
5564
|
-
toggleClass(this.container, 'active-group', isGroupActive);
|
|
5565
|
-
toggleClass(this.container, 'inactive-group', !isGroupActive);
|
|
5538
|
+
toggleClass(this.container, 'dv-active-group', isGroupActive);
|
|
5539
|
+
toggleClass(this.container, 'dv-inactive-group', !isGroupActive);
|
|
5566
5540
|
this.tabsContainer.setActive(this.isActive);
|
|
5567
5541
|
if (!this._activePanel && this.panels.length > 0) {
|
|
5568
5542
|
this.doSetActivePanel(this.panels[0]);
|
|
@@ -5654,7 +5628,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5654
5628
|
}
|
|
5655
5629
|
updateContainer() {
|
|
5656
5630
|
var _a, _b;
|
|
5657
|
-
toggleClass(this.container, 'empty', this.isEmpty);
|
|
5631
|
+
toggleClass(this.container, 'dv-empty', this.isEmpty);
|
|
5658
5632
|
this.panels.forEach((panel) => panel.runEvents());
|
|
5659
5633
|
if (this.isEmpty && !this.watermark) {
|
|
5660
5634
|
const watermark = this.accessor.createWatermarkComponent();
|
|
@@ -5795,6 +5769,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5795
5769
|
return this._snap;
|
|
5796
5770
|
}
|
|
5797
5771
|
get minimumWidth() {
|
|
5772
|
+
/**
|
|
5773
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5774
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5775
|
+
*/
|
|
5776
|
+
return this.__minimumWidth();
|
|
5777
|
+
}
|
|
5778
|
+
get minimumHeight() {
|
|
5779
|
+
/**
|
|
5780
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5781
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5782
|
+
*/
|
|
5783
|
+
return this.__minimumHeight();
|
|
5784
|
+
}
|
|
5785
|
+
get maximumHeight() {
|
|
5786
|
+
/**
|
|
5787
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5788
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5789
|
+
*/
|
|
5790
|
+
return this.__maximumHeight();
|
|
5791
|
+
}
|
|
5792
|
+
get maximumWidth() {
|
|
5793
|
+
/**
|
|
5794
|
+
* defer to protected function to allow subclasses to override easily.
|
|
5795
|
+
* see https://github.com/microsoft/TypeScript/issues/338
|
|
5796
|
+
*/
|
|
5797
|
+
return this.__maximumWidth();
|
|
5798
|
+
}
|
|
5799
|
+
__minimumWidth() {
|
|
5798
5800
|
const width = typeof this._minimumWidth === 'function'
|
|
5799
5801
|
? this._minimumWidth()
|
|
5800
5802
|
: this._minimumWidth;
|
|
@@ -5804,7 +5806,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5804
5806
|
}
|
|
5805
5807
|
return width;
|
|
5806
5808
|
}
|
|
5807
|
-
|
|
5809
|
+
__maximumWidth() {
|
|
5810
|
+
const width = typeof this._maximumWidth === 'function'
|
|
5811
|
+
? this._maximumWidth()
|
|
5812
|
+
: this._maximumWidth;
|
|
5813
|
+
if (width !== this._evaluatedMaximumWidth) {
|
|
5814
|
+
this._evaluatedMaximumWidth = width;
|
|
5815
|
+
this.updateConstraints();
|
|
5816
|
+
}
|
|
5817
|
+
return width;
|
|
5818
|
+
}
|
|
5819
|
+
__minimumHeight() {
|
|
5808
5820
|
const height = typeof this._minimumHeight === 'function'
|
|
5809
5821
|
? this._minimumHeight()
|
|
5810
5822
|
: this._minimumHeight;
|
|
@@ -5814,7 +5826,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5814
5826
|
}
|
|
5815
5827
|
return height;
|
|
5816
5828
|
}
|
|
5817
|
-
|
|
5829
|
+
__maximumHeight() {
|
|
5818
5830
|
const height = typeof this._maximumHeight === 'function'
|
|
5819
5831
|
? this._maximumHeight()
|
|
5820
5832
|
: this._maximumHeight;
|
|
@@ -5824,16 +5836,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5824
5836
|
}
|
|
5825
5837
|
return height;
|
|
5826
5838
|
}
|
|
5827
|
-
get maximumWidth() {
|
|
5828
|
-
const width = typeof this._maximumWidth === 'function'
|
|
5829
|
-
? this._maximumWidth()
|
|
5830
|
-
: this._maximumWidth;
|
|
5831
|
-
if (width !== this._evaluatedMaximumWidth) {
|
|
5832
|
-
this._evaluatedMaximumWidth = width;
|
|
5833
|
-
this.updateConstraints();
|
|
5834
|
-
}
|
|
5835
|
-
return width;
|
|
5836
|
-
}
|
|
5837
5839
|
get isActive() {
|
|
5838
5840
|
return this.api.isActive;
|
|
5839
5841
|
}
|
|
@@ -5984,6 +5986,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
5984
5986
|
position: options.group
|
|
5985
5987
|
? (_c = options.position) !== null && _c !== void 0 ? _c : 'center'
|
|
5986
5988
|
: 'center',
|
|
5989
|
+
index: options.index,
|
|
5987
5990
|
},
|
|
5988
5991
|
});
|
|
5989
5992
|
}
|
|
@@ -6035,30 +6038,34 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6035
6038
|
get minimumWidth() {
|
|
6036
6039
|
var _a;
|
|
6037
6040
|
const activePanelMinimumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumWidth;
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
+
if (typeof activePanelMinimumWidth === 'number') {
|
|
6042
|
+
return activePanelMinimumWidth;
|
|
6043
|
+
}
|
|
6044
|
+
return super.__minimumWidth();
|
|
6041
6045
|
}
|
|
6042
6046
|
get minimumHeight() {
|
|
6043
6047
|
var _a;
|
|
6044
6048
|
const activePanelMinimumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.minimumHeight;
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6049
|
+
if (typeof activePanelMinimumHeight === 'number') {
|
|
6050
|
+
return activePanelMinimumHeight;
|
|
6051
|
+
}
|
|
6052
|
+
return super.__minimumHeight();
|
|
6048
6053
|
}
|
|
6049
6054
|
get maximumWidth() {
|
|
6050
6055
|
var _a;
|
|
6051
6056
|
const activePanelMaximumWidth = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumWidth;
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6057
|
+
if (typeof activePanelMaximumWidth === 'number') {
|
|
6058
|
+
return activePanelMaximumWidth;
|
|
6059
|
+
}
|
|
6060
|
+
return super.__maximumWidth();
|
|
6055
6061
|
}
|
|
6056
6062
|
get maximumHeight() {
|
|
6057
6063
|
var _a;
|
|
6058
6064
|
const activePanelMaximumHeight = (_a = this.activePanel) === null || _a === void 0 ? void 0 : _a.maximumHeight;
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6065
|
+
if (typeof activePanelMaximumHeight === 'number') {
|
|
6066
|
+
return activePanelMaximumHeight;
|
|
6067
|
+
}
|
|
6068
|
+
return super.__maximumHeight();
|
|
6062
6069
|
}
|
|
6063
6070
|
get panels() {
|
|
6064
6071
|
return this._model.panels;
|
|
@@ -6172,12 +6179,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6172
6179
|
return this.group.api.getWindow();
|
|
6173
6180
|
}
|
|
6174
6181
|
moveTo(options) {
|
|
6175
|
-
var _a;
|
|
6182
|
+
var _a, _b;
|
|
6176
6183
|
this.accessor.moveGroupOrPanel({
|
|
6177
6184
|
from: { groupId: this._group.id, panelId: this.panel.id },
|
|
6178
6185
|
to: {
|
|
6179
|
-
group: options.group,
|
|
6180
|
-
position:
|
|
6186
|
+
group: (_a = options.group) !== null && _a !== void 0 ? _a : this._group,
|
|
6187
|
+
position: options.group
|
|
6188
|
+
? (_b = options.position) !== null && _b !== void 0 ? _b : 'center'
|
|
6189
|
+
: 'center',
|
|
6181
6190
|
index: options.index,
|
|
6182
6191
|
},
|
|
6183
6192
|
});
|
|
@@ -6396,7 +6405,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6396
6405
|
svg.setAttributeNS(null, 'viewBox', params.viewbox);
|
|
6397
6406
|
svg.setAttributeNS(null, 'aria-hidden', 'false');
|
|
6398
6407
|
svg.setAttributeNS(null, 'focusable', 'false');
|
|
6399
|
-
svg.classList.add('
|
|
6408
|
+
svg.classList.add('dv-svg');
|
|
6400
6409
|
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
6401
6410
|
path.setAttributeNS(null, 'd', params.path);
|
|
6402
6411
|
svg.appendChild(path);
|
|
@@ -6567,19 +6576,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6567
6576
|
constructor() {
|
|
6568
6577
|
super();
|
|
6569
6578
|
this._element = document.createElement('div');
|
|
6570
|
-
this._element.className = 'watermark';
|
|
6579
|
+
this._element.className = 'dv-watermark';
|
|
6571
6580
|
const title = document.createElement('div');
|
|
6572
|
-
title.className = 'watermark-title';
|
|
6581
|
+
title.className = 'dv-watermark-title';
|
|
6573
6582
|
const emptySpace = document.createElement('span');
|
|
6574
6583
|
emptySpace.style.flexGrow = '1';
|
|
6575
6584
|
const content = document.createElement('div');
|
|
6576
|
-
content.className = 'watermark-content';
|
|
6585
|
+
content.className = 'dv-watermark-content';
|
|
6577
6586
|
this._element.appendChild(title);
|
|
6578
6587
|
this._element.appendChild(content);
|
|
6579
6588
|
const actionsContainer = document.createElement('div');
|
|
6580
|
-
actionsContainer.className = 'actions-container';
|
|
6589
|
+
actionsContainer.className = 'dv-actions-container';
|
|
6581
6590
|
const closeAnchor = document.createElement('div');
|
|
6582
|
-
closeAnchor.className = 'close-action';
|
|
6591
|
+
closeAnchor.className = 'dv-close-action';
|
|
6583
6592
|
closeAnchor.appendChild(createCloseButton());
|
|
6584
6593
|
actionsContainer.appendChild(closeAnchor);
|
|
6585
6594
|
title.appendChild(emptySpace);
|
|
@@ -6599,11 +6608,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6599
6608
|
}
|
|
6600
6609
|
render() {
|
|
6601
6610
|
const isOneGroup = !!(this._api && this._api.size <= 1);
|
|
6602
|
-
toggleClass(this.element, 'has-actions', isOneGroup);
|
|
6611
|
+
toggleClass(this.element, 'dv-has-actions', isOneGroup);
|
|
6603
6612
|
}
|
|
6604
6613
|
}
|
|
6605
6614
|
|
|
6606
|
-
const DEFAULT_OVERLAY_Z_INDEX = 999;
|
|
6607
6615
|
class AriaLevelTracker {
|
|
6608
6616
|
constructor() {
|
|
6609
6617
|
this._orderedList = [];
|
|
@@ -6622,7 +6630,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
6622
6630
|
update() {
|
|
6623
6631
|
for (let i = 0; i < this._orderedList.length; i++) {
|
|
6624
6632
|
this._orderedList[i].setAttribute('aria-level', `${i}`);
|
|
6625
|
-
this._orderedList[i].style.zIndex =
|
|
6633
|
+
this._orderedList[i].style.zIndex = `calc(var(--dv-overlay-z-index, 999) + ${i * 2})`;
|
|
6626
6634
|
}
|
|
6627
6635
|
}
|
|
6628
6636
|
}
|
|
@@ -7079,7 +7087,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7079
7087
|
const element = floatingGroup.overlay.element;
|
|
7080
7088
|
const update = () => {
|
|
7081
7089
|
const level = Number(element.getAttribute('aria-level'));
|
|
7082
|
-
focusContainer.style.zIndex =
|
|
7090
|
+
focusContainer.style.zIndex = `calc(var(--dv-overlay-z-index, 999) + ${level * 2 + 1})`;
|
|
7083
7091
|
};
|
|
7084
7092
|
const observer = new MutationObserver(() => {
|
|
7085
7093
|
update();
|
|
@@ -7211,7 +7219,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7211
7219
|
window: this._window.value,
|
|
7212
7220
|
});
|
|
7213
7221
|
this._window.disposable.dispose();
|
|
7214
|
-
this._window.value.close();
|
|
7215
7222
|
this._window = null;
|
|
7216
7223
|
this._onDidClose.fire();
|
|
7217
7224
|
}
|
|
@@ -7243,7 +7250,9 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7243
7250
|
}
|
|
7244
7251
|
const disposable = new CompositeDisposable();
|
|
7245
7252
|
this._window = { value: externalWindow, disposable };
|
|
7246
|
-
disposable.addDisposables(
|
|
7253
|
+
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7254
|
+
externalWindow.close();
|
|
7255
|
+
}), addDisposableWindowListener(window, 'beforeunload', () => {
|
|
7247
7256
|
/**
|
|
7248
7257
|
* before the main window closes we should close this popup too
|
|
7249
7258
|
* to be good citizens
|
|
@@ -7260,7 +7269,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7260
7269
|
id: this.target,
|
|
7261
7270
|
window: externalWindow,
|
|
7262
7271
|
});
|
|
7263
|
-
return new Promise((resolve) => {
|
|
7272
|
+
return new Promise((resolve, reject) => {
|
|
7264
7273
|
externalWindow.addEventListener('unload', (e) => {
|
|
7265
7274
|
// if page fails to load before unloading
|
|
7266
7275
|
// this.close();
|
|
@@ -7269,21 +7278,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7269
7278
|
/**
|
|
7270
7279
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
7271
7280
|
*/
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
* beforeunload must be registered after load for reasons I could not determine
|
|
7278
|
-
* otherwise the beforeunload event will not fire when the window is closed
|
|
7279
|
-
*/
|
|
7280
|
-
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7281
|
+
try {
|
|
7282
|
+
const externalDocument = externalWindow.document;
|
|
7283
|
+
externalDocument.title = document.title;
|
|
7284
|
+
externalDocument.body.appendChild(container);
|
|
7285
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
7281
7286
|
/**
|
|
7282
|
-
*
|
|
7287
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
7288
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
7283
7289
|
*/
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7290
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7291
|
+
/**
|
|
7292
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7293
|
+
*/
|
|
7294
|
+
this.close();
|
|
7295
|
+
});
|
|
7296
|
+
resolve(container);
|
|
7297
|
+
}
|
|
7298
|
+
catch (err) {
|
|
7299
|
+
// only except this is the DOM isn't setup. e.g. in a in correctly configured test
|
|
7300
|
+
reject(err);
|
|
7301
|
+
}
|
|
7287
7302
|
});
|
|
7288
7303
|
});
|
|
7289
7304
|
});
|
|
@@ -7536,9 +7551,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7536
7551
|
}
|
|
7537
7552
|
const box = getBox();
|
|
7538
7553
|
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();
|
|
7539
|
-
if (itemToPopout.api.location.type === 'grid') {
|
|
7540
|
-
itemToPopout.api.setVisible(false);
|
|
7541
|
-
}
|
|
7542
7554
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7543
7555
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
7544
7556
|
url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
|
|
@@ -7557,11 +7569,11 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7557
7569
|
.then((popoutContainer) => {
|
|
7558
7570
|
var _a;
|
|
7559
7571
|
if (_window.isDisposed) {
|
|
7560
|
-
return;
|
|
7572
|
+
return false;
|
|
7561
7573
|
}
|
|
7562
7574
|
if (popoutContainer === null) {
|
|
7563
7575
|
popoutWindowDisposable.dispose();
|
|
7564
|
-
return;
|
|
7576
|
+
return false;
|
|
7565
7577
|
}
|
|
7566
7578
|
const gready = document.createElement('div');
|
|
7567
7579
|
gready.className = 'dv-overlay-render-container';
|
|
@@ -7570,30 +7582,40 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7570
7582
|
? itemToPopout.group
|
|
7571
7583
|
: itemToPopout;
|
|
7572
7584
|
const referenceLocation = itemToPopout.api.location.type;
|
|
7573
|
-
|
|
7585
|
+
/**
|
|
7586
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurance
|
|
7587
|
+
* of this case is when being called from the `fromJSON(...)` method
|
|
7588
|
+
*/
|
|
7589
|
+
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
7590
|
+
const group = !isGroupAddedToDom
|
|
7591
|
+
? referenceGroup
|
|
7592
|
+
: (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
|
|
7574
7593
|
group.model.renderContainer = overlayRenderContainer;
|
|
7575
|
-
|
|
7594
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7595
|
+
if (!this._groups.has(group.api.id)) {
|
|
7576
7596
|
this._onDidAddGroup.fire(group);
|
|
7577
7597
|
}
|
|
7578
|
-
if (
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7598
|
+
if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup) && isGroupAddedToDom) {
|
|
7599
|
+
if (itemToPopout instanceof DockviewPanel) {
|
|
7600
|
+
this.movingLock(() => {
|
|
7601
|
+
const panel = referenceGroup.model.removePanel(itemToPopout);
|
|
7602
|
+
group.model.openPanel(panel);
|
|
7603
|
+
});
|
|
7604
|
+
}
|
|
7605
|
+
else {
|
|
7606
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7607
|
+
from: referenceGroup,
|
|
7608
|
+
to: group,
|
|
7609
|
+
}));
|
|
7610
|
+
switch (referenceLocation) {
|
|
7611
|
+
case 'grid':
|
|
7612
|
+
referenceGroup.api.setVisible(false);
|
|
7613
|
+
break;
|
|
7614
|
+
case 'floating':
|
|
7615
|
+
case 'popout':
|
|
7616
|
+
this.removeGroup(referenceGroup);
|
|
7617
|
+
break;
|
|
7618
|
+
}
|
|
7597
7619
|
}
|
|
7598
7620
|
}
|
|
7599
7621
|
popoutContainer.classList.add('dv-dockview');
|
|
@@ -7604,6 +7626,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7604
7626
|
type: 'popout',
|
|
7605
7627
|
getWindow: () => _window.window,
|
|
7606
7628
|
};
|
|
7629
|
+
if (isGroupAddedToDom &&
|
|
7630
|
+
itemToPopout.api.location.type === 'grid') {
|
|
7631
|
+
itemToPopout.api.setVisible(false);
|
|
7632
|
+
}
|
|
7607
7633
|
this.doSetGroupAndPanelActive(group);
|
|
7608
7634
|
popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
|
|
7609
7635
|
var _a;
|
|
@@ -7618,9 +7644,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7618
7644
|
const value = {
|
|
7619
7645
|
window: _window,
|
|
7620
7646
|
popoutGroup: group,
|
|
7621
|
-
referenceGroup:
|
|
7622
|
-
?
|
|
7623
|
-
:
|
|
7647
|
+
referenceGroup: !isGroupAddedToDom
|
|
7648
|
+
? undefined
|
|
7649
|
+
: referenceGroup
|
|
7650
|
+
? this.getPanel(referenceGroup.id)
|
|
7651
|
+
? referenceGroup.id
|
|
7652
|
+
: undefined
|
|
7653
|
+
: undefined,
|
|
7624
7654
|
disposable: {
|
|
7625
7655
|
dispose: () => {
|
|
7626
7656
|
popoutWindowDisposable.dispose();
|
|
@@ -7635,9 +7665,10 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7635
7665
|
* window dimensions
|
|
7636
7666
|
*/
|
|
7637
7667
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7638
|
-
group.layout(window.innerWidth, window.innerHeight);
|
|
7668
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7639
7669
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7640
|
-
if (
|
|
7670
|
+
if (isGroupAddedToDom &&
|
|
7671
|
+
this.getPanel(referenceGroup.id)) {
|
|
7641
7672
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7642
7673
|
from: group,
|
|
7643
7674
|
to: referenceGroup,
|
|
@@ -7652,21 +7683,27 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7652
7683
|
}
|
|
7653
7684
|
}
|
|
7654
7685
|
else if (this.getPanel(group.id)) {
|
|
7655
|
-
|
|
7686
|
+
this.doRemoveGroup(group, {
|
|
7656
7687
|
skipDispose: true,
|
|
7657
7688
|
skipActive: true,
|
|
7689
|
+
skipPopoutReturn: true,
|
|
7658
7690
|
});
|
|
7691
|
+
const removedGroup = group;
|
|
7659
7692
|
removedGroup.model.renderContainer =
|
|
7660
7693
|
this.overlayRenderContainer;
|
|
7661
7694
|
removedGroup.model.location = { type: 'grid' };
|
|
7662
7695
|
returnedGroup = removedGroup;
|
|
7696
|
+
this.doAddGroup(removedGroup, [0]);
|
|
7697
|
+
this.doSetGroupAndPanelActive(removedGroup);
|
|
7663
7698
|
}
|
|
7664
7699
|
}));
|
|
7665
7700
|
this._popoutGroups.push(value);
|
|
7666
7701
|
this.updateWatermark();
|
|
7702
|
+
return true;
|
|
7667
7703
|
})
|
|
7668
7704
|
.catch((err) => {
|
|
7669
7705
|
console.error('dockview: failed to create popout window', err);
|
|
7706
|
+
return false;
|
|
7670
7707
|
});
|
|
7671
7708
|
}
|
|
7672
7709
|
addFloatingGroup(item, options) {
|
|
@@ -7770,7 +7807,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
7770
7807
|
: (_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'
|
|
7771
7808
|
? undefined
|
|
7772
7809
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
7773
|
-
const el = group.element.querySelector('.void-container');
|
|
7810
|
+
const el = group.element.querySelector('.dv-void-container');
|
|
7774
7811
|
if (!el) {
|
|
7775
7812
|
throw new Error('failed to find drag handle');
|
|
7776
7813
|
}
|
|
@@ -8053,7 +8090,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8053
8090
|
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
8054
8091
|
? this.getPanel(gridReferenceGroup)
|
|
8055
8092
|
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
8056
|
-
skipRemoveGroup: true,
|
|
8057
8093
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
8058
8094
|
overridePopoutGroup: gridReferenceGroup
|
|
8059
8095
|
? group
|
|
@@ -8071,6 +8107,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8071
8107
|
}
|
|
8072
8108
|
}
|
|
8073
8109
|
catch (err) {
|
|
8110
|
+
console.error('dockview: failed to deserialize layout. Reverting changes', err);
|
|
8074
8111
|
/**
|
|
8075
8112
|
* Takes all the successfully created groups and remove all of their panels.
|
|
8076
8113
|
*/
|
|
@@ -8138,11 +8175,13 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8138
8175
|
width: options.initialWidth,
|
|
8139
8176
|
height: options.initialHeight,
|
|
8140
8177
|
};
|
|
8178
|
+
let index;
|
|
8141
8179
|
if (options.position) {
|
|
8142
8180
|
if (isPanelOptionsWithPanel(options.position)) {
|
|
8143
8181
|
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
8144
8182
|
? this.getGroupPanel(options.position.referencePanel)
|
|
8145
8183
|
: options.position.referencePanel;
|
|
8184
|
+
index = options.position.index;
|
|
8146
8185
|
if (!referencePanel) {
|
|
8147
8186
|
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
8148
8187
|
}
|
|
@@ -8153,6 +8192,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8153
8192
|
typeof options.position.referenceGroup === 'string'
|
|
8154
8193
|
? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
8155
8194
|
: options.position.referenceGroup;
|
|
8195
|
+
index = options.position.index;
|
|
8156
8196
|
if (!referenceGroup) {
|
|
8157
8197
|
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
8158
8198
|
}
|
|
@@ -8163,6 +8203,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8163
8203
|
group.model.openPanel(panel, {
|
|
8164
8204
|
skipSetActive: options.inactive,
|
|
8165
8205
|
skipSetGroupActive: options.inactive,
|
|
8206
|
+
index,
|
|
8166
8207
|
});
|
|
8167
8208
|
if (!options.inactive) {
|
|
8168
8209
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8192,6 +8233,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8192
8233
|
group.model.openPanel(panel, {
|
|
8193
8234
|
skipSetActive: options.inactive,
|
|
8194
8235
|
skipSetGroupActive: options.inactive,
|
|
8236
|
+
index,
|
|
8195
8237
|
});
|
|
8196
8238
|
}
|
|
8197
8239
|
else if (referenceGroup.api.location.type === 'floating' ||
|
|
@@ -8200,6 +8242,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8200
8242
|
referenceGroup.model.openPanel(panel, {
|
|
8201
8243
|
skipSetActive: options.inactive,
|
|
8202
8244
|
skipSetGroupActive: options.inactive,
|
|
8245
|
+
index,
|
|
8203
8246
|
});
|
|
8204
8247
|
referenceGroup.api.setSize({
|
|
8205
8248
|
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
@@ -8220,6 +8263,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8220
8263
|
group.model.openPanel(panel, {
|
|
8221
8264
|
skipSetActive: options.inactive,
|
|
8222
8265
|
skipSetGroupActive: options.inactive,
|
|
8266
|
+
index,
|
|
8223
8267
|
});
|
|
8224
8268
|
if (!options.inactive) {
|
|
8225
8269
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8238,6 +8282,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8238
8282
|
group.model.openPanel(panel, {
|
|
8239
8283
|
skipSetActive: options.inactive,
|
|
8240
8284
|
skipSetGroupActive: options.inactive,
|
|
8285
|
+
index,
|
|
8241
8286
|
});
|
|
8242
8287
|
}
|
|
8243
8288
|
else {
|
|
@@ -8248,6 +8293,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8248
8293
|
group.model.openPanel(panel, {
|
|
8249
8294
|
skipSetActive: options.inactive,
|
|
8250
8295
|
skipSetGroupActive: options.inactive,
|
|
8296
|
+
index,
|
|
8251
8297
|
});
|
|
8252
8298
|
if (!options.inactive) {
|
|
8253
8299
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8788,6 +8834,31 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
8788
8834
|
}
|
|
8789
8835
|
}
|
|
8790
8836
|
|
|
8837
|
+
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8838
|
+
const Component = typeof componentName === 'string'
|
|
8839
|
+
? components[componentName]
|
|
8840
|
+
: undefined;
|
|
8841
|
+
const FrameworkComponent = typeof componentName === 'string'
|
|
8842
|
+
? frameworkComponents[componentName]
|
|
8843
|
+
: undefined;
|
|
8844
|
+
if (Component && FrameworkComponent) {
|
|
8845
|
+
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
8846
|
+
}
|
|
8847
|
+
if (FrameworkComponent) {
|
|
8848
|
+
if (!createFrameworkComponent) {
|
|
8849
|
+
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
8850
|
+
}
|
|
8851
|
+
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
8852
|
+
}
|
|
8853
|
+
if (!Component) {
|
|
8854
|
+
if (fallback) {
|
|
8855
|
+
return fallback();
|
|
8856
|
+
}
|
|
8857
|
+
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
8858
|
+
}
|
|
8859
|
+
return new Component(id, componentName);
|
|
8860
|
+
}
|
|
8861
|
+
|
|
8791
8862
|
class GridviewComponent extends BaseGrid {
|
|
8792
8863
|
get orientation() {
|
|
8793
8864
|
return this.gridview.orientation;
|
|
@@ -9336,12 +9407,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
9336
9407
|
this._expandedIcon = createExpandMoreButton();
|
|
9337
9408
|
this._collapsedIcon = createChevronRightButton();
|
|
9338
9409
|
this.disposable = new MutableDisposable();
|
|
9339
|
-
this.apiRef = {
|
|
9410
|
+
this.apiRef = {
|
|
9411
|
+
api: null,
|
|
9412
|
+
};
|
|
9340
9413
|
this._element = document.createElement('div');
|
|
9341
|
-
this.element.className = 'default-header';
|
|
9414
|
+
this.element.className = 'dv-default-header';
|
|
9342
9415
|
this._content = document.createElement('span');
|
|
9343
9416
|
this._expander = document.createElement('div');
|
|
9344
|
-
this._expander.className = '
|
|
9417
|
+
this._expander.className = 'dv-pane-header-icon';
|
|
9345
9418
|
this.element.appendChild(this._expander);
|
|
9346
9419
|
this.element.appendChild(this._content);
|
|
9347
9420
|
this.addDisposables(addDisposableListener(this._element, 'click', () => {
|
|
@@ -10198,22 +10271,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10198
10271
|
disposable.dispose();
|
|
10199
10272
|
};
|
|
10200
10273
|
}, [props.onDidDrop]);
|
|
10201
|
-
React.useEffect(() => {
|
|
10202
|
-
if (!dockviewRef.current) {
|
|
10203
|
-
return () => {
|
|
10204
|
-
// noop
|
|
10205
|
-
};
|
|
10206
|
-
}
|
|
10207
|
-
const disposable = dockviewRef.current.onUnhandledDragOverEvent((event) => {
|
|
10208
|
-
var _a;
|
|
10209
|
-
if ((_a = props.showDndOverlay) === null || _a === void 0 ? void 0 : _a.call(props, event)) {
|
|
10210
|
-
event.accept();
|
|
10211
|
-
}
|
|
10212
|
-
});
|
|
10213
|
-
return () => {
|
|
10214
|
-
disposable.dispose();
|
|
10215
|
-
};
|
|
10216
|
-
}, [props.showDndOverlay]);
|
|
10217
10274
|
React.useEffect(() => {
|
|
10218
10275
|
if (!dockviewRef.current) {
|
|
10219
10276
|
return () => {
|
|
@@ -10631,7 +10688,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10631
10688
|
exports.GridviewComponent = GridviewComponent;
|
|
10632
10689
|
exports.GridviewPanel = GridviewPanel;
|
|
10633
10690
|
exports.GridviewReact = GridviewReact;
|
|
10634
|
-
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
10635
10691
|
exports.PROPERTY_KEYS = PROPERTY_KEYS;
|
|
10636
10692
|
exports.PaneFramework = PaneFramework;
|
|
10637
10693
|
exports.PaneTransfer = PaneTransfer;
|
|
@@ -10650,7 +10706,6 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
|
|
|
10650
10706
|
exports.SplitviewReact = SplitviewReact;
|
|
10651
10707
|
exports.Tab = Tab;
|
|
10652
10708
|
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
10653
|
-
exports.createComponent = createComponent;
|
|
10654
10709
|
exports.createDockview = createDockview;
|
|
10655
10710
|
exports.createGridview = createGridview;
|
|
10656
10711
|
exports.createPaneview = createPaneview;
|