dockview 1.8.3 → 1.8.4

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.
@@ -31,6 +31,7 @@ export interface IDockviewReactProps {
31
31
  defaultTabComponent?: React.FunctionComponent<IDockviewPanelHeaderProps>;
32
32
  rightHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
33
33
  leftHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
34
+ prefixHeaderActionsComponent?: React.FunctionComponent<IDockviewHeaderActionsProps>;
34
35
  singleTabMode?: 'fullwidth' | 'default';
35
36
  disableFloatingGroups?: boolean;
36
37
  floatingGroupBounds?: 'boundedWithinViewport' | {
@@ -1 +1 @@
1
- {"version":3,"file":"dockview.d.ts","sourceRoot":"","sources":["../../../src/dockview/dockview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEH,iBAAiB,EACjB,uBAAuB,EAEvB,gBAAgB,EAChB,WAAW,EAKd,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,oBAAoB,EAAsB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EACH,2BAA2B,EAE9B,MAAM,yBAAyB,CAAC;AAiBjC,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,GAAG,CAC1E,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC1B,GAAG,EAAE,gBAAgB,CAAC;IACtB,YAAY,EAAE,WAAW,CAAC;CAC7B;AAED,MAAM,MAAM,yBAAyB,CACjC,CAAC,SAAS;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,GAAG,IACxC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAE5B,MAAM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EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;IACzE,2BAA2B,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;IACnF,0BAA0B,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;IAClF,4BAA4B,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,2BAA2B,CAAC,CAAC;IACpF,aAAa,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mBAAmB,CAAC,EACd,uBAAuB,GACvB;QACI,2BAA2B,CAAC,EAAE,MAAM,CAAC;QACrC,0BAA0B,CAAC,EAAE,MAAM,CAAC;KACvC,CAAC;CACX;AAID,eAAO,MAAM,aAAa,4FAwPzB,CAAC"}
@@ -109,6 +109,7 @@ exports.DockviewReact = React.forwardRef(function (props, ref) {
109
109
  showDndOverlay: props.showDndOverlay,
110
110
  createLeftHeaderActionsElement: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal: addPortal }),
111
111
  createRightHeaderActionsElement: createGroupControlElement(props.rightHeaderActionsComponent, { addPortal: addPortal }),
112
+ createPrefixHeaderActionsElement: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal: addPortal }),
112
113
  singleTabMode: props.singleTabMode,
113
114
  disableFloatingGroups: props.disableFloatingGroups,
114
115
  floatingGroupBounds: props.floatingGroupBounds,
@@ -218,6 +219,14 @@ exports.DockviewReact = React.forwardRef(function (props, ref) {
218
219
  createLeftHeaderActionsElement: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal: addPortal }),
219
220
  });
220
221
  }, [props.leftHeaderActionsComponent]);
222
+ React.useEffect(function () {
223
+ if (!dockviewRef.current) {
224
+ return;
225
+ }
226
+ dockviewRef.current.updateOptions({
227
+ createPrefixHeaderActionsElement: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal: addPortal }),
228
+ });
229
+ }, [props.prefixHeaderActionsComponent]);
221
230
  return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
222
231
  });
223
232
  exports.DockviewReact.displayName = 'DockviewComponent';
@@ -1 +1 @@
1
- {"version":3,"file":"dockview.js","sourceRoot":"","sources":["../../../src/dockview/dockview.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,+CAWuB;AACvB,uDAA2D;AAC3D,qDAAyD;AAEzD,kCAAiE;AACjE,2DAAgF;AAEhF,iEAGiC;AAEjC,SAAS,yBAAyB,CAC9B,SAA2E,EAC3E,KAAuB;IAEvB,OAAO,SAAS;QACZ,CAAC,CAAC,UAAC,UAA8B;YAC3B,OAAO,IAAI,sDAA8B,CACrC,SAAS,EACT,KAAK,EACL,UAAU,CACb,CAAC;QACN,CAAC;QACH,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC;AA0CD,IAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAEzC,QAAA,aAAa,GAAG,KAAK,CAAC,UAAU,CACzC,UAAC,KAA0B,EAAE,GAAuC;IAChE,IAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,IAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAqB,CAAC;IAChD,IAAA,KAAA,OAAuB,IAAA,2BAAmB,GAAE,IAAA,EAA3C,OAAO,QAAA,EAAE,SAAS,QAAyB,CAAC;IAEnD,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,c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BAA+B,EAAE,yBAAyB,CACtD,KAAK,CAAC,2BAA2B,EACjC,EAAE,SAAS,WAAA,EAAE,CAChB;SACJ,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;IAExC,KAAK,CAAC,SAAS,CAAC;QACZ,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YACtB,OAAO;SACV;QACD,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC;YAC9B,8BAA8B,EAAE,yBAAyB,CACrD,KAAK,CAAC,0BAA0B,EAChC,EAAE,SAAS,WAAA,EAAE,CAChB;SACJ,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEvC,KAAK,CAAC,SAAS,CAAC;QACZ,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YACtB,OAAO;SACV;QACD,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC;YAC9B,gCAAgC,EAAE,yBAAyB,CACvD,KAAK,CAAC,4BAA4B,EAClC,EAAE,SAAS,WAAA,EAAE,CAChB;SACJ,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAEzC,OAAO,CACH,6BACI,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EACxC,GAAG,EAAE,MAAM,IAEV,OAAO,CACN,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AACF,qBAAa,CAAC,WAAW,GAAG,mBAAmB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * dockview
3
- * @version 1.8.3
3
+ * @version 1.8.4
4
4
  * @link https://github.com/mathuo/dockview
5
5
  * @license MIT
6
6
  */
@@ -918,7 +918,17 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
918
918
  size = typeof size === 'number' ? size : item.size;
919
919
  size = clamp(size, item.minimumSize, item.maximumSize);
920
920
  item.size = size;
921
- this.relayout([index]);
921
+ const indexes = range(this.viewItems.length).filter((i) => i !== index);
922
+ const lowPriorityIndexes = [
923
+ ...indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.Low),
924
+ index,
925
+ ];
926
+ const highPriorityIndexes = indexes.filter((i) => this.viewItems[i].priority === exports.LayoutPriority.High);
927
+ /**
928
+ * add this view we are changing to the low-index list since we have determined the size
929
+ * here and don't want it changed
930
+ */
931
+ this.relayout([...lowPriorityIndexes, index], highPriorityIndexes);
922
932
  }
923
933
  addView(view, size = { type: 'distribute' }, index = this.viewItems.length, skipLayout) {
924
934
  const container = document.createElement('div');
@@ -1675,6 +1685,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
1675
1685
  orientation: this.orientation,
1676
1686
  descriptor,
1677
1687
  proportionalLayout,
1688
+ styles,
1678
1689
  });
1679
1690
  }
1680
1691
  this.addDisposables(this._onDidChange, this.splitview.onDidSashEnd(() => {
@@ -2186,6 +2197,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
2186
2197
  const child = sibling.children[i];
2187
2198
  grandParent.addChild(child, child.size, parentIndex + i);
2188
2199
  }
2200
+ /**
2201
+ * clean down the branch node since we need to dipose of it and
2202
+ * when .dispose() it called on a branch it will dispose of any
2203
+ * views it is holding onto.
2204
+ */
2205
+ while (sibling.children.length > 0) {
2206
+ sibling.removeChild(0);
2207
+ }
2189
2208
  }
2190
2209
  else {
2191
2210
  // otherwise create a new leaf node and add that to the grandparent
@@ -3244,6 +3263,19 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3244
3263
  this.leftActions = element;
3245
3264
  }
3246
3265
  }
3266
+ setPrefixActionsElement(element) {
3267
+ if (this.preActions === element) {
3268
+ return;
3269
+ }
3270
+ if (this.preActions) {
3271
+ this.preActions.remove();
3272
+ this.preActions = undefined;
3273
+ }
3274
+ if (element) {
3275
+ this.preActionsContainer.appendChild(element);
3276
+ this.preActions = element;
3277
+ }
3278
+ }
3247
3279
  get element() {
3248
3280
  return this._element;
3249
3281
  }
@@ -3284,9 +3316,12 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3284
3316
  this.rightActionsContainer.className = 'right-actions-container';
3285
3317
  this.leftActionsContainer = document.createElement('div');
3286
3318
  this.leftActionsContainer.className = 'left-actions-container';
3319
+ this.preActionsContainer = document.createElement('div');
3320
+ this.preActionsContainer.className = 'pre-actions-container';
3287
3321
  this.tabContainer = document.createElement('div');
3288
3322
  this.tabContainer.className = 'tabs-container';
3289
3323
  this.voidContainer = new VoidContainer(this.accessor, this.group);
3324
+ this._element.appendChild(this.preActionsContainer);
3290
3325
  this._element.appendChild(this.tabContainer);
3291
3326
  this._element.appendChild(this.leftActionsContainer);
3292
3327
  this._element.appendChild(this.voidContainer.element);
@@ -3576,6 +3611,16 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3576
3611
  });
3577
3612
  this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element);
3578
3613
  }
3614
+ if (this.accessor.options.createPrefixHeaderActionsElement) {
3615
+ this._prefixHeaderActions =
3616
+ this.accessor.options.createPrefixHeaderActionsElement(this.groupPanel);
3617
+ this.addDisposables(this._prefixHeaderActions);
3618
+ this._prefixHeaderActions.init({
3619
+ containerApi: new DockviewApi(this.accessor),
3620
+ api: this.groupPanel.api,
3621
+ });
3622
+ this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element);
3623
+ }
3579
3624
  }
3580
3625
  indexOf(panel) {
3581
3626
  return this.tabsContainer.indexOf(panel.id);
@@ -3918,6 +3963,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
3918
3963
  */
3919
3964
  return;
3920
3965
  }
3966
+ if (!document.body.contains(this._element)) {
3967
+ /**
3968
+ * since the event is dispatched through requestAnimationFrame there is a small chance
3969
+ * the component is no longer attached to the DOM, if that is the case the dimensions
3970
+ * are mostly likely all zero and meaningless. we should skip this case.
3971
+ */
3972
+ return;
3973
+ }
3921
3974
  const { width, height } = entry.contentRect;
3922
3975
  this.layout(width, height);
3923
3976
  }));
@@ -5946,61 +5999,114 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
5946
5999
  fromJSON(data) {
5947
6000
  var _a;
5948
6001
  this.clear();
6002
+ if (typeof data !== 'object' || data === null) {
6003
+ throw new Error('serialized layout must be a non-null object');
6004
+ }
5949
6005
  const { grid, panels, activeGroup } = data;
5950
6006
  if (grid.root.type !== 'branch' || !Array.isArray(grid.root.data)) {
5951
6007
  throw new Error('root must be of type branch');
5952
6008
  }
5953
- // take note of the existing dimensions
5954
- const width = this.width;
5955
- const height = this.height;
5956
- const createGroupFromSerializedState = (data) => {
5957
- const { id, locked, hideHeader, views, activeView } = data;
5958
- const group = this.createGroup({
5959
- id,
5960
- locked: !!locked,
5961
- hideHeader: !!hideHeader,
5962
- });
5963
- this._onDidAddGroup.fire(group);
5964
- for (const child of views) {
5965
- const panel = this._deserializer.fromJSON(panels[child], group);
5966
- const isActive = typeof activeView === 'string' && activeView === panel.id;
5967
- group.model.openPanel(panel, {
5968
- skipSetPanelActive: !isActive,
5969
- skipSetGroupActive: true,
6009
+ try {
6010
+ // take note of the existing dimensions
6011
+ const width = this.width;
6012
+ const height = this.height;
6013
+ const createGroupFromSerializedState = (data) => {
6014
+ const { id, locked, hideHeader, views, activeView } = data;
6015
+ if (typeof id !== 'string') {
6016
+ throw new Error('group id must be of type string');
6017
+ }
6018
+ const group = this.createGroup({
6019
+ id,
6020
+ locked: !!locked,
6021
+ hideHeader: !!hideHeader,
5970
6022
  });
6023
+ const createdPanels = [];
6024
+ for (const child of views) {
6025
+ /**
6026
+ * Run the deserializer step seperately since this may fail to due corrupted external state.
6027
+ * In running this section first we avoid firing lots of 'add' events in the event of a failure
6028
+ * due to a corruption of input data.
6029
+ */
6030
+ const panel = this._deserializer.fromJSON(panels[child], group);
6031
+ createdPanels.push(panel);
6032
+ }
6033
+ this._onDidAddGroup.fire(group);
6034
+ for (let i = 0; i < views.length; i++) {
6035
+ const panel = createdPanels[i];
6036
+ const isActive = typeof activeView === 'string' &&
6037
+ activeView === panel.id;
6038
+ group.model.openPanel(panel, {
6039
+ skipSetPanelActive: !isActive,
6040
+ skipSetGroupActive: true,
6041
+ });
6042
+ }
6043
+ if (!group.activePanel && group.panels.length > 0) {
6044
+ group.model.openPanel(group.panels[group.panels.length - 1], {
6045
+ skipSetGroupActive: true,
6046
+ });
6047
+ }
6048
+ return group;
6049
+ };
6050
+ this.gridview.deserialize(grid, {
6051
+ fromJSON: (node) => {
6052
+ return createGroupFromSerializedState(node.data);
6053
+ },
6054
+ });
6055
+ this.layout(width, height, true);
6056
+ const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : [];
6057
+ for (const serializedFloatingGroup of serializedFloatingGroups) {
6058
+ const { data, position } = serializedFloatingGroup;
6059
+ const group = createGroupFromSerializedState(data);
6060
+ this.addFloatingGroup(group, {
6061
+ x: position.left,
6062
+ y: position.top,
6063
+ height: position.height,
6064
+ width: position.width,
6065
+ }, { skipRemoveGroup: true, inDragMode: false });
6066
+ }
6067
+ for (const floatingGroup of this.floatingGroups) {
6068
+ floatingGroup.overlay.setBounds();
6069
+ }
6070
+ if (typeof activeGroup === 'string') {
6071
+ const panel = this.getPanel(activeGroup);
6072
+ if (panel) {
6073
+ this.doSetGroupActive(panel);
6074
+ }
5971
6075
  }
5972
- if (!group.activePanel && group.panels.length > 0) {
5973
- group.model.openPanel(group.panels[group.panels.length - 1], {
5974
- skipSetGroupActive: true,
5975
- });
6076
+ }
6077
+ catch (err) {
6078
+ /**
6079
+ * Takes all the successfully created groups and remove all of their panels.
6080
+ */
6081
+ for (const group of this.groups) {
6082
+ for (const panel of group.panels) {
6083
+ this.removePanel(panel, {
6084
+ removeEmptyGroup: false,
6085
+ skipDispose: false,
6086
+ });
6087
+ }
5976
6088
  }
5977
- return group;
5978
- };
5979
- this.gridview.deserialize(grid, {
5980
- fromJSON: (node) => {
5981
- return createGroupFromSerializedState(node.data);
5982
- },
5983
- });
5984
- this.layout(width, height, true);
5985
- const serializedFloatingGroups = (_a = data.floatingGroups) !== null && _a !== void 0 ? _a : [];
5986
- for (const serializedFloatingGroup of serializedFloatingGroups) {
5987
- const { data, position } = serializedFloatingGroup;
5988
- const group = createGroupFromSerializedState(data);
5989
- this.addFloatingGroup(group, {
5990
- x: position.left,
5991
- y: position.top,
5992
- height: position.height,
5993
- width: position.width,
5994
- }, { skipRemoveGroup: true, inDragMode: false });
5995
- }
5996
- for (const floatingGroup of this.floatingGroups) {
5997
- floatingGroup.overlay.setBounds();
5998
- }
5999
- if (typeof activeGroup === 'string') {
6000
- const panel = this.getPanel(activeGroup);
6001
- if (panel) {
6002
- this.doSetGroupActive(panel);
6089
+ /**
6090
+ * To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
6091
+ * the underlying HTMLElement existing in the Gridview.
6092
+ */
6093
+ for (const group of this.groups) {
6094
+ group.dispose();
6095
+ this._groups.delete(group.id);
6096
+ this._onDidRemoveGroup.fire(group);
6003
6097
  }
6098
+ // iterate over a reassigned array since original array will be modified
6099
+ for (const floatingGroup of [...this.floatingGroups]) {
6100
+ floatingGroup.dispose();
6101
+ }
6102
+ // fires clean-up events and clears the underlying HTML gridview.
6103
+ this.clear();
6104
+ /**
6105
+ * even though we have cleaned-up we still want to inform the caller of their error
6106
+ * and we'll do this through re-throwing the original error since afterall you would
6107
+ * expect trying to load a corrupted layout to result in an error and not silently fail...
6108
+ */
6109
+ throw err;
6004
6110
  }
6005
6111
  this._onDidLayoutFromJSON.fire();
6006
6112
  }
@@ -6214,6 +6320,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6214
6320
  if (!(options === null || options === void 0 ? void 0 : options.skipDispose)) {
6215
6321
  floatingGroup.group.dispose();
6216
6322
  this._groups.delete(group.id);
6323
+ // TODO: fire group removed event?
6217
6324
  }
6218
6325
  floatingGroup.dispose();
6219
6326
  return floatingGroup.group;
@@ -6454,43 +6561,64 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
6454
6561
  fromJSON(serializedGridview) {
6455
6562
  this.clear();
6456
6563
  const { grid, activePanel } = serializedGridview;
6457
- const queue = [];
6458
- // take note of the existing dimensions
6459
- const width = this.width;
6460
- const height = this.height;
6461
- this.gridview.deserialize(grid, {
6462
- fromJSON: (node) => {
6463
- const { data } = node;
6464
- const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
6465
- ? {
6466
- createComponent: this.options.frameworkComponentFactory
6467
- .createComponent,
6468
- }
6469
- : undefined);
6470
- queue.push(() => view.init({
6471
- params: data.params,
6472
- minimumWidth: data.minimumWidth,
6473
- maximumWidth: data.maximumWidth,
6474
- minimumHeight: data.minimumHeight,
6475
- maximumHeight: data.maximumHeight,
6476
- priority: data.priority,
6477
- snap: !!data.snap,
6478
- accessor: this,
6479
- isVisible: node.visible,
6480
- }));
6481
- this._onDidAddGroup.fire(view);
6482
- this.registerPanel(view);
6483
- return view;
6484
- },
6485
- });
6486
- this.layout(width, height, true);
6487
- queue.forEach((f) => f());
6488
- if (typeof activePanel === 'string') {
6489
- const panel = this.getPanel(activePanel);
6490
- if (panel) {
6491
- this.doSetGroupActive(panel);
6564
+ try {
6565
+ const queue = [];
6566
+ // take note of the existing dimensions
6567
+ const width = this.width;
6568
+ const height = this.height;
6569
+ this.gridview.deserialize(grid, {
6570
+ fromJSON: (node) => {
6571
+ const { data } = node;
6572
+ const view = createComponent(data.id, data.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
6573
+ ? {
6574
+ createComponent: this.options.frameworkComponentFactory
6575
+ .createComponent,
6576
+ }
6577
+ : undefined);
6578
+ queue.push(() => view.init({
6579
+ params: data.params,
6580
+ minimumWidth: data.minimumWidth,
6581
+ maximumWidth: data.maximumWidth,
6582
+ minimumHeight: data.minimumHeight,
6583
+ maximumHeight: data.maximumHeight,
6584
+ priority: data.priority,
6585
+ snap: !!data.snap,
6586
+ accessor: this,
6587
+ isVisible: node.visible,
6588
+ }));
6589
+ this._onDidAddGroup.fire(view);
6590
+ this.registerPanel(view);
6591
+ return view;
6592
+ },
6593
+ });
6594
+ this.layout(width, height, true);
6595
+ queue.forEach((f) => f());
6596
+ if (typeof activePanel === 'string') {
6597
+ const panel = this.getPanel(activePanel);
6598
+ if (panel) {
6599
+ this.doSetGroupActive(panel);
6600
+ }
6492
6601
  }
6493
6602
  }
6603
+ catch (err) {
6604
+ /**
6605
+ * To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
6606
+ * the underlying HTMLElement existing in the Gridview.
6607
+ */
6608
+ for (const group of this.groups) {
6609
+ group.dispose();
6610
+ this._groups.delete(group.id);
6611
+ this._onDidRemoveGroup.fire(group);
6612
+ }
6613
+ // fires clean-up events and clears the underlying HTML gridview.
6614
+ this.clear();
6615
+ /**
6616
+ * even though we have cleaned-up we still want to inform the caller of their error
6617
+ * and we'll do this through re-throwing the original error since afterall you would
6618
+ * expect trying to load a corrupted layout to result in an error and not silently fail...
6619
+ */
6620
+ throw err;
6621
+ }
6494
6622
  this._onDidLayoutfromJSON.fire();
6495
6623
  }
6496
6624
  clear() {
@@ -7674,6 +7802,7 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7674
7802
  showDndOverlay: props.showDndOverlay,
7675
7803
  createLeftHeaderActionsElement: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal }),
7676
7804
  createRightHeaderActionsElement: createGroupControlElement(props.rightHeaderActionsComponent, { addPortal }),
7805
+ createPrefixHeaderActionsElement: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
7677
7806
  singleTabMode: props.singleTabMode,
7678
7807
  disableFloatingGroups: props.disableFloatingGroups,
7679
7808
  floatingGroupBounds: props.floatingGroupBounds,
@@ -7783,6 +7912,14 @@ define(['exports', 'react', 'react-dom'], (function (exports, React, ReactDOM) {
7783
7912
  createLeftHeaderActionsElement: createGroupControlElement(props.leftHeaderActionsComponent, { addPortal }),
7784
7913
  });
7785
7914
  }, [props.leftHeaderActionsComponent]);
7915
+ React__namespace.useEffect(() => {
7916
+ if (!dockviewRef.current) {
7917
+ return;
7918
+ }
7919
+ dockviewRef.current.updateOptions({
7920
+ createPrefixHeaderActionsElement: createGroupControlElement(props.prefixHeaderActionsComponent, { addPortal }),
7921
+ });
7922
+ }, [props.prefixHeaderActionsComponent]);
7786
7923
  return (React__namespace.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
7787
7924
  });
7788
7925
  DockviewReact.displayName = 'DockviewComponent';