From 0d34d7285ec649b5f6430f8265d8e2765b464ebc Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Tue, 27 Feb 2024 19:29:54 +0800 Subject: [PATCH] fix(typo): onlyWhenVisibile -> onlyWhenVisible --- .../dockview/components/panel/content.spec.ts | 12 +- .../dockview/dockviewGroupPanelModel.spec.ts | 46 +- .../__tests__/dockview/dockviewPanel.spec.ts | 12 +- .../src/dockview/components/panel/content.ts | 4 +- .../src/dockview/dockviewComponent.ts | 2 +- .../src/overlayRenderContainer.ts | 2 +- .../react/dockview/render-mode/src/app.tsx | 4 +- packages/docs/src/generated/api.output.json | 136 ++-- yarn.lock | 747 ++---------------- 9 files changed, 186 insertions(+), 779 deletions(-) diff --git a/packages/dockview-core/src/__tests__/dockview/components/panel/content.spec.ts b/packages/dockview-core/src/__tests__/dockview/components/panel/content.spec.ts index 670c981d8..5da5ea250 100644 --- a/packages/dockview-core/src/__tests__/dockview/components/panel/content.spec.ts +++ b/packages/dockview-core/src/__tests__/dockview/components/panel/content.spec.ts @@ -68,7 +68,7 @@ describe('contentContainer', () => { const cut = new ContentContainer( fromPartial({ - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', overlayRenderContainer, }), fromPartial({ @@ -91,7 +91,7 @@ describe('contentContainer', () => { view: { content: contentRenderer, }, - api: { renderer: 'onlyWhenVisibile' }, + api: { renderer: 'onlyWhenVisible' }, }); cut.openPanel(panel as IDockviewPanel); @@ -126,7 +126,7 @@ describe('contentContainer', () => { view: { content: contentRenderer2, } as Partial, - api: { renderer: 'onlyWhenVisibile' }, + api: { renderer: 'onlyWhenVisible' }, } as Partial; cut.openPanel(panel2 as IDockviewPanel); @@ -153,7 +153,7 @@ describe('contentContainer', () => { disposable.dispose(); }); - test("that panels renderered as 'onlyWhenVisibile' are removed when closed", () => { + test("that panels renderered as 'onlyWhenVisible' are removed when closed", () => { const overlayRenderContainer = fromPartial({ detatch: jest.fn(), }); @@ -169,14 +169,14 @@ describe('contentContainer', () => { const panel1 = fromPartial({ api: { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }, view: { content: new TestContentRenderer('panel_1') }, }); const panel2 = fromPartial({ api: { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }, view: { content: new TestContentRenderer('panel_2') }, }); diff --git a/packages/dockview-core/src/__tests__/dockview/dockviewGroupPanelModel.spec.ts b/packages/dockview-core/src/__tests__/dockview/dockviewGroupPanelModel.spec.ts index b1963dbe5..b4666f113 100644 --- a/packages/dockview-core/src/__tests__/dockview/dockviewGroupPanelModel.spec.ts +++ b/packages/dockview-core/src/__tests__/dockview/dockviewGroupPanelModel.spec.ts @@ -266,13 +266,13 @@ describe('dockviewGroupPanelModel', () => { test('panel events are captured during de-serialization', () => { const panel1 = new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel2 = new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel3 = new TestPanel('panel3', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const groupview2 = new DockviewGroupPanel(dockview, 'groupview-2', { @@ -358,13 +358,13 @@ describe('dockviewGroupPanelModel', () => { ); const panel1 = new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel2 = new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel3 = new TestPanel('panel3', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); expect(events.length).toBe(0); @@ -444,13 +444,13 @@ describe('dockviewGroupPanelModel', () => { test('moveToPrevious and moveToNext', () => { const panel1 = new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel2 = new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel3 = new TestPanel('panel3', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); groupview.model.openPanel(panel1); @@ -496,13 +496,13 @@ describe('dockviewGroupPanelModel', () => { test('closeAllPanels with panels', () => { const panel1 = new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel2 = new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); const panel3 = new TestPanel('panel3', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); groupview.model.openPanel(panel1); @@ -609,7 +609,7 @@ describe('dockviewGroupPanelModel', () => { .item(0)!.childNodes; const panel1 = new TestPanel('id_1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); cut.openPanel(panel1); @@ -617,7 +617,7 @@ describe('dockviewGroupPanelModel', () => { expect(contentContainer.item(0)).toBe(panel1.view.content.element); const panel2 = new TestPanel('id_2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); cut.openPanel(panel2); @@ -625,7 +625,7 @@ describe('dockviewGroupPanelModel', () => { expect(contentContainer.item(0)).toBe(panel2.view.content.element); const panel3 = new TestPanel('id_2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any); cut.openPanel(panel3, { skipSetActive: true }); @@ -836,7 +836,7 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); @@ -910,12 +910,12 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); cut.openPanel( new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); @@ -989,12 +989,12 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); cut.openPanel( new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); @@ -1099,7 +1099,7 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); @@ -1113,7 +1113,7 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel2', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); @@ -1135,7 +1135,7 @@ describe('dockviewGroupPanelModel', () => { cut.openPanel( new TestPanel('panel1', { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', } as any) ); diff --git a/packages/dockview-core/src/__tests__/dockview/dockviewPanel.spec.ts b/packages/dockview-core/src/__tests__/dockview/dockviewPanel.spec.ts index a7381e191..10d103ff9 100644 --- a/packages/dockview-core/src/__tests__/dockview/dockviewPanel.spec.ts +++ b/packages/dockview-core/src/__tests__/dockview/dockviewPanel.spec.ts @@ -30,7 +30,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); let latestTitle: string | undefined = undefined; @@ -77,7 +77,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); cut.init({ title: 'myTitle', params: {} }); @@ -114,7 +114,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); cut.init({ params: {}, title: 'title' }); @@ -148,7 +148,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); expect(cut.params).toEqual(undefined); @@ -186,7 +186,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); cut.api.setSize({ height: 123, width: 456 }); @@ -219,7 +219,7 @@ describe('dockviewPanel', () => { const model = new panelModelMock(); const cut = new DockviewPanel('fake-id', accessor, api, group, model, { - renderer: 'onlyWhenVisibile', + renderer: 'onlyWhenVisible', }); cut.init({ params: { a: '1', b: '2' }, title: 'A title' }); diff --git a/packages/dockview-core/src/dockview/components/panel/content.ts b/packages/dockview-core/src/dockview/components/panel/content.ts index 1d5b8912d..50e7b4015 100644 --- a/packages/dockview-core/src/dockview/components/panel/content.ts +++ b/packages/dockview-core/src/dockview/components/panel/content.ts @@ -132,7 +132,7 @@ export class ContentContainer let container: HTMLElement; switch (panel.api.renderer) { - case 'onlyWhenVisibile': + case 'onlyWhenVisible': this.group.renderContainer.detatch(panel); if (this.panel) { if (doRender) { @@ -198,7 +198,7 @@ export class ContentContainer public closePanel(): void { if (this.panel) { - if (this.panel.api.renderer === 'onlyWhenVisibile') { + if (this.panel.api.renderer === 'onlyWhenVisible') { this.panel.view.content.element.parentElement?.removeChild( this.panel.view.content.element ); diff --git a/packages/dockview-core/src/dockview/dockviewComponent.ts b/packages/dockview-core/src/dockview/dockviewComponent.ts index 9b33959ab..8dd03c62c 100644 --- a/packages/dockview-core/src/dockview/dockviewComponent.ts +++ b/packages/dockview-core/src/dockview/dockviewComponent.ts @@ -425,7 +425,7 @@ export class DockviewComponent } get renderer(): DockviewPanelRenderer { - return this.options.defaultRenderer ?? 'onlyWhenVisibile'; + return this.options.defaultRenderer ?? 'onlyWhenVisible'; } constructor(options: DockviewComponentOptions) { diff --git a/packages/dockview-core/src/overlayRenderContainer.ts b/packages/dockview-core/src/overlayRenderContainer.ts index 84c0f0cb0..c7eb1d2b5 100644 --- a/packages/dockview-core/src/overlayRenderContainer.ts +++ b/packages/dockview-core/src/overlayRenderContainer.ts @@ -4,7 +4,7 @@ import { getDomNodePagePosition, toggleClass } from './dom'; import { CompositeDisposable, Disposable, IDisposable } from './lifecycle'; import { IDockviewPanel } from './dockview/dockviewPanel'; -export type DockviewPanelRenderer = 'onlyWhenVisibile' | 'always'; +export type DockviewPanelRenderer = 'onlyWhenVisible' | 'always'; export interface IRenderable { readonly element: HTMLElement; diff --git a/packages/docs/sandboxes/react/dockview/render-mode/src/app.tsx b/packages/docs/sandboxes/react/dockview/render-mode/src/app.tsx index e2809f250..13ed9ba19 100644 --- a/packages/docs/sandboxes/react/dockview/render-mode/src/app.tsx +++ b/packages/docs/sandboxes/react/dockview/render-mode/src/app.tsx @@ -55,9 +55,9 @@ const components = {