dockview-core 1.17.2 → 2.1.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/dist/cjs/api/component.api.d.ts +3 -3
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +10 -8
- package/dist/cjs/api/dockviewGroupPanelApi.js +1 -0
- package/dist/cjs/api/dockviewPanelApi.d.ts +6 -14
- package/dist/cjs/api/dockviewPanelApi.js +5 -3
- package/dist/cjs/dnd/abstractDragHandler.js +1 -1
- package/dist/cjs/dnd/dnd.d.ts +2 -2
- package/dist/cjs/dnd/droptarget.js +4 -4
- package/dist/cjs/dockview/components/panel/content.d.ts +2 -2
- package/dist/cjs/dockview/components/panel/content.js +3 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +3 -3
- package/dist/cjs/dockview/components/tab/tab.js +4 -4
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +5 -9
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +1 -2
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +1 -4
- package/dist/cjs/dockview/components/watermark/watermark.js +2 -34
- package/dist/cjs/dockview/dockviewComponent.d.ts +33 -16
- package/dist/cjs/dockview/dockviewComponent.js +103 -38
- package/dist/cjs/dockview/dockviewGroupPanel.js +16 -12
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +4 -3
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +10 -10
- package/dist/cjs/dockview/dockviewPanel.d.ts +4 -4
- package/dist/cjs/dockview/dockviewPanelModel.d.ts +1 -1
- package/dist/cjs/dockview/options.d.ts +12 -0
- package/dist/cjs/dockview/options.js +1 -0
- package/dist/cjs/dom.d.ts +11 -1
- package/dist/cjs/dom.js +19 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +8 -3
- package/dist/cjs/gridview/baseComponentGridview.js +8 -8
- package/dist/cjs/gridview/basePanelView.d.ts +1 -1
- package/dist/cjs/gridview/branchNode.d.ts +1 -1
- package/dist/cjs/gridview/branchNode.js +1 -1
- package/dist/cjs/gridview/gridview.d.ts +9 -1
- package/dist/cjs/gridview/gridview.js +51 -7
- package/dist/cjs/gridview/gridviewPanel.d.ts +4 -0
- package/dist/cjs/gridview/gridviewPanel.js +60 -32
- package/dist/cjs/gridview/leafNode.d.ts +1 -1
- package/dist/cjs/index.d.ts +8 -9
- package/dist/cjs/index.js +14 -7
- package/dist/cjs/overlay/overlay.d.ts +6 -3
- package/dist/cjs/overlay/overlay.js +15 -0
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +1 -1
- package/dist/cjs/paneview/defaultPaneviewHeader.js +5 -3
- package/dist/cjs/paneview/paneview.d.ts +3 -3
- package/dist/cjs/paneview/paneview.js +3 -3
- package/dist/cjs/paneview/paneviewComponent.d.ts +2 -2
- package/dist/cjs/paneview/paneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/paneviewPanel.js +3 -3
- package/dist/cjs/popoutWindow.js +23 -16
- package/dist/cjs/splitview/splitview.d.ts +6 -6
- package/dist/cjs/splitview/splitview.js +18 -17
- package/dist/cjs/splitview/splitviewComponent.d.ts +2 -2
- package/dist/cjs/splitview/viewItem.d.ts +1 -1
- package/dist/cjs/svg.js +1 -1
- package/dist/dockview-core.amd.js +346 -210
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +345 -209
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +346 -210
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +347 -209
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +346 -210
- package/dist/dockview-core.js.map +1 -1
- 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 +345 -209
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +3 -3
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +10 -8
- package/dist/esm/api/dockviewGroupPanelApi.js +1 -0
- package/dist/esm/api/dockviewPanelApi.d.ts +6 -14
- package/dist/esm/api/dockviewPanelApi.js +5 -3
- package/dist/esm/dnd/abstractDragHandler.js +1 -1
- package/dist/esm/dnd/dnd.d.ts +2 -2
- package/dist/esm/dnd/droptarget.js +4 -4
- package/dist/esm/dockview/components/panel/content.d.ts +2 -2
- package/dist/esm/dockview/components/panel/content.js +4 -2
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +3 -3
- package/dist/esm/dockview/components/tab/tab.js +4 -4
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +5 -9
- package/dist/esm/dockview/components/titlebar/voidContainer.js +1 -2
- package/dist/esm/dockview/components/watermark/watermark.d.ts +1 -4
- package/dist/esm/dockview/components/watermark/watermark.js +2 -34
- package/dist/esm/dockview/dockviewComponent.d.ts +33 -16
- package/dist/esm/dockview/dockviewComponent.js +102 -37
- package/dist/esm/dockview/dockviewGroupPanel.js +16 -12
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +4 -3
- package/dist/esm/dockview/dockviewGroupPanelModel.js +10 -10
- package/dist/esm/dockview/dockviewPanel.d.ts +4 -4
- package/dist/esm/dockview/dockviewPanelModel.d.ts +1 -1
- package/dist/esm/dockview/options.d.ts +12 -0
- package/dist/esm/dockview/options.js +1 -0
- package/dist/esm/dom.d.ts +11 -1
- package/dist/esm/dom.js +14 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +8 -3
- package/dist/esm/gridview/baseComponentGridview.js +8 -4
- package/dist/esm/gridview/basePanelView.d.ts +1 -1
- package/dist/esm/gridview/branchNode.d.ts +1 -1
- package/dist/esm/gridview/branchNode.js +1 -1
- package/dist/esm/gridview/gridview.d.ts +9 -1
- package/dist/esm/gridview/gridview.js +51 -7
- package/dist/esm/gridview/gridviewPanel.d.ts +4 -0
- package/dist/esm/gridview/gridviewPanel.js +40 -12
- package/dist/esm/gridview/leafNode.d.ts +1 -1
- package/dist/esm/index.d.ts +8 -9
- package/dist/esm/index.js +5 -6
- package/dist/esm/overlay/overlay.d.ts +6 -3
- package/dist/esm/overlay/overlay.js +11 -0
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.js +5 -3
- package/dist/esm/paneview/paneview.d.ts +3 -3
- package/dist/esm/paneview/paneview.js +3 -3
- package/dist/esm/paneview/paneviewComponent.d.ts +2 -2
- package/dist/esm/paneview/paneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/paneviewPanel.js +3 -3
- package/dist/esm/popoutWindow.js +24 -17
- package/dist/esm/splitview/splitview.d.ts +6 -6
- package/dist/esm/splitview/splitview.js +18 -17
- package/dist/esm/splitview/splitviewComponent.d.ts +2 -2
- package/dist/esm/splitview/viewItem.d.ts +1 -1
- package/dist/esm/svg.js +1 -1
- package/dist/styles/dockview.css +111 -151
- package/package.json +1 -1
package/dist/esm/popoutWindow.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { addStyles } from './dom';
|
|
11
11
|
import { Emitter, addDisposableWindowListener } from './events';
|
|
12
|
-
import { CompositeDisposable } from './lifecycle';
|
|
12
|
+
import { CompositeDisposable, Disposable } from './lifecycle';
|
|
13
13
|
export class PopoutWindow extends CompositeDisposable {
|
|
14
14
|
get window() {
|
|
15
15
|
var _a, _b;
|
|
@@ -50,7 +50,6 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
50
50
|
window: this._window.value,
|
|
51
51
|
});
|
|
52
52
|
this._window.disposable.dispose();
|
|
53
|
-
this._window.value.close();
|
|
54
53
|
this._window = null;
|
|
55
54
|
this._onDidClose.fire();
|
|
56
55
|
}
|
|
@@ -82,7 +81,9 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
82
81
|
}
|
|
83
82
|
const disposable = new CompositeDisposable();
|
|
84
83
|
this._window = { value: externalWindow, disposable };
|
|
85
|
-
disposable.addDisposables(
|
|
84
|
+
disposable.addDisposables(Disposable.from(() => {
|
|
85
|
+
externalWindow.close();
|
|
86
|
+
}), addDisposableWindowListener(window, 'beforeunload', () => {
|
|
86
87
|
/**
|
|
87
88
|
* before the main window closes we should close this popup too
|
|
88
89
|
* to be good citizens
|
|
@@ -99,7 +100,7 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
99
100
|
id: this.target,
|
|
100
101
|
window: externalWindow,
|
|
101
102
|
});
|
|
102
|
-
return new Promise((resolve) => {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
103
104
|
externalWindow.addEventListener('unload', (e) => {
|
|
104
105
|
// if page fails to load before unloading
|
|
105
106
|
// this.close();
|
|
@@ -108,21 +109,27 @@ export class PopoutWindow extends CompositeDisposable {
|
|
|
108
109
|
/**
|
|
109
110
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
|
|
110
111
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
* beforeunload must be registered after load for reasons I could not determine
|
|
117
|
-
* otherwise the beforeunload event will not fire when the window is closed
|
|
118
|
-
*/
|
|
119
|
-
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
112
|
+
try {
|
|
113
|
+
const externalDocument = externalWindow.document;
|
|
114
|
+
externalDocument.title = document.title;
|
|
115
|
+
externalDocument.body.appendChild(container);
|
|
116
|
+
addStyles(externalDocument, window.document.styleSheets);
|
|
120
117
|
/**
|
|
121
|
-
*
|
|
118
|
+
* beforeunload must be registered after load for reasons I could not determine
|
|
119
|
+
* otherwise the beforeunload event will not fire when the window is closed
|
|
122
120
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
addDisposableWindowListener(externalWindow, 'beforeunload', () => {
|
|
122
|
+
/**
|
|
123
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
|
|
124
|
+
*/
|
|
125
|
+
this.close();
|
|
126
|
+
});
|
|
127
|
+
resolve(container);
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
// only except this is the DOM isn't setup. e.g. in a in correctly configured test
|
|
131
|
+
reject(err);
|
|
132
|
+
}
|
|
126
133
|
});
|
|
127
134
|
});
|
|
128
135
|
});
|
|
@@ -67,17 +67,17 @@ export interface ISplitViewDescriptor {
|
|
|
67
67
|
}
|
|
68
68
|
export declare class Splitview {
|
|
69
69
|
private readonly container;
|
|
70
|
-
private element;
|
|
71
|
-
private viewContainer;
|
|
72
|
-
private sashContainer;
|
|
73
|
-
private viewItems;
|
|
74
|
-
private sashes;
|
|
70
|
+
private readonly element;
|
|
71
|
+
private readonly viewContainer;
|
|
72
|
+
private readonly sashContainer;
|
|
73
|
+
private readonly viewItems;
|
|
74
|
+
private readonly sashes;
|
|
75
75
|
private _orientation;
|
|
76
76
|
private _size;
|
|
77
77
|
private _orthogonalSize;
|
|
78
78
|
private _contentSize;
|
|
79
79
|
private _proportions;
|
|
80
|
-
private proportionalLayout;
|
|
80
|
+
private readonly proportionalLayout;
|
|
81
81
|
private _startSnappingEnabled;
|
|
82
82
|
private _endSnappingEnabled;
|
|
83
83
|
private _disabled;
|
|
@@ -67,10 +67,10 @@ export class Splitview {
|
|
|
67
67
|
const tmp = this.size;
|
|
68
68
|
this.size = this.orthogonalSize;
|
|
69
69
|
this.orthogonalSize = tmp;
|
|
70
|
-
removeClasses(this.element, 'horizontal', 'vertical');
|
|
70
|
+
removeClasses(this.element, 'dv-horizontal', 'dv-vertical');
|
|
71
71
|
this.element.classList.add(this.orientation == Orientation.HORIZONTAL
|
|
72
|
-
? 'horizontal'
|
|
73
|
-
: 'vertical');
|
|
72
|
+
? 'dv-horizontal'
|
|
73
|
+
: 'dv-vertical');
|
|
74
74
|
}
|
|
75
75
|
get minimumSize() {
|
|
76
76
|
return this.viewItems.reduce((r, item) => r + item.minimumSize, 0);
|
|
@@ -248,11 +248,11 @@ export class Splitview {
|
|
|
248
248
|
}
|
|
249
249
|
style(styles) {
|
|
250
250
|
if ((styles === null || styles === void 0 ? void 0 : styles.separatorBorder) === 'transparent') {
|
|
251
|
-
removeClasses(this.element, 'separator-border');
|
|
251
|
+
removeClasses(this.element, 'dv-separator-border');
|
|
252
252
|
this.element.style.removeProperty('--dv-separator-border');
|
|
253
253
|
}
|
|
254
254
|
else {
|
|
255
|
-
addClasses(this.element, 'separator-border');
|
|
255
|
+
addClasses(this.element, 'dv-separator-border');
|
|
256
256
|
if (styles === null || styles === void 0 ? void 0 : styles.separatorBorder) {
|
|
257
257
|
this.element.style.setProperty('--dv-separator-border', styles.separatorBorder);
|
|
258
258
|
}
|
|
@@ -322,7 +322,7 @@ export class Splitview {
|
|
|
322
322
|
}
|
|
323
323
|
addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
|
|
324
324
|
const container = document.createElement('div');
|
|
325
|
-
container.className = 'view';
|
|
325
|
+
container.className = 'dv-view';
|
|
326
326
|
container.appendChild(view.element);
|
|
327
327
|
let viewSize;
|
|
328
328
|
if (typeof size === 'number') {
|
|
@@ -354,7 +354,7 @@ export class Splitview {
|
|
|
354
354
|
if (this.viewItems.length > 1) {
|
|
355
355
|
//add sash
|
|
356
356
|
const sash = document.createElement('div');
|
|
357
|
-
sash.className = 'sash';
|
|
357
|
+
sash.className = 'dv-sash';
|
|
358
358
|
const onPointerStart = (event) => {
|
|
359
359
|
for (const item of this.viewItems) {
|
|
360
360
|
item.enabled = false;
|
|
@@ -613,7 +613,8 @@ export class Splitview {
|
|
|
613
613
|
const offset = i === 0 || visiblePanelsBeforeThisView === 0
|
|
614
614
|
? 0
|
|
615
615
|
: viewLeftOffsets[i - 1] +
|
|
616
|
-
(visiblePanelsBeforeThisView / sashCount) *
|
|
616
|
+
(visiblePanelsBeforeThisView / sashCount) *
|
|
617
|
+
marginReducedSize;
|
|
617
618
|
if (i < this.viewItems.length - 1) {
|
|
618
619
|
// calculate sash position
|
|
619
620
|
const newSize = view.visible
|
|
@@ -724,27 +725,27 @@ export class Splitview {
|
|
|
724
725
|
}
|
|
725
726
|
}
|
|
726
727
|
updateSash(sash, state) {
|
|
727
|
-
toggleClass(sash.container, 'disabled', state === SashState.DISABLED);
|
|
728
|
-
toggleClass(sash.container, 'enabled', state === SashState.ENABLED);
|
|
729
|
-
toggleClass(sash.container, 'maximum', state === SashState.MAXIMUM);
|
|
730
|
-
toggleClass(sash.container, 'minimum', state === SashState.MINIMUM);
|
|
728
|
+
toggleClass(sash.container, 'dv-disabled', state === SashState.DISABLED);
|
|
729
|
+
toggleClass(sash.container, 'dv-enabled', state === SashState.ENABLED);
|
|
730
|
+
toggleClass(sash.container, 'dv-maximum', state === SashState.MAXIMUM);
|
|
731
|
+
toggleClass(sash.container, 'dv-minimum', state === SashState.MINIMUM);
|
|
731
732
|
}
|
|
732
733
|
createViewContainer() {
|
|
733
734
|
const element = document.createElement('div');
|
|
734
|
-
element.className = 'view-container';
|
|
735
|
+
element.className = 'dv-view-container';
|
|
735
736
|
return element;
|
|
736
737
|
}
|
|
737
738
|
createSashContainer() {
|
|
738
739
|
const element = document.createElement('div');
|
|
739
|
-
element.className = 'sash-container';
|
|
740
|
+
element.className = 'dv-sash-container';
|
|
740
741
|
return element;
|
|
741
742
|
}
|
|
742
743
|
createContainer() {
|
|
743
744
|
const element = document.createElement('div');
|
|
744
745
|
const orientationClassname = this._orientation === Orientation.HORIZONTAL
|
|
745
|
-
? 'horizontal'
|
|
746
|
-
: 'vertical';
|
|
747
|
-
element.className = `split-view-container ${orientationClassname}`;
|
|
746
|
+
? 'dv-horizontal'
|
|
747
|
+
: 'dv-vertical';
|
|
748
|
+
element.className = `dv-split-view-container ${orientationClassname}`;
|
|
748
749
|
return element;
|
|
749
750
|
}
|
|
750
751
|
dispose() {
|
|
@@ -59,10 +59,10 @@ export interface ISplitviewComponent extends IDisposable {
|
|
|
59
59
|
* A high-level implementation of splitview that works using 'panels'
|
|
60
60
|
*/
|
|
61
61
|
export declare class SplitviewComponent extends Resizable implements ISplitviewComponent {
|
|
62
|
-
private _splitviewChangeDisposable;
|
|
62
|
+
private readonly _splitviewChangeDisposable;
|
|
63
63
|
private _splitview;
|
|
64
64
|
private _activePanel;
|
|
65
|
-
private _panels;
|
|
65
|
+
private readonly _panels;
|
|
66
66
|
private _options;
|
|
67
67
|
private readonly _onDidLayoutfromJSON;
|
|
68
68
|
readonly onDidLayoutFromJSON: Event<void>;
|
package/dist/esm/svg.js
CHANGED
|
@@ -5,7 +5,7 @@ const createSvgElementFromPath = (params) => {
|
|
|
5
5
|
svg.setAttributeNS(null, 'viewBox', params.viewbox);
|
|
6
6
|
svg.setAttributeNS(null, 'aria-hidden', 'false');
|
|
7
7
|
svg.setAttributeNS(null, 'focusable', 'false');
|
|
8
|
-
svg.classList.add('
|
|
8
|
+
svg.classList.add('dv-svg');
|
|
9
9
|
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
10
10
|
path.setAttributeNS(null, 'd', params.path);
|
|
11
11
|
svg.appendChild(path);
|