dockview-core
Advanced tools
Comparing version 1.8.3 to 1.8.4
@@ -36,2 +36,3 @@ import { IDisposable, CompositeDisposable } from '../../../lifecycle'; | ||
setLeftActionsElement(element: HTMLElement | undefined): void; | ||
setPrefixActionsElement(element: HTMLElement | undefined): void; | ||
show(): void; | ||
@@ -47,2 +48,3 @@ hide(): void; | ||
private readonly leftActionsContainer; | ||
private readonly preActionsContainer; | ||
private readonly voidContainer; | ||
@@ -53,2 +55,3 @@ private tabs; | ||
private leftActions; | ||
private preActions; | ||
private _hidden; | ||
@@ -69,2 +72,3 @@ private readonly _onDrop; | ||
setLeftActionsElement(element: HTMLElement | undefined): void; | ||
setPrefixActionsElement(element: HTMLElement | undefined): void; | ||
get element(): HTMLElement; | ||
@@ -71,0 +75,0 @@ isActive(tab: ITab): boolean; |
@@ -92,5 +92,8 @@ "use strict"; | ||
_this.leftActionsContainer.className = 'left-actions-container'; | ||
_this.preActionsContainer = document.createElement('div'); | ||
_this.preActionsContainer.className = 'pre-actions-container'; | ||
_this.tabContainer = document.createElement('div'); | ||
_this.tabContainer.className = 'tabs-container'; | ||
_this.voidContainer = new voidContainer_1.VoidContainer(_this.accessor, _this.group); | ||
_this._element.appendChild(_this.preActionsContainer); | ||
_this._element.appendChild(_this.tabContainer); | ||
@@ -193,2 +196,15 @@ _this._element.appendChild(_this.leftActionsContainer); | ||
}; | ||
TabsContainer.prototype.setPrefixActionsElement = function (element) { | ||
if (this.preActions === element) { | ||
return; | ||
} | ||
if (this.preActions) { | ||
this.preActions.remove(); | ||
this.preActions = undefined; | ||
} | ||
if (element) { | ||
this.preActionsContainer.appendChild(element); | ||
this.preActions = element; | ||
} | ||
}; | ||
Object.defineProperty(TabsContainer.prototype, "element", { | ||
@@ -195,0 +211,0 @@ get: function () { |
@@ -43,3 +43,3 @@ import { SerializedGridObject } from '../gridview/gridview'; | ||
} | ||
export type DockviewComponentUpdateOptions = Pick<DockviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents' | 'tabComponents' | 'frameworkTabComponents' | 'showDndOverlay' | 'watermarkFrameworkComponent' | 'defaultTabComponent' | 'createLeftHeaderActionsElement' | 'createRightHeaderActionsElement' | 'disableFloatingGroups' | 'floatingGroupBounds'>; | ||
export type DockviewComponentUpdateOptions = Pick<DockviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents' | 'tabComponents' | 'frameworkTabComponents' | 'showDndOverlay' | 'watermarkFrameworkComponent' | 'defaultTabComponent' | 'createLeftHeaderActionsElement' | 'createRightHeaderActionsElement' | 'createPrefixHeaderActionsElement' | 'disableFloatingGroups' | 'floatingGroupBounds'>; | ||
export interface DockviewDropEvent extends GroupviewDropEvent { | ||
@@ -46,0 +46,0 @@ api: DockviewApi; |
@@ -88,2 +88,62 @@ "use strict"; | ||
var DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100; | ||
function typeValidate3(data, path) { | ||
if (typeof data.id !== 'string') { | ||
throw new Error("".concat(path, ".id must be a string")); | ||
} | ||
if (typeof data.activeView !== 'string' || | ||
typeof data.activeView !== 'undefined') { | ||
throw new Error("".concat(path, ".activeView must be a string of undefined")); | ||
} | ||
} | ||
function typeValidate2(data, path) { | ||
if (typeof data.size !== 'number' && typeof data.size !== 'undefined') { | ||
throw new Error("".concat(path, ".size must be a number or undefined")); | ||
} | ||
if (typeof data.visible !== 'boolean' && | ||
typeof data.visible !== 'undefined') { | ||
throw new Error("".concat(path, ".visible must be a boolean or undefined")); | ||
} | ||
if (data.type === 'leaf') { | ||
if (typeof data.data !== 'object' || | ||
data.data === null || | ||
Array.isArray(data.data)) { | ||
throw new Error('object must be a non-null object'); | ||
} | ||
typeValidate3(data.data, "".concat(path, ".data")); | ||
} | ||
else if (data.type === 'branch') { | ||
if (!Array.isArray(data.data)) { | ||
throw new Error("".concat(path, ".data must be an array")); | ||
} | ||
} | ||
else { | ||
throw new Error("".concat(path, ".type must be onew of {'branch', 'leaf'}")); | ||
} | ||
} | ||
function typeValidate(data) { | ||
if (typeof data !== 'object' || data === null) { | ||
throw new Error('object must be a non-null object'); | ||
} | ||
var grid = data.grid, panels = data.panels, activeGroup = data.activeGroup, floatingGroups = data.floatingGroups; | ||
if (typeof grid !== 'object' || grid === null) { | ||
throw new Error("'.grid' must be a non-null object"); | ||
} | ||
if (typeof grid.height !== 'number') { | ||
throw new Error("'.grid.height' must be a number"); | ||
} | ||
if (typeof grid.width !== 'number') { | ||
throw new Error("'.grid.width' must be a number"); | ||
} | ||
if (typeof grid.root !== 'object' || grid.root === null) { | ||
throw new Error("'.grid.root' must be a non-null object"); | ||
} | ||
if (grid.root.type !== 'branch') { | ||
throw new Error(".grid.root.type must be of type 'branch'"); | ||
} | ||
if (grid.orientation !== splitview_1.Orientation.HORIZONTAL && | ||
grid.orientation !== splitview_1.Orientation.VERTICAL) { | ||
throw new Error("'.grid.width' must be one of {".concat(splitview_1.Orientation.HORIZONTAL, ", ").concat(splitview_1.Orientation.VERTICAL, "}")); | ||
} | ||
typeValidate2(grid.root, '.grid.root'); | ||
} | ||
var DockviewComponent = /** @class */ (function (_super) { | ||
@@ -482,6 +542,9 @@ __extends(DockviewComponent, _super); | ||
DockviewComponent.prototype.fromJSON = function (data) { | ||
var e_3, _a, e_4, _b; | ||
var e_3, _a, e_4, _b, e_5, _c, e_6, _d, e_7, _e, e_8, _f; | ||
var _this = this; | ||
var _c; | ||
var _g; | ||
this.clear(); | ||
if (typeof data !== 'object' || data === null) { | ||
throw new Error('serialized layout must be a non-null object'); | ||
} | ||
var grid = data.grid, panels = data.panels, activeGroup = data.activeGroup; | ||
@@ -491,19 +554,42 @@ if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) { | ||
} | ||
// take note of the existing dimensions | ||
var width = this.width; | ||
var height = this.height; | ||
var createGroupFromSerializedState = function (data) { | ||
var e_5, _a; | ||
var id = data.id, locked = data.locked, hideHeader = data.hideHeader, views = data.views, activeView = data.activeView; | ||
var group = _this.createGroup({ | ||
id: id, | ||
locked: !!locked, | ||
hideHeader: !!hideHeader, | ||
}); | ||
_this._onDidAddGroup.fire(group); | ||
try { | ||
for (var views_1 = __values(views), views_1_1 = views_1.next(); !views_1_1.done; views_1_1 = views_1.next()) { | ||
var child = views_1_1.value; | ||
var panel = _this._deserializer.fromJSON(panels[child], group); | ||
var isActive = typeof activeView === 'string' && activeView === panel.id; | ||
try { | ||
// take note of the existing dimensions | ||
var width = this.width; | ||
var height = this.height; | ||
var createGroupFromSerializedState_1 = function (data) { | ||
var e_9, _a; | ||
var id = data.id, locked = data.locked, hideHeader = data.hideHeader, views = data.views, activeView = data.activeView; | ||
if (typeof id !== 'string') { | ||
throw new Error('group id must be of type string'); | ||
} | ||
var group = _this.createGroup({ | ||
id: id, | ||
locked: !!locked, | ||
hideHeader: !!hideHeader, | ||
}); | ||
var createdPanels = []; | ||
try { | ||
for (var views_1 = __values(views), views_1_1 = views_1.next(); !views_1_1.done; views_1_1 = views_1.next()) { | ||
var child = views_1_1.value; | ||
/** | ||
* Run the deserializer step seperately since this may fail to due corrupted external state. | ||
* In running this section first we avoid firing lots of 'add' events in the event of a failure | ||
* due to a corruption of input data. | ||
*/ | ||
var panel = _this._deserializer.fromJSON(panels[child], group); | ||
createdPanels.push(panel); | ||
} | ||
} | ||
catch (e_9_1) { e_9 = { error: e_9_1 }; } | ||
finally { | ||
try { | ||
if (views_1_1 && !views_1_1.done && (_a = views_1.return)) _a.call(views_1); | ||
} | ||
finally { if (e_9) throw e_9.error; } | ||
} | ||
_this._onDidAddGroup.fire(group); | ||
for (var i = 0; i < views.length; i++) { | ||
var panel = createdPanels[i]; | ||
var isActive = typeof activeView === 'string' && | ||
activeView === panel.id; | ||
group.model.openPanel(panel, { | ||
@@ -514,62 +600,129 @@ skipSetPanelActive: !isActive, | ||
} | ||
if (!group.activePanel && group.panels.length > 0) { | ||
group.model.openPanel(group.panels[group.panels.length - 1], { | ||
skipSetGroupActive: true, | ||
}); | ||
} | ||
return group; | ||
}; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: function (node) { | ||
return createGroupFromSerializedState_1(node.data); | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
var serializedFloatingGroups = (_g = data.floatingGroups) !== null && _g !== void 0 ? _g : []; | ||
try { | ||
for (var serializedFloatingGroups_1 = __values(serializedFloatingGroups), serializedFloatingGroups_1_1 = serializedFloatingGroups_1.next(); !serializedFloatingGroups_1_1.done; serializedFloatingGroups_1_1 = serializedFloatingGroups_1.next()) { | ||
var serializedFloatingGroup = serializedFloatingGroups_1_1.value; | ||
var data_1 = serializedFloatingGroup.data, position = serializedFloatingGroup.position; | ||
var group = createGroupFromSerializedState_1(data_1); | ||
this.addFloatingGroup(group, { | ||
x: position.left, | ||
y: position.top, | ||
height: position.height, | ||
width: position.width, | ||
}, { skipRemoveGroup: true, inDragMode: false }); | ||
} | ||
} | ||
catch (e_5_1) { e_5 = { error: e_5_1 }; } | ||
catch (e_3_1) { e_3 = { error: e_3_1 }; } | ||
finally { | ||
try { | ||
if (views_1_1 && !views_1_1.done && (_a = views_1.return)) _a.call(views_1); | ||
if (serializedFloatingGroups_1_1 && !serializedFloatingGroups_1_1.done && (_a = serializedFloatingGroups_1.return)) _a.call(serializedFloatingGroups_1); | ||
} | ||
finally { if (e_5) throw e_5.error; } | ||
finally { if (e_3) throw e_3.error; } | ||
} | ||
if (!group.activePanel && group.panels.length > 0) { | ||
group.model.openPanel(group.panels[group.panels.length - 1], { | ||
skipSetGroupActive: true, | ||
}); | ||
try { | ||
for (var _h = __values(this.floatingGroups), _j = _h.next(); !_j.done; _j = _h.next()) { | ||
var floatingGroup = _j.value; | ||
floatingGroup.overlay.setBounds(); | ||
} | ||
} | ||
return group; | ||
}; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: function (node) { | ||
return createGroupFromSerializedState(node.data); | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
var serializedFloatingGroups = (_c = data.floatingGroups) !== null && _c !== void 0 ? _c : []; | ||
try { | ||
for (var serializedFloatingGroups_1 = __values(serializedFloatingGroups), serializedFloatingGroups_1_1 = serializedFloatingGroups_1.next(); !serializedFloatingGroups_1_1.done; serializedFloatingGroups_1_1 = serializedFloatingGroups_1.next()) { | ||
var serializedFloatingGroup = serializedFloatingGroups_1_1.value; | ||
var data_1 = serializedFloatingGroup.data, position = serializedFloatingGroup.position; | ||
var group = createGroupFromSerializedState(data_1); | ||
this.addFloatingGroup(group, { | ||
x: position.left, | ||
y: position.top, | ||
height: position.height, | ||
width: position.width, | ||
}, { skipRemoveGroup: true, inDragMode: false }); | ||
catch (e_4_1) { e_4 = { error: e_4_1 }; } | ||
finally { | ||
try { | ||
if (_j && !_j.done && (_b = _h.return)) _b.call(_h); | ||
} | ||
finally { if (e_4) throw e_4.error; } | ||
} | ||
if (typeof activeGroup === 'string') { | ||
var panel = this.getPanel(activeGroup); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
} | ||
} | ||
} | ||
catch (e_3_1) { e_3 = { error: e_3_1 }; } | ||
finally { | ||
catch (err) { | ||
try { | ||
if (serializedFloatingGroups_1_1 && !serializedFloatingGroups_1_1.done && (_a = serializedFloatingGroups_1.return)) _a.call(serializedFloatingGroups_1); | ||
/** | ||
* Takes all the successfully created groups and remove all of their panels. | ||
*/ | ||
for (var _k = __values(this.groups), _l = _k.next(); !_l.done; _l = _k.next()) { | ||
var group = _l.value; | ||
try { | ||
for (var _m = (e_6 = void 0, __values(group.panels)), _o = _m.next(); !_o.done; _o = _m.next()) { | ||
var panel = _o.value; | ||
this.removePanel(panel, { | ||
removeEmptyGroup: false, | ||
skipDispose: false, | ||
}); | ||
} | ||
} | ||
catch (e_6_1) { e_6 = { error: e_6_1 }; } | ||
finally { | ||
try { | ||
if (_o && !_o.done && (_d = _m.return)) _d.call(_m); | ||
} | ||
finally { if (e_6) throw e_6.error; } | ||
} | ||
} | ||
} | ||
finally { if (e_3) throw e_3.error; } | ||
} | ||
try { | ||
for (var _d = __values(this.floatingGroups), _e = _d.next(); !_e.done; _e = _d.next()) { | ||
var floatingGroup = _e.value; | ||
floatingGroup.overlay.setBounds(); | ||
catch (e_5_1) { e_5 = { error: e_5_1 }; } | ||
finally { | ||
try { | ||
if (_l && !_l.done && (_c = _k.return)) _c.call(_k); | ||
} | ||
finally { if (e_5) throw e_5.error; } | ||
} | ||
} | ||
catch (e_4_1) { e_4 = { error: e_4_1 }; } | ||
finally { | ||
try { | ||
if (_e && !_e.done && (_b = _d.return)) _b.call(_d); | ||
/** | ||
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about | ||
* the underlying HTMLElement existing in the Gridview. | ||
*/ | ||
for (var _p = __values(this.groups), _q = _p.next(); !_q.done; _q = _p.next()) { | ||
var group = _q.value; | ||
group.dispose(); | ||
this._groups.delete(group.id); | ||
this._onDidRemoveGroup.fire(group); | ||
} | ||
} | ||
finally { if (e_4) throw e_4.error; } | ||
} | ||
if (typeof activeGroup === 'string') { | ||
var panel = this.getPanel(activeGroup); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
catch (e_7_1) { e_7 = { error: e_7_1 }; } | ||
finally { | ||
try { | ||
if (_q && !_q.done && (_e = _p.return)) _e.call(_p); | ||
} | ||
finally { if (e_7) throw e_7.error; } | ||
} | ||
try { | ||
// iterate over a reassigned array since original array will be modified | ||
for (var _r = __values(__spreadArray([], __read(this.floatingGroups), false)), _s = _r.next(); !_s.done; _s = _r.next()) { | ||
var floatingGroup = _s.value; | ||
floatingGroup.dispose(); | ||
} | ||
} | ||
catch (e_8_1) { e_8 = { error: e_8_1 }; } | ||
finally { | ||
try { | ||
if (_s && !_s.done && (_f = _r.return)) _f.call(_r); | ||
} | ||
finally { if (e_8) throw e_8.error; } | ||
} | ||
// fires clean-up events and clears the underlying HTML gridview. | ||
this.clear(); | ||
/** | ||
* even though we have cleaned-up we still want to inform the caller of their error | ||
* and we'll do this through re-throwing the original error since afterall you would | ||
* expect trying to load a corrupted layout to result in an error and not silently fail... | ||
*/ | ||
throw err; | ||
} | ||
@@ -579,3 +732,3 @@ this._onDidLayoutFromJSON.fire(); | ||
DockviewComponent.prototype.clear = function () { | ||
var e_6, _a; | ||
var e_10, _a; | ||
var groups = Array.from(this._groups.values()).map(function (_) { return _.value; }); | ||
@@ -591,3 +744,3 @@ var hasActiveGroup = !!this.activeGroup; | ||
} | ||
catch (e_6_1) { e_6 = { error: e_6_1 }; } | ||
catch (e_10_1) { e_10 = { error: e_10_1 }; } | ||
finally { | ||
@@ -597,3 +750,3 @@ try { | ||
} | ||
finally { if (e_6) throw e_6.error; } | ||
finally { if (e_10) throw e_10.error; } | ||
} | ||
@@ -609,3 +762,3 @@ if (hasActiveGroup) { | ||
DockviewComponent.prototype.closeAllGroups = function () { | ||
var e_7, _a; | ||
var e_11, _a; | ||
try { | ||
@@ -618,3 +771,3 @@ for (var _b = __values(this._groups.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
} | ||
catch (e_7_1) { e_7 = { error: e_7_1 }; } | ||
catch (e_11_1) { e_11 = { error: e_11_1 }; } | ||
finally { | ||
@@ -624,3 +777,3 @@ try { | ||
} | ||
finally { if (e_7) throw e_7.error; } | ||
finally { if (e_11) throw e_11.error; } | ||
} | ||
@@ -801,3 +954,3 @@ }; | ||
DockviewComponent.prototype.removeGroup = function (group, options) { | ||
var e_8, _a; | ||
var e_12, _a; | ||
var _b; | ||
@@ -814,3 +967,3 @@ var panels = __spreadArray([], __read(group.panels), false); // reassign since group panels will mutate | ||
} | ||
catch (e_8_1) { e_8 = { error: e_8_1 }; } | ||
catch (e_12_1) { e_12 = { error: e_12_1 }; } | ||
finally { | ||
@@ -820,3 +973,3 @@ try { | ||
} | ||
finally { if (e_8) throw e_8.error; } | ||
finally { if (e_12) throw e_12.error; } | ||
} | ||
@@ -831,2 +984,3 @@ this.doRemoveGroup(group, options); | ||
this._groups.delete(group.id); | ||
// TODO: fire group removed event? | ||
} | ||
@@ -901,3 +1055,3 @@ floatingGroup.dispose(); | ||
DockviewComponent.prototype.moveGroup = function (sourceGroup, referenceGroup, target) { | ||
var e_9, _a; | ||
var e_13, _a; | ||
if (sourceGroup) { | ||
@@ -920,3 +1074,3 @@ if (!target || target === 'center') { | ||
} | ||
catch (e_9_1) { e_9 = { error: e_9_1 }; } | ||
catch (e_13_1) { e_13 = { error: e_13_1 }; } | ||
finally { | ||
@@ -926,3 +1080,3 @@ try { | ||
} | ||
finally { if (e_9) throw e_9.error; } | ||
finally { if (e_13) throw e_13.error; } | ||
} | ||
@@ -929,0 +1083,0 @@ } |
@@ -111,2 +111,3 @@ import { PanelTransfer } from '../dnd/dataTransfer'; | ||
private _leftHeaderActions; | ||
private _prefixHeaderActions; | ||
private mostRecentlyUsed; | ||
@@ -113,0 +114,0 @@ private readonly _onDidChange; |
@@ -272,2 +272,12 @@ "use strict"; | ||
} | ||
if (this.accessor.options.createPrefixHeaderActionsElement) { | ||
this._prefixHeaderActions = | ||
this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel); | ||
this.addDisposables(this._prefixHeaderActions); | ||
this._prefixHeaderActions.init({ | ||
containerApi: new component_api_1.DockviewApi(this.accessor), | ||
api: this.groupPanel.api, | ||
}); | ||
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element); | ||
} | ||
}; | ||
@@ -274,0 +284,0 @@ DockviewGroupPanelModel.prototype.indexOf = function (panel) { |
@@ -70,2 +70,3 @@ import { DockviewApi } from '../api/component.api'; | ||
createLeftHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer; | ||
createPrefixHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer; | ||
singleTabMode?: 'fullwidth' | 'default'; | ||
@@ -72,0 +73,0 @@ parentElement?: HTMLElement; |
@@ -52,3 +52,3 @@ import { Emitter, Event, TickDelayedEvent } from '../events'; | ||
readonly onDidLayoutChange: Event<void>; | ||
private readonly _onDidRemoveGroup; | ||
protected readonly _onDidRemoveGroup: Emitter<T>; | ||
readonly onDidRemoveGroup: Event<T>; | ||
@@ -55,0 +55,0 @@ protected readonly _onDidAddGroup: Emitter<T>; |
@@ -105,2 +105,3 @@ "use strict"; | ||
proportionalLayout: proportionalLayout, | ||
styles: styles, | ||
}); | ||
@@ -107,0 +108,0 @@ } |
@@ -497,2 +497,10 @@ "use strict"; | ||
} | ||
/** | ||
* clean down the branch node since we need to dipose of it and | ||
* when .dispose() it called on a branch it will dispose of any | ||
* views it is holding onto. | ||
*/ | ||
while (sibling.children.length > 0) { | ||
sibling.removeChild(0); | ||
} | ||
} | ||
@@ -499,0 +507,0 @@ else { |
@@ -148,48 +148,80 @@ "use strict"; | ||
GridviewComponent.prototype.fromJSON = function (serializedGridview) { | ||
var e_1, _a; | ||
var _this = this; | ||
this.clear(); | ||
var grid = serializedGridview.grid, activePanel = serializedGridview.activePanel; | ||
var queue = []; | ||
// take note of the existing dimensions | ||
var width = this.width; | ||
var height = this.height; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: function (node) { | ||
var data = node.data; | ||
var view = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkComponentFactory | ||
? { | ||
createComponent: _this.options.frameworkComponentFactory | ||
.createComponent, | ||
} | ||
: undefined); | ||
queue.push(function () { | ||
return view.init({ | ||
params: data.params, | ||
minimumWidth: data.minimumWidth, | ||
maximumWidth: data.maximumWidth, | ||
minimumHeight: data.minimumHeight, | ||
maximumHeight: data.maximumHeight, | ||
priority: data.priority, | ||
snap: !!data.snap, | ||
accessor: _this, | ||
isVisible: node.visible, | ||
try { | ||
var queue_1 = []; | ||
// take note of the existing dimensions | ||
var width = this.width; | ||
var height = this.height; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: function (node) { | ||
var data = node.data; | ||
var view = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkComponentFactory | ||
? { | ||
createComponent: _this.options.frameworkComponentFactory | ||
.createComponent, | ||
} | ||
: undefined); | ||
queue_1.push(function () { | ||
return view.init({ | ||
params: data.params, | ||
minimumWidth: data.minimumWidth, | ||
maximumWidth: data.maximumWidth, | ||
minimumHeight: data.minimumHeight, | ||
maximumHeight: data.maximumHeight, | ||
priority: data.priority, | ||
snap: !!data.snap, | ||
accessor: _this, | ||
isVisible: node.visible, | ||
}); | ||
}); | ||
}); | ||
_this._onDidAddGroup.fire(view); | ||
_this.registerPanel(view); | ||
return view; | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
queue.forEach(function (f) { return f(); }); | ||
if (typeof activePanel === 'string') { | ||
var panel = this.getPanel(activePanel); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
_this._onDidAddGroup.fire(view); | ||
_this.registerPanel(view); | ||
return view; | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
queue_1.forEach(function (f) { return f(); }); | ||
if (typeof activePanel === 'string') { | ||
var panel = this.getPanel(activePanel); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
} | ||
} | ||
} | ||
catch (err) { | ||
try { | ||
/** | ||
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about | ||
* the underlying HTMLElement existing in the Gridview. | ||
*/ | ||
for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var group = _c.value; | ||
group.dispose(); | ||
this._groups.delete(group.id); | ||
this._onDidRemoveGroup.fire(group); | ||
} | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
finally { | ||
try { | ||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
// fires clean-up events and clears the underlying HTML gridview. | ||
this.clear(); | ||
/** | ||
* even though we have cleaned-up we still want to inform the caller of their error | ||
* and we'll do this through re-throwing the original error since afterall you would | ||
* expect trying to load a corrupted layout to result in an error and not silently fail... | ||
*/ | ||
throw err; | ||
} | ||
this._onDidLayoutfromJSON.fire(); | ||
}; | ||
GridviewComponent.prototype.clear = function () { | ||
var e_1, _a; | ||
var e_2, _a; | ||
var hasActiveGroup = this.activeGroup; | ||
@@ -204,3 +236,3 @@ var groups = Array.from(this._groups.values()); // reassign since group panels will mutate | ||
} | ||
catch (e_1_1) { e_1 = { error: e_1_1 }; } | ||
catch (e_2_1) { e_2 = { error: e_2_1 }; } | ||
finally { | ||
@@ -210,3 +242,3 @@ try { | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
finally { if (e_2) throw e_2.error; } | ||
} | ||
@@ -213,0 +245,0 @@ if (hasActiveGroup) { |
@@ -19,2 +19,3 @@ export * from './dnd/dataTransfer'; | ||
export * from './dockview/components/tab/tab'; | ||
export { TabDragEvent, GroupDragEvent, } from './dockview/components/titlebar/tabsContainer'; | ||
export * from './dockview/types'; | ||
@@ -21,0 +22,0 @@ export * from './dockview/dockviewGroupPanel'; |
@@ -42,2 +42,10 @@ "use strict"; | ||
} | ||
if (!document.body.contains(_this._element)) { | ||
/** | ||
* since the event is dispatched through requestAnimationFrame there is a small chance | ||
* the component is no longer attached to the DOM, if that is the case the dimensions | ||
* are mostly likely all zero and meaningless. we should skip this case. | ||
*/ | ||
return; | ||
} | ||
var _a = entry.contentRect, width = _a.width, height = _a.height; | ||
@@ -44,0 +52,0 @@ _this.layout(width, height); |
@@ -386,2 +386,3 @@ "use strict"; | ||
Splitview.prototype.onDidChange = function (item, size) { | ||
var _this = this; | ||
var index = this.viewItems.indexOf(item); | ||
@@ -394,3 +395,12 @@ if (index < 0 || index >= this.viewItems.length) { | ||
item.size = size; | ||
this.relayout([index]); | ||
var indexes = (0, math_1.range)(this.viewItems.length).filter(function (i) { return i !== index; }); | ||
var lowPriorityIndexes = __spreadArray(__spreadArray([], __read(indexes.filter(function (i) { return _this.viewItems[i].priority === LayoutPriority.Low; })), false), [ | ||
index, | ||
], false); | ||
var highPriorityIndexes = indexes.filter(function (i) { return _this.viewItems[i].priority === LayoutPriority.High; }); | ||
/** | ||
* add this view we are changing to the low-index list since we have determined the size | ||
* here and don't want it changed | ||
*/ | ||
this.relayout(__spreadArray(__spreadArray([], __read(lowPriorityIndexes), false), [index], false), highPriorityIndexes); | ||
}; | ||
@@ -397,0 +407,0 @@ Splitview.prototype.addView = function (view, size, index, skipLayout) { |
@@ -36,2 +36,3 @@ import { IDisposable, CompositeDisposable } from '../../../lifecycle'; | ||
setLeftActionsElement(element: HTMLElement | undefined): void; | ||
setPrefixActionsElement(element: HTMLElement | undefined): void; | ||
show(): void; | ||
@@ -47,2 +48,3 @@ hide(): void; | ||
private readonly leftActionsContainer; | ||
private readonly preActionsContainer; | ||
private readonly voidContainer; | ||
@@ -53,2 +55,3 @@ private tabs; | ||
private leftActions; | ||
private preActions; | ||
private _hidden; | ||
@@ -69,2 +72,3 @@ private readonly _onDrop; | ||
setLeftActionsElement(element: HTMLElement | undefined): void; | ||
setPrefixActionsElement(element: HTMLElement | undefined): void; | ||
get element(): HTMLElement; | ||
@@ -71,0 +75,0 @@ isActive(tab: ITab): boolean; |
@@ -54,2 +54,15 @@ import { CompositeDisposable, } from '../../../lifecycle'; | ||
} | ||
setPrefixActionsElement(element) { | ||
if (this.preActions === element) { | ||
return; | ||
} | ||
if (this.preActions) { | ||
this.preActions.remove(); | ||
this.preActions = undefined; | ||
} | ||
if (element) { | ||
this.preActionsContainer.appendChild(element); | ||
this.preActions = element; | ||
} | ||
} | ||
get element() { | ||
@@ -95,5 +108,8 @@ return this._element; | ||
this.leftActionsContainer.className = 'left-actions-container'; | ||
this.preActionsContainer = document.createElement('div'); | ||
this.preActionsContainer.className = 'pre-actions-container'; | ||
this.tabContainer = document.createElement('div'); | ||
this.tabContainer.className = 'tabs-container'; | ||
this.voidContainer = new VoidContainer(this.accessor, this.group); | ||
this._element.appendChild(this.preActionsContainer); | ||
this._element.appendChild(this.tabContainer); | ||
@@ -100,0 +116,0 @@ this._element.appendChild(this.leftActionsContainer); |
@@ -43,3 +43,3 @@ import { SerializedGridObject } from '../gridview/gridview'; | ||
} | ||
export type DockviewComponentUpdateOptions = Pick<DockviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents' | 'tabComponents' | 'frameworkTabComponents' | 'showDndOverlay' | 'watermarkFrameworkComponent' | 'defaultTabComponent' | 'createLeftHeaderActionsElement' | 'createRightHeaderActionsElement' | 'disableFloatingGroups' | 'floatingGroupBounds'>; | ||
export type DockviewComponentUpdateOptions = Pick<DockviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents' | 'tabComponents' | 'frameworkTabComponents' | 'showDndOverlay' | 'watermarkFrameworkComponent' | 'defaultTabComponent' | 'createLeftHeaderActionsElement' | 'createRightHeaderActionsElement' | 'createPrefixHeaderActionsElement' | 'disableFloatingGroups' | 'floatingGroupBounds'>; | ||
export interface DockviewDropEvent extends GroupviewDropEvent { | ||
@@ -46,0 +46,0 @@ api: DockviewApi; |
@@ -23,2 +23,62 @@ import { getRelativeLocation, getGridLocation, } from '../gridview/gridview'; | ||
const DEFAULT_FLOATING_GROUP_OVERFLOW_SIZE = 100; | ||
function typeValidate3(data, path) { | ||
if (typeof data.id !== 'string') { | ||
throw new Error(`${path}.id must be a string`); | ||
} | ||
if (typeof data.activeView !== 'string' || | ||
typeof data.activeView !== 'undefined') { | ||
throw new Error(`${path}.activeView must be a string of undefined`); | ||
} | ||
} | ||
function typeValidate2(data, path) { | ||
if (typeof data.size !== 'number' && typeof data.size !== 'undefined') { | ||
throw new Error(`${path}.size must be a number or undefined`); | ||
} | ||
if (typeof data.visible !== 'boolean' && | ||
typeof data.visible !== 'undefined') { | ||
throw new Error(`${path}.visible must be a boolean or undefined`); | ||
} | ||
if (data.type === 'leaf') { | ||
if (typeof data.data !== 'object' || | ||
data.data === null || | ||
Array.isArray(data.data)) { | ||
throw new Error('object must be a non-null object'); | ||
} | ||
typeValidate3(data.data, `${path}.data`); | ||
} | ||
else if (data.type === 'branch') { | ||
if (!Array.isArray(data.data)) { | ||
throw new Error(`${path}.data must be an array`); | ||
} | ||
} | ||
else { | ||
throw new Error(`${path}.type must be onew of {'branch', 'leaf'}`); | ||
} | ||
} | ||
function typeValidate(data) { | ||
if (typeof data !== 'object' || data === null) { | ||
throw new Error('object must be a non-null object'); | ||
} | ||
const { grid, panels, activeGroup, floatingGroups } = data; | ||
if (typeof grid !== 'object' || grid === null) { | ||
throw new Error("'.grid' must be a non-null object"); | ||
} | ||
if (typeof grid.height !== 'number') { | ||
throw new Error("'.grid.height' must be a number"); | ||
} | ||
if (typeof grid.width !== 'number') { | ||
throw new Error("'.grid.width' must be a number"); | ||
} | ||
if (typeof grid.root !== 'object' || grid.root === null) { | ||
throw new Error("'.grid.root' must be a non-null object"); | ||
} | ||
if (grid.root.type !== 'branch') { | ||
throw new Error(".grid.root.type must be of type 'branch'"); | ||
} | ||
if (grid.orientation !== Orientation.HORIZONTAL && | ||
grid.orientation !== Orientation.VERTICAL) { | ||
throw new Error(`'.grid.width' must be one of {${Orientation.HORIZONTAL}, ${Orientation.VERTICAL}}`); | ||
} | ||
typeValidate2(grid.root, '.grid.root'); | ||
} | ||
export class DockviewComponent extends BaseGrid { | ||
@@ -372,2 +432,5 @@ get orientation() { | ||
this.clear(); | ||
if (typeof data !== 'object' || data === null) { | ||
throw new Error('serialized layout must be a non-null object'); | ||
} | ||
const { grid, panels, activeGroup } = data; | ||
@@ -377,53 +440,103 @@ if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) { | ||
} | ||
// take note of the existing dimensions | ||
const width = this.width; | ||
const height = this.height; | ||
const createGroupFromSerializedState = (data) => { | ||
const { id, locked, hideHeader, views, activeView } = data; | ||
const group = this.createGroup({ | ||
id, | ||
locked: !!locked, | ||
hideHeader: !!hideHeader, | ||
try { | ||
// take note of the existing dimensions | ||
const width = this.width; | ||
const height = this.height; | ||
const createGroupFromSerializedState = (data) => { | ||
const { id, locked, hideHeader, views, activeView } = data; | ||
if (typeof id !== 'string') { | ||
throw new Error('group id must be of type string'); | ||
} | ||
const group = this.createGroup({ | ||
id, | ||
locked: !!locked, | ||
hideHeader: !!hideHeader, | ||
}); | ||
const createdPanels = []; | ||
for (const child of views) { | ||
/** | ||
* Run the deserializer step seperately since this may fail to due corrupted external state. | ||
* In running this section first we avoid firing lots of 'add' events in the event of a failure | ||
* due to a corruption of input data. | ||
*/ | ||
const panel = this._deserializer.fromJSON(panels[child], group); | ||
createdPanels.push(panel); | ||
} | ||
this._onDidAddGroup.fire(group); | ||
for (let i = 0; i < views.length; i++) { | ||
const panel = createdPanels[i]; | ||
const isActive = typeof activeView === 'string' && | ||
activeView === panel.id; | ||
group.model.openPanel(panel, { | ||
skipSetPanelActive: !isActive, | ||
skipSetGroupActive: true, | ||
}); | ||
} | ||
if (!group.activePanel && group.panels.length > 0) { | ||
group.model.openPanel(group.panels[group.panels.length - 1], { | ||
skipSetGroupActive: true, | ||
}); | ||
} | ||
return group; | ||
}; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: (node) => { | ||
return createGroupFromSerializedState(node.data); | ||
}, | ||
}); | ||
this._onDidAddGroup.fire(group); | ||
for (const child of views) { | ||
const panel = this._deserializer.fromJSON(panels[child], group); | ||
const isActive = typeof activeView === 'string' && activeView === panel.id; | ||
group.model.openPanel(panel, { | ||
skipSetPanelActive: !isActive, | ||
skipSetGroupActive: true, | ||
}); | ||
this.layout(width, height, true); | ||
const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : []; | ||
for (const serializedFloatingGroup of serializedFloatingGroups) { | ||
const { data, position } = serializedFloatingGroup; | ||
const group = createGroupFromSerializedState(data); | ||
this.addFloatingGroup(group, { | ||
x: position.left, | ||
y: position.top, | ||
height: position.height, | ||
width: position.width, | ||
}, { skipRemoveGroup: true, inDragMode: false }); | ||
} | ||
if (!group.activePanel && group.panels.length > 0) { | ||
group.model.openPanel(group.panels[group.panels.length - 1], { | ||
skipSetGroupActive: true, | ||
}); | ||
for (const floatingGroup of this.floatingGroups) { | ||
floatingGroup.overlay.setBounds(); | ||
} | ||
return group; | ||
}; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: (node) => { | ||
return createGroupFromSerializedState(node.data); | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : []; | ||
for (const serializedFloatingGroup of serializedFloatingGroups) { | ||
const { data, position } = serializedFloatingGroup; | ||
const group = createGroupFromSerializedState(data); | ||
this.addFloatingGroup(group, { | ||
x: position.left, | ||
y: position.top, | ||
height: position.height, | ||
width: position.width, | ||
}, { skipRemoveGroup: true, inDragMode: false }); | ||
if (typeof activeGroup === 'string') { | ||
const panel = this.getPanel(activeGroup); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
} | ||
} | ||
} | ||
for (const floatingGroup of this.floatingGroups) { | ||
floatingGroup.overlay.setBounds(); | ||
} | ||
if (typeof activeGroup === 'string') { | ||
const panel = this.getPanel(activeGroup); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
catch (err) { | ||
/** | ||
* Takes all the successfully created groups and remove all of their panels. | ||
*/ | ||
for (const group of this.groups) { | ||
for (const panel of group.panels) { | ||
this.removePanel(panel, { | ||
removeEmptyGroup: false, | ||
skipDispose: false, | ||
}); | ||
} | ||
} | ||
/** | ||
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about | ||
* the underlying HTMLElement existing in the Gridview. | ||
*/ | ||
for (const group of this.groups) { | ||
group.dispose(); | ||
this._groups.delete(group.id); | ||
this._onDidRemoveGroup.fire(group); | ||
} | ||
// iterate over a reassigned array since original array will be modified | ||
for (const floatingGroup of [...this.floatingGroups]) { | ||
floatingGroup.dispose(); | ||
} | ||
// fires clean-up events and clears the underlying HTML gridview. | ||
this.clear(); | ||
/** | ||
* even though we have cleaned-up we still want to inform the caller of their error | ||
* and we'll do this through re-throwing the original error since afterall you would | ||
* expect trying to load a corrupted layout to result in an error and not silently fail... | ||
*/ | ||
throw err; | ||
} | ||
@@ -642,2 +755,3 @@ this._onDidLayoutFromJSON.fire(); | ||
this._groups.delete(group.id); | ||
// TODO: fire group removed event? | ||
} | ||
@@ -644,0 +758,0 @@ floatingGroup.dispose(); |
@@ -111,2 +111,3 @@ import { PanelTransfer } from '../dnd/dataTransfer'; | ||
private _leftHeaderActions; | ||
private _prefixHeaderActions; | ||
private mostRecentlyUsed; | ||
@@ -113,0 +114,0 @@ private readonly _onDidChange; |
@@ -171,2 +171,12 @@ import { DockviewApi } from '../api/component.api'; | ||
} | ||
if (this.accessor.options.createPrefixHeaderActionsElement) { | ||
this._prefixHeaderActions = | ||
this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel); | ||
this.addDisposables(this._prefixHeaderActions); | ||
this._prefixHeaderActions.init({ | ||
containerApi: new DockviewApi(this.accessor), | ||
api: this.groupPanel.api, | ||
}); | ||
this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element); | ||
} | ||
} | ||
@@ -173,0 +183,0 @@ indexOf(panel) { |
@@ -70,2 +70,3 @@ import { DockviewApi } from '../api/component.api'; | ||
createLeftHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer; | ||
createPrefixHeaderActionsElement?: (group: DockviewGroupPanel) => IHeaderActionsRenderer; | ||
singleTabMode?: 'fullwidth' | 'default'; | ||
@@ -72,0 +73,0 @@ parentElement?: HTMLElement; |
@@ -52,3 +52,3 @@ import { Emitter, Event, TickDelayedEvent } from '../events'; | ||
readonly onDidLayoutChange: Event<void>; | ||
private readonly _onDidRemoveGroup; | ||
protected readonly _onDidRemoveGroup: Emitter<T>; | ||
readonly onDidRemoveGroup: Event<T>; | ||
@@ -55,0 +55,0 @@ protected readonly _onDidAddGroup: Emitter<T>; |
@@ -115,2 +115,3 @@ /*--------------------------------------------------------------------------------------------- | ||
proportionalLayout, | ||
styles, | ||
}); | ||
@@ -117,0 +118,0 @@ } |
@@ -415,2 +415,10 @@ /*--------------------------------------------------------------------------------------------- | ||
} | ||
/** | ||
* clean down the branch node since we need to dipose of it and | ||
* when .dispose() it called on a branch it will dispose of any | ||
* views it is holding onto. | ||
*/ | ||
while (sibling.children.length > 0) { | ||
sibling.removeChild(0); | ||
} | ||
} | ||
@@ -417,0 +425,0 @@ else { |
@@ -80,39 +80,60 @@ import { getRelativeLocation, getGridLocation, } from './gridview'; | ||
const { grid, activePanel } = serializedGridview; | ||
const queue = []; | ||
// take note of the existing dimensions | ||
const width = this.width; | ||
const height = this.height; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: (node) => { | ||
const { data } = node; | ||
const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory | ||
? { | ||
createComponent: this.options.frameworkComponentFactory | ||
.createComponent, | ||
} | ||
: undefined); | ||
queue.push(() => view.init({ | ||
params: data.params, | ||
minimumWidth: data.minimumWidth, | ||
maximumWidth: data.maximumWidth, | ||
minimumHeight: data.minimumHeight, | ||
maximumHeight: data.maximumHeight, | ||
priority: data.priority, | ||
snap: !!data.snap, | ||
accessor: this, | ||
isVisible: node.visible, | ||
})); | ||
this._onDidAddGroup.fire(view); | ||
this.registerPanel(view); | ||
return view; | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
queue.forEach((f) => f()); | ||
if (typeof activePanel === 'string') { | ||
const panel = this.getPanel(activePanel); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
try { | ||
const queue = []; | ||
// take note of the existing dimensions | ||
const width = this.width; | ||
const height = this.height; | ||
this.gridview.deserialize(grid, { | ||
fromJSON: (node) => { | ||
const { data } = node; | ||
const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory | ||
? { | ||
createComponent: this.options.frameworkComponentFactory | ||
.createComponent, | ||
} | ||
: undefined); | ||
queue.push(() => view.init({ | ||
params: data.params, | ||
minimumWidth: data.minimumWidth, | ||
maximumWidth: data.maximumWidth, | ||
minimumHeight: data.minimumHeight, | ||
maximumHeight: data.maximumHeight, | ||
priority: data.priority, | ||
snap: !!data.snap, | ||
accessor: this, | ||
isVisible: node.visible, | ||
})); | ||
this._onDidAddGroup.fire(view); | ||
this.registerPanel(view); | ||
return view; | ||
}, | ||
}); | ||
this.layout(width, height, true); | ||
queue.forEach((f) => f()); | ||
if (typeof activePanel === 'string') { | ||
const panel = this.getPanel(activePanel); | ||
if (panel) { | ||
this.doSetGroupActive(panel); | ||
} | ||
} | ||
} | ||
catch (err) { | ||
/** | ||
* To remove a group we cannot call this.removeGroup(...) since this makes assumptions about | ||
* the underlying HTMLElement existing in the Gridview. | ||
*/ | ||
for (const group of this.groups) { | ||
group.dispose(); | ||
this._groups.delete(group.id); | ||
this._onDidRemoveGroup.fire(group); | ||
} | ||
// fires clean-up events and clears the underlying HTML gridview. | ||
this.clear(); | ||
/** | ||
* even though we have cleaned-up we still want to inform the caller of their error | ||
* and we'll do this through re-throwing the original error since afterall you would | ||
* expect trying to load a corrupted layout to result in an error and not silently fail... | ||
*/ | ||
throw err; | ||
} | ||
this._onDidLayoutfromJSON.fire(); | ||
@@ -119,0 +140,0 @@ } |
@@ -19,2 +19,3 @@ export * from './dnd/dataTransfer'; | ||
export * from './dockview/components/tab/tab'; | ||
export { TabDragEvent, GroupDragEvent, } from './dockview/components/titlebar/tabsContainer'; | ||
export * from './dockview/types'; | ||
@@ -21,0 +22,0 @@ export * from './dockview/dockviewGroupPanel'; |
@@ -26,2 +26,10 @@ import { watchElementResize } from './dom'; | ||
} | ||
if (!document.body.contains(this._element)) { | ||
/** | ||
* since the event is dispatched through requestAnimationFrame there is a small chance | ||
* the component is no longer attached to the DOM, if that is the case the dimensions | ||
* are mostly likely all zero and meaningless. we should skip this case. | ||
*/ | ||
return; | ||
} | ||
const { width, height } = entry.contentRect; | ||
@@ -28,0 +36,0 @@ this.layout(width, height); |
@@ -293,3 +293,13 @@ /*--------------------------------------------------------------------------------------------- | ||
item.size = size; | ||
this.relayout([index]); | ||
const indexes = range(this.viewItems.length).filter((i) => i !== index); | ||
const lowPriorityIndexes = [ | ||
...indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.Low), | ||
index, | ||
]; | ||
const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === LayoutPriority.High); | ||
/** | ||
* add this view we are changing to the low-index list since we have determined the size | ||
* here and don't want it changed | ||
*/ | ||
this.relayout([...lowPriorityIndexes, index], highPriorityIndexes); | ||
} | ||
@@ -296,0 +306,0 @@ addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) { |
{ | ||
"name": "dockview-core", | ||
"version": "1.8.3", | ||
"version": "1.8.4", | ||
"description": "Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support", | ||
@@ -65,6 +65,5 @@ "main": "./dist/cjs/index.js", | ||
"rollup": "^3.15.0", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"typedoc": "^0.23.25" | ||
"rollup-plugin-postcss": "^4.0.2" | ||
}, | ||
"gitHead": "4ad5b0ffe46d7d7f17a6ed97eb5715c5e603962b" | ||
"gitHead": "47f78ad649ef2c7b31b72fc3255eb99855c67f58" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6976641
7
72586