dockview-core 6.6.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/dist/cjs/api/component.api.d.ts +42 -21
- package/dist/cjs/api/component.api.js +111 -20
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +23 -8
- package/dist/cjs/api/dockviewGroupPanelApi.js +23 -0
- package/dist/cjs/api/dockviewPanelApi.d.ts +4 -3
- package/dist/cjs/api/dockviewPanelApi.js +8 -0
- package/dist/cjs/dnd/droptarget.d.ts +8 -0
- package/dist/cjs/dnd/droptarget.js +28 -0
- package/dist/cjs/dockview/accessibilityMessages.d.ts +32 -0
- package/dist/cjs/dockview/accessibilityMessages.js +51 -0
- package/dist/cjs/dockview/allModules.d.ts +8 -0
- package/dist/cjs/dockview/allModules.js +25 -0
- package/dist/cjs/dockview/components/panel/content.d.ts +2 -0
- package/dist/cjs/dockview/components/panel/content.js +35 -4
- package/dist/cjs/dockview/components/tab/tab.js +33 -5
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +35 -0
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +95 -0
- package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +52 -0
- package/dist/cjs/dockview/components/titlebar/groupDragSource.js +218 -0
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +31 -24
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +1 -0
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +105 -2
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +4 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +13 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -4
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +31 -155
- package/dist/cjs/dockview/dockviewComponent.d.ts +299 -44
- package/dist/cjs/dockview/dockviewComponent.js +1787 -993
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +39 -3
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +0 -1
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +133 -101
- package/dist/cjs/dockview/dockviewPanel.d.ts +2 -2
- package/dist/cjs/dockview/edgeGroupService.d.ts +38 -0
- package/dist/cjs/dockview/edgeGroupService.js +128 -0
- package/dist/cjs/dockview/floatingGroupService.d.ts +37 -0
- package/dist/cjs/dockview/floatingGroupService.js +231 -0
- package/dist/cjs/dockview/headerActionsService.d.ts +32 -0
- package/dist/cjs/dockview/headerActionsService.js +149 -0
- package/dist/cjs/dockview/liveRegionService.d.ts +53 -0
- package/dist/cjs/dockview/liveRegionService.js +185 -0
- package/dist/cjs/dockview/moduleContracts.d.ts +119 -0
- package/dist/cjs/dockview/moduleContracts.js +2 -0
- package/dist/cjs/dockview/modules.d.ts +110 -0
- package/dist/cjs/dockview/modules.js +304 -0
- package/dist/cjs/dockview/options.d.ts +159 -6
- package/dist/cjs/dockview/options.js +8 -1
- package/dist/cjs/dockview/popoutWindowService.d.ts +95 -0
- package/dist/cjs/dockview/popoutWindowService.js +261 -0
- package/dist/cjs/dockview/rootDropTargetService.d.ts +35 -0
- package/dist/cjs/dockview/rootDropTargetService.js +87 -0
- package/dist/cjs/dockview/watermarkService.d.ts +30 -0
- package/dist/cjs/dockview/watermarkService.js +61 -0
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +3 -2
- package/dist/cjs/gridview/gridviewComponent.d.ts +3 -3
- package/dist/cjs/gridview/gridviewPanel.d.ts +1 -1
- package/dist/cjs/index.d.ts +11 -4
- package/dist/cjs/index.js +14 -1
- package/dist/cjs/overlay/overlay.d.ts +43 -1
- package/dist/cjs/overlay/overlay.js +57 -8
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +4 -4
- package/dist/cjs/paneview/paneviewComponent.d.ts +3 -3
- package/dist/cjs/paneview/paneviewComponent.js +5 -5
- package/dist/dockview-core.js +3199 -1251
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +3198 -1250
- package/dist/esm/api/component.api.d.ts +42 -21
- package/dist/esm/api/component.api.js +63 -18
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +23 -8
- package/dist/esm/api/dockviewGroupPanelApi.js +19 -0
- package/dist/esm/api/dockviewPanelApi.d.ts +4 -3
- package/dist/esm/api/dockviewPanelApi.js +7 -0
- package/dist/esm/dnd/droptarget.d.ts +8 -0
- package/dist/esm/dnd/droptarget.js +28 -0
- package/dist/esm/dockview/accessibilityMessages.d.ts +32 -0
- package/dist/esm/dockview/accessibilityMessages.js +30 -0
- package/dist/esm/dockview/allModules.d.ts +8 -0
- package/dist/esm/dockview/allModules.js +22 -0
- package/dist/esm/dockview/components/panel/content.d.ts +2 -0
- package/dist/esm/dockview/components/panel/content.js +36 -5
- package/dist/esm/dockview/components/tab/tab.js +33 -5
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +35 -0
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +65 -0
- package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +52 -0
- package/dist/esm/dockview/components/titlebar/groupDragSource.js +178 -0
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +2 -1
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +31 -24
- package/dist/esm/dockview/components/titlebar/tabGroups.js +1 -0
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +102 -2
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +4 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +8 -2
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -4
- package/dist/esm/dockview/components/titlebar/voidContainer.js +33 -145
- package/dist/esm/dockview/dockviewComponent.d.ts +299 -44
- package/dist/esm/dockview/dockviewComponent.js +1421 -717
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +35 -3
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +0 -1
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/esm/dockview/dockviewGroupPanelModel.js +109 -93
- package/dist/esm/dockview/dockviewPanel.d.ts +2 -2
- package/dist/esm/dockview/edgeGroupService.d.ts +38 -0
- package/dist/esm/dockview/edgeGroupService.js +63 -0
- package/dist/esm/dockview/floatingGroupService.d.ts +37 -0
- package/dist/esm/dockview/floatingGroupService.js +150 -0
- package/dist/esm/dockview/headerActionsService.d.ts +32 -0
- package/dist/esm/dockview/headerActionsService.js +86 -0
- package/dist/esm/dockview/liveRegionService.d.ts +53 -0
- package/dist/esm/dockview/liveRegionService.js +159 -0
- package/dist/esm/dockview/moduleContracts.d.ts +119 -0
- package/dist/esm/dockview/moduleContracts.js +1 -0
- package/dist/esm/dockview/modules.d.ts +110 -0
- package/dist/esm/dockview/modules.js +170 -0
- package/dist/esm/dockview/options.d.ts +159 -6
- package/dist/esm/dockview/options.js +8 -1
- package/dist/esm/dockview/popoutWindowService.d.ts +95 -0
- package/dist/esm/dockview/popoutWindowService.js +175 -0
- package/dist/esm/dockview/rootDropTargetService.d.ts +35 -0
- package/dist/esm/dockview/rootDropTargetService.js +82 -0
- package/dist/esm/dockview/watermarkService.d.ts +30 -0
- package/dist/esm/dockview/watermarkService.js +56 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +2 -2
- package/dist/esm/gridview/gridviewComponent.d.ts +3 -3
- package/dist/esm/gridview/gridviewPanel.d.ts +1 -1
- package/dist/esm/index.d.ts +11 -4
- package/dist/esm/index.js +4 -0
- package/dist/esm/overlay/overlay.d.ts +43 -1
- package/dist/esm/overlay/overlay.js +53 -8
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +4 -4
- package/dist/esm/paneview/paneviewComponent.d.ts +3 -3
- package/dist/esm/paneview/paneviewComponent.js +5 -5
- package/dist/package/main.cjs.js +3234 -1286
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +3189 -1252
- package/dist/styles/dockview.css +275 -13
- package/package.json +10 -1
- package/dist/cjs/dockview/contextMenu.d.ts +0 -10
- package/dist/cjs/dockview/contextMenu.js +0 -313
- package/dist/esm/dockview/contextMenu.d.ts +0 -10
- package/dist/esm/dockview/contextMenu.js +0 -228
|
@@ -39,6 +39,15 @@ export class Overlay extends CompositeDisposable {
|
|
|
39
39
|
get isVisible() {
|
|
40
40
|
return this._isVisible;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Height of the optional drag-handle header, or 0 when none is present.
|
|
44
|
+
* Used to translate between the overlay's outer box and the content area
|
|
45
|
+
* available to the group beneath the header.
|
|
46
|
+
*/
|
|
47
|
+
get headerHeight() {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
return (_b = (_a = this.options.header) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0;
|
|
50
|
+
}
|
|
42
51
|
constructor(options) {
|
|
43
52
|
super();
|
|
44
53
|
this.options = options;
|
|
@@ -54,6 +63,11 @@ export class Overlay extends CompositeDisposable {
|
|
|
54
63
|
this._dragCancelled = false;
|
|
55
64
|
this.addDisposables(this._onDidChange, this._onDidChangeEnd, this._onDidStartMoving, this._dragMove);
|
|
56
65
|
this._element.className = 'dv-resize-container';
|
|
66
|
+
// Floating groups are non-modal dialogs over the layout. The contained
|
|
67
|
+
// group(s) carry their own `role="region"` + label, so the dialog
|
|
68
|
+
// itself only needs role + modality here.
|
|
69
|
+
this._element.setAttribute('role', 'dialog');
|
|
70
|
+
this._element.setAttribute('aria-modal', 'false');
|
|
57
71
|
this._isVisible = true;
|
|
58
72
|
this.setupResize('top');
|
|
59
73
|
this.setupResize('bottom');
|
|
@@ -63,6 +77,10 @@ export class Overlay extends CompositeDisposable {
|
|
|
63
77
|
this.setupResize('topright');
|
|
64
78
|
this.setupResize('bottomleft');
|
|
65
79
|
this.setupResize('bottomright');
|
|
80
|
+
if (this.options.header) {
|
|
81
|
+
toggleClass(this._element, 'dv-resize-container-with-titlebar', true);
|
|
82
|
+
this._element.appendChild(this.options.header);
|
|
83
|
+
}
|
|
66
84
|
this._element.appendChild(this.options.content);
|
|
67
85
|
this.options.container.appendChild(this._element);
|
|
68
86
|
// if input bad resize within acceptable boundaries
|
|
@@ -177,9 +195,14 @@ export class Overlay extends CompositeDisposable {
|
|
|
177
195
|
}
|
|
178
196
|
setupDrag(dragTarget, options = { inDragMode: false }) {
|
|
179
197
|
const track = (captureTarget, pointerId) => {
|
|
198
|
+
var _a, _b, _c;
|
|
180
199
|
let offset = null;
|
|
181
200
|
let hasMoved = false;
|
|
182
201
|
this._dragCancelled = false;
|
|
202
|
+
// Snapshot once per drag — siblings don't move while this one drags.
|
|
203
|
+
const siblingBoxes = this.options.transformDragPosition
|
|
204
|
+
? ((_c = (_b = (_a = this.options).getSiblingBoxes) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : [])
|
|
205
|
+
: [];
|
|
183
206
|
const iframes = disableIframePointEvents();
|
|
184
207
|
if (captureTarget &&
|
|
185
208
|
typeof pointerId === 'number' &&
|
|
@@ -187,7 +210,7 @@ export class Overlay extends CompositeDisposable {
|
|
|
187
210
|
try {
|
|
188
211
|
captureTarget.setPointerCapture(pointerId);
|
|
189
212
|
}
|
|
190
|
-
catch (
|
|
213
|
+
catch (_d) {
|
|
191
214
|
// ignore – non-fatal if the browser refuses capture
|
|
192
215
|
}
|
|
193
216
|
}
|
|
@@ -228,13 +251,35 @@ export class Overlay extends CompositeDisposable {
|
|
|
228
251
|
}
|
|
229
252
|
const xOffset = Math.max(0, this.getMinimumWidth(overlayRect.width));
|
|
230
253
|
const yOffset = Math.max(0, this.getMinimumHeight(overlayRect.height));
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
254
|
+
let proposedTop = y - offset.y;
|
|
255
|
+
let proposedLeft = x - offset.x;
|
|
256
|
+
// Let a consumer nudge the proposed position (snapping,
|
|
257
|
+
// custom bounds) before the container clamp below.
|
|
258
|
+
if (this.options.transformDragPosition) {
|
|
259
|
+
const adjusted = this.options.transformDragPosition({
|
|
260
|
+
proposed: {
|
|
261
|
+
top: proposedTop,
|
|
262
|
+
left: proposedLeft,
|
|
263
|
+
width: overlayRect.width,
|
|
264
|
+
height: overlayRect.height,
|
|
265
|
+
},
|
|
266
|
+
container: {
|
|
267
|
+
width: containerRect.width,
|
|
268
|
+
height: containerRect.height,
|
|
269
|
+
},
|
|
270
|
+
others: siblingBoxes,
|
|
271
|
+
});
|
|
272
|
+
if (adjusted) {
|
|
273
|
+
proposedTop = adjusted.top;
|
|
274
|
+
proposedLeft = adjusted.left;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const maxTop = Math.max(0, containerRect.height - overlayRect.height + yOffset);
|
|
278
|
+
const maxLeft = Math.max(0, containerRect.width - overlayRect.width + xOffset);
|
|
279
|
+
const top = clamp(proposedTop, -yOffset, maxTop);
|
|
280
|
+
const bottom = clamp(containerRect.height - overlayRect.height - proposedTop, -yOffset, maxTop);
|
|
281
|
+
const left = clamp(proposedLeft, -xOffset, maxLeft);
|
|
282
|
+
const right = clamp(containerRect.width - overlayRect.width - proposedLeft, -xOffset, maxLeft);
|
|
238
283
|
const bounds = {};
|
|
239
284
|
// Anchor to top or to bottom depending on which one is closer
|
|
240
285
|
if (top <= bottom) {
|
|
@@ -18,8 +18,8 @@ export declare abstract class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
18
18
|
private pointerTarget;
|
|
19
19
|
private readonly _onDidDrop;
|
|
20
20
|
readonly onDidDrop: Event<PaneviewDidDropEvent>;
|
|
21
|
-
private readonly
|
|
22
|
-
readonly
|
|
21
|
+
private readonly _onUnhandledDragOver;
|
|
22
|
+
readonly onUnhandledDragOver: Event<PaneviewDndOverlayEvent>;
|
|
23
23
|
readonly accessor: IPaneviewComponent;
|
|
24
24
|
constructor(options: {
|
|
25
25
|
accessor: IPaneviewComponent;
|
|
@@ -19,10 +19,10 @@ export class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
19
19
|
});
|
|
20
20
|
this._onDidDrop = new Emitter();
|
|
21
21
|
this.onDidDrop = this._onDidDrop.event;
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
22
|
+
this._onUnhandledDragOver = new Emitter();
|
|
23
|
+
this.onUnhandledDragOver = this._onUnhandledDragOver.event;
|
|
24
24
|
this.accessor = options.accessor;
|
|
25
|
-
this.addDisposables(this._onDidDrop, this.
|
|
25
|
+
this.addDisposables(this._onDidDrop, this._onUnhandledDragOver);
|
|
26
26
|
if (!options.disableDnd) {
|
|
27
27
|
this.initDragFeatures();
|
|
28
28
|
}
|
|
@@ -55,7 +55,7 @@ export class DraggablePaneviewPanel extends PaneviewPanel {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
const firedEvent = new PaneviewUnhandledDragOverEvent(event, position, getPaneData, this);
|
|
58
|
-
this.
|
|
58
|
+
this._onUnhandledDragOver.fire(firedEvent);
|
|
59
59
|
return firedEvent.isAccepted;
|
|
60
60
|
};
|
|
61
61
|
const dropTargetOptions = {
|
|
@@ -74,7 +74,7 @@ export interface IPaneviewComponent extends IDisposable {
|
|
|
74
74
|
readonly onDidDrop: Event<PaneviewDidDropEvent>;
|
|
75
75
|
readonly onDidLayoutChange: Event<void>;
|
|
76
76
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
77
|
-
readonly
|
|
77
|
+
readonly onUnhandledDragOver: Event<PaneviewDndOverlayEvent>;
|
|
78
78
|
addPanel<T extends object = Parameters>(options: AddPaneviewComponentOptions<T>): IPaneviewPanel;
|
|
79
79
|
layout(width: number, height: number): void;
|
|
80
80
|
toJSON(): SerializedPaneview;
|
|
@@ -103,8 +103,8 @@ export declare class PaneviewComponent extends Resizable implements IPaneviewCom
|
|
|
103
103
|
readonly onDidAddView: Event<PaneviewPanel>;
|
|
104
104
|
private readonly _onDidRemoveView;
|
|
105
105
|
readonly onDidRemoveView: Event<PaneviewPanel>;
|
|
106
|
-
private readonly
|
|
107
|
-
readonly
|
|
106
|
+
private readonly _onUnhandledDragOver;
|
|
107
|
+
readonly onUnhandledDragOver: Event<PaneviewDndOverlayEvent>;
|
|
108
108
|
private readonly _classNames;
|
|
109
109
|
get id(): string;
|
|
110
110
|
get panels(): PaneviewPanel[];
|
|
@@ -86,11 +86,11 @@ export class PaneviewComponent extends Resizable {
|
|
|
86
86
|
this.onDidAddView = this._onDidAddView.event;
|
|
87
87
|
this._onDidRemoveView = new Emitter();
|
|
88
88
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
89
|
+
this._onUnhandledDragOver = new Emitter();
|
|
90
|
+
this.onUnhandledDragOver = this._onUnhandledDragOver.event;
|
|
91
91
|
this.element.style.height = '100%';
|
|
92
92
|
this.element.style.width = '100%';
|
|
93
|
-
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this.
|
|
93
|
+
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView, this._onUnhandledDragOver);
|
|
94
94
|
this._classNames = new Classnames(this.element);
|
|
95
95
|
this._classNames.setClassNames((_a = options.className) !== null && _a !== void 0 ? _a : '');
|
|
96
96
|
// the container is owned by the third-party, do not modify/delete it
|
|
@@ -286,8 +286,8 @@ export class PaneviewComponent extends Resizable {
|
|
|
286
286
|
doAddPanel(panel) {
|
|
287
287
|
const disposable = new CompositeDisposable(panel.onDidDrop((event) => {
|
|
288
288
|
this._onDidDrop.fire(event);
|
|
289
|
-
}), panel.
|
|
290
|
-
this.
|
|
289
|
+
}), panel.onUnhandledDragOver((event) => {
|
|
290
|
+
this._onUnhandledDragOver.fire(event);
|
|
291
291
|
}));
|
|
292
292
|
this._viewDisposables.set(panel.id, disposable);
|
|
293
293
|
}
|