dockview-core 5.1.0 → 6.0.0
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 +3 -1
- package/dist/cjs/api/component.api.d.ts +93 -1
- package/dist/cjs/api/component.api.js +146 -0
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +26 -0
- package/dist/cjs/api/dockviewGroupPanelApi.js +21 -1
- package/dist/cjs/api/entryPoints.js +4 -5
- package/dist/cjs/array.js +7 -8
- package/dist/cjs/dnd/dataTransfer.d.ts +2 -1
- package/dist/cjs/dnd/dataTransfer.js +5 -4
- package/dist/cjs/dnd/droptarget.d.ts +12 -0
- package/dist/cjs/dnd/droptarget.js +38 -10
- package/dist/cjs/dnd/ghost.js +1 -2
- package/dist/cjs/dockview/components/panel/content.js +5 -1
- package/dist/cjs/dockview/components/popupService.d.ts +9 -2
- package/dist/cjs/dockview/components/popupService.js +24 -9
- package/dist/cjs/dockview/components/tab/tab.d.ts +8 -1
- package/dist/cjs/dockview/components/tab/tab.js +94 -6
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.d.ts +30 -0
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.js +95 -0
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +71 -0
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +471 -0
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +57 -0
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +612 -0
- package/dist/cjs/dockview/components/titlebar/tabOverflowControl.js +1 -2
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +67 -0
- package/dist/cjs/dockview/components/titlebar/tabs.js +1464 -34
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +6 -0
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +132 -14
- package/dist/cjs/dockview/contextMenu.d.ts +10 -0
- package/dist/cjs/dockview/contextMenu.js +298 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +60 -3
- package/dist/cjs/dockview/dockviewComponent.js +712 -126
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +83 -0
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +619 -27
- package/dist/cjs/dockview/dockviewShell.d.ts +128 -0
- package/dist/cjs/dockview/dockviewShell.js +681 -0
- package/dist/cjs/dockview/events.d.ts +9 -0
- package/dist/cjs/dockview/framework.d.ts +14 -0
- package/dist/cjs/dockview/options.d.ts +97 -2
- package/dist/cjs/dockview/options.js +10 -5
- package/dist/cjs/dockview/tabGroup.d.ts +99 -0
- package/dist/cjs/dockview/tabGroup.js +219 -0
- package/dist/cjs/dockview/tabGroupAccent.d.ts +65 -0
- package/dist/cjs/dockview/tabGroupAccent.js +128 -0
- package/dist/cjs/dockview/theme.d.ts +56 -1
- package/dist/cjs/dockview/theme.js +103 -6
- package/dist/cjs/dockview/types.d.ts +2 -0
- package/dist/cjs/dom.js +19 -19
- package/dist/cjs/events.js +2 -2
- package/dist/cjs/gridview/baseComponentGridview.d.ts +1 -0
- package/dist/cjs/gridview/baseComponentGridview.js +6 -3
- package/dist/cjs/gridview/gridview.js +7 -7
- package/dist/cjs/index.d.ts +8 -5
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/popoutWindow.js +3 -3
- package/dist/cjs/splitview/splitviewPanel.d.ts +1 -1
- package/dist/dockview-core.js +5188 -729
- 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 +5186 -727
- package/dist/esm/api/component.api.d.ts +93 -1
- package/dist/esm/api/component.api.js +118 -0
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +26 -0
- package/dist/esm/api/dockviewGroupPanelApi.js +21 -1
- package/dist/esm/dnd/dataTransfer.d.ts +2 -1
- package/dist/esm/dnd/dataTransfer.js +2 -1
- package/dist/esm/dnd/droptarget.d.ts +12 -0
- package/dist/esm/dnd/droptarget.js +33 -5
- package/dist/esm/dockview/components/panel/content.js +5 -1
- package/dist/esm/dockview/components/popupService.d.ts +9 -2
- package/dist/esm/dockview/components/popupService.js +23 -9
- package/dist/esm/dockview/components/tab/tab.d.ts +8 -1
- package/dist/esm/dockview/components/tab/tab.js +96 -6
- package/dist/esm/dockview/components/titlebar/tabGroupChip.d.ts +30 -0
- package/dist/esm/dockview/components/titlebar/tabGroupChip.js +68 -0
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +71 -0
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +354 -0
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +57 -0
- package/dist/esm/dockview/components/titlebar/tabGroups.js +406 -0
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +67 -0
- package/dist/esm/dockview/components/titlebar/tabs.js +1212 -25
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +6 -0
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +105 -7
- package/dist/esm/dockview/contextMenu.d.ts +10 -0
- package/dist/esm/dockview/contextMenu.js +213 -0
- package/dist/esm/dockview/dockviewComponent.d.ts +60 -3
- package/dist/esm/dockview/dockviewComponent.js +460 -35
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +83 -0
- package/dist/esm/dockview/dockviewGroupPanelModel.js +460 -4
- package/dist/esm/dockview/dockviewShell.d.ts +128 -0
- package/dist/esm/dockview/dockviewShell.js +621 -0
- package/dist/esm/dockview/events.d.ts +9 -0
- package/dist/esm/dockview/framework.d.ts +14 -0
- package/dist/esm/dockview/options.d.ts +97 -2
- package/dist/esm/dockview/options.js +5 -0
- package/dist/esm/dockview/tabGroup.d.ts +99 -0
- package/dist/esm/dockview/tabGroup.js +144 -0
- package/dist/esm/dockview/tabGroupAccent.d.ts +65 -0
- package/dist/esm/dockview/tabGroupAccent.js +116 -0
- package/dist/esm/dockview/theme.d.ts +56 -1
- package/dist/esm/dockview/theme.js +102 -5
- package/dist/esm/dockview/types.d.ts +2 -0
- package/dist/esm/dom.js +1 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +1 -0
- package/dist/esm/gridview/baseComponentGridview.js +4 -1
- package/dist/esm/index.d.ts +8 -5
- package/dist/esm/index.js +2 -1
- package/dist/esm/popoutWindow.js +1 -1
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -1
- package/dist/package/main.cjs.js +5182 -753
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +5168 -753
- package/dist/styles/dockview.css +1968 -195
- package/package.json +5 -1
|
@@ -16,10 +16,14 @@ import { PaneviewDidDropEvent } from '../paneview/draggablePaneviewPanel';
|
|
|
16
16
|
import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/tabsContainer';
|
|
17
17
|
import { Box } from '../types';
|
|
18
18
|
import { DockviewDidDropEvent, DockviewWillDropEvent } from '../dockview/dockviewGroupPanelModel';
|
|
19
|
-
import { DockviewWillShowOverlayLocationEvent } from '../dockview/events';
|
|
19
|
+
import { DockviewWillShowOverlayLocationEvent, DockviewTabGroupChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewTabGroupPanelChangeEvent } from '../dockview/events';
|
|
20
|
+
import { ITabGroup } from '../dockview/tabGroup';
|
|
21
|
+
import { DockviewTabGroupColorEntry } from '../dockview/tabGroupAccent';
|
|
20
22
|
import { PaneviewComponentOptions, PaneviewDndOverlayEvent } from '../paneview/options';
|
|
21
23
|
import { SplitviewComponentOptions } from '../splitview/options';
|
|
22
24
|
import { GridviewComponentOptions } from '../gridview/options';
|
|
25
|
+
import { EdgeGroupPosition, EdgeGroupOptions } from '../dockview/dockviewShell';
|
|
26
|
+
import { DockviewGroupPanelApi } from './dockviewGroupPanelApi';
|
|
23
27
|
export interface CommonApi<T = any> {
|
|
24
28
|
readonly height: number;
|
|
25
29
|
readonly width: number;
|
|
@@ -315,6 +319,9 @@ export declare class GridviewApi implements CommonApi<SerializedGridviewComponen
|
|
|
315
319
|
*/
|
|
316
320
|
dispose(): void;
|
|
317
321
|
}
|
|
322
|
+
export interface DockviewGetTabGroupsOptions {
|
|
323
|
+
groupId: string;
|
|
324
|
+
}
|
|
318
325
|
export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
319
326
|
private readonly component;
|
|
320
327
|
/**
|
|
@@ -349,6 +356,13 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
349
356
|
* Total number of groups.
|
|
350
357
|
*/
|
|
351
358
|
get size(): number;
|
|
359
|
+
/**
|
|
360
|
+
* The active tab-group color palette. Reflects the configured
|
|
361
|
+
* `tabGroupColors` option, or the built-in defaults when unset.
|
|
362
|
+
* Useful for custom chip renderers that want to roll their own
|
|
363
|
+
* picker UI.
|
|
364
|
+
*/
|
|
365
|
+
get tabGroupColors(): readonly DockviewTabGroupColorEntry[];
|
|
352
366
|
/**
|
|
353
367
|
* Total number of panels.
|
|
354
368
|
*/
|
|
@@ -421,6 +435,30 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
421
435
|
get onDidPopoutGroupSizeChange(): Event<PopoutGroupChangeSizeEvent>;
|
|
422
436
|
get onDidPopoutGroupPositionChange(): Event<PopoutGroupChangePositionEvent>;
|
|
423
437
|
get onDidOpenPopoutWindowFail(): Event<void>;
|
|
438
|
+
/**
|
|
439
|
+
* Invoked when a tab group is created in any group.
|
|
440
|
+
*/
|
|
441
|
+
get onDidCreateTabGroup(): Event<DockviewTabGroupChangeEvent>;
|
|
442
|
+
/**
|
|
443
|
+
* Invoked when a tab group is destroyed in any group.
|
|
444
|
+
*/
|
|
445
|
+
get onDidDestroyTabGroup(): Event<DockviewTabGroupChangeEvent>;
|
|
446
|
+
/**
|
|
447
|
+
* Invoked when a panel is added to a tab group.
|
|
448
|
+
*/
|
|
449
|
+
get onDidAddPanelToTabGroup(): Event<DockviewTabGroupPanelChangeEvent>;
|
|
450
|
+
/**
|
|
451
|
+
* Invoked when a panel is removed from a tab group.
|
|
452
|
+
*/
|
|
453
|
+
get onDidRemovePanelFromTabGroup(): Event<DockviewTabGroupPanelChangeEvent>;
|
|
454
|
+
/**
|
|
455
|
+
* Invoked when a tab group's properties (label, color) change.
|
|
456
|
+
*/
|
|
457
|
+
get onDidTabGroupChange(): Event<DockviewTabGroupChangeEvent>;
|
|
458
|
+
/**
|
|
459
|
+
* Invoked when a tab group is collapsed or expanded.
|
|
460
|
+
*/
|
|
461
|
+
get onDidTabGroupCollapsedChange(): Event<DockviewTabGroupCollapsedChangeEvent>;
|
|
424
462
|
/**
|
|
425
463
|
* All panel objects.
|
|
426
464
|
*/
|
|
@@ -519,7 +557,61 @@ export declare class DockviewApi implements CommonApi<SerializedDockview> {
|
|
|
519
557
|
window: Window;
|
|
520
558
|
}) => void;
|
|
521
559
|
}): Promise<boolean>;
|
|
560
|
+
/**
|
|
561
|
+
* Add an edge group at the given position. Returns the group panel API
|
|
562
|
+
* for the newly created group. Throws if a group already exists there.
|
|
563
|
+
*/
|
|
564
|
+
addEdgeGroup(position: EdgeGroupPosition, options: EdgeGroupOptions): DockviewGroupPanelApi;
|
|
565
|
+
/**
|
|
566
|
+
* Get the group panel API for an edge group at the given position.
|
|
567
|
+
* Returns `undefined` if no edge group is configured at that position.
|
|
568
|
+
*/
|
|
569
|
+
getEdgeGroup(position: EdgeGroupPosition): DockviewGroupPanelApi | undefined;
|
|
570
|
+
/**
|
|
571
|
+
* Set the visibility of an edge group.
|
|
572
|
+
*/
|
|
573
|
+
setEdgeGroupVisible(position: EdgeGroupPosition, visible: boolean): void;
|
|
574
|
+
/**
|
|
575
|
+
* Check whether an edge group is currently visible.
|
|
576
|
+
*/
|
|
577
|
+
isEdgeGroupVisible(position: EdgeGroupPosition): boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Remove an edge group and reclaim its slot in the layout.
|
|
580
|
+
* All panels inside the group are disposed. Throws if no group exists at position.
|
|
581
|
+
*/
|
|
582
|
+
removeEdgeGroup(position: EdgeGroupPosition): void;
|
|
522
583
|
updateOptions(options: Partial<DockviewComponentOptions>): void;
|
|
584
|
+
private _getGroupModel;
|
|
585
|
+
createTabGroup(options: {
|
|
586
|
+
groupId: string;
|
|
587
|
+
label?: string;
|
|
588
|
+
color?: string;
|
|
589
|
+
componentParams?: Record<string, unknown>;
|
|
590
|
+
}): ITabGroup;
|
|
591
|
+
dissolveTabGroup(options: {
|
|
592
|
+
groupId: string;
|
|
593
|
+
tabGroupId: string;
|
|
594
|
+
}): void;
|
|
595
|
+
addPanelToTabGroup(options: {
|
|
596
|
+
groupId: string;
|
|
597
|
+
tabGroupId: string;
|
|
598
|
+
panelId: string;
|
|
599
|
+
index?: number;
|
|
600
|
+
}): void;
|
|
601
|
+
removePanelFromTabGroup(options: {
|
|
602
|
+
groupId: string;
|
|
603
|
+
panelId: string;
|
|
604
|
+
}): void;
|
|
605
|
+
getTabGroups(options: DockviewGetTabGroupsOptions): readonly ITabGroup[];
|
|
606
|
+
getTabGroupForPanel(options: {
|
|
607
|
+
groupId: string;
|
|
608
|
+
panelId: string;
|
|
609
|
+
}): ITabGroup | undefined;
|
|
610
|
+
moveTabGroup(options: {
|
|
611
|
+
groupId: string;
|
|
612
|
+
tabGroupId: string;
|
|
613
|
+
index: number;
|
|
614
|
+
}): void;
|
|
523
615
|
/**
|
|
524
616
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
525
617
|
*/
|
|
@@ -467,6 +467,15 @@ export class DockviewApi {
|
|
|
467
467
|
get size() {
|
|
468
468
|
return this.component.size;
|
|
469
469
|
}
|
|
470
|
+
/**
|
|
471
|
+
* The active tab-group color palette. Reflects the configured
|
|
472
|
+
* `tabGroupColors` option, or the built-in defaults when unset.
|
|
473
|
+
* Useful for custom chip renderers that want to roll their own
|
|
474
|
+
* picker UI.
|
|
475
|
+
*/
|
|
476
|
+
get tabGroupColors() {
|
|
477
|
+
return this.component.tabGroupColorPalette.entries();
|
|
478
|
+
}
|
|
470
479
|
/**
|
|
471
480
|
* Total number of panels.
|
|
472
481
|
*/
|
|
@@ -577,6 +586,42 @@ export class DockviewApi {
|
|
|
577
586
|
get onDidOpenPopoutWindowFail() {
|
|
578
587
|
return this.component.onDidOpenPopoutWindowFail;
|
|
579
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Invoked when a tab group is created in any group.
|
|
591
|
+
*/
|
|
592
|
+
get onDidCreateTabGroup() {
|
|
593
|
+
return this.component.onDidCreateTabGroup;
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Invoked when a tab group is destroyed in any group.
|
|
597
|
+
*/
|
|
598
|
+
get onDidDestroyTabGroup() {
|
|
599
|
+
return this.component.onDidDestroyTabGroup;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Invoked when a panel is added to a tab group.
|
|
603
|
+
*/
|
|
604
|
+
get onDidAddPanelToTabGroup() {
|
|
605
|
+
return this.component.onDidAddPanelToTabGroup;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Invoked when a panel is removed from a tab group.
|
|
609
|
+
*/
|
|
610
|
+
get onDidRemovePanelFromTabGroup() {
|
|
611
|
+
return this.component.onDidRemovePanelFromTabGroup;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Invoked when a tab group's properties (label, color) change.
|
|
615
|
+
*/
|
|
616
|
+
get onDidTabGroupChange() {
|
|
617
|
+
return this.component.onDidTabGroupChange;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Invoked when a tab group is collapsed or expanded.
|
|
621
|
+
*/
|
|
622
|
+
get onDidTabGroupCollapsedChange() {
|
|
623
|
+
return this.component.onDidTabGroupCollapsedChange;
|
|
624
|
+
}
|
|
580
625
|
/**
|
|
581
626
|
* All panel objects.
|
|
582
627
|
*/
|
|
@@ -712,9 +757,82 @@ export class DockviewApi {
|
|
|
712
757
|
addPopoutGroup(item, options) {
|
|
713
758
|
return this.component.addPopoutGroup(item, options);
|
|
714
759
|
}
|
|
760
|
+
/**
|
|
761
|
+
* Add an edge group at the given position. Returns the group panel API
|
|
762
|
+
* for the newly created group. Throws if a group already exists there.
|
|
763
|
+
*/
|
|
764
|
+
addEdgeGroup(position, options) {
|
|
765
|
+
return this.component.addEdgeGroup(position, options);
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Get the group panel API for an edge group at the given position.
|
|
769
|
+
* Returns `undefined` if no edge group is configured at that position.
|
|
770
|
+
*/
|
|
771
|
+
getEdgeGroup(position) {
|
|
772
|
+
return this.component.getEdgeGroup(position);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Set the visibility of an edge group.
|
|
776
|
+
*/
|
|
777
|
+
setEdgeGroupVisible(position, visible) {
|
|
778
|
+
this.component.setEdgeGroupVisible(position, visible);
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Check whether an edge group is currently visible.
|
|
782
|
+
*/
|
|
783
|
+
isEdgeGroupVisible(position) {
|
|
784
|
+
return this.component.isEdgeGroupVisible(position);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Remove an edge group and reclaim its slot in the layout.
|
|
788
|
+
* All panels inside the group are disposed. Throws if no group exists at position.
|
|
789
|
+
*/
|
|
790
|
+
removeEdgeGroup(position) {
|
|
791
|
+
this.component.removeEdgeGroup(position);
|
|
792
|
+
}
|
|
715
793
|
updateOptions(options) {
|
|
716
794
|
this.component.updateOptions(options);
|
|
717
795
|
}
|
|
796
|
+
// === Tab Group API ===
|
|
797
|
+
_getGroupModel(groupId) {
|
|
798
|
+
const group = this.component.getPanel(groupId);
|
|
799
|
+
if (!group) {
|
|
800
|
+
throw new Error(`dockview: group '${groupId}' not found`);
|
|
801
|
+
}
|
|
802
|
+
return group.model;
|
|
803
|
+
}
|
|
804
|
+
createTabGroup(options) {
|
|
805
|
+
const model = this._getGroupModel(options.groupId);
|
|
806
|
+
return model.createTabGroup({
|
|
807
|
+
label: options.label,
|
|
808
|
+
color: options.color,
|
|
809
|
+
componentParams: options.componentParams,
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
dissolveTabGroup(options) {
|
|
813
|
+
const model = this._getGroupModel(options.groupId);
|
|
814
|
+
model.dissolveTabGroup(options.tabGroupId);
|
|
815
|
+
}
|
|
816
|
+
addPanelToTabGroup(options) {
|
|
817
|
+
const model = this._getGroupModel(options.groupId);
|
|
818
|
+
model.addPanelToTabGroup(options.tabGroupId, options.panelId, options.index);
|
|
819
|
+
}
|
|
820
|
+
removePanelFromTabGroup(options) {
|
|
821
|
+
const model = this._getGroupModel(options.groupId);
|
|
822
|
+
model.removePanelFromTabGroup(options.panelId);
|
|
823
|
+
}
|
|
824
|
+
getTabGroups(options) {
|
|
825
|
+
const model = this._getGroupModel(options.groupId);
|
|
826
|
+
return model.getTabGroups();
|
|
827
|
+
}
|
|
828
|
+
getTabGroupForPanel(options) {
|
|
829
|
+
const model = this._getGroupModel(options.groupId);
|
|
830
|
+
return model.getTabGroupForPanel(options.panelId);
|
|
831
|
+
}
|
|
832
|
+
moveTabGroup(options) {
|
|
833
|
+
const model = this._getGroupModel(options.groupId);
|
|
834
|
+
model.moveTabGroup(options.tabGroupId, options.index);
|
|
835
|
+
}
|
|
718
836
|
/**
|
|
719
837
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
720
838
|
*/
|
|
@@ -17,9 +17,17 @@ export interface DockviewGroupMoveParams {
|
|
|
17
17
|
*/
|
|
18
18
|
skipSetActive?: boolean;
|
|
19
19
|
}
|
|
20
|
+
export interface DockviewGroupPanelCollapsedChangeEvent {
|
|
21
|
+
readonly isCollapsed: boolean;
|
|
22
|
+
}
|
|
20
23
|
export interface DockviewGroupPanelApi extends GridviewPanelApi {
|
|
21
24
|
readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
|
|
22
25
|
readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
|
|
26
|
+
/**
|
|
27
|
+
* Fired when an edge group's collapsed state changes.
|
|
28
|
+
* Never fires for non-edge groups.
|
|
29
|
+
*/
|
|
30
|
+
readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>;
|
|
23
31
|
readonly location: DockviewGroupLocation;
|
|
24
32
|
/**
|
|
25
33
|
* If you require the Window object
|
|
@@ -32,6 +40,19 @@ export interface DockviewGroupPanelApi extends GridviewPanelApi {
|
|
|
32
40
|
isMaximized(): boolean;
|
|
33
41
|
exitMaximized(): void;
|
|
34
42
|
close(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Collapse this group (edge groups only). No-op for non-edge groups.
|
|
45
|
+
*/
|
|
46
|
+
collapse(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Expand this group (edge groups only). No-op for non-edge groups.
|
|
49
|
+
*/
|
|
50
|
+
expand(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Returns true if this edge group is currently collapsed.
|
|
53
|
+
* Always returns false for non-edge groups.
|
|
54
|
+
*/
|
|
55
|
+
isCollapsed(): boolean;
|
|
35
56
|
}
|
|
36
57
|
export interface DockviewGroupPanelFloatingChangeEvent {
|
|
37
58
|
readonly location: DockviewGroupLocation;
|
|
@@ -44,6 +65,8 @@ export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
44
65
|
readonly onDidLocationChange: Event<DockviewGroupPanelFloatingChangeEvent>;
|
|
45
66
|
readonly _onDidActivePanelChange: Emitter<DockviewGroupChangeEvent>;
|
|
46
67
|
readonly onDidActivePanelChange: Event<DockviewGroupChangeEvent>;
|
|
68
|
+
readonly _onDidCollapsedChange: Emitter<DockviewGroupPanelCollapsedChangeEvent>;
|
|
69
|
+
readonly onDidCollapsedChange: Event<DockviewGroupPanelCollapsedChangeEvent>;
|
|
47
70
|
get location(): DockviewGroupLocation;
|
|
48
71
|
constructor(id: string, accessor: DockviewComponent);
|
|
49
72
|
setSize(event: SizeEvent): void;
|
|
@@ -55,5 +78,8 @@ export declare class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
55
78
|
maximize(): void;
|
|
56
79
|
isMaximized(): boolean;
|
|
57
80
|
exitMaximized(): void;
|
|
81
|
+
collapse(): void;
|
|
82
|
+
expand(): void;
|
|
83
|
+
isCollapsed(): boolean;
|
|
58
84
|
initialize(group: DockviewGroupPanel): void;
|
|
59
85
|
}
|
|
@@ -16,7 +16,9 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
16
16
|
this.onDidLocationChange = this._onDidLocationChange.event;
|
|
17
17
|
this._onDidActivePanelChange = new Emitter();
|
|
18
18
|
this.onDidActivePanelChange = this._onDidActivePanelChange.event;
|
|
19
|
-
this.
|
|
19
|
+
this._onDidCollapsedChange = new Emitter();
|
|
20
|
+
this.onDidCollapsedChange = this._onDidCollapsedChange.event;
|
|
21
|
+
this.addDisposables(this._onDidLocationChange, this._onDidActivePanelChange, this._onDidCollapsedChange, this._onDidVisibilityChange.event((event) => {
|
|
20
22
|
// When becoming visible, apply any pending size change
|
|
21
23
|
if (event.isVisible && this._pendingSize) {
|
|
22
24
|
super.setSize(this._pendingSize);
|
|
@@ -98,6 +100,24 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
|
|
98
100
|
this.accessor.exitMaximizedGroup();
|
|
99
101
|
}
|
|
100
102
|
}
|
|
103
|
+
collapse() {
|
|
104
|
+
if (!this._group) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.accessor.setEdgeGroupCollapsed(this._group, true);
|
|
108
|
+
}
|
|
109
|
+
expand() {
|
|
110
|
+
if (!this._group) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.accessor.setEdgeGroupCollapsed(this._group, false);
|
|
114
|
+
}
|
|
115
|
+
isCollapsed() {
|
|
116
|
+
if (!this._group) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return this.accessor.isEdgeGroupCollapsed(this._group);
|
|
120
|
+
}
|
|
101
121
|
initialize(group) {
|
|
102
122
|
this._group = group;
|
|
103
123
|
}
|
|
@@ -4,7 +4,8 @@ export declare class PanelTransfer extends TransferObject {
|
|
|
4
4
|
readonly viewId: string;
|
|
5
5
|
readonly groupId: string;
|
|
6
6
|
readonly panelId: string | null;
|
|
7
|
-
|
|
7
|
+
readonly tabGroupId?: string | undefined;
|
|
8
|
+
constructor(viewId: string, groupId: string, panelId: string | null, tabGroupId?: string | undefined);
|
|
8
9
|
}
|
|
9
10
|
export declare class PaneTransfer extends TransferObject {
|
|
10
11
|
readonly viewId: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
class TransferObject {
|
|
2
2
|
}
|
|
3
3
|
export class PanelTransfer extends TransferObject {
|
|
4
|
-
constructor(viewId, groupId, panelId) {
|
|
4
|
+
constructor(viewId, groupId, panelId, tabGroupId) {
|
|
5
5
|
super();
|
|
6
6
|
this.viewId = viewId;
|
|
7
7
|
this.groupId = groupId;
|
|
8
8
|
this.panelId = panelId;
|
|
9
|
+
this.tabGroupId = tabGroupId;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
export class PaneTransfer extends TransferObject {
|
|
@@ -26,6 +26,18 @@ export type MeasuredValue = {
|
|
|
26
26
|
export type DroptargetOverlayModel = {
|
|
27
27
|
size?: MeasuredValue;
|
|
28
28
|
activationSize?: MeasuredValue;
|
|
29
|
+
/**
|
|
30
|
+
* Override the width threshold (in pixels) below which the overlay switches
|
|
31
|
+
* to a thin-border indicator instead of a half-width highlight. Set to 0 to
|
|
32
|
+
* always show the half-width overlay regardless of element size.
|
|
33
|
+
*/
|
|
34
|
+
smallWidthBoundary?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Override the height threshold (in pixels) below which the overlay switches
|
|
37
|
+
* to a thin-border indicator instead of a half-height highlight. Set to 0 to
|
|
38
|
+
* always show the half-height overlay regardless of element size.
|
|
39
|
+
*/
|
|
40
|
+
smallHeightBoundary?: number;
|
|
29
41
|
};
|
|
30
42
|
export interface DropTargetTargetModel {
|
|
31
43
|
getElements(event?: DragEvent, outline?: HTMLElement): {
|
|
@@ -264,13 +264,15 @@ export class Droptarget extends CompositeDisposable {
|
|
|
264
264
|
return typeof value === 'boolean' && value;
|
|
265
265
|
}
|
|
266
266
|
toggleClasses(quadrant, width, height) {
|
|
267
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
267
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
268
268
|
const target = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
269
269
|
if (!target && !this.overlayElement) {
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
const
|
|
272
|
+
const smallWidthBoundary = (_d = (_c = this.options.overlayModel) === null || _c === void 0 ? void 0 : _c.smallWidthBoundary) !== null && _d !== void 0 ? _d : SMALL_WIDTH_BOUNDARY;
|
|
273
|
+
const smallHeightBoundary = (_f = (_e = this.options.overlayModel) === null || _e === void 0 ? void 0 : _e.smallHeightBoundary) !== null && _f !== void 0 ? _f : SMALL_HEIGHT_BOUNDARY;
|
|
274
|
+
const isSmallX = width < smallWidthBoundary;
|
|
275
|
+
const isSmallY = height < smallHeightBoundary;
|
|
274
276
|
const isLeft = quadrant === 'left';
|
|
275
277
|
const isRight = quadrant === 'right';
|
|
276
278
|
const isTop = quadrant === 'top';
|
|
@@ -280,7 +282,7 @@ export class Droptarget extends CompositeDisposable {
|
|
|
280
282
|
const topClass = !isSmallY && isTop;
|
|
281
283
|
const bottomClass = !isSmallY && isBottom;
|
|
282
284
|
let size = 1;
|
|
283
|
-
const sizeOptions = (
|
|
285
|
+
const sizeOptions = (_h = (_g = this.options.overlayModel) === null || _g === void 0 ? void 0 : _g.size) !== null && _h !== void 0 ? _h : DEFAULT_SIZE;
|
|
284
286
|
if (sizeOptions.type === 'percentage') {
|
|
285
287
|
size = clamp(sizeOptions.value, 0, 100) / 100;
|
|
286
288
|
}
|
|
@@ -293,7 +295,7 @@ export class Droptarget extends CompositeDisposable {
|
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
if (target) {
|
|
296
|
-
const outlineEl = (
|
|
298
|
+
const outlineEl = (_l = (_k = (_j = this.options).getOverlayOutline) === null || _k === void 0 ? void 0 : _k.call(_j)) !== null && _l !== void 0 ? _l : this.element;
|
|
297
299
|
const elBox = outlineEl.getBoundingClientRect();
|
|
298
300
|
const ta = target.getElements(undefined, outlineEl);
|
|
299
301
|
const el = ta.root;
|
|
@@ -328,6 +330,13 @@ export class Droptarget extends CompositeDisposable {
|
|
|
328
330
|
box.left = rootLeft + width - 4;
|
|
329
331
|
box.width = 4;
|
|
330
332
|
}
|
|
333
|
+
if (isSmallY && isTop) {
|
|
334
|
+
box.height = 4;
|
|
335
|
+
}
|
|
336
|
+
if (isSmallY && isBottom) {
|
|
337
|
+
box.top = rootTop + height - 4;
|
|
338
|
+
box.height = 4;
|
|
339
|
+
}
|
|
331
340
|
// Use GPU-optimized bounds checking and setting
|
|
332
341
|
if (!checkBoundsChanged(overlay, box)) {
|
|
333
342
|
return;
|
|
@@ -338,6 +347,8 @@ export class Droptarget extends CompositeDisposable {
|
|
|
338
347
|
toggleClass(overlay, 'dv-drop-target-right', isRight);
|
|
339
348
|
toggleClass(overlay, 'dv-drop-target-top', isTop);
|
|
340
349
|
toggleClass(overlay, 'dv-drop-target-bottom', isBottom);
|
|
350
|
+
toggleClass(overlay, 'dv-drop-target-anchor-line', (isSmallX && (isLeft || isRight)) ||
|
|
351
|
+
(isSmallY && (isTop || isBottom)));
|
|
341
352
|
toggleClass(overlay, 'dv-drop-target-center', quadrant === 'center');
|
|
342
353
|
if (ta.changed) {
|
|
343
354
|
toggleClass(overlay, 'dv-drop-target-anchor-container-changed', true);
|
|
@@ -384,9 +395,26 @@ export class Droptarget extends CompositeDisposable {
|
|
|
384
395
|
box.top = `${100 * (1 - size)}%`;
|
|
385
396
|
box.height = `${100 * size}%`;
|
|
386
397
|
}
|
|
398
|
+
if (isSmallX && isLeft) {
|
|
399
|
+
box.width = '4px';
|
|
400
|
+
}
|
|
401
|
+
if (isSmallX && isRight) {
|
|
402
|
+
box.left = `${width - 4}px`;
|
|
403
|
+
box.width = '4px';
|
|
404
|
+
}
|
|
405
|
+
if (isSmallY && isTop) {
|
|
406
|
+
box.height = '4px';
|
|
407
|
+
}
|
|
408
|
+
if (isSmallY && isBottom) {
|
|
409
|
+
box.top = `${height - 4}px`;
|
|
410
|
+
box.height = '4px';
|
|
411
|
+
}
|
|
387
412
|
setGPUOptimizedBoundsFromStrings(this.overlayElement, box);
|
|
413
|
+
const isLine = (isSmallX && (isLeft || isRight)) ||
|
|
414
|
+
(isSmallY && (isTop || isBottom));
|
|
388
415
|
toggleClass(this.overlayElement, 'dv-drop-target-small-vertical', isSmallY);
|
|
389
416
|
toggleClass(this.overlayElement, 'dv-drop-target-small-horizontal', isSmallX);
|
|
417
|
+
toggleClass(this.overlayElement, 'dv-drop-target-selection-line', isLine);
|
|
390
418
|
toggleClass(this.overlayElement, 'dv-drop-target-left', isLeft);
|
|
391
419
|
toggleClass(this.overlayElement, 'dv-drop-target-right', isRight);
|
|
392
420
|
toggleClass(this.overlayElement, 'dv-drop-target-top', isTop);
|
|
@@ -57,6 +57,7 @@ export class ContentContainer extends CompositeDisposable {
|
|
|
57
57
|
this.element.style.display = 'none';
|
|
58
58
|
}
|
|
59
59
|
renderPanel(panel, options = { asActive: true }) {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
60
61
|
const doRender = options.asActive ||
|
|
61
62
|
(this.panel && this.group.isPanelActive(this.panel));
|
|
62
63
|
if (this.panel &&
|
|
@@ -65,6 +66,7 @@ export class ContentContainer extends CompositeDisposable {
|
|
|
65
66
|
* If the currently attached panel is mounted directly to the content then remove it
|
|
66
67
|
*/
|
|
67
68
|
this._element.removeChild(this.panel.view.content.element);
|
|
69
|
+
(_b = (_a = this.panel.view.content).onHide) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
68
70
|
}
|
|
69
71
|
this.panel = panel;
|
|
70
72
|
let container;
|
|
@@ -74,6 +76,7 @@ export class ContentContainer extends CompositeDisposable {
|
|
|
74
76
|
if (this.panel) {
|
|
75
77
|
if (doRender) {
|
|
76
78
|
this._element.appendChild(this.panel.view.content.element);
|
|
79
|
+
(_d = (_c = this.panel.view.content).onShow) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
container = this._element;
|
|
@@ -108,10 +111,11 @@ export class ContentContainer extends CompositeDisposable {
|
|
|
108
111
|
// noop
|
|
109
112
|
}
|
|
110
113
|
closePanel() {
|
|
111
|
-
var _a;
|
|
114
|
+
var _a, _b, _c;
|
|
112
115
|
if (this.panel) {
|
|
113
116
|
if (this.panel.api.renderer === 'onlyWhenVisible') {
|
|
114
117
|
(_a = this.panel.view.content.element.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild(this.panel.view.content.element);
|
|
118
|
+
(_c = (_b = this.panel.view.content).onHide) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
this.panel = undefined;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { CompositeDisposable } from '../../lifecycle';
|
|
2
2
|
export declare class PopupService extends CompositeDisposable {
|
|
3
|
-
private readonly root;
|
|
4
3
|
private readonly _element;
|
|
5
4
|
private _active;
|
|
6
5
|
private readonly _activeDisposable;
|
|
7
|
-
|
|
6
|
+
private _root;
|
|
7
|
+
private readonly _window;
|
|
8
|
+
constructor(root: HTMLElement, win?: Window);
|
|
9
|
+
/**
|
|
10
|
+
* Move the popup anchor into a new root element. Call this when a shell
|
|
11
|
+
* wraps the dockview component so that edge-group overflow dropdowns
|
|
12
|
+
* position correctly relative to the full layout area.
|
|
13
|
+
*/
|
|
14
|
+
updateRoot(newRoot: HTMLElement): void;
|
|
8
15
|
openPopover(element: HTMLElement, position: {
|
|
9
16
|
x: number;
|
|
10
17
|
y: number;
|
|
@@ -2,23 +2,33 @@ import { shiftAbsoluteElementIntoView } from '../../dom';
|
|
|
2
2
|
import { addDisposableListener } from '../../events';
|
|
3
3
|
import { CompositeDisposable, Disposable, MutableDisposable, } from '../../lifecycle';
|
|
4
4
|
export class PopupService extends CompositeDisposable {
|
|
5
|
-
constructor(root) {
|
|
5
|
+
constructor(root, win = window) {
|
|
6
6
|
super();
|
|
7
|
-
this.root = root;
|
|
8
7
|
this._active = null;
|
|
9
8
|
this._activeDisposable = new MutableDisposable();
|
|
10
|
-
this.
|
|
9
|
+
this._root = root;
|
|
10
|
+
this._window = win;
|
|
11
|
+
this._element = win.document.createElement('div');
|
|
11
12
|
this._element.className = 'dv-popover-anchor';
|
|
12
13
|
this._element.style.position = 'relative';
|
|
13
|
-
this.
|
|
14
|
+
this._root.prepend(this._element);
|
|
14
15
|
this.addDisposables(Disposable.from(() => {
|
|
15
16
|
this.close();
|
|
16
17
|
}), this._activeDisposable);
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Move the popup anchor into a new root element. Call this when a shell
|
|
21
|
+
* wraps the dockview component so that edge-group overflow dropdowns
|
|
22
|
+
* position correctly relative to the full layout area.
|
|
23
|
+
*/
|
|
24
|
+
updateRoot(newRoot) {
|
|
25
|
+
newRoot.prepend(this._element);
|
|
26
|
+
this._root = newRoot;
|
|
27
|
+
}
|
|
18
28
|
openPopover(element, position) {
|
|
19
29
|
var _a;
|
|
20
30
|
this.close();
|
|
21
|
-
const wrapper = document.createElement('div');
|
|
31
|
+
const wrapper = this._window.document.createElement('div');
|
|
22
32
|
wrapper.style.position = 'absolute';
|
|
23
33
|
wrapper.style.zIndex = (_a = position.zIndex) !== null && _a !== void 0 ? _a : 'var(--dv-overlay-z-index)';
|
|
24
34
|
wrapper.appendChild(element);
|
|
@@ -29,7 +39,7 @@ export class PopupService extends CompositeDisposable {
|
|
|
29
39
|
wrapper.style.left = `${position.x - offsetX}px`;
|
|
30
40
|
this._element.appendChild(wrapper);
|
|
31
41
|
this._active = wrapper;
|
|
32
|
-
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(
|
|
42
|
+
this._activeDisposable.value = new CompositeDisposable(addDisposableListener(this._window, 'pointerdown', (event) => {
|
|
33
43
|
var _a;
|
|
34
44
|
const target = event.target;
|
|
35
45
|
if (!(target instanceof HTMLElement)) {
|
|
@@ -43,11 +53,15 @@ export class PopupService extends CompositeDisposable {
|
|
|
43
53
|
return; // clicked within popover
|
|
44
54
|
}
|
|
45
55
|
this.close();
|
|
46
|
-
}), addDisposableListener(
|
|
56
|
+
}), addDisposableListener(this._window, 'keydown', (event) => {
|
|
57
|
+
if (event.key === 'Escape' || event.key === 'Enter') {
|
|
58
|
+
this.close();
|
|
59
|
+
}
|
|
60
|
+
}), addDisposableListener(this._window, 'resize', () => {
|
|
47
61
|
this.close();
|
|
48
62
|
}));
|
|
49
|
-
requestAnimationFrame(() => {
|
|
50
|
-
shiftAbsoluteElementIntoView(wrapper, this.
|
|
63
|
+
this._window.requestAnimationFrame(() => {
|
|
64
|
+
shiftAbsoluteElementIntoView(wrapper, this._root);
|
|
51
65
|
});
|
|
52
66
|
}
|
|
53
67
|
close() {
|
|
@@ -5,6 +5,7 @@ import { ITabRenderer } from '../../types';
|
|
|
5
5
|
import { DockviewGroupPanel } from '../../dockviewGroupPanel';
|
|
6
6
|
import { DroptargetEvent, WillShowOverlayEvent } from '../../../dnd/droptarget';
|
|
7
7
|
import { IDockviewPanel } from '../../dockviewPanel';
|
|
8
|
+
import { DockviewHeaderDirection } from '../../options';
|
|
8
9
|
export declare class Tab extends CompositeDisposable {
|
|
9
10
|
readonly panel: IDockviewPanel;
|
|
10
11
|
private readonly accessor;
|
|
@@ -13,17 +14,23 @@ export declare class Tab extends CompositeDisposable {
|
|
|
13
14
|
private readonly dropTarget;
|
|
14
15
|
private content;
|
|
15
16
|
private readonly dragHandler;
|
|
17
|
+
private _direction;
|
|
16
18
|
private readonly _onPointDown;
|
|
17
19
|
readonly onPointerDown: Event<MouseEvent>;
|
|
20
|
+
private readonly _onTabClick;
|
|
21
|
+
readonly onTabClick: Event<MouseEvent>;
|
|
18
22
|
private readonly _onDropped;
|
|
19
23
|
readonly onDrop: Event<DroptargetEvent>;
|
|
20
24
|
private readonly _onDragStart;
|
|
21
25
|
readonly onDragStart: Event<DragEvent>;
|
|
26
|
+
private readonly _onDragEnd;
|
|
27
|
+
readonly onDragEnd: Event<DragEvent>;
|
|
22
28
|
readonly onWillShowOverlay: Event<WillShowOverlayEvent>;
|
|
23
29
|
get element(): HTMLElement;
|
|
24
30
|
constructor(panel: IDockviewPanel, accessor: DockviewComponent, group: DockviewGroupPanel);
|
|
25
31
|
setActive(isActive: boolean): void;
|
|
26
32
|
setContent(part: ITabRenderer): void;
|
|
33
|
+
private _buildOverlayModel;
|
|
34
|
+
setDirection(direction: DockviewHeaderDirection): void;
|
|
27
35
|
updateDragAndDropState(): void;
|
|
28
|
-
dispose(): void;
|
|
29
36
|
}
|