dockview-core 6.3.0 → 6.4.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 +1 -0
- package/dist/cjs/dnd/backend.d.ts +70 -0
- package/dist/cjs/dnd/backend.js +171 -0
- package/dist/cjs/dnd/dropOverlay.d.ts +20 -0
- package/dist/cjs/dnd/dropOverlay.js +197 -0
- package/dist/cjs/dnd/droptarget.d.ts +20 -6
- package/dist/cjs/dnd/droptarget.js +14 -208
- package/dist/cjs/dnd/pointer/index.d.ts +11 -0
- package/dist/cjs/dnd/pointer/index.js +13 -0
- package/dist/cjs/dnd/pointer/longPress.d.ts +32 -0
- package/dist/cjs/dnd/pointer/longPress.js +151 -0
- package/dist/cjs/dnd/pointer/pointerDragController.d.ts +60 -0
- package/dist/cjs/dnd/pointer/pointerDragController.js +241 -0
- package/dist/cjs/dnd/pointer/pointerDragSource.d.ts +61 -0
- package/dist/cjs/dnd/pointer/pointerDragSource.js +195 -0
- package/dist/cjs/dnd/pointer/pointerDropTarget.d.ts +39 -0
- package/dist/cjs/dnd/pointer/pointerDropTarget.js +198 -0
- package/dist/cjs/dnd/pointer/pointerGhost.d.ts +30 -0
- package/dist/cjs/dnd/pointer/pointerGhost.js +44 -0
- package/dist/cjs/dnd/pointer/types.d.ts +16 -0
- package/dist/cjs/dnd/pointer/types.js +2 -0
- package/dist/cjs/dockview/components/panel/content.d.ts +3 -1
- package/dist/cjs/dockview/components/panel/content.js +33 -16
- package/dist/cjs/dockview/components/popupService.js +34 -0
- package/dist/cjs/dockview/components/tab/tab.d.ts +11 -3
- package/dist/cjs/dockview/components/tab/tab.js +151 -117
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.d.ts +9 -2
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.js +15 -6
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +33 -5
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +231 -40
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +38 -1
- package/dist/cjs/dockview/components/titlebar/tabs.js +372 -251
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +5 -3
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +6 -2
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +189 -27
- package/dist/cjs/dockview/contextMenu.js +19 -4
- package/dist/cjs/dockview/dndCapabilities.d.ts +19 -0
- package/dist/cjs/dockview/dndCapabilities.js +39 -0
- package/dist/cjs/dockview/dockviewComponent.d.ts +1 -0
- package/dist/cjs/dockview/dockviewComponent.js +54 -33
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +9 -5
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +25 -11
- package/dist/cjs/dockview/events.d.ts +2 -1
- package/dist/cjs/dockview/events.js +1 -0
- package/dist/cjs/dockview/options.d.ts +18 -3
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.js +7 -3
- package/dist/cjs/overlay/overlay.d.ts +12 -0
- package/dist/cjs/overlay/overlay.js +84 -16
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +3 -1
- package/dist/cjs/paneview/draggablePaneviewPanel.js +27 -26
- package/dist/cjs/paneview/options.d.ts +4 -3
- package/dist/dockview-core.js +2199 -834
- 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 +2202 -837
- package/dist/esm/dnd/backend.d.ts +70 -0
- package/dist/esm/dnd/backend.js +148 -0
- package/dist/esm/dnd/dropOverlay.d.ts +20 -0
- package/dist/esm/dnd/dropOverlay.js +192 -0
- package/dist/esm/dnd/droptarget.d.ts +20 -6
- package/dist/esm/dnd/droptarget.js +16 -210
- package/dist/esm/dnd/pointer/index.d.ts +11 -0
- package/dist/esm/dnd/pointer/index.js +5 -0
- package/dist/esm/dnd/pointer/longPress.d.ts +32 -0
- package/dist/esm/dnd/pointer/longPress.js +127 -0
- package/dist/esm/dnd/pointer/pointerDragController.d.ts +60 -0
- package/dist/esm/dnd/pointer/pointerDragController.js +191 -0
- package/dist/esm/dnd/pointer/pointerDragSource.d.ts +61 -0
- package/dist/esm/dnd/pointer/pointerDragSource.js +171 -0
- package/dist/esm/dnd/pointer/pointerDropTarget.d.ts +39 -0
- package/dist/esm/dnd/pointer/pointerDropTarget.js +168 -0
- package/dist/esm/dnd/pointer/pointerGhost.d.ts +30 -0
- package/dist/esm/dnd/pointer/pointerGhost.js +39 -0
- package/dist/esm/dnd/pointer/types.d.ts +16 -0
- package/dist/esm/dnd/pointer/types.js +1 -0
- package/dist/esm/dockview/components/panel/content.d.ts +3 -1
- package/dist/esm/dockview/components/panel/content.js +33 -16
- package/dist/esm/dockview/components/popupService.js +34 -0
- package/dist/esm/dockview/components/tab/tab.d.ts +11 -3
- package/dist/esm/dockview/components/tab/tab.js +139 -114
- package/dist/esm/dockview/components/titlebar/tabGroupChip.d.ts +9 -2
- package/dist/esm/dockview/components/titlebar/tabGroupChip.js +15 -6
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +33 -5
- package/dist/esm/dockview/components/titlebar/tabGroups.js +177 -12
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +38 -1
- package/dist/esm/dockview/components/titlebar/tabs.js +348 -227
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +5 -3
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +6 -2
- package/dist/esm/dockview/components/titlebar/voidContainer.js +179 -31
- package/dist/esm/dockview/contextMenu.js +19 -4
- package/dist/esm/dockview/dndCapabilities.d.ts +19 -0
- package/dist/esm/dockview/dndCapabilities.js +36 -0
- package/dist/esm/dockview/dockviewComponent.d.ts +1 -0
- package/dist/esm/dockview/dockviewComponent.js +55 -34
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +9 -5
- package/dist/esm/dockview/dockviewGroupPanelModel.js +24 -11
- package/dist/esm/dockview/events.d.ts +2 -1
- package/dist/esm/dockview/events.js +1 -0
- package/dist/esm/dockview/options.d.ts +18 -3
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.js +7 -3
- package/dist/esm/overlay/overlay.d.ts +12 -0
- package/dist/esm/overlay/overlay.js +85 -17
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +3 -1
- package/dist/esm/paneview/draggablePaneviewPanel.js +26 -20
- package/dist/esm/paneview/options.d.ts +4 -3
- package/dist/package/main.cjs.js +2202 -837
- package/dist/package/main.cjs.min.js +2 -2
- package/dist/package/main.esm.min.mjs +2 -2
- package/dist/package/main.esm.mjs +2202 -837
- package/dist/styles/dockview.css +117 -1
- package/package.json +3 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +0 -14
- package/dist/cjs/dnd/abstractDragHandler.js +0 -86
- package/dist/cjs/dnd/groupDragHandler.d.ts +0 -12
- package/dist/cjs/dnd/groupDragHandler.js +0 -104
- package/dist/esm/dnd/abstractDragHandler.d.ts +0 -14
- package/dist/esm/dnd/abstractDragHandler.js +0 -63
- package/dist/esm/dnd/groupDragHandler.d.ts +0 -12
- package/dist/esm/dnd/groupDragHandler.js +0 -81
package/dist/styles/dockview.css
CHANGED
|
@@ -2344,6 +2344,16 @@
|
|
|
2344
2344
|
/* Enhanced GPU acceleration during drag */
|
|
2345
2345
|
will-change: transform, opacity;
|
|
2346
2346
|
}
|
|
2347
|
+
.dv-resize-container .dv-resize-handle-top,
|
|
2348
|
+
.dv-resize-container .dv-resize-handle-bottom,
|
|
2349
|
+
.dv-resize-container .dv-resize-handle-left,
|
|
2350
|
+
.dv-resize-container .dv-resize-handle-right,
|
|
2351
|
+
.dv-resize-container .dv-resize-handle-topleft,
|
|
2352
|
+
.dv-resize-container .dv-resize-handle-topright,
|
|
2353
|
+
.dv-resize-container .dv-resize-handle-bottomleft,
|
|
2354
|
+
.dv-resize-container .dv-resize-handle-bottomright {
|
|
2355
|
+
touch-action: none;
|
|
2356
|
+
}
|
|
2347
2357
|
.dv-resize-container .dv-resize-handle-top {
|
|
2348
2358
|
height: 4px;
|
|
2349
2359
|
width: calc(100% - 8px);
|
|
@@ -2416,6 +2426,55 @@
|
|
|
2416
2426
|
position: absolute;
|
|
2417
2427
|
cursor: se-resize;
|
|
2418
2428
|
}
|
|
2429
|
+
@media (pointer: coarse) {
|
|
2430
|
+
.dv-resize-container .dv-resize-handle-top,
|
|
2431
|
+
.dv-resize-container .dv-resize-handle-bottom {
|
|
2432
|
+
height: 16px;
|
|
2433
|
+
width: calc(100% - 48px);
|
|
2434
|
+
left: 24px;
|
|
2435
|
+
}
|
|
2436
|
+
.dv-resize-container .dv-resize-handle-top {
|
|
2437
|
+
top: -10px;
|
|
2438
|
+
}
|
|
2439
|
+
.dv-resize-container .dv-resize-handle-bottom {
|
|
2440
|
+
bottom: -10px;
|
|
2441
|
+
}
|
|
2442
|
+
.dv-resize-container .dv-resize-handle-left,
|
|
2443
|
+
.dv-resize-container .dv-resize-handle-right {
|
|
2444
|
+
width: 16px;
|
|
2445
|
+
height: calc(100% - 48px);
|
|
2446
|
+
top: 24px;
|
|
2447
|
+
}
|
|
2448
|
+
.dv-resize-container .dv-resize-handle-left {
|
|
2449
|
+
left: -10px;
|
|
2450
|
+
}
|
|
2451
|
+
.dv-resize-container .dv-resize-handle-right {
|
|
2452
|
+
right: -10px;
|
|
2453
|
+
}
|
|
2454
|
+
.dv-resize-container .dv-resize-handle-topleft,
|
|
2455
|
+
.dv-resize-container .dv-resize-handle-topright,
|
|
2456
|
+
.dv-resize-container .dv-resize-handle-bottomleft,
|
|
2457
|
+
.dv-resize-container .dv-resize-handle-bottomright {
|
|
2458
|
+
height: 24px;
|
|
2459
|
+
width: 24px;
|
|
2460
|
+
}
|
|
2461
|
+
.dv-resize-container .dv-resize-handle-topleft {
|
|
2462
|
+
top: -12px;
|
|
2463
|
+
left: -12px;
|
|
2464
|
+
}
|
|
2465
|
+
.dv-resize-container .dv-resize-handle-topright {
|
|
2466
|
+
top: -12px;
|
|
2467
|
+
right: -12px;
|
|
2468
|
+
}
|
|
2469
|
+
.dv-resize-container .dv-resize-handle-bottomleft {
|
|
2470
|
+
bottom: -12px;
|
|
2471
|
+
left: -12px;
|
|
2472
|
+
}
|
|
2473
|
+
.dv-resize-container .dv-resize-handle-bottomright {
|
|
2474
|
+
bottom: -12px;
|
|
2475
|
+
right: -12px;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2419
2478
|
.dv-render-overlay {
|
|
2420
2479
|
--dv-overlay-z-index: var(--dv-overlay-z-index, 999);
|
|
2421
2480
|
position: absolute;
|
|
@@ -2633,6 +2692,25 @@
|
|
|
2633
2692
|
transition-duration: var(--dv-active-sash-transition-duration, 0.1s);
|
|
2634
2693
|
transition-delay: var(--dv-active-sash-transition-delay, 0.5s);
|
|
2635
2694
|
}
|
|
2695
|
+
@media (pointer: coarse) {
|
|
2696
|
+
.dv-split-view-container .dv-sash-container > .dv-sash:not(.dv-disabled)::before {
|
|
2697
|
+
content: "";
|
|
2698
|
+
position: absolute;
|
|
2699
|
+
background: transparent;
|
|
2700
|
+
}
|
|
2701
|
+
.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash:not(.dv-disabled)::before {
|
|
2702
|
+
top: 0;
|
|
2703
|
+
bottom: 0;
|
|
2704
|
+
left: -10px;
|
|
2705
|
+
right: -10px;
|
|
2706
|
+
}
|
|
2707
|
+
.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash:not(.dv-disabled)::before {
|
|
2708
|
+
left: 0;
|
|
2709
|
+
right: 0;
|
|
2710
|
+
top: -10px;
|
|
2711
|
+
bottom: -10px;
|
|
2712
|
+
}
|
|
2713
|
+
}
|
|
2636
2714
|
.dv-split-view-container .dv-view-container {
|
|
2637
2715
|
position: relative;
|
|
2638
2716
|
height: 100%;
|
|
@@ -2704,6 +2782,11 @@
|
|
|
2704
2782
|
.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action {
|
|
2705
2783
|
visibility: visible;
|
|
2706
2784
|
}
|
|
2785
|
+
@media (hover: none) {
|
|
2786
|
+
.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {
|
|
2787
|
+
visibility: visible;
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2707
2790
|
.dv-tab .dv-default-tab {
|
|
2708
2791
|
position: relative;
|
|
2709
2792
|
height: 100%;
|
|
@@ -2728,6 +2811,11 @@
|
|
|
2728
2811
|
border-radius: 2px;
|
|
2729
2812
|
background-color: var(--dv-icon-hover-background-color);
|
|
2730
2813
|
}
|
|
2814
|
+
@media (pointer: coarse) {
|
|
2815
|
+
.dv-tab .dv-default-tab .dv-default-tab-action {
|
|
2816
|
+
padding: 8px;
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2731
2819
|
.dv-tabs-overflow-dropdown-default {
|
|
2732
2820
|
height: 100%;
|
|
2733
2821
|
color: var(--dv-activegroup-hiddenpanel-tab-color);
|
|
@@ -2748,6 +2836,7 @@
|
|
|
2748
2836
|
border-radius: 2px;
|
|
2749
2837
|
background-color: var(--dv-icon-hover-background-color);
|
|
2750
2838
|
}
|
|
2839
|
+
@charset "UTF-8";
|
|
2751
2840
|
.dv-tabs-container {
|
|
2752
2841
|
display: flex;
|
|
2753
2842
|
position: relative;
|
|
@@ -2757,12 +2846,29 @@
|
|
|
2757
2846
|
/* GPU optimizations for smooth scrolling */
|
|
2758
2847
|
will-change: scroll-position;
|
|
2759
2848
|
transform: translate3d(0, 0, 0);
|
|
2849
|
+
/**
|
|
2850
|
+
* Stop scroll-chaining at the tab strip so that wheel / trackpad
|
|
2851
|
+
* overscroll past the strip's edges doesn't trigger the browser's
|
|
2852
|
+
* swipe-to-go-back-or-forward gesture (and doesn't scroll the page
|
|
2853
|
+
* either). `contain` keeps the native bounce visuals; `none` would
|
|
2854
|
+
* also disable them.
|
|
2855
|
+
*/
|
|
2856
|
+
overscroll-behavior: contain;
|
|
2857
|
+
/**
|
|
2858
|
+
* Empty space between tabs (and the scrollbar lane) keeps pan-x so a
|
|
2859
|
+
* flick on those areas produces native momentum scroll. The tab and
|
|
2860
|
+
* chip elements themselves opt out (`touch-action: none`) so the
|
|
2861
|
+
* pointer drag source owns the gesture from pointerdown — a flick on
|
|
2862
|
+
* a tab or chip always becomes a drag, regardless of direction.
|
|
2863
|
+
*/
|
|
2864
|
+
touch-action: pan-x;
|
|
2760
2865
|
}
|
|
2761
2866
|
.dv-tabs-container.dv-tabs-container-vertical {
|
|
2762
2867
|
width: 100%;
|
|
2763
2868
|
height: fit-content;
|
|
2764
2869
|
max-height: 100%;
|
|
2765
2870
|
writing-mode: vertical-rl;
|
|
2871
|
+
touch-action: pan-y;
|
|
2766
2872
|
}
|
|
2767
2873
|
.dv-tabs-container.dv-horizontal .dv-tab:not(:first-child)::before, .dv-tabs-container.dv-vertical .dv-tab:not(:first-child)::before {
|
|
2768
2874
|
content: " ";
|
|
@@ -2802,7 +2908,10 @@
|
|
|
2802
2908
|
}
|
|
2803
2909
|
|
|
2804
2910
|
.dv-tab {
|
|
2805
|
-
|
|
2911
|
+
user-select: none;
|
|
2912
|
+
-webkit-user-select: none;
|
|
2913
|
+
-moz-user-select: none;
|
|
2914
|
+
-ms-user-select: none;
|
|
2806
2915
|
outline: none;
|
|
2807
2916
|
padding: 0.25rem 0.5rem;
|
|
2808
2917
|
cursor: pointer;
|
|
@@ -2810,6 +2919,7 @@
|
|
|
2810
2919
|
box-sizing: border-box;
|
|
2811
2920
|
font-size: var(--dv-tab-font-size);
|
|
2812
2921
|
margin: var(--dv-tab-margin);
|
|
2922
|
+
touch-action: none;
|
|
2813
2923
|
}
|
|
2814
2924
|
.dv-tab.dv-tab--shifting {
|
|
2815
2925
|
will-change: transform, margin-left, margin-right, margin-top, margin-bottom;
|
|
@@ -2860,6 +2970,7 @@
|
|
|
2860
2970
|
white-space: nowrap;
|
|
2861
2971
|
box-sizing: border-box;
|
|
2862
2972
|
line-height: 1;
|
|
2973
|
+
touch-action: none;
|
|
2863
2974
|
background-color: var(--dv-tab-group-color);
|
|
2864
2975
|
color: white;
|
|
2865
2976
|
}
|
|
@@ -3037,6 +3148,11 @@
|
|
|
3037
3148
|
.dv-tabs-and-actions-container .dv-void-container {
|
|
3038
3149
|
display: flex;
|
|
3039
3150
|
flex-grow: 1;
|
|
3151
|
+
user-select: none;
|
|
3152
|
+
-webkit-user-select: none;
|
|
3153
|
+
-moz-user-select: none;
|
|
3154
|
+
-ms-user-select: none;
|
|
3155
|
+
touch-action: none;
|
|
3040
3156
|
}
|
|
3041
3157
|
.dv-tabs-and-actions-container .dv-void-container.dv-draggable {
|
|
3042
3158
|
cursor: grab;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockview-core",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Zero dependency layout manager supporting tabs, groups, grids and splitviews for vanilla TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"splitview",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"drag-and-drop",
|
|
21
21
|
"drag",
|
|
22
22
|
"drop",
|
|
23
|
+
"touch",
|
|
24
|
+
"mobile",
|
|
23
25
|
"typescript",
|
|
24
26
|
"zero-dependency",
|
|
25
27
|
"ide-layout",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
|
2
|
-
export declare abstract class DragHandler extends CompositeDisposable {
|
|
3
|
-
protected readonly el: HTMLElement;
|
|
4
|
-
private disabled?;
|
|
5
|
-
private readonly dataDisposable;
|
|
6
|
-
private readonly pointerEventsDisposable;
|
|
7
|
-
private readonly _onDragStart;
|
|
8
|
-
readonly onDragStart: import("../events").Event<DragEvent>;
|
|
9
|
-
constructor(el: HTMLElement, disabled?: boolean | undefined);
|
|
10
|
-
setDisabled(disabled: boolean): void;
|
|
11
|
-
abstract getData(event: DragEvent): IDisposable;
|
|
12
|
-
protected isCancelled(_event: DragEvent): boolean;
|
|
13
|
-
private configure;
|
|
14
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.DragHandler = void 0;
|
|
19
|
-
var dom_1 = require("../dom");
|
|
20
|
-
var events_1 = require("../events");
|
|
21
|
-
var lifecycle_1 = require("../lifecycle");
|
|
22
|
-
var DragHandler = /** @class */ (function (_super) {
|
|
23
|
-
__extends(DragHandler, _super);
|
|
24
|
-
function DragHandler(el, disabled) {
|
|
25
|
-
var _this = _super.call(this) || this;
|
|
26
|
-
_this.el = el;
|
|
27
|
-
_this.disabled = disabled;
|
|
28
|
-
_this.dataDisposable = new lifecycle_1.MutableDisposable();
|
|
29
|
-
_this.pointerEventsDisposable = new lifecycle_1.MutableDisposable();
|
|
30
|
-
_this._onDragStart = new events_1.Emitter();
|
|
31
|
-
_this.onDragStart = _this._onDragStart.event;
|
|
32
|
-
_this.addDisposables(_this._onDragStart, _this.dataDisposable, _this.pointerEventsDisposable);
|
|
33
|
-
_this.configure();
|
|
34
|
-
return _this;
|
|
35
|
-
}
|
|
36
|
-
DragHandler.prototype.setDisabled = function (disabled) {
|
|
37
|
-
this.disabled = disabled;
|
|
38
|
-
};
|
|
39
|
-
DragHandler.prototype.isCancelled = function (_event) {
|
|
40
|
-
return false;
|
|
41
|
-
};
|
|
42
|
-
DragHandler.prototype.configure = function () {
|
|
43
|
-
var _this = this;
|
|
44
|
-
this.addDisposables(this._onDragStart, (0, events_1.addDisposableListener)(this.el, 'dragstart', function (event) {
|
|
45
|
-
if (event.defaultPrevented ||
|
|
46
|
-
_this.isCancelled(event) ||
|
|
47
|
-
_this.disabled) {
|
|
48
|
-
event.preventDefault();
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
var iframes = (0, dom_1.disableIframePointEvents)();
|
|
52
|
-
_this.pointerEventsDisposable.value = {
|
|
53
|
-
dispose: function () {
|
|
54
|
-
iframes.release();
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
_this.el.classList.add('dv-dragged');
|
|
58
|
-
setTimeout(function () { return _this.el.classList.remove('dv-dragged'); }, 0);
|
|
59
|
-
_this.dataDisposable.value = _this.getData(event);
|
|
60
|
-
_this._onDragStart.fire(event);
|
|
61
|
-
if (event.dataTransfer) {
|
|
62
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
63
|
-
var hasData = event.dataTransfer.items.length > 0;
|
|
64
|
-
if (!hasData) {
|
|
65
|
-
/**
|
|
66
|
-
* Although this is not used by dockview many third party dnd libraries will check
|
|
67
|
-
* dataTransfer.types to determine valid drag events.
|
|
68
|
-
*
|
|
69
|
-
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
70
|
-
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
71
|
-
* dnd logic. You can see the code at
|
|
72
|
-
P * https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
73
|
-
*/
|
|
74
|
-
event.dataTransfer.setData('text/plain', '');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}), (0, events_1.addDisposableListener)(this.el, 'dragend', function () {
|
|
78
|
-
_this.pointerEventsDisposable.dispose();
|
|
79
|
-
setTimeout(function () {
|
|
80
|
-
_this.dataDisposable.dispose(); // allow the data to be read by other handlers before disposing
|
|
81
|
-
}, 0);
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
84
|
-
return DragHandler;
|
|
85
|
-
}(lifecycle_1.CompositeDisposable));
|
|
86
|
-
exports.DragHandler = DragHandler;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DockviewComponent } from '../dockview/dockviewComponent';
|
|
2
|
-
import { DockviewGroupPanel } from '../dockview/dockviewGroupPanel';
|
|
3
|
-
import { IDisposable } from '../lifecycle';
|
|
4
|
-
import { DragHandler } from './abstractDragHandler';
|
|
5
|
-
export declare class GroupDragHandler extends DragHandler {
|
|
6
|
-
private readonly accessor;
|
|
7
|
-
private readonly group;
|
|
8
|
-
private readonly panelTransfer;
|
|
9
|
-
constructor(element: HTMLElement, accessor: DockviewComponent, group: DockviewGroupPanel, disabled?: boolean);
|
|
10
|
-
isCancelled(_event: DragEvent): boolean;
|
|
11
|
-
getData(dragEvent: DragEvent): IDisposable;
|
|
12
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.GroupDragHandler = void 0;
|
|
19
|
-
var dom_1 = require("../dom");
|
|
20
|
-
var events_1 = require("../events");
|
|
21
|
-
var abstractDragHandler_1 = require("./abstractDragHandler");
|
|
22
|
-
var dataTransfer_1 = require("./dataTransfer");
|
|
23
|
-
var ghost_1 = require("./ghost");
|
|
24
|
-
var GroupDragHandler = /** @class */ (function (_super) {
|
|
25
|
-
__extends(GroupDragHandler, _super);
|
|
26
|
-
function GroupDragHandler(element, accessor, group, disabled) {
|
|
27
|
-
var _this = _super.call(this, element, disabled) || this;
|
|
28
|
-
_this.accessor = accessor;
|
|
29
|
-
_this.group = group;
|
|
30
|
-
_this.panelTransfer = dataTransfer_1.LocalSelectionTransfer.getInstance();
|
|
31
|
-
_this.addDisposables((0, events_1.addDisposableListener)(element, 'pointerdown', function (e) {
|
|
32
|
-
if (e.shiftKey) {
|
|
33
|
-
/**
|
|
34
|
-
* You cannot call e.preventDefault() because that will prevent drag events from firing
|
|
35
|
-
* but we also need to stop any group overlay drag events from occuring
|
|
36
|
-
* Use a custom event marker that can be checked by the overlay drag events
|
|
37
|
-
*/
|
|
38
|
-
(0, dom_1.quasiPreventDefault)(e);
|
|
39
|
-
}
|
|
40
|
-
}, true));
|
|
41
|
-
return _this;
|
|
42
|
-
}
|
|
43
|
-
GroupDragHandler.prototype.isCancelled = function (_event) {
|
|
44
|
-
if (this.group.api.location.type === 'floating' && !_event.shiftKey) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (this.group.api.location.type === 'edge' && this.group.size === 0) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
return false;
|
|
51
|
-
};
|
|
52
|
-
GroupDragHandler.prototype.getData = function (dragEvent) {
|
|
53
|
-
var _this = this;
|
|
54
|
-
var dataTransfer = dragEvent.dataTransfer;
|
|
55
|
-
this.panelTransfer.setData([new dataTransfer_1.PanelTransfer(this.accessor.id, this.group.id, null)], dataTransfer_1.PanelTransfer.prototype);
|
|
56
|
-
var style = window.getComputedStyle(this.el);
|
|
57
|
-
var bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
|
|
58
|
-
var color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
|
|
59
|
-
if (dataTransfer) {
|
|
60
|
-
var createGhost = this.accessor.options.createGroupDragGhostComponent;
|
|
61
|
-
var ghostElement = void 0;
|
|
62
|
-
var customRenderer = void 0;
|
|
63
|
-
if (createGhost) {
|
|
64
|
-
customRenderer = createGhost(this.group);
|
|
65
|
-
customRenderer.init({
|
|
66
|
-
group: this.group,
|
|
67
|
-
api: this.accessor.api,
|
|
68
|
-
});
|
|
69
|
-
ghostElement = customRenderer.element;
|
|
70
|
-
ghostElement.style.position = 'absolute';
|
|
71
|
-
ghostElement.style.pointerEvents = 'none';
|
|
72
|
-
ghostElement.style.top = '-9999px';
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
ghostElement = document.createElement('div');
|
|
76
|
-
ghostElement.style.backgroundColor = bgColor;
|
|
77
|
-
ghostElement.style.color = color;
|
|
78
|
-
ghostElement.style.padding = '2px 8px';
|
|
79
|
-
ghostElement.style.height = '24px';
|
|
80
|
-
ghostElement.style.fontSize = '11px';
|
|
81
|
-
ghostElement.style.lineHeight = '20px';
|
|
82
|
-
ghostElement.style.borderRadius = '12px';
|
|
83
|
-
ghostElement.style.position = 'absolute';
|
|
84
|
-
ghostElement.style.pointerEvents = 'none';
|
|
85
|
-
ghostElement.style.top = '-9999px';
|
|
86
|
-
ghostElement.textContent = "Multiple Panels (".concat(this.group.size, ")");
|
|
87
|
-
}
|
|
88
|
-
(0, ghost_1.addGhostImage)(dataTransfer, ghostElement, { y: -10, x: 30 });
|
|
89
|
-
if (customRenderer === null || customRenderer === void 0 ? void 0 : customRenderer.dispose) {
|
|
90
|
-
// addGhostImage removes the element from the DOM on the next
|
|
91
|
-
// tick; dispose the framework renderer on the same schedule.
|
|
92
|
-
var renderer_1 = customRenderer;
|
|
93
|
-
setTimeout(function () { var _a; return (_a = renderer_1.dispose) === null || _a === void 0 ? void 0 : _a.call(renderer_1); }, 0);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
dispose: function () {
|
|
98
|
-
_this.panelTransfer.clearData(dataTransfer_1.PanelTransfer.prototype);
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
return GroupDragHandler;
|
|
103
|
-
}(abstractDragHandler_1.DragHandler));
|
|
104
|
-
exports.GroupDragHandler = GroupDragHandler;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
|
2
|
-
export declare abstract class DragHandler extends CompositeDisposable {
|
|
3
|
-
protected readonly el: HTMLElement;
|
|
4
|
-
private disabled?;
|
|
5
|
-
private readonly dataDisposable;
|
|
6
|
-
private readonly pointerEventsDisposable;
|
|
7
|
-
private readonly _onDragStart;
|
|
8
|
-
readonly onDragStart: import("../events").Event<DragEvent>;
|
|
9
|
-
constructor(el: HTMLElement, disabled?: boolean | undefined);
|
|
10
|
-
setDisabled(disabled: boolean): void;
|
|
11
|
-
abstract getData(event: DragEvent): IDisposable;
|
|
12
|
-
protected isCancelled(_event: DragEvent): boolean;
|
|
13
|
-
private configure;
|
|
14
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { disableIframePointEvents } from '../dom';
|
|
2
|
-
import { addDisposableListener, Emitter } from '../events';
|
|
3
|
-
import { CompositeDisposable, MutableDisposable, } from '../lifecycle';
|
|
4
|
-
export class DragHandler extends CompositeDisposable {
|
|
5
|
-
constructor(el, disabled) {
|
|
6
|
-
super();
|
|
7
|
-
this.el = el;
|
|
8
|
-
this.disabled = disabled;
|
|
9
|
-
this.dataDisposable = new MutableDisposable();
|
|
10
|
-
this.pointerEventsDisposable = new MutableDisposable();
|
|
11
|
-
this._onDragStart = new Emitter();
|
|
12
|
-
this.onDragStart = this._onDragStart.event;
|
|
13
|
-
this.addDisposables(this._onDragStart, this.dataDisposable, this.pointerEventsDisposable);
|
|
14
|
-
this.configure();
|
|
15
|
-
}
|
|
16
|
-
setDisabled(disabled) {
|
|
17
|
-
this.disabled = disabled;
|
|
18
|
-
}
|
|
19
|
-
isCancelled(_event) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
configure() {
|
|
23
|
-
this.addDisposables(this._onDragStart, addDisposableListener(this.el, 'dragstart', (event) => {
|
|
24
|
-
if (event.defaultPrevented ||
|
|
25
|
-
this.isCancelled(event) ||
|
|
26
|
-
this.disabled) {
|
|
27
|
-
event.preventDefault();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const iframes = disableIframePointEvents();
|
|
31
|
-
this.pointerEventsDisposable.value = {
|
|
32
|
-
dispose: () => {
|
|
33
|
-
iframes.release();
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
this.el.classList.add('dv-dragged');
|
|
37
|
-
setTimeout(() => this.el.classList.remove('dv-dragged'), 0);
|
|
38
|
-
this.dataDisposable.value = this.getData(event);
|
|
39
|
-
this._onDragStart.fire(event);
|
|
40
|
-
if (event.dataTransfer) {
|
|
41
|
-
event.dataTransfer.effectAllowed = 'move';
|
|
42
|
-
const hasData = event.dataTransfer.items.length > 0;
|
|
43
|
-
if (!hasData) {
|
|
44
|
-
/**
|
|
45
|
-
* Although this is not used by dockview many third party dnd libraries will check
|
|
46
|
-
* dataTransfer.types to determine valid drag events.
|
|
47
|
-
*
|
|
48
|
-
* For example: in react-dnd if dataTransfer.types is not set then the dragStart event will be cancelled
|
|
49
|
-
* through .preventDefault(). Since this is applied globally to all drag events this would break dockviews
|
|
50
|
-
* dnd logic. You can see the code at
|
|
51
|
-
P * https://github.com/react-dnd/react-dnd/blob/main/packages/backend-html5/src/HTML5BackendImpl.ts#L542
|
|
52
|
-
*/
|
|
53
|
-
event.dataTransfer.setData('text/plain', '');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}), addDisposableListener(this.el, 'dragend', () => {
|
|
57
|
-
this.pointerEventsDisposable.dispose();
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
this.dataDisposable.dispose(); // allow the data to be read by other handlers before disposing
|
|
60
|
-
}, 0);
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DockviewComponent } from '../dockview/dockviewComponent';
|
|
2
|
-
import { DockviewGroupPanel } from '../dockview/dockviewGroupPanel';
|
|
3
|
-
import { IDisposable } from '../lifecycle';
|
|
4
|
-
import { DragHandler } from './abstractDragHandler';
|
|
5
|
-
export declare class GroupDragHandler extends DragHandler {
|
|
6
|
-
private readonly accessor;
|
|
7
|
-
private readonly group;
|
|
8
|
-
private readonly panelTransfer;
|
|
9
|
-
constructor(element: HTMLElement, accessor: DockviewComponent, group: DockviewGroupPanel, disabled?: boolean);
|
|
10
|
-
isCancelled(_event: DragEvent): boolean;
|
|
11
|
-
getData(dragEvent: DragEvent): IDisposable;
|
|
12
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { quasiPreventDefault } from '../dom';
|
|
2
|
-
import { addDisposableListener } from '../events';
|
|
3
|
-
import { DragHandler } from './abstractDragHandler';
|
|
4
|
-
import { LocalSelectionTransfer, PanelTransfer } from './dataTransfer';
|
|
5
|
-
import { addGhostImage } from './ghost';
|
|
6
|
-
export class GroupDragHandler extends DragHandler {
|
|
7
|
-
constructor(element, accessor, group, disabled) {
|
|
8
|
-
super(element, disabled);
|
|
9
|
-
this.accessor = accessor;
|
|
10
|
-
this.group = group;
|
|
11
|
-
this.panelTransfer = LocalSelectionTransfer.getInstance();
|
|
12
|
-
this.addDisposables(addDisposableListener(element, 'pointerdown', (e) => {
|
|
13
|
-
if (e.shiftKey) {
|
|
14
|
-
/**
|
|
15
|
-
* You cannot call e.preventDefault() because that will prevent drag events from firing
|
|
16
|
-
* but we also need to stop any group overlay drag events from occuring
|
|
17
|
-
* Use a custom event marker that can be checked by the overlay drag events
|
|
18
|
-
*/
|
|
19
|
-
quasiPreventDefault(e);
|
|
20
|
-
}
|
|
21
|
-
}, true));
|
|
22
|
-
}
|
|
23
|
-
isCancelled(_event) {
|
|
24
|
-
if (this.group.api.location.type === 'floating' && !_event.shiftKey) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (this.group.api.location.type === 'edge' && this.group.size === 0) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
getData(dragEvent) {
|
|
33
|
-
const dataTransfer = dragEvent.dataTransfer;
|
|
34
|
-
this.panelTransfer.setData([new PanelTransfer(this.accessor.id, this.group.id, null)], PanelTransfer.prototype);
|
|
35
|
-
const style = window.getComputedStyle(this.el);
|
|
36
|
-
const bgColor = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-background-color');
|
|
37
|
-
const color = style.getPropertyValue('--dv-activegroup-visiblepanel-tab-color');
|
|
38
|
-
if (dataTransfer) {
|
|
39
|
-
const createGhost = this.accessor.options.createGroupDragGhostComponent;
|
|
40
|
-
let ghostElement;
|
|
41
|
-
let customRenderer;
|
|
42
|
-
if (createGhost) {
|
|
43
|
-
customRenderer = createGhost(this.group);
|
|
44
|
-
customRenderer.init({
|
|
45
|
-
group: this.group,
|
|
46
|
-
api: this.accessor.api,
|
|
47
|
-
});
|
|
48
|
-
ghostElement = customRenderer.element;
|
|
49
|
-
ghostElement.style.position = 'absolute';
|
|
50
|
-
ghostElement.style.pointerEvents = 'none';
|
|
51
|
-
ghostElement.style.top = '-9999px';
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
ghostElement = document.createElement('div');
|
|
55
|
-
ghostElement.style.backgroundColor = bgColor;
|
|
56
|
-
ghostElement.style.color = color;
|
|
57
|
-
ghostElement.style.padding = '2px 8px';
|
|
58
|
-
ghostElement.style.height = '24px';
|
|
59
|
-
ghostElement.style.fontSize = '11px';
|
|
60
|
-
ghostElement.style.lineHeight = '20px';
|
|
61
|
-
ghostElement.style.borderRadius = '12px';
|
|
62
|
-
ghostElement.style.position = 'absolute';
|
|
63
|
-
ghostElement.style.pointerEvents = 'none';
|
|
64
|
-
ghostElement.style.top = '-9999px';
|
|
65
|
-
ghostElement.textContent = `Multiple Panels (${this.group.size})`;
|
|
66
|
-
}
|
|
67
|
-
addGhostImage(dataTransfer, ghostElement, { y: -10, x: 30 });
|
|
68
|
-
if (customRenderer === null || customRenderer === void 0 ? void 0 : customRenderer.dispose) {
|
|
69
|
-
// addGhostImage removes the element from the DOM on the next
|
|
70
|
-
// tick; dispose the framework renderer on the same schedule.
|
|
71
|
-
const renderer = customRenderer;
|
|
72
|
-
setTimeout(() => { var _a; return (_a = renderer.dispose) === null || _a === void 0 ? void 0 : _a.call(renderer); }, 0);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
dispose: () => {
|
|
77
|
-
this.panelTransfer.clearData(PanelTransfer.prototype);
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|