dockview-core 1.13.1 → 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/api/dockviewGroupPanelApi.js +4 -5
- package/dist/cjs/api/dockviewPanelApi.js +4 -6
- package/dist/cjs/dockview/dockviewComponent.js +13 -76
- package/dist/cjs/dockview/dockviewPanel.js +1 -10
- 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/events.js +3 -3
- package/dist/cjs/index.d.ts +4 -3
- package/dist/cjs/index.js +5 -3
- package/dist/dockview-core.amd.js +38 -53
- 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 +37 -52
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +38 -53
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +26 -41
- 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 +38 -53
- 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 +37 -52
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/dockviewGroupPanelApi.js +3 -4
- package/dist/esm/api/dockviewPanelApi.js +4 -6
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.js +13 -76
- package/dist/esm/dockview/dockviewPanel.js +1 -10
- 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/events.js +3 -3
- 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
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>dockview</h1>
|
|
3
3
|
|
|
4
|
-
<p>Zero dependency layout manager supporting tabs, groups, grids and splitviews
|
|
4
|
+
<p>Zero dependency layout manager supporting tabs, groups, grids and splitviews. Supports React, Vue and Vanilla TypeScript</p>
|
|
5
5
|
|
|
6
6
|
</div>
|
|
7
7
|
|
|
@@ -36,23 +36,3 @@ Please see the website: https://dockview.dev
|
|
|
36
36
|
- Security at mind - verifed publishing and builds through GitHub Actions
|
|
37
37
|
|
|
38
38
|
Want to verify our builds? Go [here](https://www.npmjs.com/package/dockview#Provenance).
|
|
39
|
-
|
|
40
|
-
## Quick start
|
|
41
|
-
|
|
42
|
-
Dockview has a peer dependency on `react >= 16.8.0` and `react-dom >= 16.8.0`. You can install dockview from [npm](https://www.npmjs.com/package/dockview-core).
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
npm install --save dockview-core
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Within your project you must import or reference the stylesheet at `dockview-core/dist/styles/dockview.css` and attach a theme.
|
|
49
|
-
|
|
50
|
-
```css
|
|
51
|
-
@import '~dockview-core/dist/styles/dockview.css';
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
You should also attach a dockview theme to an element containing your components. For example:
|
|
55
|
-
|
|
56
|
-
```html
|
|
57
|
-
<body classname="dockview-theme-dark"></body>
|
|
58
|
-
```
|
|
@@ -20,8 +20,7 @@ var droptarget_1 = require("../dnd/droptarget");
|
|
|
20
20
|
var events_1 = require("../events");
|
|
21
21
|
var lifecycle_1 = require("../lifecycle");
|
|
22
22
|
var gridviewPanelApi_1 = require("./gridviewPanelApi");
|
|
23
|
-
|
|
24
|
-
var NOT_INITIALIZED_MESSAGE = 'DockviewGroupPanelApiImpl not initialized';
|
|
23
|
+
var NOT_INITIALIZED_MESSAGE = 'dockview: DockviewGroupPanelApiImpl not initialized';
|
|
25
24
|
var DockviewGroupPanelApiImpl = /** @class */ (function (_super) {
|
|
26
25
|
__extends(DockviewGroupPanelApiImpl, _super);
|
|
27
26
|
function DockviewGroupPanelApiImpl(id, accessor) {
|
|
@@ -100,15 +99,15 @@ var DockviewGroupPanelApiImpl = /** @class */ (function (_super) {
|
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
101
|
DockviewGroupPanelApiImpl.prototype.initialize = function (group) {
|
|
103
|
-
var _this = this;
|
|
104
|
-
this._group = group;
|
|
105
102
|
/**
|
|
106
|
-
* TODO: Annoying initialization order caveat
|
|
103
|
+
* TODO: Annoying initialization order caveat, find a better way to initialize and avoid needing null checks
|
|
107
104
|
*
|
|
108
105
|
* Due to the order on initialization we know that the model isn't defined until later in the same stack-frame of setup.
|
|
109
106
|
* By queuing a microtask we can ensure the setup is completed within the same stack-frame, but after everything else has
|
|
110
107
|
* finished ensuring the `model` is defined.
|
|
111
108
|
*/
|
|
109
|
+
var _this = this;
|
|
110
|
+
this._group = group;
|
|
112
111
|
queueMicrotask(function () {
|
|
113
112
|
_this._mutableDisposable.value =
|
|
114
113
|
_this._group.model.onDidActivePanelChange(function (event) {
|
|
@@ -133,12 +133,10 @@ var DockviewPanelApiImpl = /** @class */ (function (_super) {
|
|
|
133
133
|
var _a;
|
|
134
134
|
var _trackGroupActive = (_a = previousGroup === null || previousGroup === void 0 ? void 0 : previousGroup.isActive) !== null && _a !== void 0 ? _a : false; // prevent duplicate events with same state
|
|
135
135
|
this.groupEventsDisposable.value = new lifecycle_1.CompositeDisposable(this.group.api.onDidVisibilityChange(function (event) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
!_this.isVisible &&
|
|
141
|
-
_this.group.model.isPanelActive(_this.panel)) {
|
|
136
|
+
var hasBecomeHidden = !event.isVisible && _this.isVisible;
|
|
137
|
+
var hasBecomeVisible = event.isVisible && !_this.isVisible;
|
|
138
|
+
var isActivePanel = _this.group.model.isPanelActive(_this.panel);
|
|
139
|
+
if (hasBecomeHidden || (hasBecomeVisible && isActivePanel)) {
|
|
142
140
|
_this._onDidVisibilityChange.fire(event);
|
|
143
141
|
}
|
|
144
142
|
}), this.group.api.onDidLocationChange(function (event) {
|
|
@@ -125,66 +125,6 @@ function getDockviewTheme(element) {
|
|
|
125
125
|
}
|
|
126
126
|
return theme;
|
|
127
127
|
}
|
|
128
|
-
function typeValidate3(data, path) {
|
|
129
|
-
if (typeof data.id !== 'string') {
|
|
130
|
-
throw new Error("".concat(path, ".id must be a string"));
|
|
131
|
-
}
|
|
132
|
-
if (typeof data.activeView !== 'string' ||
|
|
133
|
-
typeof data.activeView !== 'undefined') {
|
|
134
|
-
throw new Error("".concat(path, ".activeView must be a string of undefined"));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function typeValidate2(data, path) {
|
|
138
|
-
if (typeof data.size !== 'number' && typeof data.size !== 'undefined') {
|
|
139
|
-
throw new Error("".concat(path, ".size must be a number or undefined"));
|
|
140
|
-
}
|
|
141
|
-
if (typeof data.visible !== 'boolean' &&
|
|
142
|
-
typeof data.visible !== 'undefined') {
|
|
143
|
-
throw new Error("".concat(path, ".visible must be a boolean or undefined"));
|
|
144
|
-
}
|
|
145
|
-
if (data.type === 'leaf') {
|
|
146
|
-
if (typeof data.data !== 'object' ||
|
|
147
|
-
data.data === null ||
|
|
148
|
-
Array.isArray(data.data)) {
|
|
149
|
-
throw new Error('object must be a non-null object');
|
|
150
|
-
}
|
|
151
|
-
typeValidate3(data.data, "".concat(path, ".data"));
|
|
152
|
-
}
|
|
153
|
-
else if (data.type === 'branch') {
|
|
154
|
-
if (!Array.isArray(data.data)) {
|
|
155
|
-
throw new Error("".concat(path, ".data must be an array"));
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
throw new Error("".concat(path, ".type must be onew of {'branch', 'leaf'}"));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function typeValidate(data) {
|
|
163
|
-
if (typeof data !== 'object' || data === null) {
|
|
164
|
-
throw new Error('object must be a non-null object');
|
|
165
|
-
}
|
|
166
|
-
var grid = data.grid, panels = data.panels, activeGroup = data.activeGroup, floatingGroups = data.floatingGroups;
|
|
167
|
-
if (typeof grid !== 'object' || grid === null) {
|
|
168
|
-
throw new Error("'.grid' must be a non-null object");
|
|
169
|
-
}
|
|
170
|
-
if (typeof grid.height !== 'number') {
|
|
171
|
-
throw new Error("'.grid.height' must be a number");
|
|
172
|
-
}
|
|
173
|
-
if (typeof grid.width !== 'number') {
|
|
174
|
-
throw new Error("'.grid.width' must be a number");
|
|
175
|
-
}
|
|
176
|
-
if (typeof grid.root !== 'object' || grid.root === null) {
|
|
177
|
-
throw new Error("'.grid.root' must be a non-null object");
|
|
178
|
-
}
|
|
179
|
-
if (grid.root.type !== 'branch') {
|
|
180
|
-
throw new Error(".grid.root.type must be of type 'branch'");
|
|
181
|
-
}
|
|
182
|
-
if (grid.orientation !== splitview_1.Orientation.HORIZONTAL &&
|
|
183
|
-
grid.orientation !== splitview_1.Orientation.VERTICAL) {
|
|
184
|
-
throw new Error("'.grid.width' must be one of {".concat(splitview_1.Orientation.HORIZONTAL, ", ").concat(splitview_1.Orientation.VERTICAL, "}"));
|
|
185
|
-
}
|
|
186
|
-
typeValidate2(grid.root, '.grid.root');
|
|
187
|
-
}
|
|
188
128
|
var DockviewComponent = /** @class */ (function (_super) {
|
|
189
129
|
__extends(DockviewComponent, _super);
|
|
190
130
|
function DockviewComponent(options) {
|
|
@@ -447,7 +387,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
447
387
|
return element.getBoundingClientRect();
|
|
448
388
|
}
|
|
449
389
|
var box = getBox();
|
|
450
|
-
var groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
|
|
390
|
+
var groupId = (_b = (_a = options === null || options === void 0 ? void 0 : options.overridePopoutGroup) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this.getNextGroupId();
|
|
451
391
|
if (itemToPopout.api.location.type === 'grid') {
|
|
452
392
|
itemToPopout.api.setVisible(false);
|
|
453
393
|
}
|
|
@@ -567,24 +507,22 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
567
507
|
});
|
|
568
508
|
}
|
|
569
509
|
}
|
|
570
|
-
else {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
returnedGroup = removedGroup;
|
|
580
|
-
}
|
|
510
|
+
else if (_this.getPanel(group.id)) {
|
|
511
|
+
var removedGroup = _this.doRemoveGroup(group, {
|
|
512
|
+
skipDispose: true,
|
|
513
|
+
skipActive: true,
|
|
514
|
+
});
|
|
515
|
+
removedGroup.model.renderContainer =
|
|
516
|
+
_this.overlayRenderContainer;
|
|
517
|
+
removedGroup.model.location = { type: 'grid' };
|
|
518
|
+
returnedGroup = removedGroup;
|
|
581
519
|
}
|
|
582
520
|
}));
|
|
583
521
|
_this._popoutGroups.push(value);
|
|
584
522
|
_this.updateWatermark();
|
|
585
523
|
})
|
|
586
524
|
.catch(function (err) {
|
|
587
|
-
console.error(err);
|
|
525
|
+
console.error('dockview: failed to create popout window', err);
|
|
588
526
|
});
|
|
589
527
|
};
|
|
590
528
|
DockviewComponent.prototype.addFloatingGroup = function (item, coord, options) {
|
|
@@ -634,7 +572,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
634
572
|
this.doRemoveGroup(item, {
|
|
635
573
|
skipDispose: true,
|
|
636
574
|
skipPopoutReturn: true,
|
|
637
|
-
skipPopoutAssociated:
|
|
575
|
+
skipPopoutAssociated: false,
|
|
638
576
|
});
|
|
639
577
|
}
|
|
640
578
|
}
|
|
@@ -1104,7 +1042,6 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1104
1042
|
var e_13, _a;
|
|
1105
1043
|
var groups = Array.from(this._groups.values()).map(function (_) { return _.value; });
|
|
1106
1044
|
var hasActiveGroup = !!this.activeGroup;
|
|
1107
|
-
var hasActivePanel = !!this.activePanel;
|
|
1108
1045
|
try {
|
|
1109
1046
|
for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
1110
1047
|
var group = groups_1_1.value;
|
|
@@ -1671,7 +1608,7 @@ var DockviewComponent = /** @class */ (function (_super) {
|
|
|
1671
1608
|
}
|
|
1672
1609
|
var id = options === null || options === void 0 ? void 0 : options.id;
|
|
1673
1610
|
if (id && this._groups.has(options.id)) {
|
|
1674
|
-
console.warn("Duplicate group id ".concat(options === null || options === void 0 ? void 0 : options.id, ". reassigning group id to avoid errors"));
|
|
1611
|
+
console.warn("dockview: Duplicate group id ".concat(options === null || options === void 0 ? void 0 : options.id, ". reassigning group id to avoid errors"));
|
|
1675
1612
|
id = undefined;
|
|
1676
1613
|
}
|
|
1677
1614
|
if (!id) {
|
|
@@ -123,12 +123,6 @@ var DockviewPanel = /** @class */ (function (_super) {
|
|
|
123
123
|
var didTitleChange = title !== this.title;
|
|
124
124
|
if (didTitleChange) {
|
|
125
125
|
this._title = title;
|
|
126
|
-
this.view.update({
|
|
127
|
-
params: {
|
|
128
|
-
params: this._params,
|
|
129
|
-
title: this.title,
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
126
|
this.api._onDidTitleChange.fire({ title: title });
|
|
133
127
|
}
|
|
134
128
|
};
|
|
@@ -167,10 +161,7 @@ var DockviewPanel = /** @class */ (function (_super) {
|
|
|
167
161
|
}
|
|
168
162
|
// update the view with the updated props
|
|
169
163
|
this.view.update({
|
|
170
|
-
params:
|
|
171
|
-
params: this._params,
|
|
172
|
-
title: this.title,
|
|
173
|
-
},
|
|
164
|
+
params: this._params,
|
|
174
165
|
});
|
|
175
166
|
};
|
|
176
167
|
DockviewPanel.prototype.updateParentGroup = function (group, options) {
|
|
@@ -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/cjs/events.js
CHANGED
|
@@ -79,7 +79,7 @@ var Stacktrace = /** @class */ (function () {
|
|
|
79
79
|
return new Stacktrace((_a = new Error().stack) !== null && _a !== void 0 ? _a : '');
|
|
80
80
|
};
|
|
81
81
|
Stacktrace.prototype.print = function () {
|
|
82
|
-
console.warn(this.value);
|
|
82
|
+
console.warn('dockview: stacktrace', this.value);
|
|
83
83
|
};
|
|
84
84
|
return Stacktrace;
|
|
85
85
|
}());
|
|
@@ -129,7 +129,7 @@ var Emitter = /** @class */ (function () {
|
|
|
129
129
|
}
|
|
130
130
|
else if (Emitter.ENABLE_TRACKING) {
|
|
131
131
|
// console.warn(
|
|
132
|
-
// `
|
|
132
|
+
// `dockview: listener already disposed`,
|
|
133
133
|
// Stacktrace.create().print()
|
|
134
134
|
// );
|
|
135
135
|
}
|
|
@@ -175,7 +175,7 @@ var Emitter = /** @class */ (function () {
|
|
|
175
175
|
// don't check until stack of execution is completed to allow for out-of-order disposals within the same execution block
|
|
176
176
|
for (var _c = __values(_this._listeners), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
177
177
|
var listener = _d.value;
|
|
178
|
-
console.warn((_b = listener.stacktrace) === null || _b === void 0 ? void 0 : _b.print());
|
|
178
|
+
console.warn('dockview: stacktrace', (_b = listener.stacktrace) === null || _b === void 0 ? void 0 : _b.print());
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
package/dist/cjs/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/cjs/index.js
CHANGED
|
@@ -14,11 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.DockviewApi = exports.GridviewApi = exports.PaneviewApi = exports.SplitviewApi = exports.directionToPosition = exports.positionToDirection = exports.DockviewCompositeDisposable = exports.DockviewMutableDisposable = exports.DockviewEvent = exports.DockviewEmitter = void 0;
|
|
17
|
+
exports.DockviewApi = exports.GridviewApi = exports.PaneviewApi = exports.SplitviewApi = exports.directionToPosition = exports.positionToDirection = exports.DockviewDisposable = exports.DockviewCompositeDisposable = exports.DockviewMutableDisposable = exports.DockviewEvent = exports.DockviewEmitter = void 0;
|
|
18
18
|
__exportStar(require("./dnd/dataTransfer"), exports);
|
|
19
19
|
/**
|
|
20
|
-
* Events, Emitters and Disposables are very common concepts that
|
|
21
|
-
*
|
|
20
|
+
* Events, Emitters and Disposables are very common concepts that many codebases will contain, however we need
|
|
21
|
+
* to export them for dockview framework packages to use.
|
|
22
|
+
* To be a good citizen these are exported with a `Dockview` prefix to prevent accidental use by others.
|
|
22
23
|
*/
|
|
23
24
|
var events_1 = require("./events");
|
|
24
25
|
Object.defineProperty(exports, "DockviewEmitter", { enumerable: true, get: function () { return events_1.Emitter; } });
|
|
@@ -26,6 +27,7 @@ Object.defineProperty(exports, "DockviewEvent", { enumerable: true, get: functio
|
|
|
26
27
|
var lifecycle_1 = require("./lifecycle");
|
|
27
28
|
Object.defineProperty(exports, "DockviewMutableDisposable", { enumerable: true, get: function () { return lifecycle_1.MutableDisposable; } });
|
|
28
29
|
Object.defineProperty(exports, "DockviewCompositeDisposable", { enumerable: true, get: function () { return lifecycle_1.CompositeDisposable; } });
|
|
30
|
+
Object.defineProperty(exports, "DockviewDisposable", { enumerable: true, get: function () { return lifecycle_1.Disposable; } });
|
|
29
31
|
__exportStar(require("./panel/types"), exports);
|
|
30
32
|
__exportStar(require("./panel/componentFactory"), exports);
|
|
31
33
|
__exportStar(require("./splitview/splitview"), exports);
|