dockview 1.12.0 → 1.13.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/dist/cjs/dockview/defaultTab.d.ts +1 -1
- package/dist/cjs/dockview/dockview.d.ts +12 -40
- package/dist/cjs/dockview/dockview.js +102 -112
- package/dist/cjs/dockview/headerActionsRenderer.d.ts +3 -13
- package/dist/cjs/dockview/headerActionsRenderer.js +4 -14
- package/dist/cjs/dockview/reactContentPart.d.ts +2 -3
- package/dist/cjs/dockview/reactHeaderPart.d.ts +1 -2
- package/dist/cjs/dockview/reactWatermarkPart.d.ts +1 -6
- package/dist/cjs/dockview/reactWatermarkPart.js +0 -5
- package/dist/cjs/gridview/gridview.d.ts +2 -2
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/paneview/paneview.d.ts +3 -3
- package/dist/cjs/splitview/splitview.d.ts +2 -2
- package/dist/cjs/types.d.ts +0 -4
- package/dist/dockview.amd.js +2233 -2187
- package/dist/dockview.amd.js.map +1 -1
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.js.map +1 -1
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.min.noStyle.js.map +1 -1
- package/dist/dockview.amd.noStyle.js +2233 -2187
- package/dist/dockview.amd.noStyle.js.map +1 -1
- package/dist/dockview.cjs.js +2233 -2187
- package/dist/dockview.cjs.js.map +1 -1
- package/dist/dockview.esm.js +2232 -2188
- package/dist/dockview.esm.js.map +1 -1
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.esm.min.js.map +1 -1
- package/dist/dockview.js +2233 -2187
- package/dist/dockview.js.map +1 -1
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.js.map +1 -1
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.min.noStyle.js.map +1 -1
- package/dist/dockview.noStyle.js +2233 -2187
- package/dist/dockview.noStyle.js.map +1 -1
- package/dist/esm/dockview/defaultTab.d.ts +1 -1
- package/dist/esm/dockview/dockview.d.ts +12 -40
- package/dist/esm/dockview/dockview.js +93 -114
- package/dist/esm/dockview/headerActionsRenderer.d.ts +3 -13
- package/dist/esm/dockview/headerActionsRenderer.js +4 -10
- package/dist/esm/dockview/reactContentPart.d.ts +2 -3
- package/dist/esm/dockview/reactHeaderPart.d.ts +1 -2
- package/dist/esm/dockview/reactWatermarkPart.d.ts +1 -6
- package/dist/esm/dockview/reactWatermarkPart.js +0 -5
- package/dist/esm/gridview/gridview.d.ts +2 -2
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/paneview/paneview.d.ts +3 -3
- package/dist/esm/splitview/splitview.d.ts +2 -2
- package/dist/esm/types.d.ts +0 -4
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IDockviewPanelHeaderProps } from '
|
|
2
|
+
import { IDockviewPanelHeaderProps } from 'dockview-core';
|
|
3
3
|
export type IDockviewDefaultTabProps = IDockviewPanelHeaderProps & React.DOMAttributes<HTMLDivElement> & {
|
|
4
4
|
hideClose?: boolean;
|
|
5
5
|
closeActionOverride?: () => void;
|
|
@@ -1,48 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DockviewWillDropEvent,
|
|
3
|
-
|
|
4
|
-
import { PanelCollection, PanelParameters } from '../types';
|
|
5
|
-
import { IDockviewHeaderActionsProps } from './headerActionsRenderer';
|
|
6
|
-
export interface IGroupPanelBaseProps<T extends {
|
|
7
|
-
[index: string]: any;
|
|
8
|
-
} = any> extends PanelParameters<T> {
|
|
9
|
-
api: DockviewPanelApi;
|
|
10
|
-
containerApi: DockviewApi;
|
|
11
|
-
}
|
|
12
|
-
export type IDockviewPanelHeaderProps<T extends {
|
|
13
|
-
[index: string]: any;
|
|
14
|
-
} = any> = IGroupPanelBaseProps<T>;
|
|
15
|
-
export type IDockviewPanelProps<T extends {
|
|
16
|
-
[index: string]: any;
|
|
17
|
-
} = any> = IGroupPanelBaseProps<T>;
|
|
18
|
-
export interface DockviewReadyEvent {
|
|
19
|
-
api: DockviewApi;
|
|
20
|
-
}
|
|
21
|
-
export interface IDockviewReactProps {
|
|
22
|
-
onReady: (event: DockviewReadyEvent) => void;
|
|
23
|
-
components: PanelCollection<IDockviewPanelProps>;
|
|
24
|
-
tabComponents?: PanelCollection<IDockviewPanelHeaderProps>;
|
|
25
|
-
watermarkComponent?: React.FunctionComponent<IWatermarkPanelProps>;
|
|
26
|
-
onDidDrop?: (event: DockviewDidDropEvent) => void;
|
|
27
|
-
onWillDrop?: (event: DockviewWillDropEvent) => void;
|
|
28
|
-
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
|
29
|
-
hideBorders?: boolean;
|
|
2
|
+
import { DockviewWillDropEvent, DockviewDidDropEvent, IWatermarkPanelProps, IDockviewHeaderActionsProps, IDockviewPanelHeaderProps, IDockviewPanelProps, DockviewOptions, DockviewDndOverlayEvent, DockviewReadyEvent } from 'dockview-core';
|
|
3
|
+
export interface IDockviewReactProps extends DockviewOptions {
|
|
30
4
|
className?: string;
|
|
31
|
-
|
|
5
|
+
tabComponents?: Record<string, React.FunctionComponent<IDockviewPanelHeaderProps>>;
|
|
6
|
+
components: Record<string, React.FunctionComponent<IDockviewPanelProps>>;
|
|
7
|
+
watermarkComponent?: React.FunctionComponent<IWatermarkPanelProps>;
|
|
32
8
|
defaultTabComponent?: React.FunctionComponent<IDockviewPanelHeaderProps>;
|
|
33
9
|
rightHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
|
|
34
10
|
leftHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
|
|
35
11
|
prefixHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
defaultRenderer?: DockviewPanelRenderer;
|
|
44
|
-
rootOverlayModel?: DroptargetOverlayModel;
|
|
45
|
-
locked?: boolean;
|
|
46
|
-
disableDnd?: boolean;
|
|
12
|
+
onReady: (event: DockviewReadyEvent) => void;
|
|
13
|
+
onDidDrop?: (event: DockviewDidDropEvent) => void;
|
|
14
|
+
onWillDrop?: (event: DockviewWillDropEvent) => void;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use `api.onUnhandledDragOverEvent` instead. This will be removed in the next release.
|
|
17
|
+
*/
|
|
18
|
+
showDndOverlay?: (event: DockviewDndOverlayEvent) => boolean;
|
|
47
19
|
}
|
|
48
20
|
export declare const DockviewReact: React.ForwardRefExoticComponent<IDockviewReactProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DockviewComponent, DockviewApi, } from 'dockview-core';
|
|
2
|
+
import { DockviewComponent, DockviewApi, PROPERTY_KEYS, } from 'dockview-core';
|
|
3
3
|
import { ReactPanelContentPart } from './reactContentPart';
|
|
4
4
|
import { ReactPanelHeaderPart } from './reactHeaderPart';
|
|
5
5
|
import { usePortalsLifecycle } from '../react';
|
|
6
6
|
import { ReactWatermarkPart } from './reactWatermarkPart';
|
|
7
|
-
import { ReactHeaderActionsRendererPart
|
|
7
|
+
import { ReactHeaderActionsRendererPart } from './headerActionsRenderer';
|
|
8
8
|
function createGroupControlElement(component, store) {
|
|
9
9
|
return component
|
|
10
10
|
? (groupPanel) => {
|
|
@@ -13,72 +13,75 @@ function createGroupControlElement(component, store) {
|
|
|
13
13
|
: undefined;
|
|
14
14
|
}
|
|
15
15
|
const DEFAULT_REACT_TAB = 'props.defaultTabComponent';
|
|
16
|
+
function extractCoreOptions(props) {
|
|
17
|
+
const coreOptions = PROPERTY_KEYS.reduce((obj, key) => {
|
|
18
|
+
if (key in props) {
|
|
19
|
+
obj[key] = props[key];
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}, {});
|
|
23
|
+
return coreOptions;
|
|
24
|
+
}
|
|
16
25
|
export const DockviewReact = React.forwardRef((props, ref) => {
|
|
17
26
|
const domRef = React.useRef(null);
|
|
18
27
|
const dockviewRef = React.useRef();
|
|
19
28
|
const [portals, addPortal] = usePortalsLifecycle();
|
|
20
29
|
React.useImperativeHandle(ref, () => domRef.current, []);
|
|
30
|
+
const prevProps = React.useRef({});
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
const changes = {};
|
|
33
|
+
PROPERTY_KEYS.forEach((propKey) => {
|
|
34
|
+
const key = propKey;
|
|
35
|
+
const propValue = props[key];
|
|
36
|
+
if (key in props && propValue !== prevProps.current[key]) {
|
|
37
|
+
changes[key] = propValue;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
if (dockviewRef.current) {
|
|
41
|
+
dockviewRef.current.updateOptions(changes);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// not yet fully initialized
|
|
45
|
+
}
|
|
46
|
+
prevProps.current = props;
|
|
47
|
+
}, PROPERTY_KEYS.map((key) => props[key]));
|
|
21
48
|
React.useEffect(() => {
|
|
22
49
|
var _a;
|
|
23
50
|
if (!domRef.current) {
|
|
24
|
-
return
|
|
25
|
-
// noop
|
|
26
|
-
};
|
|
51
|
+
return;
|
|
27
52
|
}
|
|
28
|
-
const factory = {
|
|
29
|
-
content: {
|
|
30
|
-
createComponent: (_id, componentId, component) => {
|
|
31
|
-
return new ReactPanelContentPart(componentId, component, {
|
|
32
|
-
addPortal,
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
tab: {
|
|
37
|
-
createComponent: (_id, componentId, component) => {
|
|
38
|
-
return new ReactPanelHeaderPart(componentId, component, {
|
|
39
|
-
addPortal,
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
watermark: {
|
|
44
|
-
createComponent: (_id, componentId, component) => {
|
|
45
|
-
return new ReactWatermarkPart(componentId, component, {
|
|
46
|
-
addPortal,
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
53
|
const frameworkTabComponents = (_a = props.tabComponents) !== null && _a !== void 0 ? _a : {};
|
|
52
54
|
if (props.defaultTabComponent) {
|
|
53
55
|
frameworkTabComponents[DEFAULT_REACT_TAB] =
|
|
54
56
|
props.defaultTabComponent;
|
|
55
57
|
}
|
|
56
|
-
const
|
|
58
|
+
const frameworkOptions = {
|
|
59
|
+
createLeftHeaderActionComponent: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal }),
|
|
60
|
+
createRightHeaderActionComponent: createGroupControlElement(props.rightHeaderActionsComponent, { addPortal }),
|
|
61
|
+
createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
|
|
62
|
+
createComponent: (options) => {
|
|
63
|
+
return new ReactPanelContentPart(options.id, props.components[options.name], {
|
|
64
|
+
addPortal,
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
createTabComponent(options) {
|
|
68
|
+
return new ReactPanelHeaderPart(options.id, frameworkTabComponents[options.name], {
|
|
69
|
+
addPortal,
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
createWatermarkComponent: props.watermarkComponent
|
|
73
|
+
? () => {
|
|
74
|
+
return new ReactWatermarkPart('watermark', props.watermarkComponent, {
|
|
75
|
+
addPortal,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
: undefined,
|
|
57
79
|
parentElement: domRef.current,
|
|
58
|
-
frameworkComponentFactory: factory,
|
|
59
|
-
frameworkComponents: props.components,
|
|
60
|
-
disableAutoResizing: props.disableAutoResizing,
|
|
61
|
-
frameworkTabComponents,
|
|
62
|
-
watermarkFrameworkComponent: props.watermarkComponent,
|
|
63
80
|
defaultTabComponent: props.defaultTabComponent
|
|
64
81
|
? DEFAULT_REACT_TAB
|
|
65
82
|
: undefined,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
: undefined,
|
|
69
|
-
showDndOverlay: props.showDndOverlay,
|
|
70
|
-
createLeftHeaderActionsElement: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal }),
|
|
71
|
-
createRightHeaderActionsElement: createGroupControlElement(props.rightHeaderActionsComponent, { addPortal }),
|
|
72
|
-
createPrefixHeaderActionsElement: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
|
|
73
|
-
singleTabMode: props.singleTabMode,
|
|
74
|
-
disableFloatingGroups: props.disableFloatingGroups,
|
|
75
|
-
floatingGroupBounds: props.floatingGroupBounds,
|
|
76
|
-
defaultRenderer: props.defaultRenderer,
|
|
77
|
-
debug: props.debug,
|
|
78
|
-
rootOverlayModel: props.rootOverlayModel,
|
|
79
|
-
locked: props.locked,
|
|
80
|
-
disableDnd: props.disableDnd,
|
|
81
|
-
});
|
|
83
|
+
};
|
|
84
|
+
const dockview = new DockviewComponent(Object.assign(Object.assign({}, extractCoreOptions(props)), frameworkOptions));
|
|
82
85
|
const { clientWidth, clientHeight } = domRef.current;
|
|
83
86
|
dockview.layout(clientWidth, clientHeight);
|
|
84
87
|
if (props.onReady) {
|
|
@@ -89,20 +92,6 @@ export const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
89
92
|
dockview.dispose();
|
|
90
93
|
};
|
|
91
94
|
}, []);
|
|
92
|
-
React.useEffect(() => {
|
|
93
|
-
if (!dockviewRef.current) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
dockviewRef.current.locked = !!props.locked;
|
|
97
|
-
}, [props.locked]);
|
|
98
|
-
React.useEffect(() => {
|
|
99
|
-
if (!dockviewRef.current) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
dockviewRef.current.updateOptions({
|
|
103
|
-
disableDnd: props.disableDnd,
|
|
104
|
-
});
|
|
105
|
-
}, [props.disableDnd]);
|
|
106
95
|
React.useEffect(() => {
|
|
107
96
|
if (!dockviewRef.current) {
|
|
108
97
|
return () => {
|
|
@@ -124,63 +113,43 @@ export const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
124
113
|
// noop
|
|
125
114
|
};
|
|
126
115
|
}
|
|
127
|
-
const disposable = dockviewRef.current.
|
|
128
|
-
|
|
129
|
-
|
|
116
|
+
const disposable = dockviewRef.current.onUnhandledDragOverEvent((event) => {
|
|
117
|
+
var _a;
|
|
118
|
+
if ((_a = props.showDndOverlay) === null || _a === void 0 ? void 0 : _a.call(props, event)) {
|
|
119
|
+
event.accept();
|
|
130
120
|
}
|
|
131
121
|
});
|
|
132
122
|
return () => {
|
|
133
123
|
disposable.dispose();
|
|
134
124
|
};
|
|
135
|
-
}, [props.onWillDrop]);
|
|
136
|
-
React.useEffect(() => {
|
|
137
|
-
if (!dockviewRef.current) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
dockviewRef.current.updateOptions({
|
|
141
|
-
frameworkComponents: props.components,
|
|
142
|
-
});
|
|
143
|
-
}, [props.components]);
|
|
144
|
-
React.useEffect(() => {
|
|
145
|
-
if (!dockviewRef.current) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
dockviewRef.current.updateOptions({
|
|
149
|
-
floatingGroupBounds: props.floatingGroupBounds,
|
|
150
|
-
});
|
|
151
|
-
}, [props.floatingGroupBounds]);
|
|
152
|
-
React.useEffect(() => {
|
|
153
|
-
if (!dockviewRef.current) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
dockviewRef.current.updateOptions({
|
|
157
|
-
watermarkFrameworkComponent: props.watermarkComponent,
|
|
158
|
-
});
|
|
159
|
-
}, [props.watermarkComponent]);
|
|
160
|
-
React.useEffect(() => {
|
|
161
|
-
if (!dockviewRef.current) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
dockviewRef.current.updateOptions({
|
|
165
|
-
showDndOverlay: props.showDndOverlay,
|
|
166
|
-
});
|
|
167
125
|
}, [props.showDndOverlay]);
|
|
168
126
|
React.useEffect(() => {
|
|
169
127
|
if (!dockviewRef.current) {
|
|
170
|
-
return
|
|
128
|
+
return () => {
|
|
129
|
+
// noop
|
|
130
|
+
};
|
|
171
131
|
}
|
|
172
|
-
dockviewRef.current.
|
|
173
|
-
|
|
132
|
+
const disposable = dockviewRef.current.onWillDrop((event) => {
|
|
133
|
+
if (props.onWillDrop) {
|
|
134
|
+
props.onWillDrop(event);
|
|
135
|
+
}
|
|
174
136
|
});
|
|
175
|
-
|
|
137
|
+
return () => {
|
|
138
|
+
disposable.dispose();
|
|
139
|
+
};
|
|
140
|
+
}, [props.onWillDrop]);
|
|
176
141
|
React.useEffect(() => {
|
|
177
142
|
if (!dockviewRef.current) {
|
|
178
143
|
return;
|
|
179
144
|
}
|
|
180
145
|
dockviewRef.current.updateOptions({
|
|
181
|
-
|
|
146
|
+
createComponent: (options) => {
|
|
147
|
+
return new ReactPanelContentPart(options.id, props.components[options.name], {
|
|
148
|
+
addPortal,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
182
151
|
});
|
|
183
|
-
}, [props.
|
|
152
|
+
}, [props.components]);
|
|
184
153
|
React.useEffect(() => {
|
|
185
154
|
var _a;
|
|
186
155
|
if (!dockviewRef.current) {
|
|
@@ -195,39 +164,49 @@ export const DockviewReact = React.forwardRef((props, ref) => {
|
|
|
195
164
|
defaultTabComponent: props.defaultTabComponent
|
|
196
165
|
? DEFAULT_REACT_TAB
|
|
197
166
|
: undefined,
|
|
198
|
-
|
|
167
|
+
createTabComponent(options) {
|
|
168
|
+
return new ReactPanelHeaderPart(options.id, frameworkTabComponents[options.name], {
|
|
169
|
+
addPortal,
|
|
170
|
+
});
|
|
171
|
+
},
|
|
199
172
|
});
|
|
200
|
-
}, [props.defaultTabComponent]);
|
|
173
|
+
}, [props.tabComponents, props.defaultTabComponent]);
|
|
201
174
|
React.useEffect(() => {
|
|
202
175
|
if (!dockviewRef.current) {
|
|
203
176
|
return;
|
|
204
177
|
}
|
|
205
178
|
dockviewRef.current.updateOptions({
|
|
206
|
-
|
|
179
|
+
createWatermarkComponent: props.watermarkComponent
|
|
180
|
+
? () => {
|
|
181
|
+
return new ReactWatermarkPart('watermark', props.watermarkComponent, {
|
|
182
|
+
addPortal,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
: undefined,
|
|
207
186
|
});
|
|
208
|
-
}, [props.
|
|
187
|
+
}, [props.watermarkComponent]);
|
|
209
188
|
React.useEffect(() => {
|
|
210
189
|
if (!dockviewRef.current) {
|
|
211
190
|
return;
|
|
212
191
|
}
|
|
213
192
|
dockviewRef.current.updateOptions({
|
|
214
|
-
|
|
193
|
+
createRightHeaderActionComponent: createGroupControlElement(props.rightHeaderActionsComponent, { addPortal }),
|
|
215
194
|
});
|
|
216
|
-
}, [props.
|
|
195
|
+
}, [props.rightHeaderActionsComponent]);
|
|
217
196
|
React.useEffect(() => {
|
|
218
197
|
if (!dockviewRef.current) {
|
|
219
198
|
return;
|
|
220
199
|
}
|
|
221
200
|
dockviewRef.current.updateOptions({
|
|
222
|
-
|
|
201
|
+
createLeftHeaderActionComponent: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal }),
|
|
223
202
|
});
|
|
224
|
-
}, [props.
|
|
203
|
+
}, [props.leftHeaderActionsComponent]);
|
|
225
204
|
React.useEffect(() => {
|
|
226
205
|
if (!dockviewRef.current) {
|
|
227
206
|
return;
|
|
228
207
|
}
|
|
229
208
|
dockviewRef.current.updateOptions({
|
|
230
|
-
|
|
209
|
+
createPrefixHeaderActionComponent: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
|
|
231
210
|
});
|
|
232
211
|
}, [props.prefixHeaderActionsComponent]);
|
|
233
212
|
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactPart, ReactPortalStore } from '../react';
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
5
|
-
api: DockviewGroupPanelApi;
|
|
6
|
-
containerApi: DockviewApi;
|
|
7
|
-
panels: IDockviewPanel[];
|
|
8
|
-
activePanel: IDockviewPanel | undefined;
|
|
9
|
-
isGroupActive: boolean;
|
|
10
|
-
group: DockviewGroupPanel;
|
|
11
|
-
}
|
|
12
|
-
export declare class ReactHeaderActionsRendererPart {
|
|
3
|
+
import { DockviewApi, DockviewGroupPanel, DockviewGroupPanelApi, PanelUpdateEvent, IHeaderActionsRenderer, IDockviewHeaderActionsProps } from 'dockview-core';
|
|
4
|
+
export declare class ReactHeaderActionsRendererPart implements IHeaderActionsRenderer {
|
|
13
5
|
private readonly component;
|
|
14
6
|
private readonly reactPortalStore;
|
|
15
7
|
private readonly _group;
|
|
@@ -18,15 +10,13 @@ export declare class ReactHeaderActionsRendererPart {
|
|
|
18
10
|
private _part?;
|
|
19
11
|
get element(): HTMLElement;
|
|
20
12
|
get part(): ReactPart<IDockviewHeaderActionsProps> | undefined;
|
|
21
|
-
get group(): DockviewGroupPanel;
|
|
22
13
|
constructor(component: React.FunctionComponent<IDockviewHeaderActionsProps>, reactPortalStore: ReactPortalStore, _group: DockviewGroupPanel);
|
|
23
|
-
focus(): void;
|
|
24
14
|
init(parameters: {
|
|
25
15
|
containerApi: DockviewApi;
|
|
26
16
|
api: DockviewGroupPanelApi;
|
|
27
17
|
}): void;
|
|
28
|
-
update(event: PanelUpdateEvent): void;
|
|
29
18
|
dispose(): void;
|
|
19
|
+
update(event: PanelUpdateEvent): void;
|
|
30
20
|
private updatePanels;
|
|
31
21
|
private updateActivePanel;
|
|
32
22
|
private updateGroupActive;
|
|
@@ -7,9 +7,6 @@ export class ReactHeaderActionsRendererPart {
|
|
|
7
7
|
get part() {
|
|
8
8
|
return this._part;
|
|
9
9
|
}
|
|
10
|
-
get group() {
|
|
11
|
-
return this._group;
|
|
12
|
-
}
|
|
13
10
|
constructor(component, reactPortalStore, _group) {
|
|
14
11
|
this.component = component;
|
|
15
12
|
this.reactPortalStore = reactPortalStore;
|
|
@@ -20,9 +17,6 @@ export class ReactHeaderActionsRendererPart {
|
|
|
20
17
|
this._element.style.height = '100%';
|
|
21
18
|
this._element.style.width = '100%';
|
|
22
19
|
}
|
|
23
|
-
focus() {
|
|
24
|
-
// TODO
|
|
25
|
-
}
|
|
26
20
|
init(parameters) {
|
|
27
21
|
this.mutableDisposable.value = new DockviewCompositeDisposable(this._group.model.onDidAddPanel(() => {
|
|
28
22
|
this.updatePanels();
|
|
@@ -42,15 +36,15 @@ export class ReactHeaderActionsRendererPart {
|
|
|
42
36
|
group: this._group,
|
|
43
37
|
});
|
|
44
38
|
}
|
|
45
|
-
update(event) {
|
|
46
|
-
var _a;
|
|
47
|
-
(_a = this._part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
48
|
-
}
|
|
49
39
|
dispose() {
|
|
50
40
|
var _a;
|
|
51
41
|
this.mutableDisposable.dispose();
|
|
52
42
|
(_a = this._part) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
53
43
|
}
|
|
44
|
+
update(event) {
|
|
45
|
+
var _a;
|
|
46
|
+
(_a = this._part) === null || _a === void 0 ? void 0 : _a.update(event.params);
|
|
47
|
+
}
|
|
54
48
|
updatePanels() {
|
|
55
49
|
this.update({ params: { panels: this._group.model.panels } });
|
|
56
50
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactPortalStore } from '../react';
|
|
3
|
-
import { IDockviewPanelProps } from '
|
|
4
|
-
import { DockviewEvent, PanelUpdateEvent, IContentRenderer, GroupPanelContentPartInitParameters } from 'dockview-core';
|
|
3
|
+
import { DockviewEvent, PanelUpdateEvent, IContentRenderer, GroupPanelPartInitParameters, IDockviewPanelProps } from 'dockview-core';
|
|
5
4
|
export declare class ReactPanelContentPart implements IContentRenderer {
|
|
6
5
|
readonly id: string;
|
|
7
6
|
private readonly component;
|
|
@@ -15,7 +14,7 @@ export declare class ReactPanelContentPart implements IContentRenderer {
|
|
|
15
14
|
get element(): HTMLElement;
|
|
16
15
|
constructor(id: string, component: React.FunctionComponent<IDockviewPanelProps>, reactPortalStore: ReactPortalStore);
|
|
17
16
|
focus(): void;
|
|
18
|
-
init(parameters:
|
|
17
|
+
init(parameters: GroupPanelPartInitParameters): void;
|
|
19
18
|
update(event: PanelUpdateEvent): void;
|
|
20
19
|
layout(_width: number, _height: number): void;
|
|
21
20
|
dispose(): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactPortalStore } from '../react';
|
|
3
|
-
import { IGroupPanelBaseProps } from '
|
|
4
|
-
import { PanelUpdateEvent, ITabRenderer, GroupPanelPartInitParameters } from 'dockview-core';
|
|
3
|
+
import { PanelUpdateEvent, ITabRenderer, GroupPanelPartInitParameters, IGroupPanelBaseProps } from 'dockview-core';
|
|
5
4
|
export declare class ReactPanelHeaderPart implements ITabRenderer {
|
|
6
5
|
readonly id: string;
|
|
7
6
|
private readonly component;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactPortalStore } from '../react';
|
|
3
|
-
import { PanelUpdateEvent, DockviewGroupPanel, IWatermarkRenderer, WatermarkRendererInitParameters,
|
|
4
|
-
export interface IWatermarkPanelProps {
|
|
5
|
-
containerApi: DockviewApi;
|
|
6
|
-
group?: IDockviewGroupPanel;
|
|
7
|
-
close: () => void;
|
|
8
|
-
}
|
|
3
|
+
import { PanelUpdateEvent, DockviewGroupPanel, IWatermarkRenderer, WatermarkRendererInitParameters, IWatermarkPanelProps } from 'dockview-core';
|
|
9
4
|
export declare class ReactWatermarkPart implements IWatermarkRenderer {
|
|
10
5
|
readonly id: string;
|
|
11
6
|
private readonly component;
|
|
@@ -16,11 +16,6 @@ export class ReactWatermarkPart {
|
|
|
16
16
|
this.part = new ReactPart(this.element, this.reactPortalStore, this.component, {
|
|
17
17
|
group: parameters.group,
|
|
18
18
|
containerApi: parameters.containerApi,
|
|
19
|
-
close: () => {
|
|
20
|
-
if (parameters.group) {
|
|
21
|
-
parameters.containerApi.removeGroup(parameters.group);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
19
|
});
|
|
25
20
|
}
|
|
26
21
|
focus() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GridviewPanelApi, Orientation, GridviewApi } from 'dockview-core';
|
|
3
|
-
import {
|
|
3
|
+
import { PanelParameters } from '../types';
|
|
4
4
|
export interface GridviewReadyEvent {
|
|
5
5
|
api: GridviewApi;
|
|
6
6
|
}
|
|
@@ -13,7 +13,7 @@ export interface IGridviewPanelProps<T extends {
|
|
|
13
13
|
export interface IGridviewReactProps {
|
|
14
14
|
orientation?: Orientation;
|
|
15
15
|
onReady: (event: GridviewReadyEvent) => void;
|
|
16
|
-
components:
|
|
16
|
+
components: Record<string, React.FunctionComponent<IGridviewPanelProps>>;
|
|
17
17
|
hideBorders?: boolean;
|
|
18
18
|
className?: string;
|
|
19
19
|
proportionalLayout?: boolean;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ export * from './dockview/dockview';
|
|
|
3
3
|
export * from './dockview/defaultTab';
|
|
4
4
|
export * from './splitview/splitview';
|
|
5
5
|
export * from './gridview/gridview';
|
|
6
|
-
export { IDockviewHeaderActionsProps } from './dockview/headerActionsRenderer';
|
|
7
|
-
export { IWatermarkPanelProps } from './dockview/reactWatermarkPart';
|
|
8
6
|
export * from './paneview/paneview';
|
|
9
7
|
export * from './types';
|
|
10
8
|
export * from './react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PaneviewPanelApi, PaneviewDndOverlayEvent, PaneviewApi, PaneviewDropEvent } from 'dockview-core';
|
|
3
|
-
import {
|
|
3
|
+
import { PanelParameters } from '../types';
|
|
4
4
|
export interface PaneviewReadyEvent {
|
|
5
5
|
api: PaneviewApi;
|
|
6
6
|
}
|
|
@@ -13,8 +13,8 @@ export interface IPaneviewPanelProps<T extends {
|
|
|
13
13
|
}
|
|
14
14
|
export interface IPaneviewReactProps {
|
|
15
15
|
onReady: (event: PaneviewReadyEvent) => void;
|
|
16
|
-
components:
|
|
17
|
-
headerComponents?:
|
|
16
|
+
components: Record<string, React.FunctionComponent<IPaneviewPanelProps>>;
|
|
17
|
+
headerComponents?: Record<string, React.FunctionComponent<IPaneviewPanelProps>>;
|
|
18
18
|
className?: string;
|
|
19
19
|
disableAutoResizing?: boolean;
|
|
20
20
|
disableDnd?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SplitviewApi, SplitviewPanelApi, Orientation } from 'dockview-core';
|
|
3
|
-
import {
|
|
3
|
+
import { PanelParameters } from '../types';
|
|
4
4
|
export interface SplitviewReadyEvent {
|
|
5
5
|
api: SplitviewApi;
|
|
6
6
|
}
|
|
@@ -13,7 +13,7 @@ export interface ISplitviewPanelProps<T extends {
|
|
|
13
13
|
export interface ISplitviewReactProps {
|
|
14
14
|
orientation?: Orientation;
|
|
15
15
|
onReady: (event: SplitviewReadyEvent) => void;
|
|
16
|
-
components:
|
|
16
|
+
components: Record<string, React.FunctionComponent<ISplitviewPanelProps>>;
|
|
17
17
|
proportionalLayout?: boolean;
|
|
18
18
|
hideBorders?: boolean;
|
|
19
19
|
className?: string;
|
package/dist/esm/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockview",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Zero dependency layout manager supporting tabs, grids and splitviews
|
|
3
|
+
"version": "1.13.1",
|
|
4
|
+
"description": "Zero dependency layout manager supporting tabs, grids and splitviews",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"splitview",
|
|
7
7
|
"split-view",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"test:cov": "cross-env ../../node_modules/.bin/jest --selectProjects dockview --coverage"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"dockview-core": "^1.
|
|
57
|
+
"dockview-core": "^1.13.1"
|
|
58
58
|
}
|
|
59
59
|
}
|