dockview-core 1.17.2 → 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/cjs/api/component.api.d.ts +1 -1
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +10 -8
- package/dist/cjs/api/dockviewGroupPanelApi.js +1 -0
- package/dist/cjs/api/dockviewPanelApi.d.ts +6 -14
- package/dist/cjs/api/dockviewPanelApi.js +5 -3
- package/dist/cjs/dnd/abstractDragHandler.js +1 -1
- package/dist/cjs/dnd/dnd.d.ts +2 -2
- package/dist/cjs/dnd/droptarget.js +4 -4
- package/dist/cjs/dockview/components/panel/content.d.ts +2 -2
- package/dist/cjs/dockview/components/panel/content.js +3 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +3 -3
- package/dist/cjs/dockview/components/tab/tab.js +4 -4
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +5 -9
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +1 -1
- package/dist/cjs/dockview/components/watermark/watermark.js +6 -6
- package/dist/cjs/dockview/dockviewComponent.d.ts +2 -3
- package/dist/cjs/dockview/dockviewComponent.js +66 -35
- package/dist/cjs/dockview/dockviewGroupPanel.js +16 -12
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +3 -3
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +7 -7
- package/dist/cjs/dockview/dockviewPanel.d.ts +4 -4
- package/dist/cjs/dockview/dockviewPanelModel.d.ts +1 -1
- package/dist/cjs/dockview/options.d.ts +8 -0
- package/dist/cjs/dom.d.ts +11 -1
- package/dist/cjs/dom.js +19 -1
- package/dist/cjs/gridview/basePanelView.d.ts +1 -1
- package/dist/cjs/gridview/branchNode.d.ts +1 -1
- package/dist/cjs/gridview/branchNode.js +1 -1
- package/dist/cjs/gridview/gridview.js +2 -2
- package/dist/cjs/gridview/gridviewPanel.d.ts +4 -0
- package/dist/cjs/gridview/gridviewPanel.js +60 -32
- package/dist/cjs/gridview/leafNode.d.ts +1 -1
- package/dist/cjs/index.d.ts +8 -9
- package/dist/cjs/index.js +14 -7
- package/dist/cjs/overlay/overlay.d.ts +3 -3
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +1 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js +5 -3
- package/dist/cjs/paneview/paneview.d.ts +3 -3
- package/dist/cjs/paneview/paneview.js +3 -3
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -2
- package/dist/cjs/paneview/paneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/paneviewPanel.js +3 -3
- package/dist/cjs/popoutWindow.js +23 -16
- package/dist/cjs/splitview/splitview.d.ts +6 -6
- package/dist/cjs/splitview/splitview.js +18 -17
- package/dist/cjs/splitview/splitviewComponent.d.ts +2 -2
- package/dist/cjs/splitview/viewItem.d.ts +1 -1
- package/dist/cjs/svg.js +1 -1
- package/dist/dockview-core.amd.js +241 -169
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +240 -168
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +241 -169
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +242 -168
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +241 -169
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +240 -168
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +1 -1
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +10 -8
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -0
- package/dist/esm/api/dockviewPanelApi.d.ts +6 -14
- package/dist/esm/api/dockviewPanelApi.js +5 -3
- package/dist/esm/dnd/abstractDragHandler.js +1 -1
- package/dist/esm/dnd/dnd.d.ts +2 -2
- package/dist/esm/dnd/droptarget.js +4 -4
- package/dist/esm/dockview/components/panel/content.d.ts +2 -2
- package/dist/esm/dockview/components/panel/content.js +4 -2
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +3 -3
- package/dist/esm/dockview/components/tab/tab.js +4 -4
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +5 -9
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -1
- package/dist/esm/dockview/components/watermark/watermark.d.ts +1 -1
- package/dist/esm/dockview/components/watermark/watermark.js +6 -6
- package/dist/esm/dockview/dockviewComponent.d.ts +2 -3
- package/dist/esm/dockview/dockviewComponent.js +65 -34
- package/dist/esm/dockview/dockviewGroupPanel.js +16 -12
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +3 -3
- package/dist/esm/dockview/dockviewGroupPanelModel.js +7 -7
- package/dist/esm/dockview/dockviewPanel.d.ts +4 -4
- package/dist/esm/dockview/dockviewPanelModel.d.ts +1 -1
- package/dist/esm/dockview/options.d.ts +8 -0
- package/dist/esm/dom.d.ts +11 -1
- package/dist/esm/dom.js +14 -0
- package/dist/esm/gridview/basePanelView.d.ts +1 -1
- package/dist/esm/gridview/branchNode.d.ts +1 -1
- package/dist/esm/gridview/branchNode.js +1 -1
- package/dist/esm/gridview/gridview.js +2 -2
- package/dist/esm/gridview/gridviewPanel.d.ts +4 -0
- package/dist/esm/gridview/gridviewPanel.js +40 -12
- package/dist/esm/gridview/leafNode.d.ts +1 -1
- package/dist/esm/index.d.ts +8 -9
- package/dist/esm/index.js +5 -6
- package/dist/esm/overlay/overlay.d.ts +3 -3
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.js +5 -3
- package/dist/esm/paneview/paneview.d.ts +3 -3
- package/dist/esm/paneview/paneview.js +3 -3
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -2
- package/dist/esm/paneview/paneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/paneviewPanel.js +3 -3
- package/dist/esm/popoutWindow.js +24 -17
- package/dist/esm/splitview/splitview.d.ts +6 -6
- package/dist/esm/splitview/splitview.js +18 -17
- package/dist/esm/splitview/splitviewComponent.d.ts +2 -2
- package/dist/esm/splitview/viewItem.d.ts +1 -1
- package/dist/esm/svg.js +1 -1
- package/dist/styles/dockview.css +114 -125
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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'], (function (exports) { 'use strict';
|
|
|
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,7 +6608,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
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
|
|
|
@@ -7233,7 +7242,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7233
7242
|
window: this._window.value,
|
|
7234
7243
|
});
|
|
7235
7244
|
this._window.disposable.dispose();
|
|
7236
|
-
this._window.value.close();
|
|
7237
7245
|
this._window = null;
|
|
7238
7246
|
this._onDidClose.fire();
|
|
7239
7247
|
}
|
|
@@ -7265,7 +7273,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7265
7273
|
}
|
|
7266
7274
|
const disposable = new CompositeDisposable();
|
|
7267
7275
|
this._window = { value: externalWindow, disposable };
|
|
7268
|
-
disposable.addDisposables(
|
|
7276
|
+
disposable.addDisposables(exports.DockviewDisposable.from(() => {
|
|
7277
|
+
externalWindow.close();
|
|
7278
|
+
}), addDisposableWindowListener(window, 'beforeunload', () => {
|
|
7269
7279
|
/**
|
|
7270
7280
|
* before the main window closes we should close this popup too
|
|
7271
7281
|
* to be good citizens
|
|
@@ -7282,7 +7292,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7282
7292
|
id: this.target,
|
|
7283
7293
|
window: externalWindow,
|
|
7284
7294
|
});
|
|
7285
|
-
return new Promise((resolve) => {
|
|
7295
|
+
return new Promise((resolve, reject) => {
|
|
7286
7296
|
externalWindow.addEventListener('unload', (e) => {
|
|
7287
7297
|
// if page fails to load before unloading
|
|
7288
7298
|
// this.close();
|
|
@@ -7291,21 +7301,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7291
7301
|
/**
|
|
7292
7302
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
7293
7303
|
*/
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
* beforeunload must be registered after load for reasons I could not determine
|
|
7300
|
-
* otherwise the beforeunload event will not fire when the window is closed
|
|
7301
|
-
*/
|
|
7302
|
-
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7304
|
+
try {
|
|
7305
|
+
const externalDocument = externalWindow.document;
|
|
7306
|
+
externalDocument.title = document.title;
|
|
7307
|
+
externalDocument.body.appendChild(container);
|
|
7308
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
7303
7309
|
/**
|
|
7304
|
-
*
|
|
7310
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
7311
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
7305
7312
|
*/
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
7313
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
7314
|
+
/**
|
|
7315
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
7316
|
+
*/
|
|
7317
|
+
this.close();
|
|
7318
|
+
});
|
|
7319
|
+
resolve(container);
|
|
7320
|
+
}
|
|
7321
|
+
catch (err) {
|
|
7322
|
+
// only except this is the DOM isn't setup. e.g. in a in correctly configured test
|
|
7323
|
+
reject(err);
|
|
7324
|
+
}
|
|
7309
7325
|
});
|
|
7310
7326
|
});
|
|
7311
7327
|
});
|
|
@@ -7558,9 +7574,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7558
7574
|
}
|
|
7559
7575
|
const box = getBox();
|
|
7560
7576
|
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();
|
|
7561
|
-
if (itemToPopout.api.location.type === 'grid') {
|
|
7562
|
-
itemToPopout.api.setVisible(false);
|
|
7563
|
-
}
|
|
7564
7577
|
const _window = new PopoutWindow(`${this.id}-${groupId}`, // unique id
|
|
7565
7578
|
theme !== null && theme !== void 0 ? theme : '', {
|
|
7566
7579
|
url: (_c = options === null || options === void 0 ? void 0 : options.popoutUrl) !== null && _c !== void 0 ? _c : '/popout.html',
|
|
@@ -7579,11 +7592,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7579
7592
|
.then((popoutContainer) => {
|
|
7580
7593
|
var _a;
|
|
7581
7594
|
if (_window.isDisposed) {
|
|
7582
|
-
return;
|
|
7595
|
+
return false;
|
|
7583
7596
|
}
|
|
7584
7597
|
if (popoutContainer === null) {
|
|
7585
7598
|
popoutWindowDisposable.dispose();
|
|
7586
|
-
return;
|
|
7599
|
+
return false;
|
|
7587
7600
|
}
|
|
7588
7601
|
const gready = document.createElement('div');
|
|
7589
7602
|
gready.className = 'dv-overlay-render-container';
|
|
@@ -7592,30 +7605,40 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7592
7605
|
? itemToPopout.group
|
|
7593
7606
|
: itemToPopout;
|
|
7594
7607
|
const referenceLocation = itemToPopout.api.location.type;
|
|
7595
|
-
|
|
7608
|
+
/**
|
|
7609
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurance
|
|
7610
|
+
* of this case is when being called from the `fromJSON(...)` method
|
|
7611
|
+
*/
|
|
7612
|
+
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
7613
|
+
const group = !isGroupAddedToDom
|
|
7614
|
+
? referenceGroup
|
|
7615
|
+
: (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) !== null && _a !== void 0 ? _a : this.createGroup({ id: groupId });
|
|
7596
7616
|
group.model.renderContainer = overlayRenderContainer;
|
|
7597
|
-
|
|
7617
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7618
|
+
if (!this._groups.has(group.api.id)) {
|
|
7598
7619
|
this._onDidAddGroup.fire(group);
|
|
7599
7620
|
}
|
|
7600
|
-
if (
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7621
|
+
if (!(options === null || options === void 0 ? void 0 : options.overridePopoutGroup) && isGroupAddedToDom) {
|
|
7622
|
+
if (itemToPopout instanceof DockviewPanel) {
|
|
7623
|
+
this.movingLock(() => {
|
|
7624
|
+
const panel = referenceGroup.model.removePanel(itemToPopout);
|
|
7625
|
+
group.model.openPanel(panel);
|
|
7626
|
+
});
|
|
7627
|
+
}
|
|
7628
|
+
else {
|
|
7629
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7630
|
+
from: referenceGroup,
|
|
7631
|
+
to: group,
|
|
7632
|
+
}));
|
|
7633
|
+
switch (referenceLocation) {
|
|
7634
|
+
case 'grid':
|
|
7635
|
+
referenceGroup.api.setVisible(false);
|
|
7636
|
+
break;
|
|
7637
|
+
case 'floating':
|
|
7638
|
+
case 'popout':
|
|
7639
|
+
this.removeGroup(referenceGroup);
|
|
7640
|
+
break;
|
|
7641
|
+
}
|
|
7619
7642
|
}
|
|
7620
7643
|
}
|
|
7621
7644
|
popoutContainer.classList.add('dv-dockview');
|
|
@@ -7626,6 +7649,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7626
7649
|
type: 'popout',
|
|
7627
7650
|
getWindow: () => _window.window,
|
|
7628
7651
|
};
|
|
7652
|
+
if (isGroupAddedToDom &&
|
|
7653
|
+
itemToPopout.api.location.type === 'grid') {
|
|
7654
|
+
itemToPopout.api.setVisible(false);
|
|
7655
|
+
}
|
|
7629
7656
|
this.doSetGroupAndPanelActive(group);
|
|
7630
7657
|
popoutWindowDisposable.addDisposables(group.api.onDidActiveChange((event) => {
|
|
7631
7658
|
var _a;
|
|
@@ -7640,9 +7667,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7640
7667
|
const value = {
|
|
7641
7668
|
window: _window,
|
|
7642
7669
|
popoutGroup: group,
|
|
7643
|
-
referenceGroup:
|
|
7644
|
-
?
|
|
7645
|
-
:
|
|
7670
|
+
referenceGroup: !isGroupAddedToDom
|
|
7671
|
+
? undefined
|
|
7672
|
+
: referenceGroup
|
|
7673
|
+
? this.getPanel(referenceGroup.id)
|
|
7674
|
+
? referenceGroup.id
|
|
7675
|
+
: undefined
|
|
7676
|
+
: undefined,
|
|
7646
7677
|
disposable: {
|
|
7647
7678
|
dispose: () => {
|
|
7648
7679
|
popoutWindowDisposable.dispose();
|
|
@@ -7657,9 +7688,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7657
7688
|
* window dimensions
|
|
7658
7689
|
*/
|
|
7659
7690
|
addDisposableWindowListener(_window.window, 'resize', () => {
|
|
7660
|
-
group.layout(window.innerWidth, window.innerHeight);
|
|
7691
|
+
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
7661
7692
|
}), overlayRenderContainer, exports.DockviewDisposable.from(() => {
|
|
7662
|
-
if (
|
|
7693
|
+
if (isGroupAddedToDom &&
|
|
7694
|
+
this.getPanel(referenceGroup.id)) {
|
|
7663
7695
|
this.movingLock(() => moveGroupWithoutDestroying({
|
|
7664
7696
|
from: group,
|
|
7665
7697
|
to: referenceGroup,
|
|
@@ -7674,21 +7706,27 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7674
7706
|
}
|
|
7675
7707
|
}
|
|
7676
7708
|
else if (this.getPanel(group.id)) {
|
|
7677
|
-
|
|
7709
|
+
this.doRemoveGroup(group, {
|
|
7678
7710
|
skipDispose: true,
|
|
7679
7711
|
skipActive: true,
|
|
7712
|
+
skipPopoutReturn: true,
|
|
7680
7713
|
});
|
|
7714
|
+
const removedGroup = group;
|
|
7681
7715
|
removedGroup.model.renderContainer =
|
|
7682
7716
|
this.overlayRenderContainer;
|
|
7683
7717
|
removedGroup.model.location = { type: 'grid' };
|
|
7684
7718
|
returnedGroup = removedGroup;
|
|
7719
|
+
this.doAddGroup(removedGroup, [0]);
|
|
7720
|
+
this.doSetGroupAndPanelActive(removedGroup);
|
|
7685
7721
|
}
|
|
7686
7722
|
}));
|
|
7687
7723
|
this._popoutGroups.push(value);
|
|
7688
7724
|
this.updateWatermark();
|
|
7725
|
+
return true;
|
|
7689
7726
|
})
|
|
7690
7727
|
.catch((err) => {
|
|
7691
7728
|
console.error('dockview: failed to create popout window', err);
|
|
7729
|
+
return false;
|
|
7692
7730
|
});
|
|
7693
7731
|
}
|
|
7694
7732
|
addFloatingGroup(item, options) {
|
|
@@ -7792,7 +7830,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
7792
7830
|
: (_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'
|
|
7793
7831
|
? undefined
|
|
7794
7832
|
: (_e = (_d = this.options.floatingGroupBounds) === null || _d === void 0 ? void 0 : _d.minimumHeightWithinViewport) !== null && _e !== void 0 ? _e : DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE }));
|
|
7795
|
-
const el = group.element.querySelector('.void-container');
|
|
7833
|
+
const el = group.element.querySelector('.dv-void-container');
|
|
7796
7834
|
if (!el) {
|
|
7797
7835
|
throw new Error('failed to find drag handle');
|
|
7798
7836
|
}
|
|
@@ -8075,7 +8113,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8075
8113
|
this.addPopoutGroup((_c = (gridReferenceGroup
|
|
8076
8114
|
? this.getPanel(gridReferenceGroup)
|
|
8077
8115
|
: undefined)) !== null && _c !== void 0 ? _c : group, {
|
|
8078
|
-
skipRemoveGroup: true,
|
|
8079
8116
|
position: position !== null && position !== void 0 ? position : undefined,
|
|
8080
8117
|
overridePopoutGroup: gridReferenceGroup
|
|
8081
8118
|
? group
|
|
@@ -8093,6 +8130,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8093
8130
|
}
|
|
8094
8131
|
}
|
|
8095
8132
|
catch (err) {
|
|
8133
|
+
console.error('dockview: failed to deserialize layout. Reverting changes', err);
|
|
8096
8134
|
/**
|
|
8097
8135
|
* Takes all the successfully created groups and remove all of their panels.
|
|
8098
8136
|
*/
|
|
@@ -8160,11 +8198,13 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8160
8198
|
width: options.initialWidth,
|
|
8161
8199
|
height: options.initialHeight,
|
|
8162
8200
|
};
|
|
8201
|
+
let index;
|
|
8163
8202
|
if (options.position) {
|
|
8164
8203
|
if (isPanelOptionsWithPanel(options.position)) {
|
|
8165
8204
|
const referencePanel = typeof options.position.referencePanel === 'string'
|
|
8166
8205
|
? this.getGroupPanel(options.position.referencePanel)
|
|
8167
8206
|
: options.position.referencePanel;
|
|
8207
|
+
index = options.position.index;
|
|
8168
8208
|
if (!referencePanel) {
|
|
8169
8209
|
throw new Error(`referencePanel '${options.position.referencePanel}' does not exist`);
|
|
8170
8210
|
}
|
|
@@ -8175,6 +8215,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8175
8215
|
typeof options.position.referenceGroup === 'string'
|
|
8176
8216
|
? (_a = this._groups.get(options.position.referenceGroup)) === null || _a === void 0 ? void 0 : _a.value
|
|
8177
8217
|
: options.position.referenceGroup;
|
|
8218
|
+
index = options.position.index;
|
|
8178
8219
|
if (!referenceGroup) {
|
|
8179
8220
|
throw new Error(`referenceGroup '${options.position.referenceGroup}' does not exist`);
|
|
8180
8221
|
}
|
|
@@ -8185,6 +8226,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8185
8226
|
group.model.openPanel(panel, {
|
|
8186
8227
|
skipSetActive: options.inactive,
|
|
8187
8228
|
skipSetGroupActive: options.inactive,
|
|
8229
|
+
index,
|
|
8188
8230
|
});
|
|
8189
8231
|
if (!options.inactive) {
|
|
8190
8232
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8214,6 +8256,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8214
8256
|
group.model.openPanel(panel, {
|
|
8215
8257
|
skipSetActive: options.inactive,
|
|
8216
8258
|
skipSetGroupActive: options.inactive,
|
|
8259
|
+
index,
|
|
8217
8260
|
});
|
|
8218
8261
|
}
|
|
8219
8262
|
else if (referenceGroup.api.location.type === 'floating' ||
|
|
@@ -8222,6 +8265,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8222
8265
|
referenceGroup.model.openPanel(panel, {
|
|
8223
8266
|
skipSetActive: options.inactive,
|
|
8224
8267
|
skipSetGroupActive: options.inactive,
|
|
8268
|
+
index,
|
|
8225
8269
|
});
|
|
8226
8270
|
referenceGroup.api.setSize({
|
|
8227
8271
|
width: initial === null || initial === void 0 ? void 0 : initial.width,
|
|
@@ -8242,6 +8286,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8242
8286
|
group.model.openPanel(panel, {
|
|
8243
8287
|
skipSetActive: options.inactive,
|
|
8244
8288
|
skipSetGroupActive: options.inactive,
|
|
8289
|
+
index,
|
|
8245
8290
|
});
|
|
8246
8291
|
if (!options.inactive) {
|
|
8247
8292
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8260,6 +8305,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8260
8305
|
group.model.openPanel(panel, {
|
|
8261
8306
|
skipSetActive: options.inactive,
|
|
8262
8307
|
skipSetGroupActive: options.inactive,
|
|
8308
|
+
index,
|
|
8263
8309
|
});
|
|
8264
8310
|
}
|
|
8265
8311
|
else {
|
|
@@ -8270,6 +8316,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8270
8316
|
group.model.openPanel(panel, {
|
|
8271
8317
|
skipSetActive: options.inactive,
|
|
8272
8318
|
skipSetGroupActive: options.inactive,
|
|
8319
|
+
index,
|
|
8273
8320
|
});
|
|
8274
8321
|
if (!options.inactive) {
|
|
8275
8322
|
this.doSetGroupAndPanelActive(group);
|
|
@@ -8810,6 +8857,31 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8810
8857
|
}
|
|
8811
8858
|
}
|
|
8812
8859
|
|
|
8860
|
+
function createComponent(id, componentName, components = {}, frameworkComponents = {}, createFrameworkComponent, fallback) {
|
|
8861
|
+
const Component = typeof componentName === 'string'
|
|
8862
|
+
? components[componentName]
|
|
8863
|
+
: undefined;
|
|
8864
|
+
const FrameworkComponent = typeof componentName === 'string'
|
|
8865
|
+
? frameworkComponents[componentName]
|
|
8866
|
+
: undefined;
|
|
8867
|
+
if (Component && FrameworkComponent) {
|
|
8868
|
+
throw new Error(`Cannot create '${id}'. component '${componentName}' registered as both a component and frameworkComponent`);
|
|
8869
|
+
}
|
|
8870
|
+
if (FrameworkComponent) {
|
|
8871
|
+
if (!createFrameworkComponent) {
|
|
8872
|
+
throw new Error(`Cannot create '${id}' for framework component '${componentName}'. you must register a frameworkPanelWrapper to use framework components`);
|
|
8873
|
+
}
|
|
8874
|
+
return createFrameworkComponent.createComponent(id, componentName, FrameworkComponent);
|
|
8875
|
+
}
|
|
8876
|
+
if (!Component) {
|
|
8877
|
+
if (fallback) {
|
|
8878
|
+
return fallback();
|
|
8879
|
+
}
|
|
8880
|
+
throw new Error(`Cannot create '${id}', no component '${componentName}' provided`);
|
|
8881
|
+
}
|
|
8882
|
+
return new Component(id, componentName);
|
|
8883
|
+
}
|
|
8884
|
+
|
|
8813
8885
|
class GridviewComponent extends BaseGrid {
|
|
8814
8886
|
get orientation() {
|
|
8815
8887
|
return this.gridview.orientation;
|
|
@@ -9358,12 +9430,14 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9358
9430
|
this._expandedIcon = createExpandMoreButton();
|
|
9359
9431
|
this._collapsedIcon = createChevronRightButton();
|
|
9360
9432
|
this.disposable = new MutableDisposable();
|
|
9361
|
-
this.apiRef = {
|
|
9433
|
+
this.apiRef = {
|
|
9434
|
+
api: null,
|
|
9435
|
+
};
|
|
9362
9436
|
this._element = document.createElement('div');
|
|
9363
|
-
this.element.className = 'default-header';
|
|
9437
|
+
this.element.className = 'dv-default-header';
|
|
9364
9438
|
this._content = document.createElement('span');
|
|
9365
9439
|
this._expander = document.createElement('div');
|
|
9366
|
-
this._expander.className = '
|
|
9440
|
+
this._expander.className = 'dv-pane-header-icon';
|
|
9367
9441
|
this.element.appendChild(this._expander);
|
|
9368
9442
|
this.element.appendChild(this._content);
|
|
9369
9443
|
this.addDisposables(addDisposableListener(this._element, 'click', () => {
|
|
@@ -9834,7 +9908,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9834
9908
|
exports.GridviewApi = GridviewApi;
|
|
9835
9909
|
exports.GridviewComponent = GridviewComponent;
|
|
9836
9910
|
exports.GridviewPanel = GridviewPanel;
|
|
9837
|
-
exports.LocalSelectionTransfer = LocalSelectionTransfer;
|
|
9838
9911
|
exports.PROPERTY_KEYS = PROPERTY_KEYS;
|
|
9839
9912
|
exports.PaneFramework = PaneFramework;
|
|
9840
9913
|
exports.PaneTransfer = PaneTransfer;
|
|
@@ -9849,7 +9922,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
9849
9922
|
exports.SplitviewPanel = SplitviewPanel;
|
|
9850
9923
|
exports.Tab = Tab;
|
|
9851
9924
|
exports.WillShowOverlayLocationEvent = WillShowOverlayLocationEvent;
|
|
9852
|
-
exports.createComponent = createComponent;
|
|
9853
9925
|
exports.createDockview = createDockview;
|
|
9854
9926
|
exports.createGridview = createGridview;
|
|
9855
9927
|
exports.createPaneview = createPaneview;
|