dockview-core 4.3.1 → 4.4.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 -0
- package/dist/cjs/api/component.api.js +7 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +3 -0
- package/dist/cjs/dockview/dockviewComponent.js +28 -11
- package/dist/dockview-core.amd.js +30 -12
- 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 +30 -12
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +30 -12
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +30 -12
- 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 +30 -12
- 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 +30 -12
- 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/dockviewComponent.d.ts +3 -0
- package/dist/esm/dockview/dockviewComponent.js +26 -11
- package/package.json +1 -1
|
@@ -419,6 +419,7 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
419
419
|
get onUnhandledDragOverEvent(): Event<DockviewDndOverlayEvent>;
|
|
420
420
|
get onDidPopoutGroupSizeChange(): Event<PopoutGroupChangeSizeEvent>;
|
|
421
421
|
get onDidPopoutGroupPositionChange(): Event<PopoutGroupChangePositionEvent>;
|
|
422
|
+
get onDidOpenPopoutWindowFail(): Event<void>;
|
|
422
423
|
/**
|
|
423
424
|
* All panel objects.
|
|
424
425
|
*/
|
|
@@ -574,6 +574,9 @@ export class DockviewApi {
|
|
|
574
574
|
get onDidPopoutGroupPositionChange() {
|
|
575
575
|
return this.component.onDidPopoutGroupPositionChange;
|
|
576
576
|
}
|
|
577
|
+
get onDidOpenPopoutWindowFail() {
|
|
578
|
+
return this.component.onDidOpenPopoutWindowFail;
|
|
579
|
+
}
|
|
577
580
|
/**
|
|
578
581
|
* All panel objects.
|
|
579
582
|
*/
|
|
@@ -140,6 +140,7 @@ export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
|
|
|
140
140
|
readonly onDidMaximizedGroupChange: Event<DockviewMaximizedGroupChanged>;
|
|
141
141
|
readonly onDidPopoutGroupSizeChange: Event<PopoutGroupChangeSizeEvent>;
|
|
142
142
|
readonly onDidPopoutGroupPositionChange: Event<PopoutGroupChangePositionEvent>;
|
|
143
|
+
readonly onDidOpenPopoutWindowFail: Event<void>;
|
|
143
144
|
readonly options: DockviewComponentOptions;
|
|
144
145
|
updateOptions(options: DockviewOptions): void;
|
|
145
146
|
moveGroupOrPanel(options: MoveGroupOrPanelOptions): void;
|
|
@@ -202,6 +203,8 @@ export declare class DockviewComponent extends BaseGrid<DockviewGroupPanel> impl
|
|
|
202
203
|
readonly onDidPopoutGroupSizeChange: Event<PopoutGroupChangeSizeEvent>;
|
|
203
204
|
private readonly _onDidPopoutGroupPositionChange;
|
|
204
205
|
readonly onDidPopoutGroupPositionChange: Event<PopoutGroupChangePositionEvent>;
|
|
206
|
+
private readonly _onDidOpenPopoutWindowFail;
|
|
207
|
+
readonly onDidOpenPopoutWindowFail: Event<void>;
|
|
205
208
|
private readonly _onDidLayoutFromJSON;
|
|
206
209
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
207
210
|
private readonly _onDidActivePanelChange;
|
|
@@ -109,6 +109,8 @@ export class DockviewComponent extends BaseGrid {
|
|
|
109
109
|
this.onDidPopoutGroupSizeChange = this._onDidPopoutGroupSizeChange.event;
|
|
110
110
|
this._onDidPopoutGroupPositionChange = new Emitter();
|
|
111
111
|
this.onDidPopoutGroupPositionChange = this._onDidPopoutGroupPositionChange.event;
|
|
112
|
+
this._onDidOpenPopoutWindowFail = new Emitter();
|
|
113
|
+
this.onDidOpenPopoutWindowFail = this._onDidOpenPopoutWindowFail.event;
|
|
112
114
|
this._onDidLayoutFromJSON = new Emitter();
|
|
113
115
|
this.onDidLayoutFromJSON = this._onDidLayoutFromJSON.event;
|
|
114
116
|
this._onDidActivePanelChange = new Emitter({ replay: true });
|
|
@@ -173,7 +175,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
173
175
|
if (options.debug) {
|
|
174
176
|
this.addDisposables(new StrictEventsSequencing(this));
|
|
175
177
|
}
|
|
176
|
-
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(() => {
|
|
178
|
+
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(() => {
|
|
177
179
|
this.updateWatermark();
|
|
178
180
|
}), this.onDidAdd((event) => {
|
|
179
181
|
if (!this._moving) {
|
|
@@ -319,13 +321,6 @@ export class DockviewComponent extends BaseGrid {
|
|
|
319
321
|
if (_window.isDisposed) {
|
|
320
322
|
return false;
|
|
321
323
|
}
|
|
322
|
-
if (popoutContainer === null) {
|
|
323
|
-
popoutWindowDisposable.dispose();
|
|
324
|
-
return false;
|
|
325
|
-
}
|
|
326
|
-
const gready = document.createElement('div');
|
|
327
|
-
gready.className = 'dv-overlay-render-container';
|
|
328
|
-
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
329
324
|
const referenceGroup = (options === null || options === void 0 ? void 0 : options.referenceGroup)
|
|
330
325
|
? options.referenceGroup
|
|
331
326
|
: itemToPopout instanceof DockviewPanel
|
|
@@ -333,7 +328,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
333
328
|
: itemToPopout;
|
|
334
329
|
const referenceLocation = itemToPopout.api.location.type;
|
|
335
330
|
/**
|
|
336
|
-
* The group that is being added doesn't already exist within the DOM, the most likely
|
|
331
|
+
* The group that is being added doesn't already exist within the DOM, the most likely occurrence
|
|
337
332
|
* of this case is when being called from the `fromJSON(...)` method
|
|
338
333
|
*/
|
|
339
334
|
const isGroupAddedToDom = referenceGroup.element.parentElement !== null;
|
|
@@ -346,8 +341,28 @@ export class DockviewComponent extends BaseGrid {
|
|
|
346
341
|
}
|
|
347
342
|
else {
|
|
348
343
|
group = this.createGroup({ id: groupId });
|
|
349
|
-
|
|
344
|
+
if (popoutContainer) {
|
|
345
|
+
this._onDidAddGroup.fire(group);
|
|
346
|
+
}
|
|
350
347
|
}
|
|
348
|
+
if (popoutContainer === null) {
|
|
349
|
+
console.error('dockview: failed to create popout. perhaps you need to allow pop-ups for this website');
|
|
350
|
+
popoutWindowDisposable.dispose();
|
|
351
|
+
this._onDidOpenPopoutWindowFail.fire();
|
|
352
|
+
// if the popout window was blocked, we need to move the group back to the reference group
|
|
353
|
+
// and set it to visible
|
|
354
|
+
this.movingLock(() => moveGroupWithoutDestroying({
|
|
355
|
+
from: group,
|
|
356
|
+
to: referenceGroup,
|
|
357
|
+
}));
|
|
358
|
+
if (!referenceGroup.api.isVisible) {
|
|
359
|
+
referenceGroup.api.setVisible(true);
|
|
360
|
+
}
|
|
361
|
+
return false;
|
|
362
|
+
}
|
|
363
|
+
const gready = document.createElement('div');
|
|
364
|
+
gready.className = 'dv-overlay-render-container';
|
|
365
|
+
const overlayRenderContainer = new OverlayRenderContainer(gready, this);
|
|
351
366
|
group.model.renderContainer = overlayRenderContainer;
|
|
352
367
|
group.layout(_window.window.innerWidth, _window.window.innerHeight);
|
|
353
368
|
let floatingBox;
|
|
@@ -504,7 +519,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
504
519
|
return true;
|
|
505
520
|
})
|
|
506
521
|
.catch((err) => {
|
|
507
|
-
console.error('dockview: failed to create popout
|
|
522
|
+
console.error('dockview: failed to create popout.', err);
|
|
508
523
|
return false;
|
|
509
524
|
});
|
|
510
525
|
}
|