refactor: renaming files

This commit is contained in:
mathuo 2023-03-06 23:37:50 +08:00
parent 8528f8d70f
commit c3e2ed1a87
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
28 changed files with 358 additions and 291 deletions

View File

@ -1,5 +1,5 @@
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel'; import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
import { GroupPanel } from '../../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
import { import {
GroupPanelPartInitParameters, GroupPanelPartInitParameters,
GroupPanelUpdateEvent, GroupPanelUpdateEvent,
@ -29,7 +29,10 @@ export class DockviewPanelModelMock implements IDockviewPanelModel {
// //
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void { updateParentGroup(
group: DockviewGroupPanel,
isPanelVisible: boolean
): void {
// //
} }

View File

@ -1,7 +1,7 @@
import { DockviewPanelApiImpl, TitleEvent } from '../../api/dockviewPanelApi'; import { DockviewPanelApiImpl, TitleEvent } from '../../api/dockviewPanelApi';
import { DockviewComponent } from '../../dockview/dockviewComponent'; import { DockviewComponent } from '../../dockview/dockviewComponent';
import { DockviewPanel, IDockviewPanel } from '../../dockview/dockviewPanel'; import { DockviewPanel, IDockviewPanel } from '../../dockview/dockviewPanel';
import { GroupPanel } from '../../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
describe('groupPanelApi', () => { describe('groupPanelApi', () => {
test('title', () => { test('title', () => {
@ -10,7 +10,7 @@ describe('groupPanelApi', () => {
update: jest.fn(), update: jest.fn(),
} as any; } as any;
}); });
const groupMock = jest.fn<GroupPanel, []>(() => { const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
return {} as any; return {} as any;
}); });
@ -37,7 +37,7 @@ describe('groupPanelApi', () => {
onDidRemovePanel: jest.fn(), onDidRemovePanel: jest.fn(),
options: {}, options: {},
}; };
const groupViewPanel = new GroupPanel( const groupViewPanel = new DockviewGroupPanel(
<DockviewComponent>accessor, <DockviewComponent>accessor,
'', '',
{} {}
@ -45,7 +45,7 @@ describe('groupPanelApi', () => {
const cut = new DockviewPanelApiImpl( const cut = new DockviewPanelApiImpl(
<IDockviewPanel>groupPanel, <IDockviewPanel>groupPanel,
<GroupPanel>groupViewPanel <DockviewGroupPanel>groupViewPanel
); );
let events = 0; let events = 0;
@ -57,7 +57,7 @@ describe('groupPanelApi', () => {
expect(events).toBe(0); expect(events).toBe(0);
expect(cut.group).toBe(groupViewPanel); expect(cut.group).toBe(groupViewPanel);
const groupViewPanel2 = new GroupPanel( const groupViewPanel2 = new DockviewGroupPanel(
<DockviewComponent>accessor, <DockviewComponent>accessor,
'', '',
{} {}

View File

@ -6,7 +6,6 @@ import {
} from '../../groupview/types'; } from '../../groupview/types';
import { PanelUpdateEvent } from '../../panel/types'; import { PanelUpdateEvent } from '../../panel/types';
import { Orientation } from '../../splitview/core/splitview'; import { Orientation } from '../../splitview/core/splitview';
import { GroupPanel } from '../../groupview/groupviewPanel';
import { CompositeDisposable } from '../../lifecycle'; import { CompositeDisposable } from '../../lifecycle';
import { import {
GroupPanelUpdateEvent, GroupPanelUpdateEvent,
@ -23,6 +22,7 @@ import { DefaultDockviewDeserialzier } from '../../dockview/deserializer';
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel'; import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
import { DockviewPanelModelMock } from '../__mocks__/mockDockviewPanelMode'; import { DockviewPanelModelMock } from '../__mocks__/mockDockviewPanelMode';
import { DefaultTab } from '../../dockview/components/tab/defaultTab'; import { DefaultTab } from '../../dockview/components/tab/defaultTab';
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
class PanelContentPartTest implements IContentRenderer { class PanelContentPartTest implements IContentRenderer {
element: HTMLElement = document.createElement('div'); element: HTMLElement = document.createElement('div');
@ -36,10 +36,6 @@ class PanelContentPartTest implements IContentRenderer {
this.element.classList.add(`testpanel-${id}`); this.element.classList.add(`testpanel-${id}`);
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
//noop
}
init(parameters: GroupPanelPartInitParameters): void { init(parameters: GroupPanelPartInitParameters): void {
//noop //noop
} }
@ -78,10 +74,6 @@ class PanelTabPartTest implements ITabRenderer {
this.element.className = `panel-tab-part-${id}`; this.element.className = `panel-tab-part-${id}`;
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
//noop
}
init(parameters: GroupPanelPartInitParameters): void { init(parameters: GroupPanelPartInitParameters): void {
//noop //noop
} }
@ -105,7 +97,7 @@ class PanelTabPartTest implements ITabRenderer {
} }
class TestGroupPanel implements IDockviewPanel { class TestGroupPanel implements IDockviewPanel {
private _group: GroupPanel | undefined; private _group: DockviewGroupPanel | undefined;
readonly api: DockviewPanelApi; readonly api: DockviewPanelApi;
readonly view: IDockviewPanelModel; readonly view: IDockviewPanelModel;
@ -116,7 +108,7 @@ class TestGroupPanel implements IDockviewPanel {
accessor: DockviewComponent accessor: DockviewComponent
) { ) {
this.api = new DockviewPanelApiImpl(this, this._group!); this.api = new DockviewPanelApiImpl(this, this._group!);
this._group = new GroupPanel(accessor, id, {}); this._group = new DockviewGroupPanel(accessor, id, {});
this.view = new DockviewPanelModelMock( this.view = new DockviewPanelModelMock(
'component', 'component',
new PanelContentPartTest(id, 'component'), new PanelContentPartTest(id, 'component'),
@ -128,11 +120,11 @@ class TestGroupPanel implements IDockviewPanel {
get params(): Record<string, any> { get params(): Record<string, any> {
return {}; return {};
} }
get group(): GroupPanel { get group(): DockviewGroupPanel {
return this._group!; return this._group!;
} }
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void { updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void {
this._group = group; this._group = group;
} }
@ -838,7 +830,7 @@ describe('dockviewComponent', () => {
let events: { let events: {
panel?: IDockviewPanel; panel?: IDockviewPanel;
group?: GroupPanel | undefined; group?: DockviewGroupPanel | undefined;
type: string; type: string;
}[] = []; }[] = [];
@ -1028,7 +1020,7 @@ describe('dockviewComponent', () => {
position: { referencePanel: 'panel2', direction: 'below' }, position: { referencePanel: 'panel2', direction: 'below' },
}); });
const removedGroups: GroupPanel[] = []; const removedGroups: DockviewGroupPanel[] = [];
const removedPanels: IDockviewPanel[] = []; const removedPanels: IDockviewPanel[] = [];
const disposable = new CompositeDisposable( const disposable = new CompositeDisposable(
@ -1481,9 +1473,9 @@ describe('dockviewComponent', () => {
dockview.layout(1000, 1000); dockview.layout(1000, 1000);
let addGroup: GroupPanel[] = []; let addGroup: DockviewGroupPanel[] = [];
let removeGroup: GroupPanel[] = []; let removeGroup: DockviewGroupPanel[] = [];
let activeGroup: (GroupPanel | undefined)[] = []; let activeGroup: (DockviewGroupPanel | undefined)[] = [];
let addPanel: IDockviewPanel[] = []; let addPanel: IDockviewPanel[] = [];
let removePanel: IDockviewPanel[] = []; let removePanel: IDockviewPanel[] = [];
let activePanel: (IDockviewPanel | undefined)[] = []; let activePanel: (IDockviewPanel | undefined)[] = [];

View File

@ -1,8 +1,8 @@
import { DockviewComponent } from '../../dockview/dockviewComponent'; import { DockviewComponent } from '../../dockview/dockviewComponent';
import { DockviewApi } from '../../api/component.api'; import { DockviewApi } from '../../api/component.api';
import { DockviewPanel } from '../../dockview/dockviewPanel'; import { DockviewPanel } from '../../dockview/dockviewPanel';
import { GroupPanel } from '../../groupview/groupviewPanel';
import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel'; import { IDockviewPanelModel } from '../../dockview/dockviewPanelModel';
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
describe('dockviewPanel', () => { describe('dockviewPanel', () => {
test('update title', () => { test('update title', () => {
@ -14,7 +14,7 @@ describe('dockviewPanel', () => {
const accessorMock = jest.fn<DockviewComponent, []>(() => { const accessorMock = jest.fn<DockviewComponent, []>(() => {
return {} as any; return {} as any;
}); });
const groupMock = jest.fn<GroupPanel, []>(() => { const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
return {} as any; return {} as any;
}); });
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => { const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
@ -57,7 +57,7 @@ describe('dockviewPanel', () => {
const accessorMock = jest.fn<DockviewComponent, []>(() => { const accessorMock = jest.fn<DockviewComponent, []>(() => {
return {} as any; return {} as any;
}); });
const groupMock = jest.fn<GroupPanel, []>(() => { const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
return {} as any; return {} as any;
}); });
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => { const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
@ -89,7 +89,7 @@ describe('dockviewPanel', () => {
const accessorMock = jest.fn<DockviewComponent, []>(() => { const accessorMock = jest.fn<DockviewComponent, []>(() => {
return {} as any; return {} as any;
}); });
const groupMock = jest.fn<GroupPanel, []>(() => { const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
return {} as any; return {} as any;
}); });
const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => { const panelModelMock = jest.fn<Partial<IDockviewPanelModel>, []>(() => {
@ -121,7 +121,7 @@ describe('dockviewPanel', () => {
const accessorMock = jest.fn<DockviewComponent, []>(() => { const accessorMock = jest.fn<DockviewComponent, []>(() => {
return {} as any; return {} as any;
}); });
const groupMock = jest.fn<GroupPanel, []>(() => { const groupMock = jest.fn<DockviewGroupPanel, []>(() => {
return { return {
api: { api: {
setSize: jest.fn(), setSize: jest.fn(),

View File

@ -1,5 +1,5 @@
import { DockviewComponent } from '../../dockview/dockviewComponent'; import { DockviewComponent } from '../../dockview/dockviewComponent';
import { GroupPanel } from '../../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
describe('gridviewPanel', () => { describe('gridviewPanel', () => {
test('get panel', () => { test('get panel', () => {
@ -13,7 +13,7 @@ describe('gridviewPanel', () => {
const accessor = new accessorMock(); const accessor = new accessorMock();
const cut = new GroupPanel(accessor, 'id', {}); const cut = new DockviewGroupPanel(accessor, 'id', {});
expect(cut.params).toEqual(undefined); expect(cut.params).toEqual(undefined);

View File

@ -11,8 +11,10 @@ import {
IWatermarkRenderer, IWatermarkRenderer,
} from '../../groupview/types'; } from '../../groupview/types';
import { PanelUpdateEvent } from '../../panel/types'; import { PanelUpdateEvent } from '../../panel/types';
import { GroupOptions, Groupview } from '../../groupview/groupview'; import {
import { GroupPanel } from '../../groupview/groupviewPanel'; DockviewGroupPanelModel,
GroupOptions,
} from '../../groupview/dockviewGroupPanelModel';
import { fireEvent } from '@testing-library/dom'; import { fireEvent } from '@testing-library/dom';
import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer'; import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer';
import { CompositeDisposable } from '../../lifecycle'; import { CompositeDisposable } from '../../lifecycle';
@ -22,6 +24,7 @@ import {
IDockviewPanelModel, IDockviewPanelModel,
DockviewPanelModel, DockviewPanelModel,
} from '../../dockview/dockviewPanelModel'; } from '../../dockview/dockviewPanelModel';
import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
enum GroupChangeKind2 { enum GroupChangeKind2 {
ADD_PANEL, ADD_PANEL,
@ -52,7 +55,10 @@ class TestModel implements IDockviewPanelModel {
// //
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void { updateParentGroup(
group: DockviewGroupPanel,
isPanelVisible: boolean
): void {
// //
} }
@ -120,10 +126,6 @@ class TestContentPart implements IContentRenderer {
//void //void
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
//noop
}
focus() { focus() {
//noop //noop
} }
@ -155,10 +157,6 @@ class TestHeaderPart implements ITabRenderer {
//void //void
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean) {
//noop
}
focus() { focus() {
//noop //noop
} }
@ -173,7 +171,7 @@ class TestHeaderPart implements ITabRenderer {
} }
export class TestPanel implements IDockviewPanel { export class TestPanel implements IDockviewPanel {
private _group: GroupPanel | undefined; private _group: DockviewGroupPanel | undefined;
private _params: IGroupPanelInitParameters; private _params: IGroupPanelInitParameters;
readonly view: IDockviewPanelModel; readonly view: IDockviewPanelModel;
@ -201,8 +199,8 @@ export class TestPanel implements IDockviewPanel {
this._params = params; this._params = params;
} }
updateParentGroup(group: GroupPanel, isGroupActive: boolean) { updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void {
this._group = group; //
} }
layout(width: number, height: number) { layout(width: number, height: number) {
@ -230,7 +228,7 @@ export class TestPanel implements IDockviewPanel {
} }
describe('groupview', () => { describe('groupview', () => {
let groupview: GroupPanel; let groupview: DockviewGroupPanel;
let dockview: DockviewComponent; let dockview: DockviewComponent;
let options: GroupOptions; let options: GroupOptions;
@ -255,7 +253,7 @@ describe('groupview', () => {
options = { options = {
tabHeight: 30, tabHeight: 30,
}; };
groupview = new GroupPanel(dockview, 'groupview-1', options); groupview = new DockviewGroupPanel(dockview, 'groupview-1', options);
groupview.initialize(); groupview.initialize();
}); });
@ -264,7 +262,7 @@ describe('groupview', () => {
const panel2 = new TestPanel('panel2', jest.fn() as any); const panel2 = new TestPanel('panel2', jest.fn() as any);
const panel3 = new TestPanel('panel3', jest.fn() as any); const panel3 = new TestPanel('panel3', jest.fn() as any);
const groupview2 = new GroupPanel(dockview, 'groupview-2', { const groupview2 = new DockviewGroupPanel(dockview, 'groupview-2', {
tabHeight: 25, tabHeight: 25,
panels: [panel1, panel2, panel3], panels: [panel1, panel2, panel3],
activePanel: panel2, activePanel: panel2,
@ -518,7 +516,7 @@ describe('groupview', () => {
} }
); );
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
document.createElement('div'), document.createElement('div'),
dockviewComponent, dockviewComponent,
'id', 'id',
@ -543,7 +541,7 @@ describe('groupview', () => {
} }
); );
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
document.createElement('div'), document.createElement('div'),
dockviewComponent, dockviewComponent,
'id', 'id',
@ -574,7 +572,7 @@ describe('groupview', () => {
); );
const groupviewContainer = document.createElement('div'); const groupviewContainer = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
groupviewContainer, groupviewContainer,
dockviewComponent, dockviewComponent,
'id', 'id',
@ -621,28 +619,32 @@ describe('groupview', () => {
}; };
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
id: 'testgroupid', return {
model: groupView, id: 'testgroupid',
}; model: groupView,
}); };
}
);
const container = document.createElement('div'); const container = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
container, container,
accessor, accessor,
'groupviewid', 'groupviewid',
{}, {},
new groupPanelMock() as GroupPanel new groupPanelMock() as DockviewGroupPanel
); );
const element = container const element = container
@ -678,15 +680,17 @@ describe('groupview', () => {
}; };
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -694,12 +698,12 @@ describe('groupview', () => {
}); });
const container = document.createElement('div'); const container = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
container, container,
accessor, accessor,
'groupviewid', 'groupviewid',
{}, {},
new groupPanelMock() as GroupPanel new groupPanelMock() as DockviewGroupPanel
); );
cut.openPanel(new TestPanel('panel1', jest.fn() as any)); cut.openPanel(new TestPanel('panel1', jest.fn() as any));
@ -742,15 +746,17 @@ describe('groupview', () => {
}; };
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -758,12 +764,12 @@ describe('groupview', () => {
}); });
const container = document.createElement('div'); const container = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
container, container,
accessor, accessor,
'groupviewid', 'groupviewid',
{}, {},
new groupPanelMock() as GroupPanel new groupPanelMock() as DockviewGroupPanel
); );
cut.openPanel(new TestPanel('panel1', jest.fn() as any)); cut.openPanel(new TestPanel('panel1', jest.fn() as any));
@ -807,15 +813,17 @@ describe('groupview', () => {
}; };
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -823,12 +831,12 @@ describe('groupview', () => {
}); });
const container = document.createElement('div'); const container = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
container, container,
accessor, accessor,
'groupviewid', 'groupviewid',
{}, {},
new groupPanelMock() as GroupPanel new groupPanelMock() as DockviewGroupPanel
); );
cut.openPanel(new TestPanel('panel1', jest.fn() as any)); cut.openPanel(new TestPanel('panel1', jest.fn() as any));
@ -859,15 +867,17 @@ describe('groupview', () => {
}); });
test('that watermark is added', () => { test('that watermark is added', () => {
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -876,12 +886,12 @@ describe('groupview', () => {
const container = document.createElement('div'); const container = document.createElement('div');
const cut = new Groupview( const cut = new DockviewGroupPanelModel(
container, container,
dockview, dockview,
'groupviewid', 'groupviewid',
{}, {},
new groupPanelMock() as GroupPanel new groupPanelMock() as DockviewGroupPanel
); );
cut.initialize(); cut.initialize();

View File

@ -7,7 +7,6 @@ import {
} from '../../../groupview/types'; } from '../../../groupview/types';
import { CompositeDisposable } from '../../../lifecycle'; import { CompositeDisposable } from '../../../lifecycle';
import { PanelUpdateEvent } from '../../../panel/types'; import { PanelUpdateEvent } from '../../../panel/types';
import { GroupPanel } from '../../../groupview/groupviewPanel';
import { IDockviewPanel } from '../../../dockview/dockviewPanel'; import { IDockviewPanel } from '../../../dockview/dockviewPanel';
import { IDockviewPanelModel } from '../../../dockview/dockviewPanelModel'; import { IDockviewPanelModel } from '../../../dockview/dockviewPanelModel';
@ -27,10 +26,6 @@ class TestContentRenderer
this.element = document.createElement('div'); this.element = document.createElement('div');
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void {
//
}
init(parameters: GroupPanelContentPartInitParameters): void { init(parameters: GroupPanelContentPartInitParameters): void {
// //
} }

View File

@ -1,8 +1,8 @@
import { fireEvent } from '@testing-library/dom'; import { fireEvent } from '@testing-library/dom';
import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer'; import { LocalSelectionTransfer, PanelTransfer } from '../../dnd/dataTransfer';
import { DockviewComponent } from '../../dockview/dockviewComponent'; import { DockviewComponent } from '../../dockview/dockviewComponent';
import { Groupview } from '../../groupview/groupview'; import { DockviewGroupPanel } from '../../groupview/dockviewGroupPanel';
import { GroupPanel } from '../../groupview/groupviewPanel'; import { DockviewGroupPanelModel } from '../../groupview/dockviewGroupPanelModel';
import { Tab } from '../../groupview/tab'; import { Tab } from '../../groupview/tab';
describe('tab', () => { describe('tab', () => {
@ -34,15 +34,17 @@ describe('tab', () => {
id: 'testcomponentid', id: 'testcomponentid',
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -50,7 +52,7 @@ describe('tab', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new Tab('panelId', accessor, groupPanel); const cut = new Tab('panelId', accessor, groupPanel);
@ -77,15 +79,17 @@ describe('tab', () => {
id: 'testcomponentid', id: 'testcomponentid',
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -93,7 +97,7 @@ describe('tab', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new Tab('panel1', accessor, groupPanel); const cut = new Tab('panel1', accessor, groupPanel);
@ -125,15 +129,17 @@ describe('tab', () => {
id: 'testcomponentid', id: 'testcomponentid',
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -141,7 +147,7 @@ describe('tab', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new Tab('panel1', accessor, groupPanel); const cut = new Tab('panel1', accessor, groupPanel);
@ -173,15 +179,17 @@ describe('tab', () => {
id: 'testcomponentid', id: 'testcomponentid',
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -189,7 +197,7 @@ describe('tab', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new Tab('panel1', accessor, groupPanel); const cut = new Tab('panel1', accessor, groupPanel);
@ -227,15 +235,17 @@ describe('tab', () => {
id: 'testcomponentid', id: 'testcomponentid',
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -243,7 +253,7 @@ describe('tab', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new Tab('panel1', accessor, groupPanel); const cut = new Tab('panel1', accessor, groupPanel);

View File

@ -1,13 +1,13 @@
import { DockviewComponent } from '../../../dockview/dockviewComponent'; import { DockviewComponent } from '../../../dockview/dockviewComponent';
import { GroupPanel } from '../../../groupview/groupviewPanel';
import { TabsContainer } from '../../../groupview/titlebar/tabsContainer'; import { TabsContainer } from '../../../groupview/titlebar/tabsContainer';
import { fireEvent } from '@testing-library/dom'; import { fireEvent } from '@testing-library/dom';
import { Groupview } from '../../../groupview/groupview';
import { import {
LocalSelectionTransfer, LocalSelectionTransfer,
PanelTransfer, PanelTransfer,
} from '../../../dnd/dataTransfer'; } from '../../../dnd/dataTransfer';
import { TestPanel } from '../groupview.spec'; import { TestPanel } from '../dockviewGroupPanelModel.spec';
import { DockviewGroupPanelModel } from '../../../groupview/dockviewGroupPanelModel';
import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
describe('tabsContainer', () => { describe('tabsContainer', () => {
test('that an external event does not render a drop target and calls through to the group mode', () => { test('that an external event does not render a drop target and calls through to the group mode', () => {
@ -18,22 +18,24 @@ describe('tabsContainer', () => {
options: {}, options: {},
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
model: groupView, model: groupView,
}; };
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new TabsContainer(accessor, groupPanel); const cut = new TabsContainer(accessor, groupPanel);
@ -71,15 +73,17 @@ describe('tabsContainer', () => {
options: {}, options: {},
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -88,7 +92,7 @@ describe('tabsContainer', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new TabsContainer(accessor, groupPanel); const cut = new TabsContainer(accessor, groupPanel);
@ -137,15 +141,17 @@ describe('tabsContainer', () => {
options: {}, options: {},
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -154,7 +160,7 @@ describe('tabsContainer', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new TabsContainer(accessor, groupPanel); const cut = new TabsContainer(accessor, groupPanel);
@ -200,15 +206,17 @@ describe('tabsContainer', () => {
options: {}, options: {},
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -217,7 +225,7 @@ describe('tabsContainer', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new TabsContainer(accessor, groupPanel); const cut = new TabsContainer(accessor, groupPanel);
@ -263,15 +271,17 @@ describe('tabsContainer', () => {
options: {}, options: {},
}; };
}); });
const groupviewMock = jest.fn<Partial<Groupview>, []>(() => { const groupviewMock = jest.fn<Partial<DockviewGroupPanelModel>, []>(
return { () => {
canDisplayOverlay: jest.fn(), return {
}; canDisplayOverlay: jest.fn(),
}); };
}
);
const groupView = new groupviewMock() as Groupview; const groupView = new groupviewMock() as DockviewGroupPanelModel;
const groupPanelMock = jest.fn<Partial<GroupPanel>, []>(() => { const groupPanelMock = jest.fn<Partial<DockviewGroupPanel>, []>(() => {
return { return {
id: 'testgroupid', id: 'testgroupid',
model: groupView, model: groupView,
@ -279,7 +289,7 @@ describe('tabsContainer', () => {
}); });
const accessor = new accessorMock() as DockviewComponent; const accessor = new accessorMock() as DockviewComponent;
const groupPanel = new groupPanelMock() as GroupPanel; const groupPanel = new groupPanelMock() as DockviewGroupPanel;
const cut = new TabsContainer(accessor, groupPanel); const cut = new TabsContainer(accessor, groupPanel);

View File

@ -30,7 +30,10 @@ import {
} from '../splitview/splitviewComponent'; } from '../splitview/splitviewComponent';
import { IView, Orientation, Sizing } from '../splitview/core/splitview'; import { IView, Orientation, Sizing } from '../splitview/core/splitview';
import { ISplitviewPanel } from '../splitview/splitviewPanel'; import { ISplitviewPanel } from '../splitview/splitviewPanel';
import { GroupPanel, IGroupviewPanel } from '../groupview/groupviewPanel'; import {
DockviewGroupPanel,
IDockviewGroupPanel,
} from '../groupview/dockviewGroupPanel';
import { Emitter, Event } from '../events'; import { Emitter, Event } from '../events';
import { IDockviewPanel } from '../dockview/dockviewPanel'; import { IDockviewPanel } from '../dockview/dockviewPanel';
import { PaneviewDropEvent } from '../paneview/draggablePaneviewPanel'; import { PaneviewDropEvent } from '../paneview/draggablePaneviewPanel';
@ -362,15 +365,15 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
return this.component.totalPanels; return this.component.totalPanels;
} }
get onDidActiveGroupChange(): Event<GroupPanel | undefined> { get onDidActiveGroupChange(): Event<DockviewGroupPanel | undefined> {
return this.component.onDidActiveGroupChange; return this.component.onDidActiveGroupChange;
} }
get onDidAddGroup(): Event<GroupPanel> { get onDidAddGroup(): Event<DockviewGroupPanel> {
return this.component.onDidAddGroup; return this.component.onDidAddGroup;
} }
get onDidRemoveGroup(): Event<GroupPanel> { get onDidRemoveGroup(): Event<DockviewGroupPanel> {
return this.component.onDidRemoveGroup; return this.component.onDidRemoveGroup;
} }
@ -402,7 +405,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
return this.component.panels; return this.component.panels;
} }
get groups(): GroupPanel[] { get groups(): DockviewGroupPanel[] {
return this.component.groups; return this.component.groups;
} }
@ -410,7 +413,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
return this.component.activePanel; return this.component.activePanel;
} }
get activeGroup(): GroupPanel | undefined { get activeGroup(): DockviewGroupPanel | undefined {
return this.component.activeGroup; return this.component.activeGroup;
} }
@ -440,7 +443,7 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
return this.component.addPanel(options); return this.component.addPanel(options);
} }
addGroup(options?: AddGroupOptions): IGroupviewPanel { addGroup(options?: AddGroupOptions): IDockviewGroupPanel {
return this.component.addGroup(options); return this.component.addGroup(options);
} }
@ -456,11 +459,11 @@ export class DockviewApi implements CommonApi<SerializedDockview> {
return this.component.closeAllGroups(); return this.component.closeAllGroups();
} }
removeGroup(group: IGroupviewPanel): void { removeGroup(group: IDockviewGroupPanel): void {
this.component.removeGroup(<GroupPanel>group); this.component.removeGroup(<DockviewGroupPanel>group);
} }
getGroup(id: string): GroupPanel | undefined { getGroup(id: string): DockviewGroupPanel | undefined {
return this.component.getPanel(id); return this.component.getPanel(id);
} }

View File

@ -1,6 +1,6 @@
import { Emitter, Event } from '../events'; import { Emitter, Event } from '../events';
import { GridviewPanelApiImpl, GridviewPanelApi } from './gridviewPanelApi'; import { GridviewPanelApiImpl, GridviewPanelApi } from './gridviewPanelApi';
import { GroupPanel } from '../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
import { MutableDisposable } from '../lifecycle'; import { MutableDisposable } from '../lifecycle';
import { IDockviewPanel } from '../dockview/dockviewPanel'; import { IDockviewPanel } from '../dockview/dockviewPanel';
@ -13,7 +13,7 @@ export interface TitleEvent {
* because it belongs to a groupview * because it belongs to a groupview
*/ */
export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible'> { export interface DockviewPanelApi extends Omit<GridviewPanelApi, 'setVisible'> {
readonly group: GroupPanel; readonly group: DockviewGroupPanel;
readonly isGroupActive: boolean; readonly isGroupActive: boolean;
readonly title: string; readonly title: string;
readonly onDidActiveGroupChange: Event<void>; readonly onDidActiveGroupChange: Event<void>;
@ -26,7 +26,7 @@ export class DockviewPanelApiImpl
extends GridviewPanelApiImpl extends GridviewPanelApiImpl
implements DockviewPanelApi implements DockviewPanelApi
{ {
private _group: GroupPanel; private _group: DockviewGroupPanel;
readonly _onDidTitleChange = new Emitter<TitleEvent>(); readonly _onDidTitleChange = new Emitter<TitleEvent>();
readonly onDidTitleChange = this._onDidTitleChange.event; readonly onDidTitleChange = this._onDidTitleChange.event;
@ -47,7 +47,7 @@ export class DockviewPanelApiImpl
return !!this.group?.isActive; return !!this.group?.isActive;
} }
set group(value: GroupPanel) { set group(value: DockviewGroupPanel) {
const isOldGroupActive = this.isGroupActive; const isOldGroupActive = this.isGroupActive;
this._group = value; this._group = value;
@ -65,11 +65,11 @@ export class DockviewPanelApiImpl
} }
} }
get group(): GroupPanel { get group(): DockviewGroupPanel {
return this._group; return this._group;
} }
constructor(private panel: IDockviewPanel, group: GroupPanel) { constructor(private panel: IDockviewPanel, group: DockviewGroupPanel) {
super(panel.id); super(panel.id);
this.initialize(panel); this.initialize(panel);

View File

@ -1,4 +1,4 @@
import { GroupPanel } from '../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
import { IDisposable } from '../lifecycle'; import { IDisposable } from '../lifecycle';
import { DragHandler } from './abstractDragHandler'; import { DragHandler } from './abstractDragHandler';
import { LocalSelectionTransfer, PanelTransfer } from './dataTransfer'; import { LocalSelectionTransfer, PanelTransfer } from './dataTransfer';
@ -11,7 +11,7 @@ export class GroupDragHandler extends DragHandler {
constructor( constructor(
element: HTMLElement, element: HTMLElement,
private readonly accessorId: string, private readonly accessorId: string,
private readonly group: GroupPanel private readonly group: DockviewGroupPanel
) { ) {
super(element); super(element);
} }

View File

@ -5,7 +5,7 @@ import {
} from '../../../groupview/types'; } from '../../../groupview/types';
import { addDisposableListener } from '../../../events'; import { addDisposableListener } from '../../../events';
import { PanelUpdateEvent } from '../../../panel/types'; import { PanelUpdateEvent } from '../../../panel/types';
import { GroupPanel } from '../../../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
import { createCloseButton } from '../../../svg'; import { createCloseButton } from '../../../svg';
export class DefaultTab extends CompositeDisposable implements ITabRenderer { export class DefaultTab extends CompositeDisposable implements ITabRenderer {
@ -77,7 +77,10 @@ export class DefaultTab extends CompositeDisposable implements ITabRenderer {
}); });
} }
public updateParentGroup(group: GroupPanel, isPanelVisible: boolean) { public updateParentGroup(
group: DockviewGroupPanel,
isPanelVisible: boolean
) {
const changed = const changed =
this._isPanelVisible !== isPanelVisible || this._isPanelVisible !== isPanelVisible ||
this._isGroupActive !== group.isActive; this._isGroupActive !== group.isActive;

View File

@ -6,7 +6,7 @@ import { ActionContainer } from '../../../actionbar/actionsContainer';
import { addDisposableListener } from '../../../events'; import { addDisposableListener } from '../../../events';
import { toggleClass } from '../../../dom'; import { toggleClass } from '../../../dom';
import { CompositeDisposable } from '../../../lifecycle'; import { CompositeDisposable } from '../../../lifecycle';
import { GroupPanel } from '../../../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../../../groupview/dockviewGroupPanel';
import { PanelUpdateEvent } from '../../../panel/types'; import { PanelUpdateEvent } from '../../../panel/types';
import { createCloseButton } from '../../../svg'; import { createCloseButton } from '../../../svg';
@ -15,7 +15,7 @@ export class Watermark
implements IWatermarkRenderer implements IWatermarkRenderer
{ {
private _element: HTMLElement; private _element: HTMLElement;
private group: GroupPanel | undefined; private group: DockviewGroupPanel | undefined;
private params: GroupPanelPartInitParameters | undefined; private params: GroupPanelPartInitParameters | undefined;
get element() { get element() {
@ -83,7 +83,7 @@ export class Watermark
this.render(); this.render();
} }
updateParentGroup(group: GroupPanel, _visible: boolean): void { updateParentGroup(group: DockviewGroupPanel, _visible: boolean): void {
this.group = group; this.group = group;
this.render(); this.render();
} }

View File

@ -1,5 +1,5 @@
import { GroupviewPanelState, ITabRenderer } from '../groupview/types'; import { GroupviewPanelState, ITabRenderer } from '../groupview/types';
import { GroupPanel } from '../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
import { DockviewPanel, IDockviewPanel } from './dockviewPanel'; import { DockviewPanel, IDockviewPanel } from './dockviewPanel';
import { IDockviewComponent } from './dockviewComponent'; import { IDockviewComponent } from './dockviewComponent';
import { createComponent } from '../panel/componentFactory'; import { createComponent } from '../panel/componentFactory';
@ -8,7 +8,10 @@ import { DockviewPanelModel } from './dockviewPanelModel';
import { DockviewApi } from '../api/component.api'; import { DockviewApi } from '../api/component.api';
export interface IPanelDeserializer { export interface IPanelDeserializer {
fromJSON(panelData: GroupviewPanelState, group: GroupPanel): IDockviewPanel; fromJSON(
panelData: GroupviewPanelState,
group: DockviewGroupPanel
): IDockviewPanel;
} }
export class DefaultDockviewDeserialzier implements IPanelDeserializer { export class DefaultDockviewDeserialzier implements IPanelDeserializer {
@ -16,7 +19,7 @@ export class DefaultDockviewDeserialzier implements IPanelDeserializer {
public fromJSON( public fromJSON(
panelData: GroupviewPanelState, panelData: GroupviewPanelState,
group: GroupPanel group: DockviewGroupPanel
): IDockviewPanel { ): IDockviewPanel {
const panelId = panelData.id; const panelId = panelData.id;
const params = panelData.params; const params = panelData.params;

View File

@ -42,8 +42,11 @@ import {
GroupOptions, GroupOptions,
GroupPanelViewState, GroupPanelViewState,
GroupviewDropEvent, GroupviewDropEvent,
} from '../groupview/groupview'; } from '../groupview/dockviewGroupPanelModel';
import { GroupPanel, IGroupviewPanel } from '../groupview/groupviewPanel'; import {
DockviewGroupPanel,
IDockviewGroupPanel,
} from '../groupview/dockviewGroupPanel';
import { DockviewPanelModel } from './dockviewPanelModel'; import { DockviewPanelModel } from './dockviewPanelModel';
import { getPanelData } from '../dnd/dataTransfer'; import { getPanelData } from '../dnd/dataTransfer';
import { DockviewDropTargets } from '../groupview/dnd'; import { DockviewDropTargets } from '../groupview/dnd';
@ -80,10 +83,10 @@ export type DockviewComponentUpdateOptions = Pick<
export interface DockviewDropEvent extends GroupviewDropEvent { export interface DockviewDropEvent extends GroupviewDropEvent {
api: DockviewApi; api: DockviewApi;
group: GroupPanel | null; group: DockviewGroupPanel | null;
} }
export interface IDockviewComponent extends IBaseGrid<GroupPanel> { export interface IDockviewComponent extends IBaseGrid<DockviewGroupPanel> {
readonly activePanel: IDockviewPanel | undefined; readonly activePanel: IDockviewPanel | undefined;
readonly totalPanels: number; readonly totalPanels: number;
readonly panels: IDockviewPanel[]; readonly panels: IDockviewPanel[];
@ -93,21 +96,21 @@ export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
deserializer: IPanelDeserializer | undefined; deserializer: IPanelDeserializer | undefined;
updateOptions(options: DockviewComponentUpdateOptions): void; updateOptions(options: DockviewComponentUpdateOptions): void;
moveGroupOrPanel( moveGroupOrPanel(
referenceGroup: GroupPanel, referenceGroup: DockviewGroupPanel,
groupId: string, groupId: string,
itemId: string, itemId: string,
target: Position, target: Position,
index?: number index?: number
): void; ): void;
doSetGroupActive: (group: GroupPanel, skipFocus?: boolean) => void; doSetGroupActive: (group: DockviewGroupPanel, skipFocus?: boolean) => void;
removeGroup: (group: GroupPanel) => void; removeGroup: (group: DockviewGroupPanel) => void;
options: DockviewComponentOptions; options: DockviewComponentOptions;
addPanel(options: AddPanelOptions): IDockviewPanel; addPanel(options: AddPanelOptions): IDockviewPanel;
removePanel(panel: IDockviewPanel): void; removePanel(panel: IDockviewPanel): void;
getGroupPanel: (id: string) => IDockviewPanel | undefined; getGroupPanel: (id: string) => IDockviewPanel | undefined;
createWatermarkComponent(): IWatermarkRenderer; createWatermarkComponent(): IWatermarkRenderer;
// lifecycle // lifecycle
addGroup(options?: AddGroupOptions): IGroupviewPanel; addGroup(options?: AddGroupOptions): IDockviewGroupPanel;
closeAllGroups(): void; closeAllGroups(): void;
// events // events
moveToNext(options?: MovementOptions): void; moveToNext(options?: MovementOptions): void;
@ -124,7 +127,7 @@ export interface IDockviewComponent extends IBaseGrid<GroupPanel> {
} }
export class DockviewComponent export class DockviewComponent
extends BaseGrid<GroupPanel> extends BaseGrid<DockviewGroupPanel>
implements IDockviewComponent implements IDockviewComponent
{ {
private readonly nextGroupId = sequentialNumberGenerator(); private readonly nextGroupId = sequentialNumberGenerator();
@ -301,7 +304,7 @@ export class DockviewComponent
this.updateWatermark(); this.updateWatermark();
} }
private orthogonalize(position: Position): GroupPanel { private orthogonalize(position: Position): DockviewGroupPanel {
switch (position) { switch (position) {
case 'top': case 'top':
case 'bottom': case 'bottom':
@ -381,7 +384,7 @@ export class DockviewComponent
} }
const location = getGridLocation(options.group.element); const location = getGridLocation(options.group.element);
const next = <GroupPanel>this.gridview.next(location)?.view; const next = <DockviewGroupPanel>this.gridview.next(location)?.view;
this.doSetGroupActive(next); this.doSetGroupActive(next);
} }
@ -403,7 +406,7 @@ export class DockviewComponent
const location = getGridLocation(options.group.element); const location = getGridLocation(options.group.element);
const next = this.gridview.previous(location)?.view; const next = this.gridview.previous(location)?.view;
if (next) { if (next) {
this.doSetGroupActive(next as GroupPanel); this.doSetGroupActive(next as DockviewGroupPanel);
} }
} }
@ -532,7 +535,7 @@ export class DockviewComponent
throw new Error(`panel with id ${options.id} already exists`); throw new Error(`panel with id ${options.id} already exists`);
} }
let referenceGroup: GroupPanel | undefined; let referenceGroup: DockviewGroupPanel | undefined;
if (options.position) { if (options.position) {
if (isPanelOptionsWithPanel(options.position)) { if (isPanelOptionsWithPanel(options.position)) {
@ -665,11 +668,11 @@ export class DockviewComponent
} }
} }
addGroup(options?: AddGroupOptions): GroupPanel { addGroup(options?: AddGroupOptions): DockviewGroupPanel {
const group = this.createGroup(); const group = this.createGroup();
if (options) { if (options) {
let referenceGroup: GroupPanel | undefined; let referenceGroup: DockviewGroupPanel | undefined;
if (isGroupOptionsWithPanel(options)) { if (isGroupOptionsWithPanel(options)) {
const referencePanel = const referencePanel =
@ -726,7 +729,7 @@ export class DockviewComponent
} }
} }
removeGroup(group: GroupPanel, skipActive = false): void { removeGroup(group: DockviewGroupPanel, skipActive = false): void {
const panels = [...group.panels]; // reassign since group panels will mutate const panels = [...group.panels]; // reassign since group panels will mutate
for (const panel of panels) { for (const panel of panels) {
@ -740,7 +743,7 @@ export class DockviewComponent
} }
moveGroupOrPanel( moveGroupOrPanel(
referenceGroup: GroupPanel, referenceGroup: DockviewGroupPanel,
groupId: string, groupId: string,
itemId: string | undefined, itemId: string | undefined,
target: Position, target: Position,
@ -831,8 +834,8 @@ export class DockviewComponent
} }
private moveGroup( private moveGroup(
sourceGroup: GroupPanel, sourceGroup: DockviewGroupPanel,
referenceGroup: GroupPanel, referenceGroup: DockviewGroupPanel,
target: Position target: Position
): void { ): void {
if (sourceGroup) { if (sourceGroup) {
@ -872,7 +875,10 @@ export class DockviewComponent
} }
} }
doSetGroupActive(group: GroupPanel | undefined, skipFocus?: boolean): void { doSetGroupActive(
group: DockviewGroupPanel | undefined,
skipFocus?: boolean
): void {
const isGroupAlreadyFocused = this._activeGroup === group; const isGroupAlreadyFocused = this._activeGroup === group;
super.doSetGroupActive(group, skipFocus); super.doSetGroupActive(group, skipFocus);
@ -881,7 +887,7 @@ export class DockviewComponent
} }
} }
createGroup(options?: GroupOptions): GroupPanel { createGroup(options?: GroupOptions): DockviewGroupPanel {
if (!options) { if (!options) {
options = { tabHeight: this.tabHeight }; options = { tabHeight: this.tabHeight };
} }
@ -905,7 +911,7 @@ export class DockviewComponent
} }
} }
const view = new GroupPanel(this, id, options); const view = new DockviewGroupPanel(this, id, options);
view.init({ params: {}, accessor: <any>null }); // required to initialized .part and allow for correct disposal of group view.init({ params: {}, accessor: <any>null }); // required to initialized .part and allow for correct disposal of group
if (!this._groups.has(view.id)) { if (!this._groups.has(view.id)) {
@ -948,7 +954,7 @@ export class DockviewComponent
private createPanel( private createPanel(
options: AddPanelOptions, options: AddPanelOptions,
group: GroupPanel group: DockviewGroupPanel
): IDockviewPanel { ): IDockviewPanel {
const contentComponent = options.component; const contentComponent = options.component;
const tabComponent = const tabComponent =
@ -976,13 +982,15 @@ export class DockviewComponent
return panel; return panel;
} }
private createGroupAtLocation(location: number[] = [0]): GroupPanel { private createGroupAtLocation(
location: number[] = [0]
): DockviewGroupPanel {
const group = this.createGroup(); const group = this.createGroup();
this.doAddGroup(group, location); this.doAddGroup(group, location);
return group; return group;
} }
private findGroup(panel: IDockviewPanel): GroupPanel | undefined { private findGroup(panel: IDockviewPanel): DockviewGroupPanel | undefined {
return Array.from(this._groups.values()).find((group) => return Array.from(this._groups.values()).find((group) =>
group.value.model.containsPanel(panel) group.value.model.containsPanel(panel)
)?.value; )?.value;

View File

@ -8,7 +8,7 @@ import {
GroupviewPanelState, GroupviewPanelState,
IGroupPanelInitParameters, IGroupPanelInitParameters,
} from '../groupview/types'; } from '../groupview/types';
import { GroupPanel } from '../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
import { CompositeDisposable, IDisposable } from '../lifecycle'; import { CompositeDisposable, IDisposable } from '../lifecycle';
import { IPanel, Parameters } from '../panel/types'; import { IPanel, Parameters } from '../panel/types';
import { IDockviewPanelModel } from './dockviewPanelModel'; import { IDockviewPanelModel } from './dockviewPanelModel';
@ -16,11 +16,11 @@ import { IDockviewComponent } from './dockviewComponent';
export interface IDockviewPanel extends IDisposable, IPanel { export interface IDockviewPanel extends IDisposable, IPanel {
readonly view: IDockviewPanelModel; readonly view: IDockviewPanelModel;
readonly group: GroupPanel; readonly group: DockviewGroupPanel;
readonly api: DockviewPanelApi; readonly api: DockviewPanelApi;
readonly title: string; readonly title: string;
readonly params: Record<string, any> | undefined; readonly params: Record<string, any> | undefined;
updateParentGroup(group: GroupPanel, isGroupActive: boolean): void; updateParentGroup(group: DockviewGroupPanel, isGroupActive: boolean): void;
init(params: IGroupPanelInitParameters): void; init(params: IGroupPanelInitParameters): void;
toJSON(): GroupviewPanelState; toJSON(): GroupviewPanelState;
update(event: GroupPanelUpdateEvent): void; update(event: GroupPanelUpdateEvent): void;
@ -31,7 +31,7 @@ export class DockviewPanel
implements IDockviewPanel implements IDockviewPanel
{ {
readonly api: DockviewPanelApiImpl; readonly api: DockviewPanelApiImpl;
private _group: GroupPanel; private _group: DockviewGroupPanel;
private _params?: Parameters; private _params?: Parameters;
private _title: string; private _title: string;
@ -44,7 +44,7 @@ export class DockviewPanel
return this._title; return this._title;
} }
get group(): GroupPanel { get group(): DockviewGroupPanel {
return this._group; return this._group;
} }
@ -52,7 +52,7 @@ export class DockviewPanel
public readonly id: string, public readonly id: string,
accessor: IDockviewComponent, accessor: IDockviewComponent,
private readonly containerApi: DockviewApi, private readonly containerApi: DockviewApi,
group: GroupPanel, group: DockviewGroupPanel,
readonly view: IDockviewPanelModel readonly view: IDockviewPanelModel
) { ) {
super(); super();
@ -139,7 +139,10 @@ export class DockviewPanel
}); });
} }
public updateParentGroup(group: GroupPanel, isGroupActive: boolean): void { public updateParentGroup(
group: DockviewGroupPanel,
isGroupActive: boolean
): void {
this._group = group; this._group = group;
this.api.group = group; this.api.group = group;

View File

@ -5,7 +5,7 @@ import {
ITabRenderer, ITabRenderer,
GroupPanelUpdateEvent, GroupPanelUpdateEvent,
} from '../groupview/types'; } from '../groupview/types';
import { GroupPanel } from '../groupview/groupviewPanel'; import { DockviewGroupPanel } from '../groupview/dockviewGroupPanel';
import { IDisposable } from '../lifecycle'; import { IDisposable } from '../lifecycle';
import { createComponent } from '../panel/componentFactory'; import { createComponent } from '../panel/componentFactory';
import { IDockviewComponent } from './dockviewComponent'; import { IDockviewComponent } from './dockviewComponent';
@ -23,14 +23,14 @@ export interface IDockviewPanelModel extends IDisposable {
update(event: GroupPanelUpdateEvent): void; update(event: GroupPanelUpdateEvent): void;
layout(width: number, height: number): void; layout(width: number, height: number): void;
init(params: GroupPanelPartInitParameters): void; init(params: GroupPanelPartInitParameters): void;
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void; updateParentGroup(group: DockviewGroupPanel, isPanelVisible: boolean): void;
} }
export class DockviewPanelModel implements IDockviewPanelModel { export class DockviewPanelModel implements IDockviewPanelModel {
private readonly _content: IContentRenderer; private readonly _content: IContentRenderer;
private readonly _tab: ITabRenderer; private readonly _tab: ITabRenderer;
private _group: GroupPanel | null = null; private _group: DockviewGroupPanel | null = null;
private _isPanelVisible: boolean | null = null; private _isPanelVisible: boolean | null = null;
get content(): IContentRenderer { get content(): IContentRenderer {
@ -57,7 +57,10 @@ export class DockviewPanelModel implements IDockviewPanelModel {
this.tab.init(params); this.tab.init(params);
} }
updateParentGroup(group: GroupPanel, isPanelVisible: boolean): void { updateParentGroup(
group: DockviewGroupPanel,
isPanelVisible: boolean
): void {
if (group !== this._group) { if (group !== this._group) {
this._group = group; this._group = group;
if (this._content.onGroupChange) { if (this._content.onGroupChange) {

View File

@ -7,7 +7,10 @@ import {
WatermarkConstructor, WatermarkConstructor,
IWatermarkRenderer, IWatermarkRenderer,
} from '../groupview/types'; } from '../groupview/types';
import { GroupPanel, GroupviewPanelApi } from '../groupview/groupviewPanel'; import {
DockviewGroupPanel,
DockviewGroupPanelApi,
} from '../groupview/dockviewGroupPanel';
import { ISplitviewStyles, Orientation } from '../splitview/core/splitview'; import { ISplitviewStyles, Orientation } from '../splitview/core/splitview';
import { FrameworkFactory } from '../types'; import { FrameworkFactory } from '../types';
import { DockviewDropTargets } from '../groupview/dnd'; import { DockviewDropTargets } from '../groupview/dnd';
@ -18,7 +21,10 @@ import { IDockviewPanel } from './dockviewPanel';
export interface IGroupControlRenderer extends IDisposable { export interface IGroupControlRenderer extends IDisposable {
readonly element: HTMLElement; readonly element: HTMLElement;
init(params: { containerApi: DockviewApi; api: GroupviewPanelApi }): void; init(params: {
containerApi: DockviewApi;
api: DockviewGroupPanelApi;
}): void;
} }
export interface GroupPanelFrameworkComponentFactory { export interface GroupPanelFrameworkComponentFactory {
@ -61,7 +67,7 @@ export interface DockviewDndOverlayEvent {
nativeEvent: DragEvent; nativeEvent: DragEvent;
target: DockviewDropTargets; target: DockviewDropTargets;
position: Position; position: Position;
group?: GroupPanel; group?: DockviewGroupPanel;
getData: () => PanelTransfer | undefined; getData: () => PanelTransfer | undefined;
} }
@ -74,7 +80,9 @@ export interface DockviewComponentOptions extends DockviewRenderFunctions {
styles?: ISplitviewStyles; styles?: ISplitviewStyles;
defaultTabComponent?: string; defaultTabComponent?: string;
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean; showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
createGroupControlElement?: (group: GroupPanel) => IGroupControlRenderer; createGroupControlElement?: (
group: DockviewGroupPanel
) => IGroupControlRenderer;
singleTabMode?: 'fullwidth' | 'default'; singleTabMode?: 'fullwidth' | 'default';
} }
@ -93,7 +101,7 @@ type RelativePanel = {
type RelativeGroup = { type RelativeGroup = {
direction?: Direction; direction?: Direction;
referenceGroup: string | GroupPanel; referenceGroup: string | DockviewGroupPanel;
}; };
type AbsolutePosition = { type AbsolutePosition = {
@ -136,7 +144,7 @@ type AddGroupOptionsWithPanel = {
}; };
type AddGroupOptionsWithGroup = { type AddGroupOptionsWithGroup = {
referenceGroup: string | GroupPanel; referenceGroup: string | DockviewGroupPanel;
direction?: Omit<Direction, 'within'>; direction?: Omit<Direction, 'within'>;
}; };
@ -169,5 +177,5 @@ export interface MovementOptions2 {
export interface MovementOptions extends MovementOptions2 { export interface MovementOptions extends MovementOptions2 {
includePanel?: boolean; includePanel?: boolean;
group?: GroupPanel; group?: DockviewGroupPanel;
} }

View File

@ -1,24 +1,31 @@
import { IFrameworkPart } from '../panel/types'; import { IFrameworkPart } from '../panel/types';
import { DockviewComponent } from '../dockview/dockviewComponent'; import { DockviewComponent } from '../dockview/dockviewComponent';
import { GridviewPanelApi } from '../api/gridviewPanelApi'; import { GridviewPanelApi } from '../api/gridviewPanelApi';
import { Groupview, GroupOptions, IHeader } from './groupview'; import {
DockviewGroupPanelModel,
GroupOptions,
IHeader,
} from './dockviewGroupPanelModel';
import { GridviewPanel, IGridviewPanel } from '../gridview/gridviewPanel'; import { GridviewPanel, IGridviewPanel } from '../gridview/gridviewPanel';
import { IDockviewPanel } from '../dockview/dockviewPanel'; import { IDockviewPanel } from '../dockview/dockviewPanel';
export interface IGroupviewPanel extends IGridviewPanel { export interface IDockviewGroupPanel extends IGridviewPanel {
model: Groupview; model: DockviewGroupPanelModel;
locked: boolean; locked: boolean;
readonly size: number; readonly size: number;
readonly panels: IDockviewPanel[]; readonly panels: IDockviewPanel[];
readonly activePanel: IDockviewPanel | undefined; readonly activePanel: IDockviewPanel | undefined;
} }
export type IGroupviewPanelPublic = IGroupviewPanel; export type IDockviewGroupPanelPublic = IDockviewGroupPanel;
export type GroupviewPanelApi = GridviewPanelApi; export type DockviewGroupPanelApi = GridviewPanelApi;
export class GroupPanel extends GridviewPanel implements IGroupviewPanel { export class DockviewGroupPanel
private readonly _model: Groupview; extends GridviewPanel
implements IDockviewGroupPanel
{
private readonly _model: DockviewGroupPanelModel;
get panels(): IDockviewPanel[] { get panels(): IDockviewPanel[] {
return this._model.panels; return this._model.panels;
@ -32,7 +39,7 @@ export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
return this._model.size; return this._model.size;
} }
get model(): Groupview { get model(): DockviewGroupPanelModel {
return this._model; return this._model;
} }
@ -71,7 +78,13 @@ export class GroupPanel extends GridviewPanel implements IGroupviewPanel {
) { ) {
super(id, 'groupview_default'); super(id, 'groupview_default');
this._model = new Groupview(this.element, accessor, id, options, this); this._model = new DockviewGroupPanelModel(
this.element,
accessor,
id,
options,
this
);
} }
initialize() { initialize() {

View File

@ -11,19 +11,19 @@ import { PanelInitParameters, PanelUpdateEvent } from '../panel/types';
import { ContentContainer, IContentContainer } from './panel/content'; import { ContentContainer, IContentContainer } from './panel/content';
import { ITabsContainer, TabsContainer } from './titlebar/tabsContainer'; import { ITabsContainer, TabsContainer } from './titlebar/tabsContainer';
import { IWatermarkRenderer } from './types'; import { IWatermarkRenderer } from './types';
import { GroupPanel } from './groupviewPanel'; import { DockviewGroupPanel } from './dockviewGroupPanel';
import { DockviewDropTargets } from './dnd'; import { DockviewDropTargets } from './dnd';
import { IDockviewPanel } from '../dockview/dockviewPanel'; import { IDockviewPanel } from '../dockview/dockviewPanel';
import { IGroupControlRenderer } from '../dockview/options'; import { IGroupControlRenderer } from '../dockview/options';
export interface DndService { export interface DndService {
canDisplayOverlay( canDisplayOverlay(
group: IGroupview, group: IDockviewGroupPanelModel,
event: DragEvent, event: DragEvent,
target: DockviewDropTargets target: DockviewDropTargets
): boolean; ): boolean;
onDrop( onDrop(
group: IGroupview, group: IDockviewGroupPanelModel,
event: DragEvent, event: DragEvent,
position: Position, position: Position,
index?: number index?: number
@ -77,7 +77,7 @@ export interface IHeader {
height: number | undefined; height: number | undefined;
} }
export interface IGroupview extends IGridPanelView { export interface IDockviewGroupPanelModel extends IGridPanelView {
readonly isActive: boolean; readonly isActive: boolean;
readonly size: number; readonly size: number;
readonly panels: IDockviewPanel[]; readonly panels: IDockviewPanel[];
@ -117,7 +117,10 @@ export interface IGroupview extends IGridPanelView {
): boolean; ): boolean;
} }
export class Groupview extends CompositeDisposable implements IGroupview { export class DockviewGroupPanelModel
extends CompositeDisposable
implements IDockviewGroupPanelModel
{
private readonly tabsContainer: ITabsContainer; private readonly tabsContainer: ITabsContainer;
private readonly contentContainer: IContentContainer; private readonly contentContainer: IContentContainer;
private readonly dropTarget: Droptarget; private readonly dropTarget: Droptarget;
@ -232,7 +235,7 @@ export class Groupview extends CompositeDisposable implements IGroupview {
private accessor: DockviewComponent, private accessor: DockviewComponent,
public id: string, public id: string,
private readonly options: GroupOptions, private readonly options: GroupOptions,
private readonly groupPanel: GroupPanel private readonly groupPanel: DockviewGroupPanel
) { ) {
super(); super();

View File

@ -8,7 +8,7 @@ import {
import { toggleClass } from '../dom'; import { toggleClass } from '../dom';
import { IDockviewComponent } from '../dockview/dockviewComponent'; import { IDockviewComponent } from '../dockview/dockviewComponent';
import { ITabRenderer } from './types'; import { ITabRenderer } from './types';
import { GroupPanel } from './groupviewPanel'; import { DockviewGroupPanel } from './dockviewGroupPanel';
import { DroptargetEvent, Droptarget } from '../dnd/droptarget'; import { DroptargetEvent, Droptarget } from '../dnd/droptarget';
import { DockviewDropTargets } from './dnd'; import { DockviewDropTargets } from './dnd';
import { DragHandler } from '../dnd/abstractDragHandler'; import { DragHandler } from '../dnd/abstractDragHandler';
@ -40,7 +40,7 @@ export class Tab extends CompositeDisposable implements ITab {
constructor( constructor(
public readonly panelId: string, public readonly panelId: string,
private readonly accessor: IDockviewComponent, private readonly accessor: IDockviewComponent,
private readonly group: GroupPanel private readonly group: DockviewGroupPanel
) { ) {
super(); super();

View File

@ -6,7 +6,7 @@ import {
import { addDisposableListener, Emitter, Event } from '../../events'; import { addDisposableListener, Emitter, Event } from '../../events';
import { ITab, Tab } from '../tab'; import { ITab, Tab } from '../tab';
import { DockviewComponent } from '../../dockview/dockviewComponent'; import { DockviewComponent } from '../../dockview/dockviewComponent';
import { GroupPanel } from '../groupviewPanel'; import { DockviewGroupPanel } from '../dockviewGroupPanel';
import { VoidContainer } from './voidContainer'; import { VoidContainer } from './voidContainer';
import { toggleClass } from '../../dom'; import { toggleClass } from '../../dom';
import { IDockviewPanel } from '../../dockview/dockviewPanel'; import { IDockviewPanel } from '../../dockview/dockviewPanel';
@ -135,7 +135,7 @@ export class TabsContainer
constructor( constructor(
private readonly accessor: DockviewComponent, private readonly accessor: DockviewComponent,
private readonly group: GroupPanel private readonly group: DockviewGroupPanel
) { ) {
super(); super();

View File

@ -6,7 +6,7 @@ import { DockviewComponent } from '../../dockview/dockviewComponent';
import { addDisposableListener, Emitter, Event } from '../../events'; import { addDisposableListener, Emitter, Event } from '../../events';
import { CompositeDisposable } from '../../lifecycle'; import { CompositeDisposable } from '../../lifecycle';
import { DockviewDropTargets } from '../dnd'; import { DockviewDropTargets } from '../dnd';
import { GroupPanel } from '../groupviewPanel'; import { DockviewGroupPanel } from '../dockviewGroupPanel';
export class VoidContainer extends CompositeDisposable { export class VoidContainer extends CompositeDisposable {
private readonly _element: HTMLElement; private readonly _element: HTMLElement;
@ -21,7 +21,7 @@ export class VoidContainer extends CompositeDisposable {
constructor( constructor(
private readonly accessor: DockviewComponent, private readonly accessor: DockviewComponent,
private readonly group: GroupPanel private readonly group: DockviewGroupPanel
) { ) {
super(); super();

View File

@ -7,7 +7,7 @@ import {
Parameters, Parameters,
} from '../panel/types'; } from '../panel/types';
import { DockviewApi } from '../api/component.api'; import { DockviewApi } from '../api/component.api';
import { GroupPanel } from './groupviewPanel'; import { DockviewGroupPanel } from './dockviewGroupPanel';
import { Event } from '../events'; import { Event } from '../events';
import { import {
IDockviewPanelModel, IDockviewPanelModel,
@ -38,7 +38,7 @@ export interface IWatermarkRenderer
> { > {
readonly element: HTMLElement; readonly element: HTMLElement;
init: (params: GroupPanelPartInitParameters) => void; init: (params: GroupPanelPartInitParameters) => void;
updateParentGroup(group: GroupPanel, visible: boolean): void; updateParentGroup(group: DockviewGroupPanel, visible: boolean): void;
} }
export interface ITabRenderer export interface ITabRenderer
@ -48,7 +48,7 @@ export interface ITabRenderer
> { > {
readonly element: HTMLElement; readonly element: HTMLElement;
init(parameters: GroupPanelPartInitParameters): void; init(parameters: GroupPanelPartInitParameters): void;
onGroupChange?(group: GroupPanel): void; onGroupChange?(group: DockviewGroupPanel): void;
onPanelVisibleChange?(isPanelVisible: boolean): void; onPanelVisibleChange?(isPanelVisible: boolean): void;
} }
@ -61,7 +61,7 @@ export interface IContentRenderer
readonly onDidFocus?: Event<void>; readonly onDidFocus?: Event<void>;
readonly onDidBlur?: Event<void>; readonly onDidBlur?: Event<void>;
init(parameters: GroupPanelContentPartInitParameters): void; init(parameters: GroupPanelContentPartInitParameters): void;
onGroupChange?(group: GroupPanel): void; onGroupChange?(group: DockviewGroupPanel): void;
onPanelVisibleChange?(isPanelVisible: boolean): void; onPanelVisibleChange?(isPanelVisible: boolean): void;
} }

View File

@ -23,7 +23,7 @@ export * from './splitview/core/options';
export * from './paneview/paneview'; export * from './paneview/paneview';
export * from './gridview/gridview'; export * from './gridview/gridview';
export * from './groupview/groupview'; export * from './groupview/dockviewGroupPanelModel';
export * from './gridview/baseComponentGridview'; export * from './gridview/baseComponentGridview';
export * from './paneview/draggablePaneviewPanel'; export * from './paneview/draggablePaneviewPanel';
@ -32,7 +32,7 @@ export * from './groupview/panel/content';
export * from './groupview/tab'; export * from './groupview/tab';
export * from './groupview/dnd'; export * from './groupview/dnd';
export * from './groupview/types'; export * from './groupview/types';
export * from './groupview/groupviewPanel'; export * from './groupview/dockviewGroupPanel';
export * from './dockview/options'; export * from './dockview/options';
export * from './dockview/dockviewPanel'; export * from './dockview/dockviewPanel';

View File

@ -3,7 +3,7 @@ import { ReactPart, ReactPortalStore } from '../react';
import { IDockviewPanelProps } from '../dockview/dockview'; import { IDockviewPanelProps } from '../dockview/dockview';
import { import {
DockviewEmitter, DockviewEmitter,
Event, DockviewEvent,
GroupPanel, GroupPanel,
PanelUpdateEvent, PanelUpdateEvent,
IContentRenderer, IContentRenderer,
@ -17,10 +17,10 @@ export class ReactPanelContentPart implements IContentRenderer {
private _group: GroupPanel | undefined; private _group: GroupPanel | undefined;
private readonly _onDidFocus = new DockviewEmitter<void>(); private readonly _onDidFocus = new DockviewEmitter<void>();
readonly onDidFocus: Event<void> = this._onDidFocus.event; readonly onDidFocus: DockviewEvent<void> = this._onDidFocus.event;
private readonly _onDidBlur = new DockviewEmitter<void>(); private readonly _onDidBlur = new DockviewEmitter<void>();
readonly onDidBlur: Event<void> = this._onDidBlur.event; readonly onDidBlur: DockviewEvent<void> = this._onDidBlur.event;
get element(): HTMLElement { get element(): HTMLElement {
return this._element; return this._element;