dockview-core 4.3.1 → 4.4.1
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 -0
- package/dist/cjs/api/component.api.js +7 -0
- package/dist/cjs/dockview/components/tab/tab.d.ts +1 -0
- package/dist/cjs/dockview/components/tab/tab.js +4 -1
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +1 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +16 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +2 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +4 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +4 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +4 -0
- package/dist/cjs/dockview/dockviewComponent.js +81 -42
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +10 -8
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +3 -0
- package/dist/dockview-core.amd.js +61 -14
- 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 +61 -14
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +61 -14
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +61 -14
- 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 +61 -14
- 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 +61 -14
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +1 -0
- package/dist/esm/api/component.api.js +3 -0
- package/dist/esm/dockview/components/tab/tab.d.ts +1 -0
- package/dist/esm/dockview/components/tab/tab.js +4 -1
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +1 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +5 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +2 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +4 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.js +4 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +4 -0
- package/dist/esm/dockview/dockviewComponent.js +37 -11
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +10 -8
- package/dist/esm/dockview/dockviewGroupPanelModel.js +3 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.4.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
@@ -3652,6 +3652,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
3652
3652
|
get onDidPopoutGroupPositionChange() {
|
|
3653
3653
|
return this.component.onDidPopoutGroupPositionChange;
|
|
3654
3654
|
}
|
|
3655
|
+
get onDidOpenPopoutWindowFail() {
|
|
3656
|
+
return this.component.onDidOpenPopoutWindowFail;
|
|
3657
|
+
}
|
|
3655
3658
|
/**
|
|
3656
3659
|
* All panel objects.
|
|
3657
3660
|
*/
|
|
@@ -5020,7 +5023,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5020
5023
|
this._element = document.createElement('div');
|
|
5021
5024
|
this._element.className = 'dv-tab';
|
|
5022
5025
|
this._element.tabIndex = 0;
|
|
5023
|
-
this._element.draggable =
|
|
5026
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5024
5027
|
toggleClass(this.element, 'dv-inactive-tab', true);
|
|
5025
5028
|
const dragHandler = new TabDragHandler(this._element, this.accessor, this.group, this.panel);
|
|
5026
5029
|
this.dropTarget = new Droptarget(this._element, {
|
|
@@ -5068,6 +5071,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5068
5071
|
this.content = part;
|
|
5069
5072
|
this._element.appendChild(this.content.element);
|
|
5070
5073
|
}
|
|
5074
|
+
updateDragAndDropState() {
|
|
5075
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5076
|
+
}
|
|
5071
5077
|
dispose() {
|
|
5072
5078
|
super.dispose();
|
|
5073
5079
|
}
|
|
@@ -5139,7 +5145,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5139
5145
|
this.onDragStart = this._onDragStart.event;
|
|
5140
5146
|
this._element = document.createElement('div');
|
|
5141
5147
|
this._element.className = 'dv-void-container';
|
|
5142
|
-
this._element.draggable =
|
|
5148
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5143
5149
|
this.addDisposables(this._onDrop, this._onDragStart, addDisposableListener(this._element, 'pointerdown', () => {
|
|
5144
5150
|
this.accessor.doSetGroupActive(this.group);
|
|
5145
5151
|
}));
|
|
@@ -5162,6 +5168,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5162
5168
|
this._onDrop.fire(event);
|
|
5163
5169
|
}), this.dropTarget);
|
|
5164
5170
|
}
|
|
5171
|
+
updateDragAndDropState() {
|
|
5172
|
+
this._element.draggable = !this.accessor.options.disableDnd;
|
|
5173
|
+
}
|
|
5165
5174
|
}
|
|
5166
5175
|
|
|
5167
5176
|
class Scrollbar extends CompositeDisposable {
|
|
@@ -5422,6 +5431,11 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5422
5431
|
.map((x) => x.value.panel.id);
|
|
5423
5432
|
this._onOverflowTabsChange.fire({ tabs, reset: options.reset });
|
|
5424
5433
|
}
|
|
5434
|
+
updateDragAndDropState() {
|
|
5435
|
+
for (const tab of this._tabs) {
|
|
5436
|
+
tab.value.updateDragAndDropState();
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5425
5439
|
}
|
|
5426
5440
|
|
|
5427
5441
|
const createSvgElementFromPath = (params) => {
|
|
@@ -5694,6 +5708,10 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
5694
5708
|
});
|
|
5695
5709
|
}));
|
|
5696
5710
|
}
|
|
5711
|
+
updateDragAndDropState() {
|
|
5712
|
+
this.tabs.updateDragAndDropState();
|
|
5713
|
+
this.voidContainer.updateDragAndDropState();
|
|
5714
|
+
}
|
|
5697
5715
|
}
|
|
5698
5716
|
|
|
5699
5717
|
class DockviewUnhandledDragOverEvent extends AcceptableEvent {
|
|
@@ -6399,6 +6417,9 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
6399
6417
|
}));
|
|
6400
6418
|
}
|
|
6401
6419
|
}
|
|
6420
|
+
updateDragAndDropState() {
|
|
6421
|
+
this.tabsContainer.updateDragAndDropState();
|
|
6422
|
+
}
|
|
6402
6423
|
dispose() {
|
|
6403
6424
|
var _a, _b, _c;
|
|
6404
6425
|
super.dispose();
|
|
@@ -8254,6 +8275,8 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8254
8275
|
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
8255
8276
|
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
8256
8277
|
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
8278
|
+
this._onDidOpenPopoutWindowFail = new Emitter();
|
|
8279
|
+
this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
|
|
8257
8280
|
this._onDidLayoutFromJSON = new Emitter();
|
|
8258
8281
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
8259
8282
|
this._onDidActivePanelChange = new Emitter({ replay: true });
|
|
@@ -8318,7 +8341,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8318
8341
|
if (options.debug) {
|
|
8319
8342
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
8320
8343
|
}
|
|
8321
|
-
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8344
|
+
this.addDisposables(this.rootDropTargetContainer, this.overlayRenderContainer, this._onWillDragPanel, this._onWillDragGroup, this._onWillShowOverlay, this._onDidActivePanelChange, this._onDidAddPanel, this._onDidRemovePanel, this._onDidLayoutFromJSON, this._onDidDrop, this._onWillDrop, this._onDidMovePanel, this._onDidAddGroup, this._onDidRemoveGroup, this._onDidActiveGroupChange, this._onUnhandledDragOverEvent, this._onDidMaximizedGroupChange, this._onDidOptionsChange, this._onDidPopoutGroupSizeChange, this._onDidPopoutGroupPositionChange, this._onDidOpenPopoutWindowFail, this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
8322
8345
|
this.updateWatermark();
|
|
8323
8346
|
}), this.onDidAdd((event) => {
|
|
8324
8347
|
if (!this._moving) {
|
|
@@ -8464,13 +8487,6 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8464
8487
|
if (_window.isDisposed) {
|
|
8465
8488
|
return false;
|
|
8466
8489
|
}
|
|
8467
|
-
if (popoutContainer === null) {
|
|
8468
|
-
popoutWindowDisposable.dispose();
|
|
8469
|
-
return false;
|
|
8470
|
-
}
|
|
8471
|
-
const gready = document.createElement('div');
|
|
8472
|
-
gready.className = 'dv-overlay-render-container';
|
|
8473
|
-
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8474
8490
|
const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
|
|
8475
8491
|
? options.referenceGroup
|
|
8476
8492
|
: itemToPopout instanceof DockviewPanel
|
|
@@ -8478,7 +8494,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8478
8494
|
: itemToPopout;
|
|
8479
8495
|
const referenceLocation = itemToPopout.api.location.type;
|
|
8480
8496
|
/**
|
|
8481
|
-
* The group that is being added doesn't already exist within the DOM, the most likely
|
|
8497
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurrence
|
|
8482
8498
|
* of this case is when being called from the `fromJSON(...)` method
|
|
8483
8499
|
*/
|
|
8484
8500
|
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
@@ -8491,8 +8507,28 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8491
8507
|
}
|
|
8492
8508
|
else {
|
|
8493
8509
|
group = this.createGroup({ id: groupId });
|
|
8494
|
-
|
|
8510
|
+
if (popoutContainer) {
|
|
8511
|
+
this._onDidAddGroup.fire(group);
|
|
8512
|
+
}
|
|
8513
|
+
}
|
|
8514
|
+
if (popoutContainer === null) {
|
|
8515
|
+
console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
|
|
8516
|
+
popoutWindowDisposable.dispose();
|
|
8517
|
+
this._onDidOpenPopoutWindowFail.fire();
|
|
8518
|
+
// if the popout window was blocked, we need to move the group back to the reference group
|
|
8519
|
+
// and set it to visible
|
|
8520
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
8521
|
+
from: group,
|
|
8522
|
+
to: referenceGroup,
|
|
8523
|
+
}));
|
|
8524
|
+
if (!referenceGroup.api.isVisible) {
|
|
8525
|
+
referenceGroup.api.setVisible(true);
|
|
8526
|
+
}
|
|
8527
|
+
return false;
|
|
8495
8528
|
}
|
|
8529
|
+
const gready = document.createElement('div');
|
|
8530
|
+
gready.className = 'dv-overlay-render-container';
|
|
8531
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
8496
8532
|
group.model.renderContainer = overlayRenderContainer;
|
|
8497
8533
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
8498
8534
|
let floatingBox;
|
|
@@ -8649,7 +8685,7 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8649
8685
|
return true;
|
|
8650
8686
|
})
|
|
8651
8687
|
.catch((err) => {
|
|
8652
|
-
console.error('dockview: failed to create popout
|
|
8688
|
+
console.error('dockview: failed to create popout.', err);
|
|
8653
8689
|
return false;
|
|
8654
8690
|
});
|
|
8655
8691
|
}
|
|
@@ -8856,7 +8892,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8856
8892
|
}
|
|
8857
8893
|
}
|
|
8858
8894
|
this.updateDropTargetModel(options);
|
|
8895
|
+
const oldDisableDnd = this.options.disableDnd;
|
|
8859
8896
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
8897
|
+
const newDisableDnd = this.options.disableDnd;
|
|
8898
|
+
if (oldDisableDnd !== newDisableDnd) {
|
|
8899
|
+
this.updateDragAndDropState();
|
|
8900
|
+
}
|
|
8860
8901
|
if ('theme' in options) {
|
|
8861
8902
|
this.updateTheme();
|
|
8862
8903
|
}
|
|
@@ -8871,6 +8912,12 @@ define(['exports'], (function (exports) { 'use strict';
|
|
|
8871
8912
|
}
|
|
8872
8913
|
}
|
|
8873
8914
|
}
|
|
8915
|
+
updateDragAndDropState() {
|
|
8916
|
+
// Update draggable state for all tabs and void containers
|
|
8917
|
+
for (const group of this.groups) {
|
|
8918
|
+
group.model.updateDragAndDropState();
|
|
8919
|
+
}
|
|
8920
|
+
}
|
|
8874
8921
|
focus() {
|
|
8875
8922
|
var _a;
|
|
8876
8923
|
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|