dockview-core 1.14.0 → 1.14.1
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 -21
- package/dist/cjs/dockview/dockviewComponent.js +0 -60
- package/dist/cjs/dockview/options.d.ts +1 -1
- package/dist/cjs/dockview/types.d.ts +5 -10
- package/dist/cjs/dockview/validate.d.ts +0 -0
- package/dist/cjs/dockview/validate.js +76 -0
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +5 -3
- package/dist/dockview-core.amd.js +15 -15
- 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 +14 -14
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +15 -15
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +3 -3
- 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 +15 -15
- 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 +14 -14
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/dockview/dockviewComponent.js +0 -60
- package/dist/esm/dockview/options.d.ts +1 -1
- package/dist/esm/dockview/types.d.ts +5 -10
- package/dist/esm/dockview/validate.d.ts +0 -0
- package/dist/esm/dockview/validate.js +76 -0
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +4 -3
- package/dist/styles/dockview.css +4 -4
- package/package.json +1 -1
|
@@ -58,66 +58,6 @@ function getDockviewTheme(element) {
|
|
|
58
58
|
}
|
|
59
59
|
return theme;
|
|
60
60
|
}
|
|
61
|
-
function typeValidate3(data, path) {
|
|
62
|
-
if (typeof data.id !== 'string') {
|
|
63
|
-
throw new Error(`${path}.id must be a string`);
|
|
64
|
-
}
|
|
65
|
-
if (typeof data.activeView !== 'string' ||
|
|
66
|
-
typeof data.activeView !== 'undefined') {
|
|
67
|
-
throw new Error(`${path}.activeView must be a string of undefined`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function typeValidate2(data, path) {
|
|
71
|
-
if (typeof data.size !== 'number' && typeof data.size !== 'undefined') {
|
|
72
|
-
throw new Error(`${path}.size must be a number or undefined`);
|
|
73
|
-
}
|
|
74
|
-
if (typeof data.visible !== 'boolean' &&
|
|
75
|
-
typeof data.visible !== 'undefined') {
|
|
76
|
-
throw new Error(`${path}.visible must be a boolean or undefined`);
|
|
77
|
-
}
|
|
78
|
-
if (data.type === 'leaf') {
|
|
79
|
-
if (typeof data.data !== 'object' ||
|
|
80
|
-
data.data === null ||
|
|
81
|
-
Array.isArray(data.data)) {
|
|
82
|
-
throw new Error('object must be a non-null object');
|
|
83
|
-
}
|
|
84
|
-
typeValidate3(data.data, `${path}.data`);
|
|
85
|
-
}
|
|
86
|
-
else if (data.type === 'branch') {
|
|
87
|
-
if (!Array.isArray(data.data)) {
|
|
88
|
-
throw new Error(`${path}.data must be an array`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
throw new Error(`${path}.type must be onew of {'branch', 'leaf'}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function typeValidate(data) {
|
|
96
|
-
if (typeof data !== 'object' || data === null) {
|
|
97
|
-
throw new Error('object must be a non-null object');
|
|
98
|
-
}
|
|
99
|
-
const { grid, panels, activeGroup, floatingGroups } = data;
|
|
100
|
-
if (typeof grid !== 'object' || grid === null) {
|
|
101
|
-
throw new Error("'.grid' must be a non-null object");
|
|
102
|
-
}
|
|
103
|
-
if (typeof grid.height !== 'number') {
|
|
104
|
-
throw new Error("'.grid.height' must be a number");
|
|
105
|
-
}
|
|
106
|
-
if (typeof grid.width !== 'number') {
|
|
107
|
-
throw new Error("'.grid.width' must be a number");
|
|
108
|
-
}
|
|
109
|
-
if (typeof grid.root !== 'object' || grid.root === null) {
|
|
110
|
-
throw new Error("'.grid.root' must be a non-null object");
|
|
111
|
-
}
|
|
112
|
-
if (grid.root.type !== 'branch') {
|
|
113
|
-
throw new Error(".grid.root.type must be of type 'branch'");
|
|
114
|
-
}
|
|
115
|
-
if (grid.orientation !== Orientation.HORIZONTAL &&
|
|
116
|
-
grid.orientation !== Orientation.VERTICAL) {
|
|
117
|
-
throw new Error(`'.grid.width' must be one of {${Orientation.HORIZONTAL}, ${Orientation.VERTICAL}}`);
|
|
118
|
-
}
|
|
119
|
-
typeValidate2(grid.root, '.grid.root');
|
|
120
|
-
}
|
|
121
61
|
export class DockviewComponent extends BaseGrid {
|
|
122
62
|
get orientation() {
|
|
123
63
|
return this.gridview.orientation;
|
|
@@ -109,7 +109,7 @@ type AddPanelFloatingGroupUnion = {
|
|
|
109
109
|
position: never;
|
|
110
110
|
};
|
|
111
111
|
type AddPanelPositionUnion = {
|
|
112
|
-
floating: false
|
|
112
|
+
floating: false;
|
|
113
113
|
position: AddPanelPositionOptions;
|
|
114
114
|
};
|
|
115
115
|
type AddPanelOptionsUnion = AddPanelFloatingGroupUnion | AddPanelPositionUnion;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IDockviewComponent } from './dockviewComponent';
|
|
2
1
|
import { DockviewPanelApi } from '../api/dockviewPanelApi';
|
|
3
2
|
import { PanelInitParameters, IPanel } from '../panel/types';
|
|
4
3
|
import { DockviewApi } from '../api/component.api';
|
|
@@ -16,25 +15,20 @@ export interface WatermarkRendererInitParameters {
|
|
|
16
15
|
containerApi: DockviewApi;
|
|
17
16
|
group?: IDockviewGroupPanel;
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
type RendererMethodOptionalList = 'dispose' | 'update' | 'layout' | 'toJSON' | 'focus';
|
|
19
|
+
export interface IWatermarkRenderer extends Optional<Omit<IPanel, 'id' | 'init'>, RendererMethodOptionalList> {
|
|
20
20
|
readonly element: HTMLElement;
|
|
21
21
|
init: (params: WatermarkRendererInitParameters) => void;
|
|
22
22
|
updateParentGroup(group: DockviewGroupPanel, visible: boolean): void;
|
|
23
23
|
}
|
|
24
|
-
export interface ITabRenderer extends Optional<Omit<IPanel, 'id'>,
|
|
24
|
+
export interface ITabRenderer extends Optional<Omit<IPanel, 'id'>, RendererMethodOptionalList> {
|
|
25
25
|
readonly element: HTMLElement;
|
|
26
26
|
init(parameters: GroupPanelPartInitParameters): void;
|
|
27
27
|
}
|
|
28
|
-
export interface IContentRenderer extends Optional<Omit<IPanel, 'id'>,
|
|
28
|
+
export interface IContentRenderer extends Optional<Omit<IPanel, 'id'>, RendererMethodOptionalList> {
|
|
29
29
|
readonly element: HTMLElement;
|
|
30
30
|
init(parameters: GroupPanelPartInitParameters): void;
|
|
31
31
|
}
|
|
32
|
-
export interface WatermarkPartInitParameters {
|
|
33
|
-
accessor: IDockviewComponent;
|
|
34
|
-
}
|
|
35
|
-
export interface WatermarkConstructor {
|
|
36
|
-
new (): IWatermarkRenderer;
|
|
37
|
-
}
|
|
38
32
|
export interface IGroupPanelInitParameters extends PanelInitParameters, HeaderPartInitParameters {
|
|
39
33
|
}
|
|
40
34
|
export interface GroupviewPanelState {
|
|
@@ -47,3 +41,4 @@ export interface GroupviewPanelState {
|
|
|
47
41
|
[key: string]: any;
|
|
48
42
|
};
|
|
49
43
|
}
|
|
44
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { SerializedGridObject } from '../gridview/gridview';
|
|
3
|
+
// import { Orientation } from '../splitview/splitview';
|
|
4
|
+
// import { SerializedDockview } from './dockviewComponent';
|
|
5
|
+
// import { GroupPanelViewState } from './dockviewGroupPanelModel';
|
|
6
|
+
// function typeValidate3(data: GroupPanelViewState, path: string): void {
|
|
7
|
+
// if (typeof data.id !== 'string') {
|
|
8
|
+
// throw new Error(`${path}.id must be a string`);
|
|
9
|
+
// }
|
|
10
|
+
// if (
|
|
11
|
+
// typeof data.activeView !== 'string' ||
|
|
12
|
+
// typeof data.activeView !== 'undefined'
|
|
13
|
+
// ) {
|
|
14
|
+
// throw new Error(`${path}.activeView must be a string of undefined`);
|
|
15
|
+
// }
|
|
16
|
+
// }
|
|
17
|
+
// function typeValidate2(
|
|
18
|
+
// data: SerializedGridObject<GroupPanelViewState>,
|
|
19
|
+
// path: string
|
|
20
|
+
// ): void {
|
|
21
|
+
// if (typeof data.size !== 'number' && typeof data.size !== 'undefined') {
|
|
22
|
+
// throw new Error(`${path}.size must be a number or undefined`);
|
|
23
|
+
// }
|
|
24
|
+
// if (
|
|
25
|
+
// typeof data.visible !== 'boolean' &&
|
|
26
|
+
// typeof data.visible !== 'undefined'
|
|
27
|
+
// ) {
|
|
28
|
+
// throw new Error(`${path}.visible must be a boolean or undefined`);
|
|
29
|
+
// }
|
|
30
|
+
// if (data.type === 'leaf') {
|
|
31
|
+
// if (
|
|
32
|
+
// typeof data.data !== 'object' ||
|
|
33
|
+
// data.data === null ||
|
|
34
|
+
// Array.isArray(data.data)
|
|
35
|
+
// ) {
|
|
36
|
+
// throw new Error('object must be a non-null object');
|
|
37
|
+
// }
|
|
38
|
+
// typeValidate3(data.data, `${path}.data`);
|
|
39
|
+
// } else if (data.type === 'branch') {
|
|
40
|
+
// if (!Array.isArray(data.data)) {
|
|
41
|
+
// throw new Error(`${path}.data must be an array`);
|
|
42
|
+
// }
|
|
43
|
+
// } else {
|
|
44
|
+
// throw new Error(`${path}.type must be onew of {'branch', 'leaf'}`);
|
|
45
|
+
// }
|
|
46
|
+
// }
|
|
47
|
+
// function typeValidate(data: SerializedDockview): void {
|
|
48
|
+
// if (typeof data !== 'object' || data === null) {
|
|
49
|
+
// throw new Error('object must be a non-null object');
|
|
50
|
+
// }
|
|
51
|
+
// const { grid, panels, activeGroup, floatingGroups } = data;
|
|
52
|
+
// if (typeof grid !== 'object' || grid === null) {
|
|
53
|
+
// throw new Error("'.grid' must be a non-null object");
|
|
54
|
+
// }
|
|
55
|
+
// if (typeof grid.height !== 'number') {
|
|
56
|
+
// throw new Error("'.grid.height' must be a number");
|
|
57
|
+
// }
|
|
58
|
+
// if (typeof grid.width !== 'number') {
|
|
59
|
+
// throw new Error("'.grid.width' must be a number");
|
|
60
|
+
// }
|
|
61
|
+
// if (typeof grid.root !== 'object' || grid.root === null) {
|
|
62
|
+
// throw new Error("'.grid.root' must be a non-null object");
|
|
63
|
+
// }
|
|
64
|
+
// if (grid.root.type !== 'branch') {
|
|
65
|
+
// throw new Error(".grid.root.type must be of type 'branch'");
|
|
66
|
+
// }
|
|
67
|
+
// if (
|
|
68
|
+
// grid.orientation !== Orientation.HORIZONTAL &&
|
|
69
|
+
// grid.orientation !== Orientation.VERTICAL
|
|
70
|
+
// ) {
|
|
71
|
+
// throw new Error(
|
|
72
|
+
// `'.grid.width' must be one of {${Orientation.HORIZONTAL}, ${Orientation.VERTICAL}}`
|
|
73
|
+
// );
|
|
74
|
+
// }
|
|
75
|
+
// typeValidate2(grid.root, '.grid.root');
|
|
76
|
+
// }
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from './dnd/dataTransfer';
|
|
2
2
|
/**
|
|
3
|
-
* Events, Emitters and Disposables are very common concepts that
|
|
4
|
-
*
|
|
3
|
+
* Events, Emitters and Disposables are very common concepts that many codebases will contain, however we need
|
|
4
|
+
* to export them for dockview framework packages to use.
|
|
5
|
+
* To be a good citizen these are exported with a `Dockview` prefix to prevent accidental use by others.
|
|
5
6
|
*/
|
|
6
7
|
export { Emitter as DockviewEmitter, Event as DockviewEvent } from './events';
|
|
7
|
-
export { IDisposable as IDockviewDisposable, MutableDisposable as DockviewMutableDisposable, CompositeDisposable as DockviewCompositeDisposable, } from './lifecycle';
|
|
8
|
+
export { IDisposable as IDockviewDisposable, MutableDisposable as DockviewMutableDisposable, CompositeDisposable as DockviewCompositeDisposable, Disposable as DockviewDisposable, } from './lifecycle';
|
|
8
9
|
export * from './panel/types';
|
|
9
10
|
export * from './panel/componentFactory';
|
|
10
11
|
export * from './splitview/splitview';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export * from './dnd/dataTransfer';
|
|
2
2
|
/**
|
|
3
|
-
* Events, Emitters and Disposables are very common concepts that
|
|
4
|
-
*
|
|
3
|
+
* Events, Emitters and Disposables are very common concepts that many codebases will contain, however we need
|
|
4
|
+
* to export them for dockview framework packages to use.
|
|
5
|
+
* To be a good citizen these are exported with a `Dockview` prefix to prevent accidental use by others.
|
|
5
6
|
*/
|
|
6
7
|
export { Emitter as DockviewEmitter, Event as DockviewEvent } from './events';
|
|
7
|
-
export { MutableDisposable as DockviewMutableDisposable, CompositeDisposable as DockviewCompositeDisposable, } from './lifecycle';
|
|
8
|
+
export { MutableDisposable as DockviewMutableDisposable, CompositeDisposable as DockviewCompositeDisposable, Disposable as DockviewDisposable, } from './lifecycle';
|
|
8
9
|
export * from './panel/types';
|
|
9
10
|
export * from './panel/componentFactory';
|
|
10
11
|
export * from './splitview/splitview';
|
package/dist/styles/dockview.css
CHANGED
|
@@ -438,16 +438,16 @@
|
|
|
438
438
|
.dv-dockview .dv-overlay-render-container {
|
|
439
439
|
position: relative;
|
|
440
440
|
}
|
|
441
|
-
.dv-dockview .split-view-container.horizontal > .view-container > .view:not(:last-child) {
|
|
441
|
+
.dv-dockview .split-view-container.horizontal > .view-container > .view:not(:last-child) .groupview {
|
|
442
442
|
border-right: var(--dv-group-gap-size) solid transparent;
|
|
443
443
|
}
|
|
444
|
-
.dv-dockview .split-view-container.horizontal > .view-container > .view:not(:first-child) {
|
|
444
|
+
.dv-dockview .split-view-container.horizontal > .view-container > .view:not(:first-child) .groupview {
|
|
445
445
|
border-left: var(--dv-group-gap-size) solid transparent;
|
|
446
446
|
}
|
|
447
|
-
.dv-dockview .split-view-container.vertical > .view-container > .view:not(:last-child) {
|
|
447
|
+
.dv-dockview .split-view-container.vertical > .view-container > .view:not(:last-child) .groupview {
|
|
448
448
|
border-bottom: var(--dv-group-gap-size) solid transparent;
|
|
449
449
|
}
|
|
450
|
-
.dv-dockview .split-view-container.vertical > .view-container > .view:not(:first-child) {
|
|
450
|
+
.dv-dockview .split-view-container.vertical > .view-container > .view:not(:first-child) .groupview {
|
|
451
451
|
border-top: var(--dv-group-gap-size) solid transparent;
|
|
452
452
|
}
|
|
453
453
|
|