dockview-core 6.6.1 → 7.0.3
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 +24 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +4 -3
- package/dist/cjs/api/dockviewPanelApi.js +8 -0
- package/dist/cjs/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/cjs/dnd/droptarget.d.ts +8 -0
- package/dist/cjs/dnd/droptarget.js +28 -0
- package/dist/cjs/dnd/pointer/longPress.js +1 -1
- package/dist/cjs/dnd/pointer/pointerDragController.js +9 -7
- package/dist/cjs/dnd/pointer/pointerDragSource.js +4 -2
- 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 +41 -10
- package/dist/cjs/dockview/components/popupService.js +1 -1
- package/dist/cjs/dockview/components/tab/tab.js +35 -7
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +95 -0
- package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +51 -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 +36 -30
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +104 -53
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +121 -25
- 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 +32 -156
- package/dist/cjs/dockview/dndCapabilities.js +3 -3
- package/dist/cjs/dockview/dockviewComponent.d.ts +304 -49
- package/dist/cjs/dockview/dockviewComponent.js +1839 -1075
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +39 -3
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +1 -2
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +151 -125
- package/dist/cjs/dockview/dockviewPanel.d.ts +2 -2
- package/dist/cjs/dockview/dockviewPanel.js +4 -5
- package/dist/cjs/dockview/dockviewShell.d.ts +29 -7
- package/dist/cjs/dockview/dockviewShell.js +94 -36
- 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/strictEventsSequencing.js +6 -6
- package/dist/cjs/dockview/tabGroup.js +3 -3
- package/dist/cjs/dockview/tabGroupAccent.js +1 -3
- package/dist/cjs/dockview/watermarkService.d.ts +30 -0
- package/dist/cjs/dockview/watermarkService.js +61 -0
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/events.js +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/cjs/gridview/baseComponentGridview.js +6 -10
- package/dist/cjs/gridview/branchNode.js +13 -17
- package/dist/cjs/gridview/gridview.js +8 -8
- package/dist/cjs/gridview/gridviewComponent.d.ts +3 -3
- package/dist/cjs/gridview/gridviewComponent.js +1 -6
- 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 +82 -36
- package/dist/cjs/overlay/overlayRenderContainer.js +3 -4
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +5 -5
- package/dist/cjs/paneview/paneviewComponent.d.ts +3 -3
- package/dist/cjs/paneview/paneviewComponent.js +7 -11
- package/dist/cjs/popoutWindow.js +4 -4
- package/dist/cjs/scrollbar.d.ts +1 -1
- package/dist/cjs/scrollbar.js +7 -6
- package/dist/cjs/splitview/splitview.d.ts +1 -1
- package/dist/cjs/splitview/splitview.js +21 -20
- package/dist/cjs/splitview/viewItem.js +1 -1
- package/dist/dockview-core.js +3548 -1544
- 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 +3547 -1543
- 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 +20 -1
- package/dist/esm/api/dockviewPanelApi.d.ts +4 -3
- package/dist/esm/api/dockviewPanelApi.js +7 -0
- package/dist/esm/dnd/dropTargetAnchorContainer.js +1 -2
- package/dist/esm/dnd/droptarget.d.ts +8 -0
- package/dist/esm/dnd/droptarget.js +28 -0
- package/dist/esm/dnd/pointer/longPress.js +1 -1
- package/dist/esm/dnd/pointer/pointerDragController.js +9 -7
- package/dist/esm/dnd/pointer/pointerDragSource.js +4 -2
- 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 +42 -11
- package/dist/esm/dockview/components/popupService.js +1 -1
- package/dist/esm/dockview/components/tab/tab.js +35 -7
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +34 -0
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +65 -0
- package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +51 -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 +36 -30
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +27 -5
- package/dist/esm/dockview/components/titlebar/tabGroups.js +91 -41
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +12 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +119 -26
- 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 +34 -146
- package/dist/esm/dockview/dndCapabilities.js +3 -3
- package/dist/esm/dockview/dockviewComponent.d.ts +304 -49
- package/dist/esm/dockview/dockviewComponent.js +1459 -772
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +33 -2
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +35 -3
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +1 -2
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +36 -14
- package/dist/esm/dockview/dockviewGroupPanelModel.js +127 -117
- package/dist/esm/dockview/dockviewPanel.d.ts +2 -2
- package/dist/esm/dockview/dockviewPanel.js +1 -2
- package/dist/esm/dockview/dockviewShell.d.ts +29 -7
- package/dist/esm/dockview/dockviewShell.js +89 -37
- 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/strictEventsSequencing.js +6 -6
- package/dist/esm/dockview/tabGroup.js +3 -3
- package/dist/esm/dockview/tabGroupAccent.js +1 -3
- package/dist/esm/dockview/watermarkService.d.ts +30 -0
- package/dist/esm/dockview/watermarkService.js +56 -0
- package/dist/esm/dom.js +1 -1
- package/dist/esm/events.js +1 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -1
- package/dist/esm/gridview/baseComponentGridview.js +5 -10
- package/dist/esm/gridview/branchNode.js +13 -15
- package/dist/esm/gridview/gridview.js +8 -8
- package/dist/esm/gridview/gridviewComponent.d.ts +3 -3
- package/dist/esm/gridview/gridviewComponent.js +1 -6
- 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 +78 -36
- package/dist/esm/overlay/overlayRenderContainer.js +3 -4
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +5 -5
- package/dist/esm/paneview/paneviewComponent.d.ts +3 -3
- package/dist/esm/paneview/paneviewComponent.js +7 -11
- package/dist/esm/popoutWindow.js +4 -4
- package/dist/esm/scrollbar.d.ts +1 -1
- package/dist/esm/scrollbar.js +7 -6
- package/dist/esm/splitview/splitview.d.ts +1 -1
- package/dist/esm/splitview/splitview.js +21 -20
- package/dist/esm/splitview/viewItem.js +1 -1
- package/dist/package/main.cjs.js +3550 -1546
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +3538 -1545
- package/dist/styles/dockview.css +283 -21
- 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
|
@@ -74,9 +74,9 @@ export class TabGroup extends CompositeDisposable {
|
|
|
74
74
|
if (this._panelIds.includes(panelId)) {
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
const insertIndex = index
|
|
78
|
-
?
|
|
79
|
-
: this._panelIds.length;
|
|
77
|
+
const insertIndex = index === undefined
|
|
78
|
+
? this._panelIds.length
|
|
79
|
+
: Math.max(0, Math.min(index, this._panelIds.length));
|
|
80
80
|
this._panelIds.splice(insertIndex, 0, panelId);
|
|
81
81
|
this._onDidPanelChange.fire({ panelId, type: 'add' });
|
|
82
82
|
}
|
|
@@ -87,9 +87,7 @@ let _fallbackPalette;
|
|
|
87
87
|
* palette through.
|
|
88
88
|
*/
|
|
89
89
|
function getFallbackPalette() {
|
|
90
|
-
|
|
91
|
-
_fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true);
|
|
92
|
-
}
|
|
90
|
+
_fallbackPalette !== null && _fallbackPalette !== void 0 ? _fallbackPalette : (_fallbackPalette = new TabGroupColorPalette(DEFAULT_TAB_GROUP_COLORS, true));
|
|
93
91
|
return _fallbackPalette;
|
|
94
92
|
}
|
|
95
93
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IDisposable } from '../lifecycle';
|
|
2
|
+
import { Event } from '../events';
|
|
3
|
+
import { IWatermarkRenderer } from './types';
|
|
4
|
+
import { DockviewApi } from '../api/component.api';
|
|
5
|
+
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
6
|
+
export interface IWatermarkHost {
|
|
7
|
+
readonly api: DockviewApi;
|
|
8
|
+
readonly mountElement: HTMLElement;
|
|
9
|
+
createWatermarkComponent(): IWatermarkRenderer;
|
|
10
|
+
hasVisibleGridGroup(): boolean;
|
|
11
|
+
readonly onDidAdd: Event<DockviewGroupPanel>;
|
|
12
|
+
readonly onDidRemove: Event<DockviewGroupPanel>;
|
|
13
|
+
readonly onDidViewVisibilityChangeMicroTaskQueue: Event<unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface IWatermarkService extends IDisposable {
|
|
16
|
+
/** Mount or unmount the watermark based on current grid state. */
|
|
17
|
+
update(): void;
|
|
18
|
+
/** Tear down the current watermark and re-evaluate. Used when the watermark factory option changes. */
|
|
19
|
+
refresh(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class WatermarkService implements IWatermarkService {
|
|
22
|
+
private readonly _host;
|
|
23
|
+
private _watermark;
|
|
24
|
+
constructor(host: IWatermarkHost);
|
|
25
|
+
update(): void;
|
|
26
|
+
refresh(): void;
|
|
27
|
+
private _unmount;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const WatermarkModule: import("./modules").DockviewModule<IWatermarkHost>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CompositeDisposable } from '../lifecycle';
|
|
2
|
+
import { addTestId } from '../dom';
|
|
3
|
+
import { Event } from '../events';
|
|
4
|
+
import { defineModule } from './modules';
|
|
5
|
+
export class WatermarkService {
|
|
6
|
+
constructor(host) {
|
|
7
|
+
this._watermark = null;
|
|
8
|
+
this._host = host;
|
|
9
|
+
}
|
|
10
|
+
update() {
|
|
11
|
+
if (this._host.hasVisibleGridGroup()) {
|
|
12
|
+
this._unmount();
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (this._watermark) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
this._watermark = this._host.createWatermarkComponent();
|
|
19
|
+
this._watermark.init({ containerApi: this._host.api });
|
|
20
|
+
const container = document.createElement('div');
|
|
21
|
+
container.className = 'dv-watermark-container';
|
|
22
|
+
addTestId(container, 'watermark-component');
|
|
23
|
+
container.appendChild(this._watermark.element);
|
|
24
|
+
this._host.mountElement.appendChild(container);
|
|
25
|
+
}
|
|
26
|
+
refresh() {
|
|
27
|
+
this._unmount();
|
|
28
|
+
this.update();
|
|
29
|
+
}
|
|
30
|
+
_unmount() {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
if (!this._watermark) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this._watermark.element.parentElement.remove();
|
|
36
|
+
(_b = (_a = this._watermark).dispose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
37
|
+
this._watermark = null;
|
|
38
|
+
}
|
|
39
|
+
dispose() {
|
|
40
|
+
this._unmount();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export const WatermarkModule = defineModule({
|
|
44
|
+
name: 'Watermark',
|
|
45
|
+
serviceKey: 'watermarkService',
|
|
46
|
+
create: (host) => new WatermarkService(host),
|
|
47
|
+
init: (host, service) => {
|
|
48
|
+
// Initial evaluation reflects the watermark state at construction time.
|
|
49
|
+
service.update();
|
|
50
|
+
return new CompositeDisposable(Event.any(host.onDidAdd, host.onDidRemove)(() => {
|
|
51
|
+
service.update();
|
|
52
|
+
}), host.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
53
|
+
service.update();
|
|
54
|
+
}));
|
|
55
|
+
},
|
|
56
|
+
});
|
package/dist/esm/dom.js
CHANGED
package/dist/esm/events.js
CHANGED
|
@@ -56,7 +56,7 @@ class LeakageMonitor {
|
|
|
56
56
|
class Stacktrace {
|
|
57
57
|
static create() {
|
|
58
58
|
var _a;
|
|
59
|
-
return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');
|
|
59
|
+
return new Stacktrace((_a = new Error('listener stacktrace').stack) !== null && _a !== void 0 ? _a : '');
|
|
60
60
|
}
|
|
61
61
|
constructor(value) {
|
|
62
62
|
this.value = value;
|
|
@@ -95,7 +95,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
95
95
|
isMaximizedGroup(panel: T): boolean;
|
|
96
96
|
exitMaximizedGroup(): void;
|
|
97
97
|
hasMaximizedGroup(): boolean;
|
|
98
|
-
protected doAddGroup(group: T, location?: number[], size?: number): void;
|
|
98
|
+
protected doAddGroup(group: T, location?: number[], size?: number, gridview?: Gridview): void;
|
|
99
99
|
protected doRemoveGroup(group: T, options?: {
|
|
100
100
|
skipActive?: boolean;
|
|
101
101
|
skipDispose?: boolean;
|
|
@@ -93,8 +93,7 @@ export class BaseGrid extends Resizable {
|
|
|
93
93
|
}), this.gridview.onDidViewVisibilityChange(() => this._onDidViewVisibilityChangeMicroTaskQueue.fire()), this.onDidViewVisibilityChangeMicroTaskQueue(() => {
|
|
94
94
|
this.forceRelayout();
|
|
95
95
|
}), Disposable.from(() => {
|
|
96
|
-
|
|
97
|
-
(_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.element);
|
|
96
|
+
this.element.remove();
|
|
98
97
|
}), this.gridview.onDidChange(() => {
|
|
99
98
|
this._bufferOnDidLayoutChange.fire();
|
|
100
99
|
}), Event.any(this.onDidAdd, this.onDidRemove, this.onDidActiveChange)(() => {
|
|
@@ -145,8 +144,8 @@ export class BaseGrid extends Resizable {
|
|
|
145
144
|
hasMaximizedGroup() {
|
|
146
145
|
return this.gridview.hasMaximizedView();
|
|
147
146
|
}
|
|
148
|
-
doAddGroup(group, location = [0], size) {
|
|
149
|
-
|
|
147
|
+
doAddGroup(group, location = [0], size, gridview = this.gridview) {
|
|
148
|
+
gridview.addView(group, size !== null && size !== void 0 ? size : Sizing.Distribute, location);
|
|
150
149
|
this._onDidAdd.fire(group);
|
|
151
150
|
}
|
|
152
151
|
doRemoveGroup(group, options) {
|
|
@@ -189,9 +188,7 @@ export class BaseGrid extends Resizable {
|
|
|
189
188
|
}
|
|
190
189
|
moveToNext(options) {
|
|
191
190
|
var _a;
|
|
192
|
-
|
|
193
|
-
options = {};
|
|
194
|
-
}
|
|
191
|
+
options !== null && options !== void 0 ? options : (options = {});
|
|
195
192
|
if (!options.group) {
|
|
196
193
|
if (!this.activeGroup) {
|
|
197
194
|
return;
|
|
@@ -204,9 +201,7 @@ export class BaseGrid extends Resizable {
|
|
|
204
201
|
}
|
|
205
202
|
moveToPrevious(options) {
|
|
206
203
|
var _a;
|
|
207
|
-
|
|
208
|
-
options = {};
|
|
209
|
-
}
|
|
204
|
+
options !== null && options !== void 0 ? options : (options = {});
|
|
210
205
|
if (!options.group) {
|
|
211
206
|
if (!this.activeGroup) {
|
|
212
207
|
return;
|
|
@@ -65,13 +65,11 @@ export class BranchNode extends CompositeDisposable {
|
|
|
65
65
|
if (this.children.length === 0) {
|
|
66
66
|
return LayoutPriority.Normal;
|
|
67
67
|
}
|
|
68
|
-
const priorities = this.children.map((c) =>
|
|
69
|
-
|
|
70
|
-
: c.priority);
|
|
71
|
-
if (priorities.some((p) => p === LayoutPriority.High)) {
|
|
68
|
+
const priorities = new Set(this.children.map((c) => { var _a; return (_a = c.priority) !== null && _a !== void 0 ? _a : LayoutPriority.Normal; }));
|
|
69
|
+
if (priorities.has(LayoutPriority.High)) {
|
|
72
70
|
return LayoutPriority.High;
|
|
73
71
|
}
|
|
74
|
-
else if (priorities.
|
|
72
|
+
else if (priorities.has(LayoutPriority.Low)) {
|
|
75
73
|
return LayoutPriority.Low;
|
|
76
74
|
}
|
|
77
75
|
return LayoutPriority.Normal;
|
|
@@ -108,16 +106,7 @@ export class BranchNode extends CompositeDisposable {
|
|
|
108
106
|
this._size = size;
|
|
109
107
|
this.element = document.createElement('div');
|
|
110
108
|
this.element.className = 'dv-branch-node';
|
|
111
|
-
if (
|
|
112
|
-
this.splitview = new Splitview(this.element, {
|
|
113
|
-
orientation: this.orientation,
|
|
114
|
-
proportionalLayout,
|
|
115
|
-
styles,
|
|
116
|
-
margin,
|
|
117
|
-
});
|
|
118
|
-
this.splitview.layout(this.size, this.orthogonalSize);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
109
|
+
if (childDescriptors) {
|
|
121
110
|
const descriptor = {
|
|
122
111
|
views: childDescriptors.map((childDescriptor) => {
|
|
123
112
|
return {
|
|
@@ -140,6 +129,15 @@ export class BranchNode extends CompositeDisposable {
|
|
|
140
129
|
margin,
|
|
141
130
|
});
|
|
142
131
|
}
|
|
132
|
+
else {
|
|
133
|
+
this.splitview = new Splitview(this.element, {
|
|
134
|
+
orientation: this.orientation,
|
|
135
|
+
proportionalLayout,
|
|
136
|
+
styles,
|
|
137
|
+
margin,
|
|
138
|
+
});
|
|
139
|
+
this.splitview.layout(this.size, this.orthogonalSize);
|
|
140
|
+
}
|
|
143
141
|
this.disabled = disabled;
|
|
144
142
|
this.addDisposables(this._onDidChange, this._onDidVisibilityChange, this.splitview.onDidSashEnd(() => {
|
|
145
143
|
this._onDidChange.fire({});
|
|
@@ -383,7 +383,7 @@ export class Gridview {
|
|
|
383
383
|
if (oldRoot) {
|
|
384
384
|
oldRoot.dispose();
|
|
385
385
|
this._maximizedNode = undefined;
|
|
386
|
-
|
|
386
|
+
oldRoot.element.remove();
|
|
387
387
|
}
|
|
388
388
|
this._root = root;
|
|
389
389
|
this.element.appendChild(this._root.element);
|
|
@@ -477,7 +477,7 @@ export class Gridview {
|
|
|
477
477
|
progmaticSelect(location, reverse = false) {
|
|
478
478
|
const [path, node] = this.getNode(location);
|
|
479
479
|
if (!(node instanceof LeafNode)) {
|
|
480
|
-
throw new
|
|
480
|
+
throw new TypeError('invalid location');
|
|
481
481
|
}
|
|
482
482
|
for (let i = path.length - 1; i > -1; i--) {
|
|
483
483
|
const n = path[i];
|
|
@@ -514,7 +514,7 @@ export class Gridview {
|
|
|
514
514
|
const [rest, index] = tail(location);
|
|
515
515
|
const [, parent] = this.getNode(rest);
|
|
516
516
|
if (!(parent instanceof BranchNode)) {
|
|
517
|
-
throw new
|
|
517
|
+
throw new TypeError('Invalid from location');
|
|
518
518
|
}
|
|
519
519
|
return parent.isChildVisible(index);
|
|
520
520
|
}
|
|
@@ -525,7 +525,7 @@ export class Gridview {
|
|
|
525
525
|
const [rest, index] = tail(location);
|
|
526
526
|
const [, parent] = this.getNode(rest);
|
|
527
527
|
if (!(parent instanceof BranchNode)) {
|
|
528
|
-
throw new
|
|
528
|
+
throw new TypeError('Invalid from location');
|
|
529
529
|
}
|
|
530
530
|
this._onDidViewVisibilityChange.fire();
|
|
531
531
|
parent.setChildVisible(index, visible);
|
|
@@ -536,7 +536,7 @@ export class Gridview {
|
|
|
536
536
|
}
|
|
537
537
|
const [, parent] = this.getNode(parentLocation);
|
|
538
538
|
if (!(parent instanceof BranchNode)) {
|
|
539
|
-
throw new
|
|
539
|
+
throw new TypeError('Invalid location');
|
|
540
540
|
}
|
|
541
541
|
parent.moveChild(from, to);
|
|
542
542
|
}
|
|
@@ -582,11 +582,11 @@ export class Gridview {
|
|
|
582
582
|
const [rest, index] = tail(location);
|
|
583
583
|
const [pathToParent, parent] = this.getNode(rest);
|
|
584
584
|
if (!(parent instanceof BranchNode)) {
|
|
585
|
-
throw new
|
|
585
|
+
throw new TypeError('Invalid location');
|
|
586
586
|
}
|
|
587
587
|
const nodeToRemove = parent.children[index];
|
|
588
588
|
if (!(nodeToRemove instanceof LeafNode)) {
|
|
589
|
-
throw new
|
|
589
|
+
throw new TypeError('Invalid location');
|
|
590
590
|
}
|
|
591
591
|
parent.removeChild(index, sizing);
|
|
592
592
|
nodeToRemove.dispose();
|
|
@@ -668,7 +668,7 @@ export class Gridview {
|
|
|
668
668
|
return [path, node];
|
|
669
669
|
}
|
|
670
670
|
if (!(node instanceof BranchNode)) {
|
|
671
|
-
throw new
|
|
671
|
+
throw new TypeError('Invalid location');
|
|
672
672
|
}
|
|
673
673
|
const [index, ...rest] = location;
|
|
674
674
|
if (index < 0 || index >= node.children.length) {
|
|
@@ -11,7 +11,7 @@ export interface SerializedGridviewComponent {
|
|
|
11
11
|
grid: SerializedGridview<GridPanelViewState>;
|
|
12
12
|
activePanel?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface AddGridviewComponentOptions<T extends object = Parameters> extends BaseComponentOptions<T> {
|
|
15
15
|
minimumWidth?: number;
|
|
16
16
|
maximumWidth?: number;
|
|
17
17
|
minimumHeight?: number;
|
|
@@ -29,7 +29,7 @@ export interface IGridviewComponent extends IBaseGrid<GridviewPanel> {
|
|
|
29
29
|
readonly orientation: Orientation;
|
|
30
30
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
31
31
|
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
32
|
-
addPanel<T extends object = Parameters>(options:
|
|
32
|
+
addPanel<T extends object = Parameters>(options: AddGridviewComponentOptions<T>): IGridviewPanel;
|
|
33
33
|
removePanel(panel: IGridviewPanel, sizing?: Sizing): void;
|
|
34
34
|
focus(): void;
|
|
35
35
|
fromJSON(serializedGridview: SerializedGridviewComponent): void;
|
|
@@ -80,7 +80,7 @@ export declare class GridviewComponent extends BaseGrid<GridviewPanel> implement
|
|
|
80
80
|
reference: string;
|
|
81
81
|
size?: number;
|
|
82
82
|
}): void;
|
|
83
|
-
addPanel<T extends object = Parameters>(options:
|
|
83
|
+
addPanel<T extends object = Parameters>(options: AddGridviewComponentOptions<T>): IGridviewPanel;
|
|
84
84
|
private registerPanel;
|
|
85
85
|
moveGroup(referenceGroup: IGridPanelComponentView, groupId: string, target: Position): void;
|
|
86
86
|
removeGroup(group: GridviewPanel): void;
|
|
@@ -220,12 +220,7 @@ export class GridviewComponent extends BaseGrid {
|
|
|
220
220
|
}
|
|
221
221
|
this._groups.forEach((groupItem) => {
|
|
222
222
|
const group = groupItem.value;
|
|
223
|
-
|
|
224
|
-
group.setActive(false);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
group.setActive(true);
|
|
228
|
-
}
|
|
223
|
+
group.setActive(group === panel);
|
|
229
224
|
});
|
|
230
225
|
}));
|
|
231
226
|
this._groups.set(panel.id, {
|
|
@@ -6,7 +6,7 @@ import { LayoutPriority } from '../splitview/splitview';
|
|
|
6
6
|
import { Event } from '../events';
|
|
7
7
|
import { IViewSize } from './gridview';
|
|
8
8
|
import { BaseGrid, IGridPanelView } from './baseComponentGridview';
|
|
9
|
-
export interface
|
|
9
|
+
export interface Constraints {
|
|
10
10
|
minimumWidth?: number;
|
|
11
11
|
maximumWidth?: number;
|
|
12
12
|
minimumHeight?: number;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -13,11 +13,11 @@ export * from './paneview/paneview';
|
|
|
13
13
|
export * from './gridview/gridview';
|
|
14
14
|
export { GridviewComponentOptions, GridviewOptions, GridviewFrameworkOptions, PROPERTY_KEYS_GRIDVIEW, } from './gridview/options';
|
|
15
15
|
export * from './gridview/baseComponentGridview';
|
|
16
|
-
export { DraggablePaneviewPanel, PaneviewDidDropEvent
|
|
16
|
+
export { DraggablePaneviewPanel, PaneviewDidDropEvent, } from './paneview/draggablePaneviewPanel';
|
|
17
17
|
export * from './dockview/components/panel/content';
|
|
18
18
|
export * from './dockview/components/tab/tab';
|
|
19
|
-
export { DockviewGroupPanelModel, DockviewDidDropEvent, DockviewWillDropEvent, DockviewGroupChangeEvent, DockviewGroupLocation, } from './dockview/dockviewGroupPanelModel';
|
|
20
|
-
export { DockviewWillShowOverlayLocationEvent, DockviewTabGroupChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewTabGroupPanelChangeEvent, } from './dockview/events';
|
|
19
|
+
export { DockviewGroupPanelModel, DockviewDidDropEvent, DockviewWillDropEvent, DockviewGroupChangeEvent, DockviewGroupActivePanelChangeEvent, DockviewGroupLocation, } from './dockview/dockviewGroupPanelModel';
|
|
20
|
+
export { DockviewWillShowOverlayLocationEvent, DockviewTabGroupChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewTabGroupPanelChangeEvent, DockviewGroupDropLocation, } from './dockview/events';
|
|
21
21
|
export { TabDragEvent, GroupDragEvent, } from './dockview/components/titlebar/tabsContainer';
|
|
22
22
|
export * from './dockview/types';
|
|
23
23
|
export * from './dockview/dockviewGroupPanel';
|
|
@@ -39,6 +39,7 @@ export * from './gridview/gridviewPanel';
|
|
|
39
39
|
export { SplitviewPanel, ISplitviewPanel } from './splitview/splitviewPanel';
|
|
40
40
|
export * from './paneview/paneviewPanel';
|
|
41
41
|
export * from './dockview/types';
|
|
42
|
+
export { Box, AnchorPosition, AnchoredBox } from './types';
|
|
42
43
|
export { DockviewPanelRenderer } from './overlay/overlayRenderContainer';
|
|
43
44
|
export { Position, positionToDirection, directionToPosition, MeasuredValue, DroptargetOverlayModel, } from './dnd/droptarget';
|
|
44
45
|
export { FocusEvent, PanelDimensionChangeEvent, VisibilityEvent, ActiveEvent, PanelApi, } from './api/panelApi';
|
|
@@ -46,6 +47,12 @@ export { SizeEvent, GridviewPanelApi, GridConstraintChangeEvent, } from './api/g
|
|
|
46
47
|
export { TitleEvent, RendererChangedEvent, DockviewPanelApi, DockviewPanelMoveParams, } from './api/dockviewPanelApi';
|
|
47
48
|
export { PanelSizeEvent, PanelConstraintChangeEvent, SplitviewPanelApi, } from './api/splitviewPanelApi';
|
|
48
49
|
export { ExpansionEvent, PaneviewPanelApi } from './api/paneviewPanelApi';
|
|
49
|
-
export { DockviewGroupPanelApi,
|
|
50
|
+
export { DockviewGroupPanelApi, DockviewGroupPanelLocationChangeEvent, DockviewGroupPanelCollapsedChangeEvent, DockviewGroupMoveParams, } from './api/dockviewGroupPanelApi';
|
|
50
51
|
export { CommonApi, SplitviewApi, PaneviewApi, GridviewApi, DockviewApi, DockviewGetTabGroupsOptions, } from './api/component.api';
|
|
51
52
|
export { createDockview, createGridview, createPaneview, createSplitview, } from './api/entryPoints';
|
|
53
|
+
export { registerModules, getRegisteredModules, clearRegisteredModules, markDockviewPackageLoaded, isDockviewPackageLoaded, defineModule, DockviewModule, ServiceCollection, } from './dockview/modules';
|
|
54
|
+
export { IAccessibilityHost, IAccessibilityService, IAdvancedDnDHost, IAdvancedDnDService, IContextMenuHost, IContextMenuService, IKeyboardDockingService, ITabGroupChipsHost, ITabGroupChipsService, } from './dockview/moduleContracts';
|
|
55
|
+
export { resolveMessages } from './dockview/accessibilityMessages';
|
|
56
|
+
export { findRelativeZIndexParent } from './dom';
|
|
57
|
+
export { IDragGhostSpec } from './dnd/backend';
|
|
58
|
+
export { LiveRegionModule } from './dockview/liveRegionService';
|
package/dist/esm/index.js
CHANGED
|
@@ -38,3 +38,7 @@ export * from './dockview/types';
|
|
|
38
38
|
export { positionToDirection, directionToPosition, } from './dnd/droptarget';
|
|
39
39
|
export { SplitviewApi, PaneviewApi, GridviewApi, DockviewApi, } from './api/component.api';
|
|
40
40
|
export { createDockview, createGridview, createPaneview, createSplitview, } from './api/entryPoints';
|
|
41
|
+
export { registerModules, getRegisteredModules, clearRegisteredModules, markDockviewPackageLoaded, isDockviewPackageLoaded, defineModule, } from './dockview/modules';
|
|
42
|
+
export { resolveMessages } from './dockview/accessibilityMessages';
|
|
43
|
+
export { findRelativeZIndexParent } from './dom';
|
|
44
|
+
export { LiveRegionModule } from './dockview/liveRegionService';
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { Event } from '../events';
|
|
2
2
|
import { CompositeDisposable } from '../lifecycle';
|
|
3
|
-
import { AnchoredBox } from '../types';
|
|
3
|
+
import { AnchoredBox, Box } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Context handed to {@link OverlayOptions.transformDragPosition} each
|
|
6
|
+
* pointer-move frame while a floating overlay is being dragged.
|
|
7
|
+
*/
|
|
8
|
+
export interface OverlayDragContext {
|
|
9
|
+
/** Proposed top-left + size this frame, in container pixels (pre-clamp). */
|
|
10
|
+
readonly proposed: Box;
|
|
11
|
+
/** Size of the container the overlay is dragged within. */
|
|
12
|
+
readonly container: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
/** Bounds of the sibling overlays, snapshotted at drag start. */
|
|
17
|
+
readonly others: readonly Box[];
|
|
18
|
+
}
|
|
4
19
|
export declare class Overlay extends CompositeDisposable {
|
|
5
20
|
private readonly options;
|
|
6
21
|
private readonly _element;
|
|
@@ -22,11 +37,38 @@ export declare class Overlay extends CompositeDisposable {
|
|
|
22
37
|
set minimumInViewportHeight(value: number | undefined);
|
|
23
38
|
get element(): HTMLElement;
|
|
24
39
|
get isVisible(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Height of the optional drag-handle header, or 0 when none is present.
|
|
42
|
+
* Used to translate between the overlay's outer box and the content area
|
|
43
|
+
* available to the group beneath the header.
|
|
44
|
+
*/
|
|
45
|
+
get headerHeight(): number;
|
|
25
46
|
constructor(options: AnchoredBox & {
|
|
26
47
|
container: HTMLElement;
|
|
27
48
|
content: HTMLElement;
|
|
49
|
+
/**
|
|
50
|
+
* Optional dedicated drag handle rendered above the content (a
|
|
51
|
+
* floating window title bar). When provided the resize container
|
|
52
|
+
* lays its children out as a flex column so the content shrinks
|
|
53
|
+
* to fit beneath the handle.
|
|
54
|
+
*/
|
|
55
|
+
header?: HTMLElement;
|
|
28
56
|
minimumInViewportWidth?: number;
|
|
29
57
|
minimumInViewportHeight?: number;
|
|
58
|
+
/**
|
|
59
|
+
* Adjust the proposed top-left each drag frame (before the
|
|
60
|
+
* container clamp). Return an adjusted position or nothing to leave
|
|
61
|
+
* it unchanged. Used to implement snapping / custom bounds.
|
|
62
|
+
*/
|
|
63
|
+
transformDragPosition?: (context: OverlayDragContext) => {
|
|
64
|
+
top: number;
|
|
65
|
+
left: number;
|
|
66
|
+
} | void;
|
|
67
|
+
/**
|
|
68
|
+
* Snapshot the sibling overlays' boxes at drag start, supplied to
|
|
69
|
+
* `transformDragPosition` as `context.others`.
|
|
70
|
+
*/
|
|
71
|
+
getSiblingBoxes?: () => readonly Box[];
|
|
30
72
|
});
|
|
31
73
|
setVisible(isVisible: boolean): void;
|
|
32
74
|
bringToFront(): void;
|