Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Please see the website: https://dockview.dev

| Package | Description | Version |
| --- | --- | --- |
| [`dockview`](https://www.npmjs.com/package/dockview) | JavaScript zero dependencies, full feature set out of the box | [![npm version](https://badge.fury.io/js/dockview.svg)](https://www.npmjs.com/package/dockview) |
| [`dockview`](https://www.npmjs.com/package/dockview) | JavaScript, zero dependencies, full feature set out of the box | [![npm version](https://badge.fury.io/js/dockview.svg)](https://www.npmjs.com/package/dockview) |
| [`dockview-react`](https://www.npmjs.com/package/dockview-react) | React bindings (peer: `react` ≥16.8) | [![npm version](https://badge.fury.io/js/dockview-react.svg)](https://www.npmjs.com/package/dockview-react) |
| [`dockview-vue`](https://www.npmjs.com/package/dockview-vue) | Vue 3 bindings (peer: `vue` ≥3.4) | [![npm version](https://badge.fury.io/js/dockview-vue.svg)](https://www.npmjs.com/package/dockview-vue) |
| [`dockview-angular`](https://www.npmjs.com/package/dockview-angular) | Angular bindings (peer: `@angular/core` ≥21) | [![npm version](https://badge.fury.io/js/dockview-angular.svg)](https://www.npmjs.com/package/dockview-angular) |
Expand Down Expand Up @@ -111,7 +111,7 @@ Contributions are welcome! Please open an [issue](https://github.com/mathuo/dock

## License

MIT — see [LICENSE](./LICENSE) for details.
MIT. See [LICENSE](./LICENSE) for details.

---

Expand Down
6 changes: 3 additions & 3 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ This mono-repository has a number of packages containing the code for the dockvi

## dockview

- The batteries-included JavaScript package re-exports the core API and registers the separable feature modules so consumers get the full feature set out of the box.
- The batteries-included JavaScript package. It re-exports the core API and registers the separable feature modules so consumers get the full feature set out of the box.
- The package framework-agnostic consumers should install (`npm install dockview`).
- Has no `react` peer dependency; framework bindings live in the `dockview-<framework>` packages.
- Published as [dockview](https://www.npmjs.com/package/dockview) on npm.

## dockview-react

- The React bindings package — holds the actual React source (`DockviewReact`, hooks, portal bridge).
- The React bindings package. Holds the actual React source (`DockviewReact`, hooks, portal bridge).
- Depends on `dockview`; peer dependency on `react`.
- Published as [dockview-react](https://www.npmjs.com/package/dockview-react) on npm the canonical install name for React.
- Published as [dockview-react](https://www.npmjs.com/package/dockview-react) on npm, the canonical install name for React.

## docs

Expand Down
2 changes: 1 addition & 1 deletion packages/dockview-angular/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<h1>dockview-angular</h1>

<p>Angular bindings for dockview zero dependency layout manager supporting tabs, groups, grids and splitviews</p>
<p>Angular bindings for dockview, a zero dependency layout manager supporting tabs, groups, grids and splitviews</p>

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ describe('AngularHeaderActionsRenderer', () => {

renderer.dispose();

// After dispose, firing further events must not throw disposal
// After dispose, firing further events must not throw; disposal
// should have unsubscribed every handler.
expect(() => {
group.model.panels.push({ id: 'late' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('AngularRenderer', () => {
it('should still expose its element after dispose (regression #1220)', () => {
// Reproduces the disposal-order bug from issue #1220: dockview-core's
// OverlayRenderContainer reads `panel.view.content.element` while
// tearing down its own disposables by which point the renderer has
// tearing down its own disposables, by which point the renderer has
// already been disposed. Previously the getter threw "Angular
// renderer not initialized" here.
const renderer = new AngularRenderer<TestComponent>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class AngularRenderer<T = unknown>
}
// Intentionally retain `_element` after dispose. Dockview's overlay
// teardown reads `panel.view.content.element` while removing the node
// from its overlay parent nulling here would make the getter throw
// from its overlay parent, so nulling here would make the getter throw
// mid-cascade. The HTMLElement reference is cheap and will be GC'd
// when the renderer itself is collected.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AngularFrameworkComponentFactory {
* Refresh the component maps in place so that rebinding an `@Input()`
* component map (e.g. `[components]`) after init is honoured. The core
* calls the factory live on each panel creation, so updating these
* references is enough — no re-init required.
* references is enough. No re-init required.
*/
updateComponents(maps: {
components: Record<string, Type<any> | TemplateRef<any>>;
Expand Down
4 changes: 2 additions & 2 deletions packages/dockview-core/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<h1>dockview-core</h1>

<p>Framework-agnostic core layout engine zero dependencies, JavaScript. Supports tabs, groups, grids and splitviews</p>
<p>Framework-agnostic core layout engine, zero dependencies, JavaScript. Supports tabs, groups, grids and splitviews</p>

</div>

Expand All @@ -21,7 +21,7 @@
Please see the website: https://dockview.dev

> **`dockview-core` is an internal package.** Install
> **[`dockview`](https://www.npmjs.com/package/dockview)** insteadthe JavaScript
> **[`dockview`](https://www.npmjs.com/package/dockview)** instead, the
> JavaScript / TypeScript package that ships the full feature set out of the box. Using a
> framework? Install the bindings: [`dockview-react`](https://www.npmjs.com/package/dockview-react),
> [`dockview-vue`](https://www.npmjs.com/package/dockview-vue) or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('DockviewGroupPanelApiImpl', () => {
'test-id',
accessor as unknown as DockviewComponent
);
// _group is undefined no initialize() call
// _group is undefined, no initialize() call

expect(() => cut.collapse()).not.toThrow();
expect(accessor.setEdgeGroupCollapsed).not.toHaveBeenCalled();
Expand All @@ -106,7 +106,7 @@ describe('DockviewGroupPanelApiImpl', () => {
);

expect(cut.isCollapsed()).toBe(false);
// accessor should NOT have been called since there is no group
// accessor should not have been called since there is no group
expect(accessor.isEdgeGroupCollapsed).not.toHaveBeenCalled();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('droptarget', () => {
createOffsetDragOverEvent({ clientX: 100, clientY: 50 })
);

// 100,50 within 200x100 is the centre by default the resolver wins.
// 100,50 within 200x100 is the centre by default, but the resolver wins.
expect(droptarget.state).toBe('right');
expect(calls[0]).toMatchObject({
x: 100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ describe('LongPressDetector', () => {
});

fireEvent.pointerDown(element, pointerInit());
// Within tolerance must not cancel.
// Within tolerance, so it must not cancel.
fireEvent.pointerMove(window, pointerInit({ clientX: 5 }));
jest.advanceTimersByTime(250);
// Beyond tolerance must cancel.
// Beyond tolerance, so it must cancel.
fireEvent.pointerMove(window, pointerInit({ clientX: 20 }));
jest.advanceTimersByTime(500);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ describe('PointerDragController', () => {
getData: () => ({ dispose: jest.fn() }),
});

// First move pointer is over the target.
// First move: pointer is over the target.
spy.mockReturnValue([targetEl]);
window.dispatchEvent(
makePointerEvent('pointermove', { clientX: 10, clientY: 10 })
);

// Second move pointer is off-target.
// Second move: pointer is off-target.
spy.mockReturnValue([]);
window.dispatchEvent(
makePointerEvent('pointermove', { clientX: 500, clientY: 500 })
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('PointerDragController', () => {
getData: () => ({ dispose: jest.fn() }),
});

// Different pointerIdmust NOT route through the target.
// Different pointerId, so this must not route through the target.
window.dispatchEvent(
makePointerEvent('pointermove', {
pointerId: 2,
Expand All @@ -285,9 +285,9 @@ describe('PointerDragController', () => {
});

test('hit-testing prefers the inner / more-specific target when nested targets overlap', () => {
// Regression: previously `_findTargetUnder` accepted ANY registered
// Regression: previously `_findTargetUnder` accepted any registered
// target whose element contains the cursor element. Because the
// layout-root drop target is registered first AND contains every
// layout-root drop target is registered first and contains every
// tab, it always won the race and per-tab targets were unreachable.
const controller = PointerDragController.getInstance();

Expand Down Expand Up @@ -316,7 +316,7 @@ describe('PointerDragController', () => {
makePointerEvent('pointermove', { clientX: 10, clientY: 10 })
);

// Inner target should have received the drag-over; root must NOT
// Inner target should have received the drag-over; root must not
// have received it (it'd have eclipsed inner under the old logic).
expect(innerHandle.handleDragOver).toHaveBeenCalled();
expect(rootHandle.handleDragOver).not.toHaveBeenCalled();
Expand All @@ -332,7 +332,7 @@ describe('PointerDragController', () => {
test("beginDrag shields iframes in the source's owning document; teardown releases", () => {
const controller = PointerDragController.getInstance();

// Build iframes in the main document — these would otherwise
// Build iframes in the main document. They would otherwise
// capture pointermove events once the cursor crosses into them
// and freeze the drag.
const iframe = document.createElement('iframe');
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('PointerDragController', () => {

describe("listener attachment honours the source's owning window", () => {
test("pointermove from source's owning window is routed to the controller", () => {
// Build an iframe stand-in for a popout window so we get a
// Build an iframe (stand-in for a popout window) so we get a
// real `contentWindow` distinct from the main `window`. Verifies
// that the controller listens on the source's owning window, not
// on the main `window`.
Expand Down Expand Up @@ -428,7 +428,7 @@ describe('PointerDragController', () => {
getData: () => ({ dispose: jest.fn() }),
});

// Fire the move on the popout window (NOT the main `window`).
// Fire the move on the popout window (not the main `window`).
// If listeners attached to main `window`, this would be a no-op.
otherWin.dispatchEvent(
makePointerEvent('pointermove', { clientX: 10, clientY: 10 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IDisposable } from '../../../lifecycle';

describe('PointerDragSource', () => {
afterEach(() => {
// Defensive: ensure no drag leaks across tests via the singleton.
// Make sure no drag leaks across tests via the singleton.
PointerDragController.getInstance().cancel();
jest.useRealTimers();
});
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('PointerDragSource', () => {

fireEvent.pointerDown(element, pointerEventInit());
// Flick past pressTolerance (default 8px) within the initiation
// delay drag intent in any direction arms the drag now.
// delay: drag intent in any direction arms the drag now.
fireEvent.pointerMove(window, pointerEventInit({ clientX: 20 }));
expect(onDragStart).toHaveBeenCalledTimes(1);

Expand Down Expand Up @@ -100,7 +100,7 @@ describe('PointerDragSource', () => {
});

fireEvent.pointerDown(element, pointerEventInit());
// 4px finger jitter under pressTolerance, drag does not arm yet.
// 4px finger jitter is under pressTolerance, so the drag does not arm yet.
fireEvent.pointerMove(window, pointerEventInit({ clientX: 4 }));
expect(onDragStart).not.toHaveBeenCalled();
// After the initiation delay fires, subsequent motion past
Expand Down Expand Up @@ -182,7 +182,7 @@ describe('PointerDragSource', () => {
element,
pointerEventInit({ pointerType: 'mouse' })
);
// Mouse arms immediately no need to advance timers.
// Mouse arms immediately, so there's no need to advance timers.
fireEvent.pointerMove(
window,
pointerEventInit({ pointerType: 'mouse', clientX: 10 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ describe('PointerDropTarget', () => {
const target = new PointerDropTarget(element, {
acceptedTargetZones: ['left', 'right', 'center'],
canDisplayOverlay: () => true,
// 10,20 would be 'left' by default the resolver forces 'right'.
// 10,20 would be 'left' by default, but the resolver forces 'right'.
getPositionResolver: () => ({
resolve: () => ({ position: 'right' }),
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { DropTargetTargetModel } from '../../../dnd/droptarget';
/**
* Verifies the anchor-container ("override target") rendering path that
* floating groups, popout groups, and the layout root rely on. The path
* doesn't append a dropzone to the drop element — instead it renders into
* doesn't append a dropzone to the drop element. Instead it renders into
* an external anchor container's overlay.
*/
describe('PointerDropTarget anchor / override target path', () => {
describe('PointerDropTarget: anchor / override target path', () => {
afterEach(() => {
PointerDragController.getInstance().cancel();
});
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('PointerDropTarget — anchor / override target path', () => {
dropEl.getElementsByClassName('dv-drop-target-dropzone')
).toHaveLength(0);
// The anchor overlay should have been positioned (any non-empty
// dimensions are fine — we just want to confirm the anchor path ran).
// dimensions are fine; this confirms the anchor path ran).
expect(overlay.style.width).not.toBe('');
expect(overlay.style.height).not.toBe('');
expect(target.state).toBe('right');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestPanel implements IContentRenderer {
}

/**
* AdvancedDnD Phase 4 the keyboard-docking seam. `showPreviewOverlay`
* AdvancedDnD Phase 4: the keyboard-docking seam. `showPreviewOverlay`
* renders the same drop overlay a mouse drag shows, without a live drag, and
* the returned disposable clears it.
*/
Expand All @@ -35,7 +35,7 @@ describe('AdvancedDnD showPreviewOverlay', () => {
afterEach(() => dockview.dispose());

const service = (): IAdvancedDnDService =>
// internal seam consumed by the (future) KeyboardNavigationModule
// internal seam, consumed by the (future) KeyboardNavigationModule
(
dockview as unknown as {
_moduleRegistry: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('PopupService', () => {
test('closes the popover (after the open grace window)', () => {
// Touch long-press callers fire pointerdown events tied to the
// gesture that opened the popover. PopupService suppresses
// outside-dismissal for a short grace window advance past it.
// outside-dismissal for a short grace window, so advance past it.
const nowSpy = jest.spyOn(Date, 'now');
nowSpy.mockReturnValue(0);

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('PopupService', () => {
el.className = 'my-popup';
service.openPopover(el, { x: 0, y: 0 });

// Within grace window must not dismiss.
// Within the grace window, so it must not dismiss.
nowSpy.mockReturnValue(50);

const outside = document.createElement('div');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe('tab', () => {
clientY: 0,
});
// A downward flick past pressTolerance, before the initiation
// delay fires — drag intent in any direction begins the drag
// delay fires. Drag intent in any direction begins the drag
// (strip-scrolling lives on the empty container space, not on
// tabs themselves).
fireEvent.pointerMove(window, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ beforeAll(() => {
* body through `createOverflowRenderContext` and, when
* `accessor.advancedOverflowService` is present, hands it to the module;
* otherwise it renders the free flat list. No module is registered in core, so
* this proves the `?.`-guard falls through to the free helper the byte-for-byte
* behaviour dockview shipped before the seam existed.
* this proves the `?.`-guard falls through to the free helper, giving the
* byte-for-byte behaviour dockview shipped before the seam existed.
*/
describe('advanced overflow seam free fallback (no module)', () => {
describe('advanced overflow seam: free fallback (no module)', () => {
let container: HTMLElement;

const make = (): DockviewComponent => {
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('advanced overflow seam — free fallback (no module)', () => {
dockview.addPanel({ id, component: 'default', title: id })
);

// Drive the render seam directly with a pinned bucket jsdom has no
// Drive the render seam directly with a pinned bucket. jsdom has no
// geometry, so the clip detection can't be triggered through layout.
const header = panels[0].group.model.header as any;
header.toggleDropdown({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ describe('WrapTabGroupIndicator vertical columns (DV-14)', () => {
});

test('the continuation marker skips the column holding the first tab (vertical-rl safe)', () => {
// First panel 'a' is in the RIGHT-most column (left 40); the left column
// (left 0) is the continuation one. Bucketing by reference not by
// min-left must mark the left column, not the first.
// First panel 'a' is in the right-most column (left 40); the left column
// (left 0) is the continuation one. Bucketing by reference, not by
// min-left, must mark the left column, not the first.
const tabMap = new Map<string, any>([
['a', makeTab(40, 0)],
['b', makeTab(40, 30)],
Expand Down
Loading
Loading